445b9be95d165d36ce81699ec4ef046c79074694
[reactos.git] / reactos / include / ndk / rtltypes.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 rtltypes.h
8
9 Abstract:
10
11 Type definitions for the Run-Time Library
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _RTLTYPES_H
20 #define _RTLTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include "pstypes.h"
26
27 //
28 // Maximum Atom Length
29 //
30 #define RTL_MAXIMUM_ATOM_LENGTH 255
31
32 //
33 // Process Parameters Flags (FIXME: Rename)
34 //
35 #define PPF_NORMALIZED 0x01
36 #define PPF_PROFILE_USER 0x02
37 #define PPF_PROFILE_SERVER 0x04
38 #define PPF_PROFILE_KERNEL 0x08
39 #define PPF_UNKNOWN 0x10
40 #define PPF_RESERVE_1MB 0x20
41 #define PPF_DISABLE_HEAP_CHECKS 0x100
42 #define PPF_PROCESS_OR_1 0x200
43 #define PPF_PROCESS_OR_2 0x400
44
45 //
46 // Exception Flags
47 //
48 #define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
49 #define EXCEPTION_UNWINDING 0x02
50 #define EXCEPTION_EXIT_UNWIND 0x04
51 #define EXCEPTION_STACK_INVALID 0x08
52 #define EXCEPTION_NESTED_CALL 0x10
53 #define EXCEPTION_TARGET_UNWIND 0x20
54 #define EXCEPTION_COLLIDED_UNWIND 0x20
55
56 //
57 // Range and Range List Flags
58 //
59 #define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
60 #define RTL_RANGE_LIST_ADD_SHARED 0x00000002
61
62 #define RTL_RANGE_SHARED 0x01
63 #define RTL_RANGE_CONFLICT 0x02
64
65 //
66 // Registry Keys
67 //
68 #define RTL_REGISTRY_ABSOLUTE 0
69 #define RTL_REGISTRY_SERVICES 1
70 #define RTL_REGISTRY_CONTROL 2
71 #define RTL_REGISTRY_WINDOWS_NT 3
72 #define RTL_REGISTRY_DEVICEMAP 4
73 #define RTL_REGISTRY_USER 5
74 #define RTL_REGISTRY_MAXIMUM 6
75 #define RTL_REGISTRY_HANDLE 0x40000000
76 #define RTL_REGISTRY_OPTIONAL 0x80000000
77 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
78 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
79 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
80 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
81 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
82 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
83 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
84
85 //
86 // Versioning
87 //
88 #define VER_MINORVERSION 0x0000001
89 #define VER_MAJORVERSION 0x0000002
90 #define VER_BUILDNUMBER 0x0000004
91 #define VER_PLATFORMID 0x0000008
92 #define VER_SERVICEPACKMINOR 0x0000010
93 #define VER_SERVICEPACKMAJOR 0x0000020
94 #define VER_SUITENAME 0x0000040
95 #define VER_PRODUCT_TYPE 0x0000080
96 #define VER_PLATFORM_WIN32s 0
97 #define VER_PLATFORM_WIN32_WINDOWS 1
98 #define VER_PLATFORM_WIN32_NT 2
99 #define VER_EQUAL 1
100 #define VER_GREATER 2
101 #define VER_GREATER_EQUAL 3
102 #define VER_LESS 4
103 #define VER_LESS_EQUAL 5
104 #define VER_AND 6
105 #define VER_OR 7
106 #define VER_CONDITION_MASK 7
107 #define VER_NUM_BITS_PER_CONDITION_MASK 3
108
109 //
110 // Timezone IDs
111 //
112 #define TIME_ZONE_ID_UNKNOWN 0
113 #define TIME_ZONE_ID_STANDARD 1
114 #define TIME_ZONE_ID_DAYLIGHT 2
115 #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
116
117 //
118 // RTL Lock Type (Critical Section or Resource)
119 //
120 #define RTL_CRITSECT_TYPE 0
121 #define RTL_RESOURCE_TYPE 1
122
123 #ifdef NTOS_MODE_USER
124
125 //
126 // String Hash Algorithms
127 //
128 #define HASH_STRING_ALGORITHM_DEFAULT 0
129 #define HASH_STRING_ALGORITHM_X65599 1
130 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
131
132 //
133 // RtlDuplicateString Flags
134 //
135 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
136 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
137
138 //
139 // Codepages
140 //
141 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
142 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
143 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
144 #endif
145 #define MAXIMUM_LEADBYTES 12
146
147 //
148 // RTL Debug Queries
149 //
150 #define RTL_DEBUG_QUERY_MODULES 0x01
151 #define RTL_DEBUG_QUERY_BACKTRACES 0x02
152 #define RTL_DEBUG_QUERY_HEAPS 0x04
153 #define RTL_DEBUG_QUERY_HEAP_TAGS 0x08
154 #define RTL_DEBUG_QUERY_HEAP_BLOCKS 0x10
155 #define RTL_DEBUG_QUERY_LOCKS 0x20
156
157 //
158 // RTL Handle Flags
159 //
160 #define RTL_HANDLE_VALID 0x1
161
162 //
163 // RTL Atom Flags
164 //
165 #define RTL_ATOM_IS_PINNED 0x1
166
167 //
168 // Codepage Tags
169 //
170 #ifdef NTOS_MODE_USER
171 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
172 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
173
174 //
175 // Constant String Macro
176 //
177 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
178 { \
179 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
180 sizeof(__SOURCE_STRING__), \
181 (__SOURCE_STRING__) \
182 }
183
184 #endif
185
186 #ifdef NTOS_MODE_USER
187
188 //
189 // Table and Compare result types
190 //
191 typedef enum _TABLE_SEARCH_RESULT
192 {
193 TableEmptyTree,
194 TableFoundNode,
195 TableInsertAsLeft,
196 TableInsertAsRight
197 } TABLE_SEARCH_RESULT;
198
199 typedef enum _RTL_GENERIC_COMPARE_RESULTS
200 {
201 GenericLessThan,
202 GenericGreaterThan,
203 GenericEqual
204 } RTL_GENERIC_COMPARE_RESULTS;
205
206 #else
207
208 //
209 // ACL Query Information Classes
210 //
211 typedef enum _ACL_INFORMATION_CLASS
212 {
213 AclRevisionInformation = 1,
214 AclSizeInformation
215 } ACL_INFORMATION_CLASS;
216
217 #endif
218
219 //
220 // RTL Path Types
221 //
222 typedef enum _RTL_PATH_TYPE
223 {
224 INVALID_PATH = 0,
225 UNC_PATH, // "//foo"
226 ABSOLUTE_DRIVE_PATH, // "c:/foo"
227 RELATIVE_DRIVE_PATH, // "c:foo"
228 ABSOLUTE_PATH, // "/foo"
229 RELATIVE_PATH, // "foo"
230 DEVICE_PATH, // "//./foo"
231 UNC_DOT_PATH // "//."
232 } RTL_PATH_TYPE;
233
234 #ifndef NTOS_MODE_USER
235
236 //
237 // Callback function for RTL Timers or Registered Waits
238 //
239 typedef VOID
240 (NTAPI *WAITORTIMERCALLBACKFUNC)(
241 PVOID pvContext,
242 BOOLEAN fTimerOrWaitFired
243 );
244
245 //
246 // Handler during Vectored RTL Exceptions
247 //
248 typedef LONG
249 (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
250 PEXCEPTION_POINTERS ExceptionPointers
251 );
252
253 #else
254
255 //
256 // Handler during regular RTL Exceptions
257 //
258 typedef EXCEPTION_DISPOSITION
259 (NTAPI *PEXCEPTION_ROUTINE)(
260 IN struct _EXCEPTION_RECORD *ExceptionRecord,
261 IN PVOID EstablisherFrame,
262 IN OUT struct _CONTEXT *ContextRecord,
263 IN OUT PVOID DispatcherContext
264 );
265
266 #endif
267
268 //
269 // Callback for RTL Heap Enumeration
270 //
271 typedef NTSTATUS
272 (*PHEAP_ENUMERATION_ROUTINE)(
273 IN PVOID HeapHandle,
274 IN PVOID UserParam
275 );
276
277 //
278 // Thread and Process Start Routines for RtlCreateUserThread/Process
279 //
280 typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
281 PVOID Parameter
282 );
283
284 typedef VOID
285 (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
286 PTHREAD_START_ROUTINE StartAddress,
287 PVOID Parameter
288 );
289
290 //
291 // Declare empty structure definitions so that they may be referenced by
292 // routines before they are defined
293 //
294 struct _RTL_AVL_TABLE;
295 struct _RTL_GENERIC_TABLE;
296 struct _RTL_RANGE;
297 typedef struct _COMPRESSED_DATA_INFO COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
298
299 //
300 // Routines and callbacks for the RTL AVL/Generic Table package
301 //
302 typedef NTSTATUS
303 (NTAPI *PRTL_AVL_MATCH_FUNCTION)(
304 struct _RTL_AVL_TABLE *Table,
305 PVOID UserData,
306 PVOID MatchData
307 );
308
309 typedef RTL_GENERIC_COMPARE_RESULTS
310 (NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
311 struct _RTL_AVL_TABLE *Table,
312 PVOID FirstStruct,
313 PVOID SecondStruct
314 );
315
316 typedef RTL_GENERIC_COMPARE_RESULTS
317 (NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
318 struct _RTL_GENERIC_TABLE *Table,
319 PVOID FirstStruct,
320 PVOID SecondStruct
321 );
322
323 typedef PVOID
324 (NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
325 struct _RTL_GENERIC_TABLE *Table,
326 CLONG ByteSize
327 );
328
329 typedef VOID
330 (NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
331 struct _RTL_GENERIC_TABLE *Table,
332 PVOID Buffer
333 );
334
335 typedef PVOID
336 (NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
337 struct _RTL_AVL_TABLE *Table,
338 CLONG ByteSize
339 );
340
341 typedef VOID
342 (NTAPI *PRTL_AVL_FREE_ROUTINE) (
343 struct _RTL_AVL_TABLE *Table,
344 PVOID Buffer
345 );
346
347 //
348 // RTL Query Registry callback
349 //
350 typedef NTSTATUS
351 (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
352 IN PWSTR ValueName,
353 IN ULONG ValueType,
354 IN PVOID ValueData,
355 IN ULONG ValueLength,
356 IN PVOID Context,
357 IN PVOID EntryContext
358 );
359
360 //
361 // RTL Range List callbacks
362 //
363 #ifdef NTOS_MODE_USER
364 typedef BOOLEAN
365 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK)(
366 PVOID Context,
367 struct _RTL_RANGE *Range
368 );
369
370 //
371 // Custom Heap Commit Routine for RtlCreateHeap
372 //
373 typedef NTSTATUS
374 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
375 IN PVOID Base,
376 IN OUT PVOID *CommitAddress,
377 IN OUT PSIZE_T CommitSize
378 );
379
380 //
381 // Version Info redefinitions
382 //
383 typedef OSVERSIONINFOW RTL_OSVERSIONINFOW;
384 typedef LPOSVERSIONINFOW PRTL_OSVERSIONINFOW;
385 typedef OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
386 typedef LPOSVERSIONINFOEXW PRTL_OSVERSIONINFOEXW;
387
388 //
389 // Simple pointer definitions
390 //
391 typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION;
392 typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
393
394 //
395 // Parameters for RtlCreateHeap
396 //
397 typedef struct _RTL_HEAP_PARAMETERS
398 {
399 ULONG Length;
400 SIZE_T SegmentReserve;
401 SIZE_T SegmentCommit;
402 SIZE_T DeCommitFreeBlockThreshold;
403 SIZE_T DeCommitTotalFreeThreshold;
404 SIZE_T MaximumAllocationSize;
405 SIZE_T VirtualMemoryThreshold;
406 SIZE_T InitialCommit;
407 SIZE_T InitialReserve;
408 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
409 SIZE_T Reserved[2];
410 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
411
412 //
413 // RTL Bitmap structures
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 //
428 // RtlGenerateXxxName context
429 //
430 typedef struct _GENERATE_NAME_CONTEXT
431 {
432 USHORT Checksum;
433 BOOLEAN CheckSumInserted;
434 UCHAR NameLength;
435 WCHAR NameBuffer[8];
436 ULONG ExtensionLength;
437 WCHAR ExtensionBuffer[4];
438 ULONG LastIndexValue;
439 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
440
441 //
442 // RTL Splay and Balanced Links structures
443 //
444 typedef struct _RTL_SPLAY_LINKS
445 {
446 struct _RTL_SPLAY_LINKS *Parent;
447 struct _RTL_SPLAY_LINKS *LeftChild;
448 struct _RTL_SPLAY_LINKS *RightChild;
449 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
450
451 typedef struct _RTL_BALANCED_LINKS
452 {
453 struct _RTL_BALANCED_LINKS *Parent;
454 struct _RTL_BALANCED_LINKS *LeftChild;
455 struct _RTL_BALANCED_LINKS *RightChild;
456 CHAR Balance;
457 UCHAR Reserved[3];
458 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
459
460 //
461 // RTL Avl/Generic Tables
462 //
463 typedef struct _RTL_GENERIC_TABLE
464 {
465 PRTL_SPLAY_LINKS TableRoot;
466 LIST_ENTRY InsertOrderList;
467 PLIST_ENTRY OrderedPointer;
468 ULONG WhichOrderedElement;
469 ULONG NumberGenericTableElements;
470 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
471 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
472 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
473 PVOID TableContext;
474 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
475
476 typedef struct _RTL_AVL_TABLE
477 {
478 RTL_BALANCED_LINKS BalancedRoot;
479 PVOID OrderedPointer;
480 ULONG WhichOrderedElement;
481 ULONG NumberGenericTableElements;
482 ULONG DepthOfTree;
483 PRTL_BALANCED_LINKS RestartKey;
484 ULONG DeleteCount;
485 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
486 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
487 PRTL_AVL_FREE_ROUTINE FreeRoutine;
488 PVOID TableContext;
489 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
490
491 //
492 // RtlQueryRegistry Data
493 //
494 typedef struct _RTL_QUERY_REGISTRY_TABLE
495 {
496 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
497 ULONG Flags;
498 PWSTR Name;
499 PVOID EntryContext;
500 ULONG DefaultType;
501 PVOID DefaultData;
502 ULONG DefaultLength;
503 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
504
505 //
506 // RTL Unicode Table Structures
507 //
508 typedef struct _UNICODE_PREFIX_TABLE_ENTRY
509 {
510 CSHORT NodeTypeCode;
511 CSHORT NameLength;
512 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
513 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
514 RTL_SPLAY_LINKS Links;
515 PUNICODE_STRING Prefix;
516 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
517
518 typedef struct _UNICODE_PREFIX_TABLE
519 {
520 CSHORT NodeTypeCode;
521 CSHORT NameLength;
522 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
523 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
524 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
525
526 //
527 // Time Structure for RTL Time calls
528 //
529 typedef struct _TIME_FIELDS
530 {
531 CSHORT Year;
532 CSHORT Month;
533 CSHORT Day;
534 CSHORT Hour;
535 CSHORT Minute;
536 CSHORT Second;
537 CSHORT Milliseconds;
538 CSHORT Weekday;
539 } TIME_FIELDS, *PTIME_FIELDS;
540 #endif
541
542 //
543 // ACE Definition
544 //
545 typedef struct _ACE
546 {
547 ACE_HEADER Header;
548 ACCESS_MASK AccessMask;
549 } ACE, *PACE;
550
551 //
552 // Information Structures for RTL Debug Functions
553 //
554 typedef struct _RTL_PROCESS_MODULE_INFORMATION
555 {
556 ULONG Reserved[2];
557 PVOID Base;
558 ULONG Size;
559 ULONG Flags;
560 USHORT Index;
561 USHORT Unknown;
562 USHORT LoadCount;
563 USHORT ModuleNameOffset;
564 CHAR ImageName[256];
565 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
566
567 typedef struct _RTL_PROCESS_MODULES
568 {
569 ULONG ModuleCount;
570 RTL_PROCESS_MODULE_INFORMATION ModuleEntry[1];
571 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
572
573 typedef struct _RTL_PROCESS_HEAP_INFORMATION
574 {
575 PVOID Base;
576 ULONG Flags;
577 USHORT Granularity;
578 USHORT Unknown;
579 ULONG Allocated;
580 ULONG Committed;
581 ULONG TagCount;
582 ULONG BlockCount;
583 ULONG Reserved[7];
584 PVOID Tags;
585 PVOID Blocks;
586 } RTL_PROCESS_HEAP_INFORMATION, *PRTL_PROCESS_HEAP_INFORMATION;
587
588 typedef struct _RTL_PROCESS_HEAPS
589 {
590 ULONG HeapCount;
591 RTL_PROCESS_HEAP_INFORMATION HeapEntry[1];
592 } RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;
593
594 typedef struct _RTL_PROCESS_LOCK_INFORMATION
595 {
596 PVOID Address;
597 USHORT Type;
598 USHORT CreatorBackTraceIndex;
599 ULONG OwnerThreadId;
600 ULONG ActiveCount;
601 ULONG ContentionCount;
602 ULONG EntryCount;
603 ULONG RecursionCount;
604 ULONG NumberOfSharedWaiters;
605 ULONG NumberOfExclusiveWaiters;
606 } RTL_PROCESS_LOCK_INFORMATION, *PRTL_PROCESS_LOCK_INFORMATION;
607
608 typedef struct _RTL_PROCESS_LOCKS
609 {
610 ULONG LockCount;
611 RTL_PROCESS_LOCK_INFORMATION LockEntry[1];
612 } RTL_PROCESS_LOCKS, *PRTL_PROCESS_LOCKS;
613
614 typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
615 {
616 /* FIXME */
617 ULONG Unknown;
618 } RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
619
620 typedef struct _RTL_PROCESS_BACKTRACES
621 {
622 ULONG BackTraceCount;
623 RTL_PROCESS_BACKTRACE_INFORMATION BackTraceEntry[1];
624 } RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
625
626 typedef struct _RTL_DEBUG_BUFFER
627 {
628 HANDLE SectionHandle;
629 PVOID SectionBase;
630 PVOID RemoteSectionBase;
631 ULONG SectionBaseDelta;
632 HANDLE EventPairHandle;
633 ULONG Unknown[2];
634 HANDLE RemoteThreadHandle;
635 ULONG InfoClassMask;
636 ULONG SizeOfInfo;
637 ULONG AllocatedSize;
638 ULONG SectionSize;
639 PRTL_PROCESS_MODULES ModuleInformation;
640 PRTL_PROCESS_BACKTRACES BackTraceInformation;
641 PRTL_PROCESS_HEAPS HeapInformation;
642 PRTL_PROCESS_LOCKS LockInformation;
643 PVOID Reserved[8];
644 } RTL_DEBUG_BUFFER, *PRTL_DEBUG_BUFFER;
645
646 //
647 // RTL Handle Structures
648 //
649 typedef struct _RTL_HANDLE_TABLE_ENTRY
650 {
651 ULONG Flags;
652 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
653 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
654
655 typedef struct _RTL_HANDLE_TABLE
656 {
657 ULONG MaximumNumberOfHandles;
658 ULONG SizeOfHandleTableEntry;
659 ULONG Reserved[2];
660 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
661 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
662 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
663 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
664 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
665
666 //
667 // Exception Record
668 //
669 typedef struct _EXCEPTION_REGISTRATION_RECORD
670 {
671 struct _EXCEPTION_REGISTRATION_RECORD *Next;
672 PEXCEPTION_HANDLER Handler;
673 } EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
674
675 //
676 // Current Directory Structures
677 //
678 typedef struct _CURDIR
679 {
680 UNICODE_STRING DosPath;
681 HANDLE Handle;
682 } CURDIR, *PCURDIR;
683
684 typedef struct RTL_DRIVE_LETTER_CURDIR
685 {
686 USHORT Flags;
687 USHORT Length;
688 ULONG TimeStamp;
689 UNICODE_STRING DosPath;
690 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
691
692 #ifndef NTOS_MODE_USER
693
694 //
695 // RTL Critical Section Structures
696 //
697 typedef struct _RTL_CRITICAL_SECTION_DEBUG
698 {
699 USHORT Type;
700 USHORT CreatorBackTraceIndex;
701 struct _RTL_CRITICAL_SECTION *CriticalSection;
702 LIST_ENTRY ProcessLocksList;
703 ULONG EntryCount;
704 ULONG ContentionCount;
705 ULONG Spare[2];
706 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
707
708 typedef struct _RTL_CRITICAL_SECTION
709 {
710 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
711 LONG LockCount;
712 LONG RecursionCount;
713 HANDLE OwningThread;
714 HANDLE LockSemaphore;
715 ULONG_PTR SpinCount;
716 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
717
718 #else
719
720 //
721 // RTL Range List Structures
722 //
723 typedef struct _RTL_RANGE_LIST
724 {
725 LIST_ENTRY ListHead;
726 ULONG Flags;
727 ULONG Count;
728 ULONG Stamp;
729 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
730
731 typedef struct _RTL_RANGE
732 {
733 ULONGLONG Start;
734 ULONGLONG End;
735 PVOID UserData;
736 PVOID Owner;
737 UCHAR Attributes;
738 UCHAR Flags;
739 } RTL_RANGE, *PRTL_RANGE;
740
741 typedef struct _RANGE_LIST_ITERATOR
742 {
743 PLIST_ENTRY RangeListHead;
744 PLIST_ENTRY MergedHead;
745 PVOID Current;
746 ULONG Stamp;
747 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
748
749 #endif
750
751 //
752 // RTL Resource
753 //
754 typedef struct _RTL_RESOURCE
755 {
756 RTL_CRITICAL_SECTION Lock;
757 HANDLE SharedSemaphore;
758 ULONG SharedWaiters;
759 HANDLE ExclusiveSemaphore;
760 ULONG ExclusiveWaiters;
761 LONG NumberActive;
762 HANDLE OwningThread;
763 ULONG TimeoutBoost;
764 PVOID DebugInfo;
765 } RTL_RESOURCE, *PRTL_RESOURCE;
766
767 //
768 // RTL Message Structures for PE Resources
769 //
770 typedef struct _RTL_MESSAGE_RESOURCE_ENTRY
771 {
772 USHORT Length;
773 USHORT Flags;
774 CHAR Text[1];
775 } RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY;
776
777 typedef struct _RTL_MESSAGE_RESOURCE_BLOCK
778 {
779 ULONG LowId;
780 ULONG HighId;
781 ULONG OffsetToEntries;
782 } RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK;
783
784 typedef struct _RTL_MESSAGE_RESOURCE_DATA
785 {
786 ULONG NumberOfBlocks;
787 RTL_MESSAGE_RESOURCE_BLOCK Blocks[1];
788 } RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA;
789
790 //
791 // Structures for RtlCreateUserProcess
792 //
793 typedef struct _RTL_USER_PROCESS_PARAMETERS
794 {
795 ULONG MaximumLength;
796 ULONG Length;
797 ULONG Flags;
798 ULONG DebugFlags;
799 HANDLE ConsoleHandle;
800 ULONG ConsoleFlags;
801 HANDLE StandardInput;
802 HANDLE StandardOutput;
803 HANDLE StandardError;
804 CURDIR CurrentDirectory;
805 UNICODE_STRING DllPath;
806 UNICODE_STRING ImagePathName;
807 UNICODE_STRING CommandLine;
808 PWSTR Environment;
809 ULONG StartingX;
810 ULONG StartingY;
811 ULONG CountX;
812 ULONG CountY;
813 ULONG CountCharsX;
814 ULONG CountCharsY;
815 ULONG FillAttribute;
816 ULONG WindowFlags;
817 ULONG ShowWindowFlags;
818 UNICODE_STRING WindowTitle;
819 UNICODE_STRING DesktopInfo;
820 UNICODE_STRING ShellInfo;
821 UNICODE_STRING RuntimeData;
822 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
823 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
824
825 typedef struct _RTL_USER_PROCESS_INFORMATION
826 {
827 ULONG Size;
828 HANDLE ProcessHandle;
829 HANDLE ThreadHandle;
830 CLIENT_ID ClientId;
831 SECTION_IMAGE_INFORMATION ImageInformation;
832 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
833
834 //
835 // RTL Atom Table Structures
836 //
837 typedef struct _RTL_ATOM_TABLE_ENTRY
838 {
839 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
840 USHORT HandleIndex;
841 USHORT Atom;
842 USHORT ReferenceCount;
843 UCHAR Flags;
844 UCHAR NameLength;
845 WCHAR Name[1];
846 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
847
848 typedef struct _RTL_ATOM_TABLE
849 {
850 ULONG Signature;
851 union
852 {
853 #ifdef NTOS_MODE_USER
854 RTL_CRITICAL_SECTION CriticalSection;
855 #else
856 FAST_MUTEX FastMutex;
857 #endif
858 };
859 union
860 {
861 #ifdef NTOS_MODE_USER
862 RTL_HANDLE_TABLE RtlHandleTable;
863 #else
864 PHANDLE_TABLE ExHandleTable;
865 #endif
866 };
867 ULONG NumberOfBuckets;
868 PRTL_ATOM_TABLE_ENTRY Buckets[1];
869 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
870
871 #ifndef NTOS_MODE_USER
872
873 //
874 // System Time and Timezone Structures
875 //
876 typedef struct _SYSTEMTIME
877 {
878 USHORT wYear;
879 USHORT wMonth;
880 USHORT wDayOfWeek;
881 USHORT wDay;
882 USHORT wHour;
883 USHORT wMinute;
884 USHORT wSecond;
885 USHORT wMilliseconds;
886 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
887
888 typedef struct _TIME_ZONE_INFORMATION
889 {
890 LONG Bias;
891 WCHAR StandardName[32];
892 SYSTEMTIME StandardDate;
893 LONG StandardBias;
894 WCHAR DaylightName[32];
895 SYSTEMTIME DaylightDate;
896 LONG DaylightBias;
897 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
898
899 #endif
900
901 //
902 // Header for NLS Files
903 //
904 typedef struct _NLS_FILE_HEADER
905 {
906 USHORT HeaderSize;
907 USHORT CodePage;
908 USHORT MaximumCharacterSize;
909 USHORT DefaultChar;
910 USHORT UniDefaultChar;
911 USHORT TransDefaultChar;
912 USHORT TransUniDefaultChar;
913 USHORT DBCSCodePage;
914 UCHAR LeadByte[MAXIMUM_LEADBYTES];
915 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
916
917 #endif