Fix msvc/gcc NDK problem
[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
116 //
117 // RTL Lock Type (Critical Section or Resource)
118 //
119 #define RTL_CRITSECT_TYPE 0
120 #define RTL_RESOURCE_TYPE 1
121
122 #ifdef NTOS_MODE_USER
123
124 //
125 // String Hash Algorithms
126 //
127 #define HASH_STRING_ALGORITHM_DEFAULT 0
128 #define HASH_STRING_ALGORITHM_X65599 1
129 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
130
131 //
132 // RtlDuplicateString Flags
133 //
134 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
135 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
136
137 //
138 // Codepages
139 //
140 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
141 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
142 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
143 #endif
144 #define MAXIMUM_LEADBYTES 12
145
146 //
147 // RTL Debug Queries
148 //
149 #define RTL_DEBUG_QUERY_MODULES 0x01
150 #define RTL_DEBUG_QUERY_BACKTRACES 0x02
151 #define RTL_DEBUG_QUERY_HEAPS 0x04
152 #define RTL_DEBUG_QUERY_HEAP_TAGS 0x08
153 #define RTL_DEBUG_QUERY_HEAP_BLOCKS 0x10
154 #define RTL_DEBUG_QUERY_LOCKS 0x20
155
156 //
157 // RTL Handle Flags
158 //
159 #define RTL_HANDLE_VALID 0x1
160
161 //
162 // RTL Atom Flags
163 //
164 #define RTL_ATOM_IS_PINNED 0x1
165
166 //
167 // Codepage Tags
168 //
169 #ifdef NTOS_MODE_USER
170 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
171 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
172
173 //
174 // Constant String Macro
175 //
176 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
177 { \
178 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
179 sizeof(__SOURCE_STRING__), \
180 (__SOURCE_STRING__) \
181 }
182
183 #endif
184
185 #ifdef NTOS_MODE_USER
186
187 //
188 // Table and Compare result types
189 //
190 typedef enum _TABLE_SEARCH_RESULT
191 {
192 TableEmptyTree,
193 TableFoundNode,
194 TableInsertAsLeft,
195 TableInsertAsRight
196 } TABLE_SEARCH_RESULT;
197
198 typedef enum _RTL_GENERIC_COMPARE_RESULTS
199 {
200 GenericLessThan,
201 GenericGreaterThan,
202 GenericEqual
203 } RTL_GENERIC_COMPARE_RESULTS;
204
205 #else
206
207 //
208 // ACL Query Information Classes
209 //
210 typedef enum _ACL_INFORMATION_CLASS
211 {
212 AclRevisionInformation = 1,
213 AclSizeInformation
214 } ACL_INFORMATION_CLASS;
215
216 #endif
217
218 //
219 // RTL Path Types
220 //
221 typedef enum _RTL_PATH_TYPE
222 {
223 INVALID_PATH = 0,
224 UNC_PATH, // "//foo"
225 ABSOLUTE_DRIVE_PATH, // "c:/foo"
226 RELATIVE_DRIVE_PATH, // "c:foo"
227 ABSOLUTE_PATH, // "/foo"
228 RELATIVE_PATH, // "foo"
229 DEVICE_PATH, // "//./foo"
230 UNC_DOT_PATH // "//."
231 } RTL_PATH_TYPE;
232
233 #ifndef NTOS_MODE_USER
234
235 //
236 // Callback function for RTL Timers or Registered Waits
237 //
238 typedef VOID
239 (NTAPI *WAITORTIMERCALLBACKFUNC)(
240 PVOID pvContext,
241 BOOLEAN fTimerOrWaitFired
242 );
243
244 //
245 // Handler during Vectored RTL Exceptions
246 //
247 typedef LONG
248 (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
249 PEXCEPTION_POINTERS ExceptionPointers
250 );
251
252 #else
253
254 //
255 // Handler during regular RTL Exceptions
256 //
257 typedef EXCEPTION_DISPOSITION
258 (NTAPI *PEXCEPTION_ROUTINE)(
259 IN struct _EXCEPTION_RECORD *ExceptionRecord,
260 IN PVOID EstablisherFrame,
261 IN OUT struct _CONTEXT *ContextRecord,
262 IN OUT PVOID DispatcherContext
263 );
264
265 #endif
266
267 //
268 // Callback for RTL Heap Enumeration
269 //
270 typedef NTSTATUS
271 (*PHEAP_ENUMERATION_ROUTINE)(
272 IN PVOID HeapHandle,
273 IN PVOID UserParam
274 );
275
276 //
277 // Thread and Process Start Routines for RtlCreateUserThread/Process
278 //
279 typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
280 PVOID Parameter
281 );
282
283 typedef VOID
284 (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
285 PTHREAD_START_ROUTINE StartAddress,
286 PVOID Parameter
287 );
288
289 //
290 // Declare empty structure definitions so that they may be referenced by
291 // routines before they are defined
292 //
293 struct _RTL_AVL_TABLE;
294 struct _RTL_GENERIC_TABLE;
295 struct _RTL_RANGE;
296 typedef struct _COMPRESSED_DATA_INFO COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
297
298 //
299 // Routines and callbacks for the RTL AVL/Generic Table package
300 //
301 typedef NTSTATUS
302 (NTAPI *PRTL_AVL_MATCH_FUNCTION)(
303 struct _RTL_AVL_TABLE *Table,
304 PVOID UserData,
305 PVOID MatchData
306 );
307
308 typedef RTL_GENERIC_COMPARE_RESULTS
309 (NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
310 struct _RTL_AVL_TABLE *Table,
311 PVOID FirstStruct,
312 PVOID SecondStruct
313 );
314
315 typedef RTL_GENERIC_COMPARE_RESULTS
316 (NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
317 struct _RTL_GENERIC_TABLE *Table,
318 PVOID FirstStruct,
319 PVOID SecondStruct
320 );
321
322 typedef PVOID
323 (NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
324 struct _RTL_GENERIC_TABLE *Table,
325 CLONG ByteSize
326 );
327
328 typedef VOID
329 (NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
330 struct _RTL_GENERIC_TABLE *Table,
331 PVOID Buffer
332 );
333
334 typedef PVOID
335 (NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
336 struct _RTL_AVL_TABLE *Table,
337 CLONG ByteSize
338 );
339
340 typedef VOID
341 (NTAPI *PRTL_AVL_FREE_ROUTINE) (
342 struct _RTL_AVL_TABLE *Table,
343 PVOID Buffer
344 );
345
346 //
347 // RTL Query Registry callback
348 //
349 typedef NTSTATUS
350 (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
351 IN PWSTR ValueName,
352 IN ULONG ValueType,
353 IN PVOID ValueData,
354 IN ULONG ValueLength,
355 IN PVOID Context,
356 IN PVOID EntryContext
357 );
358
359 //
360 // RTL Range List callbacks
361 //
362 #ifdef NTOS_MODE_USER
363 typedef BOOLEAN
364 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK)(
365 PVOID Context,
366 struct _RTL_RANGE *Range
367 );
368
369 //
370 // Custom Heap Commit Routine for RtlCreateHeap
371 //
372 typedef NTSTATUS
373 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
374 IN PVOID Base,
375 IN OUT PVOID *CommitAddress,
376 IN OUT PSIZE_T CommitSize
377 );
378
379 //
380 // Version Info redefinitions
381 //
382 typedef OSVERSIONINFOW RTL_OSVERSIONINFOW;
383 typedef LPOSVERSIONINFOW PRTL_OSVERSIONINFOW;
384 typedef OSVERSIONINFOEXW RTL_OSVERSIONINFOEXW;
385 typedef LPOSVERSIONINFOEXW PRTL_OSVERSIONINFOEXW;
386
387 //
388 // Simple pointer definitions
389 //
390 typedef ACL_REVISION_INFORMATION *PACL_REVISION_INFORMATION;
391 typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
392
393 //
394 // Parameters for RtlCreateHeap
395 //
396 typedef struct _RTL_HEAP_PARAMETERS
397 {
398 ULONG Length;
399 SIZE_T SegmentReserve;
400 SIZE_T SegmentCommit;
401 SIZE_T DeCommitFreeBlockThreshold;
402 SIZE_T DeCommitTotalFreeThreshold;
403 SIZE_T MaximumAllocationSize;
404 SIZE_T VirtualMemoryThreshold;
405 SIZE_T InitialCommit;
406 SIZE_T InitialReserve;
407 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
408 SIZE_T Reserved[2];
409 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
410
411 //
412 // RTL Bitmap structures
413 //
414 typedef struct _RTL_BITMAP
415 {
416 ULONG SizeOfBitMap;
417 PULONG Buffer;
418 } RTL_BITMAP, *PRTL_BITMAP;
419
420 typedef struct _RTL_BITMAP_RUN
421 {
422 ULONG StartingIndex;
423 ULONG NumberOfBits;
424 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
425
426 //
427 // RtlGenerateXxxName context
428 //
429 typedef struct _GENERATE_NAME_CONTEXT
430 {
431 USHORT Checksum;
432 BOOLEAN CheckSumInserted;
433 UCHAR NameLength;
434 WCHAR NameBuffer[8];
435 ULONG ExtensionLength;
436 WCHAR ExtensionBuffer[4];
437 ULONG LastIndexValue;
438 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
439
440 //
441 // RTL Splay and Balanced Links structures
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 struct _RTL_BALANCED_LINKS
451 {
452 struct _RTL_BALANCED_LINKS *Parent;
453 struct _RTL_BALANCED_LINKS *LeftChild;
454 struct _RTL_BALANCED_LINKS *RightChild;
455 CHAR Balance;
456 UCHAR Reserved[3];
457 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
458
459 //
460 // RTL Avl/Generic Tables
461 //
462 typedef struct _RTL_GENERIC_TABLE
463 {
464 PRTL_SPLAY_LINKS TableRoot;
465 LIST_ENTRY InsertOrderList;
466 PLIST_ENTRY OrderedPointer;
467 ULONG WhichOrderedElement;
468 ULONG NumberGenericTableElements;
469 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
470 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
471 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
472 PVOID TableContext;
473 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
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 //
491 // RtlQueryRegistry Data
492 //
493 typedef struct _RTL_QUERY_REGISTRY_TABLE
494 {
495 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
496 ULONG Flags;
497 PWSTR Name;
498 PVOID EntryContext;
499 ULONG DefaultType;
500 PVOID DefaultData;
501 ULONG DefaultLength;
502 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
503
504 //
505 // RTL Unicode Table Structures
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 //
526 // Time Structure for RTL Time calls
527 //
528 typedef struct _TIME_FIELDS
529 {
530 CSHORT Year;
531 CSHORT Month;
532 CSHORT Day;
533 CSHORT Hour;
534 CSHORT Minute;
535 CSHORT Second;
536 CSHORT Milliseconds;
537 CSHORT Weekday;
538 } TIME_FIELDS, *PTIME_FIELDS;
539 #endif
540
541 //
542 // ACE Definition
543 //
544 typedef struct _ACE
545 {
546 ACE_HEADER Header;
547 ACCESS_MASK AccessMask;
548 } ACE, *PACE;
549
550 //
551 // Information Structures for RTL Debug Functions
552 //
553 typedef struct _RTL_PROCESS_MODULE_INFORMATION
554 {
555 ULONG Reserved[2];
556 PVOID Base;
557 ULONG Size;
558 ULONG Flags;
559 USHORT Index;
560 USHORT Unknown;
561 USHORT LoadCount;
562 USHORT ModuleNameOffset;
563 CHAR ImageName[256];
564 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
565
566 typedef struct _RTL_PROCESS_MODULES
567 {
568 ULONG ModuleCount;
569 RTL_PROCESS_MODULE_INFORMATION ModuleEntry[1];
570 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
571
572 typedef struct _RTL_PROCESS_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 } RTL_PROCESS_HEAP_INFORMATION, *PRTL_PROCESS_HEAP_INFORMATION;
586
587 typedef struct _RTL_PROCESS_HEAPS
588 {
589 ULONG HeapCount;
590 RTL_PROCESS_HEAP_INFORMATION HeapEntry[1];
591 } RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;
592
593 typedef struct _RTL_PROCESS_LOCK_INFORMATION
594 {
595 PVOID Address;
596 USHORT Type;
597 USHORT CreatorBackTraceIndex;
598 ULONG OwnerThreadId;
599 ULONG ActiveCount;
600 ULONG ContentionCount;
601 ULONG EntryCount;
602 ULONG RecursionCount;
603 ULONG NumberOfSharedWaiters;
604 ULONG NumberOfExclusiveWaiters;
605 } RTL_PROCESS_LOCK_INFORMATION, *PRTL_PROCESS_LOCK_INFORMATION;
606
607 typedef struct _RTL_PROCESS_LOCKS
608 {
609 ULONG LockCount;
610 RTL_PROCESS_LOCK_INFORMATION LockEntry[1];
611 } RTL_PROCESS_LOCKS, *PRTL_PROCESS_LOCKS;
612
613 typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
614 {
615 /* FIXME */
616 ULONG Unknown;
617 } RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
618
619 typedef struct _RTL_PROCESS_BACKTRACES
620 {
621 ULONG BackTraceCount;
622 RTL_PROCESS_BACKTRACE_INFORMATION BackTraceEntry[1];
623 } RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
624
625 typedef struct _RTL_DEBUG_BUFFER
626 {
627 HANDLE SectionHandle;
628 PVOID SectionBase;
629 PVOID RemoteSectionBase;
630 ULONG SectionBaseDelta;
631 HANDLE EventPairHandle;
632 ULONG Unknown[2];
633 HANDLE RemoteThreadHandle;
634 ULONG InfoClassMask;
635 ULONG SizeOfInfo;
636 ULONG AllocatedSize;
637 ULONG SectionSize;
638 PRTL_PROCESS_MODULES ModuleInformation;
639 PRTL_PROCESS_BACKTRACES BackTraceInformation;
640 PRTL_PROCESS_HEAPS HeapInformation;
641 PRTL_PROCESS_LOCKS LockInformation;
642 PVOID Reserved[8];
643 } RTL_DEBUG_BUFFER, *PRTL_DEBUG_BUFFER;
644
645 //
646 // RTL Handle Structures
647 //
648 typedef struct _RTL_HANDLE_TABLE_ENTRY
649 {
650 ULONG Flags;
651 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
652 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
653
654 typedef struct _RTL_HANDLE_TABLE
655 {
656 ULONG MaximumNumberOfHandles;
657 ULONG SizeOfHandleTableEntry;
658 ULONG Reserved[2];
659 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
660 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
661 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
662 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
663 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
664
665 //
666 // Exception Record
667 //
668 typedef struct _EXCEPTION_REGISTRATION_RECORD
669 {
670 struct _EXCEPTION_REGISTRATION_RECORD *Next;
671 PEXCEPTION_ROUTINE Handler;
672 } EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
673
674 //
675 // Current Directory Structures
676 //
677 typedef struct _CURDIR
678 {
679 UNICODE_STRING DosPath;
680 HANDLE Handle;
681 } CURDIR, *PCURDIR;
682
683 typedef struct RTL_DRIVE_LETTER_CURDIR
684 {
685 USHORT Flags;
686 USHORT Length;
687 ULONG TimeStamp;
688 UNICODE_STRING DosPath;
689 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
690
691 #ifndef NTOS_MODE_USER
692
693 //
694 // RTL Critical Section Structures
695 //
696 typedef struct _RTL_CRITICAL_SECTION_DEBUG
697 {
698 USHORT Type;
699 USHORT CreatorBackTraceIndex;
700 struct _RTL_CRITICAL_SECTION *CriticalSection;
701 LIST_ENTRY ProcessLocksList;
702 ULONG EntryCount;
703 ULONG ContentionCount;
704 ULONG Spare[2];
705 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
706
707 typedef struct _RTL_CRITICAL_SECTION
708 {
709 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
710 LONG LockCount;
711 LONG RecursionCount;
712 HANDLE OwningThread;
713 HANDLE LockSemaphore;
714 ULONG_PTR SpinCount;
715 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
716
717 #else
718
719 //
720 // RTL Range List Structures
721 //
722 typedef struct _RTL_RANGE_LIST
723 {
724 LIST_ENTRY ListHead;
725 ULONG Flags;
726 ULONG Count;
727 ULONG Stamp;
728 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
729
730 typedef struct _RTL_RANGE
731 {
732 ULONGLONG Start;
733 ULONGLONG End;
734 PVOID UserData;
735 PVOID Owner;
736 UCHAR Attributes;
737 UCHAR Flags;
738 } RTL_RANGE, *PRTL_RANGE;
739
740 typedef struct _RANGE_LIST_ITERATOR
741 {
742 PLIST_ENTRY RangeListHead;
743 PLIST_ENTRY MergedHead;
744 PVOID Current;
745 ULONG Stamp;
746 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
747
748 #endif
749
750 //
751 // RTL Resource
752 //
753 typedef struct _RTL_RESOURCE
754 {
755 RTL_CRITICAL_SECTION Lock;
756 HANDLE SharedSemaphore;
757 ULONG SharedWaiters;
758 HANDLE ExclusiveSemaphore;
759 ULONG ExclusiveWaiters;
760 LONG NumberActive;
761 HANDLE OwningThread;
762 ULONG TimeoutBoost;
763 PVOID DebugInfo;
764 } RTL_RESOURCE, *PRTL_RESOURCE;
765
766 //
767 // RTL Message Structures for PE Resources
768 //
769 typedef struct _RTL_MESSAGE_RESOURCE_ENTRY
770 {
771 USHORT Length;
772 USHORT Flags;
773 CHAR Text[1];
774 } RTL_MESSAGE_RESOURCE_ENTRY, *PRTL_MESSAGE_RESOURCE_ENTRY;
775
776 typedef struct _RTL_MESSAGE_RESOURCE_BLOCK
777 {
778 ULONG LowId;
779 ULONG HighId;
780 ULONG OffsetToEntries;
781 } RTL_MESSAGE_RESOURCE_BLOCK, *PRTL_MESSAGE_RESOURCE_BLOCK;
782
783 typedef struct _RTL_MESSAGE_RESOURCE_DATA
784 {
785 ULONG NumberOfBlocks;
786 RTL_MESSAGE_RESOURCE_BLOCK Blocks[1];
787 } RTL_MESSAGE_RESOURCE_DATA, *PRTL_MESSAGE_RESOURCE_DATA;
788
789 //
790 // Structures for RtlCreateUserProcess
791 //
792 typedef struct _RTL_USER_PROCESS_PARAMETERS
793 {
794 ULONG MaximumLength;
795 ULONG Length;
796 ULONG Flags;
797 ULONG DebugFlags;
798 HANDLE ConsoleHandle;
799 ULONG ConsoleFlags;
800 HANDLE StandardInput;
801 HANDLE StandardOutput;
802 HANDLE StandardError;
803 CURDIR CurrentDirectory;
804 UNICODE_STRING DllPath;
805 UNICODE_STRING ImagePathName;
806 UNICODE_STRING CommandLine;
807 PWSTR Environment;
808 ULONG StartingX;
809 ULONG StartingY;
810 ULONG CountX;
811 ULONG CountY;
812 ULONG CountCharsX;
813 ULONG CountCharsY;
814 ULONG FillAttribute;
815 ULONG WindowFlags;
816 ULONG ShowWindowFlags;
817 UNICODE_STRING WindowTitle;
818 UNICODE_STRING DesktopInfo;
819 UNICODE_STRING ShellInfo;
820 UNICODE_STRING RuntimeData;
821 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
822 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
823
824 typedef struct _RTL_USER_PROCESS_INFORMATION
825 {
826 ULONG Size;
827 HANDLE ProcessHandle;
828 HANDLE ThreadHandle;
829 CLIENT_ID ClientId;
830 SECTION_IMAGE_INFORMATION ImageInformation;
831 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
832
833 //
834 // RTL Atom Table Structures
835 //
836 typedef struct _RTL_ATOM_TABLE_ENTRY
837 {
838 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
839 USHORT HandleIndex;
840 USHORT Atom;
841 USHORT ReferenceCount;
842 UCHAR Flags;
843 UCHAR NameLength;
844 WCHAR Name[1];
845 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
846
847 typedef struct _RTL_ATOM_TABLE
848 {
849 ULONG Signature;
850 union
851 {
852 #ifdef NTOS_MODE_USER
853 RTL_CRITICAL_SECTION CriticalSection;
854 #else
855 FAST_MUTEX FastMutex;
856 #endif
857 };
858 union
859 {
860 #ifdef NTOS_MODE_USER
861 RTL_HANDLE_TABLE RtlHandleTable;
862 #else
863 PHANDLE_TABLE ExHandleTable;
864 #endif
865 };
866 ULONG NumberOfBuckets;
867 PRTL_ATOM_TABLE_ENTRY Buckets[1];
868 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
869
870 #ifndef NTOS_MODE_USER
871
872 //
873 // System Time and Timezone Structures
874 //
875 typedef struct _SYSTEMTIME
876 {
877 USHORT wYear;
878 USHORT wMonth;
879 USHORT wDayOfWeek;
880 USHORT wDay;
881 USHORT wHour;
882 USHORT wMinute;
883 USHORT wSecond;
884 USHORT wMilliseconds;
885 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
886
887 typedef struct _TIME_ZONE_INFORMATION
888 {
889 LONG Bias;
890 WCHAR StandardName[32];
891 SYSTEMTIME StandardDate;
892 LONG StandardBias;
893 WCHAR DaylightName[32];
894 SYSTEMTIME DaylightDate;
895 LONG DaylightBias;
896 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
897
898 #endif
899
900 //
901 // Header for NLS Files
902 //
903 typedef struct _NLS_FILE_HEADER
904 {
905 USHORT HeaderSize;
906 USHORT CodePage;
907 USHORT MaximumCharacterSize;
908 USHORT DefaultChar;
909 USHORT UniDefaultChar;
910 USHORT TransDefaultChar;
911 USHORT TransUniDefaultChar;
912 USHORT DBCSCodePage;
913 UCHAR LeadByte[MAXIMUM_LEADBYTES];
914 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
915
916 #endif