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