A couple more fixes to prepare for the final patch
[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 #ifdef NTOS_MODE_USER
244 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
245 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
246 #endif
247
248 /* ENUMERATIONS **************************************************************/
249
250 #ifdef NTOS_MODE_USER
251 typedef enum _TABLE_SEARCH_RESULT
252 {
253 TableEmptyTree,
254 TableFoundNode,
255 TableInsertAsLeft,
256 TableInsertAsRight
257 } TABLE_SEARCH_RESULT;
258
259 typedef enum _RTL_GENERIC_COMPARE_RESULTS
260 {
261 GenericLessThan,
262 GenericGreaterThan,
263 GenericEqual
264 } RTL_GENERIC_COMPARE_RESULTS;
265 #endif
266
267 typedef enum
268 {
269 INVALID_PATH = 0,
270 UNC_PATH, /* "//foo" */
271 ABSOLUTE_DRIVE_PATH, /* "c:/foo" */
272 RELATIVE_DRIVE_PATH, /* "c:foo" */
273 ABSOLUTE_PATH, /* "/foo" */
274 RELATIVE_PATH, /* "foo" */
275 DEVICE_PATH, /* "//./foo" */
276 UNC_DOT_PATH /* "//." */
277 } DOS_PATHNAME_TYPE;
278
279 /* FUNCTION TYPES ************************************************************/
280 #ifndef NTOS_MODE_USER
281 typedef VOID (NTAPI *WAITORTIMERCALLBACKFUNC)(PVOID, BOOLEAN);
282 #endif
283
284 struct _RTL_AVL_TABLE;
285 struct _RTL_GENERIC_TABLE;
286 struct _RTL_RANGE;
287
288 typedef NTSTATUS
289 (*PHEAP_ENUMERATION_ROUTINE)(
290 IN PVOID HeapHandle,
291 IN PVOID UserParam
292 );
293
294 typedef EXCEPTION_DISPOSITION
295 (*PEXCEPTION_HANDLER)(
296 struct _EXCEPTION_RECORD*,
297 PVOID,
298 struct _CONTEXT*,
299 PVOID
300 );
301
302 typedef LONG (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
303 PEXCEPTION_POINTERS ExceptionPointers
304 );
305
306 typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
307 PVOID Parameter
308 );
309
310 typedef VOID
311 (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
312 PTHREAD_START_ROUTINE StartAddress,
313 PVOID Parameter
314 );
315
316 typedef NTSTATUS
317 (NTAPI *PRTL_AVL_MATCH_FUNCTION)(
318 struct _RTL_AVL_TABLE *Table,
319 PVOID UserData,
320 PVOID MatchData
321 );
322
323 typedef RTL_GENERIC_COMPARE_RESULTS
324 (NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
325 struct _RTL_AVL_TABLE *Table,
326 PVOID FirstStruct,
327 PVOID SecondStruct
328 );
329
330 typedef RTL_GENERIC_COMPARE_RESULTS
331 (NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
332 struct _RTL_GENERIC_TABLE *Table,
333 PVOID FirstStruct,
334 PVOID SecondStruct
335 );
336
337 typedef PVOID
338 (NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
339 struct _RTL_GENERIC_TABLE *Table,
340 CLONG ByteSize
341 );
342
343 typedef VOID
344 (NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
345 struct _RTL_GENERIC_TABLE *Table,
346 PVOID Buffer
347 );
348
349 typedef PVOID
350 (NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
351 struct _RTL_AVL_TABLE *Table,
352 CLONG ByteSize
353 );
354
355 typedef VOID
356 (NTAPI *PRTL_AVL_FREE_ROUTINE) (
357 struct _RTL_AVL_TABLE *Table,
358 PVOID Buffer
359 );
360
361 typedef NTSTATUS
362 (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
363 IN PWSTR ValueName,
364 IN ULONG ValueType,
365 IN PVOID ValueData,
366 IN ULONG ValueLength,
367 IN PVOID Context,
368 IN PVOID EntryContext
369 );
370
371 typedef NTSTATUS
372 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
373 IN PVOID Base,
374 IN OUT PVOID *CommitAddress,
375 IN OUT PSIZE_T CommitSize
376 );
377
378 #ifdef NTOS_MODE_USER
379 typedef BOOLEAN
380 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK) (
381 PVOID Context,
382 struct _RTL_RANGE *Range
383 );
384 #endif
385
386 /* TYPES *********************************************************************/
387
388 #ifdef NTOS_MODE_USER
389 typedef OSVERSIONINFOW RTL_OSVERSIONINFOW;
390 typedef LPOSVERSIONINFOW PRTL_OSVERSIONINFOW;
391 typedef OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
392 typedef LPOSVERSIONINFOEXW PRTL_OSVERSIONINFOEXW;
393
394 typedef struct _RTL_HEAP_PARAMETERS
395 {
396 ULONG Length;
397 SIZE_T SegmentReserve;
398 SIZE_T SegmentCommit;
399 SIZE_T DeCommitFreeBlockThreshold;
400 SIZE_T DeCommitTotalFreeThreshold;
401 SIZE_T MaximumAllocationSize;
402 SIZE_T VirtualMemoryThreshold;
403 SIZE_T InitialCommit;
404 SIZE_T InitialReserve;
405 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
406 SIZE_T Reserved[2];
407 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
408
409 typedef struct _RTL_BITMAP
410 {
411 ULONG SizeOfBitMap;
412 PULONG Buffer;
413 } RTL_BITMAP, *PRTL_BITMAP;
414
415 typedef struct _RTL_BITMAP_RUN
416 {
417 ULONG StartingIndex;
418 ULONG NumberOfBits;
419 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
420
421 typedef struct _COMPRESSED_DATA_INFO
422 {
423 USHORT CompressionFormatAndEngine;
424 UCHAR CompressionUnitShift;
425 UCHAR ChunkShift;
426 UCHAR ClusterShift;
427 UCHAR Reserved;
428 USHORT NumberOfChunks;
429 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
430 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
431
432 typedef struct _GENERATE_NAME_CONTEXT
433 {
434 USHORT Checksum;
435 BOOLEAN CheckSumInserted;
436 UCHAR NameLength;
437 WCHAR NameBuffer[8];
438 ULONG ExtensionLength;
439 WCHAR ExtensionBuffer[4];
440 ULONG LastIndexValue;
441 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
442
443 typedef struct _RTL_SPLAY_LINKS
444 {
445 struct _RTL_SPLAY_LINKS *Parent;
446 struct _RTL_SPLAY_LINKS *LeftChild;
447 struct _RTL_SPLAY_LINKS *RightChild;
448 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
449
450 typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION;
451 typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
452
453 typedef struct _RTL_GENERIC_TABLE
454 {
455 PRTL_SPLAY_LINKS TableRoot;
456 LIST_ENTRY InsertOrderList;
457 PLIST_ENTRY OrderedPointer;
458 ULONG WhichOrderedElement;
459 ULONG NumberGenericTableElements;
460 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
461 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
462 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
463 PVOID TableContext;
464 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
465
466 typedef struct _RTL_BALANCED_LINKS
467 {
468 struct _RTL_BALANCED_LINKS *Parent;
469 struct _RTL_BALANCED_LINKS *LeftChild;
470 struct _RTL_BALANCED_LINKS *RightChild;
471 CHAR Balance;
472 UCHAR Reserved[3];
473 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
474
475 typedef struct _RTL_AVL_TABLE
476 {
477 RTL_BALANCED_LINKS BalancedRoot;
478 PVOID OrderedPointer;
479 ULONG WhichOrderedElement;
480 ULONG NumberGenericTableElements;
481 ULONG DepthOfTree;
482 PRTL_BALANCED_LINKS RestartKey;
483 ULONG DeleteCount;
484 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
485 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
486 PRTL_AVL_FREE_ROUTINE FreeRoutine;
487 PVOID TableContext;
488 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
489
490 typedef struct _RTL_QUERY_REGISTRY_TABLE
491 {
492 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
493 ULONG Flags;
494 PWSTR Name;
495 PVOID EntryContext;
496 ULONG DefaultType;
497 PVOID DefaultData;
498 ULONG DefaultLength;
499 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
500
501 typedef struct _UNICODE_PREFIX_TABLE_ENTRY
502 {
503 CSHORT NodeTypeCode;
504 CSHORT NameLength;
505 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
506 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
507 RTL_SPLAY_LINKS Links;
508 PUNICODE_STRING Prefix;
509 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
510
511 typedef struct _UNICODE_PREFIX_TABLE
512 {
513 CSHORT NodeTypeCode;
514 CSHORT NameLength;
515 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
516 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
517 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
518
519 typedef struct _TIME_FIELDS
520 {
521 CSHORT Year;
522 CSHORT Month;
523 CSHORT Day;
524 CSHORT Hour;
525 CSHORT Minute;
526 CSHORT Second;
527 CSHORT Milliseconds;
528 CSHORT Weekday;
529 } TIME_FIELDS, *PTIME_FIELDS;
530 #endif
531
532 typedef struct _ACE
533 {
534 ACE_HEADER Header;
535 ACCESS_MASK AccessMask;
536 } ACE, *PACE;
537
538 /* FIXME: Review definitions and give these guys a better name */
539 typedef struct _DEBUG_BUFFER
540 {
541 HANDLE SectionHandle;
542 PVOID SectionBase;
543 PVOID RemoteSectionBase;
544 ULONG SectionBaseDelta;
545 HANDLE EventPairHandle;
546 ULONG Unknown[2];
547 HANDLE RemoteThreadHandle;
548 ULONG InfoClassMask;
549 ULONG SizeOfInfo;
550 ULONG AllocatedSize;
551 ULONG SectionSize;
552 PVOID ModuleInformation;
553 PVOID BackTraceInformation;
554 PVOID HeapInformation;
555 PVOID LockInformation;
556 PVOID Reserved[8];
557 } DEBUG_BUFFER, *PDEBUG_BUFFER;
558
559 typedef struct _DEBUG_MODULE_INFORMATION
560 {
561 ULONG Reserved[2];
562 PVOID Base;
563 ULONG Size;
564 ULONG Flags;
565 USHORT Index;
566 USHORT Unknown;
567 USHORT LoadCount;
568 USHORT ModuleNameOffset;
569 CHAR ImageName[256];
570 } DEBUG_MODULE_INFORMATION, *PDEBUG_MODULE_INFORMATION;
571
572 typedef struct _DEBUG_HEAP_INFORMATION
573 {
574 PVOID Base;
575 ULONG Flags;
576 USHORT Granularity;
577 USHORT Unknown;
578 ULONG Allocated;
579 ULONG Committed;
580 ULONG TagCount;
581 ULONG BlockCount;
582 ULONG Reserved[7];
583 PVOID Tags;
584 PVOID Blocks;
585 } DEBUG_HEAP_INFORMATION, *PDEBUG_HEAP_INFORMATION;
586
587 typedef struct _DEBUG_LOCK_INFORMATION
588 {
589 PVOID Address;
590 USHORT Type;
591 USHORT CreatorBackTraceIndex;
592 ULONG OwnerThreadId;
593 ULONG ActiveCount;
594 ULONG ContentionCount;
595 ULONG EntryCount;
596 ULONG RecursionCount;
597 ULONG NumberOfSharedWaiters;
598 ULONG NumberOfExclusiveWaiters;
599 } DEBUG_LOCK_INFORMATION, *PDEBUG_LOCK_INFORMATION;
600
601 typedef struct _RTL_HANDLE_TABLE_ENTRY
602 {
603 ULONG Flags;
604 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
605 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
606
607 typedef struct _RTL_HANDLE_TABLE
608 {
609 ULONG MaximumNumberOfHandles;
610 ULONG SizeOfHandleTableEntry;
611 ULONG Reserved[2];
612 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
613 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
614 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
615 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
616 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
617
618 typedef struct _LOCK_INFORMATION
619 {
620 ULONG LockCount;
621 DEBUG_LOCK_INFORMATION LockEntry[1];
622 } LOCK_INFORMATION, *PLOCK_INFORMATION;
623
624 typedef struct _HEAP_INFORMATION
625 {
626 ULONG HeapCount;
627 DEBUG_HEAP_INFORMATION HeapEntry[1];
628 } HEAP_INFORMATION, *PHEAP_INFORMATION;
629
630 typedef struct _MODULE_INFORMATION
631 {
632 ULONG ModuleCount;
633 DEBUG_MODULE_INFORMATION ModuleEntry[1];
634 } MODULE_INFORMATION, *PMODULE_INFORMATION;
635 /* END REVIEW AREA */
636
637 #ifdef _INC_EXCPT
638 typedef struct _EXCEPTION_REGISTRATION
639 {
640 struct _EXCEPTION_REGISTRATION *prev;
641 PEXCEPTION_HANDLER handler;
642 } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
643 #endif
644
645 typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
646 typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
647
648 typedef struct _CURDIR
649 {
650 UNICODE_STRING DosPath;
651 HANDLE Handle;
652 } CURDIR, *PCURDIR;
653
654 typedef struct RTL_DRIVE_LETTER_CURDIR
655 {
656 USHORT Flags;
657 USHORT Length;
658 ULONG TimeStamp;
659 UNICODE_STRING DosPath;
660 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
661
662 #ifndef NTOS_MODE_USER
663 typedef struct _RTL_CRITICAL_SECTION_DEBUG
664 {
665 USHORT Type;
666 USHORT CreatorBackTraceIndex;
667 struct _RTL_CRITICAL_SECTION *CriticalSection;
668 LIST_ENTRY ProcessLocksList;
669 ULONG EntryCount;
670 ULONG ContentionCount;
671 ULONG Spare[2];
672 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
673
674 typedef struct _RTL_CRITICAL_SECTION
675 {
676 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
677 LONG LockCount;
678 LONG RecursionCount;
679 HANDLE OwningThread;
680 HANDLE LockSemaphore;
681 ULONG_PTR SpinCount;
682 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
683 #endif
684
685 #ifdef NTOS_MODE_USER
686 typedef struct _RTL_RANGE_LIST
687 {
688 LIST_ENTRY ListHead;
689 ULONG Flags; /* RTL_RANGE_LIST_... flags */
690 ULONG Count;
691 ULONG Stamp;
692 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
693
694 typedef struct _RTL_RANGE
695 {
696 ULONGLONG Start;
697 ULONGLONG End;
698 PVOID UserData;
699 PVOID Owner;
700 UCHAR Attributes;
701 UCHAR Flags; /* RTL_RANGE_... flags */
702 } RTL_RANGE, *PRTL_RANGE;
703
704 typedef struct _RANGE_LIST_ITERATOR
705 {
706 PLIST_ENTRY RangeListHead;
707 PLIST_ENTRY MergedHead;
708 PVOID Current;
709 ULONG Stamp;
710 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
711
712 #endif
713
714 typedef struct _RTL_RESOURCE
715 {
716 RTL_CRITICAL_SECTION Lock;
717 HANDLE SharedSemaphore;
718 ULONG SharedWaiters;
719 HANDLE ExclusiveSemaphore;
720 ULONG ExclusiveWaiters;
721 LONG NumberActive;
722 HANDLE OwningThread;
723 ULONG TimeoutBoost; /* ?? */
724 PVOID DebugInfo; /* ?? */
725 } RTL_RESOURCE, *PRTL_RESOURCE;
726
727 typedef struct _RTL_MESSAGE_RESOURCE_ENTRY
728 {
729 USHORT Length;
730 USHORT Flags;
731 CHAR Text[1];
732 } RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY;
733
734 typedef struct _RTL_MESSAGE_RESOURCE_BLOCK
735 {
736 ULONG LowId;
737 ULONG HighId;
738 ULONG OffsetToEntries;
739 } RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK;
740
741 typedef struct _RTL_MESSAGE_RESOURCE_DATA
742 {
743 ULONG NumberOfBlocks;
744 RTL_MESSAGE_RESOURCE_BLOCK Blocks[1];
745 } RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA;
746
747 typedef struct _NLS_FILE_HEADER
748 {
749 USHORT HeaderSize;
750 USHORT CodePage;
751 USHORT MaximumCharacterSize; /* SBCS = 1, DBCS = 2 */
752 USHORT DefaultChar;
753 USHORT UniDefaultChar;
754 USHORT TransDefaultChar;
755 USHORT TransUniDefaultChar;
756 USHORT DBCSCodePage;
757 UCHAR LeadByte[MAXIMUM_LEADBYTES];
758 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
759
760 typedef struct _RTL_USER_PROCESS_PARAMETERS
761 {
762 ULONG MaximumLength;
763 ULONG Length;
764 ULONG Flags;
765 ULONG DebugFlags;
766 HANDLE ConsoleHandle;
767 ULONG ConsoleFlags;
768 HANDLE StandardInput;
769 HANDLE StandardOutput;
770 HANDLE StandardError;
771 CURDIR CurrentDirectory;
772 UNICODE_STRING DllPath;
773 UNICODE_STRING ImagePathName;
774 UNICODE_STRING CommandLine;
775 PWSTR Environment;
776 ULONG StartingX;
777 ULONG StartingY;
778 ULONG CountX;
779 ULONG CountY;
780 ULONG CountCharsX;
781 ULONG CountCharsY;
782 ULONG FillAttribute;
783 ULONG WindowFlags;
784 ULONG ShowWindowFlags;
785 UNICODE_STRING WindowTitle;
786 UNICODE_STRING DesktopInfo;
787 UNICODE_STRING ShellInfo;
788 UNICODE_STRING RuntimeData;
789 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
790 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
791
792 typedef struct _RTL_USER_PROCESS_INFORMATION
793 {
794 ULONG Size;
795 HANDLE ProcessHandle;
796 HANDLE ThreadHandle;
797 CLIENT_ID ClientId;
798 SECTION_IMAGE_INFORMATION ImageInformation;
799 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
800
801 typedef struct _RTL_ATOM_TABLE_ENTRY
802 {
803 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
804 USHORT HandleIndex;
805 USHORT Atom;
806 USHORT ReferenceCount;
807 UCHAR Flags;
808 UCHAR NameLength;
809 WCHAR Name[1];
810 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
811
812 #ifdef NTOS_MODE_USER
813 typedef RTL_CRITICAL_SECTION FAST_MUTEX;
814 typedef RTL_HANDLE_TABLE HANDLE_TABLE, *PHANDLE_TABLE;
815 #endif
816 typedef struct _RTL_ATOM_TABLE
817 {
818 ULONG Signature;
819 union
820 {
821 RTL_CRITICAL_SECTION CriticalSection;
822 FAST_MUTEX FastMutex;
823 };
824 union
825 {
826 RTL_HANDLE_TABLE RtlHandleTable;
827 PHANDLE_TABLE ExHandleTable;
828 };
829 ULONG NumberOfBuckets;
830 PRTL_ATOM_TABLE_ENTRY Buckets[1];
831 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
832
833 #ifndef NTOS_MODE_USER
834
835 typedef struct _SYSTEMTIME
836 {
837 USHORT wYear;
838 USHORT wMonth;
839 USHORT wDayOfWeek;
840 USHORT wDay;
841 USHORT wHour;
842 USHORT wMinute;
843 USHORT wSecond;
844 USHORT wMilliseconds;
845 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
846
847 typedef struct _TIME_ZONE_INFORMATION
848 {
849 LONG Bias;
850 WCHAR StandardName[32];
851 SYSTEMTIME StandardDate;
852 LONG StandardBias;
853 WCHAR DaylightName[32];
854 SYSTEMTIME DaylightDate;
855 LONG DaylightBias;
856 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
857
858 typedef enum _ACL_INFORMATION_CLASS
859 {
860 AclRevisionInformation = 1,
861 AclSizeInformation
862 } ACL_INFORMATION_CLASS;
863
864 #define TIME_ZONE_ID_UNKNOWN 0
865 #define TIME_ZONE_ID_STANDARD 1
866 #define TIME_ZONE_ID_DAYLIGHT 2
867 #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
868 #endif
869
870 #endif