4938d30951c48e82a1a2f77d1c4c416b9875056f
[reactos.git] / reactos / include / ndk / umtypes.h
1 /*
2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/umtypes.h
4 * PURPOSE: Definitions needed for Native Headers if target is not Kernel-Mode.
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
6 * UPDATE HISTORY:
7 * Created 06/10/04
8 */
9
10 #ifndef _UMTYPES_H
11 #define _UMTYPES_H
12
13 /* DEPENDENCIES **************************************************************/
14 #include <winioctl.h>
15 #include <ntstatus.h>
16 #include <ddk/ntnls.h>
17 #define STATIC static
18
19 /* EXPORTED DATA *************************************************************/
20
21 /* CONSTANTS *****************************************************************/
22
23 /* NTAPI/NTOSAPI Define */
24 #define NTAPI __stdcall
25 #define NTOSAPI
26
27 /* Definitions for Object Creation -- winternl.h */
28 #define OBJ_INHERIT 2L
29 #define OBJ_PERMANENT 16L
30 #define OBJ_EXCLUSIVE 32L
31 #define OBJ_CASE_INSENSITIVE 64L
32 #define OBJ_OPENIF 128L
33 #define OBJ_OPENLINK 256L
34 #define OBJ_VALID_ATTRIBUTES 498L
35 #define InitializeObjectAttributes(p,n,a,r,s) { \
36 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
37 (p)->RootDirectory = (r); \
38 (p)->Attributes = (a); \
39 (p)->ObjectName = (n); \
40 (p)->SecurityDescriptor = (s); \
41 (p)->SecurityQualityOfService = NULL; \
42 }
43
44 /* Native API Return Value Macros */
45 #define NT_SUCCESS(x) ((x)>=0)
46 #define NT_WARNING(x) ((ULONG)(x)>>30==2)
47 #define NT_ERROR(x) ((ULONG)(x)>>30==3)
48
49 /* Object Access Rights FIXME: Some are in w32api's psdk..,is that normal ?*/
50 #define DIRECTORY_QUERY (0x0001)
51 #define DIRECTORY_TRAVERSE (0x0002)
52 #define DIRECTORY_CREATE_OBJECT (0x0004)
53 #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
54 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
55 #define EVENT_QUERY_STATE (0x0001)
56 #define SEMAPHORE_QUERY_STATE (0x0001)
57 #define SYMBOLIC_LINK_QUERY 0x0001
58 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
59
60 /* I/O Control Codes for communicating with Mailslots */
61 #define FSCTL_MAILSLOT_PEEK \
62 CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
63
64 /* I/O Control Codes for communicating with Pipes */
65 #define FSCTL_PIPE_ASSIGN_EVENT \
66 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
67
68 #define FSCTL_PIPE_DISCONNECT \
69 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
70
71 #define FSCTL_PIPE_LISTEN \
72 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
73
74 #define FSCTL_PIPE_PEEK \
75 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
76
77 #define FSCTL_PIPE_QUERY_EVENT \
78 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
79
80 #define FSCTL_PIPE_TRANSCEIVE \
81 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
82
83 #define FSCTL_PIPE_WAIT \
84 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
85
86 #define FSCTL_PIPE_IMPERSONATE \
87 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
88
89 #define FSCTL_PIPE_SET_CLIENT_PROCESS \
90 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
91
92 #define FSCTL_PIPE_QUERY_CLIENT_PROCESS \
93 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
94
95 #define FSCTL_PIPE_INTERNAL_READ \
96 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
97
98 #define FSCTL_PIPE_INTERNAL_WRITE \
99 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
100
101 #define FSCTL_PIPE_INTERNAL_TRANSCEIVE \
102 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
103
104 #define FSCTL_PIPE_INTERNAL_READ_OVFLOW \
105 CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
106
107 /* Kernel Shared Data Constants */
108 #define PROCESSOR_FEATURE_MAX 64
109 #define SharedUserData ((KUSER_SHARED_DATA * CONST) USER_SHARED_DATA)
110
111 /* Paging Values on x86 */
112 #define PAGE_SIZE 0x1000
113 #define PAGE_SHIFT 12L
114
115 /* Run-Time Library (RTL) Registry Constants */
116 #define RTL_REGISTRY_ABSOLUTE 0
117 #define RTL_REGISTRY_SERVICES 1
118 #define RTL_REGISTRY_CONTROL 2
119 #define RTL_REGISTRY_WINDOWS_NT 3
120 #define RTL_REGISTRY_DEVICEMAP 4
121 #define RTL_REGISTRY_USER 5
122 #define RTL_REGISTRY_MAXIMUM 6
123 #define RTL_REGISTRY_HANDLE 0x40000000
124 #define RTL_REGISTRY_OPTIONAL 0x80000000
125 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
126 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
127 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
128 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
129 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
130 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
131 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
132
133 /* File Result Flags */
134 #define FILE_SUPERSEDED 0x00000000
135 #define FILE_OPENED 0x00000001
136 #define FILE_CREATED 0x00000002
137 #define FILE_OVERWRITTEN 0x00000003
138 #define FILE_EXISTS 0x00000004
139 #define FILE_DOES_NOT_EXIST 0x00000005
140
141 /* Pipe Flags */
142 #define FILE_PIPE_BYTE_STREAM_MODE 0x00000000
143 #define FILE_PIPE_MESSAGE_MODE 0x00000001
144 #define FILE_PIPE_QUEUE_OPERATION 0x00000000
145 #define FILE_PIPE_COMPLETE_OPERATION 0x00000001
146 #define FILE_PIPE_INBOUND 0x00000000
147 #define FILE_PIPE_OUTBOUND 0x00000001
148 #define FILE_PIPE_FULL_DUPLEX 0x00000002
149 #define FILE_PIPE_CLIENT_END 0x00000000
150 #define FILE_PIPE_SERVER_END 0x00000001
151
152 /* Device Charactertics */
153 #define FILE_REMOVABLE_MEDIA 0x00000001
154 #define FILE_REMOTE_DEVICE 0x00000010
155
156 /* SID Constants */
157 #define SID_MAX_SUB_AUTHORITIES 15
158
159 /* Version Constants */
160 #define VER_MINORVERSION 0x0000001
161 #define VER_MAJORVERSION 0x0000002
162 #define VER_BUILDNUMBER 0x0000004
163 #define VER_PLATFORMID 0x0000008
164 #define VER_SERVICEPACKMINOR 0x0000010
165 #define VER_SERVICEPACKMAJOR 0x0000020
166 #define VER_SUITENAME 0x0000040
167 #define VER_PRODUCT_TYPE 0x0000080
168 #define VER_PLATFORM_WIN32s 0
169 #define VER_PLATFORM_WIN32_WINDOWS 1
170 #define VER_PLATFORM_WIN32_NT 2
171 #define VER_EQUAL 1
172 #define VER_GREATER 2
173 #define VER_GREATER_EQUAL 3
174 #define VER_LESS 4
175 #define VER_LESS_EQUAL 5
176 #define VER_AND 6
177 #define VER_OR 7
178 #define VER_CONDITION_MASK 7
179 #define VER_NUM_BITS_PER_CONDITION_MASK 3
180
181 /* RTL String Hash Algorithms */
182 #define HASH_STRING_ALGORITHM_DEFAULT 0
183 #define HASH_STRING_ALGORITHM_X65599 1
184 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
185
186 /* List Macros */
187 static __inline
188 VOID
189 InitializeListHead(
190 IN PLIST_ENTRY ListHead)
191 {
192 ListHead->Flink = ListHead->Blink = ListHead;
193 }
194
195 static __inline
196 VOID
197 InsertHeadList(
198 IN PLIST_ENTRY ListHead,
199 IN PLIST_ENTRY Entry)
200 {
201 PLIST_ENTRY OldFlink;
202 OldFlink = ListHead->Flink;
203 Entry->Flink = OldFlink;
204 Entry->Blink = ListHead;
205 OldFlink->Blink = Entry;
206 ListHead->Flink = Entry;
207 }
208
209 static __inline
210 VOID
211 InsertTailList(
212 IN PLIST_ENTRY ListHead,
213 IN PLIST_ENTRY Entry)
214 {
215 PLIST_ENTRY OldBlink;
216 OldBlink = ListHead->Blink;
217 Entry->Flink = ListHead;
218 Entry->Blink = OldBlink;
219 OldBlink->Flink = Entry;
220 ListHead->Blink = Entry;
221 }
222
223 #define IsListEmpty(ListHead) \
224 ((ListHead)->Flink == (ListHead))
225
226 #define PopEntryList(ListHead) \
227 (ListHead)->Next; \
228 { \
229 PSINGLE_LIST_ENTRY _FirstEntry; \
230 _FirstEntry = (ListHead)->Next; \
231 if (_FirstEntry != NULL) \
232 (ListHead)->Next = _FirstEntry->Next; \
233 }
234
235 #define PushEntryList(_ListHead, _Entry) \
236 (_Entry)->Next = (_ListHead)->Next; \
237 (_ListHead)->Next = (_Entry); \
238
239 static __inline
240 BOOLEAN
241 RemoveEntryList(
242 IN PLIST_ENTRY Entry)
243 {
244 PLIST_ENTRY OldFlink;
245 PLIST_ENTRY OldBlink;
246
247 OldFlink = Entry->Flink;
248 OldBlink = Entry->Blink;
249 OldFlink->Blink = OldBlink;
250 OldBlink->Flink = OldFlink;
251 return (OldFlink == OldBlink);
252 }
253
254 static __inline
255 PLIST_ENTRY
256 RemoveHeadList(
257 IN PLIST_ENTRY ListHead)
258 {
259 PLIST_ENTRY Flink;
260 PLIST_ENTRY Entry;
261
262 Entry = ListHead->Flink;
263 Flink = Entry->Flink;
264 ListHead->Flink = Flink;
265 Flink->Blink = ListHead;
266 return Entry;
267 }
268
269 static __inline
270 PLIST_ENTRY
271 RemoveTailList(
272 IN PLIST_ENTRY ListHead)
273 {
274 PLIST_ENTRY Blink;
275 PLIST_ENTRY Entry;
276
277 Entry = ListHead->Blink;
278 Blink = Entry->Blink;
279 ListHead->Blink = Blink;
280 Blink->Flink = ListHead;
281 return Entry;
282 }
283
284 #define IsFirstEntry(ListHead, Entry) \
285 ((ListHead)->Flink == Entry)
286
287 #define IsLastEntry(ListHead, Entry) \
288 ((ListHead)->Blink == Entry)
289
290 /*
291 * Constant String Macro
292 */
293 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
294 { \
295 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
296 sizeof(__SOURCE_STRING__), \
297 (__SOURCE_STRING__) \
298 }
299
300 /* ENUMERATIONS **************************************************************/
301
302 /* Kernel Shared Data Values */
303 typedef enum _NT_PRODUCT_TYPE
304 {
305 NtProductWinNt = 1,
306 NtProductLanManNt,
307 NtProductServer
308 } NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
309
310 typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE
311 {
312 StandardDesign,
313 NEC98x86,
314 EndAlternatives
315 } ALTERNATIVE_ARCHITECTURE_TYPE;
316
317 /* Run-Time Library (RTL) Enumerations */
318 typedef enum _TABLE_SEARCH_RESULT
319 {
320 TableEmptyTree,
321 TableFoundNode,
322 TableInsertAsLeft,
323 TableInsertAsRight
324 } TABLE_SEARCH_RESULT;
325
326 typedef enum _RTL_GENERIC_COMPARE_RESULTS
327 {
328 GenericLessThan,
329 GenericGreaterThan,
330 GenericEqual
331 } RTL_GENERIC_COMPARE_RESULTS;
332
333 /* Kernel or Native Enumerations used by Native API */
334 typedef enum _SECTION_INHERIT
335 {
336 ViewShare = 1,
337 ViewUnmap = 2
338 } SECTION_INHERIT;
339
340 typedef enum _POOL_TYPE
341 {
342 NonPagedPool,
343 PagedPool,
344 NonPagedPoolMustSucceed,
345 DontUseThisType,
346 NonPagedPoolCacheAligned,
347 PagedPoolCacheAligned,
348 NonPagedPoolCacheAlignedMustS,
349 MaxPoolType,
350 NonPagedPoolSession = 32,
351 PagedPoolSession,
352 NonPagedPoolMustSucceedSession,
353 DontUseThisTypeSession,
354 NonPagedPoolCacheAlignedSession,
355 PagedPoolCacheAlignedSession,
356 NonPagedPoolCacheAlignedMustSSession
357 } POOL_TYPE;
358
359 typedef enum _EVENT_TYPE
360 {
361 NotificationEvent,
362 SynchronizationEvent
363 } EVENT_TYPE;
364
365 typedef enum _TIMER_TYPE
366 {
367 NotificationTimer,
368 SynchronizationTimer
369 } TIMER_TYPE;
370
371 typedef enum _WAIT_TYPE
372 {
373 WaitAll,
374 WaitAny
375 } WAIT_TYPE;
376
377 typedef enum _INTERFACE_TYPE
378 {
379 InterfaceTypeUndefined = -1,
380 Internal,
381 Isa,
382 Eisa,
383 MicroChannel,
384 TurboChannel,
385 PCIBus,
386 VMEBus,
387 NuBus,
388 PCMCIABus,
389 CBus,
390 MPIBus,
391 MPSABus,
392 ProcessorInternal,
393 InternalPowerBus,
394 PNPISABus,
395 PNPBus,
396 MaximumInterfaceType
397 }INTERFACE_TYPE, *PINTERFACE_TYPE;
398
399 typedef enum _MODE
400 {
401 KernelMode,
402 UserMode,
403 MaximumMode
404 } MODE;
405
406 typedef enum _KWAIT_REASON
407 {
408 Executive,
409 FreePage,
410 PageIn,
411 PoolAllocation,
412 DelayExecution,
413 Suspended,
414 UserRequest,
415 WrExecutive,
416 WrFreePage,
417 WrPageIn,
418 WrPoolAllocation,
419 WrDelayExecution,
420 WrSuspended,
421 WrUserRequest,
422 WrEventPair,
423 WrQueue,
424 WrLpcReceive,
425 WrLpcReply,
426 WrVirtualMemory,
427 WrPageOut,
428 WrRendezvous,
429 Spare2,
430 WrGuardedMutex,
431 Spare4,
432 Spare5,
433 Spare6,
434 WrKernel,
435 WrResource,
436 WrPushLock,
437 WrMutex,
438 WrQuantumEnd,
439 WrDispatchInt,
440 WrPreempted,
441 WrYieldExecution,
442 MaximumWaitReason
443 } KWAIT_REASON;
444
445 typedef enum _KPROFILE_SOURCE
446 {
447 ProfileTime,
448 ProfileAlignmentFixup,
449 ProfileTotalIssues,
450 ProfilePipelineDry,
451 ProfileLoadInstructions,
452 ProfilePipelineFrozen,
453 ProfileBranchInstructions,
454 ProfileTotalNonissues,
455 ProfileDcacheMisses,
456 ProfileIcacheMisses,
457 ProfileCacheMisses,
458 ProfileBranchMispredictions,
459 ProfileStoreInstructions,
460 ProfileFpInstructions,
461 ProfileIntegerInstructions,
462 Profile2Issue,
463 Profile3Issue,
464 Profile4Issue,
465 ProfileSpecialInstructions,
466 ProfileTotalCycles,
467 ProfileIcacheIssues,
468 ProfileDcacheAccesses,
469 ProfileMemoryBarrierCycles,
470 ProfileLoadLinkedIssues,
471 ProfileMaximum
472 } KPROFILE_SOURCE;
473
474 /**** Information Classes ****/
475
476 /*
477 * File
478 */
479 typedef enum _FILE_INFORMATION_CLASS
480 {
481 FileDirectoryInformation = 1,
482 FileFullDirectoryInformation,
483 FileBothDirectoryInformation,
484 FileBasicInformation,
485 FileStandardInformation,
486 FileInternalInformation,
487 FileEaInformation,
488 FileAccessInformation,
489 FileNameInformation,
490 FileRenameInformation,
491 FileLinkInformation,
492 FileNamesInformation,
493 FileDispositionInformation,
494 FilePositionInformation,
495 FileFullEaInformation,
496 FileModeInformation,
497 FileAlignmentInformation,
498 FileAllInformation,
499 FileAllocationInformation,
500 FileEndOfFileInformation,
501 FileAlternateNameInformation,
502 FileStreamInformation,
503 FilePipeInformation,
504 FilePipeLocalInformation,
505 FilePipeRemoteInformation,
506 FileMailslotQueryInformation,
507 FileMailslotSetInformation,
508 FileCompressionInformation,
509 FileObjectIdInformation,
510 FileCompletionInformation,
511 FileMoveClusterInformation,
512 FileQuotaInformation,
513 FileReparsePointInformation,
514 FileNetworkOpenInformation,
515 FileAttributeTagInformation,
516 FileTrackingInformation,
517 FileIdBothDirectoryInformation,
518 FileIdFullDirectoryInformation,
519 FileValidDataLengthInformation,
520 FileShortNameInformation,
521 FileMaximumInformation
522 } FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
523
524 /*
525 * File System
526 */
527 typedef enum _FSINFOCLASS
528 {
529 FileFsVolumeInformation = 1,
530 FileFsLabelInformation,
531 FileFsSizeInformation,
532 FileFsDeviceInformation,
533 FileFsAttributeInformation,
534 FileFsControlInformation,
535 FileFsFullSizeInformation,
536 FileFsObjectIdInformation,
537 FileFsDriverPathInformation,
538 FileFsMaximumInformation
539 } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
540
541 /*
542 * Registry Key
543 */
544 typedef enum _KEY_INFORMATION_CLASS
545 {
546 KeyBasicInformation,
547 KeyNodeInformation,
548 KeyFullInformation,
549 KeyNameInformation,
550 KeyCachedInformation,
551 KeyFlagsInformation
552 } KEY_INFORMATION_CLASS;
553
554 /*
555 * Registry Key Value
556 */
557 typedef enum _KEY_VALUE_INFORMATION_CLASS
558 {
559 KeyValueBasicInformation,
560 KeyValueFullInformation,
561 KeyValuePartialInformation,
562 KeyValueFullInformationAlign64,
563 KeyValuePartialInformationAlign64
564 } KEY_VALUE_INFORMATION_CLASS;
565
566 /*
567 * Registry Key Set
568 */
569 typedef enum _KEY_SET_INFORMATION_CLASS
570 {
571 KeyWriteTimeInformation,
572 KeyUserFlagsInformation,
573 MaxKeySetInfoClass
574 } KEY_SET_INFORMATION_CLASS;
575
576 /*
577 * Process
578 */
579 typedef enum _PROCESSINFOCLASS
580 {
581 ProcessBasicInformation,
582 ProcessQuotaLimits,
583 ProcessIoCounters,
584 ProcessVmCounters,
585 ProcessTimes,
586 ProcessBasePriority,
587 ProcessRaisePriority,
588 ProcessDebugPort,
589 ProcessExceptionPort,
590 ProcessAccessToken,
591 ProcessLdtInformation,
592 ProcessLdtSize,
593 ProcessDefaultHardErrorMode,
594 ProcessIoPortHandlers,
595 ProcessPooledUsageAndLimits,
596 ProcessWorkingSetWatch,
597 ProcessUserModeIOPL,
598 ProcessEnableAlignmentFaultFixup,
599 ProcessPriorityClass,
600 ProcessWx86Information,
601 ProcessHandleCount,
602 ProcessAffinityMask,
603 ProcessPriorityBoost,
604 ProcessDeviceMap,
605 ProcessSessionInformation,
606 ProcessForegroundInformation,
607 ProcessWow64Information,
608 ProcessImageFileName,
609 ProcessLUIDDeviceMapsEnabled,
610 ProcessBreakOnTermination,
611 ProcessDebugObjectHandle,
612 ProcessDebugFlags,
613 ProcessHandleTracing,
614 MaxProcessInfoClass
615 } PROCESSINFOCLASS;
616
617 /*
618 * Thread
619 */
620 typedef enum _THREADINFOCLASS
621 {
622 ThreadBasicInformation,
623 ThreadTimes,
624 ThreadPriority,
625 ThreadBasePriority,
626 ThreadAffinityMask,
627 ThreadImpersonationToken,
628 ThreadDescriptorTableEntry,
629 ThreadEnableAlignmentFaultFixup,
630 ThreadEventPair_Reusable,
631 ThreadQuerySetWin32StartAddress,
632 ThreadZeroTlsCell,
633 ThreadPerformanceCount,
634 ThreadAmILastThread,
635 ThreadIdealProcessor,
636 ThreadPriorityBoost,
637 ThreadSetTlsArrayAddress,
638 ThreadIsIoPending,
639 ThreadHideFromDebugger,
640 ThreadBreakOnTermination,
641 MaxThreadInfoClass
642 } THREADINFOCLASS;
643
644 /* TYPES *********************************************************************/
645
646 /* Basic Types that aren't defined in User-Mode Headers */
647 typedef CONST int CINT;
648 typedef CONST char *PCSZ;
649 typedef short CSHORT;
650 typedef CSHORT *PCSHORT;
651 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
652
653 /* Kernel Types used by Native APIs */
654 typedef LONG KPRIORITY;
655 typedef LONG NTSTATUS, *PNTSTATUS;
656 typedef UCHAR KIRQL, *PKIRQL;
657 typedef ULONG KAFFINITY, *PKAFFINITY;
658 typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
659 typedef struct _PEB *PPEB;
660 typedef ULONG KPROCESSOR_MODE;
661 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
662 struct _ETHREAD;
663 struct _CSR_API_MESSAGE;
664 typedef ULONG EXECUTION_STATE;
665
666 /* Basic NT Types */
667 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
668 typedef struct _UNICODE_STRING
669 {
670 USHORT Length;
671 USHORT MaximumLength;
672 PWSTR Buffer;
673 } UNICODE_STRING, *PUNICODE_STRING;
674 typedef const UNICODE_STRING* PCUNICODE_STRING;
675
676 typedef struct _STRING
677 {
678 USHORT Length;
679 USHORT MaximumLength;
680 PCHAR Buffer;
681 } STRING, *PSTRING;
682
683 typedef struct _OBJECT_ATTRIBUTES
684 {
685 ULONG Length;
686 HANDLE RootDirectory;
687 PUNICODE_STRING ObjectName;
688 ULONG Attributes;
689 PVOID SecurityDescriptor;
690 PVOID SecurityQualityOfService;
691 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
692 #endif
693
694 typedef STRING ANSI_STRING;
695 typedef PSTRING PANSI_STRING;
696 typedef STRING OEM_STRING;
697 typedef PSTRING POEM_STRING;
698
699 typedef struct _IO_STATUS_BLOCK
700 {
701 union
702 {
703 NTSTATUS Status;
704 PVOID Pointer;
705 };
706 ULONG_PTR Information;
707 } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
708
709 typedef VOID NTAPI
710 (*PIO_APC_ROUTINE)(
711 IN PVOID ApcContext,
712 IN PIO_STATUS_BLOCK IoStatusBlock,
713 IN ULONG Reserved);
714
715 typedef VOID NTAPI
716 (*PKNORMAL_ROUTINE)(
717 IN PVOID NormalContext,
718 IN PVOID SystemArgument1,
719 IN PVOID SystemArgument2);
720
721 typedef VOID NTAPI
722 (*PTIMER_APC_ROUTINE)(
723 IN PVOID TimerContext,
724 IN ULONG TimerLowValue,
725 IN LONG TimerHighValue);
726
727 /* Kernel Types which are returned or used by Native API */
728 typedef struct _OBJECT_NAME_INFORMATION
729 {
730 UNICODE_STRING Name;
731 } OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;
732
733 typedef struct _CLIENT_ID
734 {
735 HANDLE UniqueProcess;
736 HANDLE UniqueThread;
737 } CLIENT_ID, *PCLIENT_ID;
738
739 typedef struct _KSYSTEM_TIME
740 {
741 ULONG LowPart;
742 LONG High1Time;
743 LONG High2Time;
744 } KSYSTEM_TIME, *PKSYSTEM_TIME;
745
746 typedef struct _TIME_FIELDS
747 {
748 CSHORT Year;
749 CSHORT Month;
750 CSHORT Day;
751 CSHORT Hour;
752 CSHORT Minute;
753 CSHORT Second;
754 CSHORT Milliseconds;
755 CSHORT Weekday;
756 } TIME_FIELDS, *PTIME_FIELDS;
757
758 typedef struct _VM_COUNTERS
759 {
760 SIZE_T PeakVirtualSize;
761 SIZE_T VirtualSize;
762 ULONG PageFaultCount;
763 SIZE_T PeakWorkingSetSize;
764 SIZE_T WorkingSetSize;
765 SIZE_T QuotaPeakPagedPoolUsage;
766 SIZE_T QuotaPagedPoolUsage;
767 SIZE_T QuotaPeakNonPagedPoolUsage;
768 SIZE_T QuotaNonPagedPoolUsage;
769 SIZE_T PagefileUsage;
770 SIZE_T PeakPagefileUsage;
771 } VM_COUNTERS, *PVM_COUNTERS;
772
773 typedef struct _VM_COUNTERS_EX
774 {
775 SIZE_T PeakVirtualSize;
776 SIZE_T VirtualSize;
777 ULONG PageFaultCount;
778 SIZE_T PeakWorkingSetSize;
779 SIZE_T WorkingSetSize;
780 SIZE_T QuotaPeakPagedPoolUsage;
781 SIZE_T QuotaPagedPoolUsage;
782 SIZE_T QuotaPeakNonPagedPoolUsage;
783 SIZE_T QuotaNonPagedPoolUsage;
784 SIZE_T PagefileUsage;
785 SIZE_T PeakPagefileUsage;
786 SIZE_T PrivateUsage;
787 } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
788
789 /**** Information Types ****/
790
791 /*
792 * Registry Key Set
793 */
794
795 /* Class 0 */
796 typedef struct _KEY_WRITE_TIME_INFORMATION
797 {
798 LARGE_INTEGER LastWriteTime;
799 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
800
801 /* Class 1 */
802 typedef struct _KEY_USER_FLAGS_INFORMATION
803 {
804 ULONG UserFlags;
805 } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
806
807 typedef struct _KEY_FULL_INFORMATION
808 {
809 LARGE_INTEGER LastWriteTime;
810 ULONG TitleIndex;
811 ULONG ClassOffset;
812 ULONG ClassLength;
813 ULONG SubKeys;
814 ULONG MaxNameLen;
815 ULONG MaxClassLen;
816 ULONG Values;
817 ULONG MaxValueNameLen;
818 ULONG MaxValueDataLen;
819 WCHAR Class[1];
820 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
821
822 typedef struct _KEY_NODE_INFORMATION
823 {
824 LARGE_INTEGER LastWriteTime;
825 ULONG TitleIndex;
826 ULONG ClassOffset;
827 ULONG ClassLength;
828 ULONG NameLength;
829 WCHAR Name[1];
830 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
831
832 /*
833 * File
834 */
835
836 /* Class 1 */
837 typedef struct _FILE_BASIC_INFORMATION
838 {
839 LARGE_INTEGER CreationTime;
840 LARGE_INTEGER LastAccessTime;
841 LARGE_INTEGER LastWriteTime;
842 LARGE_INTEGER ChangeTime;
843 ULONG FileAttributes;
844 } FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
845
846 /* Class 2 */
847 typedef struct _FILE_STANDARD_INFORMATION
848 {
849 LARGE_INTEGER AllocationSize;
850 LARGE_INTEGER EndOfFile;
851 ULONG NumberOfLinks;
852 BOOLEAN DeletePending;
853 BOOLEAN Directory;
854 } FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
855
856 typedef struct _FILE_NETWORK_OPEN_INFORMATION
857 {
858 LARGE_INTEGER CreationTime;
859 LARGE_INTEGER LastAccessTime;
860 LARGE_INTEGER LastWriteTime;
861 LARGE_INTEGER ChangeTime;
862 LARGE_INTEGER AllocationSize;
863 LARGE_INTEGER EndOfFile;
864 ULONG FileAttributes;
865 } FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
866
867 typedef struct _FILE_ZERO_DATA_INFORMATION
868 {
869 LARGE_INTEGER FileOffset;
870 LARGE_INTEGER BeyondFinalZero;
871 } FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
872
873 typedef struct _FILE_EA_INFORMATION
874 {
875 ULONG EaSize;
876 } FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
877
878 typedef struct _FILE_COMPRESSION_INFORMATION
879 {
880 LARGE_INTEGER CompressedFileSize;
881 USHORT CompressionFormat;
882 UCHAR CompressionUnitShift;
883 UCHAR ChunkShift;
884 UCHAR ClusterShift;
885 UCHAR Reserved[3];
886 } FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
887
888 typedef struct _FILE_POSITION_INFORMATION
889 {
890 LARGE_INTEGER CurrentByteOffset;
891 } FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;
892
893 typedef struct _FILE_DISPOSITION_INFORMATION
894 {
895 BOOLEAN DeleteFile;
896 } FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
897
898 typedef struct FILE_ALLOCATED_RANGE_BUFFER
899 {
900 LARGE_INTEGER FileOffset;
901 LARGE_INTEGER Length;
902 } FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
903
904 typedef struct _FILE_FULL_EA_INFORMATION
905 {
906 ULONG NextEntryOffset;
907 UCHAR Flags;
908 UCHAR EaNameLength;
909 USHORT EaValueLength;
910 CHAR EaName[1];
911 } FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
912
913 typedef struct _FILE_QUOTA_INFORMATION
914 {
915 ULONG NextEntryOffset;
916 ULONG SidLength;
917 LARGE_INTEGER ChangeTime;
918 LARGE_INTEGER QuotaUsed;
919 LARGE_INTEGER QuotaThreshold;
920 LARGE_INTEGER QuotaLimit;
921 SID Sid;
922 } FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
923
924 typedef struct _FILE_INTERNAL_INFORMATION
925 {
926 LARGE_INTEGER IndexNumber;
927 } FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
928
929 typedef struct _FILE_RENAME_INFORMATION
930 {
931 BOOLEAN ReplaceIfExists;
932 HANDLE RootDirectory;
933 ULONG FileNameLength;
934 WCHAR FileName[1];
935 } FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
936
937 typedef struct _FILE_PIPE_INFORMATION
938 {
939 ULONG ReadMode;
940 ULONG CompletionMode;
941 } FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
942
943 typedef struct _FILE_PIPE_LOCAL_INFORMATION
944 {
945 ULONG NamedPipeType;
946 ULONG NamedPipeConfiguration;
947 ULONG MaximumInstances;
948 ULONG CurrentInstances;
949 ULONG InboundQuota;
950 ULONG ReadDataAvailable;
951 ULONG OutboundQuota;
952 ULONG WriteQuotaAvailable;
953 ULONG NamedPipeState;
954 ULONG NamedPipeEnd;
955 } FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
956
957 typedef struct _FILE_PIPE_REMOTE_INFORMATION
958 {
959 LARGE_INTEGER CollectDataTime;
960 ULONG MaximumCollectionCount;
961 } FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
962
963 typedef struct _FILE_MAILSLOT_QUERY_INFORMATION
964 {
965 ULONG MaximumMessageSize;
966 ULONG MailslotQuota;
967 ULONG NextMessageSize;
968 ULONG MessagesAvailable;
969 LARGE_INTEGER ReadTimeout;
970 } FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
971
972 typedef struct _FILE_MAILSLOT_SET_INFORMATION
973 {
974 LARGE_INTEGER ReadTimeout;
975 } FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
976
977 typedef struct _FILE_BOTH_DIR_INFORMATION
978 {
979 ULONG NextEntryOffset;
980 ULONG FileIndex;
981 LARGE_INTEGER CreationTime;
982 LARGE_INTEGER LastAccessTime;
983 LARGE_INTEGER LastWriteTime;
984 LARGE_INTEGER ChangeTime;
985 LARGE_INTEGER EndOfFile;
986 LARGE_INTEGER AllocationSize;
987 ULONG FileAttributes;
988 ULONG FileNameLength;
989 ULONG EaSize;
990 CCHAR ShortNameLength;
991 WCHAR ShortName[12];
992 WCHAR FileName[1];
993 } FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
994
995 typedef struct _FILE_COMPLETION_INFORMATION
996 {
997 HANDLE Port;
998 PVOID Key;
999 } FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
1000
1001 typedef struct _FILE_LINK_INFORMATION
1002 {
1003 BOOLEAN ReplaceIfExists;
1004 HANDLE RootDirectory;
1005 ULONG FileNameLength;
1006 WCHAR FileName[1];
1007 } FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
1008
1009 typedef struct _FILE_NAME_INFORMATION
1010 {
1011 ULONG FileNameLength;
1012 WCHAR FileName[1];
1013 } FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
1014
1015 typedef struct _FILE_ALLOCATION_INFORMATION
1016 {
1017 LARGE_INTEGER AllocationSize;
1018 } FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
1019
1020 typedef struct _FILE_END_OF_FILE_INFORMATION
1021 {
1022 LARGE_INTEGER EndOfFile;
1023 } FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
1024
1025 typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
1026 {
1027 LARGE_INTEGER ValidDataLength;
1028 } FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
1029
1030 /*
1031 * File System
1032 */
1033 typedef struct _FILE_FS_DEVICE_INFORMATION
1034 {
1035 DEVICE_TYPE DeviceType;
1036 ULONG Characteristics;
1037 } FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
1038
1039 typedef struct _FILE_FS_ATTRIBUTE_INFORMATION
1040 {
1041 ULONG FileSystemAttributes;
1042 ULONG MaximumComponentNameLength;
1043 ULONG FileSystemNameLength;
1044 WCHAR FileSystemName[1];
1045 } FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
1046
1047 typedef struct _FILE_FS_SIZE_INFORMATION
1048 {
1049 LARGE_INTEGER TotalAllocationUnits;
1050 LARGE_INTEGER AvailableAllocationUnits;
1051 ULONG SectorsPerAllocationUnit;
1052 ULONG BytesPerSector;
1053 } FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
1054
1055 typedef struct _FILE_FS_LABEL_INFORMATION
1056 {
1057 ULONG VolumeLabelLength;
1058 WCHAR VolumeLabel[1];
1059 } FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
1060
1061 typedef struct _FILE_FS_VOLUME_INFORMATION
1062 {
1063 LARGE_INTEGER VolumeCreationTime;
1064 ULONG VolumeSerialNumber;
1065 ULONG VolumeLabelLength;
1066 BOOLEAN SupportsObjects;
1067 WCHAR VolumeLabel[1];
1068 } FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
1069
1070 /*
1071 * Registry Key Value
1072 */
1073
1074 /* Class 0 */
1075 typedef struct _KEY_VALUE_ENTRY
1076 {
1077 PUNICODE_STRING ValueName;
1078 ULONG DataLength;
1079 ULONG DataOffset;
1080 ULONG Type;
1081 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
1082
1083 /* Class 1 */
1084 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
1085 {
1086 ULONG TitleIndex;
1087 ULONG Type;
1088 ULONG DataLength;
1089 UCHAR Data[1];
1090 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
1091
1092 /* Class 2 */
1093 typedef struct _KEY_VALUE_BASIC_INFORMATION
1094 {
1095 ULONG TitleIndex;
1096 ULONG Type;
1097 ULONG NameLength;
1098 WCHAR Name[1];
1099 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
1100
1101 /* Class 3 */
1102 typedef struct _KEY_VALUE_FULL_INFORMATION
1103 {
1104 ULONG TitleIndex;
1105 ULONG Type;
1106 ULONG DataOffset;
1107 ULONG DataLength;
1108 ULONG NameLength;
1109 WCHAR Name[1];
1110 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
1111
1112 /*
1113 * Registry Key
1114 */
1115
1116 /* Class 0 */
1117 typedef struct _KEY_BASIC_INFORMATION
1118 {
1119 LARGE_INTEGER LastWriteTime;
1120 ULONG TitleIndex;
1121 ULONG NameLength;
1122 WCHAR Name[1];
1123 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
1124
1125 /* File Pipe Structures for the FSCTLs */
1126 typedef struct _FILE_PIPE_WAIT_FOR_BUFFER
1127 {
1128 LARGE_INTEGER Timeout;
1129 ULONG NameLength;
1130 BOOLEAN TimeoutSpecified;
1131 WCHAR Name[1];
1132 } FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
1133
1134 typedef struct _FILE_PIPE_PEEK_BUFFER
1135 {
1136 ULONG NamedPipeState;
1137 ULONG ReadDataAvailable;
1138 ULONG NumberOfMessages;
1139 ULONG MessageLength;
1140 CHAR Data[1];
1141 } FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER;
1142
1143 /* The Kerner/User Shared Data Structure */
1144 typedef struct _KUSER_SHARED_DATA
1145 {
1146 ULONG TickCountLowDeprecated;
1147 ULONG TickCountMultiplier;
1148 volatile KSYSTEM_TIME InterruptTime;
1149 volatile KSYSTEM_TIME SystemTime;
1150 volatile KSYSTEM_TIME TimeZoneBias;
1151 USHORT ImageNumberLow;
1152 USHORT ImageNumberHigh;
1153 WCHAR NtSystemRoot[260];
1154 ULONG MaxStackTraceDepth;
1155 ULONG CryptoExponent;
1156 ULONG TimeZoneId;
1157 ULONG LargePageMinimum;
1158 ULONG Reserved2[7];
1159 NT_PRODUCT_TYPE NtProductType;
1160 BOOLEAN ProductTypeIsValid;
1161 ULONG NtMajorVersion;
1162 ULONG NtMinorVersion;
1163 BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
1164 ULONG Reserved1;
1165 ULONG Reserved3;
1166 volatile ULONG TimeSlip;
1167 ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
1168 LARGE_INTEGER SystemExpirationDate;
1169 ULONG SuiteMask;
1170 BOOLEAN KdDebuggerEnabled;
1171 volatile ULONG ActiveConsoleId;
1172 volatile ULONG DismountCount;
1173 ULONG ComPlusPackage;
1174 ULONG LastSystemRITEventTickCount;
1175 ULONG NumberOfPhysicalPages;
1176 BOOLEAN SafeBootMode;
1177 ULONG TraceLogging;
1178 ULONGLONG Fill0;
1179 ULONGLONG SystemCall[4];
1180 union {
1181 volatile KSYSTEM_TIME TickCount;
1182 volatile ULONG64 TickCountQuad;
1183 };
1184 } KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
1185
1186 /* Run-Time Library (RTL) Types */
1187 typedef struct _RTL_BITMAP
1188 {
1189 ULONG SizeOfBitMap;
1190 PULONG Buffer;
1191 } RTL_BITMAP, *PRTL_BITMAP;
1192
1193 typedef struct _RTL_BITMAP_RUN
1194 {
1195 ULONG StartingIndex;
1196 ULONG NumberOfBits;
1197 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
1198
1199 typedef struct _COMPRESSED_DATA_INFO
1200 {
1201 USHORT CompressionFormatAndEngine;
1202 UCHAR CompressionUnitShift;
1203 UCHAR ChunkShift;
1204 UCHAR ClusterShift;
1205 UCHAR Reserved;
1206 USHORT NumberOfChunks;
1207 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
1208 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
1209
1210 typedef struct _GENERATE_NAME_CONTEXT
1211 {
1212 USHORT Checksum;
1213 BOOLEAN CheckSumInserted;
1214 UCHAR NameLength;
1215 WCHAR NameBuffer[8];
1216 ULONG ExtensionLength;
1217 WCHAR ExtensionBuffer[4];
1218 ULONG LastIndexValue;
1219 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
1220
1221 typedef struct _RTL_SPLAY_LINKS
1222 {
1223 struct _RTL_SPLAY_LINKS *Parent;
1224 struct _RTL_SPLAY_LINKS *LeftChild;
1225 struct _RTL_SPLAY_LINKS *RightChild;
1226 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
1227
1228 struct _RTL_AVL_TABLE;
1229 struct _RTL_GENERIC_TABLE;
1230
1231 typedef NTSTATUS STDCALL
1232 (*PRTL_AVL_MATCH_FUNCTION)(
1233 struct _RTL_AVL_TABLE *Table,
1234 PVOID UserData,
1235 PVOID MatchData
1236 );
1237
1238 typedef RTL_GENERIC_COMPARE_RESULTS STDCALL
1239 (*PRTL_AVL_COMPARE_ROUTINE) (
1240 struct _RTL_AVL_TABLE *Table,
1241 PVOID FirstStruct,
1242 PVOID SecondStruct
1243 );
1244
1245 typedef RTL_GENERIC_COMPARE_RESULTS STDCALL
1246 (*PRTL_GENERIC_COMPARE_ROUTINE) (
1247 struct _RTL_GENERIC_TABLE *Table,
1248 PVOID FirstStruct,
1249 PVOID SecondStruct
1250 );
1251
1252 typedef PVOID STDCALL
1253 (*PRTL_GENERIC_ALLOCATE_ROUTINE) (
1254 struct _RTL_GENERIC_TABLE *Table,
1255 LONG ByteSize
1256 );
1257
1258 typedef VOID STDCALL
1259 (*PRTL_GENERIC_FREE_ROUTINE) (
1260 struct _RTL_GENERIC_TABLE *Table,
1261 PVOID Buffer
1262 );
1263
1264 typedef VOID STDCALL
1265 (*PRTL_AVL_ALLOCATE_ROUTINE) (
1266 struct _RTL_AVL_TABLE *Table,
1267 LONG ByteSize
1268 );
1269
1270 typedef VOID STDCALL
1271 (*PRTL_AVL_FREE_ROUTINE) (
1272 struct _RTL_AVL_TABLE *Table,
1273 PVOID Buffer
1274 );
1275
1276 typedef struct _RTL_GENERIC_TABLE
1277 {
1278 PRTL_SPLAY_LINKS TableRoot;
1279 LIST_ENTRY InsertOrderList;
1280 PLIST_ENTRY OrderedPointer;
1281 ULONG WhichOrderedElement;
1282 ULONG NumberGenericTableElements;
1283 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
1284 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
1285 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
1286 PVOID TableContext;
1287 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
1288
1289 typedef struct _RTL_BALANCED_LINKS
1290 {
1291 struct _RTL_BALANCED_LINKS *Parent;
1292 struct _RTL_BALANCED_LINKS *LeftChild;
1293 struct _RTL_BALANCED_LINKS *RightChild;
1294 CHAR Balance;
1295 UCHAR Reserved[3];
1296 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
1297
1298 typedef struct _RTL_AVL_TABLE
1299 {
1300 RTL_BALANCED_LINKS BalancedRoot;
1301 PVOID OrderedPointer;
1302 ULONG WhichOrderedElement;
1303 ULONG NumberGenericTableElements;
1304 ULONG DepthOfTree;
1305 PRTL_BALANCED_LINKS RestartKey;
1306 ULONG DeleteCount;
1307 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
1308 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
1309 PRTL_AVL_FREE_ROUTINE FreeRoutine;
1310 PVOID TableContext;
1311 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
1312
1313 typedef NTSTATUS STDCALL
1314 (*PRTL_QUERY_REGISTRY_ROUTINE)(
1315 IN PWSTR ValueName,
1316 IN ULONG ValueType,
1317 IN PVOID ValueData,
1318 IN ULONG ValueLength,
1319 IN PVOID Context,
1320 IN PVOID EntryContext
1321 );
1322
1323 typedef struct _RTL_QUERY_REGISTRY_TABLE
1324 {
1325 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
1326 ULONG Flags;
1327 PWSTR Name;
1328 PVOID EntryContext;
1329 ULONG DefaultType;
1330 PVOID DefaultData;
1331 ULONG DefaultLength;
1332 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
1333
1334 typedef struct _UNICODE_PREFIX_TABLE_ENTRY
1335 {
1336 CSHORT NodeTypeCode;
1337 CSHORT NameLength;
1338 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
1339 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
1340 RTL_SPLAY_LINKS Links;
1341 PUNICODE_STRING Prefix;
1342 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
1343
1344 typedef struct _UNICODE_PREFIX_TABLE
1345 {
1346 CSHORT NodeTypeCode;
1347 CSHORT NameLength;
1348 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
1349 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
1350 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
1351
1352 typedef OSVERSIONINFOW RTL_OSVERSIONINFOW;
1353 typedef LPOSVERSIONINFOW PRTL_OSVERSIONINFOW;
1354 typedef OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
1355 typedef LPOSVERSIONINFOEXW PRTL_OSVERSIONINFOEXW;
1356
1357 #endif