d40195be549871271c68745f877d10b103b8f316
[reactos.git] / reactos / include / ndk / rtltypes.h
1 /*
2 * PROJECT: ReactOS Native Headers
3 * FILE: include/ndk/rtltypes.h
4 * PURPOSE: Defintions for Runtime Library Types not defined in DDK/IFS
5 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
6 * UPDATE HISTORY:
7 * Created 06/10/04
8 */
9 #ifndef _RTLTYPES_H
10 #define _RTLTYPES_H
11
12 /* DEPENDENCIES **************************************************************/
13 #include "excpt.h"
14
15 /* CONSTANTS *****************************************************************/
16 #define MAXIMUM_LEADBYTES 12
17
18 #define PPF_NORMALIZED 0x01
19 #define PPF_PROFILE_USER 0x02
20 #define PPF_PROFILE_SERVER 0x04
21 #define PPF_PROFILE_KERNEL 0x08
22
23 #define PPF_RESERVE_1MB 0x20
24 #define PPF_DISABLE_HEAP_CHECKS 0x100
25 #define PPF_PROCESS_OR_1 0x200
26 #define PPF_PROCESS_OR_2 0x400
27
28 #define PEB_BASE (0x7FFDF000)
29
30 #define EXCEPTION_CONTINUE_SEARCH 0
31 #define EXCEPTION_EXECUTE_HANDLER 1
32
33 #define EXCEPTION_UNWINDING 0x02
34 #define EXCEPTION_EXIT_UNWIND 0x04
35 #define EXCEPTION_STACK_INVALID 0x8
36 #define EXCEPTION_NESTED_CALL 0x10
37 #define EXCEPTION_TARGET_UNWIND 0x20
38 #define EXCEPTION_COLLIDED_UNWIND 0x20
39
40 #define EH_NONCONTINUABLE 0x01
41 #define EH_UNWINDING 0x02
42 #define EH_EXIT_UNWIND 0x04
43 #define EH_STACK_INVALID 0x08
44 #define EH_NESTED_CALL 0x10
45
46 #define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
47 #define RTL_RANGE_LIST_ADD_SHARED 0x00000002
48
49 #define RTL_RANGE_SHARED 0x01
50 #define RTL_RANGE_CONFLICT 0x02
51
52 /* Run-Time Library (RTL) Registry Constants */
53 #define RTL_REGISTRY_ABSOLUTE 0
54 #define RTL_REGISTRY_SERVICES 1
55 #define RTL_REGISTRY_CONTROL 2
56 #define RTL_REGISTRY_WINDOWS_NT 3
57 #define RTL_REGISTRY_DEVICEMAP 4
58 #define RTL_REGISTRY_USER 5
59 #define RTL_REGISTRY_MAXIMUM 6
60 #define RTL_REGISTRY_HANDLE 0x40000000
61 #define RTL_REGISTRY_OPTIONAL 0x80000000
62 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
63 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
64 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
65 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
66 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
67 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
68 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
69
70 /* Version Constants */
71 #define VER_MINORVERSION 0x0000001
72 #define VER_MAJORVERSION 0x0000002
73 #define VER_BUILDNUMBER 0x0000004
74 #define VER_PLATFORMID 0x0000008
75 #define VER_SERVICEPACKMINOR 0x0000010
76 #define VER_SERVICEPACKMAJOR 0x0000020
77 #define VER_SUITENAME 0x0000040
78 #define VER_PRODUCT_TYPE 0x0000080
79 #define VER_PLATFORM_WIN32s 0
80 #define VER_PLATFORM_WIN32_WINDOWS 1
81 #define VER_PLATFORM_WIN32_NT 2
82 #define VER_EQUAL 1
83 #define VER_GREATER 2
84 #define VER_GREATER_EQUAL 3
85 #define VER_LESS 4
86 #define VER_LESS_EQUAL 5
87 #define VER_AND 6
88 #define VER_OR 7
89 #define VER_CONDITION_MASK 7
90 #define VER_NUM_BITS_PER_CONDITION_MASK 3
91
92 #define RTL_CRITSECT_TYPE 0
93 #define RTL_RESOURCE_TYPE 1
94
95 #ifdef NTOS_MODE_USER
96 /* RTL String Hash Algorithms */
97 #define HASH_STRING_ALGORITHM_DEFAULT 0
98 #define HASH_STRING_ALGORITHM_X65599 1
99 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
100
101 /* RtlDuplicateString settings */
102 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
103 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
104
105 /* For Size conversion macros */
106 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
107 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
108 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
109
110 /* List Macros */
111 static __inline
112 VOID
113 InitializeListHead(
114 IN PLIST_ENTRY ListHead)
115 {
116 ListHead->Flink = ListHead->Blink = ListHead;
117 }
118
119 static __inline
120 VOID
121 InsertHeadList(
122 IN PLIST_ENTRY ListHead,
123 IN PLIST_ENTRY Entry)
124 {
125 PLIST_ENTRY OldFlink;
126 OldFlink = ListHead->Flink;
127 Entry->Flink = OldFlink;
128 Entry->Blink = ListHead;
129 OldFlink->Blink = Entry;
130 ListHead->Flink = Entry;
131 }
132
133 static __inline
134 VOID
135 InsertTailList(
136 IN PLIST_ENTRY ListHead,
137 IN PLIST_ENTRY Entry)
138 {
139 PLIST_ENTRY OldBlink;
140 OldBlink = ListHead->Blink;
141 Entry->Flink = ListHead;
142 Entry->Blink = OldBlink;
143 OldBlink->Flink = Entry;
144 ListHead->Blink = Entry;
145 }
146
147 #define IsListEmpty(ListHead) \
148 ((ListHead)->Flink == (ListHead))
149
150 #define PopEntryList(ListHead) \
151 (ListHead)->Next; \
152 { \
153 PSINGLE_LIST_ENTRY _FirstEntry; \
154 _FirstEntry = (ListHead)->Next; \
155 if (_FirstEntry != NULL) \
156 (ListHead)->Next = _FirstEntry->Next; \
157 }
158
159 #define PushEntryList(_ListHead, _Entry) \
160 (_Entry)->Next = (_ListHead)->Next; \
161 (_ListHead)->Next = (_Entry); \
162
163 static __inline
164 BOOLEAN
165 RemoveEntryList(
166 IN PLIST_ENTRY Entry)
167 {
168 PLIST_ENTRY OldFlink;
169 PLIST_ENTRY OldBlink;
170
171 OldFlink = Entry->Flink;
172 OldBlink = Entry->Blink;
173 OldFlink->Blink = OldBlink;
174 OldBlink->Flink = OldFlink;
175 return (OldFlink == OldBlink);
176 }
177
178 static __inline
179 PLIST_ENTRY
180 RemoveHeadList(
181 IN PLIST_ENTRY ListHead)
182 {
183 PLIST_ENTRY Flink;
184 PLIST_ENTRY Entry;
185
186 Entry = ListHead->Flink;
187 Flink = Entry->Flink;
188 ListHead->Flink = Flink;
189 Flink->Blink = ListHead;
190 return Entry;
191 }
192
193 static __inline
194 PLIST_ENTRY
195 RemoveTailList(
196 IN PLIST_ENTRY ListHead)
197 {
198 PLIST_ENTRY Blink;
199 PLIST_ENTRY Entry;
200
201 Entry = ListHead->Blink;
202 Blink = Entry->Blink;
203 ListHead->Blink = Blink;
204 Blink->Flink = ListHead;
205 return Entry;
206 }
207
208 #define IsFirstEntry(ListHead, Entry) \
209 ((ListHead)->Flink == Entry)
210
211 #define IsLastEntry(ListHead, Entry) \
212 ((ListHead)->Blink == Entry)
213
214 /*
215 * Constant String Macro
216 */
217 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
218 { \
219 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
220 sizeof(__SOURCE_STRING__), \
221 (__SOURCE_STRING__) \
222 }
223
224 #define RtlEqualLuid(L1, L2) (((L1)->HighPart == (L2)->HighPart) && \
225 ((L1)->LowPart == (L2)->LowPart))
226 #endif
227
228 /* FIXME: Rename these */
229 #define PDI_MODULES 0x01 /* The loaded modules of the process */
230 #define PDI_BACKTRACE 0x02 /* The heap stack back traces */
231 #define PDI_HEAPS 0x04 /* The heaps of the process */
232 #define PDI_HEAP_TAGS 0x08 /* The heap tags */
233 #define PDI_HEAP_BLOCKS 0x10 /* The heap blocks */
234 #define PDI_LOCKS 0x20 /* The locks created by the process */
235
236 /* RTL Handle Flags */
237 #define RTL_HANDLE_VALID 0x1
238
239 /* RTL Atom Flags */
240 #define RTL_ATOM_IS_PINNED 0x1
241
242 /* EXPORTED DATA *************************************************************/
243 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
244 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
245
246 /* ENUMERATIONS **************************************************************/
247
248 #ifdef NTOS_MODE_USER
249 typedef enum _TABLE_SEARCH_RESULT
250 {
251 TableEmptyTree,
252 TableFoundNode,
253 TableInsertAsLeft,
254 TableInsertAsRight
255 } TABLE_SEARCH_RESULT;
256
257 typedef enum _RTL_GENERIC_COMPARE_RESULTS
258 {
259 GenericLessThan,
260 GenericGreaterThan,
261 GenericEqual
262 } RTL_GENERIC_COMPARE_RESULTS;
263 #endif
264
265 typedef enum
266 {
267 INVALID_PATH = 0,
268 UNC_PATH, /* "//foo" */
269 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
270 RELATIVE_DRIVE_PATH, /* "c:foo" */
271 ABSOLUTE_PATH, /* "/foo" */
272 RELATIVE_PATH, /* "foo" */
273 DEVICE_PATH, /* "//./foo" */
274 UNC_DOT_PATH /* "//." */
275 } DOS_PATHNAME_TYPE;
276
277 /* FUNCTION TYPES ************************************************************/
278 #ifndef NTOS_MODE_USER
279 typedef VOID (NTAPI *WAITORTIMERCALLBACKFUNC)(PVOID, BOOLEAN);
280 #endif
281
282 struct _RTL_AVL_TABLE;
283 struct _RTL_GENERIC_TABLE;
284 struct _RTL_RANGE;
285
286 typedef NTSTATUS
287 (*PHEAP_ENUMERATION_ROUTINE)(
288 IN PVOID HeapHandle,
289 IN PVOID UserParam
290 );
291
292 typedef EXCEPTION_DISPOSITION
293 (*PEXCEPTION_HANDLER)(
294 struct _EXCEPTION_RECORD*,
295 PVOID,
296 struct _CONTEXT*,
297 PVOID
298 );
299
300 typedef LONG (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
301 PEXCEPTION_POINTERS ExceptionPointers
302 );
303
304 typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
305 PVOID Parameter
306 );
307
308 typedef VOID
309 (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
310 PTHREAD_START_ROUTINE StartAddress,
311 PVOID Parameter
312 );
313
314 typedef NTSTATUS
315 (NTAPI *PRTL_AVL_MATCH_FUNCTION)(
316 struct _RTL_AVL_TABLE *Table,
317 PVOID UserData,
318 PVOID MatchData
319 );
320
321 typedef RTL_GENERIC_COMPARE_RESULTS
322 (NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
323 struct _RTL_AVL_TABLE *Table,
324 PVOID FirstStruct,
325 PVOID SecondStruct
326 );
327
328 typedef RTL_GENERIC_COMPARE_RESULTS
329 (NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
330 struct _RTL_GENERIC_TABLE *Table,
331 PVOID FirstStruct,
332 PVOID SecondStruct
333 );
334
335 typedef PVOID
336 (NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
337 struct _RTL_GENERIC_TABLE *Table,
338 CLONG ByteSize
339 );
340
341 typedef VOID
342 (NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
343 struct _RTL_GENERIC_TABLE *Table,
344 PVOID Buffer
345 );
346
347 typedef PVOID
348 (NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
349 struct _RTL_AVL_TABLE *Table,
350 CLONG ByteSize
351 );
352
353 typedef VOID
354 (NTAPI *PRTL_AVL_FREE_ROUTINE) (
355 struct _RTL_AVL_TABLE *Table,
356 PVOID Buffer
357 );
358
359 typedef NTSTATUS
360 (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
361 IN PWSTR ValueName,
362 IN ULONG ValueType,
363 IN PVOID ValueData,
364 IN ULONG ValueLength,
365 IN PVOID Context,
366 IN PVOID EntryContext
367 );
368
369 typedef NTSTATUS
370 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
371 IN PVOID Base,
372 IN OUT PVOID *CommitAddress,
373 IN OUT PSIZE_T CommitSize
374 );
375
376 #ifdef NTOS_MODE_USER
377 typedef BOOLEAN
378 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) (
379 PVOID Context,
380 struct _RTL_RANGE *Range
381 );
382 #endif
383
384 /* TYPES *********************************************************************/
385
386 #ifdef NTOS_MODE_USER
387 typedef OSVERSIONINFOW RTL_OSVERSIONINFOW;
388 typedef LPOSVERSIONINFOW PRTL_OSVERSIONINFOW;
389 typedef OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
390 typedef LPOSVERSIONINFOEXW PRTL_OSVERSIONINFOEXW;
391
392 typedef struct _RTL_HEAP_PARAMETERS
393 {
394 ULONG Length;
395 SIZE_T SegmentReserve;
396 SIZE_T SegmentCommit;
397 SIZE_T DeCommitFreeBlockThreshold;
398 SIZE_T DeCommitTotalFreeThreshold;
399 SIZE_T MaximumAllocationSize;
400 SIZE_T VirtualMemoryThreshold;
401 SIZE_T InitialCommit;
402 SIZE_T InitialReserve;
403 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
404 SIZE_T Reserved[2];
405 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
406
407 typedef struct _RTL_BITMAP
408 {
409 ULONG SizeOfBitMap;
410 PULONG Buffer;
411 } RTL_BITMAP, *PRTL_BITMAP;
412
413 typedef struct _RTL_BITMAP_RUN
414 {
415 ULONG StartingIndex;
416 ULONG NumberOfBits;
417 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
418
419 typedef struct _COMPRESSED_DATA_INFO
420 {
421 USHORT CompressionFormatAndEngine;
422 UCHAR CompressionUnitShift;
423 UCHAR ChunkShift;
424 UCHAR ClusterShift;
425 UCHAR Reserved;
426 USHORT NumberOfChunks;
427 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
428 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
429
430 typedef struct _GENERATE_NAME_CONTEXT
431 {
432 USHORT Checksum;
433 BOOLEAN CheckSumInserted;
434 UCHAR NameLength;
435 WCHAR NameBuffer[8];
436 ULONG ExtensionLength;
437 WCHAR ExtensionBuffer[4];
438 ULONG LastIndexValue;
439 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
440
441 typedef struct _RTL_SPLAY_LINKS
442 {
443 struct _RTL_SPLAY_LINKS *Parent;
444 struct _RTL_SPLAY_LINKS *LeftChild;
445 struct _RTL_SPLAY_LINKS *RightChild;
446 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
447
448 typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION;
449 typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
450
451 typedef struct _RTL_GENERIC_TABLE
452 {
453 PRTL_SPLAY_LINKS TableRoot;
454 LIST_ENTRY InsertOrderList;
455 PLIST_ENTRY OrderedPointer;
456 ULONG WhichOrderedElement;
457 ULONG NumberGenericTableElements;
458 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
459 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
460 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
461 PVOID TableContext;
462 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
463
464 typedef struct _RTL_BALANCED_LINKS
465 {
466 struct _RTL_BALANCED_LINKS *Parent;
467 struct _RTL_BALANCED_LINKS *LeftChild;
468 struct _RTL_BALANCED_LINKS *RightChild;
469 CHAR Balance;
470 UCHAR Reserved[3];
471 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
472
473 typedef struct _RTL_AVL_TABLE
474 {
475 RTL_BALANCED_LINKS BalancedRoot;
476 PVOID OrderedPointer;
477 ULONG WhichOrderedElement;
478 ULONG NumberGenericTableElements;
479 ULONG DepthOfTree;
480 PRTL_BALANCED_LINKS RestartKey;
481 ULONG DeleteCount;
482 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
483 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
484 PRTL_AVL_FREE_ROUTINE FreeRoutine;
485 PVOID TableContext;
486 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
487
488 typedef struct _RTL_QUERY_REGISTRY_TABLE
489 {
490 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
491 ULONG Flags;
492 PWSTR Name;
493 PVOID EntryContext;
494 ULONG DefaultType;
495 PVOID DefaultData;
496 ULONG DefaultLength;
497 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
498
499 typedef struct _UNICODE_PREFIX_TABLE_ENTRY
500 {
501 CSHORT NodeTypeCode;
502 CSHORT NameLength;
503 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
504 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
505 RTL_SPLAY_LINKS Links;
506 PUNICODE_STRING Prefix;
507 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
508
509 typedef struct _UNICODE_PREFIX_TABLE
510 {
511 CSHORT NodeTypeCode;
512 CSHORT NameLength;
513 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
514 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
515 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
516
517 typedef struct _TIME_FIELDS
518 {
519 CSHORT Year;
520 CSHORT Month;
521 CSHORT Day;
522 CSHORT Hour;
523 CSHORT Minute;
524 CSHORT Second;
525 CSHORT Milliseconds;
526 CSHORT Weekday;
527 } TIME_FIELDS, *PTIME_FIELDS;
528 #endif
529
530 typedef struct _ACE
531 {
532 ACE_HEADER Header;
533 ACCESS_MASK AccessMask;
534 } ACE, *PACE;
535
536 /* FIXME: Review definitions and give these guys a better name */
537 typedef struct _DEBUG_BUFFER
538 {
539 HANDLE SectionHandle;
540 PVOID SectionBase;
541 PVOID RemoteSectionBase;
542 ULONG SectionBaseDelta;
543 HANDLE EventPairHandle;
544 ULONG Unknown[2];
545 HANDLE RemoteThreadHandle;
546 ULONG InfoClassMask;
547 ULONG SizeOfInfo;
548 ULONG AllocatedSize;
549 ULONG SectionSize;
550 PVOID ModuleInformation;
551 PVOID BackTraceInformation;
552 PVOID HeapInformation;
553 PVOID LockInformation;
554 PVOID Reserved[8];
555 } DEBUG_BUFFER, *PDEBUG_BUFFER;
556
557 typedef struct _DEBUG_MODULE_INFORMATION
558 {
559 ULONG Reserved[2];
560 PVOID Base;
561 ULONG Size;
562 ULONG Flags;
563 USHORT Index;
564 USHORT Unknown;
565 USHORT LoadCount;
566 USHORT ModuleNameOffset;
567 CHAR ImageName[256];
568 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
569
570 typedef struct _DEBUG_HEAP_INFORMATION
571 {
572 PVOID Base;
573 ULONG Flags;
574 USHORT Granularity;
575 USHORT Unknown;
576 ULONG Allocated;
577 ULONG Committed;
578 ULONG TagCount;
579 ULONG BlockCount;
580 ULONG Reserved[7];
581 PVOID Tags;
582 PVOID Blocks;
583 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
584
585 typedef struct _DEBUG_LOCK_INFORMATION
586 {
587 PVOID Address;
588 USHORT Type;
589 USHORT CreatorBackTraceIndex;
590 ULONG OwnerThreadId;
591 ULONG ActiveCount;
592 ULONG ContentionCount;
593 ULONG EntryCount;
594 ULONG RecursionCount;
595 ULONG NumberOfSharedWaiters;
596 ULONG NumberOfExclusiveWaiters;
597 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
598
599 typedef struct _RTL_HANDLE_TABLE_ENTRY
600 {
601 ULONG Flags;
602 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
603 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
604
605 typedef struct _RTL_HANDLE_TABLE
606 {
607 ULONG MaximumNumberOfHandles;
608 ULONG SizeOfHandleTableEntry;
609 ULONG Reserved[2];
610 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
611 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
612 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
613 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
614 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
615
616 typedef struct _LOCK_INFORMATION
617 {
618 ULONG LockCount;
619 DEBUG_LOCK_INFORMATION LockEntry[1];
620 } LOCK_INFORMATION, *PLOCK_INFORMATION;
621
622 typedef struct _HEAP_INFORMATION
623 {
624 ULONG HeapCount;
625 DEBUG_HEAP_INFORMATION HeapEntry[1];
626 } HEAP_INFORMATION, *PHEAP_INFORMATION;
627
628 typedef struct _MODULE_INFORMATION
629 {
630 ULONG ModuleCount;
631 DEBUG_MODULE_INFORMATION ModuleEntry[1];
632 } MODULE_INFORMATION, *PMODULE_INFORMATION;
633 /* END REVIEW AREA */
634
635 #ifdef _INC_EXCPT
636 typedef struct _EXCEPTION_REGISTRATION
637 {
638 struct _EXCEPTION_REGISTRATION *prev;
639 PEXCEPTION_HANDLER handler;
640 } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
641 #endif
642
643 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
644 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
645
646 typedef struct _CURDIR
647 {
648 UNICODE_STRING DosPath;
649 HANDLE Handle;
650 } CURDIR, *PCURDIR;
651
652 typedef struct RTL_DRIVE_LETTER_CURDIR
653 {
654 USHORT Flags;
655 USHORT Length;
656 ULONG TimeStamp;
657 UNICODE_STRING DosPath;
658 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
659
660 #ifndef NTOS_MODE_USER
661 typedef struct _RTL_CRITICAL_SECTION_DEBUG
662 {
663 USHORT Type;
664 USHORT CreatorBackTraceIndex;
665 struct _RTL_CRITICAL_SECTION *CriticalSection;
666 LIST_ENTRY ProcessLocksList;
667 ULONG EntryCount;
668 ULONG ContentionCount;
669 ULONG Spare[2];
670 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
671
672 typedef struct _RTL_CRITICAL_SECTION
673 {
674 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
675 LONG LockCount;
676 LONG RecursionCount;
677 HANDLE OwningThread;
678 HANDLE LockSemaphore;
679 ULONG_PTR SpinCount;
680 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
681 #endif
682
683 #ifdef NTOS_MODE_USER
684 typedef struct _RTL_RANGE_LIST
685 {
686 LIST_ENTRY ListHead;
687 ULONG Flags; /* RTL_RANGE_LIST_... flags */
688 ULONG Count;
689 ULONG Stamp;
690 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
691
692 typedef struct _RTL_RANGE
693 {
694 ULONGLONG Start;
695 ULONGLONG End;
696 PVOID UserData;
697 PVOID Owner;
698 UCHAR Attributes;
699 UCHAR Flags; /* RTL_RANGE_... flags */
700 } RTL_RANGE, *PRTL_RANGE;
701
702 typedef struct _RANGE_LIST_ITERATOR
703 {
704 PLIST_ENTRY RangeListHead;
705 PLIST_ENTRY MergedHead;
706 PVOID Current;
707 ULONG Stamp;
708 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
709
710 #endif
711
712 typedef struct _RTL_RESOURCE
713 {
714 RTL_CRITICAL_SECTION Lock;
715 HANDLE SharedSemaphore;
716 ULONG SharedWaiters;
717 HANDLE ExclusiveSemaphore;
718 ULONG ExclusiveWaiters;
719 LONG NumberActive;
720 HANDLE OwningThread;
721 ULONG TimeoutBoost; /* ?? */
722 PVOID DebugInfo; /* ?? */
723 } RTL_RESOURCE, *PRTL_RESOURCE;
724
725 typedef struct _RTL_MESSAGE_RESOURCE_ENTRY
726 {
727 USHORT Length;
728 USHORT Flags;
729 CHAR Text[1];
730 } RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY;
731
732 typedef struct _RTL_MESSAGE_RESOURCE_BLOCK
733 {
734 ULONG LowId;
735 ULONG HighId;
736 ULONG OffsetToEntries;
737 } RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK;
738
739 typedef struct _RTL_MESSAGE_RESOURCE_DATA
740 {
741 ULONG NumberOfBlocks;
742 RTL_MESSAGE_RESOURCE_BLOCK Blocks[1];
743 } RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA;
744
745 typedef struct _NLS_FILE_HEADER
746 {
747 USHORT HeaderSize;
748 USHORT CodePage;
749 USHORT MaximumCharacterSize; /* SBCS = 1, DBCS = 2 */
750 USHORT DefaultChar;
751 USHORT UniDefaultChar;
752 USHORT TransDefaultChar;
753 USHORT TransUniDefaultChar;
754 USHORT DBCSCodePage;
755 UCHAR LeadByte[MAXIMUM_LEADBYTES];
756 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
757
758 typedef struct _RTL_USER_PROCESS_PARAMETERS
759 {
760 ULONG MaximumLength;
761 ULONG Length;
762 ULONG Flags;
763 ULONG DebugFlags;
764 HANDLE ConsoleHandle;
765 ULONG ConsoleFlags;
766 HANDLE StandardInput;
767 HANDLE StandardOutput;
768 HANDLE StandardError;
769 CURDIR CurrentDirectory;
770 UNICODE_STRING DllPath;
771 UNICODE_STRING ImagePathName;
772 UNICODE_STRING CommandLine;
773 PWSTR Environment;
774 ULONG StartingX;
775 ULONG StartingY;
776 ULONG CountX;
777 ULONG CountY;
778 ULONG CountCharsX;
779 ULONG CountCharsY;
780 ULONG FillAttribute;
781 ULONG WindowFlags;
782 ULONG ShowWindowFlags;
783 UNICODE_STRING WindowTitle;
784 UNICODE_STRING DesktopInfo;
785 UNICODE_STRING ShellInfo;
786 UNICODE_STRING RuntimeData;
787 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
788 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
789
790 typedef struct _RTL_USER_PROCESS_INFORMATION
791 {
792 ULONG Size;
793 HANDLE ProcessHandle;
794 HANDLE ThreadHandle;
795 CLIENT_ID ClientId;
796 SECTION_IMAGE_INFORMATION ImageInformation;
797 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
798
799 typedef struct _RTL_ATOM_TABLE_ENTRY
800 {
801 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
802 USHORT HandleIndex;
803 USHORT Atom;
804 USHORT ReferenceCount;
805 UCHAR Flags;
806 UCHAR NameLength;
807 WCHAR Name[1];
808 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
809
810 #ifdef NTOS_MODE_USER
811 typedef RTL_CRITICAL_SECTION FAST_MUTEX;
812 typedef RTL_HANDLE_TABLE HANDLE_TABLE, *PHANDLE_TABLE;
813 #endif
814 typedef struct _RTL_ATOM_TABLE
815 {
816 ULONG Signature;
817 union
818 {
819 RTL_CRITICAL_SECTION CriticalSection;
820 FAST_MUTEX FastMutex;
821 };
822 union
823 {
824 RTL_HANDLE_TABLE RtlHandleTable;
825 PHANDLE_TABLE ExHandleTable;
826 };
827 ULONG NumberOfBuckets;
828 PRTL_ATOM_TABLE_ENTRY Buckets[1];
829 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
830
831 #ifndef NTOS_MODE_USER
832
833 typedef struct _SYSTEMTIME
834 {
835 USHORT wYear;
836 USHORT wMonth;
837 USHORT wDayOfWeek;
838 USHORT wDay;
839 USHORT wHour;
840 USHORT wMinute;
841 USHORT wSecond;
842 USHORT wMilliseconds;
843 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
844
845 typedef struct _TIME_ZONE_INFORMATION
846 {
847 LONG Bias;
848 WCHAR StandardName[32];
849 SYSTEMTIME StandardDate;
850 LONG StandardBias;
851 WCHAR DaylightName[32];
852 SYSTEMTIME DaylightDate;
853 LONG DaylightBias;
854 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
855
856 typedef enum _ACL_INFORMATION_CLASS
857 {
858 AclRevisionInformation = 1,
859 AclSizeInformation
860 } ACL_INFORMATION_CLASS;
861
862 #define TIME_ZONE_ID_UNKNOWN 0
863 #define TIME_ZONE_ID_STANDARD 1
864 #define TIME_ZONE_ID_DAYLIGHT 2
865 #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
866 #endif
867
868 #endif