4 * Windows NT Filesystem Driver Developer Kit
6 * This file is part of the w32api package.
9 * Created by Bo Brantén <bosse@acc.umu.se>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28 #pragma GCC system_header
38 #define VER_PRODUCTBUILD 10000
45 #define NTKERNELAPI STDCALL
48 typedef struct _SE_EXPORTS
*PSE_EXPORTS
;
50 extern PUCHAR
*FsRtlLegalAnsiCharacterArray
;
51 extern PSE_EXPORTS SeExports
;
52 extern PACL SePublicDefaultDacl
;
53 extern PACL SeSystemDefaultDacl
;
55 #define ANSI_DOS_STAR ('<')
56 #define ANSI_DOS_QM ('>')
57 #define ANSI_DOS_DOT ('"')
59 #define DOS_STAR (L'<')
61 #define DOS_DOT (L'"')
64 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
65 #define ACCESS_DENIED_ACE_TYPE (0x1)
66 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
67 #define SYSTEM_ALARM_ACE_TYPE (0x3)
69 #define COMPRESSION_FORMAT_NONE (0x0000)
70 #define COMPRESSION_FORMAT_DEFAULT (0x0001)
71 #define COMPRESSION_FORMAT_LZNT1 (0x0002)
72 #define COMPRESSION_ENGINE_STANDARD (0x0000)
73 #define COMPRESSION_ENGINE_MAXIMUM (0x0100)
74 #define COMPRESSION_ENGINE_HIBER (0x0200)
76 #define FILE_ACTION_ADDED 0x00000001
77 #define FILE_ACTION_REMOVED 0x00000002
78 #define FILE_ACTION_MODIFIED 0x00000003
79 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
80 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
81 #define FILE_ACTION_ADDED_STREAM 0x00000006
82 #define FILE_ACTION_REMOVED_STREAM 0x00000007
83 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
84 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
85 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
86 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
89 #define FILE_EA_TYPE_BINARY 0xfffe
90 #define FILE_EA_TYPE_ASCII 0xfffd
91 #define FILE_EA_TYPE_BITMAP 0xfffb
92 #define FILE_EA_TYPE_METAFILE 0xfffa
93 #define FILE_EA_TYPE_ICON 0xfff9
94 #define FILE_EA_TYPE_EA 0xffee
95 #define FILE_EA_TYPE_MVMT 0xffdf
96 #define FILE_EA_TYPE_MVST 0xffde
97 #define FILE_EA_TYPE_ASN1 0xffdd
98 #define FILE_EA_TYPE_FAMILY_IDS 0xff01
100 #define FILE_NEED_EA 0x00000080
102 /* also in winnt.h */
103 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
104 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
105 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
106 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
107 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
108 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
109 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
110 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
111 #define FILE_NOTIFY_CHANGE_EA 0x00000080
112 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
113 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
114 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
115 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
116 #define FILE_NOTIFY_VALID_MASK 0x00000fff
119 #define FILE_OPLOCK_BROKEN_TO_LEVEL_2 0x00000007
120 #define FILE_OPLOCK_BROKEN_TO_NONE 0x00000008
122 #define FILE_OPBATCH_BREAK_UNDERWAY 0x00000009
124 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
125 #define FILE_CASE_PRESERVED_NAMES 0x00000002
126 #define FILE_UNICODE_ON_DISK 0x00000004
127 #define FILE_PERSISTENT_ACLS 0x00000008
128 #define FILE_FILE_COMPRESSION 0x00000010
129 #define FILE_VOLUME_QUOTAS 0x00000020
130 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
131 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
132 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
133 #define FS_LFN_APIS 0x00004000
134 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
135 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
136 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
137 #define FILE_NAMED_STREAMS 0x00040000
139 #define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000
140 #define FILE_PIPE_MESSAGE_TYPE 0x00000001
142 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
143 #define FILE_PIPE_MESSAGE_MODE 0x00000001
145 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
146 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
148 #define FILE_PIPE_INBOUND 0x00000000
149 #define FILE_PIPE_OUTBOUND 0x00000001
150 #define FILE_PIPE_FULL_DUPLEX 0x00000002
152 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
153 #define FILE_PIPE_LISTENING_STATE 0x00000002
154 #define FILE_PIPE_CONNECTED_STATE 0x00000003
155 #define FILE_PIPE_CLOSING_STATE 0x00000004
157 #define FILE_PIPE_CLIENT_END 0x00000000
158 #define FILE_PIPE_SERVER_END 0x00000001
160 #define FILE_PIPE_READ_DATA 0x00000000
161 #define FILE_PIPE_WRITE_SPACE 0x00000001
163 #define FILE_STORAGE_TYPE_SPECIFIED 0x00000041 /* FILE_DIRECTORY_FILE | FILE_NON_DIRECTORY_FILE */
164 #define FILE_STORAGE_TYPE_DEFAULT (StorageTypeDefault << FILE_STORAGE_TYPE_SHIFT)
165 #define FILE_STORAGE_TYPE_DIRECTORY (StorageTypeDirectory << FILE_STORAGE_TYPE_SHIFT)
166 #define FILE_STORAGE_TYPE_FILE (StorageTypeFile << FILE_STORAGE_TYPE_SHIFT)
167 #define FILE_STORAGE_TYPE_DOCFILE (StorageTypeDocfile << FILE_STORAGE_TYPE_SHIFT)
168 #define FILE_STORAGE_TYPE_JUNCTION_POINT (StorageTypeJunctionPoint << FILE_STORAGE_TYPE_SHIFT)
169 #define FILE_STORAGE_TYPE_CATALOG (StorageTypeCatalog << FILE_STORAGE_TYPE_SHIFT)
170 #define FILE_STORAGE_TYPE_STRUCTURED_STORAGE (StorageTypeStructuredStorage << FILE_STORAGE_TYPE_SHIFT)
171 #define FILE_STORAGE_TYPE_EMBEDDING (StorageTypeEmbedding << FILE_STORAGE_TYPE_SHIFT)
172 #define FILE_STORAGE_TYPE_STREAM (StorageTypeStream << FILE_STORAGE_TYPE_SHIFT)
173 #define FILE_MINIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_DEFAULT
174 #define FILE_MAXIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_STREAM
175 #define FILE_STORAGE_TYPE_MASK 0x000f0000
176 #define FILE_STORAGE_TYPE_SHIFT 16
178 #define FILE_VC_QUOTA_NONE 0x00000000
179 #define FILE_VC_QUOTA_TRACK 0x00000001
180 #define FILE_VC_QUOTA_ENFORCE 0x00000002
181 #define FILE_VC_QUOTA_MASK 0x00000003
183 #define FILE_VC_QUOTAS_LOG_VIOLATIONS 0x00000004
184 #define FILE_VC_CONTENT_INDEX_DISABLED 0x00000008
186 #define FILE_VC_LOG_QUOTA_THRESHOLD 0x00000010
187 #define FILE_VC_LOG_QUOTA_LIMIT 0x00000020
188 #define FILE_VC_LOG_VOLUME_THRESHOLD 0x00000040
189 #define FILE_VC_LOG_VOLUME_LIMIT 0x00000080
191 #define FILE_VC_QUOTAS_INCOMPLETE 0x00000100
192 #define FILE_VC_QUOTAS_REBUILDING 0x00000200
194 #define FILE_VC_VALID_MASK 0x000003ff
196 #define FSRTL_FLAG_FILE_MODIFIED (0x01)
197 #define FSRTL_FLAG_FILE_LENGTH_CHANGED (0x02)
198 #define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04)
199 #define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08)
200 #define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10)
201 #define FSRTL_FLAG_USER_MAPPED_FILE (0x20)
202 #define FSRTL_FLAG_EOF_ADVANCE_ACTIVE (0x80)
204 #define FSRTL_FLAG2_DO_MODIFIED_WRITE (0x01)
206 #define FSRTL_FSP_TOP_LEVEL_IRP (0x01)
207 #define FSRTL_CACHE_TOP_LEVEL_IRP (0x02)
208 #define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03)
209 #define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04)
210 #define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04)
212 #define FSRTL_VOLUME_DISMOUNT 1
213 #define FSRTL_VOLUME_DISMOUNT_FAILED 2
214 #define FSRTL_VOLUME_LOCK 3
215 #define FSRTL_VOLUME_LOCK_FAILED 4
216 #define FSRTL_VOLUME_UNLOCK 5
217 #define FSRTL_VOLUME_MOUNT 6
219 #define FSRTL_WILD_CHARACTER 0x08
222 #define HARDWARE_PTE HARDWARE_PTE_X86
223 #define PHARDWARE_PTE PHARDWARE_PTE_X86
225 #define HARDWARE_PTE ULONG
226 #define PHARDWARE_PTE PULONG
229 #define IO_CHECK_CREATE_PARAMETERS 0x0200
230 #define IO_ATTACH_DEVICE 0x0400
232 #define IO_ATTACH_DEVICE_API 0x80000000
233 /* also in winnt.h */
234 #define IO_COMPLETION_QUERY_STATE 0x0001
235 #define IO_COMPLETION_MODIFY_STATE 0x0002
236 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
238 #define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
239 #define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024
241 #define IO_TYPE_APC 18
242 #define IO_TYPE_DPC 19
243 #define IO_TYPE_DEVICE_QUEUE 20
244 #define IO_TYPE_EVENT_PAIR 21
245 #define IO_TYPE_INTERRUPT 22
246 #define IO_TYPE_PROFILE 23
248 #define IRP_BEING_VERIFIED 0x10
250 #define MAILSLOT_CLASS_FIRSTCLASS 1
251 #define MAILSLOT_CLASS_SECONDCLASS 2
253 #define MAILSLOT_SIZE_AUTO 0
255 #define MAP_PROCESS 1L
256 #define MAP_SYSTEM 2L
257 #define MEM_DOS_LIM 0x40000000
258 /* also in winnt.h */
259 #define MEM_IMAGE SEC_IMAGE
261 #define OB_TYPE_TYPE 1
262 #define OB_TYPE_DIRECTORY 2
263 #define OB_TYPE_SYMBOLIC_LINK 3
264 #define OB_TYPE_TOKEN 4
265 #define OB_TYPE_PROCESS 5
266 #define OB_TYPE_THREAD 6
267 #define OB_TYPE_EVENT 7
268 #define OB_TYPE_EVENT_PAIR 8
269 #define OB_TYPE_MUTANT 9
270 #define OB_TYPE_SEMAPHORE 10
271 #define OB_TYPE_TIMER 11
272 #define OB_TYPE_PROFILE 12
273 #define OB_TYPE_WINDOW_STATION 13
274 #define OB_TYPE_DESKTOP 14
275 #define OB_TYPE_SECTION 15
276 #define OB_TYPE_KEY 16
277 #define OB_TYPE_PORT 17
278 #define OB_TYPE_ADAPTER 18
279 #define OB_TYPE_CONTROLLER 19
280 #define OB_TYPE_DEVICE 20
281 #define OB_TYPE_DRIVER 21
282 #define OB_TYPE_IO_COMPLETION 22
283 #define OB_TYPE_FILE 23
286 #define PIN_EXCLUSIVE (2)
287 #define PIN_NO_READ (4)
288 #define PIN_IF_BCB (8)
290 #define PORT_CONNECT 0x0001
291 #define PORT_ALL_ACCESS (STANDARD_RIGHTS_ALL |\
293 /* also in winnt.h */
294 #define SEC_BASED 0x00200000
295 #define SEC_NO_CHANGE 0x00400000
296 #define SEC_FILE 0x00800000
297 #define SEC_IMAGE 0x01000000
298 #define SEC_VLM 0x02000000
299 #define SEC_RESERVE 0x04000000
300 #define SEC_COMMIT 0x08000000
301 #define SEC_NOCACHE 0x10000000
303 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
304 #define SECURITY_WORLD_RID (0x00000000L)
306 #define SID_REVISION 1
308 #define TOKEN_ASSIGN_PRIMARY (0x0001)
309 #define TOKEN_DUPLICATE (0x0002)
310 #define TOKEN_IMPERSONATE (0x0004)
311 #define TOKEN_QUERY (0x0008)
312 #define TOKEN_QUERY_SOURCE (0x0010)
313 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
314 #define TOKEN_ADJUST_GROUPS (0x0040)
315 #define TOKEN_ADJUST_DEFAULT (0x0080)
317 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
318 TOKEN_ASSIGN_PRIMARY |\
322 TOKEN_QUERY_SOURCE |\
323 TOKEN_ADJUST_PRIVILEGES |\
324 TOKEN_ADJUST_GROUPS |\
325 TOKEN_ADJUST_DEFAULT)
327 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
330 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
331 TOKEN_ADJUST_PRIVILEGES |\
332 TOKEN_ADJUST_GROUPS |\
333 TOKEN_ADJUST_DEFAULT)
335 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
337 #define TOKEN_SOURCE_LENGTH 8
340 #define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x01
341 #define TOKEN_HAS_BACKUP_PRIVILEGE 0x02
342 #define TOKEN_HAS_RESTORE_PRIVILEGE 0x04
343 #define TOKEN_HAS_ADMIN_GROUP 0x08
344 #define TOKEN_IS_RESTRICTED 0x10
346 #define VACB_MAPPING_GRANULARITY (0x40000)
347 #define VACB_OFFSET_SHIFT (18)
349 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
350 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
351 #define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
352 #define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
353 #define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
354 #define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
355 #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
356 #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
357 #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
359 #define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
360 #define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
361 #define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
363 #define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
364 #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
365 #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
368 #define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
369 #define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
370 #define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
371 #define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
372 #define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
373 #define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
375 #if (VER_PRODUCTBUILD >= 1381)
377 #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
378 #define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
379 #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS)
380 #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS)
381 #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS)
382 #define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
383 #define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
384 #define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
386 #endif /* (VER_PRODUCTBUILD >= 1381) */
388 #if (VER_PRODUCTBUILD >= 2195)
390 #define FSCTL_READ_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33, METHOD_NEITHER, FILE_ANY_ACCESS)
391 #define FSCTL_WRITE_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34, METHOD_NEITHER, FILE_ANY_ACCESS)
392 #define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
394 #define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37, METHOD_NEITHER, FILE_ANY_ACCESS)
395 #define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
396 #define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
397 #define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA)
398 #define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
399 #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
400 #define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA)
401 #define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA)
402 #define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA)
403 #define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA)
404 #define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA)
405 #define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
406 #define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA)
407 #define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
408 #define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA)
409 #define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
410 #define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
411 #define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS)
412 #define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS)
413 #define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS)
414 #define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA)
415 #define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA)
416 #define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA)
417 #define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
418 #define FSCTL_QUERY_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
419 #define FSCTL_DELETE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
420 #define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
421 #define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
422 #define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
423 #define FSCTL_HSM_MSG CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 66, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
424 #define FSCTL_NSS_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 67, METHOD_BUFFERED, FILE_WRITE_DATA)
425 #define FSCTL_HSM_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 68, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
426 #define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
427 #define FSCTL_NSS_RCONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 70, METHOD_BUFFERED, FILE_READ_DATA)
428 #define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
429 #define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
431 #endif /* (VER_PRODUCTBUILD >= 2195) */
433 #define FSCTL_MAILSLOT_PEEK CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
435 #define FSCTL_NETWORK_SET_CONFIGURATION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
436 #define FSCTL_NETWORK_GET_CONFIGURATION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
437 #define FSCTL_NETWORK_GET_CONNECTION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS)
438 #define FSCTL_NETWORK_ENUMERATE_CONNECTIONS CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS)
439 #define FSCTL_NETWORK_DELETE_CONNECTION CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
440 #define FSCTL_NETWORK_GET_STATISTICS CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS)
441 #define FSCTL_NETWORK_SET_DOMAIN_NAME CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS)
442 #define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS)
444 #define FSCTL_PIPE_ASSIGN_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
445 #define FSCTL_PIPE_DISCONNECT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
446 #define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
447 #define FSCTL_PIPE_PEEK CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
448 #define FSCTL_PIPE_QUERY_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
449 #define FSCTL_PIPE_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
450 #define FSCTL_PIPE_WAIT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
451 #define FSCTL_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
452 #define FSCTL_PIPE_SET_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
453 #define FSCTL_PIPE_QUERY_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
454 #define FSCTL_PIPE_INTERNAL_READ CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
455 #define FSCTL_PIPE_INTERNAL_WRITE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
456 #define FSCTL_PIPE_INTERNAL_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
457 #define FSCTL_PIPE_INTERNAL_READ_OVFLOW CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
459 #define IOCTL_REDIR_QUERY_PATH CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS)
462 typedef PVOID OPLOCK
, *POPLOCK
;
463 typedef PVOID PWOW64_PROCESS
;
465 typedef struct _CACHE_MANAGER_CALLBACKS
*PCACHE_MANAGER_CALLBACKS
;
466 typedef struct _EPROCESS_QUOTA_BLOCK
*PEPROCESS_QUOTA_BLOCK
;
467 typedef struct _FILE_GET_QUOTA_INFORMATION
*PFILE_GET_QUOTA_INFORMATION
;
468 typedef struct _HANDLE_TABLE
*PHANDLE_TABLE
;
469 typedef struct _KEVENT_PAIR
*PKEVENT_PAIR
;
470 typedef struct _KPROCESS
*PKPROCESS
;
471 typedef struct _KQUEUE
*PKQUEUE
;
472 typedef struct _KTRAP_FRAME
*PKTRAP_FRAME
;
473 typedef struct _MAILSLOT_CREATE_PARAMETERS
*PMAILSLOT_CREATE_PARAMETERS
;
474 typedef struct _MMWSL
*PMMWSL
;
475 typedef struct _NAMED_PIPE_CREATE_PARAMETERS
*PNAMED_PIPE_CREATE_PARAMETERS
;
476 typedef struct _OBJECT_DIRECTORY
*POBJECT_DIRECTORY
;
477 typedef struct _PAGEFAULT_HISTORY
*PPAGEFAULT_HISTORY
;
478 typedef struct _PS_IMPERSONATION_INFORMATION
*PPS_IMPERSONATION_INFORMATION
;
479 typedef struct _SECTION_OBJECT
*PSECTION_OBJECT
;
480 typedef struct _SHARED_CACHE_MAP
*PSHARED_CACHE_MAP
;
481 typedef struct _TERMINATION_PORT
*PTERMINATION_PORT
;
482 typedef struct _VACB
*PVACB
;
483 typedef struct _VAD_HEADER
*PVAD_HEADER
;
485 typedef struct _NOTIFY_SYNC
498 } NOTIFY_SYNC
, * PNOTIFY_SYNC
;
500 typedef enum _FAST_IO_POSSIBLE
{
506 typedef enum _FILE_STORAGE_TYPE
{
507 StorageTypeDefault
= 1,
508 StorageTypeDirectory
,
510 StorageTypeJunctionPoint
,
512 StorageTypeStructuredStorage
,
513 StorageTypeEmbedding
,
517 typedef enum _IO_COMPLETION_INFORMATION_CLASS
{
518 IoCompletionBasicInformation
519 } IO_COMPLETION_INFORMATION_CLASS
;
521 typedef enum _OBJECT_INFO_CLASS
{
529 typedef struct _HARDWARE_PTE_X86
{
533 ULONG WriteThrough
: 1;
534 ULONG CacheDisable
: 1;
539 ULONG CopyOnWrite
: 1;
542 ULONG PageFrameNumber
: 20;
543 } HARDWARE_PTE_X86
, *PHARDWARE_PTE_X86
;
545 typedef struct _KAPC_STATE
{
546 LIST_ENTRY ApcListHead
[2];
548 BOOLEAN KernelApcInProgress
;
549 BOOLEAN KernelApcPending
;
550 BOOLEAN UserApcPending
;
551 } KAPC_STATE
, *PKAPC_STATE
;
553 typedef struct _KGDTENTRY
{
570 ULONG Reserved_0
: 1;
571 ULONG Default_Big
: 1;
572 ULONG Granularity
: 1;
576 } KGDTENTRY
, *PKGDTENTRY
;
578 typedef struct _KIDTENTRY
{
582 USHORT ExtendedOffset
;
583 } KIDTENTRY
, *PKIDTENTRY
;
585 #if (VER_PRODUCTBUILD >= 2600)
587 typedef struct _MMSUPPORT_FLAGS
{
588 ULONG SessionSpace
: 1;
589 ULONG BeingTrimmed
: 1;
590 ULONG SessionLeader
: 1;
592 ULONG WorkingSetHard
: 1;
593 ULONG AddressSpaceBeingDeleted
: 1;
594 ULONG Available
: 10;
595 ULONG AllowWorkingSetAdjustment
: 8;
596 ULONG MemoryPriority
: 8;
597 } MMSUPPORT_FLAGS
, *PMMSUPPORT_FLAGS
;
601 typedef struct _MMSUPPORT_FLAGS
{
602 ULONG SessionSpace
: 1;
603 ULONG BeingTrimmed
: 1;
604 ULONG ProcessInSession
: 1;
605 ULONG SessionLeader
: 1;
607 ULONG WorkingSetHard
: 1;
608 ULONG WriteWatch
: 1;
610 } MMSUPPORT_FLAGS
, *PMMSUPPORT_FLAGS
;
614 #if (VER_PRODUCTBUILD >= 2600)
616 typedef struct _MMSUPPORT
{
617 LARGE_INTEGER LastTrimTime
;
618 MMSUPPORT_FLAGS Flags
;
619 ULONG PageFaultCount
;
620 ULONG PeakWorkingSetSize
;
621 ULONG WorkingSetSize
;
622 ULONG MinimumWorkingSetSize
;
623 ULONG MaximumWorkingSetSize
;
624 PMMWSL VmWorkingSetList
;
625 LIST_ENTRY WorkingSetExpansionLinks
;
627 ULONG NextEstimationSlot
;
629 ULONG EstimatedAvailable
;
630 ULONG GrowthSinceLastEstimate
;
631 } MMSUPPORT
, *PMMSUPPORT
;
635 typedef struct _MMSUPPORT
{
636 LARGE_INTEGER LastTrimTime
;
637 ULONG LastTrimFaultCount
;
638 ULONG PageFaultCount
;
639 ULONG PeakWorkingSetSize
;
640 ULONG WorkingSetSize
;
641 ULONG MinimumWorkingSetSize
;
642 ULONG MaximumWorkingSetSize
;
643 PMMWSL VmWorkingSetList
;
644 LIST_ENTRY WorkingSetExpansionLinks
;
645 BOOLEAN AllowWorkingSetAdjustment
;
646 BOOLEAN AddressSpaceBeingDeleted
;
647 UCHAR ForegroundSwitchCount
;
648 UCHAR MemoryPriority
;
649 #if (VER_PRODUCTBUILD >= 2195)
652 MMSUPPORT_FLAGS Flags
;
655 ULONG NextEstimationSlot
;
657 ULONG EstimatedAvailable
;
658 ULONG GrowthSinceLastEstimate
;
659 #endif /* (VER_PRODUCTBUILD >= 2195) */
660 } MMSUPPORT
, *PMMSUPPORT
;
664 typedef struct _SE_AUDIT_PROCESS_CREATION_INFO
{
665 POBJECT_NAME_INFORMATION ImageFileName
;
666 } SE_AUDIT_PROCESS_CREATION_INFO
, *PSE_AUDIT_PROCESS_CREATION_INFO
;
668 typedef struct _BITMAP_RANGE
{
670 LARGE_INTEGER BasePage
;
671 ULONG FirstDirtyPage
;
675 } BITMAP_RANGE
, *PBITMAP_RANGE
;
677 typedef struct _CACHE_UNINITIALIZE_EVENT
{
678 struct _CACHE_UNINITIALIZE_EVENT
*Next
;
680 } CACHE_UNINITIALIZE_EVENT
, *PCACHE_UNINITIALIZE_EVENT
;
682 typedef struct _CC_FILE_SIZES
{
683 LARGE_INTEGER AllocationSize
;
684 LARGE_INTEGER FileSize
;
685 LARGE_INTEGER ValidDataLength
;
686 } CC_FILE_SIZES
, *PCC_FILE_SIZES
;
688 typedef struct _COMPRESSED_DATA_INFO
{
689 USHORT CompressionFormatAndEngine
;
690 UCHAR CompressionUnitShift
;
694 USHORT NumberOfChunks
;
695 ULONG CompressedChunkSizes
[ANYSIZE_ARRAY
];
696 } COMPRESSED_DATA_INFO
, *PCOMPRESSED_DATA_INFO
;
698 typedef struct _DEVICE_MAP
{
699 POBJECT_DIRECTORY DosDevicesDirectory
;
700 POBJECT_DIRECTORY GlobalDosDevicesDirectory
;
701 ULONG ReferenceCount
;
704 } DEVICE_MAP
, *PDEVICE_MAP
;
706 #if (VER_PRODUCTBUILD >= 2600)
708 typedef struct _EX_FAST_REF
{
709 _ANONYMOUS_UNION
union {
714 } EX_FAST_REF
, *PEX_FAST_REF
;
716 typedef struct _EX_PUSH_LOCK
{
717 _ANONYMOUS_UNION
union {
718 _ANONYMOUS_STRUCT
struct {
726 } EX_PUSH_LOCK
, *PEX_PUSH_LOCK
;
728 typedef struct _EX_RUNDOWN_REF
{
729 _ANONYMOUS_UNION
union {
733 } EX_RUNDOWN_REF
, *PEX_RUNDOWN_REF
;
737 typedef struct _EPROCESS_QUOTA_ENTRY
{
742 } EPROCESS_QUOTA_ENTRY
, *PEPROCESS_QUOTA_ENTRY
;
744 typedef struct _EPROCESS_QUOTA_BLOCK
{
745 EPROCESS_QUOTA_ENTRY QuotaEntry
[3];
746 LIST_ENTRY QuotaList
;
747 ULONG ReferenceCount
;
749 } EPROCESS_QUOTA_BLOCK
, *PEPROCESS_QUOTA_BLOCK
;
752 * When needing these parameters cast your PIO_STACK_LOCATION to
753 * PEXTENDED_IO_STACK_LOCATION
755 #if !defined(_ALPHA_)
756 #include <pshpack4.h>
758 typedef struct _EXTENDED_IO_STACK_LOCATION
{
760 /* Included for padding */
769 PIO_SECURITY_CONTEXT SecurityContext
;
773 PMAILSLOT_CREATE_PARAMETERS Parameters
;
777 PIO_SECURITY_CONTEXT SecurityContext
;
781 PNAMED_PIPE_CREATE_PARAMETERS Parameters
;
785 ULONG OutputBufferLength
;
786 ULONG InputBufferLength
;
788 PVOID Type3InputBuffer
;
792 PLARGE_INTEGER Length
;
794 LARGE_INTEGER ByteOffset
;
799 ULONG CompletionFilter
;
804 PUNICODE_STRING FileName
;
805 FILE_INFORMATION_CLASS FileInformationClass
;
819 PFILE_GET_QUOTA_INFORMATION SidList
;
833 FS_INFORMATION_CLASS FsInformationClass
;
837 PDEVICE_OBJECT DeviceObject
;
838 PFILE_OBJECT FileObject
;
839 PIO_COMPLETION_ROUTINE CompletionRoutine
;
842 } EXTENDED_IO_STACK_LOCATION
, *PEXTENDED_IO_STACK_LOCATION
;
843 #if !defined(_ALPHA_)
847 typedef struct _FILE_ACCESS_INFORMATION
{
848 ACCESS_MASK AccessFlags
;
849 } FILE_ACCESS_INFORMATION
, *PFILE_ACCESS_INFORMATION
;
851 typedef struct _FILE_ALLOCATION_INFORMATION
{
852 LARGE_INTEGER AllocationSize
;
853 } FILE_ALLOCATION_INFORMATION
, *PFILE_ALLOCATION_INFORMATION
;
855 typedef struct _FILE_BOTH_DIR_INFORMATION
{
856 ULONG NextEntryOffset
;
858 LARGE_INTEGER CreationTime
;
859 LARGE_INTEGER LastAccessTime
;
860 LARGE_INTEGER LastWriteTime
;
861 LARGE_INTEGER ChangeTime
;
862 LARGE_INTEGER EndOfFile
;
863 LARGE_INTEGER AllocationSize
;
864 ULONG FileAttributes
;
865 ULONG FileNameLength
;
867 CCHAR ShortNameLength
;
870 } FILE_BOTH_DIR_INFORMATION
, *PFILE_BOTH_DIR_INFORMATION
;
872 typedef struct _FILE_COMPLETION_INFORMATION
{
875 } FILE_COMPLETION_INFORMATION
, *PFILE_COMPLETION_INFORMATION
;
877 typedef struct _FILE_COMPRESSION_INFORMATION
{
878 LARGE_INTEGER CompressedFileSize
;
879 USHORT CompressionFormat
;
880 UCHAR CompressionUnitShift
;
884 } FILE_COMPRESSION_INFORMATION
, *PFILE_COMPRESSION_INFORMATION
;
886 typedef struct _FILE_COPY_ON_WRITE_INFORMATION
{
887 BOOLEAN ReplaceIfExists
;
888 HANDLE RootDirectory
;
889 ULONG FileNameLength
;
891 } FILE_COPY_ON_WRITE_INFORMATION
, *PFILE_COPY_ON_WRITE_INFORMATION
;
893 typedef struct _FILE_DIRECTORY_INFORMATION
{
894 ULONG NextEntryOffset
;
896 LARGE_INTEGER CreationTime
;
897 LARGE_INTEGER LastAccessTime
;
898 LARGE_INTEGER LastWriteTime
;
899 LARGE_INTEGER ChangeTime
;
900 LARGE_INTEGER EndOfFile
;
901 LARGE_INTEGER AllocationSize
;
902 ULONG FileAttributes
;
903 ULONG FileNameLength
;
905 } FILE_DIRECTORY_INFORMATION
, *PFILE_DIRECTORY_INFORMATION
;
907 typedef struct _FILE_FULL_DIRECTORY_INFORMATION
{
908 ULONG NextEntryOffset
;
910 LARGE_INTEGER CreationTime
;
911 LARGE_INTEGER LastAccessTime
;
912 LARGE_INTEGER LastWriteTime
;
913 LARGE_INTEGER ChangeTime
;
914 LARGE_INTEGER EndOfFile
;
915 LARGE_INTEGER AllocationSize
;
916 ULONG FileAttributes
;
917 ULONG FileNameLength
;
920 } FILE_FULL_DIRECTORY_INFORMATION
, *PFILE_FULL_DIRECTORY_INFORMATION
;
922 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION
{
923 ULONG NextEntryOffset
;
925 LARGE_INTEGER CreationTime
;
926 LARGE_INTEGER LastAccessTime
;
927 LARGE_INTEGER LastWriteTime
;
928 LARGE_INTEGER ChangeTime
;
929 LARGE_INTEGER EndOfFile
;
930 LARGE_INTEGER AllocationSize
;
931 ULONG FileAttributes
;
932 ULONG FileNameLength
;
934 CHAR ShortNameLength
;
937 } FILE_BOTH_DIRECTORY_INFORMATION
, *PFILE_BOTH_DIRECTORY_INFORMATION
;
939 #if (VER_PRODUCTBUILD >= 2600)
941 typedef struct _FILE_ID_FULL_DIRECTORY_INFORMATION
{
942 ULONG NextEntryOffset
;
944 LARGE_INTEGER CreationTime
;
945 LARGE_INTEGER LastAccessTime
;
946 LARGE_INTEGER LastWriteTime
;
947 LARGE_INTEGER ChangeTime
;
948 LARGE_INTEGER EndOfFile
;
949 LARGE_INTEGER AllocationSize
;
950 ULONG FileAttributes
;
951 ULONG FileNameLength
;
953 LARGE_INTEGER FileId
;
955 } FILE_ID_FULL_DIRECTORY_INFORMATION
, *PFILE_ID_FULL_DIRECTORY_INFORMATION
;
957 typedef struct _FILE_ID_BOTH_DIRECTORY_INFORMATION
{
958 ULONG NextEntryOffset
;
960 LARGE_INTEGER CreationTime
;
961 LARGE_INTEGER LastAccessTime
;
962 LARGE_INTEGER LastWriteTime
;
963 LARGE_INTEGER ChangeTime
;
964 LARGE_INTEGER EndOfFile
;
965 LARGE_INTEGER AllocationSize
;
966 ULONG FileAttributes
;
967 ULONG FileNameLength
;
969 CHAR ShortNameLength
;
971 LARGE_INTEGER FileId
;
973 } FILE_ID_BOTH_DIRECTORY_INFORMATION
, *PFILE_ID_BOTH_DIRECTORY_INFORMATION
;
977 typedef struct _FILE_EA_INFORMATION
{
979 } FILE_EA_INFORMATION
, *PFILE_EA_INFORMATION
;
981 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
{
982 ULONG FileSystemAttributes
;
983 ULONG MaximumComponentNameLength
;
984 ULONG FileSystemNameLength
;
985 WCHAR FileSystemName
[1];
986 } FILE_FS_ATTRIBUTE_INFORMATION
, *PFILE_FS_ATTRIBUTE_INFORMATION
;
988 typedef struct _FILE_FS_CONTROL_INFORMATION
{
989 LARGE_INTEGER FreeSpaceStartFiltering
;
990 LARGE_INTEGER FreeSpaceThreshold
;
991 LARGE_INTEGER FreeSpaceStopFiltering
;
992 LARGE_INTEGER DefaultQuotaThreshold
;
993 LARGE_INTEGER DefaultQuotaLimit
;
994 ULONG FileSystemControlFlags
;
995 } FILE_FS_CONTROL_INFORMATION
, *PFILE_FS_CONTROL_INFORMATION
;
997 typedef struct _FILE_FS_FULL_SIZE_INFORMATION
{
998 LARGE_INTEGER TotalAllocationUnits
;
999 LARGE_INTEGER CallerAvailableAllocationUnits
;
1000 LARGE_INTEGER ActualAvailableAllocationUnits
;
1001 ULONG SectorsPerAllocationUnit
;
1002 ULONG BytesPerSector
;
1003 } FILE_FS_FULL_SIZE_INFORMATION
, *PFILE_FS_FULL_SIZE_INFORMATION
;
1005 typedef struct _FILE_FS_LABEL_INFORMATION
{
1006 ULONG VolumeLabelLength
;
1007 WCHAR VolumeLabel
[1];
1008 } FILE_FS_LABEL_INFORMATION
, *PFILE_FS_LABEL_INFORMATION
;
1010 #if (VER_PRODUCTBUILD >= 2195)
1012 typedef struct _FILE_FS_OBJECT_ID_INFORMATION
{
1014 UCHAR ExtendedInfo
[48];
1015 } FILE_FS_OBJECT_ID_INFORMATION
, *PFILE_FS_OBJECT_ID_INFORMATION
;
1017 #endif /* (VER_PRODUCTBUILD >= 2195) */
1019 typedef struct _FILE_FS_SIZE_INFORMATION
{
1020 LARGE_INTEGER TotalAllocationUnits
;
1021 LARGE_INTEGER AvailableAllocationUnits
;
1022 ULONG SectorsPerAllocationUnit
;
1023 ULONG BytesPerSector
;
1024 } FILE_FS_SIZE_INFORMATION
, *PFILE_FS_SIZE_INFORMATION
;
1026 typedef struct _FILE_FS_VOLUME_INFORMATION
{
1027 LARGE_INTEGER VolumeCreationTime
;
1028 ULONG VolumeSerialNumber
;
1029 ULONG VolumeLabelLength
;
1030 BOOLEAN SupportsObjects
;
1031 WCHAR VolumeLabel
[1];
1032 } FILE_FS_VOLUME_INFORMATION
, *PFILE_FS_VOLUME_INFORMATION
;
1034 typedef struct _FILE_FULL_DIR_INFORMATION
{
1035 ULONG NextEntryOffset
;
1037 LARGE_INTEGER CreationTime
;
1038 LARGE_INTEGER LastAccessTime
;
1039 LARGE_INTEGER LastWriteTime
;
1040 LARGE_INTEGER ChangeTime
;
1041 LARGE_INTEGER EndOfFile
;
1042 LARGE_INTEGER AllocationSize
;
1043 ULONG FileAttributes
;
1044 ULONG FileNameLength
;
1047 } FILE_FULL_DIR_INFORMATION
, *PFILE_FULL_DIR_INFORMATION
;
1049 typedef struct _FILE_GET_EA_INFORMATION
{
1050 ULONG NextEntryOffset
;
1053 } FILE_GET_EA_INFORMATION
, *PFILE_GET_EA_INFORMATION
;
1055 typedef struct _FILE_GET_QUOTA_INFORMATION
{
1056 ULONG NextEntryOffset
;
1059 } FILE_GET_QUOTA_INFORMATION
, *PFILE_GET_QUOTA_INFORMATION
;
1061 typedef struct _FILE_INTERNAL_INFORMATION
{
1062 LARGE_INTEGER IndexNumber
;
1063 } FILE_INTERNAL_INFORMATION
, *PFILE_INTERNAL_INFORMATION
;
1065 typedef struct _FILE_LINK_INFORMATION
{
1066 BOOLEAN ReplaceIfExists
;
1067 HANDLE RootDirectory
;
1068 ULONG FileNameLength
;
1070 } FILE_LINK_INFORMATION
, *PFILE_LINK_INFORMATION
;
1072 typedef struct _FILE_LOCK_INFO
{
1073 LARGE_INTEGER StartingByte
;
1074 LARGE_INTEGER Length
;
1075 BOOLEAN ExclusiveLock
;
1077 PFILE_OBJECT FileObject
;
1079 LARGE_INTEGER EndingByte
;
1080 } FILE_LOCK_INFO
, *PFILE_LOCK_INFO
;
1082 /* raw internal file lock struct returned from FsRtlGetNextFileLock */
1083 typedef struct _FILE_SHARED_LOCK_ENTRY
{
1086 FILE_LOCK_INFO FileLock
;
1087 } FILE_SHARED_LOCK_ENTRY
, *PFILE_SHARED_LOCK_ENTRY
;
1089 /* raw internal file lock struct returned from FsRtlGetNextFileLock */
1090 typedef struct _FILE_EXCLUSIVE_LOCK_ENTRY
{
1091 LIST_ENTRY ListEntry
;
1094 FILE_LOCK_INFO FileLock
;
1095 } FILE_EXCLUSIVE_LOCK_ENTRY
, *PFILE_EXCLUSIVE_LOCK_ENTRY
;
1097 typedef NTSTATUS (*PCOMPLETE_LOCK_IRP_ROUTINE
) (
1098 /*IN*/ PVOID Context
,
1102 typedef VOID (NTAPI
*PUNLOCK_ROUTINE
) (
1103 /*IN*/ PVOID Context
,
1104 /*IN*/ PFILE_LOCK_INFO FileLockInfo
1107 typedef struct _FILE_LOCK
{
1108 PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine
;
1109 PUNLOCK_ROUTINE UnlockRoutine
;
1110 BOOLEAN FastIoIsQuestionable
;
1112 PVOID LockInformation
;
1113 FILE_LOCK_INFO LastReturnedLockInfo
;
1114 PVOID LastReturnedLock
;
1115 } FILE_LOCK
, *PFILE_LOCK
;
1117 typedef struct _FILE_MAILSLOT_PEEK_BUFFER
{
1118 ULONG ReadDataAvailable
;
1119 ULONG NumberOfMessages
;
1120 ULONG MessageLength
;
1121 } FILE_MAILSLOT_PEEK_BUFFER
, *PFILE_MAILSLOT_PEEK_BUFFER
;
1123 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION
{
1124 ULONG MaximumMessageSize
;
1125 ULONG MailslotQuota
;
1126 ULONG NextMessageSize
;
1127 ULONG MessagesAvailable
;
1128 LARGE_INTEGER ReadTimeout
;
1129 } FILE_MAILSLOT_QUERY_INFORMATION
, *PFILE_MAILSLOT_QUERY_INFORMATION
;
1131 typedef struct _FILE_MAILSLOT_SET_INFORMATION
{
1132 LARGE_INTEGER ReadTimeout
;
1133 } FILE_MAILSLOT_SET_INFORMATION
, *PFILE_MAILSLOT_SET_INFORMATION
;
1135 typedef struct _FILE_MODE_INFORMATION
{
1137 } FILE_MODE_INFORMATION
, *PFILE_MODE_INFORMATION
;
1139 typedef struct _FILE_ALL_INFORMATION
{
1140 FILE_BASIC_INFORMATION BasicInformation
;
1141 FILE_STANDARD_INFORMATION StandardInformation
;
1142 FILE_INTERNAL_INFORMATION InternalInformation
;
1143 FILE_EA_INFORMATION EaInformation
;
1144 FILE_ACCESS_INFORMATION AccessInformation
;
1145 FILE_POSITION_INFORMATION PositionInformation
;
1146 FILE_MODE_INFORMATION ModeInformation
;
1147 FILE_ALIGNMENT_INFORMATION AlignmentInformation
;
1148 FILE_NAME_INFORMATION NameInformation
;
1149 } FILE_ALL_INFORMATION
, *PFILE_ALL_INFORMATION
;
1151 typedef struct _FILE_NAMES_INFORMATION
{
1152 ULONG NextEntryOffset
;
1154 ULONG FileNameLength
;
1156 } FILE_NAMES_INFORMATION
, *PFILE_NAMES_INFORMATION
;
1158 typedef struct _FILE_OBJECTID_INFORMATION
{
1159 LONGLONG FileReference
;
1161 _ANONYMOUS_UNION
union {
1163 UCHAR BirthVolumeId
[16];
1164 UCHAR BirthObjectId
[16];
1167 UCHAR ExtendedInfo
[48];
1169 } FILE_OBJECTID_INFORMATION
, *PFILE_OBJECTID_INFORMATION
;
1171 typedef struct _FILE_OLE_CLASSID_INFORMATION
{
1173 } FILE_OLE_CLASSID_INFORMATION
, *PFILE_OLE_CLASSID_INFORMATION
;
1175 typedef struct _FILE_OLE_ALL_INFORMATION
{
1176 FILE_BASIC_INFORMATION BasicInformation
;
1177 FILE_STANDARD_INFORMATION StandardInformation
;
1178 FILE_INTERNAL_INFORMATION InternalInformation
;
1179 FILE_EA_INFORMATION EaInformation
;
1180 FILE_ACCESS_INFORMATION AccessInformation
;
1181 FILE_POSITION_INFORMATION PositionInformation
;
1182 FILE_MODE_INFORMATION ModeInformation
;
1183 FILE_ALIGNMENT_INFORMATION AlignmentInformation
;
1186 LARGE_INTEGER SecurityChangeTime
;
1187 FILE_OLE_CLASSID_INFORMATION OleClassIdInformation
;
1188 FILE_OBJECTID_INFORMATION ObjectIdInformation
;
1189 FILE_STORAGE_TYPE StorageType
;
1192 ULONG NumberOfStreamReferences
;
1195 BOOLEAN ContentIndexDisable
;
1196 BOOLEAN InheritContentIndexDisable
;
1197 FILE_NAME_INFORMATION NameInformation
;
1198 } FILE_OLE_ALL_INFORMATION
, *PFILE_OLE_ALL_INFORMATION
;
1200 typedef struct _FILE_OLE_DIR_INFORMATION
{
1201 ULONG NextEntryOffset
;
1203 LARGE_INTEGER CreationTime
;
1204 LARGE_INTEGER LastAccessTime
;
1205 LARGE_INTEGER LastWriteTime
;
1206 LARGE_INTEGER ChangeTime
;
1207 LARGE_INTEGER EndOfFile
;
1208 LARGE_INTEGER AllocationSize
;
1209 ULONG FileAttributes
;
1210 ULONG FileNameLength
;
1211 FILE_STORAGE_TYPE StorageType
;
1214 BOOLEAN ContentIndexDisable
;
1215 BOOLEAN InheritContentIndexDisable
;
1217 } FILE_OLE_DIR_INFORMATION
, *PFILE_OLE_DIR_INFORMATION
;
1219 typedef struct _FILE_OLE_INFORMATION
{
1220 LARGE_INTEGER SecurityChangeTime
;
1221 FILE_OLE_CLASSID_INFORMATION OleClassIdInformation
;
1222 FILE_OBJECTID_INFORMATION ObjectIdInformation
;
1223 FILE_STORAGE_TYPE StorageType
;
1225 BOOLEAN ContentIndexDisable
;
1226 BOOLEAN InheritContentIndexDisable
;
1227 } FILE_OLE_INFORMATION
, *PFILE_OLE_INFORMATION
;
1229 typedef struct _FILE_OLE_STATE_BITS_INFORMATION
{
1231 ULONG StateBitsMask
;
1232 } FILE_OLE_STATE_BITS_INFORMATION
, *PFILE_OLE_STATE_BITS_INFORMATION
;
1234 typedef struct _FILE_PIPE_ASSIGN_EVENT_BUFFER
{
1237 } FILE_PIPE_ASSIGN_EVENT_BUFFER
, *PFILE_PIPE_ASSIGN_EVENT_BUFFER
;
1239 typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER
{
1240 PVOID ClientSession
;
1241 PVOID ClientProcess
;
1242 } FILE_PIPE_CLIENT_PROCESS_BUFFER
, *PFILE_PIPE_CLIENT_PROCESS_BUFFER
;
1244 typedef struct _FILE_PIPE_EVENT_BUFFER
{
1245 ULONG NamedPipeState
;
1249 ULONG NumberRequests
;
1250 } FILE_PIPE_EVENT_BUFFER
, *PFILE_PIPE_EVENT_BUFFER
;
1252 typedef struct _FILE_PIPE_INFORMATION
{
1254 ULONG CompletionMode
;
1255 } FILE_PIPE_INFORMATION
, *PFILE_PIPE_INFORMATION
;
1257 typedef struct _FILE_PIPE_LOCAL_INFORMATION
{
1258 ULONG NamedPipeType
;
1259 ULONG NamedPipeConfiguration
;
1260 ULONG MaximumInstances
;
1261 ULONG CurrentInstances
;
1263 ULONG ReadDataAvailable
;
1264 ULONG OutboundQuota
;
1265 ULONG WriteQuotaAvailable
;
1266 ULONG NamedPipeState
;
1268 } FILE_PIPE_LOCAL_INFORMATION
, *PFILE_PIPE_LOCAL_INFORMATION
;
1270 typedef struct _FILE_PIPE_REMOTE_INFORMATION
{
1271 LARGE_INTEGER CollectDataTime
;
1272 ULONG MaximumCollectionCount
;
1273 } FILE_PIPE_REMOTE_INFORMATION
, *PFILE_PIPE_REMOTE_INFORMATION
;
1275 typedef struct _FILE_PIPE_WAIT_FOR_BUFFER
{
1276 LARGE_INTEGER Timeout
;
1278 BOOLEAN TimeoutSpecified
;
1280 } FILE_PIPE_WAIT_FOR_BUFFER
, *PFILE_PIPE_WAIT_FOR_BUFFER
;
1282 typedef struct _FILE_QUOTA_INFORMATION
{
1283 ULONG NextEntryOffset
;
1285 LARGE_INTEGER ChangeTime
;
1286 LARGE_INTEGER QuotaUsed
;
1287 LARGE_INTEGER QuotaThreshold
;
1288 LARGE_INTEGER QuotaLimit
;
1290 } FILE_QUOTA_INFORMATION
, *PFILE_QUOTA_INFORMATION
;
1292 typedef struct _FILE_RENAME_INFORMATION
{
1293 BOOLEAN ReplaceIfExists
;
1294 HANDLE RootDirectory
;
1295 ULONG FileNameLength
;
1297 } FILE_RENAME_INFORMATION
, *PFILE_RENAME_INFORMATION
;
1299 typedef struct _FILE_STREAM_INFORMATION
{
1300 ULONG NextEntryOffset
;
1301 ULONG StreamNameLength
;
1302 LARGE_INTEGER StreamSize
;
1303 LARGE_INTEGER StreamAllocationSize
;
1304 WCHAR StreamName
[1];
1305 } FILE_STREAM_INFORMATION
, *PFILE_STREAM_INFORMATION
;
1307 typedef struct _FILE_TRACKING_INFORMATION
{
1308 HANDLE DestinationFile
;
1309 ULONG ObjectInformationLength
;
1310 CHAR ObjectInformation
[1];
1311 } FILE_TRACKING_INFORMATION
, *PFILE_TRACKING_INFORMATION
;
1313 typedef struct _FSRTL_COMMON_FCB_HEADER
{
1314 CSHORT NodeTypeCode
;
1315 CSHORT NodeByteSize
;
1317 UCHAR IsFastIoPossible
;
1318 #if (VER_PRODUCTBUILD >= 1381)
1321 #endif /* (VER_PRODUCTBUILD >= 1381) */
1322 PERESOURCE Resource
;
1323 PERESOURCE PagingIoResource
;
1324 LARGE_INTEGER AllocationSize
;
1325 LARGE_INTEGER FileSize
;
1326 LARGE_INTEGER ValidDataLength
;
1327 } FSRTL_COMMON_FCB_HEADER
, *PFSRTL_COMMON_FCB_HEADER
;
1329 typedef struct _GENERATE_NAME_CONTEXT
{
1331 BOOLEAN CheckSumInserted
;
1333 WCHAR NameBuffer
[8];
1334 ULONG ExtensionLength
;
1335 WCHAR ExtensionBuffer
[4];
1336 ULONG LastIndexValue
;
1337 } GENERATE_NAME_CONTEXT
, *PGENERATE_NAME_CONTEXT
;
1339 typedef struct _HANDLE_TABLE_ENTRY
{
1341 ULONG ObjectAttributes
;
1342 ULONG GrantedAccess
;
1343 USHORT GrantedAccessIndex
;
1344 USHORT CreatorBackTraceIndex
;
1345 ULONG NextFreeTableEntry
;
1346 } HANDLE_TABLE_ENTRY
, *PHANDLE_TABLE_ENTRY
;
1348 typedef struct _MAPPING_PAIR
{
1351 } MAPPING_PAIR
, *PMAPPING_PAIR
;
1353 typedef struct _GET_RETRIEVAL_DESCRIPTOR
{
1354 ULONG NumberOfPairs
;
1356 MAPPING_PAIR Pair
[1];
1357 } GET_RETRIEVAL_DESCRIPTOR
, *PGET_RETRIEVAL_DESCRIPTOR
;
1359 typedef struct _IO_CLIENT_EXTENSION
{
1360 struct _IO_CLIENT_EXTENSION
*NextExtension
;
1361 PVOID ClientIdentificationAddress
;
1362 } IO_CLIENT_EXTENSION
, *PIO_CLIENT_EXTENSION
;
1364 typedef struct _IO_COMPLETION_BASIC_INFORMATION
{
1366 } IO_COMPLETION_BASIC_INFORMATION
, *PIO_COMPLETION_BASIC_INFORMATION
;
1368 typedef struct _KEVENT_PAIR
{
1373 } KEVENT_PAIR
, *PKEVENT_PAIR
;
1375 typedef struct _KQUEUE
{
1376 DISPATCHER_HEADER Header
;
1377 LIST_ENTRY EntryListHead
;
1380 LIST_ENTRY ThreadListHead
;
1381 } KQUEUE
, *PKQUEUE
, *RESTRICTED_POINTER PRKQUEUE
;
1383 typedef struct _MAILSLOT_CREATE_PARAMETERS
{
1384 ULONG MailslotQuota
;
1385 ULONG MaximumMessageSize
;
1386 LARGE_INTEGER ReadTimeout
;
1387 BOOLEAN TimeoutSpecified
;
1388 } MAILSLOT_CREATE_PARAMETERS
, *PMAILSLOT_CREATE_PARAMETERS
;
1390 typedef struct _MBCB
{
1391 CSHORT NodeTypeCode
;
1392 CSHORT NodeIsInZone
;
1396 LIST_ENTRY BitmapRanges
;
1397 LONGLONG ResumeWritePage
;
1398 BITMAP_RANGE BitmapRange1
;
1399 BITMAP_RANGE BitmapRange2
;
1400 BITMAP_RANGE BitmapRange3
;
1403 typedef struct _MOVEFILE_DESCRIPTOR
{
1406 LARGE_INTEGER StartVcn
;
1407 LARGE_INTEGER TargetLcn
;
1410 } MOVEFILE_DESCRIPTOR
, *PMOVEFILE_DESCRIPTOR
;
1412 typedef struct _NAMED_PIPE_CREATE_PARAMETERS
{
1413 ULONG NamedPipeType
;
1415 ULONG CompletionMode
;
1416 ULONG MaximumInstances
;
1418 ULONG OutboundQuota
;
1419 LARGE_INTEGER DefaultTimeout
;
1420 BOOLEAN TimeoutSpecified
;
1421 } NAMED_PIPE_CREATE_PARAMETERS
, *PNAMED_PIPE_CREATE_PARAMETERS
;
1423 typedef struct _OBJECT_BASIC_INFO
{
1425 ACCESS_MASK GrantedAccess
;
1427 ULONG ReferenceCount
;
1428 ULONG PagedPoolUsage
;
1429 ULONG NonPagedPoolUsage
;
1431 ULONG NameInformationLength
;
1432 ULONG TypeInformationLength
;
1433 ULONG SecurityDescriptorLength
;
1434 LARGE_INTEGER CreateTime
;
1435 } OBJECT_BASIC_INFO
, *POBJECT_BASIC_INFO
;
1437 typedef struct _OBJECT_HANDLE_ATTRIBUTE_INFO
{
1439 BOOLEAN ProtectFromClose
;
1440 } OBJECT_HANDLE_ATTRIBUTE_INFO
, *POBJECT_HANDLE_ATTRIBUTE_INFO
;
1442 typedef struct _OBJECT_NAME_INFO
{
1443 UNICODE_STRING ObjectName
;
1444 WCHAR ObjectNameBuffer
[1];
1445 } OBJECT_NAME_INFO
, *POBJECT_NAME_INFO
;
1447 typedef struct _OBJECT_PROTECTION_INFO
{
1449 BOOLEAN ProtectHandle
;
1450 } OBJECT_PROTECTION_INFO
, *POBJECT_PROTECTION_INFO
;
1452 typedef struct _OBJECT_TYPE_INFO
{
1453 UNICODE_STRING ObjectTypeName
;
1454 UCHAR Unknown
[0x58];
1455 WCHAR ObjectTypeNameBuffer
[1];
1456 } OBJECT_TYPE_INFO
, *POBJECT_TYPE_INFO
;
1458 typedef struct _OBJECT_ALL_TYPES_INFO
{
1459 ULONG NumberOfObjectTypes
;
1460 OBJECT_TYPE_INFO ObjectsTypeInfo
[1];
1461 } OBJECT_ALL_TYPES_INFO
, *POBJECT_ALL_TYPES_INFO
;
1463 typedef struct _PAGEFAULT_HISTORY
{
1466 KSPIN_LOCK SpinLock
;
1468 PROCESS_WS_WATCH_INFORMATION WatchInfo
[1];
1469 } PAGEFAULT_HISTORY
, *PPAGEFAULT_HISTORY
;
1471 typedef struct _PATHNAME_BUFFER
{
1472 ULONG PathNameLength
;
1474 } PATHNAME_BUFFER
, *PPATHNAME_BUFFER
;
1476 #if (VER_PRODUCTBUILD >= 2600)
1478 typedef struct _PRIVATE_CACHE_MAP_FLAGS
{
1480 ULONG ReadAheadActive
: 1;
1481 ULONG ReadAheadEnabled
: 1;
1482 ULONG Available
: 14;
1483 } PRIVATE_CACHE_MAP_FLAGS
, *PPRIVATE_CACHE_MAP_FLAGS
;
1485 typedef struct _PRIVATE_CACHE_MAP
{
1486 _ANONYMOUS_UNION
union {
1487 CSHORT NodeTypeCode
;
1488 PRIVATE_CACHE_MAP_FLAGS Flags
;
1491 ULONG ReadAheadMask
;
1492 PFILE_OBJECT FileObject
;
1493 LARGE_INTEGER FileOffset1
;
1494 LARGE_INTEGER BeyondLastByte1
;
1495 LARGE_INTEGER FileOffset2
;
1496 LARGE_INTEGER BeyondLastByte2
;
1497 LARGE_INTEGER ReadAheadOffset
[2];
1498 ULONG ReadAheadLength
[2];
1499 KSPIN_LOCK ReadAheadSpinLock
;
1500 LIST_ENTRY PrivateLinks
;
1501 } PRIVATE_CACHE_MAP
, *PPRIVATE_CACHE_MAP
;
1505 typedef struct _PS_IMPERSONATION_INFORMATION
{
1506 PACCESS_TOKEN Token
;
1508 BOOLEAN EffectiveOnly
;
1509 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
;
1510 } PS_IMPERSONATION_INFORMATION
, *PPS_IMPERSONATION_INFORMATION
;
1512 typedef struct _PUBLIC_BCB
{
1513 CSHORT NodeTypeCode
;
1514 CSHORT NodeByteSize
;
1516 LARGE_INTEGER MappedFileOffset
;
1517 } PUBLIC_BCB
, *PPUBLIC_BCB
;
1519 typedef struct _QUERY_PATH_REQUEST
{
1520 ULONG PathNameLength
;
1521 PIO_SECURITY_CONTEXT SecurityContext
;
1522 WCHAR FilePathName
[1];
1523 } QUERY_PATH_REQUEST
, *PQUERY_PATH_REQUEST
;
1525 typedef struct _QUERY_PATH_RESPONSE
{
1526 ULONG LengthAccepted
;
1527 } QUERY_PATH_RESPONSE
, *PQUERY_PATH_RESPONSE
;
1529 typedef struct _RETRIEVAL_POINTERS_BUFFER
{
1531 LARGE_INTEGER StartingVcn
;
1533 LARGE_INTEGER NextVcn
;
1536 } RETRIEVAL_POINTERS_BUFFER
, *PRETRIEVAL_POINTERS_BUFFER
;
1538 typedef struct _RTL_SPLAY_LINKS
{
1539 struct _RTL_SPLAY_LINKS
*Parent
;
1540 struct _RTL_SPLAY_LINKS
*LeftChild
;
1541 struct _RTL_SPLAY_LINKS
*RightChild
;
1542 } RTL_SPLAY_LINKS
, *PRTL_SPLAY_LINKS
;
1544 typedef struct _SE_EXPORTS
{
1546 LUID SeCreateTokenPrivilege
;
1547 LUID SeAssignPrimaryTokenPrivilege
;
1548 LUID SeLockMemoryPrivilege
;
1549 LUID SeIncreaseQuotaPrivilege
;
1550 LUID SeUnsolicitedInputPrivilege
;
1551 LUID SeTcbPrivilege
;
1552 LUID SeSecurityPrivilege
;
1553 LUID SeTakeOwnershipPrivilege
;
1554 LUID SeLoadDriverPrivilege
;
1555 LUID SeCreatePagefilePrivilege
;
1556 LUID SeIncreaseBasePriorityPrivilege
;
1557 LUID SeSystemProfilePrivilege
;
1558 LUID SeSystemtimePrivilege
;
1559 LUID SeProfileSingleProcessPrivilege
;
1560 LUID SeCreatePermanentPrivilege
;
1561 LUID SeBackupPrivilege
;
1562 LUID SeRestorePrivilege
;
1563 LUID SeShutdownPrivilege
;
1564 LUID SeDebugPrivilege
;
1565 LUID SeAuditPrivilege
;
1566 LUID SeSystemEnvironmentPrivilege
;
1567 LUID SeChangeNotifyPrivilege
;
1568 LUID SeRemoteShutdownPrivilege
;
1573 PSID SeCreatorOwnerSid
;
1574 PSID SeCreatorGroupSid
;
1576 PSID SeNtAuthoritySid
;
1580 PSID SeInteractiveSid
;
1581 PSID SeLocalSystemSid
;
1582 PSID SeAliasAdminsSid
;
1583 PSID SeAliasUsersSid
;
1584 PSID SeAliasGuestsSid
;
1585 PSID SeAliasPowerUsersSid
;
1586 PSID SeAliasAccountOpsSid
;
1587 PSID SeAliasSystemOpsSid
;
1588 PSID SeAliasPrintOpsSid
;
1589 PSID SeAliasBackupOpsSid
;
1591 PSID SeAuthenticatedUsersSid
;
1593 PSID SeRestrictedSid
;
1594 PSID SeAnonymousLogonSid
;
1596 LUID SeUndockPrivilege
;
1597 LUID SeSyncAgentPrivilege
;
1598 LUID SeEnableDelegationPrivilege
;
1600 } SE_EXPORTS
, *PSE_EXPORTS
;
1602 typedef struct _SECTION_BASIC_INFORMATION
{
1606 } SECTION_BASIC_INFORMATION
, *PSECTION_BASIC_INFORMATION
;
1608 typedef struct _SECTION_IMAGE_INFORMATION
{
1614 USHORT MinorSubsystemVersion
;
1615 USHORT MajorSubsystemVersion
;
1617 ULONG Characteristics
;
1622 } SECTION_IMAGE_INFORMATION
, *PSECTION_IMAGE_INFORMATION
;
1624 #if (VER_PRODUCTBUILD >= 2600)
1626 typedef struct _SHARED_CACHE_MAP
{
1627 CSHORT NodeTypeCode
;
1628 CSHORT NodeByteSize
;
1630 LARGE_INTEGER FileSize
;
1632 LARGE_INTEGER SectionSize
;
1633 LARGE_INTEGER ValidDataLength
;
1634 LARGE_INTEGER ValidDataGoal
;
1635 PVACB InitialVacbs
[4];
1637 PFILE_OBJECT FileObject
;
1641 ULONG NeedToZeroPage
;
1642 KSPIN_LOCK ActiveVacbSpinLock
;
1643 ULONG VacbActiveCount
;
1645 LIST_ENTRY SharedCacheMapLinks
;
1650 PKEVENT CreateEvent
;
1651 PKEVENT WaitOnActiveCount
;
1653 LONGLONG BeyondLastFlush
;
1654 PCACHE_MANAGER_CALLBACKS Callbacks
;
1655 PVOID LazyWriteContext
;
1656 LIST_ENTRY PrivateList
;
1658 PVOID FlushToLsnRoutine
;
1659 ULONG DirtyPageThreshold
;
1660 ULONG LazyWritePassCount
;
1661 PCACHE_UNINITIALIZE_EVENT UninitializeEvent
;
1662 PVACB NeedToZeroVacb
;
1663 KSPIN_LOCK BcbSpinLock
;
1666 EX_PUSH_LOCK VacbPushLock
;
1667 PRIVATE_CACHE_MAP PrivateCacheMap
;
1668 } SHARED_CACHE_MAP
, *PSHARED_CACHE_MAP
;
1672 typedef struct _STARTING_VCN_INPUT_BUFFER
{
1673 LARGE_INTEGER StartingVcn
;
1674 } STARTING_VCN_INPUT_BUFFER
, *PSTARTING_VCN_INPUT_BUFFER
;
1676 typedef struct _SYSTEM_CACHE_INFORMATION
{
1679 ULONG PageFaultCount
;
1680 ULONG MinimumWorkingSet
;
1681 ULONG MaximumWorkingSet
;
1683 } SYSTEM_CACHE_INFORMATION
, *PSYSTEM_CACHE_INFORMATION
;
1685 typedef struct _TERMINATION_PORT
{
1686 struct _TERMINATION_PORT
* Next
;
1688 } TERMINATION_PORT
, *PTERMINATION_PORT
;
1690 typedef struct _SECURITY_CLIENT_CONTEXT
{
1691 SECURITY_QUALITY_OF_SERVICE SecurityQos
;
1692 PACCESS_TOKEN ClientToken
;
1693 BOOLEAN DirectlyAccessClientToken
;
1694 BOOLEAN DirectAccessEffectiveOnly
;
1695 BOOLEAN ServerIsRemote
;
1696 TOKEN_CONTROL ClientTokenControl
;
1697 } SECURITY_CLIENT_CONTEXT
, *PSECURITY_CLIENT_CONTEXT
;
1699 typedef struct _TUNNEL
{
1701 PRTL_SPLAY_LINKS Cache
;
1702 LIST_ENTRY TimerQueue
;
1706 typedef struct _VACB
{
1708 PSHARED_CACHE_MAP SharedCacheMap
;
1710 LARGE_INTEGER FileOffset
;
1716 typedef struct _VAD_HEADER
{
1719 PVAD_HEADER ParentLink
;
1720 PVAD_HEADER LeftLink
;
1721 PVAD_HEADER RightLink
;
1722 ULONG Flags
; /* LSB = CommitCharge */
1724 PVOID FirstProtoPte
;
1728 } VAD_HEADER
, *PVAD_HEADER
;
1734 /*IN*/ PFILE_OBJECT FileObject
,
1735 /*IN*/ ULONG BytesToWrite
,
1736 /*IN*/ BOOLEAN Wait
,
1737 /*IN*/ BOOLEAN Retrying
1744 /*IN*/ PFILE_OBJECT FileObject
,
1745 /*IN*/ PLARGE_INTEGER FileOffset
,
1746 /*IN*/ ULONG Length
,
1747 /*IN*/ BOOLEAN Wait
,
1748 /*OUT*/ PVOID Buffer
,
1749 /*OUT*/ PIO_STATUS_BLOCK IoStatus
1756 /*IN*/ PFILE_OBJECT FileObject
,
1757 /*IN*/ PLARGE_INTEGER FileOffset
,
1758 /*IN*/ ULONG Length
,
1759 /*IN*/ BOOLEAN Wait
,
1763 #define CcCopyWriteWontFlush(FO, FOFF, LEN) ((LEN) <= 0x10000)
1765 typedef VOID (NTAPI
*PCC_POST_DEFERRED_WRITE
) (
1766 /*IN*/ PVOID Context1
,
1767 /*IN*/ PVOID Context2
1774 /*IN*/ PFILE_OBJECT FileObject
,
1775 /*IN*/ PCC_POST_DEFERRED_WRITE PostRoutine
,
1776 /*IN*/ PVOID Context1
,
1777 /*IN*/ PVOID Context2
,
1778 /*IN*/ ULONG BytesToWrite
,
1779 /*IN*/ BOOLEAN Retrying
1786 /*IN*/ PFILE_OBJECT FileObject
,
1787 /*IN*/ ULONG FileOffset
,
1788 /*IN*/ ULONG Length
,
1789 /*IN*/ ULONG PageCount
,
1790 /*OUT*/ PVOID Buffer
,
1791 /*OUT*/ PIO_STATUS_BLOCK IoStatus
1798 /*IN*/ PFILE_OBJECT FileObject
,
1799 /*IN*/ ULONG FileOffset
,
1800 /*IN*/ ULONG Length
,
1808 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
,
1809 /*IN*/ PLARGE_INTEGER FileOffset
/*OPTIONAL*/,
1810 /*IN*/ ULONG Length
,
1811 /*OUT*/ PIO_STATUS_BLOCK IoStatus
/*OPTIONAL*/
1814 typedef VOID (*PDIRTY_PAGE_ROUTINE
) (
1815 /*IN*/ PFILE_OBJECT FileObject
,
1816 /*IN*/ PLARGE_INTEGER FileOffset
,
1817 /*IN*/ ULONG Length
,
1818 /*IN*/ PLARGE_INTEGER OldestLsn
,
1819 /*IN*/ PLARGE_INTEGER NewestLsn
,
1820 /*IN*/ PVOID Context1
,
1821 /*IN*/ PVOID Context2
1828 /*IN*/ PVOID LogHandle
,
1829 /*IN*/ PDIRTY_PAGE_ROUTINE DirtyPageRoutine
,
1830 /*IN*/ PVOID Context1
,
1831 /*IN*/ PVOID Context2
1837 CcGetFileObjectFromBcb (
1844 CcGetFileObjectFromSectionPtrs (
1845 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
1848 #define CcGetFileSizePointer(FO) ( \
1849 ((PLARGE_INTEGER)((FO)->SectionObjectPointer->SharedCacheMap) + 1) \
1852 #if (VER_PRODUCTBUILD >= 2195)
1857 CcGetFlushedValidData (
1858 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
,
1859 /*IN*/ BOOLEAN BcbListHeld
1862 #endif /* (VER_PRODUCTBUILD >= 2195) */
1866 CcGetLsnForFileObject (
1867 /*IN*/ PFILE_OBJECT FileObject
,
1868 /*OUT*/ PLARGE_INTEGER OldestLsn
/*OPTIONAL*/
1871 typedef BOOLEAN (NTAPI
*PACQUIRE_FOR_LAZY_WRITE
) (
1872 /*IN*/ PVOID Context
,
1876 typedef VOID (NTAPI
*PRELEASE_FROM_LAZY_WRITE
) (
1877 /*IN*/ PVOID Context
1880 typedef BOOLEAN (NTAPI
*PACQUIRE_FOR_READ_AHEAD
) (
1881 /*IN*/ PVOID Context
,
1885 typedef VOID (NTAPI
*PRELEASE_FROM_READ_AHEAD
) (
1886 /*IN*/ PVOID Context
1889 typedef struct _CACHE_MANAGER_CALLBACKS
{
1890 PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
;
1891 PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
;
1892 PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead
;
1893 PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead
;
1894 } CACHE_MANAGER_CALLBACKS
, *PCACHE_MANAGER_CALLBACKS
;
1899 CcInitializeCacheMap (
1900 /*IN*/ PFILE_OBJECT FileObject
,
1901 /*IN*/ PCC_FILE_SIZES FileSizes
,
1902 /*IN*/ BOOLEAN PinAccess
,
1903 /*IN*/ PCACHE_MANAGER_CALLBACKS Callbacks
,
1904 /*IN*/ PVOID LazyWriteContext
1907 #define CcIsFileCached(FO) ( \
1908 ((FO)->SectionObjectPointer != NULL) && \
1909 (((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \
1915 CcIsThereDirtyData (
1923 /*IN*/ PFILE_OBJECT FileObject
,
1924 /*IN*/ PLARGE_INTEGER FileOffset
,
1925 /*IN*/ ULONG Length
,
1926 /*IN*/ BOOLEAN Wait
,
1928 /*OUT*/ PVOID
*Buffer
1935 /*IN*/ PFILE_OBJECT FileObject
,
1936 /*IN*/ PLARGE_INTEGER FileOffset
,
1937 /*IN*/ ULONG Length
,
1938 /*OUT*/ PMDL
*MdlChain
,
1939 /*OUT*/ PIO_STATUS_BLOCK IoStatus
1946 /*IN*/ PFILE_OBJECT FileObject
,
1947 /*IN*/ PMDL MdlChain
1953 CcMdlWriteComplete (
1954 /*IN*/ PFILE_OBJECT FileObject
,
1955 /*IN*/ PLARGE_INTEGER FileOffset
,
1956 /*IN*/ PMDL MdlChain
1963 /*IN*/ PFILE_OBJECT FileObject
,
1964 /*IN*/ PLARGE_INTEGER FileOffset
,
1965 /*IN*/ ULONG Length
,
1966 #if (VER_PRODUCTBUILD >= 2195)
1969 /*IN*/ BOOLEAN Wait
,
1971 /*IN OUT*/ PVOID
*Bcb
1978 /*IN*/ PFILE_OBJECT FileObject
,
1979 /*IN*/ PLARGE_INTEGER FileOffset
,
1980 /*IN*/ ULONG Length
,
1981 #if (VER_PRODUCTBUILD >= 2195)
1984 /*IN*/ BOOLEAN Wait
,
1987 /*OUT*/ PVOID
*Buffer
1994 /*IN*/ PFILE_OBJECT FileObject
,
1995 /*IN*/ PLARGE_INTEGER FileOffset
,
1996 /*IN*/ ULONG Length
,
1997 /*OUT*/ PMDL
*MdlChain
,
1998 /*OUT*/ PIO_STATUS_BLOCK IoStatus
2005 /*IN*/ PFILE_OBJECT FileObject
,
2006 /*IN*/ PLARGE_INTEGER FileOffset
,
2007 /*IN*/ ULONG Length
,
2008 /*IN*/ BOOLEAN Zero
,
2009 #if (VER_PRODUCTBUILD >= 2195)
2012 /*IN*/ BOOLEAN Wait
,
2015 /*OUT*/ PVOID
*Buffer
2021 CcPurgeCacheSection (
2022 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
,
2023 /*IN*/ PLARGE_INTEGER FileOffset
/*OPTIONAL*/,
2024 /*IN*/ ULONG Length
,
2025 /*IN*/ BOOLEAN UninitializeCacheMaps
2028 #define CcReadAhead(FO, FOFF, LEN) ( \
2029 if ((LEN) >= 256) { \
2030 CcScheduleReadAhead((FO), (FOFF), (LEN)); \
2034 #if (VER_PRODUCTBUILD >= 2195)
2043 #endif /* (VER_PRODUCTBUILD >= 2195) */
2055 CcScheduleReadAhead (
2056 /*IN*/ PFILE_OBJECT FileObject
,
2057 /*IN*/ PLARGE_INTEGER FileOffset
,
2064 CcSetAdditionalCacheAttributes (
2065 /*IN*/ PFILE_OBJECT FileObject
,
2066 /*IN*/ BOOLEAN DisableReadAhead
,
2067 /*IN*/ BOOLEAN DisableWriteBehind
2073 CcSetBcbOwnerPointer (
2075 /*IN*/ PVOID OwnerPointer
2081 CcSetDirtyPageThreshold (
2082 /*IN*/ PFILE_OBJECT FileObject
,
2083 /*IN*/ ULONG DirtyPageThreshold
2089 CcSetDirtyPinnedData (
2090 /*IN*/ PVOID BcbVoid
,
2091 /*IN*/ PLARGE_INTEGER Lsn
/*OPTIONAL*/
2098 /*IN*/ PFILE_OBJECT FileObject
,
2099 /*IN*/ PCC_FILE_SIZES FileSizes
2102 typedef VOID (NTAPI
*PFLUSH_TO_LSN
) (
2103 /*IN*/ PVOID LogHandle
,
2104 /*IN*/ PLARGE_INTEGER Lsn
2110 CcSetLogHandleForFile (
2111 /*IN*/ PFILE_OBJECT FileObject
,
2112 /*IN*/ PVOID LogHandle
,
2113 /*IN*/ PFLUSH_TO_LSN FlushToLsnRoutine
2119 CcSetReadAheadGranularity (
2120 /*IN*/ PFILE_OBJECT FileObject
,
2121 /*IN*/ ULONG Granularity
/* default: PAGE_SIZE */
2122 /* allowed: 2^n * PAGE_SIZE */
2128 CcUninitializeCacheMap (
2129 /*IN*/ PFILE_OBJECT FileObject
,
2130 /*IN*/ PLARGE_INTEGER TruncateSize
/*OPTIONAL*/,
2131 /*IN*/ PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent
/*OPTIONAL*/
2144 CcUnpinDataForThread (
2146 /*IN*/ ERESOURCE_THREAD ResourceThreadId
2152 CcUnpinRepinnedBcb (
2154 /*IN*/ BOOLEAN WriteThrough
,
2155 /*OUT*/ PIO_STATUS_BLOCK IoStatus
2158 #if (VER_PRODUCTBUILD >= 2195)
2163 CcWaitForCurrentLazyWriterActivity (
2167 #endif /* (VER_PRODUCTBUILD >= 2195) */
2173 /*IN*/ PFILE_OBJECT FileObject
,
2174 /*IN*/ PLARGE_INTEGER StartOffset
,
2175 /*IN*/ PLARGE_INTEGER EndOffset
,
2182 ExDisableResourceBoostLite (
2183 /*IN*/ PERESOURCE Resource
2189 ExQueryPoolBlockSize (
2190 /*IN*/ PVOID PoolBlock
,
2191 /*OUT*/ PBOOLEAN QuotaCharged
2194 #define FlagOn(x, f) ((x) & (f))
2199 FsRtlAddToTunnelCache (
2200 /*IN*/ PTUNNEL Cache
,
2201 /*IN*/ ULONGLONG DirectoryKey
,
2202 /*IN*/ PUNICODE_STRING ShortName
,
2203 /*IN*/ PUNICODE_STRING LongName
,
2204 /*IN*/ BOOLEAN KeyByShortName
,
2205 /*IN*/ ULONG DataLength
,
2209 #if (VER_PRODUCTBUILD >= 2195)
2213 FsRtlAllocateFileLock (
2214 /*IN*/ PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine
/*OPTIONAL*/,
2215 /*IN*/ PUNLOCK_ROUTINE UnlockRoutine
/*OPTIONAL*/
2218 #endif /* (VER_PRODUCTBUILD >= 2195) */
2224 /*IN*/ POOL_TYPE PoolType
,
2225 /*IN*/ ULONG NumberOfBytes
2231 FsRtlAllocatePoolWithQuota (
2232 /*IN*/ POOL_TYPE PoolType
,
2233 /*IN*/ ULONG NumberOfBytes
2239 FsRtlAllocatePoolWithQuotaTag (
2240 /*IN*/ POOL_TYPE PoolType
,
2241 /*IN*/ ULONG NumberOfBytes
,
2248 FsRtlAllocatePoolWithTag (
2249 /*IN*/ POOL_TYPE PoolType
,
2250 /*IN*/ ULONG NumberOfBytes
,
2257 FsRtlAreNamesEqual (
2258 /*IN*/ PUNICODE_STRING Name1
,
2259 /*IN*/ PUNICODE_STRING Name2
,
2260 /*IN*/ BOOLEAN IgnoreCase
,
2261 /*IN*/ PWCHAR UpcaseTable
/*OPTIONAL*/
2264 #define FsRtlAreThereCurrentFileLocks(FL) ( \
2265 ((FL)->FastIoIsQuestionable) \
2269 FsRtlCheckLockForReadAccess:
2271 All this really does is pick out the lock parameters from the irp (io stack
2272 location?), get IoGetRequestorProcess, and pass values on to
2273 FsRtlFastCheckLockForRead.
2278 FsRtlCheckLockForReadAccess (
2279 /*IN*/ PFILE_LOCK FileLock
,
2284 FsRtlCheckLockForWriteAccess:
2286 All this really does is pick out the lock parameters from the irp (io stack
2287 location?), get IoGetRequestorProcess, and pass values on to
2288 FsRtlFastCheckLockForWrite.
2293 FsRtlCheckLockForWriteAccess (
2294 /*IN*/ PFILE_LOCK FileLock
,
2300 (*POPLOCK_WAIT_COMPLETE_ROUTINE
) (
2301 /*IN*/ PVOID Context
,
2307 (*POPLOCK_FS_PREPOST_IRP
) (
2308 /*IN*/ PVOID Context
,
2316 /*IN*/ POPLOCK Oplock
,
2318 /*IN*/ PVOID Context
,
2319 /*IN*/ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine
/*OPTIONAL*/,
2320 /*IN*/ POPLOCK_FS_PREPOST_IRP PostIrpRoutine
/*OPTIONAL*/
2327 /*IN*/ PFILE_OBJECT FileObject
,
2328 /*IN*/ PLARGE_INTEGER FileOffset
,
2329 /*IN*/ ULONG Length
,
2330 /*IN*/ BOOLEAN Wait
,
2331 /*IN*/ ULONG LockKey
,
2332 /*OUT*/ PVOID Buffer
,
2333 /*OUT*/ PIO_STATUS_BLOCK IoStatus
,
2334 /*IN*/ PDEVICE_OBJECT DeviceObject
2341 /*IN*/ PFILE_OBJECT FileObject
,
2342 /*IN*/ PLARGE_INTEGER FileOffset
,
2343 /*IN*/ ULONG Length
,
2344 /*IN*/ BOOLEAN Wait
,
2345 /*IN*/ ULONG LockKey
,
2346 /*IN*/ PVOID Buffer
,
2347 /*OUT*/ PIO_STATUS_BLOCK IoStatus
,
2348 /*IN*/ PDEVICE_OBJECT DeviceObject
2354 FsRtlCurrentBatchOplock (
2355 /*IN*/ POPLOCK Oplock
2361 FsRtlDeleteKeyFromTunnelCache (
2362 /*IN*/ PTUNNEL Cache
,
2363 /*IN*/ ULONGLONG DirectoryKey
2369 FsRtlDeleteTunnelCache (
2370 /*IN*/ PTUNNEL Cache
2376 FsRtlDeregisterUncProvider (
2377 /*IN*/ HANDLE Handle
2383 FsRtlDoesNameContainWildCards (
2384 /*IN*/ PUNICODE_STRING Name
2387 #define FsRtlEnterFileSystem KeEnterCriticalRegion
2389 #define FsRtlExitFileSystem KeLeaveCriticalRegion
2394 FsRtlFastCheckLockForRead (
2395 /*IN*/ PFILE_LOCK FileLock
,
2396 /*IN*/ PLARGE_INTEGER FileOffset
,
2397 /*IN*/ PLARGE_INTEGER Length
,
2399 /*IN*/ PFILE_OBJECT FileObject
,
2400 /*IN*/ PEPROCESS Process
2406 FsRtlFastCheckLockForWrite (
2407 /*IN*/ PFILE_LOCK FileLock
,
2408 /*IN*/ PLARGE_INTEGER FileOffset
,
2409 /*IN*/ PLARGE_INTEGER Length
,
2411 /*IN*/ PFILE_OBJECT FileObject
,
2412 /*IN*/ PEPROCESS Process
2415 #define FsRtlFastLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) ( \
2416 FsRtlPrivateLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, NULL, A10, A11) \
2422 FsRtlFastUnlockAll (
2423 /*IN*/ PFILE_LOCK FileLock
,
2424 /*IN*/ PFILE_OBJECT FileObject
,
2425 /*IN*/ PEPROCESS Process
,
2426 /*IN*/ PVOID Context
/*OPTIONAL*/
2428 /* ret: STATUS_RANGE_NOT_LOCKED */
2433 FsRtlFastUnlockAllByKey (
2434 /*IN*/ PFILE_LOCK FileLock
,
2435 /*IN*/ PFILE_OBJECT FileObject
,
2436 /*IN*/ PEPROCESS Process
,
2438 /*IN*/ PVOID Context
/*OPTIONAL*/
2440 /* ret: STATUS_RANGE_NOT_LOCKED */
2445 FsRtlFastUnlockSingle (
2446 /*IN*/ PFILE_LOCK FileLock
,
2447 /*IN*/ PFILE_OBJECT FileObject
,
2448 /*IN*/ PLARGE_INTEGER FileOffset
,
2449 /*IN*/ PLARGE_INTEGER Length
,
2450 /*IN*/ PEPROCESS Process
,
2452 /*IN*/ PVOID Context
/*OPTIONAL*/,
2453 /*IN*/ BOOLEAN AlreadySynchronized
2455 /* ret: STATUS_RANGE_NOT_LOCKED */
2460 FsRtlFindInTunnelCache (
2461 /*IN*/ PTUNNEL Cache
,
2462 /*IN*/ ULONGLONG DirectoryKey
,
2463 /*IN*/ PUNICODE_STRING Name
,
2464 /*OUT*/ PUNICODE_STRING ShortName
,
2465 /*OUT*/ PUNICODE_STRING LongName
,
2466 /*IN OUT*/ PULONG DataLength
,
2470 #if (VER_PRODUCTBUILD >= 2195)
2476 /*IN*/ PFILE_LOCK FileLock
2479 #endif /* (VER_PRODUCTBUILD >= 2195) */
2485 /*IN*/ PFILE_OBJECT FileObject
,
2486 /*IN OUT*/ PLARGE_INTEGER FileSize
2490 FsRtlGetNextFileLock:
2492 ret: NULL if no more locks
2495 FsRtlGetNextFileLock uses FileLock->LastReturnedLockInfo and
2496 FileLock->LastReturnedLock as storage.
2497 LastReturnedLock is a pointer to the 'raw' lock inkl. double linked
2498 list, and FsRtlGetNextFileLock needs this to get next lock on subsequent
2499 calls with Restart = FALSE.
2504 FsRtlGetNextFileLock (
2505 /*IN*/ PFILE_LOCK FileLock
,
2506 /*IN*/ BOOLEAN Restart
2512 FsRtlInitializeFileLock (
2513 /*IN*/ PFILE_LOCK FileLock
,
2514 /*IN*/ PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine
/*OPTIONAL*/,
2515 /*IN*/ PUNLOCK_ROUTINE UnlockRoutine
/*OPTIONAL*/
2521 FsRtlInitializeOplock (
2522 /*IN OUT*/ POPLOCK Oplock
2528 FsRtlInitializeTunnelCache (
2529 /*IN*/ PTUNNEL Cache
2535 FsRtlIsNameInExpression (
2536 /*IN*/ PUNICODE_STRING Expression
,
2537 /*IN*/ PUNICODE_STRING Name
,
2538 /*IN*/ BOOLEAN IgnoreCase
,
2539 /*IN*/ PWCHAR UpcaseTable
/*OPTIONAL*/
2545 FsRtlIsNtstatusExpected (
2546 /*IN*/ NTSTATUS Ntstatus
2549 #define FsRtlIsUnicodeCharacterWild(C) ( \
2552 FlagOn((*FsRtlLegalAnsiCharacterArray)[(C)], FSRTL_WILD_CHARACTER )) \
2558 FsRtlMdlReadComplete (
2559 /*IN*/ PFILE_OBJECT FileObject
,
2560 /*IN*/ PMDL MdlChain
2566 FsRtlMdlReadCompleteDev (
2567 /*IN*/ PFILE_OBJECT FileObject
,
2568 /*IN*/ PMDL MdlChain
,
2569 /*IN*/ PDEVICE_OBJECT DeviceObject
2575 FsRtlMdlWriteComplete (
2576 /*IN*/ PFILE_OBJECT FileObject
,
2577 /*IN*/ PLARGE_INTEGER FileOffset
,
2578 /*IN*/ PMDL MdlChain
2584 FsRtlMdlWriteCompleteDev (
2585 /*IN*/ PFILE_OBJECT FileObject
,
2586 /*IN*/ PLARGE_INTEGER FileOffset
,
2587 /*IN*/ PMDL MdlChain
,
2588 /*IN*/ PDEVICE_OBJECT DeviceObject
2594 FsRtlNormalizeNtstatus (
2595 /*IN*/ NTSTATUS Exception
,
2596 /*IN*/ NTSTATUS GenericException
2602 FsRtlNotifyChangeDirectory (
2603 /*IN*/ PNOTIFY_SYNC NotifySync
,
2604 /*IN*/ PVOID FsContext
,
2605 /*IN*/ PSTRING FullDirectoryName
,
2606 /*IN*/ PLIST_ENTRY NotifyList
,
2607 /*IN*/ BOOLEAN WatchTree
,
2608 /*IN*/ ULONG CompletionFilter
,
2609 /*IN*/ PIRP NotifyIrp
2615 FsRtlNotifyCleanup (
2616 /*IN*/ PNOTIFY_SYNC NotifySync
,
2617 /*IN*/ PLIST_ENTRY NotifyList
,
2618 /*IN*/ PVOID FsContext
2621 typedef BOOLEAN (*PCHECK_FOR_TRAVERSE_ACCESS
) (
2622 /*IN*/ PVOID NotifyContext
,
2623 /*IN*/ PVOID TargetContext
,
2624 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
2630 FsRtlNotifyFullChangeDirectory (
2631 /*IN*/ PNOTIFY_SYNC NotifySync
,
2632 /*IN*/ PLIST_ENTRY NotifyList
,
2633 /*IN*/ PVOID FsContext
,
2634 /*IN*/ PSTRING FullDirectoryName
,
2635 /*IN*/ BOOLEAN WatchTree
,
2636 /*IN*/ BOOLEAN IgnoreBuffer
,
2637 /*IN*/ ULONG CompletionFilter
,
2638 /*IN*/ PIRP NotifyIrp
,
2639 /*IN*/ PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback
/*OPTIONAL*/,
2640 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
/*OPTIONAL*/
2646 FsRtlNotifyFullReportChange (
2647 /*IN*/ PNOTIFY_SYNC NotifySync
,
2648 /*IN*/ PLIST_ENTRY NotifyList
,
2649 /*IN*/ PSTRING FullTargetName
,
2650 /*IN*/ USHORT TargetNameOffset
,
2651 /*IN*/ PSTRING StreamName
/*OPTIONAL*/,
2652 /*IN*/ PSTRING NormalizedParentName
/*OPTIONAL*/,
2653 /*IN*/ ULONG FilterMatch
,
2654 /*IN*/ ULONG Action
,
2655 /*IN*/ PVOID TargetContext
2661 FsRtlNotifyInitializeSync (
2662 /*IN*/ PNOTIFY_SYNC NotifySync
2668 FsRtlNotifyReportChange (
2669 /*IN*/ PNOTIFY_SYNC NotifySync
,
2670 /*IN*/ PLIST_ENTRY NotifyList
,
2671 /*IN*/ PSTRING FullTargetName
,
2672 /*IN*/ PUSHORT FileNamePartLength
,
2673 /*IN*/ ULONG FilterMatch
2679 FsRtlNotifyUninitializeSync (
2680 /*IN*/ PNOTIFY_SYNC NotifySync
2683 #if (VER_PRODUCTBUILD >= 2195)
2688 FsRtlNotifyVolumeEvent (
2689 /*IN*/ PFILE_OBJECT FileObject
,
2690 /*IN*/ ULONG EventCode
2693 #endif /* (VER_PRODUCTBUILD >= 2195) */
2699 /*IN*/ POPLOCK Oplock
,
2701 /*IN*/ ULONG OpenCount
2707 FsRtlOplockIsFastIoPossible (
2708 /*IN*/ POPLOCK Oplock
2714 ret: IoStatus->Status: STATUS_PENDING, STATUS_LOCK_NOT_GRANTED
2717 -Calls IoCompleteRequest if Irp
2718 -Uses exception handling / ExRaiseStatus with STATUS_INSUFFICIENT_RESOURCES
2724 /*IN*/ PFILE_LOCK FileLock
,
2725 /*IN*/ PFILE_OBJECT FileObject
,
2726 /*IN*/ PLARGE_INTEGER FileOffset
,
2727 /*IN*/ PLARGE_INTEGER Length
,
2728 /*IN*/ PEPROCESS Process
,
2730 /*IN*/ BOOLEAN FailImmediately
,
2731 /*IN*/ BOOLEAN ExclusiveLock
,
2732 /*OUT*/ PIO_STATUS_BLOCK IoStatus
,
2733 /*IN*/ PIRP Irp
/*OPTIONAL*/,
2734 /*IN*/ PVOID Context
,
2735 /*IN*/ BOOLEAN AlreadySynchronized
2739 FsRtlProcessFileLock:
2742 -STATUS_INVALID_DEVICE_REQUEST
2743 -STATUS_RANGE_NOT_LOCKED from unlock routines.
2744 -STATUS_PENDING, STATUS_LOCK_NOT_GRANTED from FsRtlPrivateLock
2745 (redirected IoStatus->Status).
2748 -switch ( Irp->CurrentStackLocation->MinorFunction )
2749 lock: return FsRtlPrivateLock;
2750 unlocksingle: return FsRtlFastUnlockSingle;
2751 unlockall: return FsRtlFastUnlockAll;
2752 unlockallbykey: return FsRtlFastUnlockAllByKey;
2753 default: IofCompleteRequest with STATUS_INVALID_DEVICE_REQUEST;
2754 return STATUS_INVALID_DEVICE_REQUEST;
2756 -'AllwaysZero' is passed thru as 'AllwaysZero' to lock / unlock routines.
2757 -'Irp' is passet thru as 'Irp' to FsRtlPrivateLock.
2762 FsRtlProcessFileLock (
2763 /*IN*/ PFILE_LOCK FileLock
,
2765 /*IN*/ PVOID Context
/*OPTIONAL*/
2771 FsRtlRegisterUncProvider (
2772 /*IN OUT*/ PHANDLE MupHandle
,
2773 /*IN*/ PUNICODE_STRING RedirectorDeviceName
,
2774 /*IN*/ BOOLEAN MailslotsSupported
2780 FsRtlUninitializeFileLock (
2781 /*IN*/ PFILE_LOCK FileLock
2787 FsRtlUninitializeOplock (
2788 /*IN OUT*/ POPLOCK Oplock
2801 HalQueryRealTimeClock (
2802 /*IN OUT*/ PTIME_FIELDS TimeFields
2808 HalSetRealTimeClock (
2809 /*IN*/ PTIME_FIELDS TimeFields
2812 #define InitializeMessageHeader(m, l, t) { \
2813 (m)->Length = (USHORT)(l); \
2814 (m)->DataLength = (USHORT)(l - sizeof( LPC_MESSAGE )); \
2815 (m)->MessageType = (USHORT)(t); \
2816 (m)->DataInfoOffset = 0; \
2822 IoAcquireVpbSpinLock (
2829 IoCheckDesiredAccess (
2830 /*IN OUT*/ PACCESS_MASK DesiredAccess
,
2831 /*IN*/ ACCESS_MASK GrantedAccess
2837 IoCheckEaBufferValidity (
2838 /*IN*/ PFILE_FULL_EA_INFORMATION EaBuffer
,
2839 /*IN*/ ULONG EaLength
,
2840 /*OUT*/ PULONG ErrorOffset
2846 IoCheckFunctionAccess (
2847 /*IN*/ ACCESS_MASK GrantedAccess
,
2848 /*IN*/ UCHAR MajorFunction
,
2849 /*IN*/ UCHAR MinorFunction
,
2850 /*IN*/ ULONG IoControlCode
,
2851 /*IN*/ PFILE_INFORMATION_CLASS FileInformationClass
/*OPTIONAL*/,
2852 /*IN*/ PFS_INFORMATION_CLASS FsInformationClass
/*OPTIONAL*/
2855 #if (VER_PRODUCTBUILD >= 2195)
2860 IoCheckQuotaBufferValidity (
2861 /*IN*/ PFILE_QUOTA_INFORMATION QuotaBuffer
,
2862 /*IN*/ ULONG QuotaLength
,
2863 /*OUT*/ PULONG ErrorOffset
2866 #endif /* (VER_PRODUCTBUILD >= 2195) */
2871 IoCreateStreamFileObject (
2872 /*IN*/ PFILE_OBJECT FileObject
/*OPTIONAL*/,
2873 /*IN*/ PDEVICE_OBJECT DeviceObject
/*OPTIONAL*/
2876 #if (VER_PRODUCTBUILD >= 2195)
2881 IoCreateStreamFileObjectLite (
2882 /*IN*/ PFILE_OBJECT FileObject
/*OPTIONAL*/,
2883 /*IN*/ PDEVICE_OBJECT DeviceObject
/*OPTIONAL*/
2886 #endif /* (VER_PRODUCTBUILD >= 2195) */
2891 IoFastQueryNetworkAttributes (
2892 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
,
2893 /*IN*/ ACCESS_MASK DesiredAccess
,
2894 /*IN*/ ULONG OpenOptions
,
2895 /*OUT*/ PIO_STATUS_BLOCK IoStatus
,
2896 /*OUT*/ PFILE_NETWORK_OPEN_INFORMATION Buffer
2902 IoGetAttachedDevice (
2903 /*IN*/ PDEVICE_OBJECT DeviceObject
2909 IoGetBaseFileSystemDeviceObject (
2910 /*IN*/ PFILE_OBJECT FileObject
2916 IoGetRequestorProcess (
2920 #if (VER_PRODUCTBUILD >= 2195)
2925 IoGetRequestorProcessId (
2929 #endif /* (VER_PRODUCTBUILD >= 2195) */
2938 #define IoIsFileOpenedExclusively(FileObject) ( \
2940 (FileObject)->SharedRead || \
2941 (FileObject)->SharedWrite || \
2942 (FileObject)->SharedDelete \
2949 IoIsOperationSynchronous (
2957 /*IN*/ PETHREAD Thread
2960 #if (VER_PRODUCTBUILD >= 2195)
2965 IoIsValidNameGraftingBuffer (
2967 /*IN*/ PREPARSE_DATA_BUFFER ReparseBuffer
2970 #endif /* (VER_PRODUCTBUILD >= 2195) */
2976 /*IN*/ PFILE_OBJECT FileObject
,
2978 /*IN*/ PLARGE_INTEGER Offset
,
2979 /*IN*/ PKEVENT Event
,
2980 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
2986 IoQueryFileInformation (
2987 /*IN*/ PFILE_OBJECT FileObject
,
2988 /*IN*/ FILE_INFORMATION_CLASS FileInformationClass
,
2989 /*IN*/ ULONG Length
,
2990 /*OUT*/ PVOID FileInformation
,
2991 /*OUT*/ PULONG ReturnedLength
2997 IoQueryVolumeInformation (
2998 /*IN*/ PFILE_OBJECT FileObject
,
2999 /*IN*/ FS_INFORMATION_CLASS FsInformationClass
,
3000 /*IN*/ ULONG Length
,
3001 /*OUT*/ PVOID FsInformation
,
3002 /*OUT*/ PULONG ReturnedLength
3008 IoRegisterFileSystem (
3009 /*IN OUT*/ PDEVICE_OBJECT DeviceObject
3012 #if (VER_PRODUCTBUILD >= 1381)
3014 typedef VOID (NTAPI
*PDRIVER_FS_NOTIFICATION
) (
3015 /*IN*/ PDEVICE_OBJECT DeviceObject
,
3016 /*IN*/ BOOLEAN DriverActive
3022 IoRegisterFsRegistrationChange (
3023 /*IN*/ PDRIVER_OBJECT DriverObject
,
3024 /*IN*/ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
3027 #endif /* (VER_PRODUCTBUILD >= 1381) */
3032 IoReleaseVpbSpinLock (
3039 IoSetDeviceToVerify (
3040 /*IN*/ PETHREAD Thread
,
3041 /*IN*/ PDEVICE_OBJECT DeviceObject
3048 /*IN*/ PFILE_OBJECT FileObject
,
3049 /*IN*/ FILE_INFORMATION_CLASS FileInformationClass
,
3050 /*IN*/ ULONG Length
,
3051 /*IN*/ PVOID FileInformation
3064 IoSynchronousPageWrite (
3065 /*IN*/ PFILE_OBJECT FileObject
,
3067 /*IN*/ PLARGE_INTEGER FileOffset
,
3068 /*IN*/ PKEVENT Event
,
3069 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
3076 /*IN*/ PETHREAD Thread
3082 IoUnregisterFileSystem (
3083 /*IN OUT*/ PDEVICE_OBJECT DeviceObject
3086 #if (VER_PRODUCTBUILD >= 1381)
3091 IoUnregisterFsRegistrationChange (
3092 /*IN*/ PDRIVER_OBJECT DriverObject
,
3093 /*IN*/ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
3096 #endif /* (VER_PRODUCTBUILD >= 1381) */
3102 /*IN*/ PDEVICE_OBJECT DeviceObject
,
3103 /*IN*/ BOOLEAN AllowRawMount
3110 /*IN*/ PEPROCESS Process
3124 /*IN*/ PRKQUEUE Queue
,
3125 /*IN*/ ULONG Count
/*OPTIONAL*/
3132 /*IN*/ PRKQUEUE Queue
,
3133 /*IN*/ PLIST_ENTRY Entry
3140 /*IN*/ PRKQUEUE Queue
,
3141 /*IN*/ PLIST_ENTRY Entry
3149 /*IN*/ PVOID SystemArgument1
,
3150 /*IN*/ PVOID SystemArgument2
,
3151 /*IN*/ KPRIORITY PriorityBoost
3158 /*IN*/ PRKQUEUE Queue
3165 /*IN*/ PRKQUEUE Queue
,
3166 /*IN*/ KPROCESSOR_MODE WaitMode
,
3167 /*IN*/ PLARGE_INTEGER Timeout
/*OPTIONAL*/
3174 /*IN*/ PRKQUEUE Queue
3177 #if (VER_PRODUCTBUILD >= 2195)
3182 KeStackAttachProcess (
3183 /*IN*/ PKPROCESS Process
,
3184 /*OUT*/ PKAPC_STATE ApcState
3190 KeUnstackDetachProcess (
3191 /*IN*/ PKAPC_STATE ApcState
3194 #endif /* (VER_PRODUCTBUILD >= 2195) */
3199 MmCanFileBeTruncated (
3200 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
,
3201 /*IN*/ PLARGE_INTEGER NewFileSize
3207 MmFlushImageSection (
3208 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
,
3209 /*IN*/ MMFLUSH_TYPE FlushType
3215 MmForceSectionClosed (
3216 /*IN*/ PSECTION_OBJECT_POINTERS SectionObjectPointer
,
3217 /*IN*/ BOOLEAN DelayClose
3220 #if (VER_PRODUCTBUILD >= 1381)
3225 MmIsRecursiveIoFault (
3231 #define MmIsRecursiveIoFault() ( \
3232 (PsGetCurrentThread()->DisablePageFaultClustering) | \
3233 (PsGetCurrentThread()->ForwardClusterOnly) \
3241 MmMapViewOfSection (
3242 /*IN*/ PVOID SectionObject
,
3243 /*IN*/ PEPROCESS Process
,
3244 /*IN OUT*/ PVOID
*BaseAddress
,
3245 /*IN*/ ULONG ZeroBits
,
3246 /*IN*/ ULONG CommitSize
,
3247 /*IN OUT*/ PLARGE_INTEGER SectionOffset
/*OPTIONAL*/,
3248 /*IN OUT*/ PULONG ViewSize
,
3249 /*IN*/ SECTION_INHERIT InheritDisposition
,
3250 /*IN*/ ULONG AllocationType
,
3251 /*IN*/ ULONG Protect
3257 MmSetAddressRangeModified (
3258 /*IN*/ PVOID Address
,
3266 /*IN*/ KPROCESSOR_MODE ObjectAttributesAccessMode
/*OPTIONAL*/,
3267 /*IN*/ POBJECT_TYPE ObjectType
,
3268 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
/*OPTIONAL*/,
3269 /*IN*/ KPROCESSOR_MODE AccessMode
,
3270 /*IN OUT*/ PVOID ParseContext
/*OPTIONAL*/,
3271 /*IN*/ ULONG ObjectSize
,
3272 /*IN*/ ULONG PagedPoolCharge
/*OPTIONAL*/,
3273 /*IN*/ ULONG NonPagedPoolCharge
/*OPTIONAL*/,
3274 /*OUT*/ PVOID
*Object
3280 ObGetObjectPointerCount (
3288 /*IN*/ PVOID Object
,
3289 /*IN*/ PACCESS_STATE PassedAccessState
/*OPTIONAL*/,
3290 /*IN*/ ACCESS_MASK DesiredAccess
,
3291 /*IN*/ ULONG AdditionalReferences
,
3292 /*OUT*/ PVOID
*ReferencedObject
/*OPTIONAL*/,
3293 /*OUT*/ PHANDLE Handle
3299 ObMakeTemporaryObject (
3306 ObOpenObjectByPointer (
3307 /*IN*/ PVOID Object
,
3308 /*IN*/ ULONG HandleAttributes
,
3309 /*IN*/ PACCESS_STATE PassedAccessState
/*OPTIONAL*/,
3310 /*IN*/ ACCESS_MASK DesiredAccess
/*OPTIONAL*/,
3311 /*IN*/ POBJECT_TYPE ObjectType
/*OPTIONAL*/,
3312 /*IN*/ KPROCESSOR_MODE AccessMode
,
3313 /*OUT*/ PHANDLE Handle
3320 /*IN*/ PVOID Object
,
3321 /*OUT*/ POBJECT_NAME_INFORMATION ObjectNameInfo
,
3322 /*IN*/ ULONG Length
,
3323 /*OUT*/ PULONG ReturnLength
3329 ObQueryObjectAuditingByHandle (
3330 /*IN*/ HANDLE Handle
,
3331 /*OUT*/ PBOOLEAN GenerateOnClose
3337 ObReferenceObjectByName (
3338 /*IN*/ PUNICODE_STRING ObjectName
,
3339 /*IN*/ ULONG Attributes
,
3340 /*IN*/ PACCESS_STATE PassedAccessState
/*OPTIONAL*/,
3341 /*IN*/ ACCESS_MASK DesiredAccess
/*OPTIONAL*/,
3342 /*IN*/ POBJECT_TYPE ObjectType
,
3343 /*IN*/ KPROCESSOR_MODE AccessMode
,
3344 /*IN OUT*/ PVOID ParseContext
/*OPTIONAL*/,
3345 /*OUT*/ PVOID
*Object
3352 /*IN*/ PEPROCESS Process
,
3353 /*IN*/ POOL_TYPE PoolType
,
3357 #define PsDereferenceImpersonationToken(T) \
3358 {if (ARGUMENT_PRESENT(T)) { \
3359 (ObDereferenceObject((T))); \
3365 #define PsDereferencePrimaryToken(T) (ObDereferenceObject((T)))
3370 PsGetProcessExitTime (
3377 PsIsThreadTerminating (
3378 /*IN*/ PETHREAD Thread
3384 PsLookupProcessByProcessId (
3385 /*IN*/ PVOID ProcessId
,
3386 /*OUT*/ PEPROCESS
*Process
3392 PsLookupProcessThreadByCid (
3393 /*IN*/ PCLIENT_ID Cid
,
3394 /*OUT*/ PEPROCESS
*Process
/*OPTIONAL*/,
3395 /*OUT*/ PETHREAD
*Thread
3401 PsLookupThreadByThreadId (
3402 /*IN*/ PVOID UniqueThreadId
,
3403 /*OUT*/ PETHREAD
*Thread
3409 PsReferenceImpersonationToken (
3410 /*IN*/ PETHREAD Thread
,
3411 /*OUT*/ PBOOLEAN CopyOnUse
,
3412 /*OUT*/ PBOOLEAN EffectiveOnly
,
3413 /*OUT*/ PSECURITY_IMPERSONATION_LEVEL Level
3419 PsReferencePrimaryToken (
3420 /*IN*/ PEPROCESS Process
3427 /*IN*/ PEPROCESS Process
,
3428 /*IN*/ POOL_TYPE PoolType
,
3442 RtlAbsoluteToSelfRelativeSD (
3443 /*IN*/ PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
,
3444 /*IN OUT*/ PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
,
3445 /*IN*/ PULONG BufferLength
3452 /*IN*/ HANDLE HeapHandle
,
3461 /*IN*/ USHORT CompressionFormatAndEngine
,
3462 /*IN*/ PUCHAR UncompressedBuffer
,
3463 /*IN*/ ULONG UncompressedBufferSize
,
3464 /*OUT*/ PUCHAR CompressedBuffer
,
3465 /*IN*/ ULONG CompressedBufferSize
,
3466 /*IN*/ ULONG UncompressedChunkSize
,
3467 /*OUT*/ PULONG FinalCompressedSize
,
3468 /*IN*/ PVOID WorkSpace
3475 /*IN*/ PUCHAR UncompressedBuffer
,
3476 /*IN*/ ULONG UncompressedBufferSize
,
3477 /*OUT*/ PUCHAR CompressedBuffer
,
3478 /*IN*/ ULONG CompressedBufferSize
,
3479 /*IN OUT*/ PCOMPRESSED_DATA_INFO CompressedDataInfo
,
3480 /*IN*/ ULONG CompressedDataInfoLength
,
3481 /*IN*/ PVOID WorkSpace
3487 RtlConvertSidToUnicodeString (
3488 /*OUT*/ PUNICODE_STRING DestinationString
,
3490 /*IN*/ BOOLEAN AllocateDestinationString
3497 /*IN*/ ULONG Length
,
3498 /*IN*/ PSID Destination
,
3505 RtlDecompressBuffer (
3506 /*IN*/ USHORT CompressionFormat
,
3507 /*OUT*/ PUCHAR UncompressedBuffer
,
3508 /*IN*/ ULONG UncompressedBufferSize
,
3509 /*IN*/ PUCHAR CompressedBuffer
,
3510 /*IN*/ ULONG CompressedBufferSize
,
3511 /*OUT*/ PULONG FinalUncompressedSize
3517 RtlDecompressChunks (
3518 /*OUT*/ PUCHAR UncompressedBuffer
,
3519 /*IN*/ ULONG UncompressedBufferSize
,
3520 /*IN*/ PUCHAR CompressedBuffer
,
3521 /*IN*/ ULONG CompressedBufferSize
,
3522 /*IN*/ PUCHAR CompressedTail
,
3523 /*IN*/ ULONG CompressedTailSize
,
3524 /*IN*/ PCOMPRESSED_DATA_INFO CompressedDataInfo
3530 RtlDecompressFragment (
3531 /*IN*/ USHORT CompressionFormat
,
3532 /*OUT*/ PUCHAR UncompressedFragment
,
3533 /*IN*/ ULONG UncompressedFragmentSize
,
3534 /*IN*/ PUCHAR CompressedBuffer
,
3535 /*IN*/ ULONG CompressedBufferSize
,
3536 /*IN*/ ULONG FragmentOffset
,
3537 /*OUT*/ PULONG FinalUncompressedSize
,
3538 /*IN*/ PVOID WorkSpace
3545 /*IN*/ USHORT CompressionFormat
,
3546 /*IN OUT*/ PUCHAR
*CompressedBuffer
,
3547 /*IN*/ PUCHAR EndOfCompressedBufferPlus1
,
3548 /*OUT*/ PUCHAR
*ChunkBuffer
,
3549 /*OUT*/ PULONG ChunkSize
3563 RtlFillMemoryUlong (
3564 /*IN*/ PVOID Destination
,
3565 /*IN*/ ULONG Length
,
3573 /*IN*/ HANDLE HeapHandle
,
3581 RtlGenerate8dot3Name (
3582 /*IN*/ PUNICODE_STRING Name
,
3583 /*IN*/ BOOLEAN AllowExtendedCharacters
,
3584 /*IN OUT*/ PGENERATE_NAME_CONTEXT Context
,
3585 /*OUT*/ PUNICODE_STRING Name8dot3
3591 RtlGetCompressionWorkSpaceSize (
3592 /*IN*/ USHORT CompressionFormatAndEngine
,
3593 /*OUT*/ PULONG CompressBufferWorkSpaceSize
,
3594 /*OUT*/ PULONG CompressFragmentWorkSpaceSize
3600 RtlGetDaclSecurityDescriptor (
3601 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3602 /*OUT*/ PBOOLEAN DaclPresent
,
3604 /*OUT*/ PBOOLEAN DaclDefaulted
3610 RtlGetGroupSecurityDescriptor (
3611 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3612 /*OUT*/ PSID
*Group
,
3613 /*OUT*/ PBOOLEAN GroupDefaulted
3619 RtlGetOwnerSecurityDescriptor (
3620 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3621 /*OUT*/ PSID
*Owner
,
3622 /*OUT*/ PBOOLEAN OwnerDefaulted
3629 /*IN OUT*/ PSID Sid
,
3630 /*IN*/ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
,
3631 /*IN*/ UCHAR SubAuthorityCount
3637 RtlIsNameLegalDOS8Dot3 (
3638 /*IN*/ PUNICODE_STRING UnicodeName
,
3639 /*IN*/ PANSI_STRING AnsiName
,
3646 RtlLengthRequiredSid (
3647 /*IN*/ UCHAR SubAuthorityCount
3660 RtlNtStatusToDosError (
3661 /*IN*/ NTSTATUS Status
3668 /*IN*/ USHORT CompressionFormat
,
3669 /*IN OUT*/ PUCHAR
*CompressedBuffer
,
3670 /*IN*/ PUCHAR EndOfCompressedBufferPlus1
,
3671 /*OUT*/ PUCHAR
*ChunkBuffer
,
3672 /*IN*/ ULONG ChunkSize
3678 RtlSecondsSince1970ToTime (
3679 /*IN*/ ULONG SecondsSince1970
,
3680 /*OUT*/ PLARGE_INTEGER Time
3683 #if (VER_PRODUCTBUILD >= 2195)
3688 RtlSelfRelativeToAbsoluteSD (
3689 /*IN*/ PSECURITY_DESCRIPTOR SelfRelativeSD
,
3690 /*OUT*/ PSECURITY_DESCRIPTOR AbsoluteSD
,
3691 /*IN*/ PULONG AbsoluteSDSize
,
3693 /*IN*/ PULONG DaclSize
,
3695 /*IN*/ PULONG SaclSize
,
3697 /*IN*/ PULONG OwnerSize
,
3698 /*IN*/ PSID PrimaryGroup
,
3699 /*IN*/ PULONG PrimaryGroupSize
3702 #endif /* (VER_PRODUCTBUILD >= 2195) */
3707 RtlSetGroupSecurityDescriptor (
3708 /*IN OUT*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3710 /*IN*/ BOOLEAN GroupDefaulted
3716 RtlSetOwnerSecurityDescriptor (
3717 /*IN OUT*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3719 /*IN*/ BOOLEAN OwnerDefaulted
3725 RtlSetSaclSecurityDescriptor (
3726 /*IN OUT*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3727 /*IN*/ BOOLEAN SaclPresent
,
3729 /*IN*/ BOOLEAN SaclDefaulted
3735 RtlSubAuthorityCountSid (
3742 RtlSubAuthoritySid (
3744 /*IN*/ ULONG SubAuthority
3757 SeAppendPrivileges (
3758 PACCESS_STATE AccessState
,
3759 PPRIVILEGE_SET Privileges
3765 SeAuditingFileEvents (
3766 /*IN*/ BOOLEAN AccessGranted
,
3767 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
3773 SeAuditingFileOrGlobalEvents (
3774 /*IN*/ BOOLEAN AccessGranted
,
3775 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3776 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
3782 SeCaptureSubjectContext (
3783 /*OUT*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
3789 SeCreateAccessState (
3790 /*OUT*/ PACCESS_STATE AccessState
,
3791 /*IN*/ PVOID AuxData
,
3792 /*IN*/ ACCESS_MASK AccessMask
,
3793 /*IN*/ PGENERIC_MAPPING Mapping
3799 SeCreateClientSecurity (
3800 /*IN*/ PETHREAD Thread
,
3801 /*IN*/ PSECURITY_QUALITY_OF_SERVICE QualityOfService
,
3802 /*IN*/ BOOLEAN RemoteClient
,
3803 /*OUT*/ PSECURITY_CLIENT_CONTEXT ClientContext
3806 #if (VER_PRODUCTBUILD >= 2195)
3811 SeCreateClientSecurityFromSubjectContext (
3812 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
,
3813 /*IN*/ PSECURITY_QUALITY_OF_SERVICE QualityOfService
,
3814 /*IN*/ BOOLEAN ServerIsRemote
,
3815 /*OUT*/ PSECURITY_CLIENT_CONTEXT ClientContext
3818 #endif /* (VER_PRODUCTBUILD >= 2195) */
3820 #define SeDeleteClientSecurity(C) { \
3821 if (SeTokenType((C)->ClientToken) == TokenPrimary) { \
3822 PsDereferencePrimaryToken( (C)->ClientToken ); \
3824 PsDereferenceImpersonationToken( (C)->ClientToken ); \
3831 SeDeleteObjectAuditAlarm (
3832 /*IN*/ PVOID Object
,
3833 /*IN*/ HANDLE Handle
3836 #define SeEnableAccessToExports() SeExports = *(PSE_EXPORTS *)SeExports;
3842 /*IN*/ PPRIVILEGE_SET Privileges
3848 SeImpersonateClient (
3849 /*IN*/ PSECURITY_CLIENT_CONTEXT ClientContext
,
3850 /*IN*/ PETHREAD ServerThread
/*OPTIONAL*/
3853 #if (VER_PRODUCTBUILD >= 2195)
3858 SeImpersonateClientEx (
3859 /*IN*/ PSECURITY_CLIENT_CONTEXT ClientContext
,
3860 /*IN*/ PETHREAD ServerThread
/*OPTIONAL*/
3863 #endif /* (VER_PRODUCTBUILD >= 2195) */
3868 SeLockSubjectContext (
3869 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
3875 SeMarkLogonSessionForTerminationNotification (
3876 /*IN*/ PLUID LogonId
3882 SeOpenObjectAuditAlarm (
3883 /*IN*/ PUNICODE_STRING ObjectTypeName
,
3884 /*IN*/ PVOID Object
/*OPTIONAL*/,
3885 /*IN*/ PUNICODE_STRING AbsoluteObjectName
/*OPTIONAL*/,
3886 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3887 /*IN*/ PACCESS_STATE AccessState
,
3888 /*IN*/ BOOLEAN ObjectCreated
,
3889 /*IN*/ BOOLEAN AccessGranted
,
3890 /*IN*/ KPROCESSOR_MODE AccessMode
,
3891 /*OUT*/ PBOOLEAN GenerateOnClose
3897 SeOpenObjectForDeleteAuditAlarm (
3898 /*IN*/ PUNICODE_STRING ObjectTypeName
,
3899 /*IN*/ PVOID Object
/*OPTIONAL*/,
3900 /*IN*/ PUNICODE_STRING AbsoluteObjectName
/*OPTIONAL*/,
3901 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3902 /*IN*/ PACCESS_STATE AccessState
,
3903 /*IN*/ BOOLEAN ObjectCreated
,
3904 /*IN*/ BOOLEAN AccessGranted
,
3905 /*IN*/ KPROCESSOR_MODE AccessMode
,
3906 /*OUT*/ PBOOLEAN GenerateOnClose
3913 /*IN OUT*/ PPRIVILEGE_SET RequiredPrivileges
,
3914 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
,
3915 /*IN*/ KPROCESSOR_MODE AccessMode
3921 SeQueryAuthenticationIdToken (
3922 /*IN*/ PACCESS_TOKEN Token
,
3923 /*OUT*/ PLUID LogonId
3926 #if (VER_PRODUCTBUILD >= 2195)
3931 SeQueryInformationToken (
3932 /*IN*/ PACCESS_TOKEN Token
,
3933 /*IN*/ TOKEN_INFORMATION_CLASS TokenInformationClass
,
3934 /*OUT*/ PVOID
*TokenInformation
3937 #endif /* (VER_PRODUCTBUILD >= 2195) */
3942 SeQuerySecurityDescriptorInfo (
3943 /*IN*/ PSECURITY_INFORMATION SecurityInformation
,
3944 /*OUT*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
3945 /*IN OUT*/ PULONG Length
,
3946 /*IN*/ PSECURITY_DESCRIPTOR
*ObjectsSecurityDescriptor
3949 #if (VER_PRODUCTBUILD >= 2195)
3954 SeQuerySessionIdToken (
3955 /*IN*/ PACCESS_TOKEN Token
,
3956 /*IN*/ PULONG SessionId
3959 #endif /* (VER_PRODUCTBUILD >= 2195) */
3961 #define SeQuerySubjectContextToken( SubjectContext ) \
3962 ( ARGUMENT_PRESENT( \
3963 ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken \
3965 ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken : \
3966 ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->PrimaryToken )
3968 typedef NTSTATUS (*PSE_LOGON_SESSION_TERMINATED_ROUTINE
) (
3969 /*IN*/ PLUID LogonId
3975 SeRegisterLogonSessionTerminatedRoutine (
3976 /*IN*/ PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine
3982 SeReleaseSubjectContext (
3983 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
3989 SeSetAccessStateGenericMapping (
3990 PACCESS_STATE AccessState
,
3991 PGENERIC_MAPPING GenericMapping
3997 SeSetSecurityDescriptorInfo (
3998 /*IN*/ PVOID Object
/*OPTIONAL*/,
3999 /*IN*/ PSECURITY_INFORMATION SecurityInformation
,
4000 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
4001 /*IN OUT*/ PSECURITY_DESCRIPTOR
*ObjectsSecurityDescriptor
,
4002 /*IN*/ POOL_TYPE PoolType
,
4003 /*IN*/ PGENERIC_MAPPING GenericMapping
4006 #if (VER_PRODUCTBUILD >= 2195)
4011 SeSetSecurityDescriptorInfoEx (
4012 /*IN*/ PVOID Object
/*OPTIONAL*/,
4013 /*IN*/ PSECURITY_INFORMATION SecurityInformation
,
4014 /*IN*/ PSECURITY_DESCRIPTOR ModificationDescriptor
,
4015 /*IN OUT*/ PSECURITY_DESCRIPTOR
*ObjectsSecurityDescriptor
,
4016 /*IN*/ ULONG AutoInheritFlags
,
4017 /*IN*/ POOL_TYPE PoolType
,
4018 /*IN*/ PGENERIC_MAPPING GenericMapping
4025 /*IN*/ PACCESS_TOKEN Token
4031 SeTokenIsRestricted (
4032 /*IN*/ PACCESS_TOKEN Token
4035 #endif /* (VER_PRODUCTBUILD >= 2195) */
4041 /*IN*/ PACCESS_TOKEN Token
4047 SeUnlockSubjectContext (
4048 /*IN*/ PSECURITY_SUBJECT_CONTEXT SubjectContext
4053 SeUnregisterLogonSessionTerminatedRoutine (
4054 /*IN*/ PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine
4057 #if (VER_PRODUCTBUILD >= 2195)
4062 ZwAdjustPrivilegesToken (
4063 /*IN*/ HANDLE TokenHandle
,
4064 /*IN*/ BOOLEAN DisableAllPrivileges
,
4065 /*IN*/ PTOKEN_PRIVILEGES NewState
,
4066 /*IN*/ ULONG BufferLength
,
4067 /*OUT*/ PTOKEN_PRIVILEGES PreviousState
/*OPTIONAL*/,
4068 /*OUT*/ PULONG ReturnLength
4071 #endif /* (VER_PRODUCTBUILD >= 2195) */
4077 /*IN*/ HANDLE ThreadHandle
4083 ZwAllocateVirtualMemory (
4084 /*IN*/ HANDLE ProcessHandle
,
4085 /*IN OUT*/ PVOID
*BaseAddress
,
4086 /*IN*/ ULONG ZeroBits
,
4087 /*IN OUT*/ PULONG RegionSize
,
4088 /*IN*/ ULONG AllocationType
,
4089 /*IN*/ ULONG Protect
4095 ZwAccessCheckAndAuditAlarm (
4096 /*IN*/ PUNICODE_STRING SubsystemName
,
4097 /*IN*/ PVOID HandleId
,
4098 /*IN*/ PUNICODE_STRING ObjectTypeName
,
4099 /*IN*/ PUNICODE_STRING ObjectName
,
4100 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
4101 /*IN*/ ACCESS_MASK DesiredAccess
,
4102 /*IN*/ PGENERIC_MAPPING GenericMapping
,
4103 /*IN*/ BOOLEAN ObjectCreation
,
4104 /*OUT*/ PACCESS_MASK GrantedAccess
,
4105 /*OUT*/ PBOOLEAN AccessStatus
,
4106 /*OUT*/ PBOOLEAN GenerateOnClose
4109 #if (VER_PRODUCTBUILD >= 2195)
4115 /*IN*/ HANDLE FileHandle
,
4116 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
4119 #endif /* (VER_PRODUCTBUILD >= 2195) */
4125 /*IN*/ HANDLE EventHandle
4131 ZwCloseObjectAuditAlarm (
4132 /*IN*/ PUNICODE_STRING SubsystemName
,
4133 /*IN*/ PVOID HandleId
,
4134 /*IN*/ BOOLEAN GenerateOnClose
4141 /*OUT*/ PHANDLE SectionHandle
,
4142 /*IN*/ ACCESS_MASK DesiredAccess
,
4143 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
/*OPTIONAL*/,
4144 /*IN*/ PLARGE_INTEGER MaximumSize
/*OPTIONAL*/,
4145 /*IN*/ ULONG SectionPageProtection
,
4146 /*IN*/ ULONG AllocationAttributes
,
4147 /*IN*/ HANDLE FileHandle
/*OPTIONAL*/
4153 ZwCreateSymbolicLinkObject (
4154 /*OUT*/ PHANDLE SymbolicLinkHandle
,
4155 /*IN*/ ACCESS_MASK DesiredAccess
,
4156 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
,
4157 /*IN*/ PUNICODE_STRING TargetName
4164 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
4171 /*IN*/ HANDLE Handle
,
4172 /*IN*/ PUNICODE_STRING Name
4178 ZwDeviceIoControlFile (
4179 /*IN*/ HANDLE FileHandle
,
4180 /*IN*/ HANDLE Event
/*OPTIONAL*/,
4181 /*IN*/ PIO_APC_ROUTINE ApcRoutine
/*OPTIONAL*/,
4182 /*IN*/ PVOID ApcContext
/*OPTIONAL*/,
4183 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4184 /*IN*/ ULONG IoControlCode
,
4185 /*IN*/ PVOID InputBuffer
/*OPTIONAL*/,
4186 /*IN*/ ULONG InputBufferLength
,
4187 /*OUT*/ PVOID OutputBuffer
/*OPTIONAL*/,
4188 /*IN*/ ULONG OutputBufferLength
4195 /*IN*/ PUNICODE_STRING String
4202 /*IN*/ HANDLE SourceProcessHandle
,
4203 /*IN*/ HANDLE SourceHandle
,
4204 /*IN*/ HANDLE TargetProcessHandle
/*OPTIONAL*/,
4205 /*OUT*/ PHANDLE TargetHandle
/*OPTIONAL*/,
4206 /*IN*/ ACCESS_MASK DesiredAccess
,
4207 /*IN*/ ULONG HandleAttributes
,
4208 /*IN*/ ULONG Options
4215 /*IN*/ HANDLE ExistingTokenHandle
,
4216 /*IN*/ ACCESS_MASK DesiredAccess
,
4217 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
,
4218 /*IN*/ BOOLEAN EffectiveOnly
,
4219 /*IN*/ TOKEN_TYPE TokenType
,
4220 /*OUT*/ PHANDLE NewTokenHandle
4226 ZwFlushInstructionCache (
4227 /*IN*/ HANDLE ProcessHandle
,
4228 /*IN*/ PVOID BaseAddress
/*OPTIONAL*/,
4229 /*IN*/ ULONG FlushSize
4232 #if (VER_PRODUCTBUILD >= 2195)
4237 ZwFlushVirtualMemory (
4238 /*IN*/ HANDLE ProcessHandle
,
4239 /*IN OUT*/ PVOID
*BaseAddress
,
4240 /*IN OUT*/ PULONG FlushSize
,
4241 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
4244 #endif /* (VER_PRODUCTBUILD >= 2195) */
4249 ZwFreeVirtualMemory (
4250 /*IN*/ HANDLE ProcessHandle
,
4251 /*IN OUT*/ PVOID
*BaseAddress
,
4252 /*IN OUT*/ PULONG RegionSize
,
4253 /*IN*/ ULONG FreeType
4260 /*IN*/ HANDLE FileHandle
,
4261 /*IN*/ HANDLE Event
/*OPTIONAL*/,
4262 /*IN*/ PIO_APC_ROUTINE ApcRoutine
/*OPTIONAL*/,
4263 /*IN*/ PVOID ApcContext
/*OPTIONAL*/,
4264 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4265 /*IN*/ ULONG FsControlCode
,
4266 /*IN*/ PVOID InputBuffer
/*OPTIONAL*/,
4267 /*IN*/ ULONG InputBufferLength
,
4268 /*OUT*/ PVOID OutputBuffer
/*OPTIONAL*/,
4269 /*IN*/ ULONG OutputBufferLength
4272 #if (VER_PRODUCTBUILD >= 2195)
4277 ZwInitiatePowerAction (
4278 /*IN*/ POWER_ACTION SystemAction
,
4279 /*IN*/ SYSTEM_POWER_STATE MinSystemState
,
4281 /*IN*/ BOOLEAN Asynchronous
4284 #endif /* (VER_PRODUCTBUILD >= 2195) */
4290 /* "\\Registry\\Machine\\System\\CurrentControlSet\\Services\\<DriverName>" */
4291 /*IN*/ PUNICODE_STRING RegistryPath
4298 /*IN*/ POBJECT_ATTRIBUTES KeyObjectAttributes
,
4299 /*IN*/ POBJECT_ATTRIBUTES FileObjectAttributes
4306 /*IN*/ HANDLE KeyHandle
,
4307 /*IN*/ HANDLE EventHandle
/*OPTIONAL*/,
4308 /*IN*/ PIO_APC_ROUTINE ApcRoutine
/*OPTIONAL*/,
4309 /*IN*/ PVOID ApcContext
/*OPTIONAL*/,
4310 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4311 /*IN*/ ULONG NotifyFilter
,
4312 /*IN*/ BOOLEAN WatchSubtree
,
4313 /*IN*/ PVOID Buffer
,
4314 /*IN*/ ULONG BufferLength
,
4315 /*IN*/ BOOLEAN Asynchronous
4321 ZwOpenDirectoryObject (
4322 /*OUT*/ PHANDLE DirectoryHandle
,
4323 /*IN*/ ACCESS_MASK DesiredAccess
,
4324 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
4331 /*OUT*/ PHANDLE EventHandle
,
4332 /*IN*/ ACCESS_MASK DesiredAccess
,
4333 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
4340 /*OUT*/ PHANDLE ProcessHandle
,
4341 /*IN*/ ACCESS_MASK DesiredAccess
,
4342 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
,
4343 /*IN*/ PCLIENT_ID ClientId
/*OPTIONAL*/
4349 ZwOpenProcessToken (
4350 /*IN*/ HANDLE ProcessHandle
,
4351 /*IN*/ ACCESS_MASK DesiredAccess
,
4352 /*OUT*/ PHANDLE TokenHandle
4359 /*OUT*/ PHANDLE ThreadHandle
,
4360 /*IN*/ ACCESS_MASK DesiredAccess
,
4361 /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes
,
4362 /*IN*/ PCLIENT_ID ClientId
4369 /*IN*/ HANDLE ThreadHandle
,
4370 /*IN*/ ACCESS_MASK DesiredAccess
,
4371 /*IN*/ BOOLEAN OpenAsSelf
,
4372 /*OUT*/ PHANDLE TokenHandle
4375 #if (VER_PRODUCTBUILD >= 2195)
4380 ZwPowerInformation (
4381 /*IN*/ POWER_INFORMATION_LEVEL PowerInformationLevel
,
4382 /*IN*/ PVOID InputBuffer
/*OPTIONAL*/,
4383 /*IN*/ ULONG InputBufferLength
,
4384 /*OUT*/ PVOID OutputBuffer
/*OPTIONAL*/,
4385 /*IN*/ ULONG OutputBufferLength
4388 #endif /* (VER_PRODUCTBUILD >= 2195) */
4394 /*IN*/ HANDLE EventHandle
,
4395 /*OUT*/ PULONG PreviousState
/*OPTIONAL*/
4401 ZwQueryDefaultLocale (
4402 /*IN*/ BOOLEAN ThreadOrSystem
,
4403 /*OUT*/ PLCID Locale
4409 ZwQueryDirectoryFile (
4410 /*IN*/ HANDLE FileHandle
,
4411 /*IN*/ HANDLE Event
/*OPTIONAL*/,
4412 /*IN*/ PIO_APC_ROUTINE ApcRoutine
/*OPTIONAL*/,
4413 /*IN*/ PVOID ApcContext
/*OPTIONAL*/,
4414 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4415 /*OUT*/ PVOID FileInformation
,
4416 /*IN*/ ULONG Length
,
4417 /*IN*/ FILE_INFORMATION_CLASS FileInformationClass
,
4418 /*IN*/ BOOLEAN ReturnSingleEntry
,
4419 /*IN*/ PUNICODE_STRING FileName
/*OPTIONAL*/,
4420 /*IN*/ BOOLEAN RestartScan
4423 #if (VER_PRODUCTBUILD >= 2195)
4428 ZwQueryDirectoryObject (
4429 /*IN*/ HANDLE DirectoryHandle
,
4430 /*OUT*/ PVOID Buffer
,
4431 /*IN*/ ULONG Length
,
4432 /*IN*/ BOOLEAN ReturnSingleEntry
,
4433 /*IN*/ BOOLEAN RestartScan
,
4434 /*IN OUT*/ PULONG Context
,
4435 /*OUT*/ PULONG ReturnLength
/*OPTIONAL*/
4442 /*IN*/ HANDLE FileHandle
,
4443 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4444 /*OUT*/ PVOID Buffer
,
4445 /*IN*/ ULONG Length
,
4446 /*IN*/ BOOLEAN ReturnSingleEntry
,
4447 /*IN*/ PVOID EaList
/*OPTIONAL*/,
4448 /*IN*/ ULONG EaListLength
,
4449 /*IN*/ PULONG EaIndex
/*OPTIONAL*/,
4450 /*IN*/ BOOLEAN RestartScan
4453 #endif /* (VER_PRODUCTBUILD >= 2195) */
4458 ZwQueryInformationProcess (
4459 /*IN*/ HANDLE ProcessHandle
,
4460 /*IN*/ PROCESSINFOCLASS ProcessInformationClass
,
4461 /*OUT*/ PVOID ProcessInformation
,
4462 /*IN*/ ULONG ProcessInformationLength
,
4463 /*OUT*/ PULONG ReturnLength
/*OPTIONAL*/
4469 ZwQueryInformationToken (
4470 /*IN*/ HANDLE TokenHandle
,
4471 /*IN*/ TOKEN_INFORMATION_CLASS TokenInformationClass
,
4472 /*OUT*/ PVOID TokenInformation
,
4473 /*IN*/ ULONG Length
,
4474 /*OUT*/ PULONG ResultLength
4481 /*IN*/ HANDLE ObjectHandle
,
4482 /*IN*/ OBJECT_INFORMATION_CLASS ObjectInformationClass
,
4483 /*OUT*/ PVOID ObjectInformation
,
4484 /*IN*/ ULONG Length
,
4485 /*OUT*/ PULONG ResultLength
4492 /*IN*/ HANDLE SectionHandle
,
4493 /*IN*/ SECTION_INFORMATION_CLASS SectionInformationClass
,
4494 /*OUT*/ PVOID SectionInformation
,
4495 /*IN*/ ULONG SectionInformationLength
,
4496 /*OUT*/ PULONG ResultLength
/*OPTIONAL*/
4502 ZwQuerySecurityObject (
4503 /*IN*/ HANDLE FileHandle
,
4504 /*IN*/ SECURITY_INFORMATION SecurityInformation
,
4505 /*OUT*/ PSECURITY_DESCRIPTOR SecurityDescriptor
,
4506 /*IN*/ ULONG Length
,
4507 /*OUT*/ PULONG ResultLength
4513 ZwQuerySystemInformation (
4514 /*IN*/ SYSTEM_INFORMATION_CLASS SystemInformationClass
,
4515 /*OUT*/ PVOID SystemInformation
,
4516 /*IN*/ ULONG Length
,
4517 /*OUT*/ PULONG ReturnLength
4523 ZwQueryVolumeInformationFile (
4524 /*IN*/ HANDLE FileHandle
,
4525 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4526 /*OUT*/ PVOID FsInformation
,
4527 /*IN*/ ULONG Length
,
4528 /*IN*/ FS_INFORMATION_CLASS FsInformationClass
4535 /*IN*/ POBJECT_ATTRIBUTES NewFileObjectAttributes
,
4536 /*IN*/ HANDLE KeyHandle
,
4537 /*IN*/ POBJECT_ATTRIBUTES OldFileObjectAttributes
4544 /*IN*/ HANDLE EventHandle
,
4545 /*OUT*/ PULONG PreviousState
/*OPTIONAL*/
4548 #if (VER_PRODUCTBUILD >= 2195)
4554 /*IN*/ HANDLE KeyHandle
,
4555 /*IN*/ HANDLE FileHandle
,
4559 #endif /* (VER_PRODUCTBUILD >= 2195) */
4565 /*IN*/ HANDLE KeyHandle
,
4566 /*IN*/ HANDLE FileHandle
4572 ZwSetDefaultLocale (
4573 /*IN*/ BOOLEAN ThreadOrSystem
,
4577 #if (VER_PRODUCTBUILD >= 2195)
4582 ZwSetDefaultUILanguage (
4583 /*IN*/ LANGID LanguageId
4590 /*IN*/ HANDLE FileHandle
,
4591 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4592 /*OUT*/ PVOID Buffer
,
4596 #endif /* (VER_PRODUCTBUILD >= 2195) */
4602 /*IN*/ HANDLE EventHandle
,
4603 /*OUT*/ PULONG PreviousState
/*OPTIONAL*/
4609 ZwSetInformationObject (
4610 /*IN*/ HANDLE ObjectHandle
,
4611 /*IN*/ OBJECT_INFORMATION_CLASS ObjectInformationClass
,
4612 /*IN*/ PVOID ObjectInformation
,
4613 /*IN*/ ULONG ObjectInformationLength
4619 ZwSetInformationProcess (
4620 /*IN*/ HANDLE ProcessHandle
,
4621 /*IN*/ PROCESSINFOCLASS ProcessInformationClass
,
4622 /*IN*/ PVOID ProcessInformation
,
4623 /*IN*/ ULONG ProcessInformationLength
4626 #if (VER_PRODUCTBUILD >= 2195)
4631 ZwSetSecurityObject (
4632 /*IN*/ HANDLE Handle
,
4633 /*IN*/ SECURITY_INFORMATION SecurityInformation
,
4634 /*IN*/ PSECURITY_DESCRIPTOR SecurityDescriptor
4637 #endif /* (VER_PRODUCTBUILD >= 2195) */
4642 ZwSetSystemInformation (
4643 /*IN*/ SYSTEM_INFORMATION_CLASS SystemInformationClass
,
4644 /*IN*/ PVOID SystemInformation
,
4652 /*IN*/ PLARGE_INTEGER NewTime
,
4653 /*OUT*/ PLARGE_INTEGER OldTime
/*OPTIONAL*/
4656 #if (VER_PRODUCTBUILD >= 2195)
4661 ZwSetVolumeInformationFile (
4662 /*IN*/ HANDLE FileHandle
,
4663 /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock
,
4664 /*IN*/ PVOID FsInformation
,
4665 /*IN*/ ULONG Length
,
4666 /*IN*/ FS_INFORMATION_CLASS FsInformationClass
4669 #endif /* (VER_PRODUCTBUILD >= 2195) */
4674 ZwTerminateProcess (
4675 /*IN*/ HANDLE ProcessHandle
/*OPTIONAL*/,
4676 /*IN*/ NTSTATUS ExitStatus
4683 /* "\\Registry\\Machine\\System\\CurrentControlSet\\Services\\<DriverName>" */
4684 /*IN*/ PUNICODE_STRING RegistryPath
4691 /*IN*/ POBJECT_ATTRIBUTES KeyObjectAttributes
4697 ZwWaitForSingleObject (
4698 /*IN*/ HANDLE Handle
,
4699 /*IN*/ BOOLEAN Alertable
,
4700 /*IN*/ PLARGE_INTEGER Timeout
/*OPTIONAL*/
4706 ZwWaitForMultipleObjects (
4707 /*IN*/ ULONG HandleCount
,
4708 /*IN*/ PHANDLE Handles
,
4709 /*IN*/ WAIT_TYPE WaitType
,
4710 /*IN*/ BOOLEAN Alertable
,
4711 /*IN*/ PLARGE_INTEGER Timeout
/*OPTIONAL*/
4725 #endif /* _NTIFS_ */