Merge the rest from header branch.
[reactos.git] / reactos / 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 #pragma once
24
25 #define _NTIFS_INCLUDED_
26 #define _GNU_NTIFS_
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /* Dependencies */
33 #include <ntddk.h>
34 #include <excpt.h>
35 #include <ntdef.h>
36 #include <ntnls.h>
37 #include <ntstatus.h>
38 #include <bugcodes.h>
39 /* FIXME : #include <ntiologc.h> */
40
41 #ifndef FlagOn
42 #define FlagOn(_F,_SF) ((_F) & (_SF))
43 #endif
44
45 #ifndef BooleanFlagOn
46 #define BooleanFlagOn(F,SF) ((BOOLEAN)(((F) & (SF)) != 0))
47 #endif
48
49 #ifndef SetFlag
50 #define SetFlag(_F,_SF) ((_F) |= (_SF))
51 #endif
52
53 #ifndef ClearFlag
54 #define ClearFlag(_F,_SF) ((_F) &= ~(_SF))
55 #endif
56
57 typedef UNICODE_STRING LSA_UNICODE_STRING, *PLSA_UNICODE_STRING;
58 typedef STRING LSA_STRING, *PLSA_STRING;
59 typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES;
60
61 #ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
62 #define SID_IDENTIFIER_AUTHORITY_DEFINED
63 typedef struct _SID_IDENTIFIER_AUTHORITY {
64 UCHAR Value[6];
65 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
66 #endif
67
68 #ifndef SID_DEFINED
69 #define SID_DEFINED
70 typedef struct _SID {
71 UCHAR Revision;
72 UCHAR SubAuthorityCount;
73 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
74 ULONG SubAuthority[ANYSIZE_ARRAY];
75 } SID, *PISID;
76 #endif
77
78 #define SID_REVISION 1
79 #define SID_MAX_SUB_AUTHORITIES 15
80 #define SID_RECOMMENDED_SUB_AUTHORITIES 1
81
82 typedef enum _SID_NAME_USE {
83 SidTypeUser = 1,
84 SidTypeGroup,
85 SidTypeDomain,
86 SidTypeAlias,
87 SidTypeWellKnownGroup,
88 SidTypeDeletedAccount,
89 SidTypeInvalid,
90 SidTypeUnknown,
91 SidTypeComputer,
92 SidTypeLabel
93 } SID_NAME_USE, *PSID_NAME_USE;
94
95 typedef struct _SID_AND_ATTRIBUTES {
96 PSID Sid;
97 ULONG Attributes;
98 } SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
99 typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
100 typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
101
102 #define SID_HASH_SIZE 32
103 typedef ULONG_PTR SID_HASH_ENTRY, *PSID_HASH_ENTRY;
104
105 typedef struct _SID_AND_ATTRIBUTES_HASH {
106 ULONG SidCount;
107 PSID_AND_ATTRIBUTES SidAttr;
108 SID_HASH_ENTRY Hash[SID_HASH_SIZE];
109 } SID_AND_ATTRIBUTES_HASH, *PSID_AND_ATTRIBUTES_HASH;
110
111 /* Universal well-known SIDs */
112
113 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
114 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
115 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
116 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
117 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
118 #define SECURITY_RESOURCE_MANAGER_AUTHORITY {0,0,0,0,0,9}
119
120 #define SECURITY_NULL_RID (0x00000000L)
121 #define SECURITY_WORLD_RID (0x00000000L)
122 #define SECURITY_LOCAL_RID (0x00000000L)
123 #define SECURITY_LOCAL_LOGON_RID (0x00000001L)
124
125 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
126 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
127 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
128 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
129 #define SECURITY_CREATOR_OWNER_RIGHTS_RID (0x00000004L)
130
131 /* NT well-known SIDs */
132
133 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
134
135 #define SECURITY_DIALUP_RID (0x00000001L)
136 #define SECURITY_NETWORK_RID (0x00000002L)
137 #define SECURITY_BATCH_RID (0x00000003L)
138 #define SECURITY_INTERACTIVE_RID (0x00000004L)
139 #define SECURITY_LOGON_IDS_RID (0x00000005L)
140 #define SECURITY_LOGON_IDS_RID_COUNT (3L)
141 #define SECURITY_SERVICE_RID (0x00000006L)
142 #define SECURITY_ANONYMOUS_LOGON_RID (0x00000007L)
143 #define SECURITY_PROXY_RID (0x00000008L)
144 #define SECURITY_ENTERPRISE_CONTROLLERS_RID (0x00000009L)
145 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
146 #define SECURITY_PRINCIPAL_SELF_RID (0x0000000AL)
147 #define SECURITY_AUTHENTICATED_USER_RID (0x0000000BL)
148 #define SECURITY_RESTRICTED_CODE_RID (0x0000000CL)
149 #define SECURITY_TERMINAL_SERVER_RID (0x0000000DL)
150 #define SECURITY_REMOTE_LOGON_RID (0x0000000EL)
151 #define SECURITY_THIS_ORGANIZATION_RID (0x0000000FL)
152 #define SECURITY_IUSER_RID (0x00000011L)
153 #define SECURITY_LOCAL_SYSTEM_RID (0x00000012L)
154 #define SECURITY_LOCAL_SERVICE_RID (0x00000013L)
155 #define SECURITY_NETWORK_SERVICE_RID (0x00000014L)
156 #define SECURITY_NT_NON_UNIQUE (0x00000015L)
157 #define SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT (3L)
158 #define SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID (0x00000016L)
159
160 #define SECURITY_BUILTIN_DOMAIN_RID (0x00000020L)
161 #define SECURITY_WRITE_RESTRICTED_CODE_RID (0x00000021L)
162
163
164 #define SECURITY_PACKAGE_BASE_RID (0x00000040L)
165 #define SECURITY_PACKAGE_RID_COUNT (2L)
166 #define SECURITY_PACKAGE_NTLM_RID (0x0000000AL)
167 #define SECURITY_PACKAGE_SCHANNEL_RID (0x0000000EL)
168 #define SECURITY_PACKAGE_DIGEST_RID (0x00000015L)
169
170 #define SECURITY_CRED_TYPE_BASE_RID (0x00000041L)
171 #define SECURITY_CRED_TYPE_RID_COUNT (2L)
172 #define SECURITY_CRED_TYPE_THIS_ORG_CERT_RID (0x00000001L)
173
174 #define SECURITY_MIN_BASE_RID (0x00000050L)
175 #define SECURITY_SERVICE_ID_BASE_RID (0x00000050L)
176 #define SECURITY_SERVICE_ID_RID_COUNT (6L)
177 #define SECURITY_RESERVED_ID_BASE_RID (0x00000051L)
178 #define SECURITY_APPPOOL_ID_BASE_RID (0x00000052L)
179 #define SECURITY_APPPOOL_ID_RID_COUNT (6L)
180 #define SECURITY_VIRTUALSERVER_ID_BASE_RID (0x00000053L)
181 #define SECURITY_VIRTUALSERVER_ID_RID_COUNT (6L)
182 #define SECURITY_USERMODEDRIVERHOST_ID_BASE_RID (0x00000054L)
183 #define SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT (6L)
184 #define SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID (0x00000055L)
185 #define SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT (6L)
186 #define SECURITY_WMIHOST_ID_BASE_RID (0x00000056L)
187 #define SECURITY_WMIHOST_ID_RID_COUNT (6L)
188 #define SECURITY_TASK_ID_BASE_RID (0x00000057L)
189 #define SECURITY_NFS_ID_BASE_RID (0x00000058L)
190 #define SECURITY_COM_ID_BASE_RID (0x00000059L)
191 #define SECURITY_VIRTUALACCOUNT_ID_RID_COUNT (6L)
192
193 #define SECURITY_MAX_BASE_RID (0x0000006FL)
194
195 #define SECURITY_MAX_ALWAYS_FILTERED (0x000003E7L)
196 #define SECURITY_MIN_NEVER_FILTERED (0x000003E8L)
197
198 #define SECURITY_OTHER_ORGANIZATION_RID (0x000003E8L)
199
200 #define SECURITY_WINDOWSMOBILE_ID_BASE_RID (0x00000070L)
201
202 /* Well-known domain relative sub-authority values (RIDs) */
203
204 #define DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS (0x000001F2L)
205
206 #define FOREST_USER_RID_MAX (0x000001F3L)
207
208 /* Well-known users */
209
210 #define DOMAIN_USER_RID_ADMIN (0x000001F4L)
211 #define DOMAIN_USER_RID_GUEST (0x000001F5L)
212 #define DOMAIN_USER_RID_KRBTGT (0x000001F6L)
213
214 #define DOMAIN_USER_RID_MAX (0x000003E7L)
215
216 /* Well-known groups */
217
218 #define DOMAIN_GROUP_RID_ADMINS (0x00000200L)
219 #define DOMAIN_GROUP_RID_USERS (0x00000201L)
220 #define DOMAIN_GROUP_RID_GUESTS (0x00000202L)
221 #define DOMAIN_GROUP_RID_COMPUTERS (0x00000203L)
222 #define DOMAIN_GROUP_RID_CONTROLLERS (0x00000204L)
223 #define DOMAIN_GROUP_RID_CERT_ADMINS (0x00000205L)
224 #define DOMAIN_GROUP_RID_SCHEMA_ADMINS (0x00000206L)
225 #define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS (0x00000207L)
226 #define DOMAIN_GROUP_RID_POLICY_ADMINS (0x00000208L)
227 #define DOMAIN_GROUP_RID_READONLY_CONTROLLERS (0x00000209L)
228
229 /* Well-known aliases */
230
231 #define DOMAIN_ALIAS_RID_ADMINS (0x00000220L)
232 #define DOMAIN_ALIAS_RID_USERS (0x00000221L)
233 #define DOMAIN_ALIAS_RID_GUESTS (0x00000222L)
234 #define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L)
235
236 #define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L)
237 #define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L)
238 #define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L)
239 #define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L)
240
241 #define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L)
242 #define DOMAIN_ALIAS_RID_RAS_SERVERS (0x00000229L)
243 #define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS (0x0000022AL)
244 #define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS (0x0000022BL)
245 #define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS (0x0000022CL)
246 #define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS (0x0000022DL)
247
248 #define DOMAIN_ALIAS_RID_MONITORING_USERS (0x0000022EL)
249 #define DOMAIN_ALIAS_RID_LOGGING_USERS (0x0000022FL)
250 #define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS (0x00000230L)
251 #define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS (0x00000231L)
252 #define DOMAIN_ALIAS_RID_DCOM_USERS (0x00000232L)
253 #define DOMAIN_ALIAS_RID_IUSERS (0x00000238L)
254 #define DOMAIN_ALIAS_RID_CRYPTO_OPERATORS (0x00000239L)
255 #define DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP (0x0000023BL)
256 #define DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP (0x0000023CL)
257 #define DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP (0x0000023DL)
258 #define DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP (0x0000023EL)
259
260 #define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
261 #define SECURITY_MANDATORY_UNTRUSTED_RID (0x00000000L)
262 #define SECURITY_MANDATORY_LOW_RID (0x00001000L)
263 #define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L)
264 #define SECURITY_MANDATORY_HIGH_RID (0x00003000L)
265 #define SECURITY_MANDATORY_SYSTEM_RID (0x00004000L)
266 #define SECURITY_MANDATORY_PROTECTED_PROCESS_RID (0x00005000L)
267
268 /* SECURITY_MANDATORY_MAXIMUM_USER_RID is the highest RID that
269 can be set by a usermode caller.*/
270
271 #define SECURITY_MANDATORY_MAXIMUM_USER_RID SECURITY_MANDATORY_SYSTEM_RID
272
273 #define MANDATORY_LEVEL_TO_MANDATORY_RID(IL) (IL * 0x1000)
274
275 /* Allocate the System Luid. The first 1000 LUIDs are reserved.
276 Use #999 here (0x3e7 = 999) */
277
278 #define SYSTEM_LUID { 0x3e7, 0x0 }
279 #define ANONYMOUS_LOGON_LUID { 0x3e6, 0x0 }
280 #define LOCALSERVICE_LUID { 0x3e5, 0x0 }
281 #define NETWORKSERVICE_LUID { 0x3e4, 0x0 }
282 #define IUSER_LUID { 0x3e3, 0x0 }
283
284 typedef struct _ACE_HEADER {
285 UCHAR AceType;
286 UCHAR AceFlags;
287 USHORT AceSize;
288 } ACE_HEADER, *PACE_HEADER;
289
290 /* also in winnt.h */
291 #define ACCESS_MIN_MS_ACE_TYPE (0x0)
292 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
293 #define ACCESS_DENIED_ACE_TYPE (0x1)
294 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
295 #define SYSTEM_ALARM_ACE_TYPE (0x3)
296 #define ACCESS_MAX_MS_V2_ACE_TYPE (0x3)
297 #define ACCESS_ALLOWED_COMPOUND_ACE_TYPE (0x4)
298 #define ACCESS_MAX_MS_V3_ACE_TYPE (0x4)
299 #define ACCESS_MIN_MS_OBJECT_ACE_TYPE (0x5)
300 #define ACCESS_ALLOWED_OBJECT_ACE_TYPE (0x5)
301 #define ACCESS_DENIED_OBJECT_ACE_TYPE (0x6)
302 #define SYSTEM_AUDIT_OBJECT_ACE_TYPE (0x7)
303 #define SYSTEM_ALARM_OBJECT_ACE_TYPE (0x8)
304 #define ACCESS_MAX_MS_OBJECT_ACE_TYPE (0x8)
305 #define ACCESS_MAX_MS_V4_ACE_TYPE (0x8)
306 #define ACCESS_MAX_MS_ACE_TYPE (0x8)
307 #define ACCESS_ALLOWED_CALLBACK_ACE_TYPE (0x9)
308 #define ACCESS_DENIED_CALLBACK_ACE_TYPE (0xA)
309 #define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB)
310 #define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE (0xC)
311 #define SYSTEM_AUDIT_CALLBACK_ACE_TYPE (0xD)
312 #define SYSTEM_ALARM_CALLBACK_ACE_TYPE (0xE)
313 #define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE (0xF)
314 #define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE (0x10)
315 #define ACCESS_MAX_MS_V5_ACE_TYPE (0x11)
316 #define SYSTEM_MANDATORY_LABEL_ACE_TYPE (0x11)
317
318 /* The following are the inherit flags that go into the AceFlags field
319 of an Ace header. */
320
321 #define OBJECT_INHERIT_ACE (0x1)
322 #define CONTAINER_INHERIT_ACE (0x2)
323 #define NO_PROPAGATE_INHERIT_ACE (0x4)
324 #define INHERIT_ONLY_ACE (0x8)
325 #define INHERITED_ACE (0x10)
326 #define VALID_INHERIT_FLAGS (0x1F)
327
328 #define SUCCESSFUL_ACCESS_ACE_FLAG (0x40)
329 #define FAILED_ACCESS_ACE_FLAG (0x80)
330
331 typedef struct _ACCESS_ALLOWED_ACE {
332 ACE_HEADER Header;
333 ACCESS_MASK Mask;
334 ULONG SidStart;
335 } ACCESS_ALLOWED_ACE, *PACCESS_ALLOWED_ACE;
336
337 typedef struct _ACCESS_DENIED_ACE {
338 ACE_HEADER Header;
339 ACCESS_MASK Mask;
340 ULONG SidStart;
341 } ACCESS_DENIED_ACE, *PACCESS_DENIED_ACE;
342
343 typedef struct _SYSTEM_AUDIT_ACE {
344 ACE_HEADER Header;
345 ACCESS_MASK Mask;
346 ULONG SidStart;
347 } SYSTEM_AUDIT_ACE, *PSYSTEM_AUDIT_ACE;
348
349 typedef struct _SYSTEM_ALARM_ACE {
350 ACE_HEADER Header;
351 ACCESS_MASK Mask;
352 ULONG SidStart;
353 } SYSTEM_ALARM_ACE, *PSYSTEM_ALARM_ACE;
354
355 typedef struct _SYSTEM_MANDATORY_LABEL_ACE {
356 ACE_HEADER Header;
357 ACCESS_MASK Mask;
358 ULONG SidStart;
359 } SYSTEM_MANDATORY_LABEL_ACE, *PSYSTEM_MANDATORY_LABEL_ACE;
360
361 #define SYSTEM_MANDATORY_LABEL_NO_WRITE_UP 0x1
362 #define SYSTEM_MANDATORY_LABEL_NO_READ_UP 0x2
363 #define SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP 0x4
364 #define SYSTEM_MANDATORY_LABEL_VALID_MASK (SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | \
365 SYSTEM_MANDATORY_LABEL_NO_READ_UP | \
366 SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP)
367
368 #define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
369
370 typedef USHORT SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL;
371
372 #define SE_OWNER_DEFAULTED 0x0001
373 #define SE_GROUP_DEFAULTED 0x0002
374 #define SE_DACL_PRESENT 0x0004
375 #define SE_DACL_DEFAULTED 0x0008
376 #define SE_SACL_PRESENT 0x0010
377 #define SE_SACL_DEFAULTED 0x0020
378 #define SE_DACL_UNTRUSTED 0x0040
379 #define SE_SERVER_SECURITY 0x0080
380 #define SE_DACL_AUTO_INHERIT_REQ 0x0100
381 #define SE_SACL_AUTO_INHERIT_REQ 0x0200
382 #define SE_DACL_AUTO_INHERITED 0x0400
383 #define SE_SACL_AUTO_INHERITED 0x0800
384 #define SE_DACL_PROTECTED 0x1000
385 #define SE_SACL_PROTECTED 0x2000
386 #define SE_RM_CONTROL_VALID 0x4000
387 #define SE_SELF_RELATIVE 0x8000
388
389 typedef struct _SECURITY_DESCRIPTOR_RELATIVE {
390 UCHAR Revision;
391 UCHAR Sbz1;
392 SECURITY_DESCRIPTOR_CONTROL Control;
393 ULONG Owner;
394 ULONG Group;
395 ULONG Sacl;
396 ULONG Dacl;
397 } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
398
399 typedef struct _SECURITY_DESCRIPTOR {
400 UCHAR Revision;
401 UCHAR Sbz1;
402 SECURITY_DESCRIPTOR_CONTROL Control;
403 PSID Owner;
404 PSID Group;
405 PACL Sacl;
406 PACL Dacl;
407 } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
408
409 typedef struct _OBJECT_TYPE_LIST {
410 USHORT Level;
411 USHORT Sbz;
412 GUID *ObjectType;
413 } OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST;
414
415 #define ACCESS_OBJECT_GUID 0
416 #define ACCESS_PROPERTY_SET_GUID 1
417 #define ACCESS_PROPERTY_GUID 2
418 #define ACCESS_MAX_LEVEL 4
419
420 typedef enum _AUDIT_EVENT_TYPE {
421 AuditEventObjectAccess,
422 AuditEventDirectoryServiceAccess
423 } AUDIT_EVENT_TYPE, *PAUDIT_EVENT_TYPE;
424
425 #define AUDIT_ALLOW_NO_PRIVILEGE 0x1
426
427 #define ACCESS_DS_SOURCE_A "DS"
428 #define ACCESS_DS_SOURCE_W L"DS"
429 #define ACCESS_DS_OBJECT_TYPE_NAME_A "Directory Service Object"
430 #define ACCESS_DS_OBJECT_TYPE_NAME_W L"Directory Service Object"
431
432 #define ACCESS_REASON_TYPE_MASK 0xffff0000
433 #define ACCESS_REASON_DATA_MASK 0x0000ffff
434
435 typedef enum _ACCESS_REASON_TYPE {
436 AccessReasonNone = 0x00000000,
437 AccessReasonAllowedAce = 0x00010000,
438 AccessReasonDeniedAce = 0x00020000,
439 AccessReasonAllowedParentAce = 0x00030000,
440 AccessReasonDeniedParentAce = 0x00040000,
441 AccessReasonMissingPrivilege = 0x00100000,
442 AccessReasonFromPrivilege = 0x00200000,
443 AccessReasonIntegrityLevel = 0x00300000,
444 AccessReasonOwnership = 0x00400000,
445 AccessReasonNullDacl = 0x00500000,
446 AccessReasonEmptyDacl = 0x00600000,
447 AccessReasonNoSD = 0x00700000,
448 AccessReasonNoGrant = 0x00800000
449 } ACCESS_REASON_TYPE;
450
451 typedef ULONG ACCESS_REASON;
452
453 typedef struct _ACCESS_REASONS {
454 ACCESS_REASON Data[32];
455 } ACCESS_REASONS, *PACCESS_REASONS;
456
457 #define SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE 0x00000001
458 #define SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE 0x00000002
459 #define SE_SECURITY_DESCRIPTOR_VALID_FLAGS 0x00000003
460
461 typedef struct _SE_SECURITY_DESCRIPTOR {
462 ULONG Size;
463 ULONG Flags;
464 PSECURITY_DESCRIPTOR SecurityDescriptor;
465 } SE_SECURITY_DESCRIPTOR, *PSE_SECURITY_DESCRIPTOR;
466
467 typedef struct _SE_ACCESS_REQUEST {
468 ULONG Size;
469 PSE_SECURITY_DESCRIPTOR SeSecurityDescriptor;
470 ACCESS_MASK DesiredAccess;
471 ACCESS_MASK PreviouslyGrantedAccess;
472 PSID PrincipalSelfSid;
473 PGENERIC_MAPPING GenericMapping;
474 ULONG ObjectTypeListCount;
475 POBJECT_TYPE_LIST ObjectTypeList;
476 } SE_ACCESS_REQUEST, *PSE_ACCESS_REQUEST;
477
478 typedef struct _SE_ACCESS_REPLY {
479 ULONG Size;
480 ULONG ResultListCount;
481 PACCESS_MASK GrantedAccess;
482 PNTSTATUS AccessStatus;
483 PACCESS_REASONS AccessReason;
484 PPRIVILEGE_SET* Privileges;
485 } SE_ACCESS_REPLY, *PSE_ACCESS_REPLY;
486
487 typedef enum _SE_AUDIT_OPERATION {
488 AuditPrivilegeObject,
489 AuditPrivilegeService,
490 AuditAccessCheck,
491 AuditOpenObject,
492 AuditOpenObjectWithTransaction,
493 AuditCloseObject,
494 AuditDeleteObject,
495 AuditOpenObjectForDelete,
496 AuditOpenObjectForDeleteWithTransaction,
497 AuditCloseNonObject,
498 AuditOpenNonObject,
499 AuditObjectReference,
500 AuditHandleCreation,
501 } SE_AUDIT_OPERATION, *PSE_AUDIT_OPERATION;
502
503 typedef struct _SE_AUDIT_INFO {
504 ULONG Size;
505 AUDIT_EVENT_TYPE AuditType;
506 SE_AUDIT_OPERATION AuditOperation;
507 ULONG AuditFlags;
508 UNICODE_STRING SubsystemName;
509 UNICODE_STRING ObjectTypeName;
510 UNICODE_STRING ObjectName;
511 PVOID HandleId;
512 GUID* TransactionId;
513 LUID* OperationId;
514 BOOLEAN ObjectCreation;
515 BOOLEAN GenerateOnClose;
516 } SE_AUDIT_INFO, *PSE_AUDIT_INFO;
517
518 #define TOKEN_ASSIGN_PRIMARY (0x0001)
519 #define TOKEN_DUPLICATE (0x0002)
520 #define TOKEN_IMPERSONATE (0x0004)
521 #define TOKEN_QUERY (0x0008)
522 #define TOKEN_QUERY_SOURCE (0x0010)
523 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
524 #define TOKEN_ADJUST_GROUPS (0x0040)
525 #define TOKEN_ADJUST_DEFAULT (0x0080)
526 #define TOKEN_ADJUST_SESSIONID (0x0100)
527
528 #define TOKEN_ALL_ACCESS_P (STANDARD_RIGHTS_REQUIRED |\
529 TOKEN_ASSIGN_PRIMARY |\
530 TOKEN_DUPLICATE |\
531 TOKEN_IMPERSONATE |\
532 TOKEN_QUERY |\
533 TOKEN_QUERY_SOURCE |\
534 TOKEN_ADJUST_PRIVILEGES |\
535 TOKEN_ADJUST_GROUPS |\
536 TOKEN_ADJUST_DEFAULT )
537
538 #if ((defined(_WIN32_WINNT) && (_WIN32_WINNT > 0x0400)) || (!defined(_WIN32_WINNT)))
539 #define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P |\
540 TOKEN_ADJUST_SESSIONID )
541 #else
542 #define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P)
543 #endif
544
545 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
546 TOKEN_QUERY)
547
548 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
549 TOKEN_ADJUST_PRIVILEGES |\
550 TOKEN_ADJUST_GROUPS |\
551 TOKEN_ADJUST_DEFAULT)
552
553 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
554
555 typedef enum _TOKEN_TYPE {
556 TokenPrimary = 1,
557 TokenImpersonation
558 } TOKEN_TYPE,*PTOKEN_TYPE;
559
560 typedef enum _TOKEN_INFORMATION_CLASS {
561 TokenUser = 1,
562 TokenGroups,
563 TokenPrivileges,
564 TokenOwner,
565 TokenPrimaryGroup,
566 TokenDefaultDacl,
567 TokenSource,
568 TokenType,
569 TokenImpersonationLevel,
570 TokenStatistics,
571 TokenRestrictedSids,
572 TokenSessionId,
573 TokenGroupsAndPrivileges,
574 TokenSessionReference,
575 TokenSandBoxInert,
576 TokenAuditPolicy,
577 TokenOrigin,
578 TokenElevationType,
579 TokenLinkedToken,
580 TokenElevation,
581 TokenHasRestrictions,
582 TokenAccessInformation,
583 TokenVirtualizationAllowed,
584 TokenVirtualizationEnabled,
585 TokenIntegrityLevel,
586 TokenUIAccess,
587 TokenMandatoryPolicy,
588 TokenLogonSid,
589 MaxTokenInfoClass
590 } TOKEN_INFORMATION_CLASS, *PTOKEN_INFORMATION_CLASS;
591
592 typedef struct _TOKEN_USER {
593 SID_AND_ATTRIBUTES User;
594 } TOKEN_USER, *PTOKEN_USER;
595
596 typedef struct _TOKEN_GROUPS {
597 ULONG GroupCount;
598 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
599 } TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS;
600
601 typedef struct _TOKEN_PRIVILEGES {
602 ULONG PrivilegeCount;
603 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
604 } TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES;
605
606 typedef struct _TOKEN_OWNER {
607 PSID Owner;
608 } TOKEN_OWNER,*PTOKEN_OWNER;
609
610 typedef struct _TOKEN_PRIMARY_GROUP {
611 PSID PrimaryGroup;
612 } TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP;
613
614 typedef struct _TOKEN_DEFAULT_DACL {
615 PACL DefaultDacl;
616 } TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL;
617
618 typedef struct _TOKEN_GROUPS_AND_PRIVILEGES {
619 ULONG SidCount;
620 ULONG SidLength;
621 PSID_AND_ATTRIBUTES Sids;
622 ULONG RestrictedSidCount;
623 ULONG RestrictedSidLength;
624 PSID_AND_ATTRIBUTES RestrictedSids;
625 ULONG PrivilegeCount;
626 ULONG PrivilegeLength;
627 PLUID_AND_ATTRIBUTES Privileges;
628 LUID AuthenticationId;
629 } TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES;
630
631 typedef struct _TOKEN_LINKED_TOKEN {
632 HANDLE LinkedToken;
633 } TOKEN_LINKED_TOKEN, *PTOKEN_LINKED_TOKEN;
634
635 typedef struct _TOKEN_ELEVATION {
636 ULONG TokenIsElevated;
637 } TOKEN_ELEVATION, *PTOKEN_ELEVATION;
638
639 typedef struct _TOKEN_MANDATORY_LABEL {
640 SID_AND_ATTRIBUTES Label;
641 } TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL;
642
643 #define TOKEN_MANDATORY_POLICY_OFF 0x0
644 #define TOKEN_MANDATORY_POLICY_NO_WRITE_UP 0x1
645 #define TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN 0x2
646
647 #define TOKEN_MANDATORY_POLICY_VALID_MASK (TOKEN_MANDATORY_POLICY_NO_WRITE_UP | \
648 TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN)
649
650 typedef struct _TOKEN_MANDATORY_POLICY {
651 ULONG Policy;
652 } TOKEN_MANDATORY_POLICY, *PTOKEN_MANDATORY_POLICY;
653
654 typedef struct _TOKEN_ACCESS_INFORMATION {
655 PSID_AND_ATTRIBUTES_HASH SidHash;
656 PSID_AND_ATTRIBUTES_HASH RestrictedSidHash;
657 PTOKEN_PRIVILEGES Privileges;
658 LUID AuthenticationId;
659 TOKEN_TYPE TokenType;
660 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
661 TOKEN_MANDATORY_POLICY MandatoryPolicy;
662 ULONG Flags;
663 } TOKEN_ACCESS_INFORMATION, *PTOKEN_ACCESS_INFORMATION;
664
665 #define POLICY_AUDIT_SUBCATEGORY_COUNT (53)
666
667 typedef struct _TOKEN_AUDIT_POLICY {
668 UCHAR PerUserPolicy[((POLICY_AUDIT_SUBCATEGORY_COUNT) >> 1) + 1];
669 } TOKEN_AUDIT_POLICY, *PTOKEN_AUDIT_POLICY;
670
671 #define TOKEN_SOURCE_LENGTH 8
672
673 typedef struct _TOKEN_SOURCE {
674 CHAR SourceName[TOKEN_SOURCE_LENGTH];
675 LUID SourceIdentifier;
676 } TOKEN_SOURCE,*PTOKEN_SOURCE;
677
678 typedef struct _TOKEN_STATISTICS {
679 LUID TokenId;
680 LUID AuthenticationId;
681 LARGE_INTEGER ExpirationTime;
682 TOKEN_TYPE TokenType;
683 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
684 ULONG DynamicCharged;
685 ULONG DynamicAvailable;
686 ULONG GroupCount;
687 ULONG PrivilegeCount;
688 LUID ModifiedId;
689 } TOKEN_STATISTICS, *PTOKEN_STATISTICS;
690
691 typedef struct _TOKEN_CONTROL {
692 LUID TokenId;
693 LUID AuthenticationId;
694 LUID ModifiedId;
695 TOKEN_SOURCE TokenSource;
696 } TOKEN_CONTROL,*PTOKEN_CONTROL;
697
698 typedef struct _TOKEN_ORIGIN {
699 LUID OriginatingLogonSession;
700 } TOKEN_ORIGIN, *PTOKEN_ORIGIN;
701
702 typedef enum _MANDATORY_LEVEL {
703 MandatoryLevelUntrusted = 0,
704 MandatoryLevelLow,
705 MandatoryLevelMedium,
706 MandatoryLevelHigh,
707 MandatoryLevelSystem,
708 MandatoryLevelSecureProcess,
709 MandatoryLevelCount
710 } MANDATORY_LEVEL, *PMANDATORY_LEVEL;
711
712 typedef enum _OBJECT_INFORMATION_CLASS {
713 ObjectBasicInformation = 0,
714 ObjectNameInformation = 1, /* FIXME, not in WDK */
715 ObjectTypeInformation = 2,
716 ObjectTypesInformation = 3, /* FIXME, not in WDK */
717 ObjectHandleFlagInformation = 4, /* FIXME, not in WDK */
718 ObjectSessionInformation = 5, /* FIXME, not in WDK */
719 MaxObjectInfoClass /* FIXME, not in WDK */
720 } OBJECT_INFORMATION_CLASS;
721
722 NTSYSCALLAPI
723 NTSTATUS
724 NTAPI
725 NtQueryObject(
726 IN HANDLE Handle OPTIONAL,
727 IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
728 OUT PVOID ObjectInformation OPTIONAL,
729 IN ULONG ObjectInformationLength,
730 OUT PULONG ReturnLength OPTIONAL);
731
732 #if (NTDDI_VERSION >= NTDDI_WIN2K)
733
734 NTSYSCALLAPI
735 NTSTATUS
736 NTAPI
737 NtOpenThreadToken(
738 IN HANDLE ThreadHandle,
739 IN ACCESS_MASK DesiredAccess,
740 IN BOOLEAN OpenAsSelf,
741 OUT PHANDLE TokenHandle);
742
743 NTSYSCALLAPI
744 NTSTATUS
745 NTAPI
746 NtOpenProcessToken(
747 IN HANDLE ProcessHandle,
748 IN ACCESS_MASK DesiredAccess,
749 OUT PHANDLE TokenHandle);
750
751 NTSYSCALLAPI
752 NTSTATUS
753 NTAPI
754 NtQueryInformationToken(
755 IN HANDLE TokenHandle,
756 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
757 OUT PVOID TokenInformation OPTIONAL,
758 IN ULONG TokenInformationLength,
759 OUT PULONG ReturnLength);
760
761 NTSYSCALLAPI
762 NTSTATUS
763 NTAPI
764 NtAdjustPrivilegesToken(
765 IN HANDLE TokenHandle,
766 IN BOOLEAN DisableAllPrivileges,
767 IN PTOKEN_PRIVILEGES NewState OPTIONAL,
768 IN ULONG BufferLength,
769 OUT PTOKEN_PRIVILEGES PreviousState,
770 OUT PULONG ReturnLength OPTIONAL);
771
772 NTSYSCALLAPI
773 NTSTATUS
774 NTAPI
775 NtCreateFile(
776 OUT PHANDLE FileHandle,
777 IN ACCESS_MASK DesiredAccess,
778 IN POBJECT_ATTRIBUTES ObjectAttributes,
779 OUT PIO_STATUS_BLOCK IoStatusBlock,
780 IN PLARGE_INTEGER AllocationSize OPTIONAL,
781 IN ULONG FileAttributes,
782 IN ULONG ShareAccess,
783 IN ULONG CreateDisposition,
784 IN ULONG CreateOptions,
785 IN PVOID EaBuffer,
786 IN ULONG EaLength);
787
788 NTSYSCALLAPI
789 NTSTATUS
790 NTAPI
791 NtDeviceIoControlFile(
792 IN HANDLE FileHandle,
793 IN HANDLE Event OPTIONAL,
794 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
795 IN PVOID ApcContext OPTIONAL,
796 OUT PIO_STATUS_BLOCK IoStatusBlock,
797 IN ULONG IoControlCode,
798 IN PVOID InputBuffer OPTIONAL,
799 IN ULONG InputBufferLength,
800 OUT PVOID OutputBuffer OPTIONAL,
801 IN ULONG OutputBufferLength);
802
803 NTSYSCALLAPI
804 NTSTATUS
805 NTAPI
806 NtFsControlFile(
807 IN HANDLE FileHandle,
808 IN HANDLE Event OPTIONAL,
809 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
810 IN PVOID ApcContext OPTIONAL,
811 OUT PIO_STATUS_BLOCK IoStatusBlock,
812 IN ULONG FsControlCode,
813 IN PVOID InputBuffer OPTIONAL,
814 IN ULONG InputBufferLength,
815 OUT PVOID OutputBuffer OPTIONAL,
816 IN ULONG OutputBufferLength);
817
818 NTSYSCALLAPI
819 NTSTATUS
820 NTAPI
821 NtLockFile(
822 IN HANDLE FileHandle,
823 IN HANDLE Event OPTIONAL,
824 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
825 IN PVOID ApcContext OPTIONAL,
826 OUT PIO_STATUS_BLOCK IoStatusBlock,
827 IN PLARGE_INTEGER ByteOffset,
828 IN PLARGE_INTEGER Length,
829 IN ULONG Key,
830 IN BOOLEAN FailImmediately,
831 IN BOOLEAN ExclusiveLock);
832
833 NTSYSCALLAPI
834 NTSTATUS
835 NTAPI
836 NtOpenFile(
837 OUT PHANDLE FileHandle,
838 IN ACCESS_MASK DesiredAccess,
839 IN POBJECT_ATTRIBUTES ObjectAttributes,
840 OUT PIO_STATUS_BLOCK IoStatusBlock,
841 IN ULONG ShareAccess,
842 IN ULONG OpenOptions);
843
844 NTSYSCALLAPI
845 NTSTATUS
846 NTAPI
847 NtQueryDirectoryFile(
848 IN HANDLE FileHandle,
849 IN HANDLE Event OPTIONAL,
850 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
851 IN PVOID ApcContext OPTIONAL,
852 OUT PIO_STATUS_BLOCK IoStatusBlock,
853 OUT PVOID FileInformation,
854 IN ULONG Length,
855 IN FILE_INFORMATION_CLASS FileInformationClass,
856 IN BOOLEAN ReturnSingleEntry,
857 IN PUNICODE_STRING FileName OPTIONAL,
858 IN BOOLEAN RestartScan);
859
860 NTSYSCALLAPI
861 NTSTATUS
862 NTAPI
863 NtQueryInformationFile(
864 IN HANDLE FileHandle,
865 OUT PIO_STATUS_BLOCK IoStatusBlock,
866 OUT PVOID FileInformation,
867 IN ULONG Length,
868 IN FILE_INFORMATION_CLASS FileInformationClass);
869
870 NTSYSCALLAPI
871 NTSTATUS
872 NTAPI
873 NtQueryQuotaInformationFile(
874 IN HANDLE FileHandle,
875 OUT PIO_STATUS_BLOCK IoStatusBlock,
876 OUT PVOID Buffer,
877 IN ULONG Length,
878 IN BOOLEAN ReturnSingleEntry,
879 IN PVOID SidList,
880 IN ULONG SidListLength,
881 IN PSID StartSid OPTIONAL,
882 IN BOOLEAN RestartScan);
883
884 NTSYSCALLAPI
885 NTSTATUS
886 NTAPI
887 NtQueryVolumeInformationFile(
888 IN HANDLE FileHandle,
889 OUT PIO_STATUS_BLOCK IoStatusBlock,
890 OUT PVOID FsInformation,
891 IN ULONG Length,
892 IN FS_INFORMATION_CLASS FsInformationClass);
893
894 NTSYSCALLAPI
895 NTSTATUS
896 NTAPI
897 NtReadFile(
898 IN HANDLE FileHandle,
899 IN HANDLE Event OPTIONAL,
900 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
901 IN PVOID ApcContext OPTIONAL,
902 OUT PIO_STATUS_BLOCK IoStatusBlock,
903 OUT PVOID Buffer,
904 IN ULONG Length,
905 IN PLARGE_INTEGER ByteOffset OPTIONAL,
906 IN PULONG Key OPTIONAL);
907
908 NTSYSCALLAPI
909 NTSTATUS
910 NTAPI
911 NtSetInformationFile(
912 IN HANDLE FileHandle,
913 OUT PIO_STATUS_BLOCK IoStatusBlock,
914 IN PVOID FileInformation,
915 IN ULONG Length,
916 IN FILE_INFORMATION_CLASS FileInformationClass);
917
918 NTSYSCALLAPI
919 NTSTATUS
920 NTAPI
921 NtSetQuotaInformationFile(
922 IN HANDLE FileHandle,
923 OUT PIO_STATUS_BLOCK IoStatusBlock,
924 IN PVOID Buffer,
925 IN ULONG Length);
926
927 NTSYSCALLAPI
928 NTSTATUS
929 NTAPI
930 NtSetVolumeInformationFile(
931 IN HANDLE FileHandle,
932 OUT PIO_STATUS_BLOCK IoStatusBlock,
933 IN PVOID FsInformation,
934 IN ULONG Length,
935 IN FS_INFORMATION_CLASS FsInformationClass);
936
937 NTSYSCALLAPI
938 NTSTATUS
939 NTAPI
940 NtWriteFile(
941 IN HANDLE FileHandle,
942 IN HANDLE Event OPTIONAL,
943 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
944 IN PVOID ApcContext OPTIONAL,
945 OUT PIO_STATUS_BLOCK IoStatusBlock,
946 IN PVOID Buffer,
947 IN ULONG Length,
948 IN PLARGE_INTEGER ByteOffset OPTIONAL,
949 IN PULONG Key OPTIONAL);
950
951 NTSYSCALLAPI
952 NTSTATUS
953 NTAPI
954 NtUnlockFile(
955 IN HANDLE FileHandle,
956 OUT PIO_STATUS_BLOCK IoStatusBlock,
957 IN PLARGE_INTEGER ByteOffset,
958 IN PLARGE_INTEGER Length,
959 IN ULONG Key);
960
961 NTSYSCALLAPI
962 NTSTATUS
963 NTAPI
964 NtSetSecurityObject(
965 IN HANDLE Handle,
966 IN SECURITY_INFORMATION SecurityInformation,
967 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
968
969 NTSYSCALLAPI
970 NTSTATUS
971 NTAPI
972 NtQuerySecurityObject(
973 IN HANDLE Handle,
974 IN SECURITY_INFORMATION SecurityInformation,
975 OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
976 IN ULONG Length,
977 OUT PULONG LengthNeeded);
978
979 NTSYSCALLAPI
980 NTSTATUS
981 NTAPI
982 NtClose(
983 IN HANDLE Handle);
984
985 NTSYSCALLAPI
986 NTSTATUS
987 NTAPI
988 NtAllocateVirtualMemory(
989 IN HANDLE ProcessHandle,
990 IN OUT PVOID *BaseAddress,
991 IN ULONG_PTR ZeroBits,
992 IN OUT PSIZE_T RegionSize,
993 IN ULONG AllocationType,
994 IN ULONG Protect);
995
996 NTSYSCALLAPI
997 NTSTATUS
998 NTAPI
999 NtFreeVirtualMemory(
1000 IN HANDLE ProcessHandle,
1001 IN OUT PVOID *BaseAddress,
1002 IN OUT PSIZE_T RegionSize,
1003 IN ULONG FreeType);
1004
1005 #endif
1006
1007 #if (NTDDI_VERSION >= NTDDI_WINXP)
1008
1009 NTSYSCALLAPI
1010 NTSTATUS
1011 NTAPI
1012 NtOpenThreadTokenEx(
1013 IN HANDLE ThreadHandle,
1014 IN ACCESS_MASK DesiredAccess,
1015 IN BOOLEAN OpenAsSelf,
1016 IN ULONG HandleAttributes,
1017 OUT PHANDLE TokenHandle);
1018
1019 NTSYSCALLAPI
1020 NTSTATUS
1021 NTAPI
1022 NtOpenProcessTokenEx(
1023 IN HANDLE ProcessHandle,
1024 IN ACCESS_MASK DesiredAccess,
1025 IN ULONG HandleAttributes,
1026 OUT PHANDLE TokenHandle);
1027
1028 NTSYSAPI
1029 NTSTATUS
1030 NTAPI
1031 NtOpenJobObjectToken(
1032 IN HANDLE JobHandle,
1033 IN ACCESS_MASK DesiredAccess,
1034 OUT PHANDLE TokenHandle);
1035
1036 NTSYSCALLAPI
1037 NTSTATUS
1038 NTAPI
1039 NtDuplicateToken(
1040 IN HANDLE ExistingTokenHandle,
1041 IN ACCESS_MASK DesiredAccess,
1042 IN POBJECT_ATTRIBUTES ObjectAttributes,
1043 IN BOOLEAN EffectiveOnly,
1044 IN TOKEN_TYPE TokenType,
1045 OUT PHANDLE NewTokenHandle);
1046
1047 NTSYSCALLAPI
1048 NTSTATUS
1049 NTAPI
1050 NtFilterToken(
1051 IN HANDLE ExistingTokenHandle,
1052 IN ULONG Flags,
1053 IN PTOKEN_GROUPS SidsToDisable OPTIONAL,
1054 IN PTOKEN_PRIVILEGES PrivilegesToDelete OPTIONAL,
1055 IN PTOKEN_GROUPS RestrictedSids OPTIONAL,
1056 OUT PHANDLE NewTokenHandle);
1057
1058 NTSYSCALLAPI
1059 NTSTATUS
1060 NTAPI
1061 NtImpersonateAnonymousToken(
1062 IN HANDLE ThreadHandle);
1063
1064 NTSYSCALLAPI
1065 NTSTATUS
1066 NTAPI
1067 NtSetInformationToken(
1068 IN HANDLE TokenHandle,
1069 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
1070 IN PVOID TokenInformation,
1071 IN ULONG TokenInformationLength);
1072
1073 NTSYSCALLAPI
1074 NTSTATUS
1075 NTAPI
1076 NtAdjustGroupsToken(
1077 IN HANDLE TokenHandle,
1078 IN BOOLEAN ResetToDefault,
1079 IN PTOKEN_GROUPS NewState OPTIONAL,
1080 IN ULONG BufferLength OPTIONAL,
1081 OUT PTOKEN_GROUPS PreviousState,
1082 OUT PULONG ReturnLength);
1083
1084 NTSYSCALLAPI
1085 NTSTATUS
1086 NTAPI
1087 NtPrivilegeCheck(
1088 IN HANDLE ClientToken,
1089 IN OUT PPRIVILEGE_SET RequiredPrivileges,
1090 OUT PBOOLEAN Result);
1091
1092 NTSYSCALLAPI
1093 NTSTATUS
1094 NTAPI
1095 NtAccessCheckAndAuditAlarm(
1096 IN PUNICODE_STRING SubsystemName,
1097 IN PVOID HandleId OPTIONAL,
1098 IN PUNICODE_STRING ObjectTypeName,
1099 IN PUNICODE_STRING ObjectName,
1100 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1101 IN ACCESS_MASK DesiredAccess,
1102 IN PGENERIC_MAPPING GenericMapping,
1103 IN BOOLEAN ObjectCreation,
1104 OUT PACCESS_MASK GrantedAccess,
1105 OUT PNTSTATUS AccessStatus,
1106 OUT PBOOLEAN GenerateOnClose);
1107
1108 NTSYSCALLAPI
1109 NTSTATUS
1110 NTAPI
1111 NtAccessCheckByTypeAndAuditAlarm(
1112 IN PUNICODE_STRING SubsystemName,
1113 IN PVOID HandleId,
1114 IN PUNICODE_STRING ObjectTypeName,
1115 IN PUNICODE_STRING ObjectName,
1116 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1117 IN PSID PrincipalSelfSid OPTIONAL,
1118 IN ACCESS_MASK DesiredAccess,
1119 IN AUDIT_EVENT_TYPE AuditType,
1120 IN ULONG Flags,
1121 IN POBJECT_TYPE_LIST ObjectTypeList OPTIONAL,
1122 IN ULONG ObjectTypeLength,
1123 IN PGENERIC_MAPPING GenericMapping,
1124 IN BOOLEAN ObjectCreation,
1125 OUT PACCESS_MASK GrantedAccess,
1126 OUT PNTSTATUS AccessStatus,
1127 OUT PBOOLEAN GenerateOnClose);
1128
1129 NTSYSCALLAPI
1130 NTSTATUS
1131 NTAPI
1132 NtAccessCheckByTypeResultListAndAuditAlarm(
1133 IN PUNICODE_STRING SubsystemName,
1134 IN PVOID HandleId OPTIONAL,
1135 IN PUNICODE_STRING ObjectTypeName,
1136 IN PUNICODE_STRING ObjectName,
1137 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1138 IN PSID PrincipalSelfSid OPTIONAL,
1139 IN ACCESS_MASK DesiredAccess,
1140 IN AUDIT_EVENT_TYPE AuditType,
1141 IN ULONG Flags,
1142 IN POBJECT_TYPE_LIST ObjectTypeList OPTIONAL,
1143 IN ULONG ObjectTypeLength,
1144 IN PGENERIC_MAPPING GenericMapping,
1145 IN BOOLEAN ObjectCreation,
1146 OUT PACCESS_MASK GrantedAccess,
1147 OUT PNTSTATUS AccessStatus,
1148 OUT PBOOLEAN GenerateOnClose);
1149
1150 NTSTATUS
1151 NTAPI
1152 NtAccessCheckByTypeResultListAndAuditAlarmByHandle(
1153 IN PUNICODE_STRING SubsystemName,
1154 IN PVOID HandleId OPTIONAL,
1155 IN HANDLE ClientToken,
1156 IN PUNICODE_STRING ObjectTypeName,
1157 IN PUNICODE_STRING ObjectName,
1158 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1159 IN PSID PrincipalSelfSid OPTIONAL,
1160 IN ACCESS_MASK DesiredAccess,
1161 IN AUDIT_EVENT_TYPE AuditType,
1162 IN ULONG Flags,
1163 IN POBJECT_TYPE_LIST ObjectTypeList OPTIONAL,
1164 IN ULONG ObjectTypeLength,
1165 IN PGENERIC_MAPPING GenericMapping,
1166 IN BOOLEAN ObjectCreation,
1167 OUT PACCESS_MASK GrantedAccess,
1168 OUT PNTSTATUS AccessStatus,
1169 OUT PBOOLEAN GenerateOnClose);
1170
1171 NTSYSCALLAPI
1172 NTSTATUS
1173 NTAPI
1174 NtOpenObjectAuditAlarm(
1175 IN PUNICODE_STRING SubsystemName,
1176 IN PVOID HandleId OPTIONAL,
1177 IN PUNICODE_STRING ObjectTypeName,
1178 IN PUNICODE_STRING ObjectName,
1179 IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL,
1180 IN HANDLE ClientToken,
1181 IN ACCESS_MASK DesiredAccess,
1182 IN ACCESS_MASK GrantedAccess,
1183 IN PPRIVILEGE_SET Privileges OPTIONAL,
1184 IN BOOLEAN ObjectCreation,
1185 IN BOOLEAN AccessGranted,
1186 OUT PBOOLEAN GenerateOnClose);
1187
1188 NTSYSCALLAPI
1189 NTSTATUS
1190 NTAPI
1191 NtPrivilegeObjectAuditAlarm(
1192 IN PUNICODE_STRING SubsystemName,
1193 IN PVOID HandleId OPTIONAL,
1194 IN HANDLE ClientToken,
1195 IN ACCESS_MASK DesiredAccess,
1196 IN PPRIVILEGE_SET Privileges,
1197 IN BOOLEAN AccessGranted);
1198
1199 NTSYSCALLAPI
1200 NTSTATUS
1201 NTAPI
1202 NtCloseObjectAuditAlarm(
1203 IN PUNICODE_STRING SubsystemName,
1204 IN PVOID HandleId OPTIONAL,
1205 IN BOOLEAN GenerateOnClose);
1206
1207 NTSYSCALLAPI
1208 NTSTATUS
1209 NTAPI
1210 NtDeleteObjectAuditAlarm(
1211 IN PUNICODE_STRING SubsystemName,
1212 IN PVOID HandleId OPTIONAL,
1213 IN BOOLEAN GenerateOnClose);
1214
1215 NTSYSCALLAPI
1216 NTSTATUS
1217 NTAPI
1218 NtPrivilegedServiceAuditAlarm(
1219 IN PUNICODE_STRING SubsystemName,
1220 IN PUNICODE_STRING ServiceName,
1221 IN HANDLE ClientToken,
1222 IN PPRIVILEGE_SET Privileges,
1223 IN BOOLEAN AccessGranted);
1224
1225 NTSYSCALLAPI
1226 NTSTATUS
1227 NTAPI
1228 NtSetInformationThread(
1229 IN HANDLE ThreadHandle,
1230 IN THREADINFOCLASS ThreadInformationClass,
1231 IN PVOID ThreadInformation,
1232 IN ULONG ThreadInformationLength);
1233
1234 NTSYSCALLAPI
1235 NTSTATUS
1236 NTAPI
1237 NtCreateSection(
1238 OUT PHANDLE SectionHandle,
1239 IN ACCESS_MASK DesiredAccess,
1240 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1241 IN PLARGE_INTEGER MaximumSize OPTIONAL,
1242 IN ULONG SectionPageProtection,
1243 IN ULONG AllocationAttributes,
1244 IN HANDLE FileHandle OPTIONAL);
1245
1246 #endif
1247
1248 typedef NTSTATUS
1249 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE) (
1250 IN PVOID Base,
1251 IN OUT PVOID *CommitAddress,
1252 IN OUT PSIZE_T CommitSize);
1253
1254 typedef struct _RTL_HEAP_PARAMETERS {
1255 ULONG Length;
1256 SIZE_T SegmentReserve;
1257 SIZE_T SegmentCommit;
1258 SIZE_T DeCommitFreeBlockThreshold;
1259 SIZE_T DeCommitTotalFreeThreshold;
1260 SIZE_T MaximumAllocationSize;
1261 SIZE_T VirtualMemoryThreshold;
1262 SIZE_T InitialCommit;
1263 SIZE_T InitialReserve;
1264 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
1265 SIZE_T Reserved[2];
1266 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
1267
1268 #if (NTDDI_VERSION >= NTDDI_WIN2K)
1269
1270 NTSYSAPI
1271 PVOID
1272 NTAPI
1273 RtlAllocateHeap(
1274 IN HANDLE HeapHandle,
1275 IN ULONG Flags OPTIONAL,
1276 IN SIZE_T Size);
1277
1278 NTSYSAPI
1279 BOOLEAN
1280 NTAPI
1281 RtlFreeHeap(
1282 IN PVOID HeapHandle,
1283 IN ULONG Flags OPTIONAL,
1284 IN PVOID BaseAddress);
1285
1286 NTSYSAPI
1287 VOID
1288 NTAPI
1289 RtlCaptureContext(
1290 OUT PCONTEXT ContextRecord);
1291
1292 NTSYSAPI
1293 ULONG
1294 NTAPI
1295 RtlRandom(
1296 IN OUT PULONG Seed);
1297
1298 NTSYSAPI
1299 BOOLEAN
1300 NTAPI
1301 RtlCreateUnicodeString(
1302 OUT PUNICODE_STRING DestinationString,
1303 IN PCWSTR SourceString);
1304
1305 NTSYSAPI
1306 NTSTATUS
1307 NTAPI
1308 RtlAppendStringToString(
1309 IN OUT PSTRING Destination,
1310 IN const STRING *Source);
1311
1312 NTSYSAPI
1313 NTSTATUS
1314 NTAPI
1315 RtlOemStringToUnicodeString(
1316 IN OUT PUNICODE_STRING DestinationString,
1317 IN PCOEM_STRING SourceString,
1318 IN BOOLEAN AllocateDestinationString);
1319
1320 NTSYSAPI
1321 NTSTATUS
1322 NTAPI
1323 RtlUnicodeStringToOemString(
1324 IN OUT POEM_STRING DestinationString,
1325 IN PCUNICODE_STRING SourceString,
1326 IN BOOLEAN AllocateDestinationString);
1327
1328 NTSYSAPI
1329 NTSTATUS
1330 NTAPI
1331 RtlUpcaseUnicodeStringToOemString(
1332 IN OUT POEM_STRING DestinationString,
1333 IN PCUNICODE_STRING SourceString,
1334 IN BOOLEAN AllocateDestinationString);
1335
1336 NTSYSAPI
1337 NTSTATUS
1338 NTAPI
1339 RtlOemStringToCountedUnicodeString(
1340 IN OUT PUNICODE_STRING DestinationString,
1341 IN PCOEM_STRING SourceString,
1342 IN BOOLEAN AllocateDestinationString);
1343
1344 NTSYSAPI
1345 NTSTATUS
1346 NTAPI
1347 RtlUnicodeStringToCountedOemString(
1348 IN OUT POEM_STRING DestinationString,
1349 IN PCUNICODE_STRING SourceString,
1350 IN BOOLEAN AllocateDestinationString);
1351
1352 NTSYSAPI
1353 NTSTATUS
1354 NTAPI
1355 RtlUpcaseUnicodeStringToCountedOemString(
1356 IN OUT POEM_STRING DestinationString,
1357 IN PCUNICODE_STRING SourceString,
1358 IN BOOLEAN AllocateDestinationString);
1359
1360 NTSYSAPI
1361 NTSTATUS
1362 NTAPI
1363 RtlDowncaseUnicodeString(
1364 IN OUT PUNICODE_STRING UniDest,
1365 IN PCUNICODE_STRING UniSource,
1366 IN BOOLEAN AllocateDestinationString);
1367
1368 NTSYSAPI
1369 VOID
1370 NTAPI
1371 RtlFreeOemString (
1372 IN OUT POEM_STRING OemString);
1373
1374 NTSYSAPI
1375 ULONG
1376 NTAPI
1377 RtlxUnicodeStringToOemSize(
1378 IN PCUNICODE_STRING UnicodeString);
1379
1380 NTSYSAPI
1381 ULONG
1382 NTAPI
1383 RtlxOemStringToUnicodeSize(
1384 IN PCOEM_STRING OemString);
1385
1386 NTSYSAPI
1387 NTSTATUS
1388 NTAPI
1389 RtlMultiByteToUnicodeN(
1390 OUT PWCH UnicodeString,
1391 IN ULONG MaxBytesInUnicodeString,
1392 OUT PULONG BytesInUnicodeString OPTIONAL,
1393 IN const CHAR *MultiByteString,
1394 IN ULONG BytesInMultiByteString);
1395
1396 NTSYSAPI
1397 NTSTATUS
1398 NTAPI
1399 RtlMultiByteToUnicodeSize(
1400 OUT PULONG BytesInUnicodeString,
1401 IN const CHAR *MultiByteString,
1402 IN ULONG BytesInMultiByteString);
1403
1404 NTSYSAPI
1405 NTSTATUS
1406 NTAPI
1407 RtlUnicodeToMultiByteSize(
1408 OUT PULONG BytesInMultiByteString,
1409 IN PCWCH UnicodeString,
1410 IN ULONG BytesInUnicodeString);
1411
1412 NTSYSAPI
1413 NTSTATUS
1414 NTAPI
1415 RtlUnicodeToMultiByteN(
1416 OUT PCHAR MultiByteString,
1417 IN ULONG MaxBytesInMultiByteString,
1418 OUT PULONG BytesInMultiByteString OPTIONAL,
1419 IN PWCH UnicodeString,
1420 IN ULONG BytesInUnicodeString);
1421
1422 NTSYSAPI
1423 NTSTATUS
1424 NTAPI
1425 RtlUpcaseUnicodeToMultiByteN(
1426 OUT PCHAR MultiByteString,
1427 IN ULONG MaxBytesInMultiByteString,
1428 OUT PULONG BytesInMultiByteString OPTIONAL,
1429 IN PCWCH UnicodeString,
1430 IN ULONG BytesInUnicodeString);
1431
1432 NTSYSAPI
1433 NTSTATUS
1434 NTAPI
1435 RtlOemToUnicodeN(
1436 OUT PWSTR UnicodeString,
1437 IN ULONG MaxBytesInUnicodeString,
1438 OUT PULONG BytesInUnicodeString OPTIONAL,
1439 IN PCCH OemString,
1440 IN ULONG BytesInOemString);
1441
1442 NTSYSAPI
1443 NTSTATUS
1444 NTAPI
1445 RtlUnicodeToOemN(
1446 OUT PCHAR OemString,
1447 IN ULONG MaxBytesInOemString,
1448 OUT PULONG BytesInOemString OPTIONAL,
1449 IN PCWCH UnicodeString,
1450 IN ULONG BytesInUnicodeString);
1451
1452 NTSYSAPI
1453 NTSTATUS
1454 NTAPI
1455 RtlUpcaseUnicodeToOemN(
1456 OUT PCHAR OemString,
1457 IN ULONG MaxBytesInOemString,
1458 OUT PULONG BytesInOemString OPTIONAL,
1459 IN PCWCH UnicodeString,
1460 IN ULONG BytesInUnicodeString);
1461
1462 typedef struct _GENERATE_NAME_CONTEXT {
1463 USHORT Checksum;
1464 BOOLEAN CheckSumInserted;
1465 UCHAR NameLength;
1466 WCHAR NameBuffer[8];
1467 ULONG ExtensionLength;
1468 WCHAR ExtensionBuffer[4];
1469 ULONG LastIndexValue;
1470 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
1471
1472 #if (NTDDI_VERSION >= NTDDI_VISTASP1)
1473 NTSYSAPI
1474 NTSTATUS
1475 NTAPI
1476 RtlGenerate8dot3Name(
1477 IN PCUNICODE_STRING Name,
1478 IN BOOLEAN AllowExtendedCharacters,
1479 IN OUT PGENERATE_NAME_CONTEXT Context,
1480 IN OUT PUNICODE_STRING Name8dot3);
1481 #else
1482 NTSYSAPI
1483 VOID
1484 NTAPI
1485 RtlGenerate8dot3Name(
1486 IN PCUNICODE_STRING Name,
1487 IN BOOLEAN AllowExtendedCharacters,
1488 IN OUT PGENERATE_NAME_CONTEXT Context,
1489 IN OUT PUNICODE_STRING Name8dot3);
1490 #endif
1491
1492 NTSYSAPI
1493 BOOLEAN
1494 NTAPI
1495 RtlIsNameLegalDOS8Dot3(
1496 IN PCUNICODE_STRING Name,
1497 IN OUT POEM_STRING OemName OPTIONAL,
1498 IN OUT PBOOLEAN NameContainsSpaces OPTIONAL);
1499
1500 NTSYSAPI
1501 BOOLEAN
1502 NTAPI
1503 RtlIsValidOemCharacter(
1504 IN OUT PWCHAR Char);
1505
1506 typedef struct _PREFIX_TABLE_ENTRY {
1507 CSHORT NodeTypeCode;
1508 CSHORT NameLength;
1509 struct _PREFIX_TABLE_ENTRY *NextPrefixTree;
1510 RTL_SPLAY_LINKS Links;
1511 PSTRING Prefix;
1512 } PREFIX_TABLE_ENTRY, *PPREFIX_TABLE_ENTRY;
1513
1514 typedef struct _PREFIX_TABLE {
1515 CSHORT NodeTypeCode;
1516 CSHORT NameLength;
1517 PPREFIX_TABLE_ENTRY NextPrefixTree;
1518 } PREFIX_TABLE, *PPREFIX_TABLE;
1519
1520 NTSYSAPI
1521 VOID
1522 NTAPI
1523 PfxInitialize(
1524 OUT PPREFIX_TABLE PrefixTable);
1525
1526 NTSYSAPI
1527 BOOLEAN
1528 NTAPI
1529 PfxInsertPrefix(
1530 IN PPREFIX_TABLE PrefixTable,
1531 IN PSTRING Prefix,
1532 OUT PPREFIX_TABLE_ENTRY PrefixTableEntry);
1533
1534 NTSYSAPI
1535 VOID
1536 NTAPI
1537 PfxRemovePrefix(
1538 IN PPREFIX_TABLE PrefixTable,
1539 IN PPREFIX_TABLE_ENTRY PrefixTableEntry);
1540
1541 NTSYSAPI
1542 PPREFIX_TABLE_ENTRY
1543 NTAPI
1544 PfxFindPrefix(
1545 IN PPREFIX_TABLE PrefixTable,
1546 IN PSTRING FullName);
1547
1548 typedef struct _UNICODE_PREFIX_TABLE_ENTRY {
1549 CSHORT NodeTypeCode;
1550 CSHORT NameLength;
1551 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
1552 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
1553 RTL_SPLAY_LINKS Links;
1554 PUNICODE_STRING Prefix;
1555 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
1556
1557 typedef struct _UNICODE_PREFIX_TABLE {
1558 CSHORT NodeTypeCode;
1559 CSHORT NameLength;
1560 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
1561 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
1562 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
1563
1564 NTSYSAPI
1565 VOID
1566 NTAPI
1567 RtlInitializeUnicodePrefix(
1568 OUT PUNICODE_PREFIX_TABLE PrefixTable);
1569
1570 NTSYSAPI
1571 BOOLEAN
1572 NTAPI
1573 RtlInsertUnicodePrefix(
1574 IN PUNICODE_PREFIX_TABLE PrefixTable,
1575 IN PUNICODE_STRING Prefix,
1576 OUT PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry);
1577
1578 NTSYSAPI
1579 VOID
1580 NTAPI
1581 RtlRemoveUnicodePrefix(
1582 IN PUNICODE_PREFIX_TABLE PrefixTable,
1583 IN PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry);
1584
1585 NTSYSAPI
1586 PUNICODE_PREFIX_TABLE_ENTRY
1587 NTAPI
1588 RtlFindUnicodePrefix(
1589 IN PUNICODE_PREFIX_TABLE PrefixTable,
1590 IN PUNICODE_STRING FullName,
1591 IN ULONG CaseInsensitiveIndex);
1592
1593 NTSYSAPI
1594 PUNICODE_PREFIX_TABLE_ENTRY
1595 NTAPI
1596 RtlNextUnicodePrefix(
1597 IN PUNICODE_PREFIX_TABLE PrefixTable,
1598 IN BOOLEAN Restart);
1599
1600 NTSYSAPI
1601 SIZE_T
1602 NTAPI
1603 RtlCompareMemoryUlong(
1604 IN PVOID Source,
1605 IN SIZE_T Length,
1606 IN ULONG Pattern);
1607
1608 NTSYSAPI
1609 BOOLEAN
1610 NTAPI
1611 RtlTimeToSecondsSince1980(
1612 IN PLARGE_INTEGER Time,
1613 OUT PULONG ElapsedSeconds);
1614
1615 NTSYSAPI
1616 VOID
1617 NTAPI
1618 RtlSecondsSince1980ToTime(
1619 IN ULONG ElapsedSeconds,
1620 OUT PLARGE_INTEGER Time);
1621
1622 NTSYSAPI
1623 BOOLEAN
1624 NTAPI
1625 RtlTimeToSecondsSince1970(
1626 IN PLARGE_INTEGER Time,
1627 OUT PULONG ElapsedSeconds);
1628
1629 NTSYSAPI
1630 VOID
1631 NTAPI
1632 RtlSecondsSince1970ToTime(
1633 IN ULONG ElapsedSeconds,
1634 OUT PLARGE_INTEGER Time);
1635
1636 NTSYSAPI
1637 BOOLEAN
1638 NTAPI
1639 RtlValidSid(
1640 IN PSID Sid);
1641
1642 NTSYSAPI
1643 BOOLEAN
1644 NTAPI
1645 RtlEqualSid(
1646 IN PSID Sid1,
1647 IN PSID Sid2);
1648
1649 NTSYSAPI
1650 BOOLEAN
1651 NTAPI
1652 RtlEqualPrefixSid(
1653 IN PSID Sid1,
1654 IN PSID Sid2);
1655
1656 NTSYSAPI
1657 ULONG
1658 NTAPI
1659 RtlLengthRequiredSid(
1660 IN ULONG SubAuthorityCount);
1661
1662 NTSYSAPI
1663 PVOID
1664 NTAPI
1665 RtlFreeSid(
1666 IN PSID Sid);
1667
1668 NTSYSAPI
1669 NTSTATUS
1670 NTAPI
1671 RtlAllocateAndInitializeSid(
1672 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
1673 IN UCHAR SubAuthorityCount,
1674 IN ULONG SubAuthority0,
1675 IN ULONG SubAuthority1,
1676 IN ULONG SubAuthority2,
1677 IN ULONG SubAuthority3,
1678 IN ULONG SubAuthority4,
1679 IN ULONG SubAuthority5,
1680 IN ULONG SubAuthority6,
1681 IN ULONG SubAuthority7,
1682 OUT PSID *Sid);
1683
1684 NTSYSAPI
1685 NTSTATUS
1686 NTAPI
1687 RtlInitializeSid(
1688 OUT PSID Sid,
1689 IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
1690 IN UCHAR SubAuthorityCount);
1691
1692 NTSYSAPI
1693 PULONG
1694 NTAPI
1695 RtlSubAuthoritySid(
1696 IN PSID Sid,
1697 IN ULONG SubAuthority);
1698
1699 NTSYSAPI
1700 ULONG
1701 NTAPI
1702 RtlLengthSid(
1703 IN PSID Sid);
1704
1705 NTSYSAPI
1706 NTSTATUS
1707 NTAPI
1708 RtlCopySid(
1709 IN ULONG Length,
1710 IN PSID Destination,
1711 IN PSID Source);
1712
1713 NTSYSAPI
1714 NTSTATUS
1715 NTAPI
1716 RtlConvertSidToUnicodeString(
1717 IN OUT PUNICODE_STRING UnicodeString,
1718 IN PSID Sid,
1719 IN BOOLEAN AllocateDestinationString);
1720
1721 NTSYSAPI
1722 VOID
1723 NTAPI
1724 RtlCopyLuid(
1725 OUT PLUID DestinationLuid,
1726 IN PLUID SourceLuid);
1727
1728 NTSYSAPI
1729 NTSTATUS
1730 NTAPI
1731 RtlCreateAcl(
1732 OUT PACL Acl,
1733 IN ULONG AclLength,
1734 IN ULONG AclRevision);
1735
1736 NTSYSAPI
1737 NTSTATUS
1738 NTAPI
1739 RtlAddAce(
1740 IN OUT PACL Acl,
1741 IN ULONG AceRevision,
1742 IN ULONG StartingAceIndex,
1743 IN PVOID AceList,
1744 IN ULONG AceListLength);
1745
1746 NTSYSAPI
1747 NTSTATUS
1748 NTAPI
1749 RtlDeleteAce(
1750 IN OUT PACL Acl,
1751 IN ULONG AceIndex);
1752
1753 NTSYSAPI
1754 NTSTATUS
1755 NTAPI
1756 RtlGetAce(
1757 IN PACL Acl,
1758 IN ULONG AceIndex,
1759 OUT PVOID *Ace);
1760
1761 NTSYSAPI
1762 NTSTATUS
1763 NTAPI
1764 RtlAddAccessAllowedAce(
1765 IN OUT PACL Acl,
1766 IN ULONG AceRevision,
1767 IN ACCESS_MASK AccessMask,
1768 IN PSID Sid);
1769
1770 NTSYSAPI
1771 NTSTATUS
1772 NTAPI
1773 RtlAddAccessAllowedAceEx(
1774 IN OUT PACL Acl,
1775 IN ULONG AceRevision,
1776 IN ULONG AceFlags,
1777 IN ACCESS_MASK AccessMask,
1778 IN PSID Sid);
1779
1780 NTSYSAPI
1781 NTSTATUS
1782 NTAPI
1783 RtlCreateSecurityDescriptorRelative(
1784 OUT PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
1785 IN ULONG Revision);
1786
1787 NTSYSAPI
1788 NTSTATUS
1789 NTAPI
1790 RtlGetDaclSecurityDescriptor(
1791 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1792 OUT PBOOLEAN DaclPresent,
1793 OUT PACL *Dacl,
1794 OUT PBOOLEAN DaclDefaulted);
1795
1796 NTSYSAPI
1797 NTSTATUS
1798 NTAPI
1799 RtlSetOwnerSecurityDescriptor(
1800 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
1801 IN PSID Owner OPTIONAL,
1802 IN BOOLEAN OwnerDefaulted);
1803
1804 NTSYSAPI
1805 NTSTATUS
1806 NTAPI
1807 RtlGetOwnerSecurityDescriptor(
1808 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1809 OUT PSID *Owner,
1810 OUT PBOOLEAN OwnerDefaulted);
1811
1812 NTSYSAPI
1813 ULONG
1814 NTAPI
1815 RtlNtStatusToDosError(
1816 IN NTSTATUS Status);
1817
1818 NTSYSAPI
1819 NTSTATUS
1820 NTAPI
1821 RtlCustomCPToUnicodeN(
1822 IN PCPTABLEINFO CustomCP,
1823 OUT PWCH UnicodeString,
1824 IN ULONG MaxBytesInUnicodeString,
1825 OUT PULONG BytesInUnicodeString OPTIONAL,
1826 IN PCH CustomCPString,
1827 IN ULONG BytesInCustomCPString);
1828
1829 NTSYSAPI
1830 NTSTATUS
1831 NTAPI
1832 RtlUnicodeToCustomCPN(
1833 IN PCPTABLEINFO CustomCP,
1834 OUT PCH CustomCPString,
1835 IN ULONG MaxBytesInCustomCPString,
1836 OUT PULONG BytesInCustomCPString OPTIONAL,
1837 IN PWCH UnicodeString,
1838 IN ULONG BytesInUnicodeString);
1839
1840 NTSYSAPI
1841 NTSTATUS
1842 NTAPI
1843 RtlUpcaseUnicodeToCustomCPN(
1844 IN PCPTABLEINFO CustomCP,
1845 OUT PCH CustomCPString,
1846 IN ULONG MaxBytesInCustomCPString,
1847 OUT PULONG BytesInCustomCPString OPTIONAL,
1848 IN PWCH UnicodeString,
1849 IN ULONG BytesInUnicodeString);
1850
1851 NTSYSAPI
1852 VOID
1853 NTAPI
1854 RtlInitCodePageTable(
1855 IN PUSHORT TableBase,
1856 IN OUT PCPTABLEINFO CodePageTable);
1857
1858 #endif
1859
1860 #if (NTDDI_VERSION >= NTDDI_WINXP)
1861
1862 NTSYSAPI
1863 PVOID
1864 NTAPI
1865 RtlCreateHeap(
1866 IN ULONG Flags,
1867 IN PVOID HeapBase OPTIONAL,
1868 IN SIZE_T ReserveSize OPTIONAL,
1869 IN SIZE_T CommitSize OPTIONAL,
1870 IN PVOID Lock OPTIONAL,
1871 IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL);
1872
1873 NTSYSAPI
1874 PVOID
1875 NTAPI
1876 RtlDestroyHeap(
1877 IN PVOID HeapHandle);
1878
1879 NTSYSAPI
1880 USHORT
1881 NTAPI
1882 RtlCaptureStackBackTrace(
1883 IN ULONG FramesToSkip,
1884 IN ULONG FramesToCapture,
1885 OUT PVOID *BackTrace,
1886 OUT PULONG BackTraceHash OPTIONAL);
1887
1888 NTSYSAPI
1889 ULONG
1890 NTAPI
1891 RtlRandomEx(
1892 IN OUT PULONG Seed);
1893
1894 NTSYSAPI
1895 NTSTATUS
1896 NTAPI
1897 RtlInitUnicodeStringEx(
1898 OUT PUNICODE_STRING DestinationString,
1899 IN PCWSTR SourceString OPTIONAL);
1900
1901 NTSYSAPI
1902 NTSTATUS
1903 NTAPI
1904 RtlValidateUnicodeString(
1905 IN ULONG Flags,
1906 IN PCUNICODE_STRING String);
1907
1908 NTSYSAPI
1909 NTSTATUS
1910 NTAPI
1911 RtlDuplicateUnicodeString(
1912 IN ULONG Flags,
1913 IN PCUNICODE_STRING SourceString,
1914 OUT PUNICODE_STRING DestinationString);
1915
1916 NTSYSAPI
1917 NTSTATUS
1918 NTAPI
1919 RtlGetCompressionWorkSpaceSize(
1920 IN USHORT CompressionFormatAndEngine,
1921 OUT PULONG CompressBufferWorkSpaceSize,
1922 OUT PULONG CompressFragmentWorkSpaceSize);
1923
1924 NTSYSAPI
1925 NTSTATUS
1926 NTAPI
1927 RtlCompressBuffer(
1928 IN USHORT CompressionFormatAndEngine,
1929 IN PUCHAR UncompressedBuffer,
1930 IN ULONG UncompressedBufferSize,
1931 OUT PUCHAR CompressedBuffer,
1932 IN ULONG CompressedBufferSize,
1933 IN ULONG UncompressedChunkSize,
1934 OUT PULONG FinalCompressedSize,
1935 IN PVOID WorkSpace);
1936
1937 NTSYSAPI
1938 NTSTATUS
1939 NTAPI
1940 RtlDecompressBuffer(
1941 IN USHORT CompressionFormat,
1942 OUT PUCHAR UncompressedBuffer,
1943 IN ULONG UncompressedBufferSize,
1944 IN PUCHAR CompressedBuffer,
1945 IN ULONG CompressedBufferSize,
1946 OUT PULONG FinalUncompressedSize);
1947
1948 NTSYSAPI
1949 NTSTATUS
1950 NTAPI
1951 RtlDecompressFragment(
1952 IN USHORT CompressionFormat,
1953 OUT PUCHAR UncompressedFragment,
1954 IN ULONG UncompressedFragmentSize,
1955 IN PUCHAR CompressedBuffer,
1956 IN ULONG CompressedBufferSize,
1957 IN ULONG FragmentOffset,
1958 OUT PULONG FinalUncompressedSize,
1959 IN PVOID WorkSpace);
1960
1961 NTSYSAPI
1962 NTSTATUS
1963 NTAPI
1964 RtlDescribeChunk(
1965 IN USHORT CompressionFormat,
1966 IN OUT PUCHAR *CompressedBuffer,
1967 IN PUCHAR EndOfCompressedBufferPlus1,
1968 OUT PUCHAR *ChunkBuffer,
1969 OUT PULONG ChunkSize);
1970
1971 NTSYSAPI
1972 NTSTATUS
1973 NTAPI
1974 RtlReserveChunk(
1975 IN USHORT CompressionFormat,
1976 IN OUT PUCHAR *CompressedBuffer,
1977 IN PUCHAR EndOfCompressedBufferPlus1,
1978 OUT PUCHAR *ChunkBuffer,
1979 IN ULONG ChunkSize);
1980
1981 typedef struct _COMPRESSED_DATA_INFO {
1982 USHORT CompressionFormatAndEngine;
1983 UCHAR CompressionUnitShift;
1984 UCHAR ChunkShift;
1985 UCHAR ClusterShift;
1986 UCHAR Reserved;
1987 USHORT NumberOfChunks;
1988 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
1989 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
1990
1991 NTSYSAPI
1992 NTSTATUS
1993 NTAPI
1994 RtlDecompressChunks(
1995 OUT PUCHAR UncompressedBuffer,
1996 IN ULONG UncompressedBufferSize,
1997 IN PUCHAR CompressedBuffer,
1998 IN ULONG CompressedBufferSize,
1999 IN PUCHAR CompressedTail,
2000 IN ULONG CompressedTailSize,
2001 IN PCOMPRESSED_DATA_INFO CompressedDataInfo);
2002
2003 NTSYSAPI
2004 NTSTATUS
2005 NTAPI
2006 RtlCompressChunks(
2007 IN PUCHAR UncompressedBuffer,
2008 IN ULONG UncompressedBufferSize,
2009 OUT PUCHAR CompressedBuffer,
2010 IN ULONG CompressedBufferSize,
2011 IN OUT PCOMPRESSED_DATA_INFO CompressedDataInfo,
2012 IN ULONG CompressedDataInfoLength,
2013 IN PVOID WorkSpace);
2014
2015 NTSYSAPI
2016 PSID_IDENTIFIER_AUTHORITY
2017 NTAPI
2018 RtlIdentifierAuthoritySid(
2019 IN PSID Sid);
2020
2021 NTSYSAPI
2022 PUCHAR
2023 NTAPI
2024 RtlSubAuthorityCountSid(
2025 IN PSID Sid);
2026
2027 NTSYSAPI
2028 ULONG
2029 NTAPI
2030 RtlNtStatusToDosErrorNoTeb(
2031 IN NTSTATUS Status);
2032
2033 NTSYSAPI
2034 NTSTATUS
2035 NTAPI
2036 RtlCreateSystemVolumeInformationFolder(
2037 IN PCUNICODE_STRING VolumeRootPath);
2038
2039 #endif
2040
2041 #if defined(_M_AMD64)
2042
2043 FORCEINLINE
2044 VOID
2045 RtlFillMemoryUlong (
2046 OUT PVOID Destination,
2047 IN SIZE_T Length,
2048 IN ULONG Pattern)
2049 {
2050 PULONG Address = (PULONG)Destination;
2051 if ((Length /= 4) != 0) {
2052 if (((ULONG64)Address & 4) != 0) {
2053 *Address = Pattern;
2054 if ((Length -= 1) == 0) {
2055 return;
2056 }
2057 Address += 1;
2058 }
2059 __stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2);
2060 if ((Length & 1) != 0) Address[Length - 1] = Pattern;
2061 }
2062 return;
2063 }
2064
2065 #define RtlFillMemoryUlonglong(Destination, Length, Pattern) \
2066 __stosq((PULONG64)(Destination), Pattern, (Length) / 8)
2067
2068 #else
2069
2070 #if (NTDDI_VERSION >= NTDDI_WINXP)
2071
2072 NTSYSAPI
2073 VOID
2074 NTAPI
2075 RtlFillMemoryUlong(
2076 OUT PVOID Destination,
2077 IN SIZE_T Length,
2078 IN ULONG Pattern);
2079
2080 NTSYSAPI
2081 VOID
2082 NTAPI
2083 RtlFillMemoryUlonglong(
2084 OUT PVOID Destination,
2085 IN SIZE_T Length,
2086 IN ULONGLONG Pattern);
2087
2088 #endif
2089
2090 #endif // defined(_M_AMD64)
2091
2092 #if (NTDDI_VERSION >= NTDDI_WS03)
2093
2094 NTSYSAPI
2095 NTSTATUS
2096 NTAPI
2097 RtlInitAnsiStringEx(
2098 OUT PANSI_STRING DestinationString,
2099 IN PCSZ SourceString OPTIONAL);
2100
2101 #endif
2102
2103 #if (NTDDI_VERSION >= NTDDI_WS03SP1)
2104
2105 NTSYSAPI
2106 NTSTATUS
2107 NTAPI
2108 RtlGetSaclSecurityDescriptor(
2109 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
2110 OUT PBOOLEAN SaclPresent,
2111 OUT PACL *Sacl,
2112 OUT PBOOLEAN SaclDefaulted);
2113
2114 NTSYSAPI
2115 NTSTATUS
2116 NTAPI
2117 RtlSetGroupSecurityDescriptor(
2118 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
2119 IN PSID Group OPTIONAL,
2120 IN BOOLEAN GroupDefaulted OPTIONAL);
2121
2122 NTSYSAPI
2123 NTSTATUS
2124 NTAPI
2125 RtlGetGroupSecurityDescriptor(
2126 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
2127 OUT PSID *Group,
2128 OUT PBOOLEAN GroupDefaulted);
2129
2130 NTSYSAPI
2131 NTSTATUS
2132 NTAPI
2133 RtlAbsoluteToSelfRelativeSD(
2134 IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
2135 OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor OPTIONAL,
2136 IN OUT PULONG BufferLength);
2137
2138 NTSYSAPI
2139 NTSTATUS
2140 NTAPI
2141 RtlSelfRelativeToAbsoluteSD(
2142 IN PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
2143 OUT PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor OPTIONAL,
2144 IN OUT PULONG AbsoluteSecurityDescriptorSize,
2145 OUT PACL Dacl OPTIONAL,
2146 IN OUT PULONG DaclSize,
2147 OUT PACL Sacl OPTIONAL,
2148 IN OUT PULONG SaclSize,
2149 OUT PSID Owner OPTIONAL,
2150 IN OUT PULONG OwnerSize,
2151 OUT PSID PrimaryGroup OPTIONAL,
2152 IN OUT PULONG PrimaryGroupSize);
2153
2154 #endif
2155
2156 #if (NTDDI_VERSION >= NTDDI_VISTA)
2157
2158 NTSYSAPI
2159 NTSTATUS
2160 NTAPI
2161 RtlNormalizeString(
2162 IN ULONG NormForm,
2163 IN PCWSTR SourceString,
2164 IN LONG SourceStringLength,
2165 OUT PWSTR DestinationString,
2166 IN OUT PLONG DestinationStringLength);
2167
2168 NTSYSAPI
2169 NTSTATUS
2170 NTAPI
2171 RtlIsNormalizedString(
2172 IN ULONG NormForm,
2173 IN PCWSTR SourceString,
2174 IN LONG SourceStringLength,
2175 OUT PBOOLEAN Normalized);
2176
2177 NTSYSAPI
2178 NTSTATUS
2179 NTAPI
2180 RtlIdnToAscii(
2181 IN ULONG Flags,
2182 IN PCWSTR SourceString,
2183 IN LONG SourceStringLength,
2184 OUT PWSTR DestinationString,
2185 IN OUT PLONG DestinationStringLength);
2186
2187 NTSYSAPI
2188 NTSTATUS
2189 NTAPI
2190 RtlIdnToUnicode(
2191 IN ULONG Flags,
2192 IN PCWSTR SourceString,
2193 IN LONG SourceStringLength,
2194 OUT PWSTR DestinationString,
2195 IN OUT PLONG DestinationStringLength);
2196
2197 NTSYSAPI
2198 NTSTATUS
2199 NTAPI
2200 RtlIdnToNameprepUnicode(
2201 IN ULONG Flags,
2202 IN PCWSTR SourceString,
2203 IN LONG SourceStringLength,
2204 OUT PWSTR DestinationString,
2205 IN OUT PLONG DestinationStringLength);
2206
2207 NTSYSAPI
2208 NTSTATUS
2209 NTAPI
2210 RtlCreateServiceSid(
2211 IN PUNICODE_STRING ServiceName,
2212 OUT PSID ServiceSid,
2213 IN OUT PULONG ServiceSidLength);
2214
2215 NTSYSAPI
2216 LONG
2217 NTAPI
2218 RtlCompareAltitudes(
2219 IN PCUNICODE_STRING Altitude1,
2220 IN PCUNICODE_STRING Altitude2);
2221
2222 #endif
2223
2224 #if (NTDDI_VERSION >= NTDDI_WIN7)
2225
2226 NTSYSAPI
2227 NTSTATUS
2228 NTAPI
2229 RtlUnicodeToUTF8N(
2230 OUT PCHAR UTF8StringDestination,
2231 IN ULONG UTF8StringMaxByteCount,
2232 OUT PULONG UTF8StringActualByteCount,
2233 IN PCWCH UnicodeStringSource,
2234 IN ULONG UnicodeStringByteCount);
2235
2236 NTSYSAPI
2237 NTSTATUS
2238 NTAPI
2239 RtlUTF8ToUnicodeN(
2240 OUT PWSTR UnicodeStringDestination,
2241 IN ULONG UnicodeStringMaxByteCount,
2242 OUT PULONG UnicodeStringActualByteCount,
2243 IN PCCH UTF8StringSource,
2244 IN ULONG UTF8StringByteCount);
2245
2246 NTSYSAPI
2247 NTSTATUS
2248 NTAPI
2249 RtlReplaceSidInSd(
2250 IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
2251 IN PSID OldSid,
2252 IN PSID NewSid,
2253 OUT ULONG *NumChanges);
2254
2255 NTSYSAPI
2256 NTSTATUS
2257 NTAPI
2258 RtlCreateVirtualAccountSid(
2259 IN PCUNICODE_STRING Name,
2260 IN ULONG BaseSubAuthority,
2261 OUT PSID Sid,
2262 IN OUT PULONG SidLength);
2263
2264 #endif
2265
2266 #define HEAP_NO_SERIALIZE 0x00000001
2267 #define HEAP_GROWABLE 0x00000002
2268 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
2269 #define HEAP_ZERO_MEMORY 0x00000008
2270 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
2271 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
2272 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
2273 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
2274
2275 #define HEAP_CREATE_ALIGN_16 0x00010000
2276 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
2277 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
2278
2279 #define HEAP_SETTABLE_USER_VALUE 0x00000100
2280 #define HEAP_SETTABLE_USER_FLAG1 0x00000200
2281 #define HEAP_SETTABLE_USER_FLAG2 0x00000400
2282 #define HEAP_SETTABLE_USER_FLAG3 0x00000800
2283 #define HEAP_SETTABLE_USER_FLAGS 0x00000E00
2284
2285 #define HEAP_CLASS_0 0x00000000
2286 #define HEAP_CLASS_1 0x00001000
2287 #define HEAP_CLASS_2 0x00002000
2288 #define HEAP_CLASS_3 0x00003000
2289 #define HEAP_CLASS_4 0x00004000
2290 #define HEAP_CLASS_5 0x00005000
2291 #define HEAP_CLASS_6 0x00006000
2292 #define HEAP_CLASS_7 0x00007000
2293 #define HEAP_CLASS_8 0x00008000
2294 #define HEAP_CLASS_MASK 0x0000F000
2295
2296 #define HEAP_MAXIMUM_TAG 0x0FFF
2297 #define HEAP_GLOBAL_TAG 0x0800
2298 #define HEAP_PSEUDO_TAG_FLAG 0x8000
2299 #define HEAP_TAG_SHIFT 18
2300 #define HEAP_TAG_MASK (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
2301
2302 #define HEAP_CREATE_VALID_MASK (HEAP_NO_SERIALIZE | \
2303 HEAP_GROWABLE | \
2304 HEAP_GENERATE_EXCEPTIONS | \
2305 HEAP_ZERO_MEMORY | \
2306 HEAP_REALLOC_IN_PLACE_ONLY | \
2307 HEAP_TAIL_CHECKING_ENABLED | \
2308 HEAP_FREE_CHECKING_ENABLED | \
2309 HEAP_DISABLE_COALESCE_ON_FREE | \
2310 HEAP_CLASS_MASK | \
2311 HEAP_CREATE_ALIGN_16 | \
2312 HEAP_CREATE_ENABLE_TRACING | \
2313 HEAP_CREATE_ENABLE_EXECUTE)
2314
2315 FORCEINLINE
2316 ULONG
2317 HEAP_MAKE_TAG_FLAGS(
2318 IN ULONG TagBase,
2319 IN ULONG Tag)
2320 {
2321 //__assume_bound(TagBase); // FIXME
2322 return ((ULONG)((TagBase) + ((Tag) << HEAP_TAG_SHIFT)));
2323 }
2324
2325 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
2326 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
2327
2328 #define RtlUnicodeStringToOemSize(STRING) (NLS_MB_OEM_CODE_PAGE_TAG ? \
2329 RtlxUnicodeStringToOemSize(STRING) : \
2330 ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
2331 )
2332
2333 #define RtlOemStringToUnicodeSize(STRING) ( \
2334 NLS_MB_OEM_CODE_PAGE_TAG ? \
2335 RtlxOemStringToUnicodeSize(STRING) : \
2336 ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \
2337 )
2338
2339 #define RtlOemStringToCountedUnicodeSize(STRING) ( \
2340 (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
2341 )
2342
2343 typedef PVOID
2344 (NTAPI *PRTL_ALLOCATE_STRING_ROUTINE)(
2345 IN SIZE_T NumberOfBytes);
2346
2347 #if _WIN32_WINNT >= 0x0600
2348
2349 typedef PVOID
2350 (NTAPI *PRTL_REALLOCATE_STRING_ROUTINE)(
2351 IN SIZE_T NumberOfBytes,
2352 IN PVOID Buffer);
2353
2354 #endif
2355
2356 typedef VOID
2357 (NTAPI *PRTL_FREE_STRING_ROUTINE)(
2358 IN PVOID Buffer);
2359
2360 extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
2361 extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
2362
2363 #if _WIN32_WINNT >= 0x0600
2364 extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
2365 #endif
2366
2367 #define COMPRESSION_FORMAT_NONE (0x0000)
2368 #define COMPRESSION_FORMAT_DEFAULT (0x0001)
2369 #define COMPRESSION_FORMAT_LZNT1 (0x0002)
2370 #define COMPRESSION_ENGINE_STANDARD (0x0000)
2371 #define COMPRESSION_ENGINE_MAXIMUM (0x0100)
2372 #define COMPRESSION_ENGINE_HIBER (0x0200)
2373
2374 #define RtlOffsetToPointer(B,O) ((PCHAR)( ((PCHAR)(B)) + ((ULONG_PTR)(O)) ))
2375 #define RtlPointerToOffset(B,P) ((ULONG)( ((PCHAR)(P)) - ((PCHAR)(B)) ))
2376
2377 #define MAX_UNICODE_STACK_BUFFER_LENGTH 256
2378
2379 #define RTL_SYSTEM_VOLUME_INFORMATION_FOLDER L"System Volume Information"
2380
2381 #define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3))
2382
2383 #define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT
2384 #define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT
2385
2386 typedef ULONG LSA_OPERATIONAL_MODE, *PLSA_OPERATIONAL_MODE;
2387
2388 typedef enum _SECURITY_LOGON_TYPE {
2389 UndefinedLogonType = 0,
2390 Interactive = 2,
2391 Network,
2392 Batch,
2393 Service,
2394 Proxy,
2395 Unlock,
2396 NetworkCleartext,
2397 NewCredentials,
2398 #if (_WIN32_WINNT >= 0x0501)
2399 RemoteInteractive,
2400 CachedInteractive,
2401 #endif
2402 #if (_WIN32_WINNT >= 0x0502)
2403 CachedRemoteInteractive,
2404 CachedUnlock
2405 #endif
2406 } SECURITY_LOGON_TYPE, *PSECURITY_LOGON_TYPE;
2407
2408 #ifndef _NTLSA_AUDIT_
2409 #define _NTLSA_AUDIT_
2410
2411 #ifndef GUID_DEFINED
2412 #include <guiddef.h>
2413 #endif
2414
2415 #endif /* _NTLSA_AUDIT_ */
2416
2417 NTSTATUS
2418 NTAPI
2419 LsaRegisterLogonProcess(
2420 IN PLSA_STRING LogonProcessName,
2421 OUT PHANDLE LsaHandle,
2422 OUT PLSA_OPERATIONAL_MODE SecurityMode);
2423
2424 NTSTATUS
2425 NTAPI
2426 LsaLogonUser(
2427 IN HANDLE LsaHandle,
2428 IN PLSA_STRING OriginName,
2429 IN SECURITY_LOGON_TYPE LogonType,
2430 IN ULONG AuthenticationPackage,
2431 IN PVOID AuthenticationInformation,
2432 IN ULONG AuthenticationInformationLength,
2433 IN PTOKEN_GROUPS LocalGroups OPTIONAL,
2434 IN PTOKEN_SOURCE SourceContext,
2435 OUT PVOID *ProfileBuffer,
2436 OUT PULONG ProfileBufferLength,
2437 OUT PLUID LogonId,
2438 OUT PHANDLE Token,
2439 OUT PQUOTA_LIMITS Quotas,
2440 OUT PNTSTATUS SubStatus);
2441
2442 NTSTATUS
2443 NTAPI
2444 LsaFreeReturnBuffer(
2445 IN PVOID Buffer);
2446
2447 #ifndef _NTLSA_IFS_
2448 #define _NTLSA_IFS_
2449 #endif
2450
2451 #define MSV1_0_PACKAGE_NAME "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"
2452 #define MSV1_0_PACKAGE_NAMEW L"MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"
2453 #define MSV1_0_PACKAGE_NAMEW_LENGTH sizeof(MSV1_0_PACKAGE_NAMEW) - sizeof(WCHAR)
2454
2455 #define MSV1_0_SUBAUTHENTICATION_KEY "SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0"
2456 #define MSV1_0_SUBAUTHENTICATION_VALUE "Auth"
2457
2458 #define MSV1_0_CHALLENGE_LENGTH 8
2459 #define MSV1_0_USER_SESSION_KEY_LENGTH 16
2460 #define MSV1_0_LANMAN_SESSION_KEY_LENGTH 8
2461
2462 #define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED 0x02
2463 #define MSV1_0_UPDATE_LOGON_STATISTICS 0x04
2464 #define MSV1_0_RETURN_USER_PARAMETERS 0x08
2465 #define MSV1_0_DONT_TRY_GUEST_ACCOUNT 0x10
2466 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x20
2467 #define MSV1_0_RETURN_PASSWORD_EXPIRY 0x40
2468 #define MSV1_0_USE_CLIENT_CHALLENGE 0x80
2469 #define MSV1_0_TRY_GUEST_ACCOUNT_ONLY 0x100
2470 #define MSV1_0_RETURN_PROFILE_PATH 0x200
2471 #define MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY 0x400
2472 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x800
2473
2474 #define MSV1_0_DISABLE_PERSONAL_FALLBACK 0x00001000
2475 #define MSV1_0_ALLOW_FORCE_GUEST 0x00002000
2476
2477 #if (_WIN32_WINNT >= 0x0502)
2478 #define MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED 0x00004000
2479 #define MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY 0x00008000
2480 #endif
2481
2482 #define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000
2483 #define MSV1_0_ALLOW_MSVCHAPV2 0x00010000
2484
2485 #if (_WIN32_WINNT >= 0x0600)
2486 #define MSV1_0_S4U2SELF 0x00020000
2487 #define MSV1_0_CHECK_LOGONHOURS_FOR_S4U 0x00040000
2488 #endif
2489
2490 #define MSV1_0_SUBAUTHENTICATION_DLL 0xFF000000
2491 #define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT 24
2492 #define MSV1_0_MNS_LOGON 0x01000000
2493
2494 #define MSV1_0_SUBAUTHENTICATION_DLL_RAS 2
2495 #define MSV1_0_SUBAUTHENTICATION_DLL_IIS 132
2496
2497 #define LOGON_GUEST 0x01
2498 #define LOGON_NOENCRYPTION 0x02
2499 #define LOGON_CACHED_ACCOUNT 0x04
2500 #define LOGON_USED_LM_PASSWORD 0x08
2501 #define LOGON_EXTRA_SIDS 0x20
2502 #define LOGON_SUBAUTH_SESSION_KEY 0x40
2503 #define LOGON_SERVER_TRUST_ACCOUNT 0x80
2504 #define LOGON_NTLMV2_ENABLED 0x100
2505 #define LOGON_RESOURCE_GROUPS 0x200
2506 #define LOGON_PROFILE_PATH_RETURNED 0x400
2507 #define LOGON_NT_V2 0x800
2508 #define LOGON_LM_V2 0x1000
2509 #define LOGON_NTLM_V2 0x2000
2510
2511 #if (_WIN32_WINNT >= 0x0600)
2512
2513 #define LOGON_OPTIMIZED 0x4000
2514 #define LOGON_WINLOGON 0x8000
2515 #define LOGON_PKINIT 0x10000
2516 #define LOGON_NO_OPTIMIZED 0x20000
2517
2518 #endif
2519
2520 #define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000
2521
2522 #define LOGON_GRACE_LOGON 0x01000000
2523
2524 #define MSV1_0_OWF_PASSWORD_LENGTH 16
2525 #define MSV1_0_CRED_LM_PRESENT 0x1
2526 #define MSV1_0_CRED_NT_PRESENT 0x2
2527 #define MSV1_0_CRED_VERSION 0
2528
2529 #define MSV1_0_NTLM3_RESPONSE_LENGTH 16
2530 #define MSV1_0_NTLM3_OWF_LENGTH 16
2531
2532 #if (_WIN32_WINNT == 0x0500)
2533 #define MSV1_0_MAX_NTLM3_LIFE 1800
2534 #else
2535 #define MSV1_0_MAX_NTLM3_LIFE 129600
2536 #endif
2537 #define MSV1_0_MAX_AVL_SIZE 64000
2538
2539 #if (_WIN32_WINNT >= 0x0501)
2540
2541 #define MSV1_0_AV_FLAG_FORCE_GUEST 0x00000001
2542
2543 #if (_WIN32_WINNT >= 0x0600)
2544 #define MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES 0x00000002
2545 #endif
2546
2547 #endif
2548
2549 #define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_RESPONSE_LENGTH)
2550
2551 #if(_WIN32_WINNT >= 0x0502)
2552 #define MSV1_0_NTLM3_MIN_NT_RESPONSE_LENGTH RTL_SIZEOF_THROUGH_FIELD(MSV1_0_NTLM3_RESPONSE, AvPairsOff)
2553 #endif
2554
2555 #define USE_PRIMARY_PASSWORD 0x01
2556 #define RETURN_PRIMARY_USERNAME 0x02
2557 #define RETURN_PRIMARY_LOGON_DOMAINNAME 0x04
2558 #define RETURN_NON_NT_USER_SESSION_KEY 0x08
2559 #define GENERATE_CLIENT_CHALLENGE 0x10
2560 #define GCR_NTLM3_PARMS 0x20
2561 #define GCR_TARGET_INFO 0x40
2562 #define RETURN_RESERVED_PARAMETER 0x80
2563 #define GCR_ALLOW_NTLM 0x100
2564 #define GCR_USE_OEM_SET 0x200
2565 #define GCR_MACHINE_CREDENTIAL 0x400
2566 #define GCR_USE_OWF_PASSWORD 0x800
2567 #define GCR_ALLOW_LM 0x1000
2568 #define GCR_ALLOW_NO_TARGET 0x2000
2569
2570 typedef enum _MSV1_0_LOGON_SUBMIT_TYPE {
2571 MsV1_0InteractiveLogon = 2,
2572 MsV1_0Lm20Logon,
2573 MsV1_0NetworkLogon,
2574 MsV1_0SubAuthLogon,
2575 MsV1_0WorkstationUnlockLogon = 7,
2576 MsV1_0S4ULogon = 12,
2577 MsV1_0VirtualLogon = 82
2578 } MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE;
2579
2580 typedef enum _MSV1_0_PROFILE_BUFFER_TYPE {
2581 MsV1_0InteractiveProfile = 2,
2582 MsV1_0Lm20LogonProfile,
2583 MsV1_0SmartCardProfile
2584 } MSV1_0_PROFILE_BUFFER_TYPE, *PMSV1_0_PROFILE_BUFFER_TYPE;
2585
2586 typedef struct _MSV1_0_INTERACTIVE_LOGON {
2587 MSV1_0_LOGON_SUBMIT_TYPE MessageType;
2588 UNICODE_STRING LogonDomainName;
2589 UNICODE_STRING UserName;
2590 UNICODE_STRING Password;
2591 } MSV1_0_INTERACTIVE_LOGON, *PMSV1_0_INTERACTIVE_LOGON;
2592
2593 typedef struct _MSV1_0_INTERACTIVE_PROFILE {
2594 MSV1_0_PROFILE_BUFFER_TYPE MessageType;
2595 USHORT LogonCount;
2596 USHORT BadPasswordCount;
2597 LARGE_INTEGER LogonTime;
2598 LARGE_INTEGER LogoffTime;
2599 LARGE_INTEGER KickOffTime;
2600 LARGE_INTEGER PasswordLastSet;
2601 LARGE_INTEGER PasswordCanChange;
2602 LARGE_INTEGER PasswordMustChange;
2603 UNICODE_STRING LogonScript;
2604 UNICODE_STRING HomeDirectory;
2605 UNICODE_STRING FullName;
2606 UNICODE_STRING ProfilePath;
2607 UNICODE_STRING HomeDirectoryDrive;
2608 UNICODE_STRING LogonServer;
2609 ULONG UserFlags;
2610 } MSV1_0_INTERACTIVE_PROFILE, *PMSV1_0_INTERACTIVE_PROFILE;
2611
2612 typedef struct _MSV1_0_LM20_LOGON {
2613 MSV1_0_LOGON_SUBMIT_TYPE MessageType;
2614 UNICODE_STRING LogonDomainName;
2615 UNICODE_STRING UserName;
2616 UNICODE_STRING Workstation;
2617 UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
2618 STRING CaseSensitiveChallengeResponse;
2619 STRING CaseInsensitiveChallengeResponse;
2620 ULONG ParameterControl;
2621 } MSV1_0_LM20_LOGON, * PMSV1_0_LM20_LOGON;
2622
2623 typedef struct _MSV1_0_SUBAUTH_LOGON {
2624 MSV1_0_LOGON_SUBMIT_TYPE MessageType;
2625 UNICODE_STRING LogonDomainName;
2626 UNICODE_STRING UserName;
2627 UNICODE_STRING Workstation;
2628 UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
2629 STRING AuthenticationInfo1;
2630 STRING AuthenticationInfo2;
2631 ULONG ParameterControl;
2632 ULONG SubAuthPackageId;
2633 } MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON;
2634
2635 #if (_WIN32_WINNT >= 0x0600)
2636
2637 #define MSV1_0_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2
2638
2639 typedef struct _MSV1_0_S4U_LOGON {
2640 MSV1_0_LOGON_SUBMIT_TYPE MessageType;
2641 ULONG Flags;
2642 UNICODE_STRING UserPrincipalName;
2643 UNICODE_STRING DomainName;
2644 } MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON;
2645
2646 #endif
2647
2648 typedef struct _MSV1_0_LM20_LOGON_PROFILE {
2649 MSV1_0_PROFILE_BUFFER_TYPE MessageType;
2650 LARGE_INTEGER KickOffTime;
2651 LARGE_INTEGER LogoffTime;
2652 ULONG UserFlags;
2653 UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
2654 UNICODE_STRING LogonDomainName;
2655 UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
2656 UNICODE_STRING LogonServer;
2657 UNICODE_STRING UserParameters;
2658 } MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE;
2659
2660 typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL {
2661 ULONG Version;
2662 ULONG Flags;
2663 UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH];
2664 UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH];
2665 } MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
2666
2667 typedef struct _MSV1_0_NTLM3_RESPONSE {
2668 UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH];
2669 UCHAR RespType;
2670 UCHAR HiRespType;
2671 USHORT Flags;
2672 ULONG MsgWord;
2673 ULONGLONG TimeStamp;
2674 UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH];
2675 ULONG AvPairsOff;
2676 UCHAR Buffer[1];
2677 } MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE;
2678
2679 typedef enum _MSV1_0_AVID {
2680 MsvAvEOL,
2681 MsvAvNbComputerName,
2682 MsvAvNbDomainName,
2683 MsvAvDnsComputerName,
2684 MsvAvDnsDomainName,
2685 #if (_WIN32_WINNT >= 0x0501)
2686 MsvAvDnsTreeName,
2687 MsvAvFlags,
2688 #if (_WIN32_WINNT >= 0x0600)
2689 MsvAvTimestamp,
2690 MsvAvRestrictions,
2691 MsvAvTargetName,
2692 MsvAvChannelBindings,
2693 #endif
2694 #endif
2695 } MSV1_0_AVID;
2696
2697 typedef struct _MSV1_0_AV_PAIR {
2698 USHORT AvId;
2699 USHORT AvLen;
2700 } MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR;
2701
2702 typedef enum _MSV1_0_PROTOCOL_MESSAGE_TYPE {
2703 MsV1_0Lm20ChallengeRequest = 0,
2704 MsV1_0Lm20GetChallengeResponse,
2705 MsV1_0EnumerateUsers,
2706 MsV1_0GetUserInfo,
2707 MsV1_0ReLogonUsers,
2708 MsV1_0ChangePassword,
2709 MsV1_0ChangeCachedPassword,
2710 MsV1_0GenericPassthrough,
2711 MsV1_0CacheLogon,
2712 MsV1_0SubAuth,
2713 MsV1_0DeriveCredential,
2714 MsV1_0CacheLookup,
2715 #if (_WIN32_WINNT >= 0x0501)
2716 MsV1_0SetProcessOption,
2717 #endif
2718 #if (_WIN32_WINNT >= 0x0600)
2719 MsV1_0ConfigLocalAliases,
2720 MsV1_0ClearCachedCredentials,
2721 #endif
2722 } MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE;
2723
2724 typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST {
2725 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2726 } MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST;
2727
2728 typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE {
2729 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2730 UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
2731 } MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE;
2732
2733 typedef struct _MSV1_0_GETCHALLENRESP_REQUEST_V1 {
2734 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2735 ULONG ParameterControl;
2736 LUID LogonId;
2737 UNICODE_STRING Password;
2738 UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
2739 } MSV1_0_GETCHALLENRESP_REQUEST_V1, *PMSV1_0_GETCHALLENRESP_REQUEST_V1;
2740
2741 typedef struct _MSV1_0_GETCHALLENRESP_REQUEST {
2742 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2743 ULONG ParameterControl;
2744 LUID LogonId;
2745 UNICODE_STRING Password;
2746 UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
2747 UNICODE_STRING UserName;
2748 UNICODE_STRING LogonDomainName;
2749 UNICODE_STRING ServerName;
2750 } MSV1_0_GETCHALLENRESP_REQUEST, *PMSV1_0_GETCHALLENRESP_REQUEST;
2751
2752 typedef struct _MSV1_0_GETCHALLENRESP_RESPONSE {
2753 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2754 STRING CaseSensitiveChallengeResponse;
2755 STRING CaseInsensitiveChallengeResponse;
2756 UNICODE_STRING UserName;
2757 UNICODE_STRING LogonDomainName;
2758 UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
2759 UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
2760 } MSV1_0_GETCHALLENRESP_RESPONSE, *PMSV1_0_GETCHALLENRESP_RESPONSE;
2761
2762 typedef struct _MSV1_0_ENUMUSERS_REQUEST {
2763 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2764 } MSV1_0_ENUMUSERS_REQUEST, *PMSV1_0_ENUMUSERS_REQUEST;
2765
2766 typedef struct _MSV1_0_ENUMUSERS_RESPONSE {
2767 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2768 ULONG NumberOfLoggedOnUsers;
2769 PLUID LogonIds;
2770 PULONG EnumHandles;
2771 } MSV1_0_ENUMUSERS_RESPONSE, *PMSV1_0_ENUMUSERS_RESPONSE;
2772
2773 typedef struct _MSV1_0_GETUSERINFO_REQUEST {
2774 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2775 LUID LogonId;
2776 } MSV1_0_GETUSERINFO_REQUEST, *PMSV1_0_GETUSERINFO_REQUEST;
2777
2778 typedef struct _MSV1_0_GETUSERINFO_RESPONSE {
2779 MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
2780 PSID UserSid;
2781 UNICODE_STRING UserName;
2782 UNICODE_STRING LogonDomainName;
2783 UNICODE_STRING LogonServer;
2784 SECURITY_LOGON_TYPE LogonType;
2785 } MSV1_0_GETUSERINFO_RESPONSE, *PMSV1_0_GETUSERINFO_RESPONSE;
2786
2787 #define FILE_OPLOCK_BROKEN_TO_LEVEL_2 0x00000007
2788 #define FILE_OPLOCK_BROKEN_TO_NONE 0x00000008
2789 #define FILE_OPBATCH_BREAK_UNDERWAY 0x00000009
2790
2791 /* also in winnt.h */
2792 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
2793 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
2794 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
2795 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
2796 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
2797 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
2798 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
2799 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
2800 #define FILE_NOTIFY_CHANGE_EA 0x00000080
2801 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
2802 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
2803 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
2804 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
2805 #define FILE_NOTIFY_VALID_MASK 0x00000fff
2806
2807 #define FILE_ACTION_ADDED 0x00000001
2808 #define FILE_ACTION_REMOVED 0x00000002
2809 #define FILE_ACTION_MODIFIED 0x00000003
2810 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
2811 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
2812 #define FILE_ACTION_ADDED_STREAM 0x00000006
2813 #define FILE_ACTION_REMOVED_STREAM 0x00000007
2814 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
2815 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
2816 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
2817 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
2818 /* end winnt.h */
2819
2820 #define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000
2821 #define FILE_PIPE_MESSAGE_TYPE 0x00000001
2822
2823 #define FILE_PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000
2824 #define FILE_PIPE_REJECT_REMOTE_CLIENTS 0x00000002
2825
2826 #define FILE_PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000
2827 #define FILE_PIPE_REJECT_REMOTE_CLIENTS 0x00000002
2828 #define FILE_PIPE_TYPE_VALID_MASK 0x00000003
2829
2830 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
2831 #define FILE_PIPE_MESSAGE_MODE 0x00000001
2832
2833 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
2834 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
2835
2836 #define FILE_PIPE_INBOUND 0x00000000
2837 #define FILE_PIPE_OUTBOUND 0x00000001
2838 #define FILE_PIPE_FULL_DUPLEX 0x00000002
2839
2840 #define FILE_PIPE_DISCONNECTED_STATE 0x00000001
2841 #define FILE_PIPE_LISTENING_STATE 0x00000002
2842 #define FILE_PIPE_CONNECTED_STATE 0x00000003
2843 #define FILE_PIPE_CLOSING_STATE 0x00000004
2844
2845 #define FILE_PIPE_CLIENT_END 0x00000000
2846 #define FILE_PIPE_SERVER_END 0x00000001
2847
2848 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
2849 #define FILE_CASE_PRESERVED_NAMES 0x00000002
2850 #define FILE_UNICODE_ON_DISK 0x00000004
2851 #define FILE_PERSISTENT_ACLS 0x00000008
2852 #define FILE_FILE_COMPRESSION 0x00000010
2853 #define FILE_VOLUME_QUOTAS 0x00000020
2854 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
2855 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
2856 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
2857 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
2858 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
2859 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
2860 #define FILE_NAMED_STREAMS 0x00040000
2861 #define FILE_READ_ONLY_VOLUME 0x00080000
2862 #define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000
2863 #define FILE_SUPPORTS_TRANSACTIONS 0x00200000
2864 #define FILE_SUPPORTS_HARD_LINKS 0x00400000
2865 #define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000
2866 #define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000
2867 #define FILE_SUPPORTS_USN_JOURNAL 0x02000000
2868
2869 #define FILE_NEED_EA 0x00000080
2870
2871 #define FILE_EA_TYPE_BINARY 0xfffe
2872 #define FILE_EA_TYPE_ASCII 0xfffd
2873 #define FILE_EA_TYPE_BITMAP 0xfffb
2874 #define FILE_EA_TYPE_METAFILE 0xfffa
2875 #define FILE_EA_TYPE_ICON 0xfff9
2876 #define FILE_EA_TYPE_EA 0xffee
2877 #define FILE_EA_TYPE_MVMT 0xffdf
2878 #define FILE_EA_TYPE_MVST 0xffde
2879 #define FILE_EA_TYPE_ASN1 0xffdd
2880 #define FILE_EA_TYPE_FAMILY_IDS 0xff01
2881
2882 typedef struct _FILE_NOTIFY_INFORMATION {
2883 ULONG NextEntryOffset;
2884 ULONG Action;
2885 ULONG FileNameLength;
2886 WCHAR FileName[1];
2887 } FILE_NOTIFY_INFORMATION, *PFILE_NOTIFY_INFORMATION;
2888
2889 typedef struct _FILE_DIRECTORY_INFORMATION {
2890 ULONG NextEntryOffset;
2891 ULONG FileIndex;
2892 LARGE_INTEGER CreationTime;
2893 LARGE_INTEGER LastAccessTime;
2894 LARGE_INTEGER LastWriteTime;
2895 LARGE_INTEGER ChangeTime;
2896 LARGE_INTEGER EndOfFile;
2897 LARGE_INTEGER AllocationSize;
2898 ULONG FileAttributes;
2899 ULONG FileNameLength;
2900 WCHAR FileName[1];
2901 } FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
2902
2903 typedef struct _FILE_FULL_DIR_INFORMATION {
2904 ULONG NextEntryOffset;
2905 ULONG FileIndex;
2906 LARGE_INTEGER CreationTime;
2907 LARGE_INTEGER LastAccessTime;
2908 LARGE_INTEGER LastWriteTime;
2909 LARGE_INTEGER ChangeTime;
2910 LARGE_INTEGER EndOfFile;
2911 LARGE_INTEGER AllocationSize;
2912 ULONG FileAttributes;
2913 ULONG FileNameLength;
2914 ULONG EaSize;
2915 WCHAR FileName[1];
2916 } FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
2917
2918 typedef struct _FILE_ID_FULL_DIR_INFORMATION {
2919 ULONG NextEntryOffset;
2920 ULONG FileIndex;
2921 LARGE_INTEGER CreationTime;
2922 LARGE_INTEGER LastAccessTime;
2923 LARGE_INTEGER LastWriteTime;
2924 LARGE_INTEGER ChangeTime;
2925 LARGE_INTEGER EndOfFile;
2926 LARGE_INTEGER AllocationSize;
2927 ULONG FileAttributes;
2928 ULONG FileNameLength;
2929 ULONG EaSize;
2930 LARGE_INTEGER FileId;
2931 WCHAR FileName[1];
2932 } FILE_ID_FULL_DIR_INFORMATION, *PFILE_ID_FULL_DIR_INFORMATION;
2933
2934 typedef struct _FILE_BOTH_DIR_INFORMATION {
2935 ULONG NextEntryOffset;
2936 ULONG FileIndex;
2937 LARGE_INTEGER CreationTime;
2938 LARGE_INTEGER LastAccessTime;
2939 LARGE_INTEGER LastWriteTime;
2940 LARGE_INTEGER ChangeTime;
2941 LARGE_INTEGER EndOfFile;
2942 LARGE_INTEGER AllocationSize;
2943 ULONG FileAttributes;
2944 ULONG FileNameLength;
2945 ULONG EaSize;
2946 CCHAR ShortNameLength;
2947 WCHAR ShortName[12];
2948 WCHAR FileName[1];
2949 } FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
2950
2951 typedef struct _FILE_ID_BOTH_DIR_INFORMATION {
2952 ULONG NextEntryOffset;
2953 ULONG FileIndex;
2954 LARGE_INTEGER CreationTime;
2955 LARGE_INTEGER LastAccessTime;
2956 LARGE_INTEGER LastWriteTime;
2957 LARGE_INTEGER ChangeTime;
2958 LARGE_INTEGER EndOfFile;
2959 LARGE_INTEGER AllocationSize;
2960 ULONG FileAttributes;
2961 ULONG FileNameLength;
2962 ULONG EaSize;
2963 CCHAR ShortNameLength;
2964 WCHAR ShortName[12];
2965 LARGE_INTEGER FileId;
2966 WCHAR FileName[1];
2967 } FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION;
2968
2969 typedef struct _FILE_NAMES_INFORMATION {
2970 ULONG NextEntryOffset;
2971 ULONG FileIndex;
2972 ULONG FileNameLength;
2973 WCHAR FileName[1];
2974 } FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
2975
2976 typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
2977 ULONG NextEntryOffset;
2978 ULONG FileIndex;
2979 LARGE_INTEGER CreationTime;
2980 LARGE_INTEGER LastAccessTime;
2981 LARGE_INTEGER LastWriteTime;
2982 LARGE_INTEGER ChangeTime;
2983 LARGE_INTEGER EndOfFile;
2984 LARGE_INTEGER AllocationSize;
2985 ULONG FileAttributes;
2986 ULONG FileNameLength;
2987 LARGE_INTEGER FileId;
2988 GUID LockingTransactionId;
2989 ULONG TxInfoFlags;
2990 WCHAR FileName[1];
2991 } FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
2992
2993 #define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_WRITELOCKED 0x00000001
2994 #define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_VISIBLE_TO_TX 0x00000002
2995 #define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_VISIBLE_OUTSIDE_TX 0x00000004
2996
2997 typedef struct _FILE_OBJECTID_INFORMATION {
2998 LONGLONG FileReference;
2999 UCHAR ObjectId[16];
3000 _ANONYMOUS_UNION union {
3001 __GNU_EXTENSION struct {
3002 UCHAR BirthVolumeId[16];
3003 UCHAR BirthObjectId[16];
3004 UCHAR DomainId[16];
3005 };
3006 UCHAR ExtendedInfo[48];
3007 } DUMMYUNIONNAME;
3008 } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
3009
3010 #define ANSI_DOS_STAR ('<')
3011 #define ANSI_DOS_QM ('>')
3012 #define ANSI_DOS_DOT ('"')
3013
3014 #define DOS_STAR (L'<')
3015 #define DOS_QM (L'>')
3016 #define DOS_DOT (L'"')
3017
3018 typedef struct _FILE_INTERNAL_INFORMATION {
3019 LARGE_INTEGER IndexNumber;
3020 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
3021
3022 typedef struct _FILE_EA_INFORMATION {
3023 ULONG EaSize;
3024 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
3025
3026 typedef struct _FILE_ACCESS_INFORMATION {
3027 ACCESS_MASK AccessFlags;
3028 } FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
3029
3030 typedef struct _FILE_MODE_INFORMATION {
3031 ULONG Mode;
3032 } FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
3033
3034 typedef struct _FILE_ALL_INFORMATION {
3035 FILE_BASIC_INFORMATION BasicInformation;
3036 FILE_STANDARD_INFORMATION StandardInformation;
3037 FILE_INTERNAL_INFORMATION InternalInformation;
3038 FILE_EA_INFORMATION EaInformation;
3039 FILE_ACCESS_INFORMATION AccessInformation;
3040 FILE_POSITION_INFORMATION PositionInformation;
3041 FILE_MODE_INFORMATION ModeInformation;
3042 FILE_ALIGNMENT_INFORMATION AlignmentInformation;
3043 FILE_NAME_INFORMATION NameInformation;
3044 } FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
3045
3046 typedef struct _FILE_ALLOCATION_INFORMATION {
3047 LARGE_INTEGER AllocationSize;
3048 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
3049
3050 typedef struct _FILE_COMPRESSION_INFORMATION {
3051 LARGE_INTEGER CompressedFileSize;
3052 USHORT CompressionFormat;
3053 UCHAR CompressionUnitShift;
3054 UCHAR ChunkShift;
3055 UCHAR ClusterShift;
3056 UCHAR Reserved[3];
3057 } FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
3058
3059 typedef struct _FILE_LINK_INFORMATION {
3060 BOOLEAN ReplaceIfExists;
3061 HANDLE RootDirectory;
3062 ULONG FileNameLength;
3063 WCHAR FileName[1];
3064 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
3065
3066 typedef struct _FILE_MOVE_CLUSTER_INFORMATION {
3067 ULONG ClusterCount;
3068 HANDLE RootDirectory;
3069 ULONG FileNameLength;
3070 WCHAR FileName[1];
3071 } FILE_MOVE_CLUSTER_INFORMATION, *PFILE_MOVE_CLUSTER_INFORMATION;
3072
3073 typedef struct _FILE_RENAME_INFORMATION {
3074 BOOLEAN ReplaceIfExists;
3075 HANDLE RootDirectory;
3076 ULONG FileNameLength;
3077 WCHAR FileName[1];
3078 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
3079
3080 typedef struct _FILE_STREAM_INFORMATION {
3081 ULONG NextEntryOffset;
3082 ULONG StreamNameLength;
3083 LARGE_INTEGER StreamSize;
3084 LARGE_INTEGER StreamAllocationSize;
3085 WCHAR StreamName[1];
3086 } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
3087
3088 typedef struct _FILE_TRACKING_INFORMATION {
3089 HANDLE DestinationFile;
3090 ULONG ObjectInformationLength;
3091 CHAR ObjectInformation[1];
3092 } FILE_TRACKING_INFORMATION, *PFILE_TRACKING_INFORMATION;
3093
3094 typedef struct _FILE_COMPLETION_INFORMATION {
3095 HANDLE Port;
3096 PVOID Key;
3097 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
3098
3099 typedef struct _FILE_PIPE_INFORMATION {
3100 ULONG ReadMode;
3101 ULONG CompletionMode;
3102 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
3103
3104 typedef struct _FILE_PIPE_LOCAL_INFORMATION {
3105 ULONG NamedPipeType;
3106 ULONG NamedPipeConfiguration;
3107 ULONG MaximumInstances;
3108 ULONG CurrentInstances;
3109 ULONG InboundQuota;
3110 ULONG ReadDataAvailable;
3111 ULONG OutboundQuota;
3112 ULONG WriteQuotaAvailable;
3113 ULONG NamedPipeState;
3114 ULONG NamedPipeEnd;
3115 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
3116
3117 typedef struct _FILE_PIPE_REMOTE_INFORMATION {
3118 LARGE_INTEGER CollectDataTime;
3119 ULONG MaximumCollectionCount;
3120 } FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
3121
3122 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
3123 ULONG MaximumMessageSize;
3124 ULONG MailslotQuota;
3125 ULONG NextMessageSize;
3126 ULONG MessagesAvailable;
3127 LARGE_INTEGER ReadTimeout;
3128 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
3129
3130 typedef struct _FILE_MAILSLOT_SET_INFORMATION {
3131 PLARGE_INTEGER ReadTimeout;
3132 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
3133
3134 typedef struct _FILE_REPARSE_POINT_INFORMATION {
3135 LONGLONG FileReference;
3136 ULONG Tag;
3137 } FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
3138
3139 typedef struct _FILE_LINK_ENTRY_INFORMATION {
3140 ULONG NextEntryOffset;
3141 LONGLONG ParentFileId;
3142 ULONG FileNameLength;
3143 WCHAR FileName[1];
3144 } FILE_LINK_ENTRY_INFORMATION, *PFILE_LINK_ENTRY_INFORMATION;
3145
3146 typedef struct _FILE_LINKS_INFORMATION {
3147 ULONG BytesNeeded;
3148 ULONG EntriesReturned;
3149 FILE_LINK_ENTRY_INFORMATION Entry;
3150 } FILE_LINKS_INFORMATION, *PFILE_LINKS_INFORMATION;
3151
3152 typedef struct _FILE_NETWORK_PHYSICAL_NAME_INFORMATION {
3153 ULONG FileNameLength;
3154 WCHAR FileName[1];
3155 } FILE_NETWORK_PHYSICAL_NAME_INFORMATION, *PFILE_NETWORK_PHYSICAL_NAME_INFORMATION;
3156
3157 typedef struct _FILE_STANDARD_LINK_INFORMATION {
3158 ULONG NumberOfAccessibleLinks;
3159 ULONG TotalNumberOfLinks;
3160 BOOLEAN DeletePending;
3161 BOOLEAN Directory;
3162 } FILE_STANDARD_LINK_INFORMATION, *PFILE_STANDARD_LINK_INFORMATION;
3163
3164 typedef struct _FILE_GET_EA_INFORMATION {
3165 ULONG NextEntryOffset;
3166 UCHAR EaNameLength;
3167 CHAR EaName[1];
3168 } FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
3169
3170 #define REMOTE_PROTOCOL_FLAG_LOOPBACK 0x00000001
3171 #define REMOTE_PROTOCOL_FLAG_OFFLINE 0x00000002
3172
3173 typedef struct _FILE_REMOTE_PROTOCOL_INFORMATION {
3174 USHORT StructureVersion;
3175 USHORT StructureSize;
3176 ULONG Protocol;
3177 USHORT ProtocolMajorVersion;
3178 USHORT ProtocolMinorVersion;
3179 USHORT ProtocolRevision;
3180 USHORT Reserved;
3181 ULONG Flags;
3182 struct {
3183 ULONG Reserved[8];
3184 } GenericReserved;
3185 struct {
3186 ULONG Reserved[16];
3187 } ProtocolSpecificReserved;
3188 } FILE_REMOTE_PROTOCOL_INFORMATION, *PFILE_REMOTE_PROTOCOL_INFORMATION;
3189
3190 typedef struct _FILE_GET_QUOTA_INFORMATION {
3191 ULONG NextEntryOffset;
3192 ULONG SidLength;
3193 SID Sid;
3194 } FILE_GET_QUOTA_INFORMATION, *PFILE_GET_QUOTA_INFORMATION;
3195
3196 typedef struct _FILE_QUOTA_INFORMATION {
3197 ULONG NextEntryOffset;
3198 ULONG SidLength;
3199 LARGE_INTEGER ChangeTime;
3200 LARGE_INTEGER QuotaUsed;
3201 LARGE_INTEGER QuotaThreshold;
3202 LARGE_INTEGER QuotaLimit;
3203 SID Sid;
3204 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
3205
3206 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION {
3207 ULONG FileSystemAttributes;
3208 ULONG MaximumComponentNameLength;
3209 ULONG FileSystemNameLength;
3210 WCHAR FileSystemName[1];
3211 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
3212
3213 typedef struct _FILE_FS_DRIVER_PATH_INFORMATION {
3214 BOOLEAN DriverInPath;
3215 ULONG DriverNameLength;
3216 WCHAR DriverName[1];
3217 } FILE_FS_DRIVER_PATH_INFORMATION, *PFILE_FS_DRIVER_PATH_INFORMATION;
3218
3219 typedef struct _FILE_FS_VOLUME_FLAGS_INFORMATION {
3220 ULONG Flags;
3221 } FILE_FS_VOLUME_FLAGS_INFORMATION, *PFILE_FS_VOLUME_FLAGS_INFORMATION;
3222
3223 #define FILE_VC_QUOTA_NONE 0x00000000
3224 #define FILE_VC_QUOTA_TRACK 0x00000001
3225 #define FILE_VC_QUOTA_ENFORCE 0x00000002
3226 #define FILE_VC_QUOTA_MASK 0x00000003
3227 #define FILE_VC_CONTENT_INDEX_DISABLED 0x00000008
3228 #define FILE_VC_LOG_QUOTA_THRESHOLD 0x00000010
3229 #define FILE_VC_LOG_QUOTA_LIMIT 0x00000020
3230 #define FILE_VC_LOG_VOLUME_THRESHOLD 0x00000040
3231 #define FILE_VC_LOG_VOLUME_LIMIT 0x00000080
3232 #define FILE_VC_QUOTAS_INCOMPLETE 0x00000100
3233 #define FILE_VC_QUOTAS_REBUILDING 0x00000200
3234 #define FILE_VC_VALID_MASK 0x000003ff
3235
3236 typedef struct _FILE_FS_CONTROL_INFORMATION {
3237 LARGE_INTEGER FreeSpaceStartFiltering;
3238 LARGE_INTEGER FreeSpaceThreshold;
3239 LARGE_INTEGER FreeSpaceStopFiltering;
3240 LARGE_INTEGER DefaultQuotaThreshold;
3241 LARGE_INTEGER DefaultQuotaLimit;
3242 ULONG FileSystemControlFlags;
3243 } FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION;
3244
3245 #ifndef _FILESYSTEMFSCTL_
3246 #define _FILESYSTEMFSCTL_
3247
3248 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
3249 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
3250 #define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
3251 #define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
3252 #define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
3253 #define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
3254 #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
3255 #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
3256 #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
3257 #define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
3258 #define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
3259 #define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
3260 #define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
3261 #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
3262 #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
3263 #define FSCTL_SET_BOOTLOADER_ACCESSED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
3264
3265 #define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
3266 #define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
3267 #define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
3268 #define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
3269 #define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
3270
3271 #if (_WIN32_WINNT >= 0x0400)
3272
3273 #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
3274 #define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
3275 #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS)
3276 #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS)
3277 #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_ANY_ACCESS)
3278 #define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
3279 #define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
3280
3281 #endif
3282
3283 #if (_WIN32_WINNT >= 0x0500)
3284
3285 #define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
3286 #define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_WRITE_DATA)
3287 #define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
3288 #define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_WRITE_DATA)
3289 #define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_WRITE_DATA)
3290 #define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
3291 #define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_WRITE_DATA)
3292 #define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_READ_DATA)
3293 #define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA)
3294 #define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_READ_DATA)
3295 #define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_WRITE_DATA)
3296 #define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
3297 #define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_WRITE_DATA)
3298 #define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
3299 #define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA)
3300 #define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
3301 #define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_BUFFERED, FILE_ANY_ACCESS)
3302 #define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS)
3303 #define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_ANY_ACCESS)
3304 #define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_ANY_ACCESS)
3305 #define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_READ_DATA)
3306 #define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_READ_DATA)
3307 #define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_READ_DATA)
3308 #define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
3309 #define FSCTL_QUERY_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
3310 #define FSCTL_DELETE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
3311 #define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
3312 #define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
3313 #define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
3314 #define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
3315 #define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
3316 #define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
3317
3318 #endif
3319
3320 #if (_WIN32_WINNT >= 0x0600)
3321
3322 #define FSCTL_MAKE_MEDIA_COMPATIBLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 76, METHOD_BUFFERED, FILE_WRITE_DATA)
3323 #define FSCTL_SET_DEFECT_MANAGEMENT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 77, METHOD_BUFFERED, FILE_WRITE_DATA)
3324 #define FSCTL_QUERY_SPARING_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 78, METHOD_BUFFERED, FILE_ANY_ACCESS)
3325 #define FSCTL_QUERY_ON_DISK_VOLUME_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 79, METHOD_BUFFERED, FILE_ANY_ACCESS)
3326 #define FSCTL_SET_VOLUME_COMPRESSION_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 80, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
3327 #define FSCTL_TXFS_MODIFY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 81, METHOD_BUFFERED, FILE_WRITE_DATA)
3328 #define FSCTL_TXFS_QUERY_RM_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 82, METHOD_BUFFERED, FILE_READ_DATA)
3329 #define FSCTL_TXFS_ROLLFORWARD_REDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 84, METHOD_BUFFERED, FILE_WRITE_DATA)
3330 #define FSCTL_TXFS_ROLLFORWARD_UNDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 85, METHOD_BUFFERED, FILE_WRITE_DATA)
3331 #define FSCTL_TXFS_START_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 86, METHOD_BUFFERED, FILE_WRITE_DATA)
3332 #define FSCTL_TXFS_SHUTDOWN_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 87, METHOD_BUFFERED, FILE_WRITE_DATA)
3333 #define FSCTL_TXFS_READ_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 88, METHOD_BUFFERED, FILE_READ_DATA)
3334 #define FSCTL_TXFS_WRITE_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 89, METHOD_BUFFERED, FILE_WRITE_DATA)
3335 #define FSCTL_TXFS_CREATE_SECONDARY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 90, METHOD_BUFFERED, FILE_WRITE_DATA)
3336 #define FSCTL_TXFS_GET_METADATA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 91, METHOD_BUFFERED, FILE_READ_DATA)
3337 #define FSCTL_TXFS_GET_TRANSACTED_VERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 92, METHOD_BUFFERED, FILE_READ_DATA)
3338 #define FSCTL_TXFS_SAVEPOINT_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 94, METHOD_BUFFERED, FILE_WRITE_DATA)
3339 #define FSCTL_TXFS_CREATE_MINIVERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 95, METHOD_BUFFERED, FILE_WRITE_DATA)
3340 #define FSCTL_TXFS_TRANSACTION_ACTIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 99, METHOD_BUFFERED, FILE_READ_DATA)
3341 #define FSCTL_SET_ZERO_ON_DEALLOCATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 101, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
3342 #define FSCTL_SET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
3343 #define FSCTL_GET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
3344 #define FSCTL_WAIT_FOR_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
3345 #define FSCTL_INITIATE_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
3346 #define FSCTL_CSC_INTERNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 107, METHOD_NEITHER, FILE_ANY_ACCESS)
3347 #define FSCTL_SHRINK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 108, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
3348 #define FSCTL_SET_SHORT_NAME_BEHAVIOR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 109, METHOD_BUFFERED, FILE_ANY_ACCESS)
3349 #define FSCTL_DFSR_SET_GHOST_HANDLE_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 110, METHOD_BUFFERED, FILE_ANY_ACCESS)
3350
3351 #define FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES \
3352 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_READ_DATA)
3353 #define FSCTL_TXFS_LIST_TRANSACTIONS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 121, METHOD_BUFFERED, FILE_READ_DATA)
3354 #define FSCTL_QUERY_PAGEFILE_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 122, METHOD_BUFFERED, FILE_ANY_ACCESS)
3355 #define FSCTL_RESET_VOLUME_ALLOCATION_HINTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 123, METHOD_BUFFERED, FILE_ANY_ACCESS)
3356 #define FSCTL_TXFS_READ_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 126, METHOD_BUFFERED, FILE_ANY_ACCESS)
3357
3358 #endif
3359
3360 #if (_WIN32_WINNT >= 0x0601)
3361
3362 #define FSCTL_QUERY_DEPENDENT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 124, METHOD_BUFFERED, FILE_ANY_ACCESS)
3363 #define FSCTL_SD_GLOBAL_CHANGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 125, METHOD_BUFFERED, FILE_ANY_ACCESS)
3364 #define FSCTL_LOOKUP_STREAM_FROM_CLUSTER CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 127, METHOD_BUFFERED, FILE_ANY_ACCESS)
3365 #define FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 128, METHOD_BUFFERED, FILE_ANY_ACCESS)
3366 #define FSCTL_FILE_TYPE_NOTIFICATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 129, METHOD_BUFFERED, FILE_ANY_ACCESS)
3367 #define FSCTL_GET_BOOT_AREA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 140, METHOD_BUFFERED, FILE_ANY_ACCESS)
3368 #define FSCTL_GET_RETRIEVAL_POINTER_BASE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 141, METHOD_BUFFERED, FILE_ANY_ACCESS)
3369 #define FSCTL_SET_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS)
3370 #define FSCTL_QUERY_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 143, METHOD_BUFFERED, FILE_ANY_ACCESS)
3371
3372 #define FSCTL_REQUEST_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 144, METHOD_BUFFERED, FILE_ANY_ACCESS)
3373
3374 #define FSCTL_CSV_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 145, METHOD_BUFFERED, FILE_ANY_ACCESS)
3375 #define FSCTL_IS_CSV_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 146, METHOD_BUFFERED, FILE_ANY_ACCESS)
3376
3377 #define FSCTL_QUERY_FILE_SYSTEM_RECOGNITION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 147, METHOD_BUFFERED, FILE_ANY_ACCESS)
3378 #define FSCTL_CSV_GET_VOLUME_PATH_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 148, METHOD_BUFFERED, FILE_ANY_ACCESS)
3379 #define FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 149, METHOD_BUFFERED, FILE_ANY_ACCESS)
3380 #define FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 150, METHOD_BUFFERED, FILE_ANY_ACCESS)
3381 #define FSCTL_IS_FILE_ON_CSV_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 151, METHOD_BUFFERED, FILE_ANY_ACCESS)
3382
3383 typedef struct _CSV_NAMESPACE_INFO {
3384 ULONG Version;
3385 ULONG DeviceNumber;
3386 LARGE_INTEGER StartingOffset;
3387 ULONG SectorSize;
3388 } CSV_NAMESPACE_INFO, *PCSV_NAMESPACE_INFO;
3389
3390 #define CSV_NAMESPACE_INFO_V1 (sizeof(CSV_NAMESPACE_INFO))
3391 #define CSV_INVALID_DEVICE_NUMBER 0xFFFFFFFF
3392
3393 #endif
3394
3395 #define FSCTL_MARK_AS_SYSTEM_HIVE FSCTL_SET_BOOTLOADER_ACCESSED
3396
3397 typedef struct _PATHNAME_BUFFER {
3398 ULONG PathNameLength;
3399 WCHAR Name[1];
3400 } PATHNAME_BUFFER, *PPATHNAME_BUFFER;
3401
3402 typedef struct _FSCTL_QUERY_FAT_BPB_BUFFER {
3403 UCHAR First0x24BytesOfBootSector[0x24];
3404 } FSCTL_QUERY_FAT_BPB_BUFFER, *PFSCTL_QUERY_FAT_BPB_BUFFER;
3405
3406 #if (_WIN32_WINNT >= 0x0400)
3407
3408 typedef struct _NTFS_VOLUME_DATA_BUFFER {
3409 LARGE_INTEGER VolumeSerialNumber;
3410 LARGE_INTEGER NumberSectors;
3411 LARGE_INTEGER TotalClusters;
3412 LARGE_INTEGER FreeClusters;
3413 LARGE_INTEGER TotalReserved;
3414 ULONG BytesPerSector;
3415 ULONG BytesPerCluster;
3416 ULONG BytesPerFileRecordSegment;
3417 ULONG ClustersPerFileRecordSegment;
3418 LARGE_INTEGER MftValidDataLength;
3419 LARGE_INTEGER MftStartLcn;
3420 LARGE_INTEGER Mft2StartLcn;
3421 LARGE_INTEGER MftZoneStart;
3422 LARGE_INTEGER MftZoneEnd;
3423 } NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER;
3424
3425 typedef struct _NTFS_EXTENDED_VOLUME_DATA {
3426 ULONG ByteCount;
3427 USHORT MajorVersion;
3428 USHORT MinorVersion;
3429 } NTFS_EXTENDED_VOLUME_DATA, *PNTFS_EXTENDED_VOLUME_DATA;
3430
3431 typedef struct _STARTING_LCN_INPUT_BUFFER {
3432 LARGE_INTEGER StartingLcn;
3433 } STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER;
3434
3435 typedef struct _VOLUME_BITMAP_BUFFER {
3436 LARGE_INTEGER StartingLcn;
3437 LARGE_INTEGER BitmapSize;
3438 UCHAR Buffer[1];
3439 } VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER;
3440
3441 typedef struct _STARTING_VCN_INPUT_BUFFER {
3442 LARGE_INTEGER StartingVcn;
3443 } STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;
3444
3445 typedef struct _RETRIEVAL_POINTERS_BUFFER {
3446 ULONG ExtentCount;
3447 LARGE_INTEGER StartingVcn;
3448 struct {
3449 LARGE_INTEGER NextVcn;
3450 LARGE_INTEGER Lcn;
3451 } Extents[1];
3452 } RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
3453
3454 typedef struct _NTFS_FILE_RECORD_INPUT_BUFFER {
3455 LARGE_INTEGER FileReferenceNumber;
3456 } NTFS_FILE_RECORD_INPUT_BUFFER, *PNTFS_FILE_RECORD_INPUT_BUFFER;
3457
3458 typedef struct _NTFS_FILE_RECORD_OUTPUT_BUFFER {
3459 LARGE_INTEGER FileReferenceNumber;
3460 ULONG FileRecordLength;
3461 UCHAR FileRecordBuffer[1];
3462 } NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER;
3463
3464 typedef struct _MOVE_FILE_DATA {
3465 HANDLE FileHandle;
3466 LARGE_INTEGER StartingVcn;
3467 LARGE_INTEGER StartingLcn;
3468 ULONG ClusterCount;
3469 } MOVE_FILE_DATA, *PMOVE_FILE_DATA;
3470
3471 typedef struct _MOVE_FILE_RECORD_DATA {
3472 HANDLE FileHandle;
3473 LARGE_INTEGER SourceFileRecord;
3474 LARGE_INTEGER TargetFileRecord;
3475 } MOVE_FILE_RECORD_DATA, *PMOVE_FILE_RECORD_DATA;
3476
3477 #if defined(_WIN64)
3478 typedef struct _MOVE_FILE_DATA32 {
3479 UINT32 FileHandle;
3480 LARGE_INTEGER StartingVcn;
3481 LARGE_INTEGER StartingLcn;
3482 ULONG ClusterCount;
3483 } MOVE_FILE_DATA32, *PMOVE_FILE_DATA32;
3484 #endif
3485
3486 #endif /* (_WIN32_WINNT >= 0x0400) */
3487
3488 #if (_WIN32_WINNT >= 0x0500)
3489
3490 typedef struct _FIND_BY_SID_DATA {
3491 ULONG Restart;
3492 SID Sid;
3493 } FIND_BY_SID_DATA, *PFIND_BY_SID_DATA;
3494
3495 typedef struct _FIND_BY_SID_OUTPUT {
3496 ULONG NextEntryOffset;
3497 ULONG FileIndex;
3498 ULONG FileNameLength;
3499 WCHAR FileName[1];
3500 } FIND_BY_SID_OUTPUT, *PFIND_BY_SID_OUTPUT;
3501
3502 typedef struct _MFT_ENUM_DATA {
3503 ULONGLONG StartFileReferenceNumber;
3504 USN LowUsn;
3505 USN HighUsn;
3506 } MFT_ENUM_DATA, *PMFT_ENUM_DATA;
3507
3508 typedef struct _CREATE_USN_JOURNAL_DATA {
3509 ULONGLONG MaximumSize;
3510 ULONGLONG AllocationDelta;
3511 } CREATE_USN_JOURNAL_DATA, *PCREATE_USN_JOURNAL_DATA;
3512
3513 typedef struct _READ_USN_JOURNAL_DATA {
3514 USN StartUsn;
3515 ULONG ReasonMask;
3516 ULONG ReturnOnlyOnClose;
3517 ULONGLONG Timeout;
3518 ULONGLONG BytesToWaitFor;
3519 ULONGLONG UsnJournalID;
3520 } READ_USN_JOURNAL_DATA, *PREAD_USN_JOURNAL_DATA;
3521
3522 typedef struct _USN_RECORD {
3523 ULONG RecordLength;
3524 USHORT MajorVersion;
3525 USHORT MinorVersion;
3526 ULONGLONG FileReferenceNumber;
3527 ULONGLONG ParentFileReferenceNumber;
3528 USN Usn;
3529 LARGE_INTEGER TimeStamp;
3530 ULONG Reason;
3531 ULONG SourceInfo;
3532 ULONG SecurityId;
3533 ULONG FileAttributes;
3534 USHORT FileNameLength;
3535 USHORT FileNameOffset;
3536 WCHAR FileName[1];
3537 } USN_RECORD, *PUSN_RECORD;
3538
3539 #define USN_PAGE_SIZE (0x1000)
3540
3541 #define USN_REASON_DATA_OVERWRITE (0x00000001)
3542 #define USN_REASON_DATA_EXTEND (0x00000002)
3543 #define USN_REASON_DATA_TRUNCATION (0x00000004)
3544 #define USN_REASON_NAMED_DATA_OVERWRITE (0x00000010)
3545 #define USN_REASON_NAMED_DATA_EXTEND (0x00000020)
3546 #define USN_REASON_NAMED_DATA_TRUNCATION (0x00000040)
3547 #define USN_REASON_FILE_CREATE (0x00000100)
3548 #define USN_REASON_FILE_DELETE (0x00000200)
3549 #define USN_REASON_EA_CHANGE (0x00000400)
3550 #define USN_REASON_SECURITY_CHANGE (0x00000800)
3551 #define USN_REASON_RENAME_OLD_NAME (0x00001000)
3552 #define USN_REASON_RENAME_NEW_NAME (0x00002000)
3553 #define USN_REASON_INDEXABLE_CHANGE (0x00004000)
3554 #define USN_REASON_BASIC_INFO_CHANGE (0x00008000)
3555 #define USN_REASON_HARD_LINK_CHANGE (0x00010000)
3556 #define USN_REASON_COMPRESSION_CHANGE (0x00020000)
3557 #define USN_REASON_ENCRYPTION_CHANGE (0x00040000)
3558 #define USN_REASON_OBJECT_ID_CHANGE (0x00080000)
3559 #define USN_REASON_REPARSE_POINT_CHANGE (0x00100000)
3560 #define USN_REASON_STREAM_CHANGE (0x00200000)
3561 #define USN_REASON_TRANSACTED_CHANGE (0x00400000)
3562 #define USN_REASON_CLOSE (0x80000000)
3563
3564 typedef struct _USN_JOURNAL_DATA {
3565 ULONGLONG UsnJournalID;
3566 USN FirstUsn;
3567 USN NextUsn;
3568 USN LowestValidUsn;
3569 USN MaxUsn;
3570 ULONGLONG MaximumSize;
3571 ULONGLONG AllocationDelta;
3572 } USN_JOURNAL_DATA, *PUSN_JOURNAL_DATA;
3573
3574 typedef struct _DELETE_USN_JOURNAL_DATA {
3575 ULONGLONG UsnJournalID;
3576 ULONG DeleteFlags;
3577 } DELETE_USN_JOURNAL_DATA, *PDELETE_USN_JOURNAL_DATA;
3578
3579 #define USN_DELETE_FLAG_DELETE (0x00000001)
3580 #define USN_DELETE_FLAG_NOTIFY (0x00000002)
3581 #define USN_DELETE_VALID_FLAGS (0x00000003)
3582
3583 typedef struct _MARK_HANDLE_INFO {
3584 ULONG UsnSourceInfo;
3585 HANDLE VolumeHandle;
3586 ULONG HandleInfo;
3587 } MARK_HANDLE_INFO, *PMARK_HANDLE_INFO;
3588
3589 #if defined(_WIN64)
3590 typedef struct _MARK_HANDLE_INFO32 {
3591 ULONG UsnSourceInfo;
3592 UINT32 VolumeHandle;
3593 ULONG HandleInfo;
3594 } MARK_HANDLE_INFO32, *PMARK_HANDLE_INFO32;
3595 #endif
3596
3597 #define USN_SOURCE_DATA_MANAGEMENT (0x00000001)
3598 #define USN_SOURCE_AUXILIARY_DATA (0x00000002)
3599 #define USN_SOURCE_REPLICATION_MANAGEMENT (0x00000004)
3600
3601 #define MARK_HANDLE_PROTECT_CLUSTERS (0x00000001)
3602 #define MARK_HANDLE_TXF_SYSTEM_LOG (0x00000004)
3603 #define MARK_HANDLE_NOT_TXF_SYSTEM_LOG (0x00000008)
3604
3605 typedef struct _BULK_SECURITY_TEST_DATA {
3606 ACCESS_MASK DesiredAccess;
3607 ULONG SecurityIds[1];
3608 } BULK_SECURITY_TEST_DATA, *PBULK_SECURITY_TEST_DATA;
3609
3610 #define VOLUME_IS_DIRTY (0x00000001)
3611 #define VOLUME_UPGRADE_SCHEDULED (0x00000002)
3612 #define VOLUME_SESSION_OPEN (0x00000004)
3613
3614 typedef struct _FILE_PREFETCH {
3615 ULONG Type;
3616 ULONG Count;
3617 ULONGLONG Prefetch[1];
3618 } FILE_PREFETCH, *PFILE_PREFETCH;
3619
3620 typedef struct _FILE_PREFETCH_EX {
3621 ULONG Type;
3622 ULONG Count;
3623 PVOID Context;
3624 ULONGLONG Prefetch[1];
3625 } FILE_PREFETCH_EX, *PFILE_PREFETCH_EX;
3626
3627 #define FILE_PREFETCH_TYPE_FOR_CREATE 0x1
3628 #define FILE_PREFETCH_TYPE_FOR_DIRENUM 0x2
3629 #define FILE_PREFETCH_TYPE_FOR_CREATE_EX 0x3
3630 #define FILE_PREFETCH_TYPE_FOR_DIRENUM_EX 0x4
3631
3632 #define FILE_PREFETCH_TYPE_MAX 0x4
3633
3634 typedef struct _FILE_OBJECTID_BUFFER {
3635 UCHAR ObjectId[16];
3636 union {
3637 struct {
3638 UCHAR BirthVolumeId[16];
3639 UCHAR BirthObjectId[16];
3640 UCHAR DomainId[16];
3641 } DUMMYSTRUCTNAME;
3642 UCHAR ExtendedInfo[48];
3643 } DUMMYUNIONNAME;
3644 } FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
3645
3646 typedef struct _FILE_SET_SPARSE_BUFFER {
3647 BOOLEAN SetSparse;
3648 } FILE_SET_SPARSE_BUFFER, *PFILE_SET_SPARSE_BUFFER;
3649
3650 typedef struct _FILE_ZERO_DATA_INFORMATION {
3651 LARGE_INTEGER FileOffset;
3652 LARGE_INTEGER BeyondFinalZero;
3653 } FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
3654
3655 typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
3656 LARGE_INTEGER FileOffset;
3657 LARGE_INTEGER Length;
3658 } FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
3659
3660 typedef struct _ENCRYPTION_BUFFER {
3661 ULONG EncryptionOperation;
3662 UCHAR Private[1];
3663 } ENCRYPTION_BUFFER, *PENCRYPTION_BUFFER;
3664
3665 #define FILE_SET_ENCRYPTION 0x00000001
3666 #define FILE_CLEAR_ENCRYPTION 0x00000002
3667 #define STREAM_SET_ENCRYPTION 0x00000003
3668 #define STREAM_CLEAR_ENCRYPTION 0x00000004
3669
3670 #define MAXIMUM_ENCRYPTION_VALUE 0x00000004
3671
3672 typedef struct _DECRYPTION_STATUS_BUFFER {
3673 BOOLEAN NoEncryptedStreams;
3674 } DECRYPTION_STATUS_BUFFER, *PDECRYPTION_STATUS_BUFFER;
3675
3676 #define ENCRYPTION_FORMAT_DEFAULT (0x01)
3677
3678 #define COMPRESSION_FORMAT_SPARSE (0x4000)
3679
3680 typedef struct _REQUEST_RAW_ENCRYPTED_DATA {
3681 LONGLONG FileOffset;
3682 ULONG Length;
3683 } REQUEST_RAW_ENCRYPTED_DATA, *PREQUEST_RAW_ENCRYPTED_DATA;
3684
3685 typedef struct _ENCRYPTED_DATA_INFO {
3686 ULONGLONG StartingFileOffset;
3687 ULONG OutputBufferOffset;
3688 ULONG BytesWithinFileSize;
3689 ULONG BytesWithinValidDataLength;
3690 USHORT CompressionFormat;
3691 UCHAR DataUnitShift;
3692 UCHAR ChunkShift;
3693 UCHAR ClusterShift;
3694 UCHAR EncryptionFormat;
3695 USHORT NumberOfDataBlocks;
3696 ULONG DataBlockSize[ANYSIZE_ARRAY];
3697 } ENCRYPTED_DATA_INFO, *PENCRYPTED_DATA_INFO;
3698
3699 typedef struct _PLEX_READ_DATA_REQUEST {
3700 LARGE_INTEGER ByteOffset;
3701 ULONG ByteLength;
3702 ULONG PlexNumber;
3703 } PLEX_READ_DATA_REQUEST, *PPLEX_READ_DATA_REQUEST;
3704
3705 typedef struct _SI_COPYFILE {
3706 ULONG SourceFileNameLength;
3707 ULONG DestinationFileNameLength;
3708 ULONG Flags;
3709 WCHAR FileNameBuffer[1];
3710 } SI_COPYFILE, *PSI_COPYFILE;
3711
3712 #define COPYFILE_SIS_LINK 0x0001
3713 #define COPYFILE_SIS_REPLACE 0x0002
3714 #define COPYFILE_SIS_FLAGS 0x0003
3715
3716 #endif /* (_WIN32_WINNT >= 0x0500) */
3717
3718 #if (_WIN32_WINNT >= 0x0600)
3719
3720 typedef struct _FILE_MAKE_COMPATIBLE_BUFFER {
3721 BOOLEAN CloseDisc;
3722 } FILE_MAKE_COMPATIBLE_BUFFER, *PFILE_MAKE_COMPATIBLE_BUFFER;
3723
3724 typedef struct _FILE_SET_DEFECT_MGMT_BUFFER {
3725 BOOLEAN Disable;
3726 } FILE_SET_DEFECT_MGMT_BUFFER, *PFILE_SET_DEFECT_MGMT_BUFFER;
3727
3728 typedef struct _FILE_QUERY_SPARING_BUFFER {
3729 ULONG SparingUnitBytes;
3730 BOOLEAN SoftwareSparing;
3731 ULONG TotalSpareBlocks;
3732 ULONG FreeSpareBlocks;
3733 } FILE_QUERY_SPARING_BUFFER, *PFILE_QUERY_SPARING_BUFFER;
3734
3735 typedef struct _FILE_QUERY_ON_DISK_VOL_INFO_BUFFER {
3736 LARGE_INTEGER DirectoryCount;
3737 LARGE_INTEGER FileCount;
3738 USHORT FsFormatMajVersion;
3739 USHORT FsFormatMinVersion;
3740 WCHAR FsFormatName[12];
3741 LARGE_INTEGER FormatTime;
3742 LARGE_INTEGER LastUpdateTime;
3743 WCHAR CopyrightInfo[34];
3744 WCHAR AbstractInfo[34];
3745 WCHAR FormattingImplementationInfo[34];
3746 WCHAR LastModifyingImplementationInfo[34];
3747 } FILE_QUERY_ON_DISK_VOL_INFO_BUFFER, *PFILE_QUERY_ON_DISK_VOL_INFO_BUFFER;
3748
3749 #define SET_REPAIR_ENABLED (0x00000001)
3750 #define SET_REPAIR_VOLUME_BITMAP_SCAN (0x00000002)
3751 #define SET_REPAIR_DELETE_CROSSLINK (0x00000004)
3752 #define SET_REPAIR_WARN_ABOUT_DATA_LOSS (0x00000008)
3753 #define SET_REPAIR_DISABLED_AND_BUGCHECK_ON_CORRUPT (0x00000010)
3754 #define SET_REPAIR_VALID_MASK (0x0000001F)
3755
3756 typedef enum _SHRINK_VOLUME_REQUEST_TYPES {
3757 ShrinkPrepare = 1,
3758 ShrinkCommit,
3759 ShrinkAbort
3760 } SHRINK_VOLUME_REQUEST_TYPES, *PSHRINK_VOLUME_REQUEST_TYPES;
3761
3762 typedef struct _SHRINK_VOLUME_INFORMATION {
3763 SHRINK_VOLUME_REQUEST_TYPES ShrinkRequestType;
3764 ULONGLONG Flags;
3765 LONGLONG NewNumberOfSectors;
3766 } SHRINK_VOLUME_INFORMATION, *PSHRINK_VOLUME_INFORMATION;
3767
3768 #define TXFS_RM_FLAG_LOGGING_MODE 0x00000001
3769 #define TXFS_RM_FLAG_RENAME_RM 0x00000002
3770 #define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX 0x00000004
3771 #define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN 0x00000008
3772 #define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS 0x00000010
3773 #define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT 0x00000020
3774 #define TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE 0x00000040
3775 #define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX 0x00000080
3776 #define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN 0x00000100
3777 #define TXFS_RM_FLAG_GROW_LOG 0x00000400
3778 #define TXFS_RM_FLAG_SHRINK_LOG 0x00000800
3779 #define TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE 0x00001000
3780 #define TXFS_RM_FLAG_PRESERVE_CHANGES 0x00002000
3781 #define TXFS_RM_FLAG_RESET_RM_AT_NEXT_START 0x00004000
3782 #define TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START 0x00008000
3783 #define TXFS_RM_FLAG_PREFER_CONSISTENCY 0x00010000
3784 #define TXFS_RM_FLAG_PREFER_AVAILABILITY 0x00020000
3785
3786 #define TXFS_LOGGING_MODE_SIMPLE (0x0001)
3787 #define TXFS_LOGGING_MODE_FULL (0x0002)
3788
3789 #define TXFS_TRANSACTION_STATE_NONE 0x00
3790 #define TXFS_TRANSACTION_STATE_ACTIVE 0x01
3791 #define TXFS_TRANSACTION_STATE_PREPARED 0x02
3792 #define TXFS_TRANSACTION_STATE_NOTACTIVE 0x03
3793
3794 #define TXFS_MODIFY_RM_VALID_FLAGS \
3795 (TXFS_RM_FLAG_LOGGING_MODE | \
3796 TXFS_RM_FLAG_RENAME_RM | \
3797 TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX | \
3798 TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN | \
3799 TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \
3800 TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \
3801 TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE | \
3802 TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \
3803 TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN | \
3804 TXFS_RM_FLAG_SHRINK_LOG | \
3805 TXFS_RM_FLAG_GROW_LOG | \
3806 TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE | \
3807 TXFS_RM_FLAG_PRESERVE_CHANGES | \
3808 TXFS_RM_FLAG_RESET_RM_AT_NEXT_START | \
3809 TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START | \
3810 TXFS_RM_FLAG_PREFER_CONSISTENCY | \
3811 TXFS_RM_FLAG_PREFER_AVAILABILITY)
3812
3813 typedef struct _TXFS_MODIFY_RM {
3814 ULONG Flags;
3815 ULONG LogContainerCountMax;
3816 ULONG LogContainerCountMin;
3817 ULONG LogContainerCount;
3818 ULONG LogGrowthIncrement;
3819 ULONG LogAutoShrinkPercentage;
3820 ULONGLONG Reserved;
3821 USHORT LoggingMode;
3822 } TXFS_MODIFY_RM, *PTXFS_MODIFY_RM;
3823
3824 #define TXFS_RM_STATE_NOT_STARTED 0
3825 #define TXFS_RM_STATE_STARTING 1
3826 #define TXFS_RM_STATE_ACTIVE 2
3827 #define TXFS_RM_STATE_SHUTTING_DOWN 3
38