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