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