Beware of the alt+fs slippery finger
[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 /* RTL Debug Queries */
232 #define RTL_DEBUG_QUERY_MODULES 0x01
233 #define RTL_DEBUG_QUERY_BACKTRACES 0x02
234 #define RTL_DEBUG_QUERY_HEAPS 0x04
235 #define RTL_DEBUG_QUERY_HEAP_TAGS 0x08
236 #define RTL_DEBUG_QUERY_HEAP_BLOCKS 0x10
237 #define RTL_DEBUG_QUERY_LOCKS 0x20
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 _RTL_PATH_TYPE
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 } RTL_PATH_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 typedef struct _RTL_PROCESS_MODULE_INFORMATION
553 {
554 ULONG Reserved[2];
555 PVOID Base;
556 ULONG Size;
557 ULONG Flags;
558 USHORT Index;
559 USHORT Unknown;
560 USHORT LoadCount;
561 USHORT ModuleNameOffset;
562 CHAR ImageName[256];
563 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
564
565 typedef struct _RTL_PROCESS_MODULES
566 {
567 ULONG ModuleCount;
568 RTL_PROCESS_MODULE_INFORMATION ModuleEntry[1];
569 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
570
571 typedef struct _RTL_PROCESS_HEAP_INFORMATION
572 {
573 PVOID Base;
574 ULONG Flags;
575 USHORT Granularity;
576 USHORT Unknown;
577 ULONG Allocated;
578 ULONG Committed;
579 ULONG TagCount;
580 ULONG BlockCount;
581 ULONG Reserved[7];
582 PVOID Tags;
583 PVOID Blocks;
584 } RTL_PROCESS_HEAP_INFORMATION, *PRTL_PROCESS_HEAP_INFORMATION;
585
586 typedef struct _RTL_PROCESS_HEAPS
587 {
588 ULONG HeapCount;
589 RTL_PROCESS_HEAP_INFORMATION HeapEntry[1];
590 } RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;
591
592 typedef struct _RTL_PROCESS_LOCK_INFORMATION
593 {
594 PVOID Address;
595 USHORT Type;
596 USHORT CreatorBackTraceIndex;
597 ULONG OwnerThreadId;
598 ULONG ActiveCount;
599 ULONG ContentionCount;
600 ULONG EntryCount;
601 ULONG RecursionCount;
602 ULONG NumberOfSharedWaiters;
603 ULONG NumberOfExclusiveWaiters;
604 } RTL_PROCESS_LOCK_INFORMATION, *PRTL_PROCESS_LOCK_INFORMATION;
605
606 typedef struct _RTL_PROCESS_LOCKS
607 {
608 ULONG LockCount;
609 RTL_PROCESS_LOCK_INFORMATION LockEntry[1];
610 } RTL_PROCESS_LOCKS, *PRTL_PROCESS_LOCKS;
611
612 typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
613 {
614 /* FIXME */
615 ULONG Unknown;
616 } RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
617
618 typedef struct _RTL_PROCESS_BACKTRACES
619 {
620 ULONG BackTraceCount;
621 RTL_PROCESS_BACKTRACE_INFORMATION BackTraceEntry[1];
622 } RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
623
624 typedef struct _RTL_DEBUG_BUFFER
625 {
626 HANDLE SectionHandle;
627 PVOID SectionBase;
628 PVOID RemoteSectionBase;
629 ULONG SectionBaseDelta;
630 HANDLE EventPairHandle;
631 ULONG Unknown[2];
632 HANDLE RemoteThreadHandle;
633 ULONG InfoClassMask;
634 ULONG SizeOfInfo;
635 ULONG AllocatedSize;
636 ULONG SectionSize;
637 PRTL_PROCESS_MODULES ModuleInformation;
638 PRTL_PROCESS_BACKTRACES BackTraceInformation;
639 PRTL_PROCESS_HEAPS HeapInformation;
640 PRTL_PROCESS_LOCKS LockInformation;
641 PVOID Reserved[8];
642 } RTL_DEBUG_BUFFER, *PRTL_DEBUG_BUFFER;
643
644 typedef struct _RTL_HANDLE_TABLE_ENTRY
645 {
646 ULONG Flags;
647 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
648 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
649
650 typedef struct _RTL_HANDLE_TABLE
651 {
652 ULONG MaximumNumberOfHandles;
653 ULONG SizeOfHandleTableEntry;
654 ULONG Reserved[2];
655 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
656 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
657 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
658 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
659 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
660
661 typedef struct _EXCEPTION_REGISTRATION_RECORD
662 {
663 struct _EXCEPTION_REGISTRATION_RECORD *Next;
664 PEXCEPTION_HANDLER Handler;
665 } EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
666
667 typedef struct _CURDIR
668 {
669 UNICODE_STRING DosPath;
670 HANDLE Handle;
671 } CURDIR, *PCURDIR;
672
673 typedef struct RTL_DRIVE_LETTER_CURDIR
674 {
675 USHORT Flags;
676 USHORT Length;
677 ULONG TimeStamp;
678 UNICODE_STRING DosPath;
679 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
680
681 #ifndef NTOS_MODE_USER
682 typedef struct _RTL_CRITICAL_SECTION_DEBUG
683 {
684 USHORT Type;
685 USHORT CreatorBackTraceIndex;
686 struct _RTL_CRITICAL_SECTION *CriticalSection;
687 LIST_ENTRY ProcessLocksList;
688 ULONG EntryCount;
689 ULONG ContentionCount;
690 ULONG Spare[2];
691 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
692
693 typedef struct _RTL_CRITICAL_SECTION
694 {
695 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
696 LONG LockCount;
697 LONG RecursionCount;
698 HANDLE OwningThread;
699 HANDLE LockSemaphore;
700 ULONG_PTR SpinCount;
701 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
702 #endif
703
704 #ifdef NTOS_MODE_USER
705 typedef struct _RTL_RANGE_LIST
706 {
707 LIST_ENTRY ListHead;
708 ULONG Flags; /* RTL_RANGE_LIST_... flags */
709 ULONG Count;
710 ULONG Stamp;
711 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
712
713 typedef struct _RTL_RANGE
714 {
715 ULONGLONG Start;
716 ULONGLONG End;
717 PVOID UserData;
718 PVOID Owner;
719 UCHAR Attributes;
720 UCHAR Flags; /* RTL_RANGE_... flags */
721 } RTL_RANGE, *PRTL_RANGE;
722
723 typedef struct _RANGE_LIST_ITERATOR
724 {
725 PLIST_ENTRY RangeListHead;
726 PLIST_ENTRY MergedHead;
727 PVOID Current;
728 ULONG Stamp;
729 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
730
731 #endif
732
733 typedef struct _RTL_RESOURCE
734 {
735 RTL_CRITICAL_SECTION Lock;
736 HANDLE SharedSemaphore;
737 ULONG SharedWaiters;
738 HANDLE ExclusiveSemaphore;
739 ULONG ExclusiveWaiters;
740 LONG NumberActive;
741 HANDLE OwningThread;
742 ULONG TimeoutBoost;
743 PVOID DebugInfo;
744 } RTL_RESOURCE, *PRTL_RESOURCE;
745
746 typedef struct _RTL_MESSAGE_RESOURCE_ENTRY
747 {
748 USHORT Length;
749 USHORT Flags;
750 CHAR Text[1];
751 } RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY;
752
753 typedef struct _RTL_MESSAGE_RESOURCE_BLOCK
754 {
755 ULONG LowId;
756 ULONG HighId;
757 ULONG OffsetToEntries;
758 } RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK;
759
760 typedef struct _RTL_MESSAGE_RESOURCE_DATA
761 {
762 ULONG NumberOfBlocks;
763 RTL_MESSAGE_RESOURCE_BLOCK Blocks[1];
764 } RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA;
765
766 typedef struct _NLS_FILE_HEADER
767 {
768 USHORT HeaderSize;
769 USHORT CodePage;
770 USHORT MaximumCharacterSize;
771 USHORT DefaultChar;
772 USHORT UniDefaultChar;
773 USHORT TransDefaultChar;
774 USHORT TransUniDefaultChar;
775 USHORT DBCSCodePage;
776 UCHAR LeadByte[MAXIMUM_LEADBYTES];
777 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
778
779 typedef struct _RTL_USER_PROCESS_PARAMETERS
780 {
781 ULONG MaximumLength;
782 ULONG Length;
783 ULONG Flags;
784 ULONG DebugFlags;
785 HANDLE ConsoleHandle;
786 ULONG ConsoleFlags;
787 HANDLE StandardInput;
788 HANDLE StandardOutput;
789 HANDLE StandardError;
790 CURDIR CurrentDirectory;
791 UNICODE_STRING DllPath;
792 UNICODE_STRING ImagePathName;
793 UNICODE_STRING CommandLine;
794 PWSTR Environment;
795 ULONG StartingX;
796 ULONG StartingY;
797 ULONG CountX;
798 ULONG CountY;
799 ULONG CountCharsX;
800 ULONG CountCharsY;
801 ULONG FillAttribute;
802 ULONG WindowFlags;
803 ULONG ShowWindowFlags;
804 UNICODE_STRING WindowTitle;
805 UNICODE_STRING DesktopInfo;
806 UNICODE_STRING ShellInfo;
807 UNICODE_STRING RuntimeData;
808 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
809 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
810
811 typedef struct _RTL_USER_PROCESS_INFORMATION
812 {
813 ULONG Size;
814 HANDLE ProcessHandle;
815 HANDLE ThreadHandle;
816 CLIENT_ID ClientId;
817 SECTION_IMAGE_INFORMATION ImageInformation;
818 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
819
820 typedef struct _RTL_ATOM_TABLE_ENTRY
821 {
822 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
823 USHORT HandleIndex;
824 USHORT Atom;
825 USHORT ReferenceCount;
826 UCHAR Flags;
827 UCHAR NameLength;
828 WCHAR Name[1];
829 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
830
831 #ifdef NTOS_MODE_USER
832 typedef RTL_CRITICAL_SECTION FAST_MUTEX;
833 typedef RTL_HANDLE_TABLE HANDLE_TABLE, *PHANDLE_TABLE;
834 #endif
835 typedef struct _RTL_ATOM_TABLE
836 {
837 ULONG Signature;
838 union
839 {
840 RTL_CRITICAL_SECTION CriticalSection;
841 FAST_MUTEX FastMutex;
842 };
843 union
844 {
845 RTL_HANDLE_TABLE RtlHandleTable;
846 PHANDLE_TABLE ExHandleTable;
847 };
848 ULONG NumberOfBuckets;
849 PRTL_ATOM_TABLE_ENTRY Buckets[1];
850 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
851
852 #ifndef NTOS_MODE_USER
853
854 typedef struct _SYSTEMTIME
855 {
856 USHORT wYear;
857 USHORT wMonth;
858 USHORT wDayOfWeek;
859 USHORT wDay;
860 USHORT wHour;
861 USHORT wMinute;
862 USHORT wSecond;
863 USHORT wMilliseconds;
864 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
865
866 typedef struct _TIME_ZONE_INFORMATION
867 {
868 LONG Bias;
869 WCHAR StandardName[32];
870 SYSTEMTIME StandardDate;
871 LONG StandardBias;
872 WCHAR DaylightName[32];
873 SYSTEMTIME DaylightDate;
874 LONG DaylightBias;
875 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
876
877 typedef enum _ACL_INFORMATION_CLASS
878 {
879 AclRevisionInformation = 1,
880 AclSizeInformation
881 } ACL_INFORMATION_CLASS;
882
883 #define TIME_ZONE_ID_UNKNOWN 0
884 #define TIME_ZONE_ID_STANDARD 1
885 #define TIME_ZONE_ID_DAYLIGHT 2
886 #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
887 #endif
888
889 #endif