Move pushlock definition. It is gone from MS headers now.
[reactos.git] / reactos / w32api / include / ddk / ntifs.h
1 /*
2 * ntifs.h
3 *
4 * Windows NT Filesystem Driver Developer Kit
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Bo Brantén <bosse@acc.umu.se>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
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.
20 *
21 */
22
23 #ifndef _NTIFS_
24 #define _NTIFS_
25 #define _GNU_NTIFS_
26
27 #if __GNUC__ >= 3
28 #pragma GCC system_header
29 #endif
30
31 #include "ntddk.h"
32 #include "csq.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #pragma pack(push,4)
39
40 #define VER_PRODUCTBUILD 10000
41
42 #ifndef NTSYSAPI
43 #define NTSYSAPI
44 #endif
45
46 #ifndef NTKERNELAPI
47 #define NTKERNELAPI DECLSPEC_IMPORT
48 #endif
49
50 typedef struct _SE_EXPORTS *PSE_EXPORTS;
51
52 #ifdef _NTOSKRNL_
53 extern PUCHAR FsRtlLegalAnsiCharacterArray;
54 #else
55 extern DECLSPEC_IMPORT PUCHAR FsRtlLegalAnsiCharacterArray;
56 #endif
57 extern PSE_EXPORTS SeExports;
58 extern PACL SePublicDefaultDacl;
59 extern PACL SeSystemDefaultDacl;
60
61 extern KSPIN_LOCK IoStatisticsLock;
62 extern ULONG IoReadOperationCount;
63 extern ULONG IoWriteOperationCount;
64 extern ULONG IoOtherOperationCount;
65 extern LARGE_INTEGER IoReadTransferCount;
66 extern LARGE_INTEGER IoWriteTransferCount;
67 extern LARGE_INTEGER IoOtherTransferCount;
68
69 #define ANSI_DOS_STAR ('<')
70 #define ANSI_DOS_QM ('>')
71 #define ANSI_DOS_DOT ('"')
72
73 #define DOS_STAR (L'<')
74 #define DOS_QM (L'>')
75 #define DOS_DOT (L'"')
76
77 /* also in winnt.h */
78 #define ACCESS_MIN_MS_ACE_TYPE (0x0)
79 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
80 #define ACCESS_DENIED_ACE_TYPE (0x1)
81 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
82 #define SYSTEM_ALARM_ACE_TYPE (0x3)
83 #define ACCESS_MAX_MS_V2_ACE_TYPE (0x3)
84 #define ACCESS_ALLOWED_COMPOUND_ACE_TYPE (0x4)
85 #define ACCESS_MAX_MS_V3_ACE_TYPE (0x4)
86 #define ACCESS_MIN_MS_OBJECT_ACE_TYPE (0x5)
87 #define ACCESS_ALLOWED_OBJECT_ACE_TYPE (0x5)
88 #define ACCESS_DENIED_OBJECT_ACE_TYPE (0x6)
89 #define SYSTEM_AUDIT_OBJECT_ACE_TYPE (0x7)
90 #define SYSTEM_ALARM_OBJECT_ACE_TYPE (0x8)
91 #define ACCESS_MAX_MS_OBJECT_ACE_TYPE (0x8)
92 #define ACCESS_MAX_MS_V4_ACE_TYPE (0x8)
93 #define ACCESS_MAX_MS_ACE_TYPE (0x8)
94 #define ACCESS_ALLOWED_CALLBACK_ACE_TYPE (0x9)
95 #define ACCESS_DENIED_CALLBACK_ACE_TYPE (0xA)
96 #define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB)
97 #define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE (0xC)
98 #define SYSTEM_AUDIT_CALLBACK_ACE_TYPE (0xD)
99 #define SYSTEM_ALARM_CALLBACK_ACE_TYPE (0xE)
100 #define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE (0xF)
101 #define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE (0x10)
102 #define ACCESS_MAX_MS_V5_ACE_TYPE (0x10)
103
104 #define COMPRESSION_FORMAT_NONE (0x0000)
105 #define COMPRESSION_FORMAT_DEFAULT (0x0001)
106 #define COMPRESSION_FORMAT_LZNT1 (0x0002)
107 #define COMPRESSION_ENGINE_STANDARD (0x0000)
108 #define COMPRESSION_ENGINE_MAXIMUM (0x0100)
109 #define COMPRESSION_ENGINE_HIBER (0x0200)
110
111 #define FILE_ACTION_ADDED 0x00000001
112 #define FILE_ACTION_REMOVED 0x00000002
113 #define FILE_ACTION_MODIFIED 0x00000003
114 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
115 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
116 #define FILE_ACTION_ADDED_STREAM 0x00000006
117 #define FILE_ACTION_REMOVED_STREAM 0x00000007
118 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
119 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
120 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
121 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
122 /* end winnt.h */
123
124 #define FILE_EA_TYPE_BINARY 0xfffe
125 #define FILE_EA_TYPE_ASCII 0xfffd
126 #define FILE_EA_TYPE_BITMAP 0xfffb
127 #define FILE_EA_TYPE_METAFILE 0xfffa
128 #define FILE_EA_TYPE_ICON 0xfff9
129 #define FILE_EA_TYPE_EA 0xffee
130 #define FILE_EA_TYPE_MVMT 0xffdf
131 #define FILE_EA_TYPE_MVST 0xffde
132 #define FILE_EA_TYPE_ASN1 0xffdd
133 #define FILE_EA_TYPE_FAMILY_IDS 0xff01
134
135 #define FILE_NEED_EA 0x00000080
136
137 /* also in winnt.h */
138 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
139 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
140 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
141 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
142 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
143 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
144 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
145 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
146 #define FILE_NOTIFY_CHANGE_EA 0x00000080
147 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
148 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
149 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
150 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
151 #define FILE_NOTIFY_VALID_MASK 0x00000fff
152 /* end winnt.h */
153
154 #define FILE_OPLOCK_BROKEN_TO_LEVEL_2 0x00000007
155 #define FILE_OPLOCK_BROKEN_TO_NONE 0x00000008
156
157 #define FILE_OPBATCH_BREAK_UNDERWAY 0x00000009
158
159 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
160 #define FILE_CASE_PRESERVED_NAMES 0x00000002
161 #define FILE_UNICODE_ON_DISK 0x00000004
162 #define FILE_PERSISTENT_ACLS 0x00000008
163 #define FILE_FILE_COMPRESSION 0x00000010
164 #define FILE_VOLUME_QUOTAS 0x00000020
165 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
166 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
167 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
168 #define FS_LFN_APIS 0x00004000
169 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
170 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
171 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
172 #define FILE_NAMED_STREAMS 0x00040000
173
174 #define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000
175 #define FILE_PIPE_MESSAGE_TYPE 0x00000001
176
177 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
178 #define FILE_PIPE_MESSAGE_MODE 0x00000001
179
180 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
181 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
182
183 #define FILE_PIPE_INBOUND 0x00000000
184 #define FILE_PIPE_OUTBOUND 0x00000001
185 #define FILE_PIPE_FULL_DUPLEX 0x00000002
186
187 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
188 #define FILE_PIPE_LISTENING_STATE 0x00000002
189 #define FILE_PIPE_CONNECTED_STATE 0x00000003
190 #define FILE_PIPE_CLOSING_STATE 0x00000004
191
192 #define FILE_PIPE_CLIENT_END 0x00000000
193 #define FILE_PIPE_SERVER_END 0x00000001
194
195 #define FILE_PIPE_READ_DATA 0x00000000
196 #define FILE_PIPE_WRITE_SPACE 0x00000001
197
198 #define FILE_STORAGE_TYPE_SPECIFIED 0x00000041 /* FILE_DIRECTORY_FILE | FILE_NON_DIRECTORY_FILE */
199 #define FILE_STORAGE_TYPE_DEFAULT (StorageTypeDefault << FILE_STORAGE_TYPE_SHIFT)
200 #define FILE_STORAGE_TYPE_DIRECTORY (StorageTypeDirectory << FILE_STORAGE_TYPE_SHIFT)
201 #define FILE_STORAGE_TYPE_FILE (StorageTypeFile << FILE_STORAGE_TYPE_SHIFT)
202 #define FILE_STORAGE_TYPE_DOCFILE (StorageTypeDocfile << FILE_STORAGE_TYPE_SHIFT)
203 #define FILE_STORAGE_TYPE_JUNCTION_POINT (StorageTypeJunctionPoint << FILE_STORAGE_TYPE_SHIFT)
204 #define FILE_STORAGE_TYPE_CATALOG (StorageTypeCatalog << FILE_STORAGE_TYPE_SHIFT)
205 #define FILE_STORAGE_TYPE_STRUCTURED_STORAGE (StorageTypeStructuredStorage << FILE_STORAGE_TYPE_SHIFT)
206 #define FILE_STORAGE_TYPE_EMBEDDING (StorageTypeEmbedding << FILE_STORAGE_TYPE_SHIFT)
207 #define FILE_STORAGE_TYPE_STREAM (StorageTypeStream << FILE_STORAGE_TYPE_SHIFT)
208 #define FILE_MINIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_DEFAULT
209 #define FILE_MAXIMUM_STORAGE_TYPE FILE_STORAGE_TYPE_STREAM
210 #define FILE_STORAGE_TYPE_MASK 0x000f0000
211 #define FILE_STORAGE_TYPE_SHIFT 16
212
213 #define FILE_VC_QUOTA_NONE 0x00000000
214 #define FILE_VC_QUOTA_TRACK 0x00000001
215 #define FILE_VC_QUOTA_ENFORCE 0x00000002
216 #define FILE_VC_QUOTA_MASK 0x00000003
217
218 #define FILE_VC_QUOTAS_LOG_VIOLATIONS 0x00000004
219 #define FILE_VC_CONTENT_INDEX_DISABLED 0x00000008
220
221 #define FILE_VC_LOG_QUOTA_THRESHOLD 0x00000010
222 #define FILE_VC_LOG_QUOTA_LIMIT 0x00000020
223 #define FILE_VC_LOG_VOLUME_THRESHOLD 0x00000040
224 #define FILE_VC_LOG_VOLUME_LIMIT 0x00000080
225
226 #define FILE_VC_QUOTAS_INCOMPLETE 0x00000100
227 #define FILE_VC_QUOTAS_REBUILDING 0x00000200
228
229 #define FILE_VC_VALID_MASK 0x000003ff
230
231 #define FSRTL_FLAG_FILE_MODIFIED (0x01)
232 #define FSRTL_FLAG_FILE_LENGTH_CHANGED (0x02)
233 #define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04)
234 #define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08)
235 #define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10)
236 #define FSRTL_FLAG_USER_MAPPED_FILE (0x20)
237 #define FSRTL_FLAG_EOF_ADVANCE_ACTIVE (0x80)
238
239 #define FSRTL_FLAG2_DO_MODIFIED_WRITE (0x01)
240
241 #define FSRTL_FSP_TOP_LEVEL_IRP (0x01)
242 #define FSRTL_CACHE_TOP_LEVEL_IRP (0x02)
243 #define FSRTL_MOD_WRITE_TOP_LEVEL_IRP (0x03)
244 #define FSRTL_FAST_IO_TOP_LEVEL_IRP (0x04)
245 #define FSRTL_MAX_TOP_LEVEL_IRP_FLAG (0x04)
246
247 #define FSRTL_VOLUME_DISMOUNT 1
248 #define FSRTL_VOLUME_DISMOUNT_FAILED 2
249 #define FSRTL_VOLUME_LOCK 3
250 #define FSRTL_VOLUME_LOCK_FAILED 4
251 #define FSRTL_VOLUME_UNLOCK 5
252 #define FSRTL_VOLUME_MOUNT 6
253
254 #define FSRTL_WILD_CHARACTER 0x08
255
256 #define FSRTL_FAT_LEGAL 0x01
257 #define FSRTL_HPFS_LEGAL 0x02
258 #define FSRTL_NTFS_LEGAL 0x04
259 #define FSRTL_WILD_CHARACTER 0x08
260 #define FSRTL_OLE_LEGAL 0x10
261 #define FSRTL_NTFS_STREAM_LEGAL 0x14
262
263 #ifdef _X86_
264 #define HARDWARE_PTE HARDWARE_PTE_X86
265 #define PHARDWARE_PTE PHARDWARE_PTE_X86
266 #else
267 #define HARDWARE_PTE ULONG
268 #define PHARDWARE_PTE PULONG
269 #endif
270
271 #define IO_CHECK_CREATE_PARAMETERS 0x0200
272 #define IO_ATTACH_DEVICE 0x0400
273
274 #define IO_ATTACH_DEVICE_API 0x80000000
275 /* also in winnt.h */
276 #define IO_COMPLETION_QUERY_STATE 0x0001
277 #define IO_COMPLETION_MODIFY_STATE 0x0002
278 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
279 /* end winnt.h */
280 #define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
281 #define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024
282
283 #define IO_TYPE_APC 18
284 #define IO_TYPE_DPC 19
285 #define IO_TYPE_DEVICE_QUEUE 20
286 #define IO_TYPE_EVENT_PAIR 21
287 #define IO_TYPE_INTERRUPT 22
288 #define IO_TYPE_PROFILE 23
289
290 #define IRP_BEING_VERIFIED 0x10
291
292 #define MAILSLOT_CLASS_FIRSTCLASS 1
293 #define MAILSLOT_CLASS_SECONDCLASS 2
294
295 #define MAILSLOT_SIZE_AUTO 0
296
297 #define MAP_PROCESS 1L
298 #define MAP_SYSTEM 2L
299 #define MEM_DOS_LIM 0x40000000
300 /* also in winnt.h */
301 #define MEM_IMAGE SEC_IMAGE
302 /* end winnt.h */
303 #define OB_TYPE_TYPE 1
304 #define OB_TYPE_DIRECTORY 2
305 #define OB_TYPE_SYMBOLIC_LINK 3
306 #define OB_TYPE_TOKEN 4
307 #define OB_TYPE_PROCESS 5
308 #define OB_TYPE_THREAD 6
309 #define OB_TYPE_EVENT 7
310 #define OB_TYPE_EVENT_PAIR 8
311 #define OB_TYPE_MUTANT 9
312 #define OB_TYPE_SEMAPHORE 10
313 #define OB_TYPE_TIMER 11
314 #define OB_TYPE_PROFILE 12
315 #define OB_TYPE_WINDOW_STATION 13
316 #define OB_TYPE_DESKTOP 14
317 #define OB_TYPE_SECTION 15
318 #define OB_TYPE_KEY 16
319 #define OB_TYPE_PORT 17
320 #define OB_TYPE_ADAPTER 18
321 #define OB_TYPE_CONTROLLER 19
322 #define OB_TYPE_DEVICE 20
323 #define OB_TYPE_DRIVER 21
324 #define OB_TYPE_IO_COMPLETION 22
325 #define OB_TYPE_FILE 23
326
327 #define PIN_WAIT (1)
328 #define PIN_EXCLUSIVE (2)
329 #define PIN_NO_READ (4)
330 #define PIN_IF_BCB (8)
331
332 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
333 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
334
335 /* also in winnt.h */
336 #define SEC_BASED 0x00200000
337 #define SEC_NO_CHANGE 0x00400000
338 #define SEC_FILE 0x00800000
339 #define SEC_IMAGE 0x01000000
340 #define SEC_VLM 0x02000000
341 #define SEC_RESERVE 0x04000000
342 #define SEC_COMMIT 0x08000000
343 #define SEC_NOCACHE 0x10000000
344
345 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
346 #define SECURITY_WORLD_RID (0x00000000L)
347
348 #define SID_REVISION 1
349 #define SID_MAX_SUB_AUTHORITIES 15
350 #define SID_RECOMMENDED_SUB_AUTHORITIES 1
351
352 #define TOKEN_ASSIGN_PRIMARY (0x0001)
353 #define TOKEN_DUPLICATE (0x0002)
354 #define TOKEN_IMPERSONATE (0x0004)
355 #define TOKEN_QUERY (0x0008)
356 #define TOKEN_QUERY_SOURCE (0x0010)
357 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
358 #define TOKEN_ADJUST_GROUPS (0x0040)
359 #define TOKEN_ADJUST_DEFAULT (0x0080)
360 #define TOKEN_ADJUST_SESSIONID (0x0100)
361
362 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
363 TOKEN_ASSIGN_PRIMARY |\
364 TOKEN_DUPLICATE |\
365 TOKEN_IMPERSONATE |\
366 TOKEN_QUERY |\
367 TOKEN_QUERY_SOURCE |\
368 TOKEN_ADJUST_PRIVILEGES |\
369 TOKEN_ADJUST_GROUPS |\
370 TOKEN_ADJUST_DEFAULT |\
371 TOKEN_ADJUST_SESSIONID)
372
373 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
374 TOKEN_QUERY)
375
376 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
377 TOKEN_ADJUST_PRIVILEGES |\
378 TOKEN_ADJUST_GROUPS |\
379 TOKEN_ADJUST_DEFAULT)
380
381 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
382
383 #define TOKEN_SOURCE_LENGTH 8
384 /* end winnt.h */
385
386 #define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x01
387 #define TOKEN_HAS_BACKUP_PRIVILEGE 0x02
388 #define TOKEN_HAS_RESTORE_PRIVILEGE 0x04
389 #define TOKEN_HAS_ADMIN_GROUP 0x08
390 #define TOKEN_IS_RESTRICTED 0x10
391
392 #define VACB_MAPPING_GRANULARITY (0x40000)
393 #define VACB_OFFSET_SHIFT (18)
394
395 #define SE_OWNER_DEFAULTED 0x0001
396 #define SE_GROUP_DEFAULTED 0x0002
397 #define SE_DACL_PRESENT 0x0004
398 #define SE_DACL_DEFAULTED 0x0008
399 #define SE_SACL_PRESENT 0x0010
400 #define SE_SACL_DEFAULTED 0x0020
401 #define SE_DACL_UNTRUSTED 0x0040
402 #define SE_SERVER_SECURITY 0x0080
403 #define SE_DACL_AUTO_INHERIT_REQ 0x0100
404 #define SE_SACL_AUTO_INHERIT_REQ 0x0200
405 #define SE_DACL_AUTO_INHERITED 0x0400
406 #define SE_SACL_AUTO_INHERITED 0x0800
407 #define SE_DACL_PROTECTED 0x1000
408 #define SE_SACL_PROTECTED 0x2000
409 #define SE_RM_CONTROL_VALID 0x4000
410 #define SE_SELF_RELATIVE 0x8000
411
412 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
413 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
414 #define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
415 #define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
416 #define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
417 #define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
418 #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
419 #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
420 #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
421
422 #define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
423 #define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
424 #define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
425
426 #define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
427 #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
428 #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
429
430
431 #define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
432 #define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
433 #define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
434 #define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
435 #define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
436 #define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
437
438 #if (VER_PRODUCTBUILD >= 1381)
439
440 #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
441 #define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
442 #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS)
443 #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS)
444 #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS)
445 #define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
446 #define FSCTL_GET_HFS_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
447 #define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
448
449 #endif /* (VER_PRODUCTBUILD >= 1381) */
450
451 #if (VER_PRODUCTBUILD >= 2195)
452
453 #define FSCTL_READ_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 33, METHOD_NEITHER, FILE_ANY_ACCESS)
454 #define FSCTL_WRITE_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 34, METHOD_NEITHER, FILE_ANY_ACCESS)
455 #define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
456
457 #define FSCTL_DUMP_PROPERTY_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 37, METHOD_NEITHER, FILE_ANY_ACCESS)
458 #define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
459 #define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
460 #define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA)
461 #define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
462 #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
463 #define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA)
464 #define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA)
465 #define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA)
466 #define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA)
467 #define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA)
468 #define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
469 #define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA)
470 #define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
471 #define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA)
472 #define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
473 #define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
474 #define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS)
475 #define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS)
476 #define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS)
477 #define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA)
478 #define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA)
479 #define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA)
480 #define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
481 #define FSCTL_QUERY_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
482 #define FSCTL_DELETE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
483 #define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
484 #define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
485 #define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
486 #define FSCTL_HSM_MSG CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 66, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
487 #define FSCTL_NSS_CONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 67, METHOD_BUFFERED, FILE_WRITE_DATA)
488 #define FSCTL_HSM_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 68, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
489 #define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
490 #define FSCTL_NSS_RCONTROL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 70, METHOD_BUFFERED, FILE_READ_DATA)
491 #define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
492 #define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
493
494 #endif /* (VER_PRODUCTBUILD >= 2195) */
495
496 #define FSCTL_MAILSLOT_PEEK CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
497
498 #define FSCTL_NETWORK_SET_CONFIGURATION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 102, METHOD_IN_DIRECT, FILE_ANY_ACCESS)
499 #define FSCTL_NETWORK_GET_CONFIGURATION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 103, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
500 #define FSCTL_NETWORK_GET_CONNECTION_INFO CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 104, METHOD_NEITHER, FILE_ANY_ACCESS)
501 #define FSCTL_NETWORK_ENUMERATE_CONNECTIONS CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 105, METHOD_NEITHER, FILE_ANY_ACCESS)
502 #define FSCTL_NETWORK_DELETE_CONNECTION CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 107, METHOD_BUFFERED, FILE_ANY_ACCESS)
503 #define FSCTL_NETWORK_GET_STATISTICS CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 116, METHOD_BUFFERED, FILE_ANY_ACCESS)
504 #define FSCTL_NETWORK_SET_DOMAIN_NAME CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_ANY_ACCESS)
505 #define FSCTL_NETWORK_REMOTE_BOOT_INIT_SCRT CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 250, METHOD_BUFFERED, FILE_ANY_ACCESS)
506
507 #define FSCTL_PIPE_ASSIGN_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
508 #define FSCTL_PIPE_DISCONNECT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
509 #define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
510 #define FSCTL_PIPE_PEEK CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
511 #define FSCTL_PIPE_QUERY_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
512 #define FSCTL_PIPE_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
513 #define FSCTL_PIPE_WAIT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
514 #define FSCTL_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
515 #define FSCTL_PIPE_SET_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
516 #define FSCTL_PIPE_QUERY_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
517 #define FSCTL_PIPE_INTERNAL_READ CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
518 #define FSCTL_PIPE_INTERNAL_WRITE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
519 #define FSCTL_PIPE_INTERNAL_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
520 #define FSCTL_PIPE_INTERNAL_READ_OVFLOW CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
521
522 #define IOCTL_REDIR_QUERY_PATH CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS)
523
524 typedef PVOID OPLOCK, *POPLOCK;
525
526 typedef struct _CACHE_MANAGER_CALLBACKS *PCACHE_MANAGER_CALLBACKS;
527 typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION;
528 typedef struct _HANDLE_TABLE *PHANDLE_TABLE;
529 typedef struct _KPROCESS *PKPROCESS;
530 typedef struct _KQUEUE *PKQUEUE;
531 typedef struct _KTRAP_FRAME *PKTRAP_FRAME;
532 typedef struct _OBJECT_DIRECTORY *POBJECT_DIRECTORY;
533 typedef struct _SECTION_OBJECT *PSECTION_OBJECT;
534 typedef struct _SHARED_CACHE_MAP *PSHARED_CACHE_MAP;
535 typedef struct _VACB *PVACB;
536 typedef struct _VAD_HEADER *PVAD_HEADER;
537
538 typedef ULONG LBN;
539 typedef LBN *PLBN;
540
541 typedef ULONG VBN;
542 typedef VBN *PVBN;
543
544 typedef struct _NOTIFY_SYNC
545 {
546 ULONG Unknown0;
547 ULONG Unknown1;
548 ULONG Unknown2;
549 USHORT Unknown3;
550 USHORT Unknown4;
551 ULONG Unknown5;
552 ULONG Unknown6;
553 ULONG Unknown7;
554 ULONG Unknown8;
555 ULONG Unknown9;
556 ULONG Unknown10;
557 } NOTIFY_SYNC, * PNOTIFY_SYNC;
558
559 typedef enum _FAST_IO_POSSIBLE {
560 FastIoIsNotPossible,
561 FastIoIsPossible,
562 FastIoIsQuestionable
563 } FAST_IO_POSSIBLE;
564
565 typedef enum _FILE_STORAGE_TYPE {
566 StorageTypeDefault = 1,
567 StorageTypeDirectory,
568 StorageTypeFile,
569 StorageTypeJunctionPoint,
570 StorageTypeCatalog,
571 StorageTypeStructuredStorage,
572 StorageTypeEmbedding,
573 StorageTypeStream
574 } FILE_STORAGE_TYPE;
575
576 typedef enum _OBJECT_INFO_CLASS {
577 ObjectBasicInfo,
578 ObjectNameInfo,
579 ObjectTypeInfo,
580 ObjectAllTypesInfo,
581 ObjectProtectionInfo
582 } OBJECT_INFO_CLASS;
583
584 typedef struct _KAPC_STATE {
585 LIST_ENTRY ApcListHead[2];
586 PKPROCESS Process;
587 BOOLEAN KernelApcInProgress;
588 BOOLEAN KernelApcPending;
589 BOOLEAN UserApcPending;
590 } KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
591
592 typedef struct _BITMAP_RANGE {
593 LIST_ENTRY Links;
594 LARGE_INTEGER BasePage;
595 ULONG FirstDirtyPage;
596 ULONG LastDirtyPage;
597 ULONG DirtyPages;
598 PULONG Bitmap;
599 } BITMAP_RANGE, *PBITMAP_RANGE;
600
601 typedef struct _CACHE_UNINITIALIZE_EVENT {
602 struct _CACHE_UNINITIALIZE_EVENT *Next;
603 KEVENT Event;
604 } CACHE_UNINITIALIZE_EVENT, *PCACHE_UNINITIALIZE_EVENT;
605
606 typedef struct _CC_FILE_SIZES {
607 LARGE_INTEGER AllocationSize;
608 LARGE_INTEGER FileSize;
609 LARGE_INTEGER ValidDataLength;
610 } CC_FILE_SIZES, *PCC_FILE_SIZES;
611
612 typedef struct _COMPRESSED_DATA_INFO {
613 USHORT CompressionFormatAndEngine;
614 UCHAR CompressionUnitShift;
615 UCHAR ChunkShift;
616 UCHAR ClusterShift;
617 UCHAR Reserved;
618 USHORT NumberOfChunks;
619 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
620 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
621
622 typedef struct _SID_IDENTIFIER_AUTHORITY {
623 BYTE Value[6];
624 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
625 typedef PVOID PSID;
626 typedef struct _SID {
627 BYTE Revision;
628 BYTE SubAuthorityCount;
629 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
630 DWORD SubAuthority[ANYSIZE_ARRAY];
631 } SID, *PISID;
632 typedef struct _SID_AND_ATTRIBUTES {
633 PSID Sid;
634 DWORD Attributes;
635 } SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
636 typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
637 typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
638 typedef struct _TOKEN_SOURCE {
639 CHAR SourceName[TOKEN_SOURCE_LENGTH];
640 LUID SourceIdentifier;
641 } TOKEN_SOURCE,*PTOKEN_SOURCE;
642 typedef struct _TOKEN_CONTROL {
643 LUID TokenId;
644 LUID AuthenticationId;
645 LUID ModifiedId;
646 TOKEN_SOURCE TokenSource;
647 } TOKEN_CONTROL,*PTOKEN_CONTROL;
648 typedef struct _TOKEN_DEFAULT_DACL {
649 PACL DefaultDacl;
650 } TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL;
651 typedef struct _TOKEN_GROUPS {
652 DWORD GroupCount;
653 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
654 } TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS;
655 typedef struct _TOKEN_GROUPS_AND_PRIVILEGES {
656 ULONG SidCount;
657 ULONG SidLength;
658 PSID_AND_ATTRIBUTES Sids;
659 ULONG RestrictedSidCount;
660 ULONG RestrictedSidLength;
661 PSID_AND_ATTRIBUTES RestrictedSids;
662 ULONG PrivilegeCount;
663 ULONG PrivilegeLength;
664 PLUID_AND_ATTRIBUTES Privileges;
665 LUID AuthenticationId;
666 } TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES;
667 typedef struct _TOKEN_ORIGIN {
668 LUID OriginatingLogonSession;
669 } TOKEN_ORIGIN, *PTOKEN_ORIGIN;
670 typedef struct _TOKEN_OWNER {
671 PSID Owner;
672 } TOKEN_OWNER,*PTOKEN_OWNER;
673 typedef struct _TOKEN_PRIMARY_GROUP {
674 PSID PrimaryGroup;
675 } TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP;
676 typedef struct _TOKEN_PRIVILEGES {
677 DWORD PrivilegeCount;
678 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
679 } TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES;
680 typedef enum tagTOKEN_TYPE {
681 TokenPrimary = 1,
682 TokenImpersonation
683 } TOKEN_TYPE,*PTOKEN_TYPE;
684 typedef struct _TOKEN_STATISTICS {
685 LUID TokenId;
686 LUID AuthenticationId;
687 LARGE_INTEGER ExpirationTime;
688 TOKEN_TYPE TokenType;
689 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
690 DWORD DynamicCharged;
691 DWORD DynamicAvailable;
692 DWORD GroupCount;
693 DWORD PrivilegeCount;
694 LUID ModifiedId;
695 } TOKEN_STATISTICS, *PTOKEN_STATISTICS;
696 typedef struct _TOKEN_USER {
697 SID_AND_ATTRIBUTES User;
698 } TOKEN_USER, *PTOKEN_USER;
699 typedef DWORD SECURITY_INFORMATION,*PSECURITY_INFORMATION;
700 typedef WORD SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL;
701 typedef struct _SECURITY_DESCRIPTOR {
702 BYTE Revision;
703 BYTE Sbz1;
704 SECURITY_DESCRIPTOR_CONTROL Control;
705 PSID Owner;
706 PSID Group;
707 PACL Sacl;
708 PACL Dacl;
709 } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
710 typedef struct _SECURITY_DESCRIPTOR_RELATIVE {
711 BYTE Revision;
712 BYTE Sbz1;
713 SECURITY_DESCRIPTOR_CONTROL Control;
714 DWORD Owner;
715 DWORD Group;
716 DWORD Sacl;
717 DWORD Dacl;
718 } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
719 typedef enum _TOKEN_INFORMATION_CLASS {
720 TokenUser=1,TokenGroups,TokenPrivileges,TokenOwner,
721 TokenPrimaryGroup,TokenDefaultDacl,TokenSource,TokenType,
722 TokenImpersonationLevel,TokenStatistics,TokenRestrictedSids,
723 TokenSessionId,TokenGroupsAndPrivileges,TokenSessionReference,
724 TokenSandBoxInert,TokenAuditPolicy,TokenOrigin,
725 } TOKEN_INFORMATION_CLASS;
726
727 typedef struct _FILE_ACCESS_INFORMATION {
728 ACCESS_MASK AccessFlags;
729 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
730
731 typedef struct _FILE_ALLOCATION_INFORMATION {
732 LARGE_INTEGER AllocationSize;
733 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
734
735 typedef struct _FILE_BOTH_DIR_INFORMATION {
736 ULONG NextEntryOffset;
737 ULONG FileIndex;
738 LARGE_INTEGER CreationTime;
739 LARGE_INTEGER LastAccessTime;
740 LARGE_INTEGER LastWriteTime;
741 LARGE_INTEGER ChangeTime;
742 LARGE_INTEGER EndOfFile;
743 LARGE_INTEGER AllocationSize;
744 ULONG FileAttributes;
745 ULONG FileNameLength;
746 ULONG EaSize;
747 CCHAR ShortNameLength;
748 WCHAR ShortName[12];
749 WCHAR FileName[1];
750 } FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
751
752 typedef struct _FILE_COMPLETION_INFORMATION {
753 HANDLE Port;
754 PVOID Key;
755 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
756
757 typedef struct _FILE_COMPRESSION_INFORMATION {
758 LARGE_INTEGER CompressedFileSize;
759 USHORT CompressionFormat;
760 UCHAR CompressionUnitShift;
761 UCHAR ChunkShift;
762 UCHAR ClusterShift;
763 UCHAR Reserved[3];
764 } FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
765
766 typedef struct _FILE_COPY_ON_WRITE_INFORMATION {
767 BOOLEAN ReplaceIfExists;
768 HANDLE RootDirectory;
769 ULONG FileNameLength;
770 WCHAR FileName[1];
771 } FILE_COPY_ON_WRITE_INFORMATION, *PFILE_COPY_ON_WRITE_INFORMATION;
772
773 typedef struct _FILE_DIRECTORY_INFORMATION {
774 ULONG NextEntryOffset;
775 ULONG FileIndex;
776 LARGE_INTEGER CreationTime;
777 LARGE_INTEGER LastAccessTime;
778 LARGE_INTEGER LastWriteTime;
779 LARGE_INTEGER ChangeTime;
780 LARGE_INTEGER EndOfFile;
781 LARGE_INTEGER AllocationSize;
782 ULONG FileAttributes;
783 ULONG FileNameLength;
784 WCHAR FileName[1];
785 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
786
787 typedef struct _FILE_FULL_DIRECTORY_INFORMATION {
788 ULONG NextEntryOffset;
789 ULONG FileIndex;
790 LARGE_INTEGER CreationTime;
791 LARGE_INTEGER LastAccessTime;
792 LARGE_INTEGER LastWriteTime;
793 LARGE_INTEGER ChangeTime;
794 LARGE_INTEGER EndOfFile;
795 LARGE_INTEGER AllocationSize;
796 ULONG FileAttributes;
797 ULONG FileNameLength;
798 ULONG EaSize;
799 WCHAR FileName[0];
800 } FILE_FULL_DIRECTORY_INFORMATION, *PFILE_FULL_DIRECTORY_INFORMATION;
801
802 typedef struct _FILE_BOTH_DIRECTORY_INFORMATION {
803 ULONG NextEntryOffset;
804 ULONG FileIndex;
805 LARGE_INTEGER CreationTime;
806 LARGE_INTEGER LastAccessTime;
807 LARGE_INTEGER LastWriteTime;
808 LARGE_INTEGER ChangeTime;
809 LARGE_INTEGER EndOfFile;
810 LARGE_INTEGER AllocationSize;
811 ULONG FileAttributes;
812 ULONG FileNameLength;
813 ULONG EaSize;
814 CHAR ShortNameLength;
815 WCHAR ShortName[12];
816 WCHAR FileName[0];
817 } FILE_BOTH_DIRECTORY_INFORMATION, *PFILE_BOTH_DIRECTORY_INFORMATION;
818
819 typedef struct _FILE_EA_INFORMATION {
820 ULONG EaSize;
821 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
822
823 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION {
824 ULONG FileSystemAttributes;
825 ULONG MaximumComponentNameLength;
826 ULONG FileSystemNameLength;
827 WCHAR FileSystemName[1];
828 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
829
830 typedef struct _FILE_FS_CONTROL_INFORMATION {
831 LARGE_INTEGER FreeSpaceStartFiltering;
832 LARGE_INTEGER FreeSpaceThreshold;
833 LARGE_INTEGER FreeSpaceStopFiltering;
834 LARGE_INTEGER DefaultQuotaThreshold;
835 LARGE_INTEGER DefaultQuotaLimit;
836 ULONG FileSystemControlFlags;
837 } FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION;
838
839 typedef struct _FILE_FS_FULL_SIZE_INFORMATION {
840 LARGE_INTEGER TotalAllocationUnits;
841 LARGE_INTEGER CallerAvailableAllocationUnits;
842 LARGE_INTEGER ActualAvailableAllocationUnits;
843 ULONG SectorsPerAllocationUnit;
844 ULONG BytesPerSector;
845 } FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION;
846
847 typedef struct _FILE_FS_LABEL_INFORMATION {
848 ULONG VolumeLabelLength;
849 WCHAR VolumeLabel[1];
850 } FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
851
852 #if (VER_PRODUCTBUILD >= 2195)
853
854 typedef struct _FILE_FS_OBJECT_ID_INFORMATION {
855 UCHAR ObjectId[16];
856 UCHAR ExtendedInfo[48];
857 } FILE_FS_OBJECT_ID_INFORMATION, *PFILE_FS_OBJECT_ID_INFORMATION;
858
859 #endif /* (VER_PRODUCTBUILD >= 2195) */
860
861 typedef struct _FILE_FS_SIZE_INFORMATION {
862 LARGE_INTEGER TotalAllocationUnits;
863 LARGE_INTEGER AvailableAllocationUnits;
864 ULONG SectorsPerAllocationUnit;
865 ULONG BytesPerSector;
866 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
867
868 typedef struct _FILE_FS_VOLUME_INFORMATION {
869 LARGE_INTEGER VolumeCreationTime;
870 ULONG VolumeSerialNumber;
871 ULONG VolumeLabelLength;
872 BOOLEAN SupportsObjects;
873 WCHAR VolumeLabel[1];
874 } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
875
876 typedef struct _FILE_FULL_DIR_INFORMATION {
877 ULONG NextEntryOffset;
878 ULONG FileIndex;
879 LARGE_INTEGER CreationTime;
880 LARGE_INTEGER LastAccessTime;
881 LARGE_INTEGER LastWriteTime;
882 LARGE_INTEGER ChangeTime;
883 LARGE_INTEGER EndOfFile;
884 LARGE_INTEGER AllocationSize;
885 ULONG FileAttributes;
886 ULONG FileNameLength;
887 ULONG EaSize;
888 WCHAR FileName[1];
889 } FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
890
891 typedef struct _FILE_GET_EA_INFORMATION {
892 ULONG NextEntryOffset;
893 UCHAR EaNameLength;
894 CHAR EaName[1];
895 } FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
896
897 typedef struct _FILE_GET_QUOTA_INFORMATION {
898 ULONG NextEntryOffset;
899 ULONG SidLength;
900 SID Sid;
901 } FILE_GET_QUOTA_INFORMATION, *PFILE_GET_QUOTA_INFORMATION;
902
903 typedef struct _FILE_QUOTA_INFORMATION
904 {
905 ULONG NextEntryOffset;
906 ULONG SidLength;
907 LARGE_INTEGER ChangeTime;
908 LARGE_INTEGER QuotaUsed;
909 LARGE_INTEGER QuotaThreshold;
910 LARGE_INTEGER QuotaLimit;
911 SID Sid;
912 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
913
914 typedef struct _FILE_INTERNAL_INFORMATION {
915 LARGE_INTEGER IndexNumber;
916 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
917
918 typedef struct _FILE_LINK_INFORMATION {
919 BOOLEAN ReplaceIfExists;
920 HANDLE RootDirectory;
921 ULONG FileNameLength;
922 WCHAR FileName[1];
923 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
924
925 typedef struct _FILE_LOCK_INFO {
926 LARGE_INTEGER StartingByte;
927 LARGE_INTEGER Length;
928 BOOLEAN ExclusiveLock;
929 ULONG Key;
930 PFILE_OBJECT FileObject;
931 PEPROCESS Process;
932 LARGE_INTEGER EndingByte;
933 } FILE_LOCK_INFO, *PFILE_LOCK_INFO;
934
935 /* raw internal file lock struct returned from FsRtlGetNextFileLock */
936 typedef struct _FILE_SHARED_LOCK_ENTRY {
937 PVOID Unknown1;
938 PVOID Unknown2;
939 FILE_LOCK_INFO FileLock;
940 } FILE_SHARED_LOCK_ENTRY, *PFILE_SHARED_LOCK_ENTRY;
941
942 /* raw internal file lock struct returned from FsRtlGetNextFileLock */
943 typedef struct _FILE_EXCLUSIVE_LOCK_ENTRY {
944 LIST_ENTRY ListEntry;
945 PVOID Unknown1;
946 PVOID Unknown2;
947 FILE_LOCK_INFO FileLock;
948 } FILE_EXCLUSIVE_LOCK_ENTRY, *PFILE_EXCLUSIVE_LOCK_ENTRY;
949
950 typedef NTSTATUS (*PCOMPLETE_LOCK_IRP_ROUTINE) (
951 IN PVOID Context,
952 IN PIRP Irp
953 );
954
955 typedef VOID (NTAPI *PUNLOCK_ROUTINE) (
956 IN PVOID Context,
957 IN PFILE_LOCK_INFO FileLockInfo
958 );
959
960 typedef struct _FILE_LOCK {
961 PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine;
962 PUNLOCK_ROUTINE UnlockRoutine;
963 BOOLEAN FastIoIsQuestionable;
964 BOOLEAN Pad[3];
965 PVOID LockInformation;
966 FILE_LOCK_INFO LastReturnedLockInfo;
967 PVOID LastReturnedLock;
968 } FILE_LOCK, *PFILE_LOCK;
969
970 typedef struct _FILE_MAILSLOT_PEEK_BUFFER {
971 ULONG ReadDataAvailable;
972 ULONG NumberOfMessages;
973 ULONG MessageLength;
974 } FILE_MAILSLOT_PEEK_BUFFER, *PFILE_MAILSLOT_PEEK_BUFFER;
975
976 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
977 ULONG MaximumMessageSize;
978 ULONG MailslotQuota;
979 ULONG NextMessageSize;
980 ULONG MessagesAvailable;
981 LARGE_INTEGER ReadTimeout;
982 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
983
984 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
985 PLARGE_INTEGER ReadTimeout;
986 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
987
988 typedef struct _FILE_MODE_INFORMATION {
989 ULONG Mode;
990 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
991
992 typedef struct _FILE_ALL_INFORMATION {
993 FILE_BASIC_INFORMATION BasicInformation;
994 FILE_STANDARD_INFORMATION StandardInformation;
995 FILE_INTERNAL_INFORMATION InternalInformation;
996 FILE_EA_INFORMATION EaInformation;
997 FILE_ACCESS_INFORMATION AccessInformation;
998 FILE_POSITION_INFORMATION PositionInformation;
999 FILE_MODE_INFORMATION ModeInformation;
1000 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
1001 FILE_NAME_INFORMATION NameInformation;
1002 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
1003
1004 typedef struct _FILE_NAMES_INFORMATION {
1005 ULONG NextEntryOffset;
1006 ULONG FileIndex;
1007 ULONG FileNameLength;
1008 WCHAR FileName[1];
1009 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
1010
1011 typedef struct _FILE_OBJECTID_INFORMATION {
1012 LONGLONG FileReference;
1013 UCHAR ObjectId[16];
1014 _ANONYMOUS_UNION union {
1015 struct {
1016 UCHAR BirthVolumeId[16];
1017 UCHAR BirthObjectId[16];
1018 UCHAR DomainId[16];
1019 } ;
1020 UCHAR ExtendedInfo[48];
1021 } DUMMYUNIONNAME;
1022 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
1023
1024 typedef struct _FILE_OLE_CLASSID_INFORMATION {
1025 GUID ClassId;
1026 } FILE_OLE_CLASSID_INFORMATION, *PFILE_OLE_CLASSID_INFORMATION;
1027
1028 typedef struct _FILE_OLE_ALL_INFORMATION {
1029 FILE_BASIC_INFORMATION BasicInformation;
1030 FILE_STANDARD_INFORMATION StandardInformation;
1031 FILE_INTERNAL_INFORMATION InternalInformation;
1032 FILE_EA_INFORMATION EaInformation;
1033 FILE_ACCESS_INFORMATION AccessInformation;
1034 FILE_POSITION_INFORMATION PositionInformation;
1035 FILE_MODE_INFORMATION ModeInformation;
1036 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
1037 USN LastChangeUsn;
1038 USN ReplicationUsn;
1039 LARGE_INTEGER SecurityChangeTime;
1040 FILE_OLE_CLASSID_INFORMATION OleClassIdInformation;
1041 FILE_OBJECTID_INFORMATION ObjectIdInformation;
1042 FILE_STORAGE_TYPE StorageType;
1043 ULONG OleStateBits;
1044 ULONG OleId;
1045 ULONG NumberOfStreamReferences;
1046 ULONG StreamIndex;
1047 ULONG SecurityId;
1048 BOOLEAN ContentIndexDisable;
1049 BOOLEAN InheritContentIndexDisable;
1050 FILE_NAME_INFORMATION NameInformation;
1051 } FILE_OLE_ALL_INFORMATION, *PFILE_OLE_ALL_INFORMATION;
1052
1053 typedef struct _FILE_OLE_DIR_INFORMATION {
1054 ULONG NextEntryOffset;
1055 ULONG FileIndex;
1056 LARGE_INTEGER CreationTime;
1057 LARGE_INTEGER LastAccessTime;
1058 LARGE_INTEGER LastWriteTime;
1059 LARGE_INTEGER ChangeTime;
1060 LARGE_INTEGER EndOfFile;
1061 LARGE_INTEGER AllocationSize;
1062 ULONG FileAttributes;
1063 ULONG FileNameLength;
1064 FILE_STORAGE_TYPE StorageType;
1065 GUID OleClassId;
1066 ULONG OleStateBits;
1067 BOOLEAN ContentIndexDisable;
1068 BOOLEAN InheritContentIndexDisable;
1069 WCHAR FileName[1];
1070 } FILE_OLE_DIR_INFORMATION, *PFILE_OLE_DIR_INFORMATION;
1071
1072 typedef struct _FILE_OLE_INFORMATION {
1073 LARGE_INTEGER SecurityChangeTime;
1074 FILE_OLE_CLASSID_INFORMATION OleClassIdInformation;
1075 FILE_OBJECTID_INFORMATION ObjectIdInformation;
1076 FILE_STORAGE_TYPE StorageType;
1077 ULONG OleStateBits;
1078 BOOLEAN ContentIndexDisable;
1079 BOOLEAN InheritContentIndexDisable;
1080 } FILE_OLE_INFORMATION, *PFILE_OLE_INFORMATION;
1081
1082 typedef struct _FILE_OLE_STATE_BITS_INFORMATION {
1083 ULONG StateBits;
1084 ULONG StateBitsMask;
1085 } FILE_OLE_STATE_BITS_INFORMATION, *PFILE_OLE_STATE_BITS_INFORMATION;
1086
1087 typedef struct _FILE_PIPE_ASSIGN_EVENT_BUFFER {
1088 HANDLE EventHandle;
1089 ULONG KeyValue;
1090 } FILE_PIPE_ASSIGN_EVENT_BUFFER, *PFILE_PIPE_ASSIGN_EVENT_BUFFER;
1091
1092 typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER {
1093 PVOID ClientSession;
1094 PVOID ClientProcess;
1095 } FILE_PIPE_CLIENT_PROCESS_BUFFER, *PFILE_PIPE_CLIENT_PROCESS_BUFFER;
1096
1097 typedef struct _FILE_PIPE_EVENT_BUFFER {
1098 ULONG NamedPipeState;
1099 ULONG EntryType;
1100 ULONG ByteCount;
1101 ULONG KeyValue;
1102 ULONG NumberRequests;
1103 } FILE_PIPE_EVENT_BUFFER, *PFILE_PIPE_EVENT_BUFFER;
1104
1105 typedef struct _FILE_PIPE_PEEK_BUFFER
1106 {
1107 ULONG NamedPipeState;
1108 ULONG ReadDataAvailable;
1109 ULONG NumberOfMessages;
1110 ULONG MessageLength;
1111 CHAR Data[1];
1112 } FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER;
1113
1114 typedef struct _FILE_PIPE_INFORMATION {
1115 ULONG ReadMode;
1116 ULONG CompletionMode;
1117 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
1118
1119 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
1120 ULONG NamedPipeType;
1121 ULONG NamedPipeConfiguration;
1122 ULONG MaximumInstances;
1123 ULONG CurrentInstances;
1124 ULONG InboundQuota;
1125 ULONG ReadDataAvailable;
1126 ULONG OutboundQuota;
1127 ULONG WriteQuotaAvailable;
1128 ULONG NamedPipeState;
1129 ULONG NamedPipeEnd;
1130 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
1131
1132 typedef struct _FILE_PIPE_REMOTE_INFORMATION {
1133 LARGE_INTEGER CollectDataTime;
1134 ULONG MaximumCollectionCount;
1135 } FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
1136
1137 typedef struct _FILE_PIPE_WAIT_FOR_BUFFER {
1138 LARGE_INTEGER Timeout;
1139 ULONG NameLength;
1140 BOOLEAN TimeoutSpecified;
1141 WCHAR Name[1];
1142 } FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
1143
1144 typedef struct _FILE_RENAME_INFORMATION {
1145 BOOLEAN ReplaceIfExists;
1146 HANDLE RootDirectory;
1147 ULONG FileNameLength;
1148 WCHAR FileName[1];
1149 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
1150
1151 typedef struct _FILE_STREAM_INFORMATION {
1152 ULONG NextEntryOffset;
1153 ULONG StreamNameLength;
1154 LARGE_INTEGER StreamSize;
1155 LARGE_INTEGER StreamAllocationSize;
1156 WCHAR StreamName[1];
1157 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
1158
1159 typedef struct _FILE_TRACKING_INFORMATION {
1160 HANDLE DestinationFile;
1161 ULONG ObjectInformationLength;
1162 CHAR ObjectInformation[1];
1163 } FILE_TRACKING_INFORMATION, *PFILE_TRACKING_INFORMATION;
1164
1165 #if (VER_PRODUCTBUILD >= 2195)
1166 typedef struct _FILE_ZERO_DATA_INFORMATION {
1167 LARGE_INTEGER FileOffset;
1168 LARGE_INTEGER BeyondFinalZero;
1169 } FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
1170
1171 typedef struct FILE_ALLOCATED_RANGE_BUFFER {
1172 LARGE_INTEGER FileOffset;
1173 LARGE_INTEGER Length;
1174 } FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
1175 #endif /* (VER_PRODUCTBUILD >= 2195) */
1176
1177 typedef struct _FSRTL_COMMON_FCB_HEADER {
1178 CSHORT NodeTypeCode;
1179 CSHORT NodeByteSize;
1180 UCHAR Flags;
1181 UCHAR IsFastIoPossible;
1182 #if (VER_PRODUCTBUILD >= 1381)
1183 UCHAR Flags2;
1184 UCHAR Reserved;
1185 #endif /* (VER_PRODUCTBUILD >= 1381) */
1186 PERESOURCE Resource;
1187 PERESOURCE PagingIoResource;
1188 LARGE_INTEGER AllocationSize;
1189 LARGE_INTEGER FileSize;
1190 LARGE_INTEGER ValidDataLength;
1191 } FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER;
1192
1193 #if (VER_PRODUCTBUILD >= 2600)
1194
1195 typedef struct _FSRTL_ADVANCED_FCB_HEADER {
1196 CSHORT NodeTypeCode;
1197 CSHORT NodeByteSize;
1198 UCHAR Flags;
1199 UCHAR IsFastIoPossible;
1200 UCHAR Flags2;
1201 UCHAR Reserved;
1202 PERESOURCE Resource;
1203 PERESOURCE PagingIoResource;
1204 LARGE_INTEGER AllocationSize;
1205 LARGE_INTEGER FileSize;
1206 LARGE_INTEGER ValidDataLength;
1207 PFAST_MUTEX FastMutex;
1208 LIST_ENTRY FilterContexts;
1209 } FSRTL_ADVANCED_FCB_HEADER, *PFSRTL_ADVANCED_FCB_HEADER;
1210
1211 typedef struct _FSRTL_PER_STREAM_CONTEXT {
1212 LIST_ENTRY Links;
1213 PVOID OwnerId;
1214 PVOID InstanceId;
1215 PFREE_FUNCTION FreeCallback;
1216 } FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT;
1217
1218 #endif /* (VER_PRODUCTBUILD >= 2600) */
1219
1220 typedef struct _BASE_MCB
1221 {
1222 ULONG MaximumPairCount;
1223 ULONG PairCount;
1224 POOL_TYPE PoolType;
1225 PVOID Mapping;
1226 } BASE_MCB;
1227 typedef BASE_MCB *PBASE_MCB;
1228
1229 typedef struct _LARGE_MCB
1230 {
1231 PFAST_MUTEX FastMutex;
1232 BASE_MCB BaseMcb;
1233 } LARGE_MCB;
1234 typedef LARGE_MCB *PLARGE_MCB;
1235
1236 typedef struct _MCB
1237 {
1238 LARGE_MCB DummyFieldThatSizesThisStructureCorrectly;
1239 } MCB;
1240 typedef MCB *PMCB;
1241
1242 typedef struct _GENERATE_NAME_CONTEXT {
1243 USHORT Checksum;
1244 BOOLEAN CheckSumInserted;
1245 UCHAR NameLength;
1246 WCHAR NameBuffer[8];
1247 ULONG ExtensionLength;
1248 WCHAR ExtensionBuffer[4];
1249 ULONG LastIndexValue;
1250 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
1251
1252 typedef struct _MAPPING_PAIR {
1253 ULONGLONG Vcn;
1254 ULONGLONG Lcn;
1255 } MAPPING_PAIR, *PMAPPING_PAIR;
1256
1257 typedef struct _GET_RETRIEVAL_DESCRIPTOR {
1258 ULONG NumberOfPairs;
1259 ULONGLONG StartVcn;
1260 MAPPING_PAIR Pair[1];
1261 } GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR;
1262
1263 typedef struct _IO_CLIENT_EXTENSION {
1264 struct _IO_CLIENT_EXTENSION *NextExtension;
1265 PVOID ClientIdentificationAddress;
1266 } IO_CLIENT_EXTENSION, *PIO_CLIENT_EXTENSION;
1267
1268 typedef struct _IO_COMPLETION_BASIC_INFORMATION {
1269 LONG Depth;
1270 } IO_COMPLETION_BASIC_INFORMATION, *PIO_COMPLETION_BASIC_INFORMATION;
1271
1272 typedef struct _KQUEUE {
1273 DISPATCHER_HEADER Header;
1274 LIST_ENTRY EntryListHead;
1275 ULONG CurrentCount;
1276 ULONG MaximumCount;
1277 LIST_ENTRY ThreadListHead;
1278 } KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;
1279
1280 typedef struct _MBCB {
1281 CSHORT NodeTypeCode;
1282 CSHORT NodeIsInZone;
1283 ULONG PagesToWrite;
1284 ULONG DirtyPages;
1285 ULONG Reserved;
1286 LIST_ENTRY BitmapRanges;
1287 LONGLONG ResumeWritePage;
1288 BITMAP_RANGE BitmapRange1;
1289 BITMAP_RANGE BitmapRange2;
1290 BITMAP_RANGE BitmapRange3;
1291 } MBCB, *PMBCB;
1292
1293 typedef struct _MOVEFILE_DESCRIPTOR {
1294 HANDLE FileHandle;
1295 ULONG Reserved;
1296 LARGE_INTEGER StartVcn;
1297 LARGE_INTEGER TargetLcn;
1298 ULONG NumVcns;
1299 ULONG Reserved1;
1300 } MOVEFILE_DESCRIPTOR, *PMOVEFILE_DESCRIPTOR;
1301
1302 typedef struct _OBJECT_BASIC_INFO {
1303 ULONG Attributes;
1304 ACCESS_MASK GrantedAccess;
1305 ULONG HandleCount;
1306 ULONG ReferenceCount;
1307 ULONG PagedPoolUsage;
1308 ULONG NonPagedPoolUsage;
1309 ULONG Reserved[3];
1310 ULONG NameInformationLength;
1311 ULONG TypeInformationLength;
1312 ULONG SecurityDescriptorLength;
1313 LARGE_INTEGER CreateTime;
1314 } OBJECT_BASIC_INFO, *POBJECT_BASIC_INFO;
1315
1316 typedef struct _OBJECT_HANDLE_ATTRIBUTE_INFO {
1317 BOOLEAN Inherit;
1318 BOOLEAN ProtectFromClose;
1319 } OBJECT_HANDLE_ATTRIBUTE_INFO, *POBJECT_HANDLE_ATTRIBUTE_INFO;
1320
1321 typedef struct _OBJECT_NAME_INFO {
1322 UNICODE_STRING ObjectName;
1323 WCHAR ObjectNameBuffer[1];
1324 } OBJECT_NAME_INFO, *POBJECT_NAME_INFO;
1325
1326 typedef struct _OBJECT_PROTECTION_INFO {
1327 BOOLEAN Inherit;
1328 BOOLEAN ProtectHandle;
1329 } OBJECT_PROTECTION_INFO, *POBJECT_PROTECTION_INFO;
1330
1331 typedef struct _OBJECT_TYPE_INFO {
1332 UNICODE_STRING ObjectTypeName;
1333 UCHAR Unknown[0x58];
1334 WCHAR ObjectTypeNameBuffer[1];
1335 } OBJECT_TYPE_INFO, *POBJECT_TYPE_INFO;
1336
1337 typedef struct _OBJECT_ALL_TYPES_INFO {
1338 ULONG NumberOfObjectTypes;
1339 OBJECT_TYPE_INFO ObjectsTypeInfo[1];
1340 } OBJECT_ALL_TYPES_INFO, *POBJECT_ALL_TYPES_INFO;
1341
1342
1343 typedef struct _PATHNAME_BUFFER {
1344 ULONG PathNameLength;
1345 WCHAR Name[1];
1346 } PATHNAME_BUFFER, *PPATHNAME_BUFFER;
1347
1348 #if (VER_PRODUCTBUILD >= 2600)
1349
1350 typedef struct _PRIVATE_CACHE_MAP_FLAGS {
1351 ULONG DontUse : 16;
1352 ULONG ReadAheadActive : 1;
1353 ULONG ReadAheadEnabled : 1;
1354 ULONG Available : 14;
1355 } PRIVATE_CACHE_MAP_FLAGS, *PPRIVATE_CACHE_MAP_FLAGS;
1356
1357 typedef struct _PRIVATE_CACHE_MAP {
1358 _ANONYMOUS_UNION union {
1359 CSHORT NodeTypeCode;
1360 PRIVATE_CACHE_MAP_FLAGS Flags;
1361 ULONG UlongFlags;
1362 } DUMMYUNIONNAME;
1363 ULONG ReadAheadMask;
1364 PFILE_OBJECT FileObject;
1365 LARGE_INTEGER FileOffset1;
1366 LARGE_INTEGER BeyondLastByte1;
1367 LARGE_INTEGER FileOffset2;
1368 LARGE_INTEGER BeyondLastByte2;
1369 LARGE_INTEGER ReadAheadOffset[2];
1370 ULONG ReadAheadLength[2];
1371 KSPIN_LOCK ReadAheadSpinLock;
1372 LIST_ENTRY PrivateLinks;
1373 } PRIVATE_CACHE_MAP, *PPRIVATE_CACHE_MAP;
1374
1375 #endif
1376
1377 typedef struct _PUBLIC_BCB {
1378 CSHORT NodeTypeCode;
1379 CSHORT NodeByteSize;
1380 ULONG MappedLength;
1381 LARGE_INTEGER MappedFileOffset;
1382 } PUBLIC_BCB, *PPUBLIC_BCB;
1383
1384 typedef struct _QUERY_PATH_REQUEST {
1385 ULONG PathNameLength;
1386 PIO_SECURITY_CONTEXT SecurityContext;
1387 WCHAR FilePathName[1];
1388 } QUERY_PATH_REQUEST, *PQUERY_PATH_REQUEST;
1389
1390 typedef struct _QUERY_PATH_RESPONSE {
1391 ULONG LengthAccepted;
1392 } QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE;
1393
1394 typedef struct _RETRIEVAL_POINTERS_BUFFER {
1395 ULONG ExtentCount;
1396 LARGE_INTEGER StartingVcn;
1397 struct {
1398 LARGE_INTEGER NextVcn;
1399 LARGE_INTEGER Lcn;
1400 } Extents[1];
1401 } RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
1402
1403 typedef struct _RTL_SPLAY_LINKS {
1404 struct _RTL_SPLAY_LINKS *Parent;
1405 struct _RTL_SPLAY_LINKS *LeftChild;
1406 struct _RTL_SPLAY_LINKS *RightChild;
1407 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
1408
1409 typedef enum _RTL_GENERIC_COMPARE_RESULTS
1410 {
1411 GenericLessThan,
1412 GenericGreaterThan,
1413 GenericEqual
1414 } RTL_GENERIC_COMPARE_RESULTS;
1415
1416 #if defined(USE_LPC6432)
1417 #define LPC_CLIENT_ID CLIENT_ID64
1418 #define LPC_SIZE_T ULONGLONG
1419 #define LPC_PVOID ULONGLONG
1420 #define LPC_HANDLE ULONGLONG
1421 #else
1422 #define LPC_CLIENT_ID CLIENT_ID
1423 #define LPC_SIZE_T SIZE_T
1424 #define LPC_PVOID PVOID
1425 #define LPC_HANDLE HANDLE
1426 #endif
1427
1428 typedef struct _PORT_MESSAGE
1429 {
1430 union
1431 {
1432 struct
1433 {
1434 CSHORT DataLength;
1435 CSHORT TotalLength;
1436 } s1;
1437 ULONG Length;
1438 } u1;
1439 union
1440 {
1441 struct
1442 {
1443 CSHORT Type;
1444 CSHORT DataInfoOffset;
1445 } s2;
1446 ULONG ZeroInit;
1447 } u2;
1448 union
1449 {
1450 LPC_CLIENT_ID ClientId;
1451 double DoNotUseThisField;
1452 };
1453 ULONG MessageId;
1454 union
1455 {
1456 LPC_SIZE_T ClientViewSize;
1457 ULONG CallbackId;
1458 };
1459 } PORT_MESSAGE, *PPORT_MESSAGE;
1460
1461 typedef struct _PORT_VIEW
1462 {
1463 ULONG Length;
1464 LPC_HANDLE SectionHandle;
1465 ULONG SectionOffset;
1466 LPC_SIZE_T ViewSize;
1467 LPC_PVOID ViewBase;
1468 LPC_PVOID ViewRemoteBase;
1469 } PORT_VIEW, *PPORT_VIEW;
1470
1471 typedef struct _REMOTE_PORT_VIEW
1472 {
1473 ULONG Length;
1474 LPC_SIZE_T ViewSize;
1475 LPC_PVOID ViewBase;
1476 } REMOTE_PORT_VIEW, *PREMOTE_PORT_VIEW;
1477
1478 typedef struct _SE_EXPORTS {
1479
1480 LUID SeCreateTokenPrivilege;
1481 LUID SeAssignPrimaryTokenPrivilege;
1482 LUID SeLockMemoryPrivilege;
1483 LUID SeIncreaseQuotaPrivilege;
1484 LUID SeUnsolicitedInputPrivilege;
1485 LUID SeTcbPrivilege;
1486 LUID SeSecurityPrivilege;
1487 LUID SeTakeOwnershipPrivilege;
1488 LUID SeLoadDriverPrivilege;
1489 LUID SeCreatePagefilePrivilege;
1490 LUID SeIncreaseBasePriorityPrivilege;
1491 LUID SeSystemProfilePrivilege;
1492 LUID SeSystemtimePrivilege;
1493 LUID SeProfileSingleProcessPrivilege;
1494 LUID SeCreatePermanentPrivilege;
1495 LUID SeBackupPrivilege;
1496 LUID SeRestorePrivilege;
1497 LUID SeShutdownPrivilege;
1498 LUID SeDebugPrivilege;
1499 LUID SeAuditPrivilege;
1500 LUID SeSystemEnvironmentPrivilege;
1501 LUID SeChangeNotifyPrivilege;
1502 LUID SeRemoteShutdownPrivilege;
1503
1504 PSID SeNullSid;
1505 PSID SeWorldSid;
1506 PSID SeLocalSid;
1507 PSID SeCreatorOwnerSid;
1508 PSID SeCreatorGroupSid;
1509
1510 PSID SeNtAuthoritySid;
1511 PSID SeDialupSid;
1512 PSID SeNetworkSid;
1513 PSID SeBatchSid;
1514 PSID SeInteractiveSid;
1515 PSID SeLocalSystemSid;
1516 PSID SeAliasAdminsSid;
1517 PSID SeAliasUsersSid;
1518 PSID SeAliasGuestsSid;
1519 PSID SeAliasPowerUsersSid;
1520 PSID SeAliasAccountOpsSid;
1521 PSID SeAliasSystemOpsSid;
1522 PSID SeAliasPrintOpsSid;
1523 PSID SeAliasBackupOpsSid;
1524
1525 PSID SeAuthenticatedUsersSid;
1526
1527 PSID SeRestrictedSid;
1528 PSID SeAnonymousLogonSid;
1529
1530 LUID SeUndockPrivilege;
1531 LUID SeSyncAgentPrivilege;
1532 LUID SeEnableDelegationPrivilege;
1533
1534 } SE_EXPORTS, *PSE_EXPORTS;
1535
1536 typedef struct
1537 {
1538 LARGE_INTEGER StartingLcn;
1539 } STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER;
1540
1541 typedef struct _STARTING_VCN_INPUT_BUFFER {
1542 LARGE_INTEGER StartingVcn;
1543 } STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;
1544
1545 typedef struct _SECURITY_CLIENT_CONTEXT {
1546 SECURITY_QUALITY_OF_SERVICE SecurityQos;
1547 PACCESS_TOKEN ClientToken;
1548 BOOLEAN DirectlyAccessClientToken;
1549 BOOLEAN DirectAccessEffectiveOnly;
1550 BOOLEAN ServerIsRemote;
1551 TOKEN_CONTROL ClientTokenControl;
1552 } SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT;
1553
1554 typedef struct _TUNNEL {
1555 FAST_MUTEX Mutex;
1556 PRTL_SPLAY_LINKS Cache;
1557 LIST_ENTRY TimerQueue;
1558 USHORT NumEntries;
1559 } TUNNEL, *PTUNNEL;
1560
1561 typedef struct _VACB {
1562 PVOID BaseAddress;
1563 PSHARED_CACHE_MAP SharedCacheMap;
1564 union {
1565 LARGE_INTEGER FileOffset;
1566 USHORT ActiveCount;
1567 } Overlay;
1568 LIST_ENTRY LruList;
1569 } VACB, *PVACB;
1570
1571 typedef struct _VAD_HEADER {
1572 PVOID StartVPN;
1573 PVOID EndVPN;
1574 PVAD_HEADER ParentLink;
1575 PVAD_HEADER LeftLink;
1576 PVAD_HEADER RightLink;
1577 ULONG Flags; /* LSB = CommitCharge */
1578 PVOID ControlArea;
1579 PVOID FirstProtoPte;
1580 PVOID LastPTE;
1581 ULONG Unknown;
1582 LIST_ENTRY Secured;
1583 } VAD_HEADER, *PVAD_HEADER;
1584
1585 typedef struct
1586 {
1587 LARGE_INTEGER StartingLcn;
1588 LARGE_INTEGER BitmapSize;
1589 UCHAR Buffer[1];
1590 } VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER;
1591
1592 #if (VER_PRODUCTBUILD >= 2600)
1593
1594 typedef BOOLEAN
1595 (NTAPI *PFILTER_REPORT_CHANGE) (
1596 IN PVOID NotifyContext,
1597 IN PVOID FilterContext
1598 );
1599
1600 typedef enum _FS_FILTER_SECTION_SYNC_TYPE {
1601 SyncTypeOther = 0,
1602 SyncTypeCreateSection
1603 } FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE;
1604
1605 typedef union _FS_FILTER_PARAMETERS {
1606 struct {
1607 PLARGE_INTEGER EndingOffset;
1608 } AcquireForModifiedPageWriter;
1609
1610 struct {
1611 PERESOURCE ResourceToRelease;
1612 } ReleaseForModifiedPageWriter;
1613
1614 struct {
1615 FS_FILTER_SECTION_SYNC_TYPE SyncType;
1616 ULONG PageProtection;
1617 } AcquireForSectionSynchronization;
1618
1619 struct {
1620 PVOID Argument1;
1621 PVOID Argument2;
1622 PVOID Argument3;
1623 PVOID Argument4;
1624 PVOID Argument5;
1625 } Others;
1626 } FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS;
1627
1628 typedef struct _FS_FILTER_CALLBACK_DATA {
1629 ULONG SizeOfFsFilterCallbackData;
1630 UCHAR Operation;
1631 UCHAR Reserved;
1632 struct _DEVICE_OBJECT *DeviceObject;
1633 struct _FILE_OBJECT *FileObject;
1634 FS_FILTER_PARAMETERS Parameters;
1635 } FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA;
1636
1637 typedef NTSTATUS
1638 (NTAPI *PFS_FILTER_CALLBACK) (
1639 IN PFS_FILTER_CALLBACK_DATA Data,
1640 OUT PVOID *CompletionContext
1641 );
1642
1643 typedef VOID
1644 (NTAPI *PFS_FILTER_COMPLETION_CALLBACK) (
1645 IN PFS_FILTER_CALLBACK_DATA Data,
1646 IN NTSTATUS OperationStatus,
1647 IN PVOID CompletionContext
1648 );
1649
1650 typedef struct _FS_FILTER_CALLBACKS {
1651 ULONG SizeOfFsFilterCallbacks;
1652 ULONG Reserved;
1653 PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization;
1654 PFS_FILTER_COMPLETION_CALLBACK PostAcquireForSectionSynchronization;
1655 PFS_FILTER_CALLBACK PreReleaseForSectionSynchronization;
1656 PFS_FILTER_COMPLETION_CALLBACK PostReleaseForSectionSynchronization;
1657 PFS_FILTER_CALLBACK PreAcquireForCcFlush;
1658 PFS_FILTER_COMPLETION_CALLBACK PostAcquireForCcFlush;
1659 PFS_FILTER_CALLBACK PreReleaseForCcFlush;
1660 PFS_FILTER_COMPLETION_CALLBACK PostReleaseForCcFlush;
1661 PFS_FILTER_CALLBACK PreAcquireForModifiedPageWriter;
1662 PFS_FILTER_COMPLETION_CALLBACK PostAcquireForModifiedPageWriter;
1663 PFS_FILTER_CALLBACK PreReleaseForModifiedPageWriter;
1664 PFS_FILTER_COMPLETION_CALLBACK PostReleaseForModifiedPageWriter;
1665 } FS_FILTER_CALLBACKS, *PFS_FILTER_CALLBACKS;
1666
1667 typedef struct _READ_LIST {
1668 PFILE_OBJECT FileObject;
1669 ULONG NumberOfEntries;
1670 LOGICAL IsImage;
1671 FILE_SEGMENT_ELEMENT List[ANYSIZE_ARRAY];
1672 } READ_LIST, *PREAD_LIST;
1673
1674 #endif
1675
1676 typedef NTSTATUS
1677 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE) (
1678 IN PVOID Base,
1679 IN OUT PVOID *CommitAddress,
1680 IN OUT PSIZE_T CommitSize
1681 );
1682
1683 typedef struct _RTL_HEAP_PARAMETERS {
1684 ULONG Length;
1685 SIZE_T SegmentReserve;
1686 SIZE_T SegmentCommit;
1687 SIZE_T DeCommitFreeBlockThreshold;
1688 SIZE_T DeCommitTotalFreeThreshold;
1689 SIZE_T MaximumAllocationSize;
1690 SIZE_T VirtualMemoryThreshold;
1691 SIZE_T InitialCommit;
1692 SIZE_T InitialReserve;
1693 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
1694 SIZE_T Reserved[2];
1695 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
1696
1697 NTKERNELAPI
1698 BOOLEAN
1699 NTAPI
1700 CcCanIWrite (
1701 IN PFILE_OBJECT FileObject,
1702 IN ULONG BytesToWrite,
1703 IN BOOLEAN Wait,
1704 IN BOOLEAN Retrying
1705 );
1706
1707 NTKERNELAPI
1708 BOOLEAN
1709 NTAPI
1710 CcCopyRead (
1711 IN PFILE_OBJECT FileObject,
1712 IN PLARGE_INTEGER FileOffset,
1713 IN ULONG Length,
1714 IN BOOLEAN Wait,
1715 OUT PVOID Buffer,
1716 OUT PIO_STATUS_BLOCK IoStatus
1717 );
1718
1719 NTKERNELAPI
1720 BOOLEAN
1721 NTAPI
1722 CcCopyWrite (
1723 IN PFILE_OBJECT FileObject,
1724 IN PLARGE_INTEGER FileOffset,
1725 IN ULONG Length,
1726 IN BOOLEAN Wait,
1727 IN PVOID Buffer
1728 );
1729
1730 #define CcCopyWriteWontFlush(FO, FOFF, LEN) ((LEN) <= 0x10000)
1731
1732 typedef VOID (NTAPI *PCC_POST_DEFERRED_WRITE) (
1733 IN PVOID Context1,
1734 IN PVOID Context2
1735 );
1736
1737 NTKERNELAPI
1738 VOID
1739 NTAPI
1740 CcDeferWrite (
1741 IN PFILE_OBJECT FileObject,
1742 IN PCC_POST_DEFERRED_WRITE PostRoutine,
1743 IN PVOID Context1,
1744 IN PVOID Context2,
1745 IN ULONG BytesToWrite,
1746 IN BOOLEAN Retrying
1747 );
1748
1749 NTKERNELAPI
1750 VOID
1751 NTAPI
1752 CcFastCopyRead (
1753 IN PFILE_OBJECT FileObject,
1754 IN ULONG FileOffset,
1755 IN ULONG Length,
1756 IN ULONG PageCount,
1757 OUT PVOID Buffer,
1758 OUT PIO_STATUS_BLOCK IoStatus
1759 );
1760
1761 NTKERNELAPI
1762 VOID
1763 NTAPI
1764 CcFastCopyWrite (
1765 IN PFILE_OBJECT FileObject,
1766 IN ULONG FileOffset,
1767 IN ULONG Length,
1768 IN PVOID Buffer
1769 );
1770
1771 NTKERNELAPI
1772 VOID
1773 NTAPI
1774 CcFlushCache (
1775 IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
1776 IN PLARGE_INTEGER FileOffset OPTIONAL,
1777 IN ULONG Length,
1778 OUT PIO_STATUS_BLOCK IoStatus OPTIONAL
1779 );
1780
1781 typedef VOID (*PDIRTY_PAGE_ROUTINE) (
1782 IN PFILE_OBJECT FileObject,
1783 IN PLARGE_INTEGER FileOffset,
1784 IN ULONG Length,
1785 IN PLARGE_INTEGER OldestLsn,
1786 IN PLARGE_INTEGER NewestLsn,
1787 IN PVOID Context1,
1788 IN PVOID Context2
1789 );
1790
1791 NTKERNELAPI
1792 LARGE_INTEGER
1793 NTAPI
1794 CcGetDirtyPages (
1795 IN PVOID LogHandle,
1796 IN PDIRTY_PAGE_ROUTINE DirtyPageRoutine,
1797 IN PVOID Context1,
1798 IN PVOID Context2
1799 );
1800
1801 NTKERNELAPI
1802 PFILE_OBJECT
1803 NTAPI
1804 CcGetFileObjectFromBcb (
1805 IN PVOID Bcb
1806 );
1807
1808 NTKERNELAPI
1809 PFILE_OBJECT
1810 NTAPI
1811 CcGetFileObjectFromSectionPtrs (
1812 IN PSECTION_OBJECT_POINTERS SectionObjectPointer
1813 );
1814
1815 #define CcGetFileSizePointer(FO) ( \
1816 ((PLARGE_INTEGER)((FO)->SectionObjectPointer->SharedCacheMap) + 1) \
1817 )
1818
1819 #if (VER_PRODUCTBUILD >= 2195)
1820
1821 NTKERNELAPI
1822 LARGE_INTEGER
1823 NTAPI
1824 CcGetFlushedValidData (
1825 IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
1826 IN BOOLEAN BcbListHeld
1827 );
1828
1829 #endif /* (VER_PRODUCTBUILD >= 2195) */
1830
1831 NTKERNELAPI
1832 LARGE_INTEGER
1833 NTAPI
1834 CcGetLsnForFileObject (
1835 IN PFILE_OBJECT FileObject,
1836 OUT PLARGE_INTEGER OldestLsn OPTIONAL
1837 );
1838
1839 typedef BOOLEAN (NTAPI *PACQUIRE_FOR_LAZY_WRITE) (
1840 IN PVOID Context,
1841 IN BOOLEAN Wait
1842 );
1843
1844 typedef VOID (NTAPI *PRELEASE_FROM_LAZY_WRITE) (
1845 IN PVOID Context
1846 );
1847
1848 typedef BOOLEAN (NTAPI *PACQUIRE_FOR_READ_AHEAD) (
1849 IN PVOID Context,
1850 IN BOOLEAN Wait
1851 );
1852
1853 typedef VOID (NTAPI *PRELEASE_FROM_READ_AHEAD) (
1854 IN PVOID Context
1855 );
1856
1857 typedef struct _CACHE_MANAGER_CALLBACKS {
1858 PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite;
1859 PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite;
1860 PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead;
1861 PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead;
1862 } CACHE_MANAGER_CALLBACKS, *PCACHE_MANAGER_CALLBACKS;
1863
1864 NTKERNELAPI
1865 VOID
1866 NTAPI
1867 CcInitializeCacheMap (
1868 IN PFILE_OBJECT FileObject,
1869 IN PCC_FILE_SIZES FileSizes,
1870 IN BOOLEAN PinAccess,
1871 IN PCACHE_MANAGER_CALLBACKS Callbacks,
1872 IN PVOID LazyWriteContext
1873 );
1874
1875 #define CcIsFileCached(FO) ( \
1876 ((FO)->SectionObjectPointer != NULL) && \
1877 (((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \
1878 )
1879
1880 NTKERNELAPI
1881 BOOLEAN
1882 NTAPI
1883 CcIsThereDirtyData (
1884 IN PVPB Vpb
1885 );
1886
1887 NTKERNELAPI
1888 BOOLEAN
1889 NTAPI
1890 CcMapData (
1891 IN PFILE_OBJECT FileObject,
1892 IN PLARGE_INTEGER FileOffset,
1893 IN ULONG Length,
1894 IN BOOLEAN Wait,
1895 OUT PVOID *Bcb,
1896 OUT PVOID *Buffer
1897 );
1898
1899 NTKERNELAPI
1900 VOID
1901 NTAPI
1902 CcMdlRead (
1903 IN PFILE_OBJECT FileObject,
1904 IN PLARGE_INTEGER FileOffset,
1905 IN ULONG Length,
1906 OUT PMDL *MdlChain,
1907 OUT PIO_STATUS_BLOCK IoStatus
1908 );
1909
1910 NTKERNELAPI
1911 VOID
1912 NTAPI
1913 CcMdlReadComplete (
1914 IN PFILE_OBJECT FileObject,
1915 IN PMDL MdlChain
1916 );
1917
1918 NTKERNELAPI
1919 VOID
1920 NTAPI
1921 CcMdlWriteComplete (
1922 IN PFILE_OBJECT FileObject,
1923 IN PLARGE_INTEGER FileOffset,
1924 IN PMDL MdlChain
1925 );
1926
1927 NTKERNELAPI
1928 BOOLEAN
1929 NTAPI
1930 CcPinMappedData (
1931 IN PFILE_OBJECT FileObject,
1932 IN PLARGE_INTEGER FileOffset,
1933 IN ULONG Length,
1934 #if (VER_PRODUCTBUILD >= 2195)
1935 IN ULONG Flags,
1936 #else
1937 IN BOOLEAN Wait,
1938 #endif
1939 IN OUT PVOID *Bcb
1940 );
1941
1942 NTKERNELAPI
1943 BOOLEAN
1944 NTAPI
1945 CcPinRead (
1946 IN PFILE_OBJECT FileObject,
1947 IN PLARGE_INTEGER FileOffset,
1948 IN ULONG Length,
1949 #if (VER_PRODUCTBUILD >= 2195)
1950 IN ULONG Flags,
1951 #else
1952 IN BOOLEAN Wait,
1953 #endif
1954 OUT PVOID *Bcb,
1955 OUT PVOID *Buffer
1956 );
1957
1958 NTKERNELAPI
1959 VOID
1960 NTAPI
1961 CcPrepareMdlWrite (
1962 IN PFILE_OBJECT FileObject,
1963 IN PLARGE_INTEGER FileOffset,
1964 IN ULONG Length,
1965 OUT PMDL *MdlChain,
1966 OUT PIO_STATUS_BLOCK IoStatus
1967 );
1968
1969 NTKERNELAPI
1970 BOOLEAN
1971 NTAPI
1972 CcPreparePinWrite (
1973 IN PFILE_OBJECT FileObject,
1974 IN PLARGE_INTEGER FileOffset,
1975 IN ULONG Length,
1976 IN BOOLEAN Zero,
1977 #if (VER_PRODUCTBUILD >= 2195)
1978 IN ULONG Flags,
1979 #else
1980 IN BOOLEAN Wait,
1981 #endif
1982 OUT PVOID *Bcb,
1983 OUT PVOID *Buffer
1984 );
1985
1986 NTKERNELAPI
1987 BOOLEAN
1988 NTAPI
1989 CcPurgeCacheSection (
1990 IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
1991 IN PLARGE_INTEGER FileOffset OPTIONAL,
1992 IN ULONG Length,
1993 IN BOOLEAN UninitializeCacheMaps
1994 );
1995
1996 #define CcReadAhead(FO, FOFF, LEN) ( \
1997 if ((LEN) >= 256) { \
1998 CcScheduleReadAhead((FO), (FOFF), (LEN)); \
1999 } \
2000 )
2001
2002 #if (VER_PRODUCTBUILD >= 2195)
2003
2004 NTKERNELAPI
2005 PVOID
2006 NTAPI
2007 CcRemapBcb (
2008 IN PVOID Bcb
2009 );
2010
2011 #endif /* (VER_PRODUCTBUILD >= 2195) */
2012
2013 NTKERNELAPI
2014 VOID
2015 NTAPI
2016 CcRepinBcb (
2017 IN PVOID Bcb
2018 );
2019
2020 NTKERNELAPI
2021 VOID
2022 NTAPI
2023 CcScheduleReadAhead (
2024 IN PFILE_OBJECT FileObject,
2025 IN PLARGE_INTEGER FileOffset,
2026 IN ULONG Length
2027 );
2028
2029 NTKERNELAPI
2030 VOID
2031 NTAPI
2032 CcSetAdditionalCacheAttributes (
2033 IN PFILE_OBJECT FileObject,
2034 IN BOOLEAN DisableReadAhead,
2035 IN BOOLEAN DisableWriteBehind
2036 );
2037
2038 NTKERNELAPI
2039 VOID
2040 NTAPI
2041 CcSetBcbOwnerPointer (
2042 IN PVOID Bcb,
2043 IN PVOID OwnerPointer
2044 );
2045
2046 NTKERNELAPI
2047 VOID
2048 NTAPI
2049 CcSetDirtyPageThreshold (
2050 IN PFILE_OBJECT FileObject,
2051 IN ULONG DirtyPageThreshold
2052 );
2053
2054 NTKERNELAPI
2055 VOID
2056 NTAPI
2057 CcSetDirtyPinnedData (
2058 IN PVOID BcbVoid,
2059 IN PLARGE_INTEGER Lsn OPTIONAL
2060 );
2061
2062 NTKERNELAPI
2063 VOID
2064 NTAPI
2065 CcSetFileSizes (
2066 IN PFILE_OBJECT FileObject,
2067 IN PCC_FILE_SIZES FileSizes
2068 );
2069
2070 typedef VOID (NTAPI *PFLUSH_TO_LSN) (
2071 IN PVOID LogHandle,
2072 IN PLARGE_INTEGER Lsn
2073 );
2074
2075 NTKERNELAPI
2076 VOID
2077 NTAPI
2078 CcSetLogHandleForFile (
2079 IN PFILE_OBJECT FileObject,
2080 IN PVOID LogHandle,
2081 IN PFLUSH_TO_LSN FlushToLsnRoutine
2082 );
2083
2084 NTKERNELAPI
2085 VOID
2086 NTAPI
2087 CcSetReadAheadGranularity (
2088 IN PFILE_OBJECT FileObject,
2089 IN ULONG Granularity /* default: PAGE_SIZE */
2090 /* allowed: 2^n * PAGE_SIZE */
2091 );
2092
2093 NTKERNELAPI
2094 BOOLEAN
2095 NTAPI
2096 CcUninitializeCacheMap (
2097 IN PFILE_OBJECT FileObject,
2098 IN PLARGE_INTEGER TruncateSize OPTIONAL,
2099 IN PCACHE_UNINITIALIZE_EVENT UninitializeCompleteEvent OPTIONAL
2100 );
2101
2102 NTKERNELAPI
2103 VOID
2104 NTAPI
2105 CcUnpinData (
2106 IN PVOID Bcb
2107 );
2108
2109 NTKERNELAPI
2110 VOID
2111 NTAPI
2112 CcUnpinDataForThread (
2113 IN PVOID Bcb,
2114 IN ERESOURCE_THREAD ResourceThreadId
2115 );
2116
2117 NTKERNELAPI
2118 VOID
2119 NTAPI
2120 CcUnpinRepinnedBcb (
2121 IN PVOID Bcb,
2122 IN BOOLEAN WriteThrough,
2123 OUT PIO_STATUS_BLOCK IoStatus
2124 );
2125
2126 #if (VER_PRODUCTBUILD >= 2195)
2127
2128 NTKERNELAPI
2129 NTSTATUS
2130 NTAPI
2131 CcWaitForCurrentLazyWriterActivity (
2132 VOID
2133 );
2134
2135 #endif /* (VER_PRODUCTBUILD >= 2195) */
2136
2137 NTKERNELAPI
2138 BOOLEAN
2139 NTAPI
2140 CcZeroData (
2141 IN PFILE_OBJECT FileObject,
2142 IN PLARGE_INTEGER StartOffset,
2143 IN PLARGE_INTEGER EndOffset,
2144 IN BOOLEAN Wait
2145 );
2146
2147 NTKERNELAPI
2148 VOID
2149 NTAPI
2150 ExDisableResourceBoostLite (
2151 IN PERESOURCE Resource
2152 );
2153
2154 NTKERNELAPI
2155 ULONG
2156 NTAPI
2157 ExQueryPoolBlockSize (
2158 IN PVOID PoolBlock,
2159 OUT PBOOLEAN QuotaCharged
2160 );
2161
2162 #if (VER_PRODUCTBUILD >= 2600)
2163
2164 #ifndef __NTOSKRNL__
2165 NTKERNELAPI
2166 VOID
2167 FASTCALL
2168 ExInitializeRundownProtection (
2169 IN PEX_RUNDOWN_REF RunRef
2170 );
2171
2172 NTKERNELAPI
2173 VOID
2174 FASTCALL
2175 ExReInitializeRundownProtection (
2176 IN PEX_RUNDOWN_REF RunRef
2177 );
2178
2179 NTKERNELAPI
2180 BOOLEAN
2181 FASTCALL
2182 ExAcquireRundownProtection (
2183 IN PEX_RUNDOWN_REF RunRef
2184 );
2185
2186 NTKERNELAPI
2187 BOOLEAN
2188 FASTCALL
2189 ExAcquireRundownProtectionEx (
2190 IN PEX_RUNDOWN_REF RunRef,
2191 IN ULONG Count
2192 );
2193
2194 NTKERNELAPI
2195 VOID
2196 FASTCALL
2197 ExReleaseRundownProtection (
2198 IN PEX_RUNDOWN_REF RunRef
2199 );
2200
2201 NTKERNELAPI
2202 VOID
2203 FASTCALL
2204 ExReleaseRundownProtectionEx (
2205 IN PEX_RUNDOWN_REF RunRef,
2206 IN ULONG Count
2207 );
2208
2209 NTKERNELAPI
2210 VOID
2211 FASTCALL
2212 ExRundownCompleted (
2213 IN PEX_RUNDOWN_REF RunRef
2214 );
2215
2216 NTKERNELAPI
2217 VOID
2218 FASTCALL
2219 ExWaitForRundownProtectionRelease (
2220 IN PEX_RUNDOWN_REF RunRef
2221 );
2222
2223 #endif
2224 #endif /* (VER_PRODUCTBUILD >= 2600) */
2225
2226 #define FlagOn(x, f) ((x) & (f))
2227
2228 NTKERNELAPI
2229 VOID
2230 NTAPI
2231 FsRtlAddToTunnelCache (
2232 IN PTUNNEL Cache,
2233 IN ULONGLONG DirectoryKey,
2234 IN PUNICODE_STRING ShortName,
2235 IN PUNICODE_STRING LongName,
2236 IN BOOLEAN KeyByShortName,
2237 IN ULONG DataLength,
2238 IN PVOID Data
2239 );
2240
2241 #if (VER_PRODUCTBUILD >= 2195)
2242
2243 PFILE_LOCK
2244 NTAPI
2245 FsRtlAllocateFileLock (
2246 IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL,
2247 IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL
2248 );
2249
2250 #endif /* (VER_PRODUCTBUILD >= 2195) */
2251
2252 NTKERNELAPI
2253 PVOID
2254 NTAPI
2255 FsRtlAllocatePool (
2256 IN POOL_TYPE PoolType,
2257 IN ULONG NumberOfBytes
2258 );
2259
2260 NTKERNELAPI
2261 PVOID
2262 NTAPI
2263 FsRtlAllocatePoolWithQuota (
2264 IN POOL_TYPE PoolType,
2265 IN ULONG NumberOfBytes
2266 );
2267
2268 NTKERNELAPI
2269 PVOID
2270 NTAPI
2271 FsRtlAllocatePoolWithQuotaTag (
2272 IN POOL_TYPE PoolType,
2273 IN ULONG NumberOfBytes,
2274 IN ULONG Tag
2275 );
2276
2277 NTKERNELAPI
2278 PVOID
2279 NTAPI
2280 FsRtlAllocatePoolWithTag (
2281 IN POOL_TYPE PoolType,
2282 IN ULONG NumberOfBytes,
2283 IN ULONG Tag
2284 );
2285
2286 NTKERNELAPI
2287 BOOLEAN
2288 NTAPI
2289 FsRtlAreNamesEqual (
2290 IN PUNICODE_STRING Name1,
2291 IN PUNICODE_STRING Name2,
2292 IN BOOLEAN IgnoreCase,
2293 IN PWCHAR UpcaseTable OPTIONAL
2294 );
2295
2296 #define FsRtlAreThereCurrentFileLocks(FL) ( \
2297 ((FL)->FastIoIsQuestionable) \
2298 )
2299
2300 /*
2301 FsRtlCheckLockForReadAccess:
2302
2303 All this really does is pick out the lock parameters from the irp (io stack
2304 location?), get IoGetRequestorProcess, and pass values on to
2305 FsRtlFastCheckLockForRead.
2306 */
2307 NTKERNELAPI
2308 BOOLEAN
2309 NTAPI
2310 FsRtlCheckLockForReadAccess (
2311 IN PFILE_LOCK FileLock,
2312 IN PIRP Irp
2313 );
2314
2315 /*
2316 FsRtlCheckLockForWriteAccess:
2317
2318 All this really does is pick out the lock parameters from the irp (io stack
2319 location?), get IoGetRequestorProcess, and pass values on to
2320 FsRtlFastCheckLockForWrite.
2321 */
2322 NTKERNELAPI
2323 BOOLEAN
2324 NTAPI
2325 FsRtlCheckLockForWriteAccess (
2326 IN PFILE_LOCK FileLock,
2327 IN PIRP Irp
2328 );
2329
2330 typedef
2331 VOID
2332 (NTAPI*POPLOCK_WAIT_COMPLETE_ROUTINE) (
2333 IN PVOID Context,
2334 IN PIRP Irp
2335 );
2336
2337 typedef
2338 VOID
2339 (NTAPI*POPLOCK_FS_PREPOST_IRP) (
2340 IN PVOID Context,
2341 IN PIRP Irp
2342 );
2343
2344 NTKERNELAPI
2345 NTSTATUS
2346 NTAPI
2347 FsRtlCheckOplock (
2348 IN POPLOCK Oplock,
2349 IN PIRP Irp,
2350 IN PVOID Context,
2351 IN POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine OPTIONAL,
2352 IN POPLOCK_FS_PREPOST_IRP PostIrpRoutine OPTIONAL
2353 );
2354
2355 NTKERNELAPI
2356 BOOLEAN
2357 NTAPI
2358 FsRtlCopyRead (
2359 IN PFILE_OBJECT FileObject,
2360 IN PLARGE_INTEGER FileOffset,
2361 IN ULONG Length,
2362 IN BOOLEAN Wait,
2363 IN ULONG LockKey,
2364 OUT PVOID Buffer,
2365 OUT PIO_STATUS_BLOCK IoStatus,
2366 IN PDEVICE_OBJECT DeviceObject
2367 );
2368
2369 NTKERNELAPI
2370 BOOLEAN
2371 NTAPI
2372 FsRtlCopyWrite (
2373 IN PFILE_OBJECT FileObject,
2374 IN PLARGE_INTEGER FileOffset,
2375 IN ULONG Length,
2376 IN BOOLEAN Wait,
2377 IN ULONG LockKey,
2378 IN PVOID Buffer,
2379 OUT PIO_STATUS_BLOCK IoStatus,
2380 IN PDEVICE_OBJECT DeviceObject
2381 );
2382
2383 NTKERNELAPI
2384 PVOID
2385 NTAPI
2386 RtlCreateHeap (
2387 IN ULONG Flags,
2388 IN PVOID HeapBase OPTIONAL,
2389 IN SIZE_T ReserveSize OPTIONAL,
2390 IN SIZE_T CommitSize OPTIONAL,
2391 IN PVOID Lock OPTIONAL,
2392 IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL
2393 );
2394
2395 NTKERNELAPI
2396 BOOLEAN
2397 NTAPI
2398 FsRtlCurrentBatchOplock (
2399 IN POPLOCK Oplock
2400 );
2401
2402 NTKERNELAPI
2403 VOID
2404 NTAPI
2405 FsRtlDeleteKeyFromTunnelCache (
2406 IN PTUNNEL Cache,
2407 IN ULONGLONG DirectoryKey
2408 );
2409
2410 NTKERNELAPI
2411 VOID
2412 NTAPI
2413 FsRtlDeleteTunnelCache (
2414 IN PTUNNEL Cache
2415 );
2416
2417 NTKERNELAPI
2418 VOID
2419 NTAPI
2420 FsRtlDeregisterUncProvider (
2421 IN HANDLE Handle
2422 );
2423
2424 NTKERNELAPI
2425 PVOID
2426 NTAPI
2427 RtlDestroyHeap(
2428 IN PVOID HeapHandle
2429 );
2430
2431 NTKERNELAPI
2432 VOID
2433 NTAPI
2434 FsRtlDissectDbcs (
2435 IN ANSI_STRING Name,
2436 OUT PANSI_STRING FirstPart,
2437 OUT PANSI_STRING RemainingPart
2438 );
2439
2440 NTKERNELAPI
2441 VOID
2442 NTAPI
2443 FsRtlDissectName (
2444 IN UNICODE_STRING Name,
2445 OUT PUNICODE_STRING FirstPart,
2446 OUT PUNICODE_STRING RemainingPart
2447 );
2448
2449 NTKERNELAPI
2450 BOOLEAN
2451 NTAPI
2452 FsRtlDoesDbcsContainWildCards (
2453 IN PANSI_STRING Name
2454 );
2455
2456 NTKERNELAPI
2457 BOOLEAN
2458 NTAPI
2459 FsRtlDoesNameContainWildCards (
2460 IN PUNICODE_STRING Name
2461 );
2462
2463 #define FsRtlEnterFileSystem KeEnterCriticalRegion
2464
2465 #define FsRtlExitFileSystem KeLeaveCriticalRegion
2466
2467 NTKERNELAPI
2468 BOOLEAN
2469 NTAPI
2470 FsRtlFastCheckLockForRead (
2471 IN PFILE_LOCK FileLock,
2472 IN PLARGE_INTEGER FileOffset,
2473 IN PLARGE_INTEGER Length,
2474 IN ULONG Key,
2475 IN PFILE_OBJECT FileObject,
2476 IN PEPROCESS Process
2477 );
2478
2479 NTKERNELAPI
2480 BOOLEAN
2481 NTAPI
2482 FsRtlFastCheckLockForWrite (
2483 IN PFILE_LOCK FileLock,
2484 IN PLARGE_INTEGER FileOffset,
2485 IN PLARGE_INTEGER Length,
2486 IN ULONG Key,
2487 IN PFILE_OBJECT FileObject,
2488 IN PEPROCESS Process
2489 );
2490
2491 #define FsRtlFastLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) ( \
2492 FsRtlPrivateLock(A1, A2, A3, A4, A5, A6, A7, A8, A9, NULL, A10, A11) \
2493 )
2494
2495 NTKERNELAPI
2496 NTSTATUS
2497 NTAPI
2498 FsRtlFastUnlockAll (
2499 IN PFILE_LOCK FileLock,
2500 IN PFILE_OBJECT FileObject,
2501 IN PEPROCESS Process,
2502 IN PVOID Context OPTIONAL
2503 );
2504 /* ret: STATUS_RANGE_NOT_LOCKED */
2505
2506 NTKERNELAPI
2507 NTSTATUS
2508 NTAPI
2509 FsRtlFastUnlockAllByKey (
2510 IN PFILE_LOCK FileLock,
2511 IN PFILE_OBJECT FileObject,
2512 IN PEPROCESS Process,
2513 IN ULONG Key,
2514 IN PVOID Context OPTIONAL
2515 );
2516 /* ret: STATUS_RANGE_NOT_LOCKED */
2517
2518 NTKERNELAPI
2519 NTSTATUS
2520 NTAPI
2521 FsRtlFastUnlockSingle (
2522 IN PFILE_LOCK FileLock,
2523 IN PFILE_OBJECT FileObject,
2524 IN PLARGE_INTEGER FileOffset,
2525 IN PLARGE_INTEGER Length,
2526 IN PEPROCESS Process,
2527 IN ULONG Key,
2528 IN PVOID Context OPTIONAL,
2529 IN BOOLEAN AlreadySynchronized
2530 );
2531 /* ret: STATUS_RANGE_NOT_LOCKED */
2532
2533 NTKERNELAPI
2534 BOOLEAN
2535 NTAPI
2536 FsRtlFindInTunnelCache (
2537 IN PTUNNEL Cache,
2538 IN ULONGLONG DirectoryKey,
2539 IN PUNICODE_STRING Name,
2540 OUT PUNICODE_STRING ShortName,
2541 OUT PUNICODE_STRING LongName,
2542 IN OUT PULONG DataLength,
2543 OUT PVOID Data
2544 );
2545
2546 #if (VER_PRODUCTBUILD >= 2195)
2547
2548 NTKERNELAPI
2549 VOID
2550 NTAPI
2551 FsRtlFreeFileLock (
2552 IN PFILE_LOCK FileLock
2553 );
2554
2555 #endif /* (VER_PRODUCTBUILD >= 2195) */
2556
2557 NTKERNELAPI
2558 NTSTATUS
2559 NTAPI
2560 FsRtlGetFileSize (
2561 IN PFILE_OBJECT FileObject,
2562 IN OUT PLARGE_INTEGER FileSize
2563 );
2564
2565 /*
2566 FsRtlGetNextFileLock:
2567
2568 ret: NULL if no more locks
2569
2570 Internals:
2571 FsRtlGetNextFileLock uses FileLock->LastReturnedLockInfo and
2572 FileLock->LastReturnedLock as storage.
2573 LastReturnedLock is a pointer to the 'raw' lock inkl. double linked
2574 list, and FsRtlGetNextFileLock needs this to get next lock on subsequent
2575 calls with Restart = FALSE.
2576 */
2577 NTKERNELAPI
2578 PFILE_LOCK_INFO
2579 NTAPI
2580 FsRtlGetNextFileLock (
2581 IN PFILE_LOCK FileLock,
2582 IN BOOLEAN Restart
2583 );
2584
2585 NTKERNELAPI
2586 VOID
2587 NTAPI
2588 FsRtlInitializeFileLock (
2589 IN PFILE_LOCK FileLock,
2590 IN PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine OPTIONAL,
2591 IN PUNLOCK_ROUTINE UnlockRoutine OPTIONAL
2592 );
2593
2594 NTKERNELAPI
2595 VOID
2596 NTAPI
2597 FsRtlInitializeOplock (
2598 IN OUT POPLOCK Oplock
2599 );
2600
2601 NTKERNELAPI
2602 VOID
2603 NTAPI
2604 FsRtlInitializeTunnelCache (
2605 IN PTUNNEL Cache
2606 );
2607
2608 NTKERNELAPI
2609 BOOLEAN
2610 NTAPI
2611 FsRtlIsNameInExpression (
2612 IN PUNICODE_STRING Expression,
2613 IN PUNICODE_STRING Name,
2614 IN BOOLEAN IgnoreCase,
2615 IN PWCHAR UpcaseTable OPTIONAL
2616 );
2617
2618 NTKERNELAPI
2619 BOOLEAN
2620 NTAPI
2621 FsRtlIsNtstatusExpected (
2622 IN NTSTATUS Ntstatus
2623 );
2624
2625 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
2626
2627 extern PUSHORT NlsOemLeadByteInfo;
2628
2629 #define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) ( \
2630 (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE : \
2631 (NLS_MB_CODE_PAGE_TAG && \
2632 (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0))) \
2633 )
2634
2635 #define FsRtlIsAnsiCharacterWild(C) ( \
2636 FlagOn(FsRtlLegalAnsiCharacterArray[(UCHAR)(C)], FSRTL_WILD_CHARACTER ) \
2637 )
2638
2639 #define FsRtlIsUnicodeCharacterWild(C) ( \
2640 (((C) >= 0x40) ? \
2641 FALSE : \
2642 FlagOn(FsRtlLegalAnsiCharacterArray[(C)], FSRTL_WILD_CHARACTER )) \
2643 )
2644
2645 NTKERNELAPI
2646 BOOLEAN
2647 NTAPI
2648 FsRtlMdlReadDev (
2649 IN PFILE_OBJECT FileObject,
2650 IN PLARGE_INTEGER FileOffset,
2651 IN ULONG Length,
2652 IN ULONG LockKey,
2653 OUT PMDL *MdlChain,
2654 OUT PIO_STATUS_BLOCK IoStatus,
2655 IN PDEVICE_OBJECT DeviceObject
2656 );
2657
2658 NTKERNELAPI
2659 BOOLEAN
2660 NTAPI
2661 FsRtlMdlReadComplete (
2662 IN PFILE_OBJECT FileObject,
2663 IN PMDL MdlChain
2664 );
2665
2666 NTKERNELAPI
2667 BOOLEAN
2668 NTAPI
2669 FsRtlMdlReadCompleteDev (
2670 IN PFILE_OBJECT FileObject,
2671 IN PMDL MdlChain,
2672 IN PDEVICE_OBJECT DeviceObject
2673 );
2674
2675 NTKERNELAPI
2676 BOOLEAN
2677 NTAPI
2678 FsRtlPrepareMdlWriteDev (
2679 IN PFILE_OBJECT FileObject,
2680 IN PLARGE_INTEGER FileOffset,
2681 IN ULONG Length,
2682 IN ULONG LockKey,
2683 OUT PMDL *MdlChain,
2684 OUT PIO_STATUS_BLOCK IoStatus,
2685 IN PDEVICE_OBJECT DeviceObject
2686 );
2687
2688 NTKERNELAPI
2689 BOOLEAN
2690 NTAPI
2691 FsRtlMdlWriteComplete (
2692 IN PFILE_OBJECT FileObject,
2693 IN PLARGE_INTEGER FileOffset,
2694 IN PMDL MdlChain
2695 );
2696
2697 NTKERNELAPI
2698 BOOLEAN
2699 NTAPI
2700 FsRtlMdlWriteCompleteDev (
2701 IN PFILE_OBJECT FileObject,
2702 IN PLARGE_INTEGER FileOffset,
2703 IN PMDL MdlChain,
2704 IN PDEVICE_OBJECT DeviceObject
2705 );
2706
2707 NTKERNELAPI
2708 NTSTATUS
2709 NTAPI
2710 FsRtlNormalizeNtstatus (
2711 IN NTSTATUS Exception,
2712 IN NTSTATUS GenericException
2713 );
2714
2715 NTKERNELAPI
2716 VOID
2717 NTAPI
2718 FsRtlNotifyChangeDirectory (
2719 IN PNOTIFY_SYNC NotifySync,
2720 IN PVOID FsContext,
2721 IN PSTRING FullDirectoryName,
2722 IN PLIST_ENTRY NotifyList,
2723 IN BOOLEAN WatchTree,
2724 IN ULONG CompletionFilter,
2725 IN PIRP NotifyIrp
2726 );
2727
2728 NTKERNELAPI
2729 VOID
2730 NTAPI
2731 FsRtlNotifyCleanup (
2732 IN PNOTIFY_SYNC NotifySync,
2733 IN PLIST_ENTRY NotifyList,
2734 IN PVOID FsContext
2735 );
2736
2737 typedef BOOLEAN (*PCHECK_FOR_TRAVERSE_ACCESS) (
2738 IN PVOID NotifyContext,
2739 IN PVOID TargetContext,
2740 IN PSECURITY_SUBJECT_CONTEXT SubjectContext
2741 );
2742
2743 NTKERNELAPI
2744 VOID
2745 NTAPI
2746 FsRtlNotifyFullChangeDirectory (
2747 IN PNOTIFY_SYNC NotifySync,
2748 IN PLIST_ENTRY NotifyList,
2749 IN PVOID FsContext,
2750 IN PSTRING FullDirectoryName,
2751 IN BOOLEAN WatchTree,
2752 IN BOOLEAN IgnoreBuffer,
2753 IN ULONG CompletionFilter,
2754 IN PIRP NotifyIrp,
2755 IN PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback OPTIONAL,
2756 IN PSECURITY_SUBJECT_CONTEXT SubjectContext OPTIONAL
2757 );
2758
2759 NTKERNELAPI
2760 VOID
2761 NTAPI
2762 FsRtlNotifyFullReportChange (
2763 IN PNOTIFY_SYNC NotifySync,
2764 IN PLIST_ENTRY NotifyList,
2765 IN PSTRING FullTargetName,
2766 IN USHORT TargetNameOffset,
2767 IN PSTRING StreamName OPTIONAL,
2768 IN PSTRING NormalizedParentName OPTIONAL,
2769 IN ULONG FilterMatch,
2770 IN ULONG Action,
2771 IN PVOID TargetContext
2772 );
2773
2774 NTKERNELAPI
2775 VOID
2776 NTAPI
2777 FsRtlNotifyInitializeSync (
2778 IN PNOTIFY_SYNC *NotifySync
2779 );
2780
2781 NTKERNELAPI
2782 VOID
2783 NTAPI
2784 FsRtlNotifyReportChange (
2785 IN PNOTIFY_SYNC NotifySync,
2786 IN PLIST_ENTRY NotifyList,
2787 IN PSTRING FullTargetName,
2788 IN PUSHORT FileNamePartLength,
2789 IN ULONG FilterMatch
2790 );
2791
2792 NTKERNELAPI
2793 VOID
2794 NTAPI
2795 FsRtlNotifyUninitializeSync (
2796 IN PNOTIFY_SYNC *NotifySync
2797 );
2798
2799 #if (VER_PRODUCTBUILD >= 2195)
2800
2801 NTKERNELAPI
2802 NTSTATUS
2803 NTAPI
2804 FsRtlNotifyVolumeEvent (
2805 IN PFILE_OBJECT FileObject,
2806 IN ULONG EventCode
2807 );
2808
2809 #endif /* (VER_PRODUCTBUILD >= 2195) */
2810
2811 NTKERNELAPI
2812 NTSTATUS
2813 NTAPI
2814 FsRtlOplockFsctrl (
2815 IN POPLOCK Oplock,
2816 IN PIRP Irp,
2817 IN ULONG OpenCount
2818 );
2819
2820 NTKERNELAPI
2821 BOOLEAN
2822 NTAPI
2823 FsRtlOplockIsFastIoPossible (
2824 IN POPLOCK Oplock
2825 );
2826
2827 /*
2828 FsRtlPrivateLock:
2829
2830 ret: IoStatus->Status: STATUS_PENDING, STATUS_LOCK_NOT_GRANTED
2831
2832 Internals:
2833 -Calls IoCompleteRequest if Irp
2834 -Uses exception handling / ExRaiseStatus with STATUS_INSUFFICIENT_RESOURCES
2835 */
2836 NTKERNELAPI
2837 BOOLEAN
2838 NTAPI
2839 FsRtlPrivateLock (
2840 IN PFILE_LOCK FileLock,
2841 IN PFILE_OBJECT FileObject,
2842 IN PLARGE_INTEGER FileOffset,
2843 IN PLARGE_INTEGER Length,
2844 IN PEPROCESS Process,
2845 IN ULONG Key,
2846 IN BOOLEAN FailImmediately,
2847 IN BOOLEAN ExclusiveLock,
2848 OUT PIO_STATUS_BLOCK IoStatus,
2849 IN PIRP Irp OPTIONAL,
2850 IN PVOID Context,
2851 IN BOOLEAN AlreadySynchronized
2852 );
2853
2854 /*
2855 FsRtlProcessFileLock:
2856
2857 ret:
2858 -STATUS_INVALID_DEVICE_REQUEST
2859 -STATUS_RANGE_NOT_LOCKED from unlock routines.
2860 -STATUS_PENDING, STATUS_LOCK_NOT_GRANTED from FsRtlPrivateLock
2861 (redirected IoStatus->Status).
2862
2863 Internals:
2864 -switch ( Irp->CurrentStackLocation->MinorFunction )
2865 lock: return FsRtlPrivateLock;
2866 unlocksingle: return FsRtlFastUnlockSingle;
2867 unlockall: return FsRtlFastUnlockAll;
2868 unlockallbykey: return FsRtlFastUnlockAllByKey;
2869 default: IofCompleteRequest with STATUS_INVALID_DEVICE_REQUEST;
2870 return STATUS_INVALID_DEVICE_REQUEST;
2871
2872 -'AllwaysZero' is passed thru as 'AllwaysZero' to lock / unlock routines.
2873 -'Irp' is passet thru as 'Irp' to FsRtlPrivateLock.
2874 */
2875 NTKERNELAPI
2876 NTSTATUS
2877 NTAPI
2878 FsRtlProcessFileLock (
2879 IN PFILE_LOCK FileLock,
2880 IN PIRP Irp,
2881 IN PVOID Context OPTIONAL
2882 );
2883
2884 NTKERNELAPI
2885 NTSTATUS
2886 NTAPI
2887 FsRtlRegisterUncProvider (
2888 IN OUT PHANDLE MupHandle,
2889 IN PUNICODE_STRING RedirectorDeviceName,
2890 IN BOOLEAN MailslotsSupported
2891 );
2892
2893 typedef VOID
2894 (NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE) (
2895 IN PVOID Context,
2896 IN PKEVENT Event
2897 );
2898
2899 NTKERNELAPI
2900 VOID
2901 NTAPI
2902 FsRtlPostStackOverflow (
2903 IN PVOID Context,
2904 IN PKEVENT Event,
2905 IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine
2906 );
2907
2908 NTKERNELAPI
2909 VOID
2910 NTAPI
2911 FsRtlPostPagingFileStackOverflow (
2912 IN PVOID Context,
2913 IN PKEVENT Event,
2914 IN PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine
2915 );
2916
2917 NTKERNELAPI
2918 VOID
2919 NTAPI
2920 FsRtlUninitializeFileLock (
2921 IN PFILE_LOCK FileLock
2922 );
2923
2924 NTKERNELAPI
2925 VOID
2926 NTAPI
2927 FsRtlUninitializeOplock (
2928 IN OUT POPLOCK Oplock
2929 );
2930
2931 NTSYSAPI
2932 VOID
2933 NTAPI
2934 HalDisplayString (
2935 IN PCHAR String
2936 );
2937
2938 NTSYSAPI
2939 VOID
2940 NTAPI
2941 HalQueryRealTimeClock (
2942 IN OUT PTIME_FIELDS TimeFields
2943 );
2944
2945 NTSYSAPI
2946 VOID
2947 NTAPI
2948 HalSetRealTimeClock (
2949 IN PTIME_FIELDS TimeFields
2950 );
2951
2952 NTKERNELAPI
2953 NTSTATUS
2954 NTAPI
2955 IoAttachDeviceToDeviceStackSafe(
2956 IN PDEVICE_OBJECT SourceDevice,
2957 IN PDEVICE_OBJECT TargetDevice,
2958 OUT PDEVICE_OBJECT *AttachedToDeviceObject
2959 );
2960
2961 NTKERNELAPI
2962 VOID
2963 NTAPI
2964 IoAcquireVpbSpinLock (
2965 OUT PKIRQL Irql
2966 );
2967
2968 NTKERNELAPI
2969 NTSTATUS
2970 NTAPI
2971 IoCheckDesiredAccess (
2972 IN OUT PACCESS_MASK DesiredAccess,
2973 IN ACCESS_MASK GrantedAccess
2974 );
2975
2976 NTKERNELAPI
2977 NTSTATUS
2978 NTAPI
2979 IoCheckEaBufferValidity (
2980 IN PFILE_FULL_EA_INFORMATION EaBuffer,
2981 IN ULONG EaLength,
2982 OUT PULONG ErrorOffset
2983 );
2984
2985 NTKERNELAPI
2986 NTSTATUS
2987 NTAPI
2988 IoCheckFunctionAccess (
2989 IN ACCESS_MASK GrantedAccess,
2990 IN UCHAR MajorFunction,
2991 IN UCHAR MinorFunction,
2992 IN ULONG IoControlCode,
2993 IN PVOID Argument1 OPTIONAL,
2994 IN PVOID Argument2 OPTIONAL
2995 );
2996
2997 #if (VER_PRODUCTBUILD >= 2195)
2998
2999 NTKERNELAPI
3000 NTSTATUS
3001 NTAPI
3002 IoCheckQuotaBufferValidity (
3003 IN PFILE_QUOTA_INFORMATION QuotaBuffer,
3004 IN ULONG QuotaLength,
3005 OUT PULONG ErrorOffset
3006 );
3007
3008 #endif /* (VER_PRODUCTBUILD >= 2195) */
3009
3010 NTKERNELAPI
3011 PFILE_OBJECT
3012 NTAPI
3013 IoCreateStreamFileObject (
3014 IN PFILE_OBJECT FileObject OPTIONAL,
3015 IN PDEVICE_OBJECT DeviceObject OPTIONAL
3016 );
3017
3018 #if (VER_PRODUCTBUILD >= 2195)
3019
3020 NTKERNELAPI
3021 PFILE_OBJECT
3022 NTAPI
3023 IoCreateStreamFileObjectLite (
3024 IN PFILE_OBJECT FileObject OPTIONAL,
3025 IN PDEVICE_OBJECT DeviceObject OPTIONAL
3026 );
3027
3028 #endif /* (VER_PRODUCTBUILD >= 2195) */
3029
3030 NTKERNELAPI
3031 BOOLEAN
3032 NTAPI
3033 IoFastQueryNetworkAttributes (
3034 IN POBJECT_ATTRIBUTES ObjectAttributes,
3035 IN ACCESS_MASK DesiredAccess,
3036 IN ULONG OpenOptions,
3037 OUT PIO_STATUS_BLOCK IoStatus,
3038 OUT PFILE_NETWORK_OPEN_INFORMATION Buffer
3039 );
3040
3041 NTKERNELAPI
3042 PDEVICE_OBJECT
3043 NTAPI
3044 IoGetAttachedDevice (
3045 IN PDEVICE_OBJECT DeviceObject
3046 );
3047
3048 NTKERNELAPI
3049 PDEVICE_OBJECT
3050 NTAPI
3051 IoGetBaseFileSystemDeviceObject (
3052 IN PFILE_OBJECT FileObject
3053 );
3054
3055 NTKERNELAPI
3056 PEPROCESS
3057 NTAPI
3058 IoGetRequestorProcess (
3059 IN PIRP Irp
3060 );
3061
3062 #if (VER_PRODUCTBUILD >= 2195)
3063
3064 NTKERNELAPI
3065 ULONG
3066 NTAPI
3067 IoGetRequestorProcessId (
3068 IN PIRP Irp
3069 );
3070
3071 #endif /* (VER_PRODUCTBUILD >= 2195) */
3072
3073 NTKERNELAPI
3074 PIRP
3075 NTAPI
3076 IoGetTopLevelIrp (
3077 VOID
3078 );
3079
3080 #define IoIsFileOpenedExclusively(FileObject) ( \
3081 (BOOLEAN) !( \
3082 (FileObject)->SharedRead || \
3083 (FileObject)->SharedWrite || \
3084 (FileObject)->SharedDelete \
3085 ) \
3086 )
3087
3088 NTKERNELAPI
3089 BOOLEAN
3090 NTAPI
3091 IoIsOperationSynchronous (
3092 IN PIRP Irp
3093 );
3094
3095 NTKERNELAPI
3096 BOOLEAN
3097 NTAPI
3098 IoIsSystemThread (
3099 IN PETHREAD Thread
3100 );
3101
3102 #if (VER_PRODUCTBUILD >= 2195)
3103
3104 NTKERNELAPI
3105 BOOLEAN
3106 NTAPI
3107 IoIsValidNameGraftingBuffer (
3108 IN PIRP Irp,
3109 IN PREPARSE_DATA_BUFFER ReparseBuffer
3110 );
3111
3112 #endif /* (VER_PRODUCTBUILD >= 2195) */
3113
3114 NTKERNELAPI
3115 NTSTATUS
3116 NTAPI
3117 IoPageRead (
3118 IN PFILE_OBJECT FileObject,
3119 IN PMDL Mdl,
3120 IN PLARGE_INTEGER Offset,
3121 IN PKEVENT Event,
3122 OUT PIO_STATUS_BLOCK IoStatusBlock
3123 );
3124
3125 NTKERNELAPI
3126 NTSTATUS
3127 NTAPI
3128 IoQueryFileInformation (
3129 IN PFILE_OBJECT FileObject,
3130 IN FILE_INFORMATION_CLASS FileInformationClass,
3131 IN ULONG Length,
3132 OUT PVOID FileInformation,
3133 OUT PULONG ReturnedLength
3134 );
3135
3136 NTKERNELAPI
3137 NTSTATUS
3138 NTAPI
3139 IoQueryVolumeInformation (
3140 IN PFILE_OBJECT FileObject,
3141 IN FS_INFORMATION_CLASS FsInformationClass,
3142 IN ULONG Length,
3143 OUT PVOID FsInformation,
3144 OUT PULONG ReturnedLength
3145 );
3146
3147 NTKERNELAPI
3148 VOID
3149 NTAPI
3150 IoQueueThreadIrp(
3151 IN PIRP Irp
3152 );
3153
3154 NTKERNELAPI
3155 VOID
3156 NTAPI
3157 IoRegisterFileSystem (
3158 IN OUT PDEVICE_OBJECT DeviceObject
3159 );
3160
3161 #if (VER_PRODUCTBUILD >= 1381)
3162
3163 typedef VOID (NTAPI *PDRIVER_FS_NOTIFICATION) (
3164 IN PDEVICE_OBJECT DeviceObject,
3165 IN BOOLEAN DriverActive
3166 );
3167
3168 NTKERNELAPI
3169 NTSTATUS
3170 NTAPI
3171 IoRegisterFsRegistrationChange (
3172 IN PDRIVER_OBJECT DriverObject,
3173 IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
3174 );
3175
3176 #endif /* (VER_PRODUCTBUILD >= 1381) */
3177
3178 NTKERNELAPI
3179 VOID
3180 NTAPI
3181 IoReleaseVpbSpinLock (
3182 IN KIRQL Irql
3183 );
3184
3185 NTKERNELAPI
3186 VOID
3187 NTAPI
3188 IoSetDeviceToVerify (
3189 IN PETHREAD Thread,
3190 IN PDEVICE_OBJECT DeviceObject
3191 );
3192
3193 NTKERNELAPI
3194 NTSTATUS
3195 NTAPI
3196 IoSetInformation (
3197 IN PFILE_OBJECT FileObject,
3198 IN FILE_INFORMATION_CLASS FileInformationClass,
3199 IN ULONG Length,
3200 IN PVOID FileInformation
3201 );
3202
3203 NTKERNELAPI
3204 VOID
3205 NTAPI
3206 IoSetTopLevelIrp (
3207 IN PIRP Irp
3208 );
3209
3210 NTKERNELAPI
3211 NTSTATUS
3212 NTAPI
3213 IoSynchronousPageWrite (
3214 IN PFILE_OBJECT FileObject,
3215 IN PMDL Mdl,
3216 IN PLARGE_INTEGER FileOffset,
3217 IN PKEVENT Event,
3218 OUT PIO_STATUS_BLOCK IoStatusBlock
3219 );
3220
3221 NTKERNELAPI
3222 PEPROCESS
3223 NTAPI
3224 IoThreadToProcess (
3225 IN PETHREAD Thread
3226 );
3227
3228 NTKERNELAPI
3229 VOID
3230 NTAPI
3231 IoUnregisterFileSystem (
3232 IN OUT PDEVICE_OBJECT DeviceObject
3233 );
3234
3235 #if (VER_PRODUCTBUILD >= 1381)
3236
3237 NTKERNELAPI
3238 VOID
3239 NTAPI
3240 IoUnregisterFsRegistrationChange (
3241 IN PDRIVER_OBJECT DriverObject,
3242 IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
3243 );
3244
3245 #endif /* (VER_PRODUCTBUILD >= 1381) */
3246
3247 NTKERNELAPI
3248 NTSTATUS
3249 NTAPI
3250 IoVerifyVolume (
3251 IN PDEVICE_OBJECT DeviceObject,
3252 IN BOOLEAN AllowRawMount
3253 );
3254
3255 NTKERNELAPI
3256 VOID
3257 NTAPI
3258 KeAttachProcess (
3259 IN PKPROCESS Process
3260 );
3261
3262 NTKERNELAPI
3263 VOID
3264 NTAPI
3265 KeDetachProcess (
3266 VOID
3267 );
3268
3269 NTKERNELAPI
3270 VOID
3271 NTAPI
3272 KeInitializeQueue (
3273 IN PRKQUEUE Queue,
3274 IN ULONG Count OPTIONAL
3275 );
3276
3277 NTKERNELAPI
3278 LONG
3279 NTAPI
3280 KeInsertHeadQueue (
3281 IN PRKQUEUE Queue,
3282 IN PLIST_ENTRY Entry
3283 );
3284
3285 NTKERNELAPI
3286 LONG
3287 NTAPI
3288 KeInsertQueue (
3289 IN PRKQUEUE Queue,
3290 IN PLIST_ENTRY Entry
3291 );
3292
3293 NTKERNELAPI
3294 BOOLEAN
3295 NTAPI
3296 KeInsertQueueApc (
3297 IN PKAPC Apc,
3298 IN PVOID SystemArgument1,
3299 IN PVOID SystemArgument2,
3300 IN KPRIORITY PriorityBoost
3301 );
3302
3303 NTKERNELAPI
3304 LONG
3305 NTAPI
3306 KeReadStateQueue (
3307 IN PRKQUEUE Queue
3308 );
3309
3310 NTKERNELAPI
3311 PLIST_ENTRY
3312 NTAPI
3313 KeRemoveQueue (
3314 IN PRKQUEUE Queue,
3315 IN KPROCESSOR_MODE WaitMode,
3316 IN PLARGE_INTEGER Timeout OPTIONAL
3317 );
3318
3319 NTKERNELAPI
3320 PLIST_ENTRY
3321 NTAPI
3322 KeRundownQueue (
3323 IN PRKQUEUE Queue
3324 );
3325
3326 NTKERNELAPI
3327 VOID
3328 NTAPI
3329 KeInitializeMutant (
3330 IN PRKMUTANT Mutant,
3331 IN BOOLEAN InitialOwner
3332 );
3333
3334 NTKERNELAPI
3335 LONG
3336 NTAPI
3337 KeReadStateMutant (
3338 IN PRKMUTANT Mutant
3339 );
3340
3341 NTKERNELAPI
3342 LONG
3343 NTAPI
3344 KeReleaseMutant (
3345 IN PRKMUTANT Mutant,
3346 IN KPRIORITY Increment,
3347 IN BOOLEAN Abandoned,
3348 IN BOOLEAN Wait
3349 );
3350
3351 #if (VER_PRODUCTBUILD >= 2195)
3352
3353 NTKERNELAPI
3354 VOID
3355 NTAPI
3356 KeStackAttachProcess (
3357 IN PKPROCESS Process,
3358 OUT PKAPC_STATE ApcState
3359 );
3360
3361 NTKERNELAPI
3362 VOID
3363 NTAPI
3364 KeUnstackDetachProcess (
3365 IN PKAPC_STATE ApcState
3366 );
3367
3368 #endif /* (VER_PRODUCTBUILD >= 2195) */
3369
3370 NTKERNELAPI
3371 BOOLEAN
3372 NTAPI
3373 MmCanFileBeTruncated (
3374 IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
3375 IN PLARGE_INTEGER NewFileSize
3376 );
3377
3378 NTKERNELAPI
3379 BOOLEAN
3380 NTAPI
3381 MmFlushImageSection (
3382 IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
3383 IN MMFLUSH_TYPE FlushType
3384 );
3385
3386 NTKERNELAPI
3387 BOOLEAN
3388 NTAPI
3389 MmForceSectionClosed (
3390 IN PSECTION_OBJECT_POINTERS SectionObjectPointer,
3391 IN BOOLEAN DelayClose
3392 );
3393
3394 #if (VER_PRODUCTBUILD >= 1381)
3395
3396 NTKERNELAPI
3397 BOOLEAN
3398 NTAPI
3399 MmIsRecursiveIoFault (
3400 VOID
3401 );
3402
3403 #else
3404
3405 #define MmIsRecursiveIoFault() ( \
3406 (PsGetCurrentThread()->DisablePageFaultClustering) | \
3407 (PsGetCurrentThread()->ForwardClusterOnly) \
3408 )
3409
3410 #endif
3411
3412 NTKERNELAPI
3413 NTSTATUS
3414 NTAPI
3415 MmMapViewOfSection (
3416 IN PVOID SectionObject,
3417 IN PEPROCESS Process,
3418 IN OUT PVOID *BaseAddress,
3419 IN ULONG ZeroBits,
3420 IN ULONG CommitSize,
3421 IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
3422 IN OUT PULONG ViewSize,
3423 IN SECTION_INHERIT InheritDisposition,
3424 IN ULONG AllocationType,
3425 IN ULONG Protect
3426 );
3427
3428 NTKERNELAPI
3429 BOOLEAN
3430 NTAPI
3431 MmSetAddressRangeModified (
3432 IN PVOID Address,
3433 IN ULONG Length
3434 );
3435
3436 NTKERNELAPI
3437 NTSTATUS
3438 NTAPI
3439 ObCreateObject (
3440 IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
3441 IN POBJECT_TYPE ObjectType,
3442 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
3443 IN KPROCESSOR_MODE AccessMode,
3444 IN OUT PVOID ParseContext OPTIONAL,
3445 IN ULONG ObjectSize,
3446 IN ULONG PagedPoolCharge OPTIONAL,
3447 IN ULONG NonPagedPoolCharge OPTIONAL,
3448 OUT PVOID *Object
3449 );
3450
3451 NTKERNELAPI
3452 ULONG
3453 NTAPI
3454 ObGetObjectPointerCount (
3455 IN PVOID Object
3456 );
3457
3458 NTKERNELAPI
3459 NTSTATUS
3460 NTAPI
3461 ObInsertObject (
3462 IN PVOID Object,
3463 IN PACCESS_STATE PassedAccessState OPTIONAL,
3464 IN ACCESS_MASK DesiredAccess,
3465 IN ULONG AdditionalReferences,
3466 OUT PVOID *ReferencedObject OPTIONAL,
3467 OUT PHANDLE Handle
3468 );
3469
3470 NTKERNELAPI
3471 VOID
3472 NTAPI
3473 ObMakeTemporaryObject (
3474 IN PVOID Object
3475 );
3476
3477 NTKERNELAPI
3478 NTSTATUS
3479 NTAPI
3480 ObOpenObjectByPointer (
3481 IN PVOID Object,
3482 IN ULONG HandleAttributes,
3483 IN PACCESS_STATE PassedAccessState OPTIONAL,
3484 IN ACCESS_MASK DesiredAccess OPTIONAL,
3485 IN POBJECT_TYPE ObjectType OPTIONAL,
3486 IN KPROCESSOR_MODE AccessMode,
3487 OUT PHANDLE Handle
3488 );
3489
3490 NTKERNELAPI
3491 NTSTATUS
3492 NTAPI
3493 ObQueryNameString (
3494 IN PVOID Object,
3495 OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
3496 IN ULONG Length,
3497 OUT PULONG ReturnLength
3498 );
3499
3500 NTKERNELAPI
3501 NTSTATUS
3502 NTAPI
3503 ObQueryObjectAuditingByHandle (
3504 IN HANDLE Handle,
3505 OUT PBOOLEAN GenerateOnClose
3506 );
3507
3508 NTKERNELAPI
3509 NTSTATUS
3510 NTAPI
3511 ObReferenceObjectByName (
3512 IN PUNICODE_STRING ObjectName,
3513 IN ULONG Attributes,
3514 IN PACCESS_STATE PassedAccessState OPTIONAL,
3515 IN ACCESS_MASK DesiredAccess OPTIONAL,
3516 IN POBJECT_TYPE ObjectType,
3517 IN KPROCESSOR_MODE AccessMode,
3518 IN OUT PVOID ParseContext OPTIONAL,
3519 OUT PVOID *Object
3520 );
3521
3522 NTKERNELAPI
3523 NTSTATUS
3524 NTAPI
3525 PsAssignImpersonationToken (
3526 IN PETHREAD Thread,
3527 IN HANDLE Token
3528 );
3529
3530 NTKERNELAPI
3531 VOID
3532 NTAPI
3533 PsChargePoolQuota (
3534 IN PEPROCESS Process,
3535 IN POOL_TYPE PoolType,
3536 IN ULONG Amount
3537 );
3538
3539 NTKERNELAPI
3540 NTSTATUS
3541 NTAPI
3542 PsChargeProcessPoolQuota (
3543 IN PEPROCESS Process,
3544 IN POOL_TYPE PoolType,
3545 IN ULONG_PTR Amount
3546 );
3547
3548 #define PsDereferenceImpersonationToken(T) \
3549 {if (ARGUMENT_PRESENT(T)) { \
3550 (ObDereferenceObject((T))); \
3551 } else { \
3552 ; \
3553 } \
3554 }
3555
3556 #define PsDereferencePrimaryToken(T) (ObDereferenceObject((T)))
3557
3558 NTKERNELAPI
3559 BOOLEAN
3560 NTAPI
3561 PsDisableImpersonation(
3562 IN PETHREAD Thread,
3563 IN PSE_IMPERSONATION_STATE ImpersonationState
3564 );
3565
3566 NTKERNELAPI
3567 LARGE_INTEGER
3568 NTAPI
3569 PsGetProcessExitTime (
3570 VOID
3571 );
3572
3573 NTKERNELAPI
3574 NTSTATUS
3575 NTAPI
3576 PsImpersonateClient(
3577 IN PETHREAD Thread,
3578 IN PACCESS_TOKEN Token,
3579 IN BOOLEAN CopyOnOpen,
3580 IN BOOLEAN EffectiveOnly,
3581 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
3582 );
3583
3584 NTKERNELAPI
3585 BOOLEAN
3586 NTAPI
3587 PsIsSystemThread(
3588 IN PETHREAD Thread
3589 );
3590
3591 NTKERNELAPI
3592 BOOLEAN
3593 NTAPI
3594 PsIsThreadTerminating (
3595 IN PETHREAD Thread
3596 );
3597
3598 NTKERNELAPI
3599 NTSTATUS
3600 NTAPI
3601 PsLookupProcessByProcessId (
3602 IN HANDLE ProcessId,
3603 OUT PEPROCESS *Process
3604 );
3605
3606 NTKERNELAPI
3607 NTSTATUS
3608 NTAPI
3609 PsLookupProcessThreadByCid (
3610 IN PCLIENT_ID Cid,
3611 OUT PEPROCESS *Process OPTIONAL,
3612 OUT PETHREAD *Thread
3613 );
3614
3615 NTKERNELAPI
3616 NTSTATUS
3617 NTAPI
3618 PsLookupThreadByThreadId (
3619 IN HANDLE UniqueThreadId,
3620 OUT PETHREAD *Thread
3621 );
3622
3623 NTKERNELAPI
3624 PACCESS_TOKEN
3625 NTAPI
3626 PsReferenceImpersonationToken (
3627 IN PETHREAD Thread,
3628 OUT PBOOLEAN CopyOnUse,
3629 OUT PBOOLEAN EffectiveOnly,
3630 OUT PSECURITY_IMPERSONATION_LEVEL Level
3631 );
3632
3633 NTKERNELAPI
3634 HANDLE
3635 NTAPI
3636 PsReferencePrimaryToken (
3637 IN PEPROCESS Process
3638 );
3639
3640 NTKERNELAPI
3641 VOID
3642 NTAPI
3643 PsRestoreImpersonation(
3644 IN PETHREAD Thread,
3645 IN PSE_IMPERSONATION_STATE ImpersonationState
3646 );
3647
3648 NTKERNELAPI
3649 VOID
3650 NTAPI
3651 PsReturnPoolQuota (
3652 IN PEPROCESS Process,
3653 IN POOL_TYPE PoolType,
3654 IN ULONG Amount
3655 );
3656
3657 NTKERNELAPI
3658 VOID
3659 NTAPI
3660 PsRevertToSelf (
3661 VOID
3662 );
3663
3664 NTSYSAPI
3665 NTSTATUS
3666 NTAPI
3667 RtlAbsoluteToSelfRelativeSD (
3668 IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
3669 IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
3670 IN PULONG BufferLength
3671 );
3672
3673 NTSYSAPI
3674 PVOID
3675 NTAPI
3676 RtlAllocateHeap (
3677 IN HANDLE HeapHandle,
3678 IN ULONG Flags,
3679 IN ULONG Size
3680 );
3681
3682 NTSYSAPI
3683 NTSTATUS
3684 NTAPI
3685 RtlCompressBuffer (
3686 IN USHORT CompressionFormatAndEngine,
3687 IN PUCHAR UncompressedBuffer,
3688 IN ULONG UncompressedBufferSize,
3689 OUT PUCHAR CompressedBuffer,
3690 IN ULONG CompressedBufferSize,
3691 IN ULONG UncompressedChunkSize,
3692 OUT PULONG FinalCompressedSize,
3693 IN PVOID WorkSpace
3694 );
3695
3696 NTSYSAPI
3697 NTSTATUS
3698 NTAPI
3699 RtlCompressChunks (
3700 IN PUCHAR UncompressedBuffer,
3701 IN ULONG UncompressedBufferSize,
3702 OUT PUCHAR CompressedBuffer,
3703 IN ULONG CompressedBufferSize,
3704 IN OUT PCOMPRESSED_DATA_INFO CompressedDataInfo,
3705 IN ULONG CompressedDataInfoLength,
3706 IN PVOID WorkSpace
3707 );
3708
3709 NTSYSAPI
3710 NTSTATUS
3711 NTAPI
3712 RtlConvertSidToUnicodeString (
3713 OUT PUNICODE_STRING DestinationString,
3714 IN PSID Sid,
3715 IN BOOLEAN AllocateDestinationString
3716 );
3717
3718 NTSYSAPI
3719 NTSTATUS
3720 NTAPI
3721 RtlCopySid (
3722 IN ULONG Length,
3723 IN PSID Destination,
3724 IN PSID Source
3725 );
3726
3727 NTSYSAPI
3728 BOOLEAN
3729 NTAPI
3730 RtlCreateUnicodeString(
3731 PUNICODE_STRING DestinationString,
3732 PCWSTR SourceString
3733 );
3734
3735 NTSYSAPI
3736 NTSTATUS
3737 NTAPI
3738 RtlDecompressBuffer (
3739 IN USHORT CompressionFormat,
3740 OUT PUCHAR UncompressedBuffer,
3741 IN ULONG UncompressedBufferSize,
3742 IN PUCHAR CompressedBuffer,
3743 IN ULONG CompressedBufferSize,
3744 OUT PULONG FinalUncompressedSize
3745 );
3746
3747 NTSYSAPI
3748 NTSTATUS
3749 NTAPI
3750 RtlDecompressChunks (
3751 OUT PUCHAR UncompressedBuffer,
3752 IN ULONG UncompressedBufferSize,
3753 IN PUCHAR CompressedBuffer,
3754 IN ULONG CompressedBufferSize,
3755 IN PUCHAR CompressedTail,
3756 IN ULONG CompressedTailSize,
3757 IN PCOMPRESSED_DATA_INFO CompressedDataInfo
3758 );
3759
3760 NTSYSAPI
3761 NTSTATUS
3762 NTAPI
3763 RtlDecompressFragment (
3764 IN USHORT CompressionFormat,
3765 OUT PUCHAR UncompressedFragment,
3766 IN ULONG UncompressedFragmentSize,
3767 IN PUCHAR CompressedBuffer,
3768 IN ULONG CompressedBufferSize,
3769 IN ULONG FragmentOffset,
3770 OUT PULONG FinalUncompressedSize,
3771 IN PVOID WorkSpace
3772 );
3773
3774 NTSYSAPI
3775 NTSTATUS
3776 NTAPI
3777 RtlDescribeChunk (
3778 IN USHORT CompressionFormat,
3779 IN OUT PUCHAR *CompressedBuffer,
3780 IN PUCHAR EndOfCompressedBufferPlus1,
3781 OUT PUCHAR *ChunkBuffer,
3782 OUT PULONG ChunkSize
3783 );
3784
3785 NTSYSAPI
3786 NTSTATUS
3787 NTAPI
3788 RtlDowncaseUnicodeString(
3789 IN OUT PUNICODE_STRING UniDest,
3790 IN PCUNICODE_STRING UniSource,
3791 IN BOOLEAN AllocateDestinationString
3792 );
3793
3794 NTSYSAPI
3795 NTSTATUS
3796 NTAPI
3797 RtlDuplicateUnicodeString(
3798 IN ULONG Flags,
3799 IN PCUNICODE_STRING SourceString,
3800 OUT PUNICODE_STRING DestinationString
3801 );
3802
3803 NTSYSAPI
3804 BOOLEAN