[NDK]
[reactos.git] / reactos / sdk / 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 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 //
34 // Maximum Atom Length
35 //
36 #define RTL_MAXIMUM_ATOM_LENGTH 255
37
38 //
39 // Process Parameters Flags
40 //
41 #define RTL_USER_PROCESS_PARAMETERS_NORMALIZED 0x01
42 #define RTL_USER_PROCESS_PARAMETERS_PROFILE_USER 0x02
43 #define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL 0x04
44 #define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER 0x08
45 #define RTL_USER_PROCESS_PARAMETERS_UNKNOWN 0x10
46 #define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB 0x20
47 #define RTL_USER_PROCESS_PARAMETERS_RESERVE_16MB 0x40
48 #define RTL_USER_PROCESS_PARAMETERS_CASE_SENSITIVE 0x80
49 #define RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS 0x100
50 #define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_1 0x200
51 #define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_2 0x400
52 #define RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH 0x1000
53 #define RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH 0x2000
54 #define RTL_USER_PROCESS_PARAMETERS_IMAGE_KEY_MISSING 0x4000
55 #define RTL_USER_PROCESS_PARAMETERS_NX 0x20000
56
57 #define RTL_MAX_DRIVE_LETTERS 32
58 #define RTL_DRIVE_LETTER_VALID (USHORT)0x0001
59
60 //
61 // End of Exception List
62 //
63 #define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
64
65 //
66 // Thread Error Mode Flags
67 //
68 /* Also defined in psdk/winbase.h */
69 #define SEM_FAILCRITICALERRORS 0x0001
70 #define SEM_NOGPFAULTERRORBOX 0x0002
71 #define SEM_NOALIGNMENTFAULTEXCEPT 0x0004
72 #define SEM_NOOPENFILEERRORBOX 0x8000
73
74 #define RTL_SEM_FAILCRITICALERRORS (SEM_FAILCRITICALERRORS << 4)
75 #define RTL_SEM_NOGPFAULTERRORBOX (SEM_NOGPFAULTERRORBOX << 4)
76 #define RTL_SEM_NOALIGNMENTFAULTEXCEPT (SEM_NOALIGNMENTFAULTEXCEPT << 4)
77
78 //
79 // Range and Range List Flags
80 //
81 #define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
82 #define RTL_RANGE_LIST_ADD_SHARED 0x00000002
83
84 #define RTL_RANGE_SHARED 0x01
85 #define RTL_RANGE_CONFLICT 0x02
86
87 //
88 // Flags in RTL_ACTIVATION_CONTEXT_STACK_FRAME (from Checked NTDLL)
89 //
90 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_RELEASE_ON_DEACTIVATION 0x01
91 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_NO_DEACTIVATE 0x02
92 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ON_FREE_LIST 0x04
93 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_HEAP_ALLOCATED 0x08
94 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_NOT_REALLY_ACTIVATED 0x10
95 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ACTIVATED 0x20
96 #define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_DEACTIVATED 0x40
97
98 //
99 // Activation Context Frame Flags (from Checked NTDLL)
100 //
101 #define RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER 0x01
102
103 //
104 // RtlActivateActivationContextEx Flags (from Checked NTDLL)
105 //
106 #define RTL_ACTIVATE_ACTIVATION_CONTEXT_EX_FLAG_RELEASE_ON_STACK_DEALLOCATION 0x01
107
108 //
109 // RtlDeactivateActivationContext Flags (based on Win32 flag and name of above)
110 //
111 #define RTL_DEACTIVATE_ACTIVATION_CONTEXT_FLAG_FORCE_EARLY_DEACTIVATION 0x01
112
113 //
114 // RtlQueryActivationContext Flags (based on Win32 flag and name of above)
115 //
116 #define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_USE_ACTIVE_ACTIVATION_CONTEXT 0x01
117 #define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_HMODULE 0x02
118 #define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_ADDRESS 0x04
119 #define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF 0x80000000
120
121 //
122 // Public Heap Flags
123 //
124 #if !defined(NTOS_MODE_USER) && !defined(_NTIFS_)
125 #define HEAP_NO_SERIALIZE 0x00000001
126 #define HEAP_GROWABLE 0x00000002
127 #define HEAP_GENERATE_EXCEPTIONS 0x00000004
128 #define HEAP_ZERO_MEMORY 0x00000008
129 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
130 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020
131 #define HEAP_FREE_CHECKING_ENABLED 0x00000040
132 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
133 #define HEAP_CREATE_ALIGN_16 0x00010000
134 #define HEAP_CREATE_ENABLE_TRACING 0x00020000
135 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
136 #endif
137
138 //
139 // User-Defined Heap Flags and Classes
140 //
141 #define HEAP_SETTABLE_USER_VALUE 0x00000100
142 #define HEAP_SETTABLE_USER_FLAG1 0x00000200
143 #define HEAP_SETTABLE_USER_FLAG2 0x00000400
144 #define HEAP_SETTABLE_USER_FLAG3 0x00000800
145 #define HEAP_SETTABLE_USER_FLAGS 0x00000E00
146 #define HEAP_CLASS_0 0x00000000
147 #define HEAP_CLASS_1 0x00001000
148 #define HEAP_CLASS_2 0x00002000
149 #define HEAP_CLASS_3 0x00003000
150 #define HEAP_CLASS_4 0x00004000
151 #define HEAP_CLASS_5 0x00005000
152 #define HEAP_CLASS_6 0x00006000
153 #define HEAP_CLASS_7 0x00007000
154 #define HEAP_CLASS_8 0x00008000
155 #define HEAP_CLASS_MASK 0x0000F000
156
157 //
158 // Internal HEAP Structure Flags
159 //
160 #define HEAP_FLAG_PAGE_ALLOCS 0x01000000
161 #define HEAP_PROTECTION_ENABLED 0x02000000
162 #define HEAP_BREAK_WHEN_OUT_OF_VM 0x04000000
163 #define HEAP_NO_ALIGNMENT 0x08000000
164 #define HEAP_CAPTURE_STACK_BACKTRACES 0x08000000
165 #define HEAP_SKIP_VALIDATION_CHECKS 0x10000000
166 #define HEAP_VALIDATE_ALL_ENABLED 0x20000000
167 #define HEAP_VALIDATE_PARAMETERS_ENABLED 0x40000000
168 #define HEAP_LOCK_USER_ALLOCATED 0x80000000
169
170 //
171 // Heap Validation Flags
172 //
173 #define HEAP_CREATE_VALID_MASK \
174 (HEAP_NO_SERIALIZE | \
175 HEAP_GROWABLE | \
176 HEAP_GENERATE_EXCEPTIONS | \
177 HEAP_ZERO_MEMORY | \
178 HEAP_REALLOC_IN_PLACE_ONLY | \
179 HEAP_TAIL_CHECKING_ENABLED | \
180 HEAP_FREE_CHECKING_ENABLED | \
181 HEAP_DISABLE_COALESCE_ON_FREE | \
182 HEAP_CLASS_MASK | \
183 HEAP_CREATE_ALIGN_16 | \
184 HEAP_CREATE_ENABLE_TRACING | \
185 HEAP_CREATE_ENABLE_EXECUTE)
186 #ifdef C_ASSERT
187 C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
188 #endif
189
190 //
191 // Native image architecture
192 //
193 #if defined(_M_IX86)
194 #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_I386
195 #elif defined(_M_ARM)
196 #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARM
197 #elif defined(_M_AMD64)
198 #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_AMD64
199 #else
200 #error Define these please!
201 #endif
202
203 //
204 // Registry Keys
205 //
206 #define RTL_REGISTRY_ABSOLUTE 0
207 #define RTL_REGISTRY_SERVICES 1
208 #define RTL_REGISTRY_CONTROL 2
209 #define RTL_REGISTRY_WINDOWS_NT 3
210 #define RTL_REGISTRY_DEVICEMAP 4
211 #define RTL_REGISTRY_USER 5
212 #define RTL_REGISTRY_MAXIMUM 6
213 #define RTL_REGISTRY_HANDLE 0x40000000
214 #define RTL_REGISTRY_OPTIONAL 0x80000000
215 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
216 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
217 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
218 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
219 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
220 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020
221 #define RTL_QUERY_REGISTRY_DELETE 0x00000040
222
223 //
224 // Versioning
225 //
226 #define VER_MINORVERSION 0x0000001
227 #define VER_MAJORVERSION 0x0000002
228 #define VER_BUILDNUMBER 0x0000004
229 #define VER_PLATFORMID 0x0000008
230 #define VER_SERVICEPACKMINOR 0x0000010
231 #define VER_SERVICEPACKMAJOR 0x0000020
232 #define VER_SUITENAME 0x0000040
233 #define VER_PRODUCT_TYPE 0x0000080
234 #define VER_PLATFORM_WIN32s 0
235 #define VER_PLATFORM_WIN32_WINDOWS 1
236 #define VER_PLATFORM_WIN32_NT 2
237 #define VER_EQUAL 1
238 #define VER_GREATER 2
239 #define VER_GREATER_EQUAL 3
240 #define VER_LESS 4
241 #define VER_LESS_EQUAL 5
242 #define VER_AND 6
243 #define VER_OR 7
244 #define VER_CONDITION_MASK 7
245 #define VER_NUM_BITS_PER_CONDITION_MASK 3
246
247 //
248 // Timezone IDs
249 //
250 #define TIME_ZONE_ID_UNKNOWN 0
251 #define TIME_ZONE_ID_STANDARD 1
252 #define TIME_ZONE_ID_DAYLIGHT 2
253
254 //
255 // Maximum Path Length
256 //
257 #define MAX_PATH 260
258
259 //
260 // RTL Lock Type (Critical Section or Resource)
261 //
262 #define RTL_CRITSECT_TYPE 0
263 #define RTL_RESOURCE_TYPE 1
264
265 //
266 // RtlAcquirePrivileges Flags
267 //
268 #define RTL_ACQUIRE_PRIVILEGE_IMPERSONATE 1
269 #define RTL_ACQUIRE_PRIVILEGE_PROCESS 2
270
271 #ifdef NTOS_MODE_USER
272
273 //
274 // String Hash Algorithms
275 //
276 #define HASH_STRING_ALGORITHM_DEFAULT 0
277 #define HASH_STRING_ALGORITHM_X65599 1
278 #define HASH_STRING_ALGORITHM_INVALID 0xffffffff
279
280 //
281 // RtlDuplicateString Flags
282 //
283 #define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
284 #define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
285
286 //
287 // RtlFindCharInUnicodeString Flags
288 //
289 #define RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END 1
290 #define RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET 2
291 #define RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE 4
292
293 //
294 // RtlImageNtHeaderEx Flags
295 //
296 #define RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK 0x00000001
297
298 //
299 // RtlDosApplyFileIsolationRedirection_Ustr Flags
300 //
301 #define RTL_DOS_APPLY_FILE_REDIRECTION_USTR_FLAG_RESPECT_DOT_LOCAL 0x01
302
303 //
304 // Codepages
305 //
306 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
307 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
308 #define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
309
310 //
311 // Activation Contexts
312 //
313 #define INVALID_ACTIVATION_CONTEXT (PVOID)0xFFFFFFFF
314
315 //
316 // C++ CONST casting
317 //
318 #if defined(__cplusplus)
319 #define RTL_CONST_CAST(type) const_cast<type>
320 #else
321 #define RTL_CONST_CAST(type) (type)
322 #endif
323
324 //
325 // Constant String Macro
326 //
327 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
328 { \
329 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
330 sizeof(__SOURCE_STRING__), \
331 (__SOURCE_STRING__) \
332 }
333
334 //
335 // Constant Object Attributes Macro
336 //
337 #define RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a) \
338 { \
339 sizeof(OBJECT_ATTRIBUTES), \
340 NULL, \
341 RTL_CONST_CAST(PUNICODE_STRING)(n), \
342 a, \
343 NULL, \
344 NULL \
345 }
346
347 #define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
348 RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
349
350 #else /* NTOS_MODE_USER */
351 //
352 // Message Resource Flag
353 //
354 #define MESSAGE_RESOURCE_UNICODE 0x0001
355
356 #endif /* !NTOS_MODE_USER */
357 #define MAXIMUM_LEADBYTES 12
358
359 //
360 // RTL Debug Queries
361 //
362 #define RTL_DEBUG_QUERY_MODULES 0x01
363 #define RTL_DEBUG_QUERY_BACKTRACES 0x02
364 #define RTL_DEBUG_QUERY_HEAPS 0x04
365 #define RTL_DEBUG_QUERY_HEAP_TAGS 0x08
366 #define RTL_DEBUG_QUERY_HEAP_BLOCKS 0x10
367 #define RTL_DEBUG_QUERY_LOCKS 0x20
368
369 //
370 // RTL Handle Flags
371 //
372 #define RTL_HANDLE_VALID 0x1
373
374 //
375 // RTL Atom Flags
376 //
377 #define RTL_ATOM_IS_PINNED 0x1
378
379 //
380 // Critical section lock bits
381 //
382 #define CS_LOCK_BIT 0x1
383 #define CS_LOCK_BIT_V 0x0
384 #define CS_LOCK_WAITER_WOKEN 0x2
385 #define CS_LOCK_WAITER_INC 0x4
386
387 //
388 // Codepage Tags
389 //
390 #ifdef NTOS_MODE_USER
391 extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
392 extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
393
394 //
395 // Constant String Macro
396 //
397 #define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
398 { \
399 sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
400 sizeof(__SOURCE_STRING__), \
401 (__SOURCE_STRING__) \
402 }
403
404 #endif /* NTOS_MODE_USER */
405
406 #ifdef NTOS_MODE_USER
407
408 //
409 // Boot Status Data Field Types
410 //
411 typedef enum _RTL_BSD_ITEM_TYPE
412 {
413 RtlBsdItemVersionNumber,
414 RtlBsdItemProductType,
415 RtlBsdItemAabEnabled,
416 RtlBsdItemAabTimeout,
417 RtlBsdItemBootGood,
418 RtlBsdItemBootShutdown,
419 RtlBsdItemMax
420 } RTL_BSD_ITEM_TYPE, *PRTL_BSD_ITEM_TYPE;
421
422 //
423 // Table and Compare result types
424 //
425 typedef enum _TABLE_SEARCH_RESULT
426 {
427 TableEmptyTree,
428 TableFoundNode,
429 TableInsertAsLeft,
430 TableInsertAsRight
431 } TABLE_SEARCH_RESULT;
432
433 typedef enum _RTL_GENERIC_COMPARE_RESULTS
434 {
435 GenericLessThan,
436 GenericGreaterThan,
437 GenericEqual
438 } RTL_GENERIC_COMPARE_RESULTS;
439
440 #endif /* NTOS_MODE_USER */
441
442 //
443 // RTL Path Types
444 //
445 typedef enum _RTL_PATH_TYPE
446 {
447 RtlPathTypeUnknown,
448 RtlPathTypeUncAbsolute,
449 RtlPathTypeDriveAbsolute,
450 RtlPathTypeDriveRelative,
451 RtlPathTypeRooted,
452 RtlPathTypeRelative,
453 RtlPathTypeLocalDevice,
454 RtlPathTypeRootLocalDevice,
455 } RTL_PATH_TYPE;
456
457 #ifndef NTOS_MODE_USER
458
459 //
460 // Heap Information Class
461 //
462 typedef enum _HEAP_INFORMATION_CLASS
463 {
464 HeapCompatibilityInformation,
465 HeapEnableTerminationOnCorruption
466 } HEAP_INFORMATION_CLASS;
467
468 //
469 // Callback function for RTL Timers or Registered Waits
470 //
471 typedef VOID
472 (NTAPI *WAITORTIMERCALLBACKFUNC)(
473 PVOID pvContext,
474 BOOLEAN fTimerOrWaitFired
475 );
476
477 //
478 // Handler during Vectored RTL Exceptions
479 //
480 typedef LONG
481 (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
482 PEXCEPTION_POINTERS ExceptionPointers
483 );
484
485 //
486 // Worker Thread Callback for Rtl
487 //
488 typedef VOID
489 (NTAPI *WORKERCALLBACKFUNC)(
490 _In_ PVOID Context
491 );
492
493 #else /* !NTOS_MODE_USER */
494
495 //
496 // RTL Library Allocation/Free Routines
497 //
498 typedef PVOID
499 (NTAPI *PRTL_ALLOCATE_STRING_ROUTINE)(
500 SIZE_T NumberOfBytes
501 );
502
503 typedef PVOID
504 (NTAPI *PRTL_REALLOCATE_STRING_ROUTINE)(
505 SIZE_T NumberOfBytes,
506 PVOID Buffer
507 );
508
509 typedef
510 VOID
511 (NTAPI *PRTL_FREE_STRING_ROUTINE)(
512 PVOID Buffer
513 );
514
515 extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
516 extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
517 extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
518
519 #endif /* NTOS_MODE_USER */
520
521 //
522 // Unhandled Exception Filter
523 //
524 typedef ULONG
525 (NTAPI *RTLP_UNHANDLED_EXCEPTION_FILTER)(
526 _In_ struct _EXCEPTION_POINTERS *ExceptionInfo
527 );
528 typedef RTLP_UNHANDLED_EXCEPTION_FILTER *PRTLP_UNHANDLED_EXCEPTION_FILTER;
529
530 //
531 // Callback for RTL Heap Enumeration
532 //
533 typedef NTSTATUS
534 (NTAPI *PHEAP_ENUMERATION_ROUTINE)(
535 _In_ PVOID HeapHandle,
536 _In_ PVOID UserParam
537 );
538
539 //
540 // Thread and Process Start Routines for RtlCreateUserThread/Process
541 //
542 typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
543 PVOID Parameter
544 );
545
546 typedef VOID
547 (NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
548 PTHREAD_START_ROUTINE StartAddress,
549 PVOID Parameter
550 );
551
552 //
553 // Worker Start/Exit Function
554 //
555 typedef NTSTATUS
556 (NTAPI *PRTL_START_POOL_THREAD)(
557 _In_ PTHREAD_START_ROUTINE Function,
558 _In_ PVOID Parameter,
559 _Out_ PHANDLE ThreadHandle
560 );
561
562 typedef NTSTATUS
563 (NTAPI *PRTL_EXIT_POOL_THREAD)(
564 _In_ NTSTATUS ExitStatus
565 );
566
567 //
568 // Declare empty structure definitions so that they may be referenced by
569 // routines before they are defined
570 //
571 struct _RTL_AVL_TABLE;
572 struct _RTL_GENERIC_TABLE;
573 struct _RTL_RANGE;
574
575 //
576 // Routines and callbacks for the RTL AVL/Generic Table package
577 //
578 #ifdef NTOS_MODE_USER
579 typedef NTSTATUS
580 (NTAPI RTL_AVL_MATCH_FUNCTION)(
581 struct _RTL_AVL_TABLE *Table,
582 PVOID UserData,
583 PVOID MatchData
584 );
585 typedef RTL_AVL_MATCH_FUNCTION *PRTL_AVL_MATCH_FUNCTION;
586
587 typedef RTL_GENERIC_COMPARE_RESULTS
588 (NTAPI RTL_AVL_COMPARE_ROUTINE) (
589 struct _RTL_AVL_TABLE *Table,
590 PVOID FirstStruct,
591 PVOID SecondStruct
592 );
593 typedef RTL_AVL_COMPARE_ROUTINE *PRTL_AVL_COMPARE_ROUTINE;
594
595 typedef RTL_GENERIC_COMPARE_RESULTS
596 (NTAPI RTL_GENERIC_COMPARE_ROUTINE) (
597 struct _RTL_GENERIC_TABLE *Table,
598 PVOID FirstStruct,
599 PVOID SecondStruct
600 );
601 typedef RTL_GENERIC_COMPARE_ROUTINE *PRTL_GENERIC_COMPARE_ROUTINE;
602
603 typedef PVOID
604 (NTAPI RTL_GENERIC_ALLOCATE_ROUTINE) (
605 struct _RTL_GENERIC_TABLE *Table,
606 CLONG ByteSize
607 );
608 typedef RTL_GENERIC_ALLOCATE_ROUTINE *PRTL_GENERIC_ALLOCATE_ROUTINE;
609
610 typedef PVOID
611 (NTAPI RTL_AVL_ALLOCATE_ROUTINE) (
612 struct _RTL_AVL_TABLE *Table,
613 CLONG ByteSize
614 );
615 typedef RTL_AVL_ALLOCATE_ROUTINE *PRTL_AVL_ALLOCATE_ROUTINE;
616
617 typedef VOID
618 (NTAPI RTL_GENERIC_FREE_ROUTINE) (
619 struct _RTL_GENERIC_TABLE *Table,
620 PVOID Buffer
621 );
622 typedef RTL_GENERIC_FREE_ROUTINE *PRTL_GENERIC_FREE_ROUTINE;
623
624 typedef VOID
625 (NTAPI RTL_AVL_FREE_ROUTINE) (
626 struct _RTL_AVL_TABLE *Table,
627 PVOID Buffer
628 );
629 typedef RTL_AVL_FREE_ROUTINE *PRTL_AVL_FREE_ROUTINE;
630
631 #ifdef RTL_USE_AVL_TABLES
632 #undef RTL_GENERIC_COMPARE_ROUTINE
633 #undef PRTL_GENERIC_COMPARE_ROUTINE
634 #undef RTL_GENERIC_ALLOCATE_ROUTINE
635 #undef PRTL_GENERIC_ALLOCATE_ROUTINE
636 #undef RTL_GENERIC_FREE_ROUTINE
637 #undef PRTL_GENERIC_FREE_ROUTINE
638
639 #define RTL_GENERIC_COMPARE_ROUTINE RTL_AVL_COMPARE_ROUTINE
640 #define PRTL_GENERIC_COMPARE_ROUTINE PRTL_AVL_COMPARE_ROUTINE
641 #define RTL_GENERIC_ALLOCATE_ROUTINE RTL_AVL_ALLOCATE_ROUTINE
642 #define PRTL_GENERIC_ALLOCATE_ROUTINE PRTL_AVL_ALLOCATE_ROUTINE
643 #define RTL_GENERIC_FREE_ROUTINE RTL_AVL_FREE_ROUTINE
644 #define PRTL_GENERIC_FREE_ROUTINE PRTL_AVL_FREE_ROUTINE
645 #endif /* RTL_USE_AVL_TABLES */
646
647 #endif /* NTOS_MODE_USER */
648
649 //
650 // RTL Query Registry callback
651 //
652 #ifdef NTOS_MODE_USER
653 typedef NTSTATUS
654 (NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
655 _In_ PWSTR ValueName,
656 _In_ ULONG ValueType,
657 _In_ PVOID ValueData,
658 _In_ ULONG ValueLength,
659 _In_ PVOID Context,
660 _In_ PVOID EntryContext
661 );
662 #endif
663
664 //
665 // RTL Secure Memory callbacks
666 //
667 #ifdef NTOS_MODE_USER
668 typedef NTSTATUS
669 (NTAPI *PRTL_SECURE_MEMORY_CACHE_CALLBACK)(
670 _In_ PVOID Address,
671 _In_ SIZE_T Length
672 );
673 #endif
674
675 //
676 // RTL Range List callbacks
677 //
678 #ifdef NTOS_MODE_USER
679 typedef BOOLEAN
680 (NTAPI *PRTL_CONFLICT_RANGE_CALLBACK)(
681 PVOID Context,
682 struct _RTL_RANGE *Range
683 );
684
685 //
686 // Custom Heap Commit Routine for RtlCreateHeap
687 //
688 typedef NTSTATUS
689 (NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
690 _In_ PVOID Base,
691 _Inout_ PVOID *CommitAddress,
692 _Inout_ PSIZE_T CommitSize
693 );
694
695 //
696 // Parameters for RtlCreateHeap
697 //
698 typedef struct _RTL_HEAP_PARAMETERS
699 {
700 ULONG Length;
701 SIZE_T SegmentReserve;
702 SIZE_T SegmentCommit;
703 SIZE_T DeCommitFreeBlockThreshold;
704 SIZE_T DeCommitTotalFreeThreshold;
705 SIZE_T MaximumAllocationSize;
706 SIZE_T VirtualMemoryThreshold;
707 SIZE_T InitialCommit;
708 SIZE_T InitialReserve;
709 PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
710 SIZE_T Reserved[2];
711 } RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
712
713 //
714 // RTL Bitmap structures
715 //
716 typedef struct _RTL_BITMAP
717 {
718 ULONG SizeOfBitMap;
719 PULONG Buffer;
720 } RTL_BITMAP, *PRTL_BITMAP;
721
722 typedef struct _RTL_BITMAP_RUN
723 {
724 ULONG StartingIndex;
725 ULONG NumberOfBits;
726 } RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
727
728 //
729 // RtlGenerateXxxName context
730 //
731 typedef struct _GENERATE_NAME_CONTEXT
732 {
733 USHORT Checksum;
734 BOOLEAN CheckSumInserted;
735 UCHAR NameLength;
736 WCHAR NameBuffer[8];
737 ULONG ExtensionLength;
738 WCHAR ExtensionBuffer[4];
739 ULONG LastIndexValue;
740 } GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
741
742 //
743 // RTL Splay and Balanced Links structures
744 //
745 typedef struct _RTL_SPLAY_LINKS
746 {
747 struct _RTL_SPLAY_LINKS *Parent;
748 struct _RTL_SPLAY_LINKS *LeftChild;
749 struct _RTL_SPLAY_LINKS *RightChild;
750 } RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
751
752 typedef struct _RTL_BALANCED_LINKS
753 {
754 struct _RTL_BALANCED_LINKS *Parent;
755 struct _RTL_BALANCED_LINKS *LeftChild;
756 struct _RTL_BALANCED_LINKS *RightChild;
757 CHAR Balance;
758 UCHAR Reserved[3];
759 } RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
760
761 //
762 // RTL Avl/Generic Tables
763 //
764 #ifndef RTL_USE_AVL_TABLES
765 typedef struct _RTL_GENERIC_TABLE
766 {
767 PRTL_SPLAY_LINKS TableRoot;
768 LIST_ENTRY InsertOrderList;
769 PLIST_ENTRY OrderedPointer;
770 ULONG WhichOrderedElement;
771 ULONG NumberGenericTableElements;
772 PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
773 PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
774 PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
775 PVOID TableContext;
776 } RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
777 #endif /* !RTL_USE_AVL_TABLES */
778
779 typedef struct _RTL_AVL_TABLE
780 {
781 RTL_BALANCED_LINKS BalancedRoot;
782 PVOID OrderedPointer;
783 ULONG WhichOrderedElement;
784 ULONG NumberGenericTableElements;
785 ULONG DepthOfTree;
786 PRTL_BALANCED_LINKS RestartKey;
787 ULONG DeleteCount;
788 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
789 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
790 PRTL_AVL_FREE_ROUTINE FreeRoutine;
791 PVOID TableContext;
792 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
793
794 #ifdef RTL_USE_AVL_TABLES
795 #undef RTL_GENERIC_TABLE
796 #undef PRTL_GENERIC_TABLE
797
798 #define RTL_GENERIC_TABLE RTL_AVL_TABLE
799 #define PRTL_GENERIC_TABLE PRTL_AVL_TABLE
800 #endif /* RTL_USE_AVL_TABLES */
801
802 //
803 // RTL Compression Buffer
804 //
805 typedef struct _COMPRESSED_DATA_INFO {
806 USHORT CompressionFormatAndEngine;
807 UCHAR CompressionUnitShift;
808 UCHAR ChunkShift;
809 UCHAR ClusterShift;
810 UCHAR Reserved;
811 USHORT NumberOfChunks;
812 ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
813 } COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
814
815 //
816 // RtlQueryRegistry Data
817 //
818 typedef struct _RTL_QUERY_REGISTRY_TABLE
819 {
820 PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
821 ULONG Flags;
822 PCWSTR Name;
823 PVOID EntryContext;
824 ULONG DefaultType;
825 PVOID DefaultData;
826 ULONG DefaultLength;
827 } RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
828
829 //
830 // RTL Unicode Table Structures
831 //
832 typedef struct _UNICODE_PREFIX_TABLE_ENTRY
833 {
834 CSHORT NodeTypeCode;
835 CSHORT NameLength;
836 struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
837 struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
838 RTL_SPLAY_LINKS Links;
839 PUNICODE_STRING Prefix;
840 } UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
841
842 typedef struct _UNICODE_PREFIX_TABLE
843 {
844 CSHORT NodeTypeCode;
845 CSHORT NameLength;
846 PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
847 PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
848 } UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
849
850 #ifdef NTOS_MODE_USER
851 //
852 // Pfx* routines' table structures
853 //
854 typedef struct _PREFIX_TABLE_ENTRY
855 {
856 CSHORT NodeTypeCode;
857 CSHORT NameLength;
858 struct _PREFIX_TABLE_ENTRY *NextPrefixTree;
859 RTL_SPLAY_LINKS Links;
860 PSTRING Prefix;
861 } PREFIX_TABLE_ENTRY, *PPREFIX_TABLE_ENTRY;
862
863 typedef struct _PREFIX_TABLE
864 {
865 CSHORT NodeTypeCode;
866 CSHORT NameLength;
867 PPREFIX_TABLE_ENTRY NextPrefixTree;
868 } PREFIX_TABLE, *PPREFIX_TABLE;
869 #endif
870
871 //
872 // Time Structure for RTL Time calls
873 //
874 typedef struct _TIME_FIELDS
875 {
876 CSHORT Year;
877 CSHORT Month;
878 CSHORT Day;
879 CSHORT Hour;
880 CSHORT Minute;
881 CSHORT Second;
882 CSHORT Milliseconds;
883 CSHORT Weekday;
884 } TIME_FIELDS, *PTIME_FIELDS;
885
886 //
887 // Activation Context Frame
888 //
889 typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
890 {
891 struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
892 PACTIVATION_CONTEXT ActivationContext;
893 ULONG Flags;
894 } RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
895
896 typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC
897 {
898 SIZE_T Size;
899 ULONG Format;
900 RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
901 } RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC, *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC;
902
903 typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
904 {
905 SIZE_T Size;
906 ULONG Format;
907 RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
908 PVOID Extra1;
909 PVOID Extra2;
910 PVOID Extra3;
911 PVOID Extra4;
912 } RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED, *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED;
913
914 typedef RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
915 typedef PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
916
917 typedef struct _RTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME
918 {
919 RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
920 ULONG_PTR Cookie;
921 PVOID ActivationStackBackTrace[8];
922 } RTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
923
924 #if (NTDDI_VERSION >= NTDDI_WS03)
925 typedef struct _ACTIVATION_CONTEXT_STACK
926 {
927 PRTL_ACTIVATION_CONTEXT_STACK_FRAME ActiveFrame;
928 LIST_ENTRY FrameListCache;
929 ULONG Flags;
930 ULONG NextCookieSequenceNumber;
931 ULONG StackId;
932 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
933 #else
934 typedef struct _ACTIVATION_CONTEXT_STACK
935 {
936 ULONG Flags;
937 ULONG NextCookieSequenceNumber;
938 PVOID ActiveFrame;
939 LIST_ENTRY FrameListCache;
940 } ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
941 #endif
942
943 typedef struct _ACTIVATION_CONTEXT_DATA
944 {
945 ULONG Magic;
946 ULONG HeaderSize;
947 ULONG FormatVersion;
948 ULONG TotalSize;
949 ULONG DefaultTocOffset;
950 ULONG ExtendedTocOffset;
951 ULONG AssemblyRosterOffset;
952 ULONG Flags;
953 } ACTIVATION_CONTEXT_DATA, *PACTIVATION_CONTEXT_DATA;
954
955 typedef struct _ACTIVATION_CONTEXT_STACK_FRAMELIST
956 {
957 ULONG Magic;
958 ULONG FramesInUse;
959 LIST_ENTRY Links;
960 ULONG Flags;
961 ULONG NotFramesInUse;
962 RTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME Frames[32];
963 } ACTIVATION_CONTEXT_STACK_FRAMELIST, *PACTIVATION_CONTEXT_STACK_FRAMELIST;
964
965 #endif /* NTOS_MODE_USER */
966
967 //
968 // ACE Structure
969 //
970 typedef struct _ACE
971 {
972 ACE_HEADER Header;
973 ACCESS_MASK AccessMask;
974 } ACE, *PACE;
975
976 //
977 // Information Structures for RTL Debug Functions
978 //
979 typedef struct _RTL_PROCESS_MODULE_INFORMATION
980 {
981 ULONG Section;
982 PVOID MappedBase;
983 PVOID ImageBase;
984 ULONG ImageSize;
985 ULONG Flags;
986 USHORT LoadOrderIndex;
987 USHORT InitOrderIndex;
988 USHORT LoadCount;
989 USHORT OffsetToFileName;
990 CHAR FullPathName[256];
991 } RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
992
993 typedef struct _RTL_PROCESS_MODULES
994 {
995 ULONG NumberOfModules;
996 RTL_PROCESS_MODULE_INFORMATION Modules[1];
997 } RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
998
999 typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
1000 {
1001 ULONG NextOffset;
1002 RTL_PROCESS_MODULE_INFORMATION BaseInfo;
1003 ULONG ImageCheckSum;
1004 ULONG TimeDateStamp;
1005 PVOID DefaultBase;
1006 } RTL_PROCESS_MODULE_INFORMATION_EX, *PRTL_PROCESS_MODULE_INFORMATION_EX;
1007
1008 typedef struct _RTL_HEAP_TAG_INFO
1009 {
1010 ULONG NumberOfAllocations;
1011 ULONG NumberOfFrees;
1012 SIZE_T BytesAllocated;
1013 } RTL_HEAP_TAG_INFO, *PRTL_HEAP_TAG_INFO;
1014
1015 typedef struct _RTL_HEAP_USAGE_ENTRY
1016 {
1017 struct _RTL_HEAP_USAGE_ENTRY *Next;
1018 PVOID Address;
1019 SIZE_T Size;
1020 USHORT AllocatorBackTraceIndex;
1021 USHORT TagIndex;
1022 } RTL_HEAP_USAGE_ENTRY, *PRTL_HEAP_USAGE_ENTRY;
1023
1024 typedef struct _RTL_HEAP_USAGE
1025 {
1026 ULONG Length;
1027 SIZE_T BytesAllocated;
1028 SIZE_T BytesCommitted;
1029 SIZE_T BytesReserved;
1030 SIZE_T BytesReservedMaximum;
1031 PRTL_HEAP_USAGE_ENTRY Entries;
1032 PRTL_HEAP_USAGE_ENTRY AddedEntries;
1033 PRTL_HEAP_USAGE_ENTRY RemovedEntries;
1034 ULONG_PTR Reserved[8];
1035 } RTL_HEAP_USAGE, *PRTL_HEAP_USAGE;
1036
1037 typedef struct _RTL_HEAP_WALK_ENTRY
1038 {
1039 PVOID DataAddress;
1040 SIZE_T DataSize;
1041 UCHAR OverheadBytes;
1042 UCHAR SegmentIndex;
1043 USHORT Flags;
1044 union
1045 {
1046 struct
1047 {
1048 SIZE_T Settable;
1049 USHORT TagIndex;
1050 USHORT AllocatorBackTraceIndex;
1051 ULONG Reserved[2];
1052 } Block;
1053 struct
1054 {
1055 ULONG_PTR CommittedSize;
1056 ULONG_PTR UnCommittedSize;
1057 PVOID FirstEntry;
1058 PVOID LastEntry;
1059 } Segment;
1060 };
1061 } RTL_HEAP_WALK_ENTRY, *PRTL_HEAP_WALK_ENTRY;
1062
1063 typedef struct _RTL_HEAP_ENTRY
1064 {
1065 SIZE_T Size;
1066 USHORT Flags;
1067 USHORT AllocatorBackTraceIndex;
1068 union
1069 {
1070 struct
1071 {
1072 SIZE_T Settable;
1073 ULONG Tag;
1074 } s1;
1075 struct
1076 {
1077 SIZE_T CommittedSize;
1078 PVOID FirstBlock;
1079 } s2;
1080 } u;
1081 } RTL_HEAP_ENTRY, *PRTL_HEAP_ENTRY;
1082
1083 typedef struct _RTL_HEAP_TAG
1084 {
1085 ULONG NumberOfAllocations;
1086 ULONG NumberOfFrees;
1087 SIZE_T BytesAllocated;
1088 USHORT TagIndex;
1089 USHORT CreatorBackTraceIndex;
1090 WCHAR TagName[24];
1091 } RTL_HEAP_TAG, *PRTL_HEAP_TAG;
1092
1093 typedef struct _RTL_HEAP_INFORMATION
1094 {
1095 PVOID BaseAddress;
1096 ULONG Flags;
1097 USHORT EntryOverhead;
1098 USHORT CreatorBackTraceIndex;
1099 SIZE_T BytesAllocated;
1100 SIZE_T BytesCommitted;
1101 ULONG NumberOfTags;
1102 ULONG NumberOfEntries;
1103 ULONG NumberOfPseudoTags;
1104 ULONG PseudoTagGranularity;
1105 ULONG Reserved[5];
1106 PRTL_HEAP_TAG Tags;
1107 PRTL_HEAP_ENTRY Entries;
1108 } RTL_HEAP_INFORMATION, *PRTL_HEAP_INFORMATION;
1109
1110 typedef struct _RTL_PROCESS_HEAPS
1111 {
1112 ULONG NumberOfHeaps;
1113 RTL_HEAP_INFORMATION Heaps[1];
1114 } RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;
1115
1116 typedef struct _RTL_PROCESS_LOCK_INFORMATION
1117 {
1118 PVOID Address;
1119 USHORT Type;
1120 USHORT CreatorBackTraceIndex;
1121 ULONG OwnerThreadId;
1122 ULONG ActiveCount;
1123 ULONG ContentionCount;
1124 ULONG EntryCount;
1125 ULONG RecursionCount;
1126 ULONG NumberOfSharedWaiters;
1127 ULONG NumberOfExclusiveWaiters;
1128 } RTL_PROCESS_LOCK_INFORMATION, *PRTL_PROCESS_LOCK_INFORMATION;
1129
1130 typedef struct _RTL_PROCESS_LOCKS
1131 {
1132 ULONG NumberOfLocks;
1133 RTL_PROCESS_LOCK_INFORMATION Locks[1];
1134 } RTL_PROCESS_LOCKS, *PRTL_PROCESS_LOCKS;
1135
1136 typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
1137 {
1138 PVOID SymbolicBackTrace;
1139 ULONG TraceCount;
1140 USHORT Index;
1141 USHORT Depth;
1142 PVOID BackTrace[16];
1143 } RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
1144
1145 typedef struct _RTL_PROCESS_BACKTRACES
1146 {
1147 ULONG CommittedMemory;
1148 ULONG ReservedMemory;
1149 ULONG NumberOfBackTraceLookups;
1150 ULONG NumberOfBackTraces;
1151 RTL_PROCESS_BACKTRACE_INFORMATION BackTraces[1];
1152 } RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
1153
1154 typedef struct _RTL_PROCESS_VERIFIER_OPTIONS
1155 {
1156 ULONG SizeStruct;
1157 ULONG Option;
1158 UCHAR OptionData[1];
1159 //
1160 // Option array continues below
1161 //
1162 } RTL_PROCESS_VERIFIER_OPTIONS, *PRTL_PROCESS_VERIFIER_OPTIONS;
1163
1164 typedef struct _RTL_DEBUG_INFORMATION
1165 {
1166 HANDLE SectionHandleClient;
1167 PVOID ViewBaseClient;
1168 PVOID ViewBaseTarget;
1169 ULONG ViewBaseDelta;
1170 HANDLE EventPairClient;
1171 PVOID EventPairTarget;
1172 HANDLE TargetProcessId;
1173 HANDLE TargetThreadHandle;
1174 ULONG Flags;
1175 ULONG OffsetFree;
1176 ULONG CommitSize;
1177 ULONG ViewSize;
1178 union
1179 {
1180 PRTL_PROCESS_MODULES Modules;
1181 PRTL_PROCESS_MODULE_INFORMATION_EX ModulesEx;
1182 };
1183 PRTL_PROCESS_BACKTRACES BackTraces;
1184 PRTL_PROCESS_HEAPS Heaps;
1185 PRTL_PROCESS_LOCKS Locks;
1186 HANDLE SpecificHeap;
1187 HANDLE TargetProcessHandle;
1188 RTL_PROCESS_VERIFIER_OPTIONS VerifierOptions;
1189 HANDLE ProcessHeap;
1190 HANDLE CriticalSectionHandle;
1191 HANDLE CriticalSectionOwnerThread;
1192 PVOID Reserved[4];
1193 } RTL_DEBUG_INFORMATION, *PRTL_DEBUG_INFORMATION;
1194
1195 //
1196 // Unload Event Trace Structure for RtlGetUnloadEventTrace
1197 //
1198 typedef struct _RTL_UNLOAD_EVENT_TRACE
1199 {
1200 PVOID BaseAddress;
1201 ULONG SizeOfImage;
1202 ULONG Sequence;
1203 ULONG TimeDateStamp;
1204 ULONG CheckSum;
1205 WCHAR ImageName[32];
1206 } RTL_UNLOAD_EVENT_TRACE, *PRTL_UNLOAD_EVENT_TRACE;
1207
1208 //
1209 // RTL Handle Structures
1210 //
1211 typedef struct _RTL_HANDLE_TABLE_ENTRY
1212 {
1213 union
1214 {
1215 ULONG Flags;
1216 struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
1217 };
1218 } RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
1219
1220 typedef struct _RTL_HANDLE_TABLE
1221 {
1222 ULONG MaximumNumberOfHandles;
1223 ULONG SizeOfHandleTableEntry;
1224 ULONG Reserved[2];
1225 PRTL_HANDLE_TABLE_ENTRY FreeHandles;
1226 PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
1227 PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
1228 PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
1229 } RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
1230
1231 #ifdef NTOS_MODE_USER
1232 //
1233 // Exception Record
1234 //
1235 typedef struct _EXCEPTION_REGISTRATION_RECORD
1236 {
1237 struct _EXCEPTION_REGISTRATION_RECORD *Next;
1238 PEXCEPTION_ROUTINE Handler;
1239 } EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
1240 #endif /* NTOS_MODE_USER */
1241
1242 //
1243 // Current Directory Structures
1244 //
1245 typedef struct _CURDIR
1246 {
1247 UNICODE_STRING DosPath;
1248 HANDLE Handle;
1249 } CURDIR, *PCURDIR;
1250
1251 typedef struct _RTLP_CURDIR_REF
1252 {
1253 LONG RefCount;
1254 HANDLE Handle;
1255 } RTLP_CURDIR_REF, *PRTLP_CURDIR_REF;
1256
1257 typedef struct _RTL_RELATIVE_NAME_U
1258 {
1259 UNICODE_STRING RelativeName;
1260 HANDLE ContainingDirectory;
1261 PRTLP_CURDIR_REF CurDirRef;
1262 } RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U;
1263
1264 typedef struct _RTL_DRIVE_LETTER_CURDIR
1265 {
1266 USHORT Flags;
1267 USHORT Length;
1268 ULONG TimeStamp;
1269 UNICODE_STRING DosPath;
1270 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
1271
1272 typedef struct _RTL_PERTHREAD_CURDIR
1273 {
1274 PRTL_DRIVE_LETTER_CURDIR CurrentDirectories;
1275 PUNICODE_STRING ImageName;
1276 PVOID Environment;
1277 } RTL_PERTHREAD_CURDIR, *PRTL_PERTHREAD_CURDIR;
1278
1279 //
1280 // Private State structure for RtlAcquirePrivilege/RtlReleasePrivilege
1281 //
1282 typedef struct _RTL_ACQUIRE_STATE
1283 {
1284 HANDLE Token;
1285 HANDLE OldImpersonationToken;
1286 PTOKEN_PRIVILEGES OldPrivileges;
1287 PTOKEN_PRIVILEGES NewPrivileges;
1288 ULONG Flags;
1289 UCHAR OldPrivBuffer[1024];
1290 } RTL_ACQUIRE_STATE, *PRTL_ACQUIRE_STATE;
1291
1292 #ifndef NTOS_MODE_USER
1293
1294 //
1295 // RTL Critical Section Structures
1296 //
1297 typedef struct _RTL_CRITICAL_SECTION_DEBUG
1298 {
1299 USHORT Type;
1300 USHORT CreatorBackTraceIndex;
1301 struct _RTL_CRITICAL_SECTION *CriticalSection;
1302 LIST_ENTRY ProcessLocksList;
1303 ULONG EntryCount;
1304 ULONG ContentionCount;
1305 ULONG Spare[2];
1306 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
1307
1308 typedef struct _RTL_CRITICAL_SECTION
1309 {
1310 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
1311 LONG LockCount;
1312 LONG RecursionCount;
1313 HANDLE OwningThread;
1314 HANDLE LockSemaphore;
1315 ULONG_PTR SpinCount;
1316 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
1317
1318 #endif /* !NTOS_MODE_USER */
1319
1320 //
1321 // RTL Private Heap Structures
1322 //
1323 typedef struct _HEAP_LOCK
1324 {
1325 union
1326 {
1327 RTL_CRITICAL_SECTION CriticalSection;
1328 #ifndef NTOS_MODE_USER
1329 ERESOURCE Resource;
1330 #endif
1331 UCHAR Padding[0x68]; /* Max ERESOURCE size for x64 build. Needed because RTL is built only once */
1332 };
1333 } HEAP_LOCK, *PHEAP_LOCK;
1334
1335 //
1336 // RTL Range List Structures
1337 //
1338 typedef struct _RTL_RANGE_LIST
1339 {
1340 LIST_ENTRY ListHead;
1341 ULONG Flags;
1342 ULONG Count;
1343 ULONG Stamp;
1344 } RTL_RANGE_LIST, *PRTL_RANGE_LIST;
1345
1346 typedef struct _RTL_RANGE
1347 {
1348 ULONGLONG Start;
1349 ULONGLONG End;
1350 PVOID UserData;
1351 PVOID Owner;
1352 UCHAR Attributes;
1353 UCHAR Flags;
1354 } RTL_RANGE, *PRTL_RANGE;
1355
1356 typedef struct _RANGE_LIST_ITERATOR
1357 {
1358 PLIST_ENTRY RangeListHead;
1359 PLIST_ENTRY MergedHead;
1360 PVOID Current;
1361 ULONG Stamp;
1362 } RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
1363
1364 //
1365 // RTL Resource
1366 //
1367 #define RTL_RESOURCE_FLAG_LONG_TERM ((ULONG)0x00000001)
1368
1369 typedef struct _RTL_RESOURCE
1370 {
1371 RTL_CRITICAL_SECTION Lock;
1372 HANDLE SharedSemaphore;
1373 ULONG SharedWaiters;
1374 HANDLE ExclusiveSemaphore;
1375 ULONG ExclusiveWaiters;
1376 LONG NumberActive;
1377 HANDLE OwningThread;
1378 ULONG TimeoutBoost;
1379 PVOID DebugInfo;
1380 } RTL_RESOURCE, *PRTL_RESOURCE;
1381
1382 //
1383 // Structures for RtlCreateUserProcess
1384 //
1385 typedef struct _RTL_USER_PROCESS_PARAMETERS
1386 {
1387 ULONG MaximumLength;
1388 ULONG Length;
1389 ULONG Flags;
1390 ULONG DebugFlags;
1391 HANDLE ConsoleHandle;
1392 ULONG ConsoleFlags;
1393 HANDLE StandardInput;
1394 HANDLE StandardOutput;
1395 HANDLE StandardError;
1396 CURDIR CurrentDirectory;
1397 UNICODE_STRING DllPath;
1398 UNICODE_STRING ImagePathName;
1399 UNICODE_STRING CommandLine;
1400 PWSTR Environment;
1401 ULONG StartingX;
1402 ULONG StartingY;
1403 ULONG CountX;
1404 ULONG CountY;
1405 ULONG CountCharsX;
1406 ULONG CountCharsY;
1407 ULONG FillAttribute;
1408 ULONG WindowFlags;
1409 ULONG ShowWindowFlags;
1410 UNICODE_STRING WindowTitle;
1411 UNICODE_STRING DesktopInfo;
1412 UNICODE_STRING ShellInfo;
1413 UNICODE_STRING RuntimeData;
1414 RTL_DRIVE_LETTER_CURDIR CurrentDirectories[RTL_MAX_DRIVE_LETTERS];
1415 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
1416 SIZE_T EnvironmentSize;
1417 #endif
1418 #if (NTDDI_VERSION >= NTDDI_WIN7)
1419 SIZE_T EnvironmentVersion;
1420 #endif
1421 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
1422
1423 typedef struct _RTL_USER_PROCESS_INFORMATION
1424 {
1425 ULONG Size;
1426 HANDLE ProcessHandle;
1427 HANDLE ThreadHandle;
1428 CLIENT_ID ClientId;
1429 SECTION_IMAGE_INFORMATION ImageInformation;
1430 } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
1431
1432 #if (NTDDI_VERSION >= NTDDI_WIN7)
1433
1434 typedef enum _RTL_UMS_SCHEDULER_REASON
1435 {
1436 UmsSchedulerStartup = 0,
1437 UmsSchedulerThreadBlocked = 1,
1438 UmsSchedulerThreadYield = 2,
1439 } RTL_UMS_SCHEDULER_REASON, *PRTL_UMS_SCHEDULER_REASON;
1440
1441 typedef enum _RTL_UMSCTX_FLAGS
1442 {
1443 UMSCTX_SCHEDULED_THREAD_BIT = 0,
1444 #if (NTDDI_VERSION < NTDDI_WIN8)
1445 UMSCTX_HAS_QUANTUM_REQ_BIT,
1446 UMSCTX_HAS_AFFINITY_REQ_BIT,
1447 UMSCTX_HAS_PRIORITY_REQ_BIT,
1448 #endif
1449 UMSCTX_SUSPENDED_BIT,
1450 UMSCTX_VOLATILE_CONTEXT_BIT,
1451 UMSCTX_TERMINATED_BIT,
1452 UMSCTX_DEBUG_ACTIVE_BIT,
1453 UMSCTX_RUNNING_ON_SELF_THREAD_BIT,
1454 UMSCTX_DENY_RUNNING_ON_SELF_THREAD_BIT
1455
1456 } RTL_UMSCTX_FLAGS, *PRTL_UMSCTX_FLAGS;
1457
1458 #define UMSCTX_SCHEDULED_THREAD_MASK (1 << UMSCTX_SCHEDULED_THREAD_BIT)
1459 #define UMSCTX_SUSPENDED_MASK (1 << UMSCTX_SUSPENDED_BIT)
1460 #define UMSCTX_VOLATILE_CONTEXT_MASK (1 << UMSCTX_VOLATILE_CONTEXT_BIT)
1461 #define UMSCTX_TERMINATED_MASK (1 << UMSCTX_TERMINATED_BIT)
1462 #define UMSCTX_DEBUG_ACTIVE_MASK (1 << UMSCTX_DEBUG_ACTIVE_BIT)
1463 #define UMSCTX_RUNNING_ON_SELF_THREAD_MASK (1 << UMSCTX_RUNNING_ON_SELF_THREAD_BIT)
1464 #define UMSCTX_DENY_RUNNING_ON_SELF_THREAD_MASK (1 << UMSCTX_DENY_RUNNING_ON_SELF_THREAD_BIT)
1465
1466 //
1467 // UMS Context
1468 //
1469 typedef struct DECLSPEC_ALIGN(16) _RTL_UMS_CONTEXT
1470 {
1471 SINGLE_LIST_ENTRY Link;
1472 CONTEXT Context;
1473 PVOID Teb;
1474 PVOID UserContext;
1475 union
1476 {
1477 struct
1478 {
1479 ULONG ScheduledThread : 1;
1480 #if (NTDDI_VERSION < NTDDI_WIN8)
1481 ULONG HasQuantumReq : 1;
1482 ULONG HasAffinityReq : 1;
1483 ULONG HasPriorityReq : 1;
1484 #endif
1485 ULONG Suspended : 1;
1486 ULONG VolatileContext : 1;
1487 ULONG Terminated : 1;
1488 ULONG DebugActive : 1;
1489 ULONG RunningOnSelfThread : 1;
1490 ULONG DenyRunningOnSelfThread : 1;
1491 #if (NTDDI_VERSION < NTDDI_WIN8)
1492 ULONG ReservedFlags : 22;
1493 #endif
1494 };
1495 LONG Flags;
1496 };
1497 union
1498 {
1499 struct
1500 {
1501 #if (NTDDI_VERSION >= NTDDI_WIN8)
1502 ULONG64 KernelUpdateLock : 2;
1503 #else
1504 ULONG64 KernelUpdateLock : 1;
1505 ULONG64 Reserved : 1;
1506 #endif
1507 ULONG64 PrimaryClientID : 62;
1508 };
1509 ULONG64 ContextLock;
1510 };
1511 #if (NTDDI_VERSION < NTDDI_WIN8)
1512 ULONG64 QuantumValue;
1513 GROUP_AFFINITY AffinityMask;
1514 LONG Priority;
1515 #endif
1516 struct _RTL_UMS_CONTEXT* PrimaryUmsContext;
1517 ULONG SwitchCount;
1518 ULONG KernelYieldCount;
1519 ULONG MixedYieldCount;
1520 ULONG YieldCount;
1521 } RTL_UMS_CONTEXT, *PRTL_UMS_CONTEXT;
1522 #endif // #if (NTDDI_VERSION >= NTDDI_WIN7)
1523
1524 //
1525 // RTL Atom Table Structures
1526 //
1527 typedef struct _RTL_ATOM_TABLE_ENTRY
1528 {
1529 struct _RTL_ATOM_TABLE_ENTRY *HashLink;
1530 USHORT HandleIndex;
1531 USHORT Atom;
1532 USHORT ReferenceCount;
1533 UCHAR Flags;
1534 UCHAR NameLength;
1535 WCHAR Name[1];
1536 } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
1537
1538 typedef struct _RTL_ATOM_TABLE
1539 {
1540 ULONG Signature;
1541 union
1542 {
1543 #ifdef NTOS_MODE_USER
1544 RTL_CRITICAL_SECTION CriticalSection;
1545 #else
1546 FAST_MUTEX FastMutex;
1547 #endif
1548 };
1549 union
1550 {
1551 #ifdef NTOS_MODE_USER
1552 RTL_HANDLE_TABLE RtlHandleTable;
1553 #else
1554 PHANDLE_TABLE ExHandleTable;
1555 #endif
1556 };
1557 ULONG NumberOfBuckets;
1558 PRTL_ATOM_TABLE_ENTRY Buckets[1];
1559 } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
1560
1561 #ifndef _WINBASE_
1562 //
1563 // System Time and Timezone Structures
1564 //
1565 typedef struct _SYSTEMTIME
1566 {
1567 USHORT wYear;
1568 USHORT wMonth;
1569 USHORT wDayOfWeek;
1570 USHORT wDay;
1571 USHORT wHour;
1572 USHORT wMinute;
1573 USHORT wSecond;
1574 USHORT wMilliseconds;
1575 } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
1576
1577 typedef struct _TIME_ZONE_INFORMATION
1578 {
1579 LONG Bias;
1580 WCHAR StandardName[32];
1581 SYSTEMTIME StandardDate;
1582 LONG StandardBias;
1583 WCHAR DaylightName[32];
1584 SYSTEMTIME DaylightDate;
1585 LONG DaylightBias;
1586 } TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
1587 #endif /* !_WINBASE_ */
1588
1589 //
1590 // Native version of Timezone Structure
1591 //
1592 typedef LPTIME_ZONE_INFORMATION PRTL_TIME_ZONE_INFORMATION;
1593
1594 //
1595 // Hotpatch Header
1596 //
1597 typedef struct _RTL_PATCH_HEADER
1598 {
1599 LIST_ENTRY PatchList;
1600 PVOID PatchImageBase;
1601 struct _RTL_PATCH_HEADER *NextPath;
1602 ULONG PatchFlags;
1603 LONG PatchRefCount;
1604 struct _HOTPATCH_HEADER *HotpatchHeader;
1605 UNICODE_STRING TargetDllName;
1606 PVOID TargetDllBase;
1607 PLDR_DATA_TABLE_ENTRY TargetLdrDataTableEntry;
1608 PLDR_DATA_TABLE_ENTRY PatchLdrDataTableEntry;
1609 struct _SYSTEM_HOTPATCH_CODE_INFORMATION *CodeInfo;
1610 } RTL_PATCH_HEADER, *PRTL_PATCH_HEADER;
1611
1612 //
1613 // Header for NLS Files
1614 //
1615 typedef struct _NLS_FILE_HEADER
1616 {
1617 USHORT HeaderSize;
1618 USHORT CodePage;
1619 USHORT MaximumCharacterSize;
1620 USHORT DefaultChar;
1621 USHORT UniDefaultChar;
1622 USHORT TransDefaultChar;
1623 USHORT TransUniDefaultChar;
1624 UCHAR LeadByte[MAXIMUM_LEADBYTES];
1625 } NLS_FILE_HEADER, *PNLS_FILE_HEADER;
1626
1627 //
1628 // Stack Traces
1629 //
1630 typedef struct _RTL_STACK_TRACE_ENTRY
1631 {
1632 struct _RTL_STACK_TRACE_ENTRY *HashChain;
1633 ULONG TraceCount;
1634 USHORT Index;
1635 USHORT Depth;
1636 PVOID BackTrace[32];
1637 } RTL_STACK_TRACE_ENTRY, *PRTL_STACK_TRACE_ENTRY;
1638
1639 typedef struct _STACK_TRACE_DATABASE
1640 {
1641 RTL_CRITICAL_SECTION CriticalSection;
1642 } STACK_TRACE_DATABASE, *PSTACK_TRACE_DATABASE;
1643
1644 //
1645 // Trace Database
1646 //
1647
1648 typedef ULONG (NTAPI *RTL_TRACE_HASH_FUNCTION) (ULONG Count, PVOID *Trace);
1649
1650 typedef struct _RTL_TRACE_BLOCK
1651 {
1652 ULONG Magic;
1653 ULONG Count;
1654 ULONG Size;
1655 ULONG UserCount;
1656 ULONG UserSize;
1657 PVOID UserContext;
1658 struct _RTL_TRACE_BLOCK *Next;
1659 PVOID *Trace;
1660 } RTL_TRACE_BLOCK, *PRTL_TRACE_BLOCK;
1661
1662 typedef struct _RTL_TRACE_DATABASE
1663 {
1664 ULONG Magic;
1665 ULONG Flags;
1666 ULONG Tag;
1667 struct _RTL_TRACE_SEGMENT *SegmentList;
1668 SIZE_T MaximumSize;
1669 SIZE_T CurrentSize;
1670 PVOID Owner;
1671 #ifdef NTOS_MODE_USER
1672 RTL_CRITICAL_SECTION Lock;
1673 #else
1674 union
1675 {
1676 KSPIN_LOCK SpinLock;
1677 FAST_MUTEX FastMutex;
1678 } u;
1679 #endif
1680 ULONG NoOfBuckets;
1681 struct _RTL_TRACE_BLOCK **Buckets;
1682 RTL_TRACE_HASH_FUNCTION HashFunction;
1683 SIZE_T NoOfTraces;
1684 SIZE_T NoOfHits;
1685 ULONG HashCounter[16];
1686 } RTL_TRACE_DATABASE, *PRTL_TRACE_DATABASE;
1687
1688 typedef struct _RTL_TRACE_SEGMENT
1689 {
1690 ULONG Magic;
1691 struct _RTL_TRACE_DATABASE *Database;
1692 struct _RTL_TRACE_SEGMENT *NextSegment;
1693 SIZE_T TotalSize;
1694 PCHAR SegmentStart;
1695 PCHAR SegmentEnd;
1696 PCHAR SegmentFree;
1697 } RTL_TRACE_SEGMENT, *PRTL_TRACE_SEGMENT;
1698
1699 typedef struct _RTL_TRACE_ENUMERATE
1700 {
1701 struct _RTL_TRACE_DATABASE *Database;
1702 ULONG Index;
1703 struct _RTL_TRACE_BLOCK *Block;
1704 } RTL_TRACE_ENUMERATE, * PRTL_TRACE_ENUMERATE;
1705
1706 //
1707 // Auto-Managed Rtl* String Buffer
1708 //
1709 typedef struct _RTL_BUFFER
1710 {
1711 PUCHAR Buffer;
1712 PUCHAR StaticBuffer;
1713 SIZE_T Size;
1714 SIZE_T StaticSize;
1715 SIZE_T ReservedForAllocatedSize;
1716 PVOID ReservedForIMalloc;
1717 } RTL_BUFFER, *PRTL_BUFFER;
1718
1719 typedef struct _RTL_UNICODE_STRING_BUFFER
1720 {
1721 UNICODE_STRING String;
1722 RTL_BUFFER ByteBuffer;
1723 WCHAR MinimumStaticBufferForTerminalNul;
1724 } RTL_UNICODE_STRING_BUFFER, *PRTL_UNICODE_STRING_BUFFER;
1725
1726 #ifndef NTOS_MODE_USER
1727
1728 //
1729 // Message Resource Entry, Block and Data
1730 //
1731 typedef struct _MESSAGE_RESOURCE_ENTRY
1732 {
1733 USHORT Length;
1734 USHORT Flags;
1735 UCHAR Text[ANYSIZE_ARRAY];
1736 } MESSAGE_RESOURCE_ENTRY, *PMESSAGE_RESOURCE_ENTRY;
1737
1738 typedef struct _MESSAGE_RESOURCE_BLOCK
1739 {
1740 ULONG LowId;
1741 ULONG HighId;
1742 ULONG OffsetToEntries;
1743 } MESSAGE_RESOURCE_BLOCK, *PMESSAGE_RESOURCE_BLOCK;
1744
1745 typedef struct _MESSAGE_RESOURCE_DATA
1746 {
1747 ULONG NumberOfBlocks;
1748 MESSAGE_RESOURCE_BLOCK Blocks[ANYSIZE_ARRAY];
1749 } MESSAGE_RESOURCE_DATA, *PMESSAGE_RESOURCE_DATA;
1750
1751 #endif /* !NTOS_MODE_USER */
1752
1753 #ifdef NTOS_MODE_USER
1754
1755 //
1756 // Memory Stream
1757 //
1758 #ifndef CONST_VTBL
1759 #ifdef CONST_VTABLE
1760 #define CONST_VTBL const
1761 #else
1762 #define CONST_VTBL
1763 #endif
1764 #endif
1765
1766 struct IStreamVtbl;
1767 struct IStream;
1768 struct tagSTATSTG;
1769
1770 typedef struct _RTL_MEMORY_STREAM RTL_MEMORY_STREAM, *PRTL_MEMORY_STREAM;
1771
1772 typedef VOID
1773 (NTAPI *PRTL_MEMORY_STREAM_FINAL_RELEASE_ROUTINE)(
1774 _In_ PRTL_MEMORY_STREAM Stream
1775 );
1776
1777 struct _RTL_MEMORY_STREAM
1778 {
1779 CONST_VTBL struct IStreamVtbl *Vtbl;
1780 LONG RefCount;
1781 ULONG Unk1;
1782 PVOID Current;
1783 PVOID Start;
1784 PVOID End;
1785 PRTL_MEMORY_STREAM_FINAL_RELEASE_ROUTINE FinalRelease;
1786 HANDLE ProcessHandle;
1787 };
1788
1789 #endif /* NTOS_MODE_USER */
1790
1791 #ifdef __cplusplus
1792 }
1793 #endif
1794
1795 #endif /* !_RTLTYPES_H */