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