[RTL]
[reactos.git] / reactos / include / ndk / rtltypes.h
1 /*++ NDK Version: 0098
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 (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18
19 #ifndef _RTLTYPES_H
20 #define _RTLTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <mmtypes.h>
27 #include <ldrtypes.h>
28
29 //
30 // Maximum Atom Length
31 //
32 #define RTL_MAXIMUM_ATOM_LENGTH 255
33
34 //
35 // Process Parameters Flags
36 //
37 #define RTL_USER_PROCESS_PARAMETERS_NORMALIZED 0x01
38 #define RTL_USER_PROCESS_PARAMETERS_PROFILE_USER 0x02
39 #define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER 0x04
40 #define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL 0x08
41 #define RTL_USER_PROCESS_PARAMETERS_UNKNOWN 0x10
42 #define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB 0x20
43 #define RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS 0x100
44 #define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_1 0x200
45 #define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_2 0x400
46 #define RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH 0x1000
47 #define RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH 0x2000
48 #define RTL_USER_PROCESS_PARAMETERS_NX 0x20000
49
50 //
51 // Exception Flags
52 //
53 #define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
54 #define EXCEPTION_UNWINDING 0x02
55 #define EXCEPTION_EXIT_UNWIND 0x04
56 #define EXCEPTION_STACK_INVALID 0x08
57 #define EXCEPTION_UNWIND (EXCEPTION_UNWINDING + EXCEPTION_EXIT_UNWIND)
58 #define EXCEPTION_NESTED_CALL 0x10
59 #define EXCEPTION_TARGET_UNWIND 0x20
60 #define EXCEPTION_COLLIDED_UNWIND 0x20
61
62 //
63 // Range and Range List Flags
64 //
65 #define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
66 #define RTL_RANGE_LIST_ADD_SHARED 0x00000002
67
68 #define RTL_RANGE_SHARED 0x01
69 #define RTL_RANGE_CONFLICT 0x02
70
71 //
72 // Activation Context Frame Flags
73 //
74 #define RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER \
75 0x1
76
77 //
78 // Public Heap Flags
79 //
80 #if !defined(NTOS_MODE_USER) && !defined(_NTIFS_)
81 #define HEAP_NO_SERIALIZE 0x00000001
82 #define HEAP_GROWABLE 0x00000002
83 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
84 #define HEAP_ZERO_MEMORY 0x00000008
85 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
86 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
87 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
88 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
89 #define HEAP_CREATE_ALIGN_16 0x00010000
90 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
91 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
92 #endif
93
94 //
95 // User-Defined Heap Flags and Classes
96 //
97 #define HEAP_SETTABLE_USER_VALUE 0x00000100
98 #define HEAP_SETTABLE_USER_FLAG1 0x00000200
99 #define HEAP_SETTABLE_USER_FLAG2 0x00000400
100 #define HEAP_SETTABLE_USER_FLAG3 0x00000800
101 #define HEAP_SETTABLE_USER_FLAGS 0x00000E00
102 #define HEAP_CLASS_0 0x00000000
103 #define HEAP_CLASS_1 0x00001000
104 #define HEAP_CLASS_2 0x00002000
105 #define HEAP_CLASS_3 0x00003000
106 #define HEAP_CLASS_4 0x00004000
107 #define HEAP_CLASS_5 0x00005000
108 #define HEAP_CLASS_6 0x00006000
109 #define HEAP_CLASS_7 0x00007000
110 #define HEAP_CLASS_8 0x00008000
111 #define HEAP_CLASS_MASK 0x0000F000
112
113 //
114 // Internal HEAP Structure Flags
115 //
116 #define HEAP_FLAG_PAGE_ALLOCS 0x01000000
117 #define HEAP_PROTECTION_ENABLED 0x02000000
118 #define HEAP_BREAK_WHEN_OUT_OF_VM 0x04000000
119 #define HEAP_NO_ALIGNMENT 0x08000000
120 #define HEAP_CAPTURE_STACK_BACKTRACES 0x08000000
121 #define HEAP_SKIP_VALIDATION_CHECKS 0x10000000
122 #define HEAP_VALIDATE_ALL_ENABLED 0x20000000
123 #define HEAP_VALIDATE_PARAMETERS_ENABLED 0x40000000
124 #define HEAP_LOCK_USER_ALLOCATED 0x80000000
125
126 //
127 // Heap Validation Flags
128 //
129 #define HEAP_CREATE_VALID_MASK \
130 (HEAP_NO_SERIALIZE | \
131 HEAP_GROWABLE | \
132 HEAP_GENERATE_EXCEPTIONS | \
133 HEAP_ZERO_MEMORY | \
134 HEAP_REALLOC_IN_PLACE_ONLY | \
135 HEAP_TAIL_CHECKING_ENABLED | \
136 HEAP_FREE_CHECKING_ENABLED | \
137 HEAP_DISABLE_COALESCE_ON_FREE | \
138 HEAP_CLASS_MASK | \
139 HEAP_CREATE_ALIGN_16 | \
140 HEAP_CREATE_ENABLE_TRACING | \
141 HEAP_CREATE_ENABLE_EXECUTE)
142 #ifdef C_ASSERT
143 C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
144 #endif
145
146 //
147 // Native image architecture
148 //
149 #if defined(_M_IX86)
150 #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_I386
151 #elif defined(_M_ARM)
152 #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARM
153 #elif defined(_M_AMD64)
154 #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_AMD64
155 #else
156 #error Define these please!
157 #endif
158
159 //
160 // Registry Keys
161 //
162 #define RTL_REGISTRY_ABSOLUTE 0
163 #define RTL_REGISTRY_SERVICES 1
164 #define RTL_REGISTRY_CONTROL 2
165 #define RTL_REGISTRY_WINDOWS_NT 3
166 #define RTL_REGISTRY_DEVICEMAP 4
167 #define RTL_REGISTRY_USER 5
168 #define RTL_REGISTRY_MAXIMUM 6
169 #define RTL_REGISTRY_HANDLE 0x40000000
170 #define RTL_REGISTRY_OPTIONAL 0x80000000
171 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
172 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
173 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
174 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
175 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
176 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
177 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
178
179 //
180 // Versioning
181 //
182 #define VER_MINORVERSION 0x0000001
183 #define VER_MAJORVERSION 0x0000002
184 #define VER_BUILDNUMBER 0x0000004
185 #define VER_PLATFORMID 0x0000008
186 #define VER_SERVICEPACKMINOR 0x0000010
187 #define VER_SERVICEPACKMAJOR 0x0000020
188 #define VER_SUITENAME 0x0000040
189 #define VER_PRODUCT_TYPE 0x0000080
190 #define VER_PLATFORM_WIN32s 0
191 #define VER_PLATFORM_WIN32_WINDOWS 1
192 #define VER_PLATFORM_WIN32_NT 2
193 #define VER_EQUAL 1
194 #define VER_GREATER 2
195 #define VER_GREATER_EQUAL 3
196 #define VER_LESS 4
197 #define VER_LESS_EQUAL 5
198 #define VER_AND 6
199 #define VER_OR 7
200 #define VER_CONDITION_MASK 7
201 #define VER_NUM_BITS_PER_CONDITION_MASK 3
202
203 //
204 // Timezone IDs
205 //
206 #define TIME_ZONE_ID_UNKNOWN 0
207 #define TIME_ZONE_ID_STANDARD 1
208 #define TIME_ZONE_ID_DAYLIGHT 2
209
210 //
211 // Maximum Path Length
212 //
213 #define MAX_PATH 260
214
215 //
216 // RTL Lock Type (Critical Section or Resource)
217 //
218 #define RTL_CRITSECT_TYPE 0
219 #define RTL_RESOURCE_TYPE 1
220
221 //
222 // RtlAcquirePrivileges Flags
223 //
224 #define RTL_ACQUIRE_PRIVILEGE_IMPERSONATE 1
225 #define RTL_ACQUIRE_PRIVILEGE_PROCESS 2
226
227 #ifdef NTOS_MODE_USER
228
229 //
230 // String Hash Algorithms
231 //
232 #define HASH_STRING_ALGORITHM_DEFAULT 0
233 #define HASH_STRING_ALGORITHM_X65599 1
234 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
235
236 //
237 // RtlDuplicateString Flags
238 //
239 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
240 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
241
242 //
243 // RtlFindCharInUnicodeString Flags
244 //
245 #define RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END 1
246 #define RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET 2
247 #define RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE 4
248
249 //
250 // RtlImageNtHeaderEx Flags
251 //
252 #define RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK 0x00000001
253
254 //
255 // Codepages
256 //
257 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
258 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
259 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
260
261 //
262 // Activation Contexts
263 //
264 #define INVALID_ACTIVATION_CONTEXT (PVOID)0xFFFFFFFF
265
266 //
267 // C++ CONST casting
268 //
269 #if defined(__cplusplus)
270 #define RTL_CONST_CAST(type) const_cast<type>
271 #else
272 #define RTL_CONST_CAST(type) (type)
273 #endif
274
275 //
276 // Constant String Macro
277 //
278 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
279 { \
280 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
281 sizeof(__SOURCE_STRING__), \
282 (__SOURCE_STRING__) \
283 }
284
285 //
286 // Constant Object Attributes Macro
287 //
288 #define RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a) \
289 { \
290 sizeof(OBJECT_ATTRIBUTES), \
291 NULL, \
292 RTL_CONST_CAST(PUNICODE_STRING)(n), \
293 a, \
294 NULL, \
295 NULL \
296 }
297
298 #define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
299 RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
300
301 #else /* NTOS_MODE_USER */
302 //
303 // Message Resource Flag
304 //
305 #define MESSAGE_RESOURCE_UNICODE 0x0001
306
307 #endif /* !NTOS_MODE_USER */
308 #define MAXIMUM_LEADBYTES 12
309
310 //
311 // RTL Debug Queries
312 //
313 #define RTL_DEBUG_QUERY_MODULES 0x01
314 #define RTL_DEBUG_QUERY_BACKTRACES 0x02
315 #define RTL_DEBUG_QUERY_HEAPS 0x04
316 #define RTL_DEBUG_QUERY_HEAP_TAGS 0x08
317 #define RTL_DEBUG_QUERY_HEAP_BLOCKS 0x10
318 #define RTL_DEBUG_QUERY_LOCKS 0x20
319
320 //
321 // RTL Handle Flags
322 //
323 #define RTL_HANDLE_VALID 0x1
324
325 //
326 // RTL Atom Flags
327 //
328 #define RTL_ATOM_IS_PINNED 0x1
329
330 //
331 // Critical section lock bits
332 //
333 #define CS_LOCK_BIT 0x1
334 #define CS_LOCK_BIT_V 0x0
335 #define CS_LOCK_WAITER_WOKEN 0x2
336 #define CS_LOCK_WAITER_INC 0x4
337
338 //
339 // Codepage Tags
340 //
341 #ifdef NTOS_MODE_USER
342 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
343 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
344
345 //
346 // Constant String Macro
347 //
348 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
349 { \
350 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
351 sizeof(__SOURCE_STRING__), \
352 (__SOURCE_STRING__) \
353 }
354
355 #endif /* NTOS_MODE_USER */
356
357 #ifdef NTOS_MODE_USER
358
359 //
360 // Table and Compare result types
361 //
362 typedef enum _TABLE_SEARCH_RESULT
363 {
364 TableEmptyTree,
365 TableFoundNode,
366 TableInsertAsLeft,
367 TableInsertAsRight
368 } TABLE_SEARCH_RESULT;
369
370 typedef enum _RTL_GENERIC_COMPARE_RESULTS
371 {
372 GenericLessThan,
373 GenericGreaterThan,
374 GenericEqual
375 } RTL_GENERIC_COMPARE_RESULTS;
376
377 #endif /* NTOS_MODE_USER */
378
379 //
380 // RTL Path Types
381 //
382 typedef enum _RTL_PATH_TYPE
383 {
384 RtlPathTypeUnknown,
385 RtlPathTypeUncAbsolute,
386 RtlPathTypeDriveAbsolute,
387 RtlPathTypeDriveRelative,
388 RtlPathTypeRooted,
389 RtlPathTypeRelative,
390 RtlPathTypeLocalDevice,
391 RtlPathTypeRootLocalDevice,
392 } RTL_PATH_TYPE;
393
394 #ifndef NTOS_MODE_USER
395
396 //
397 // Heap Information Class
398 //
399 typedef enum _HEAP_INFORMATION_CLASS
400 {
401 HeapCompatibilityInformation,
402 HeapEnableTerminationOnCorruption
403 } HEAP_INFORMATION_CLASS;
404
405 //
406 // Callback function for RTL Timers or Registered Waits
407 //
408 typedef VOID
409 (NTAPI *WAITORTIMERCALLBACKFUNC)(
410 PVOID pvContext,
411 BOOLEAN fTimerOrWaitFired
412 );
413
414 //
415 // Handler during Vectored RTL Exceptions
416 //
417 typedef LONG
418 (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
419 PEXCEPTION_POINTERS ExceptionPointers
420 );
421
422 //
423 // Worker Thread Callback for Rtl
424 //
425 typedef VOID
426 (NTAPI *WORKERCALLBACKFUNC)(
427 IN PVOID Context
428 );
429
430 #else /* !NTOS_MODE_USER */
431
432 //
433 // Handler during regular RTL Exceptions
434 //
435 typedef EXCEPTION_DISPOSITION
436 (NTAPI *PEXCEPTION_ROUTINE)(
437 IN struct _EXCEPTION_RECORD *ExceptionRecord,
438 IN PVOID EstablisherFrame,
439 IN OUT struct _CONTEXT *ContextRecord,
440 IN OUT PVOID DispatcherContext
441 );
442
443 //
444 // RTL Library Allocation/Free Routines
445 //
446 typedef PVOID
447 (NTAPI *PRTL_ALLOCATE_STRING_ROUTINE)(
448 SIZE_T NumberOfBytes
449 );
450
451 typedef PVOID
452 (NTAPI *PRTL_REALLOCATE_STRING_ROUTINE)(
453 SIZE_T NumberOfBytes,
454 PVOID Buffer
455 );
456
457 typedef
458 VOID
459 (NTAPI *PRTL_FREE_STRING_ROUTINE)(
460 PVOID Buffer
461 );
462
463 extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
464 extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
465 extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
466
467 #endif /* NTOS_MODE_USER */
468
469 //
470 // Callback for RTL Heap Enumeration
471 //
472 typedef NTSTATUS
473 (NTAPI *PHEAP_ENUMERATION_ROUTINE)(
474 IN PVOID HeapHandle,
475 IN PVOID UserParam
476 );
477
478 //
479 // Thread and Process Start Routines for RtlCreateUserThread/Process
480 //
481 typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
482 PVOID Parameter
483 );
484
485 typedef VOID
486 (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
487 PTHREAD_START_ROUTINE StartAddress,
488 PVOID Parameter
489 );
490
491 //
492 // Declare empty structure definitions so that they may be referenced by
493 // routines before they are defined
494 //
495 struct _RTL_AVL_TABLE;
496 struct _RTL_GENERIC_TABLE;
497 struct _RTL_RANGE;
498
499 //
500 // Routines and callbacks for the RTL AVL/Generic Table package
501 //
502 #ifdef NTOS_MODE_USER
503 typedef NTSTATUS
504 (NTAPI RTL_AVL_MATCH_FUNCTION)(
505 struct _RTL_AVL_TABLE *Table,
506 PVOID UserData,
507 PVOID MatchData
508 );
509 typedef RTL_AVL_MATCH_FUNCTION *PRTL_AVL_MATCH_FUNCTION;
510
511 typedef RTL_GENERIC_COMPARE_RESULTS
512 (NTAPI RTL_AVL_COMPARE_ROUTINE) (
513 struct _RTL_AVL_TABLE *Table,
514 PVOID FirstStruct,
515 PVOID SecondStruct
516 );
517 typedef RTL_AVL_COMPARE_ROUTINE *PRTL_AVL_COMPARE_ROUTINE;
518
519 typedef RTL_GENERIC_COMPARE_RESULTS
520 (NTAPI RTL_GENERIC_COMPARE_ROUTINE) (
521 struct _RTL_GENERIC_TABLE *Table,
522 PVOID FirstStruct,
523 PVOID SecondStruct
524 );
525 typedef RTL_GENERIC_COMPARE_ROUTINE *PRTL_GENERIC_COMPARE_ROUTINE;
526
527 typedef PVOID
528 (NTAPI RTL_GENERIC_ALLOCATE_ROUTINE) (
529 struct _RTL_GENERIC_TABLE *Table,
530 CLONG ByteSize
531 );
532 typedef RTL_GENERIC_ALLOCATE_ROUTINE *PRTL_GENERIC_ALLOCATE_ROUTINE;
533
534 typedef PVOID
535 (NTAPI RTL_AVL_ALLOCATE_ROUTINE) (
536 struct _RTL_AVL_TABLE *Table,
537 CLONG ByteSize
538 );
539 typedef RTL_AVL_ALLOCATE_ROUTINE *PRTL_AVL_ALLOCATE_ROUTINE;
540
541 typedef VOID
542 (NTAPI RTL_GENERIC_FREE_ROUTINE) (
543 struct _RTL_GENERIC_TABLE *Table,
544 PVOID Buffer
545 );
546 typedef RTL_GENERIC_FREE_ROUTINE *PRTL_GENERIC_FREE_ROUTINE;
547
548 typedef VOID
549 (NTAPI RTL_AVL_FREE_ROUTINE) (
550 struct _RTL_AVL_TABLE *Table,
551 PVOID Buffer
552 );
553 typedef RTL_AVL_FREE_ROUTINE *PRTL_AVL_FREE_ROUTINE;
554
555 #ifdef RTL_USE_AVL_TABLES
556 #undef RTL_GENERIC_COMPARE_ROUTINE
557 #undef PRTL_GENERIC_COMPARE_ROUTINE
558 #undef RTL_GENERIC_ALLOCATE_ROUTINE
559 #undef PRTL_GENERIC_ALLOCATE_ROUTINE
560 #undef RTL_GENERIC_FREE_ROUTINE
561 #undef PRTL_GENERIC_FREE_ROUTINE
562
563 #define RTL_GENERIC_COMPARE_ROUTINE RTL_AVL_COMPARE_ROUTINE
564 #define PRTL_GENERIC_COMPARE_ROUTINE PRTL_AVL_COMPARE_ROUTINE
565 #define RTL_GENERIC_ALLOCATE_ROUTINE RTL_AVL_ALLOCATE_ROUTINE
566 #define PRTL_GENERIC_ALLOCATE_ROUTINE PRTL_AVL_ALLOCATE_ROUTINE
567 #define RTL_GENERIC_FREE_ROUTINE RTL_AVL_FREE_ROUTINE
568 #define PRTL_GENERIC_FREE_ROUTINE PRTL_AVL_FREE_ROUTINE
569 #endif /* RTL_USE_AVL_TABLES */
570
571 #endif /* NTOS_MODE_USER */
572
573 //
574 // RTL Query Registry callback
575 //
576 #ifdef NTOS_MODE_USER
577 typedef NTSTATUS
578 (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
579 IN PWSTR ValueName,
580 IN ULONG ValueType,
581 IN PVOID ValueData,
582 IN ULONG ValueLength,
583 IN PVOID Context,
584 IN PVOID EntryContext
585 );
586 #endif
587
588 //
589 // RTL Secure Memory callbacks
590 //
591 #ifdef NTOS_MODE_USER
592 typedef NTSTATUS
593 (NTAPI *PRTL_SECURE_MEMORY_CACHE_CALLBACK)(
594 IN PVOID Address,
595 IN SIZE_T Length
596 );
597 #endif
598
599 //
600 // RTL Range List callbacks
601 //
602 #ifdef NTOS_MODE_USER
603 typedef BOOLEAN
604 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK)(
605 PVOID Context,
606 struct _RTL_RANGE *Range
607 );
608
609 //
610 // Custom Heap Commit Routine for RtlCreateHeap
611 //
612 typedef NTSTATUS
613 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
614 IN PVOID Base,
615 IN OUT PVOID *CommitAddress,
616 IN OUT PSIZE_T CommitSize
617 );
618
619 //
620 // Parameters for RtlCreateHeap
621 //
622 typedef struct _RTL_HEAP_PARAMETERS
623 {
624 ULONG Length;
625 SIZE_T SegmentReserve;
626 SIZE_T SegmentCommit;
627 SIZE_T DeCommitFreeBlockThreshold;
628 SIZE_T DeCommitTotalFreeThreshold;
629 SIZE_T MaximumAllocationSize;
630 SIZE_T VirtualMemoryThreshold;
631 SIZE_T InitialCommit;
632 SIZE_T InitialReserve;
633 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
634 SIZE_T Reserved[2];
635 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
636
637 //
638 // RTL Bitmap structures
639 //
640 typedef struct _RTL_BITMAP
641 {
642 ULONG SizeOfBitMap;
643 PULONG Buffer;
644 } RTL_BITMAP, *PRTL_BITMAP;
645
646 typedef struct _RTL_BITMAP_RUN
647 {
648 ULONG StartingIndex;
649 ULONG NumberOfBits;
650 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
651
652 //
653 // RtlGenerateXxxName context
654 //
655 typedef struct _GENERATE_NAME_CONTEXT
656 {
657 USHORT Checksum;
658 BOOLEAN CheckSumInserted;
659 UCHAR NameLength;
660 WCHAR NameBuffer[8];
661 ULONG ExtensionLength;
662 WCHAR ExtensionBuffer[4];
663 ULONG LastIndexValue;
664 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
665
666 //
667 // RTL Splay and Balanced Links structures
668 //
669 typedef struct _RTL_SPLAY_LINKS
670 {
671 struct _RTL_SPLAY_LINKS *Parent;
672 struct _RTL_SPLAY_LINKS *LeftChild;
673 struct _RTL_SPLAY_LINKS *RightChild;
674 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
675
676 typedef struct _RTL_BALANCED_LINKS
677 {
678 struct _RTL_BALANCED_LINKS *Parent;
679 struct _RTL_BALANCED_LINKS *LeftChild;
680 struct _RTL_BALANCED_LINKS *RightChild;
681 CHAR Balance;
682 UCHAR Reserved[3];
683 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
684
685 //
686 // RTL Avl/Generic Tables
687 //
688 #ifndef RTL_USE_AVL_TABLES
689 typedef struct _RTL_GENERIC_TABLE
690 {
691 PRTL_SPLAY_LINKS TableRoot;
692 LIST_ENTRY InsertOrderList;
693 PLIST_ENTRY OrderedPointer;
694 ULONG WhichOrderedElement;
695 ULONG NumberGenericTableElements;
696 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
697 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
698 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
699 PVOID TableContext;
700 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
701 #endif /* !RTL_USE_AVL_TABLES */
702
703 typedef struct _RTL_AVL_TABLE
704 {
705 RTL_BALANCED_LINKS BalancedRoot;
706 PVOID OrderedPointer;
707 ULONG WhichOrderedElement;
708 ULONG NumberGenericTableElements;
709 ULONG DepthOfTree;
710 PRTL_BALANCED_LINKS RestartKey;
711 ULONG DeleteCount;
712 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
713 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
714 PRTL_AVL_FREE_ROUTINE FreeRoutine;
715 PVOID TableContext;
716 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
717
718 #ifdef RTL_USE_AVL_TABLES
719 #undef RTL_GENERIC_TABLE
720 #undef PRTL_GENERIC_TABLE
721
722 #define RTL_GENERIC_TABLE RTL_AVL_TABLE
723 #define PRTL_GENERIC_TABLE PRTL_AVL_TABLE
724 #endif /* RTL_USE_AVL_TABLES */
725
726 //
727 // RTL Compression Buffer
728 //
729 typedef struct _COMPRESSED_DATA_INFO {
730 USHORT CompressionFormatAndEngine;
731 UCHAR CompressionUnitShift;
732 UCHAR ChunkShift;
733 UCHAR ClusterShift;
734 UCHAR Reserved;
735 USHORT NumberOfChunks;
736 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
737 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
738
739 //
740 // RtlQueryRegistry Data
741 //
742 typedef struct _RTL_QUERY_REGISTRY_TABLE
743 {
744 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
745 ULONG Flags;
746 PCWSTR Name;
747 PVOID EntryContext;
748 ULONG DefaultType;
749 PVOID DefaultData;
750 ULONG DefaultLength;
751 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
752
753 //
754 // RTL Unicode Table Structures
755 //
756 typedef struct _UNICODE_PREFIX_TABLE_ENTRY
757 {
758 CSHORT NodeTypeCode;
759 CSHORT NameLength;
760 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
761 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
762 RTL_SPLAY_LINKS Links;
763 PUNICODE_STRING Prefix;
764 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
765
766 typedef struct _UNICODE_PREFIX_TABLE
767 {
768 CSHORT NodeTypeCode;
769 CSHORT NameLength;
770 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
771 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
772 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
773
774 //
775 // Time Structure for RTL Time calls
776 //
777 typedef struct _TIME_FIELDS
778 {
779 CSHORT Year;
780 CSHORT Month;
781 CSHORT Day;
782 CSHORT Hour;
783 CSHORT Minute;
784 CSHORT Second;
785 CSHORT Milliseconds;
786 CSHORT Weekday;
787 } TIME_FIELDS, *PTIME_FIELDS;
788
789 //
790 // Activation Context
791 //
792 typedef PVOID PACTIVATION_CONTEXT;
793
794 //
795 // Activation Context Frame
796 //
797 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
798 {
799 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
800 PACTIVATION_CONTEXT ActivationContext;
801 ULONG Flags;
802 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
803
804 typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC
805 {
806 SIZE_T Size;
807 ULONG Format;
808 RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
809 } RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC, *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC;
810
811 typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
812 {
813 SIZE_T Size;
814 ULONG Format;
815 RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
816 PVOID Extra1;
817 PVOID Extra2;
818 PVOID Extra3;
819 PVOID Extra4;
820 } RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED, *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED;
821
822 typedef RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
823 typedef PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
824
825 #if (NTDDI_VERSION >= NTDDI_WS03)
826 typedef struct _ACTIVATION_CONTEXT_STACK
827 {
828 PRTL_ACTIVATION_CONTEXT_STACK_FRAME ActiveFrame;
829 LIST_ENTRY FrameListCache;
830 ULONG Flags;
831 ULONG NextCookieSequenceNumber;
832 ULONG StackId;
833 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
834 #else
835 typedef struct _ACTIVATION_CONTEXT_STACK
836 {
837 ULONG Flags;
838 ULONG NextCookieSequenceNumber;
839 PVOID ActiveFrame;
840 LIST_ENTRY FrameListCache;
841 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
842 #endif
843
844 #endif /* NTOS_MODE_USER */
845
846 //
847 // ACE Structure
848 //
849 typedef struct _ACE
850 {
851 ACE_HEADER Header;
852 ACCESS_MASK AccessMask;
853 } ACE, *PACE;
854
855 //
856 // Information Structures for RTL Debug Functions
857 //
858 typedef struct _RTL_PROCESS_MODULE_INFORMATION
859 {
860 ULONG Section;
861 PVOID MappedBase;
862 PVOID ImageBase;
863 ULONG ImageSize;
864 ULONG Flags;
865 USHORT LoadOrderIndex;
866 USHORT InitOrderIndex;
867 USHORT LoadCount;
868 USHORT OffsetToFileName;
869 CHAR FullPathName[256];
870 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
871
872 typedef struct _RTL_PROCESS_MODULES
873 {
874 ULONG NumberOfModules;
875 RTL_PROCESS_MODULE_INFORMATION Modules[1];
876 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
877
878 typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
879 {
880 ULONG NextOffset;
881 RTL_PROCESS_MODULE_INFORMATION BaseInfo;
882 ULONG ImageCheckSum;
883 ULONG TimeDateStamp;
884 PVOID DefaultBase;
885 } RTL_PROCESS_MODULE_INFORMATION_EX, *PRTL_PROCESS_MODULE_INFORMATION_EX;
886
887 typedef struct _RTL_HEAP_TAG_INFO
888 {
889 ULONG NumberOfAllocations;
890 ULONG NumberOfFrees;
891 ULONG BytesAllocated;
892 } RTL_HEAP_TAG_INFO, *PRTL_HEAP_TAG_INFO;
893
894 typedef struct _RTL_HEAP_USAGE_ENTRY
895 {
896 struct _RTL_HEAP_USAGE_ENTRY *Next;
897 } RTL_HEAP_USAGE_ENTRY, *PRTL_HEAP_USAGE_ENTRY;
898
899 typedef struct _RTL_HEAP_USAGE
900 {
901 ULONG Length;
902 ULONG BytesAllocated;
903 ULONG BytesCommitted;
904 ULONG BytesReserved;
905 ULONG BytesReservedMaximum;
906 PRTL_HEAP_USAGE_ENTRY Entries;
907 PRTL_HEAP_USAGE_ENTRY AddedEntries;
908 PRTL_HEAP_USAGE_ENTRY RemovedEntries;
909 UCHAR Reserved[32];
910 } RTL_HEAP_USAGE, *PRTL_HEAP_USAGE;
911
912 typedef struct _RTL_HEAP_INFORMATION
913 {
914 PVOID BaseAddress;
915 ULONG Flags;
916 USHORT EntryOverhead;
917 USHORT CreatorBackTraceIndex;
918 ULONG BytesAllocated;
919 ULONG BytesCommitted;
920 ULONG NumberOfTags;
921 ULONG NumberOfEntries;
922 ULONG NumberOfPseudoTags;
923 ULONG PseudoTagGranularity;
924 ULONG Reserved[4];
925 PVOID Tags;
926 PVOID Entries;
927 } RTL_HEAP_INFORMATION, *PRTL_HEAP_INFORMATION;
928
929 typedef struct _RTL_PROCESS_HEAPS
930 {
931 ULONG NumberOfHeaps;
932 RTL_HEAP_INFORMATION Heaps[1];
933 } RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;
934
935 typedef struct _RTL_PROCESS_LOCK_INFORMATION
936 {
937 PVOID Address;
938 USHORT Type;
939 USHORT CreatorBackTraceIndex;
940 ULONG OwnerThreadId;
941 ULONG ActiveCount;
942 ULONG ContentionCount;
943 ULONG EntryCount;
944 ULONG RecursionCount;
945 ULONG NumberOfSharedWaiters;
946 ULONG NumberOfExclusiveWaiters;
947 } RTL_PROCESS_LOCK_INFORMATION, *PRTL_PROCESS_LOCK_INFORMATION;
948
949 typedef struct _RTL_PROCESS_LOCKS
950 {
951 ULONG NumberOfLocks;
952 RTL_PROCESS_LOCK_INFORMATION Locks[1];
953 } RTL_PROCESS_LOCKS, *PRTL_PROCESS_LOCKS;
954
955 typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
956 {
957 PVOID SymbolicBackTrace;
958 ULONG TraceCount;
959 USHORT Index;
960 USHORT Depth;
961 PVOID BackTrace[16];
962 } RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
963
964 typedef struct _RTL_PROCESS_BACKTRACES
965 {
966 ULONG CommittedMemory;
967 ULONG ReservedMemory;
968 ULONG NumberOfBackTraceLookups;
969 ULONG NumberOfBackTraces;
970 RTL_PROCESS_BACKTRACE_INFORMATION BackTraces[1];
971 } RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
972
973 typedef struct _RTL_PROCESS_VERIFIER_OPTIONS
974 {
975 ULONG SizeStruct;
976 ULONG Option;
977 UCHAR OptionData[1];
978 //
979 // Option array continues below
980 //
981 } RTL_PROCESS_VERIFIER_OPTIONS, *PRTL_PROCESS_VERIFIER_OPTIONS;
982
983 typedef struct _RTL_DEBUG_INFORMATION
984 {
985 HANDLE SectionHandleClient;
986 PVOID ViewBaseClient;
987 PVOID ViewBaseTarget;
988 ULONG ViewBaseDelta;
989 HANDLE EventPairClient;
990 PVOID EventPairTarget;
991 HANDLE TargetProcessId;
992 HANDLE TargetThreadHandle;
993 ULONG Flags;
994 ULONG OffsetFree;
995 ULONG CommitSize;
996 ULONG ViewSize;
997 union
998 {
999 PRTL_PROCESS_MODULES Modules;
1000 PRTL_PROCESS_MODULE_INFORMATION_EX ModulesEx;
1001 };
1002 PRTL_PROCESS_BACKTRACES BackTraces;
1003 PRTL_PROCESS_HEAPS Heaps;
1004 PRTL_PROCESS_LOCKS Locks;
1005 HANDLE SpecificHeap;
1006 HANDLE TargetProcessHandle;
1007 RTL_PROCESS_VERIFIER_OPTIONS VerifierOptions;
1008 HANDLE ProcessHeap;
1009 HANDLE CriticalSectionHandle;
1010 HANDLE CriticalSectionOwnerThread;
1011 PVOID Reserved[4];
1012 } RTL_DEBUG_INFORMATION, *PRTL_DEBUG_INFORMATION;
1013
1014 //
1015 // Unload Event Trace Structure for RtlGetUnloadEventTrace
1016 //
1017 typedef struct _RTL_UNLOAD_EVENT_TRACE
1018 {
1019 PVOID BaseAddress;
1020 ULONG SizeOfImage;
1021 ULONG Sequence;
1022 ULONG TimeDateStamp;
1023 ULONG CheckSum;
1024 WCHAR ImageName[32];
1025 } RTL_UNLOAD_EVENT_TRACE, *PRTL_UNLOAD_EVENT_TRACE;
1026
1027 //
1028 // RTL Handle Structures
1029 //
1030 typedef struct _RTL_HANDLE_TABLE_ENTRY
1031 {
1032 union
1033 {
1034 ULONG Flags;
1035 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
1036 };
1037 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
1038
1039 typedef struct _RTL_HANDLE_TABLE
1040 {
1041 ULONG MaximumNumberOfHandles;
1042 ULONG SizeOfHandleTableEntry;
1043 ULONG Reserved[2];
1044 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
1045 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
1046 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
1047 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
1048 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
1049
1050 //
1051 // Exception Record
1052 //
1053 typedef struct _EXCEPTION_REGISTRATION_RECORD
1054 {
1055 struct _EXCEPTION_REGISTRATION_RECORD *Next;
1056 PEXCEPTION_ROUTINE Handler;
1057 } EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
1058
1059 //
1060 // Current Directory Structures
1061 //
1062 typedef struct _CURDIR
1063 {
1064 UNICODE_STRING DosPath;
1065 HANDLE Handle;
1066 } CURDIR, *PCURDIR;
1067
1068 typedef struct _RTLP_CURDIR_REF *PRTLP_CURDIR_REF;
1069 typedef struct _RTL_RELATIVE_NAME_U
1070 {
1071 UNICODE_STRING RelativeName;
1072 HANDLE ContainingDirectory;
1073 PRTLP_CURDIR_REF CurDirRef;
1074 } RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U;
1075
1076 typedef struct _RTL_DRIVE_LETTER_CURDIR
1077 {
1078 USHORT Flags;
1079 USHORT Length;
1080 ULONG TimeStamp;
1081 UNICODE_STRING DosPath;
1082 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
1083
1084 typedef struct _RTL_PERTHREAD_CURDIR
1085 {
1086 PRTL_DRIVE_LETTER_CURDIR CurrentDirectories;
1087 PUNICODE_STRING ImageName;
1088 PVOID Environment;
1089 } RTL_PERTHREAD_CURDIR, *PRTL_PERTHREAD_CURDIR;
1090
1091 //
1092 // Private State structure for RtlAcquirePrivilege/RtlReleasePrivilege
1093 //
1094 typedef struct _RTL_ACQUIRE_STATE
1095 {
1096 HANDLE Token;
1097 HANDLE OldImpersonationToken;
1098 PTOKEN_PRIVILEGES OldPrivileges;
1099 PTOKEN_PRIVILEGES NewPrivileges;
1100 ULONG Flags;
1101 UCHAR OldPrivBuffer[1024];
1102 } RTL_ACQUIRE_STATE, *PRTL_ACQUIRE_STATE;
1103
1104 #ifndef NTOS_MODE_USER
1105
1106 //
1107 // RTL Critical Section Structures
1108 //
1109 typedef struct _RTL_CRITICAL_SECTION_DEBUG
1110 {
1111 USHORT Type;
1112 USHORT CreatorBackTraceIndex;
1113 struct _RTL_CRITICAL_SECTION *CriticalSection;
1114 LIST_ENTRY ProcessLocksList;
1115 ULONG EntryCount;
1116 ULONG ContentionCount;
1117 ULONG Spare[2];
1118 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
1119
1120 typedef struct _RTL_CRITICAL_SECTION
1121 {
1122 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
1123 LONG LockCount;
1124 LONG RecursionCount;
1125 HANDLE OwningThread;
1126 HANDLE LockSemaphore;
1127 ULONG_PTR SpinCount;
1128 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
1129
1130 #endif /* !NTOS_MODE_USER */
1131
1132 //
1133 // RTL Private Heap Structures
1134 //
1135 typedef struct _HEAP_LOCK
1136 {
1137 union
1138 {
1139 RTL_CRITICAL_SECTION CriticalSection;
1140 #ifndef NTOS_MODE_USER
1141 ERESOURCE Resource;
1142 #endif
1143 UCHAR Padding[0x68]; /* Max ERESOURCE size for x64 build. Needed because RTL is built only once */
1144 };
1145 } HEAP_LOCK, *PHEAP_LOCK;
1146
1147 //
1148 // RTL Range List Structures
1149 //
1150 typedef struct _RTL_RANGE_LIST
1151 {
1152 LIST_ENTRY ListHead;
1153 ULONG Flags;
1154 ULONG Count;
1155 ULONG Stamp;
1156 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
1157
1158 typedef struct _RTL_RANGE
1159 {
1160 ULONGLONG Start;
1161 ULONGLONG End;
1162 PVOID UserData;
1163 PVOID Owner;
1164 UCHAR Attributes;
1165 UCHAR Flags;
1166 } RTL_RANGE, *PRTL_RANGE;
1167
1168 typedef struct _RANGE_LIST_ITERATOR
1169 {
1170 PLIST_ENTRY RangeListHead;
1171 PLIST_ENTRY MergedHead;
1172 PVOID Current;
1173 ULONG Stamp;
1174 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
1175
1176 //
1177 // RTL Resource
1178 //
1179 typedef struct _RTL_RESOURCE
1180 {
1181 RTL_CRITICAL_SECTION Lock;
1182 HANDLE SharedSemaphore;
1183 ULONG SharedWaiters;
1184 HANDLE ExclusiveSemaphore;
1185 ULONG ExclusiveWaiters;
1186 LONG NumberActive;
1187 HANDLE OwningThread;
1188 ULONG TimeoutBoost;
1189 PVOID DebugInfo;
1190 } RTL_RESOURCE, *PRTL_RESOURCE;
1191
1192 //
1193 // Structures for RtlCreateUserProcess
1194 //
1195 typedef struct _RTL_USER_PROCESS_PARAMETERS
1196 {
1197 ULONG MaximumLength;
1198 ULONG Length;
1199 ULONG Flags;
1200 ULONG DebugFlags;
1201 HANDLE ConsoleHandle;
1202 ULONG ConsoleFlags;
1203 HANDLE StandardInput;
1204 HANDLE StandardOutput;
1205 HANDLE StandardError;
1206 CURDIR CurrentDirectory;
1207 UNICODE_STRING DllPath;
1208 UNICODE_STRING ImagePathName;
1209 UNICODE_STRING CommandLine;
1210 PWSTR Environment;
1211 ULONG StartingX;
1212 ULONG StartingY;
1213 ULONG CountX;
1214 ULONG CountY;
1215 ULONG CountCharsX;
1216 ULONG CountCharsY;
1217 ULONG FillAttribute;
1218 ULONG WindowFlags;
1219 ULONG ShowWindowFlags;
1220 UNICODE_STRING WindowTitle;
1221 UNICODE_STRING DesktopInfo;
1222 UNICODE_STRING ShellInfo;
1223 UNICODE_STRING RuntimeData;
1224 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
1225 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
1226
1227 typedef struct _RTL_USER_PROCESS_INFORMATION
1228 {
1229 ULONG Size;
1230 HANDLE ProcessHandle;
1231 HANDLE ThreadHandle;
1232 CLIENT_ID ClientId;
1233 SECTION_IMAGE_INFORMATION ImageInformation;
1234 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
1235
1236 //
1237 // RTL Atom Table Structures
1238 //
1239 typedef struct _RTL_ATOM_TABLE_ENTRY
1240 {
1241 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
1242 USHORT HandleIndex;
1243 USHORT Atom;
1244 USHORT ReferenceCount;
1245 UCHAR Flags;
1246 UCHAR NameLength;
1247 WCHAR Name[1];
1248 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
1249
1250 typedef struct _RTL_ATOM_TABLE
1251 {
1252 ULONG Signature;
1253 union
1254 {
1255 #ifdef NTOS_MODE_USER
1256 RTL_CRITICAL_SECTION CriticalSection;
1257 #else
1258 FAST_MUTEX FastMutex;
1259 #endif
1260 };
1261 union
1262 {
1263 #ifdef NTOS_MODE_USER
1264 RTL_HANDLE_TABLE RtlHandleTable;
1265 #else
1266 PHANDLE_TABLE ExHandleTable;
1267 #endif
1268 };
1269 ULONG NumberOfBuckets;
1270 PRTL_ATOM_TABLE_ENTRY Buckets[1];
1271 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
1272
1273 #ifndef _WINBASE_
1274 //
1275 // System Time and Timezone Structures
1276 //
1277 typedef struct _SYSTEMTIME
1278 {
1279 USHORT wYear;
1280 USHORT wMonth;
1281 USHORT wDayOfWeek;
1282 USHORT wDay;
1283 USHORT wHour;
1284 USHORT wMinute;
1285 USHORT wSecond;
1286 USHORT wMilliseconds;
1287 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
1288
1289 typedef struct _TIME_ZONE_INFORMATION
1290 {
1291 LONG Bias;
1292 WCHAR StandardName[32];
1293 SYSTEMTIME StandardDate;
1294 LONG StandardBias;
1295 WCHAR DaylightName[32];
1296 SYSTEMTIME DaylightDate;
1297 LONG DaylightBias;
1298 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
1299 #endif /* !_WINBASE_ */
1300
1301 //
1302 // Native version of Timezone Structure
1303 //
1304 typedef LPTIME_ZONE_INFORMATION PRTL_TIME_ZONE_INFORMATION;
1305
1306 //
1307 // Hotpatch Header
1308 //
1309 typedef struct _RTL_PATCH_HEADER
1310 {
1311 LIST_ENTRY PatchList;
1312 PVOID PatchImageBase;
1313 struct _RTL_PATCH_HEADER *NextPath;
1314 ULONG PatchFlags;
1315 LONG PatchRefCount;
1316 struct _HOTPATCH_HEADER *HotpatchHeader;
1317 UNICODE_STRING TargetDllName;
1318 PVOID TargetDllBase;
1319 PLDR_DATA_TABLE_ENTRY TargetLdrDataTableEntry;
1320 PLDR_DATA_TABLE_ENTRY PatchLdrDataTableEntry;
1321 struct _SYSTEM_HOTPATCH_CODE_INFORMATION *CodeInfo;
1322 } RTL_PATCH_HEADER, *PRTL_PATCH_HEADER;
1323
1324 //
1325 // Header for NLS Files
1326 //
1327 typedef struct _NLS_FILE_HEADER
1328 {
1329 USHORT HeaderSize;
1330 USHORT CodePage;
1331 USHORT MaximumCharacterSize;
1332 USHORT DefaultChar;
1333 USHORT UniDefaultChar;
1334 USHORT TransDefaultChar;
1335 USHORT TransUniDefaultChar;
1336 UCHAR LeadByte[MAXIMUM_LEADBYTES];
1337 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
1338
1339 //
1340 // Stack Traces
1341 //
1342 typedef struct _RTL_STACK_TRACE_ENTRY
1343 {
1344 struct _RTL_STACK_TRACE_ENTRY *HashChain;
1345 ULONG TraceCount;
1346 USHORT Index;
1347 USHORT Depth;
1348 PVOID BackTrace[32];
1349 } RTL_STACK_TRACE_ENTRY, *PRTL_STACK_TRACE_ENTRY;
1350
1351 typedef struct _STACK_TRACE_DATABASE
1352 {
1353 RTL_CRITICAL_SECTION CriticalSection;
1354 } STACK_TRACE_DATABASE, *PSTACK_TRACE_DATABASE;
1355
1356 typedef struct _RTL_TRACE_BLOCK
1357 {
1358 ULONG Magic;
1359 ULONG Count;
1360 ULONG Size;
1361 ULONG UserCount;
1362 ULONG UserSize;
1363 PVOID UserContext;
1364 struct _RTL_TRACE_BLOCK *Next;
1365 PVOID *Trace;
1366 } RTL_TRACE_BLOCK, *PRTL_TRACE_BLOCK;
1367
1368 #ifndef NTOS_MODE_USER
1369
1370 //
1371 // Message Resource Entry, Block and Data
1372 //
1373 typedef struct _MESSAGE_RESOURCE_ENTRY
1374 {
1375 USHORT Length;
1376 USHORT Flags;
1377 UCHAR Text[ANYSIZE_ARRAY];
1378 } MESSAGE_RESOURCE_ENTRY, *PMESSAGE_RESOURCE_ENTRY;
1379
1380 typedef struct _MESSAGE_RESOURCE_BLOCK
1381 {
1382 ULONG LowId;
1383 ULONG HighId;
1384 ULONG OffsetToEntries;
1385 } MESSAGE_RESOURCE_BLOCK, *PMESSAGE_RESOURCE_BLOCK;
1386
1387 typedef struct _MESSAGE_RESOURCE_DATA
1388 {
1389 ULONG NumberOfBlocks;
1390 MESSAGE_RESOURCE_BLOCK Blocks[ANYSIZE_ARRAY];
1391 } MESSAGE_RESOURCE_DATA, *PMESSAGE_RESOURCE_DATA;
1392
1393 #endif /* !NTOS_MODE_USER */
1394 #endif /* !_RTLTYPES_H */