2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
Header Name:
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
rtltypes.h
|
2005-09-05 18:06:20 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
Abstract:
|
2005-09-06 05:30:39 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
Type definitions for the Run-Time Library
|
2005-09-24 02:50:02 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
Author:
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
--*/
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifndef _RTLTYPES_H
|
|
|
|
#define _RTLTYPES_H
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <umtypes.h>
|
2010-03-25 12:22:59 +00:00
|
|
|
#include <mmtypes.h>
|
|
|
|
#include <ldrtypes.h>
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2013-06-09 08:54:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Maximum Atom Length
|
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_MAXIMUM_ATOM_LENGTH 255
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
2005-11-27 18:24:32 +00:00
|
|
|
// Process Parameters Flags
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED 0x01
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_USER 0x02
|
2012-01-24 21:15:55 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL 0x04
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER 0x08
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_UNKNOWN 0x10
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB 0x20
|
2011-12-04 16:27:14 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_RESERVE_16MB 0x40
|
2012-01-24 21:15:55 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_CASE_SENSITIVE 0x80
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_DISABLE_HEAP_CHECKS 0x100
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_1 0x200
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROCESS_OR_2 0x400
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PRIVATE_DLL_PATH 0x1000
|
2012-01-24 21:56:02 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH 0x2000
|
2012-01-24 21:15:55 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_IMAGE_KEY_MISSING 0x4000
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_NX 0x20000
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2012-01-24 21:15:55 +00:00
|
|
|
#define RTL_MAX_DRIVE_LETTERS 32
|
|
|
|
#define RTL_DRIVE_LETTER_VALID (USHORT)0x0001
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
2012-09-09 10:42:32 +00:00
|
|
|
// End of Exception List
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Range and Range List Flags
|
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_RANGE_LIST_ADD_IF_CONFLICT 0x00000001
|
|
|
|
#define RTL_RANGE_LIST_ADD_SHARED 0x00000002
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_RANGE_SHARED 0x01
|
|
|
|
#define RTL_RANGE_CONFLICT 0x02
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
2013-08-29 04:34:00 +00:00
|
|
|
// Flags in RTL_ACTIVATION_CONTEXT_STACK_FRAME (from Checked NTDLL)
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
2014-09-24 16:00:35 +00:00
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_RELEASE_ON_DEACTIVATION 0x01
|
2013-08-29 04:34:00 +00:00
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_NO_DEACTIVATE 0x02
|
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ON_FREE_LIST 0x04
|
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_HEAP_ALLOCATED 0x08
|
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_NOT_REALLY_ACTIVATED 0x10
|
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_ACTIVATED 0x20
|
|
|
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_DEACTIVATED 0x40
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2012-05-25 19:26:42 +00:00
|
|
|
//
|
2013-08-29 04:34:00 +00:00
|
|
|
// Activation Context Frame Flags (from Checked NTDLL)
|
2012-05-25 19:26:42 +00:00
|
|
|
//
|
2013-08-29 04:34:00 +00:00
|
|
|
#define RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER 0x01
|
|
|
|
|
|
|
|
//
|
|
|
|
// RtlActivateActivationContextEx Flags (from Checked NTDLL)
|
|
|
|
//
|
|
|
|
#define RTL_ACTIVATE_ACTIVATION_CONTEXT_EX_FLAG_RELEASE_ON_STACK_DEALLOCATION 0x01
|
|
|
|
|
|
|
|
//
|
|
|
|
// RtlDeactivateActivationContext Flags (based on Win32 flag and name of above)
|
|
|
|
//
|
|
|
|
#define RTL_DEACTIVATE_ACTIVATION_CONTEXT_FLAG_FORCE_EARLY_DEACTIVATION 0x01
|
|
|
|
|
|
|
|
//
|
|
|
|
// RtlQueryActivationContext Flags (based on Win32 flag and name of above)
|
|
|
|
//
|
|
|
|
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_USE_ACTIVE_ACTIVATION_CONTEXT 0x01
|
|
|
|
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_HMODULE 0x02
|
|
|
|
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_IS_ADDRESS 0x04
|
|
|
|
#define RTL_QUERY_ACTIVATION_CONTEXT_FLAG_NO_ADDREF 0x80000000
|
2012-05-25 19:26:42 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
2006-06-23 21:21:45 +00:00
|
|
|
// Public Heap Flags
|
|
|
|
//
|
|
|
|
#if !defined(NTOS_MODE_USER) && !defined(_NTIFS_)
|
|
|
|
#define HEAP_NO_SERIALIZE 0x00000001
|
|
|
|
#define HEAP_GROWABLE 0x00000002
|
|
|
|
#define HEAP_GENERATE_EXCEPTIONS 0x00000004
|
|
|
|
#define HEAP_ZERO_MEMORY 0x00000008
|
|
|
|
#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010
|
|
|
|
#define HEAP_TAIL_CHECKING_ENABLED 0x00000020
|
|
|
|
#define HEAP_FREE_CHECKING_ENABLED 0x00000040
|
|
|
|
#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080
|
|
|
|
#define HEAP_CREATE_ALIGN_16 0x00010000
|
|
|
|
#define HEAP_CREATE_ENABLE_TRACING 0x00020000
|
|
|
|
#define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// User-Defined Heap Flags and Classes
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
2006-06-23 21:21:45 +00:00
|
|
|
#define HEAP_SETTABLE_USER_VALUE 0x00000100
|
|
|
|
#define HEAP_SETTABLE_USER_FLAG1 0x00000200
|
|
|
|
#define HEAP_SETTABLE_USER_FLAG2 0x00000400
|
|
|
|
#define HEAP_SETTABLE_USER_FLAG3 0x00000800
|
|
|
|
#define HEAP_SETTABLE_USER_FLAGS 0x00000E00
|
2006-05-10 17:47:44 +00:00
|
|
|
#define HEAP_CLASS_0 0x00000000
|
|
|
|
#define HEAP_CLASS_1 0x00001000
|
|
|
|
#define HEAP_CLASS_2 0x00002000
|
|
|
|
#define HEAP_CLASS_3 0x00003000
|
|
|
|
#define HEAP_CLASS_4 0x00004000
|
|
|
|
#define HEAP_CLASS_5 0x00005000
|
|
|
|
#define HEAP_CLASS_6 0x00006000
|
|
|
|
#define HEAP_CLASS_7 0x00007000
|
|
|
|
#define HEAP_CLASS_8 0x00008000
|
|
|
|
#define HEAP_CLASS_MASK 0x0000F000
|
|
|
|
|
2006-06-23 21:21:45 +00:00
|
|
|
//
|
|
|
|
// Internal HEAP Structure Flags
|
|
|
|
//
|
|
|
|
#define HEAP_FLAG_PAGE_ALLOCS 0x01000000
|
|
|
|
#define HEAP_PROTECTION_ENABLED 0x02000000
|
|
|
|
#define HEAP_BREAK_WHEN_OUT_OF_VM 0x04000000
|
|
|
|
#define HEAP_NO_ALIGNMENT 0x08000000
|
|
|
|
#define HEAP_CAPTURE_STACK_BACKTRACES 0x08000000
|
|
|
|
#define HEAP_SKIP_VALIDATION_CHECKS 0x10000000
|
|
|
|
#define HEAP_VALIDATE_ALL_ENABLED 0x20000000
|
|
|
|
#define HEAP_VALIDATE_PARAMETERS_ENABLED 0x40000000
|
|
|
|
#define HEAP_LOCK_USER_ALLOCATED 0x80000000
|
|
|
|
|
|
|
|
//
|
|
|
|
// Heap Validation Flags
|
|
|
|
//
|
|
|
|
#define HEAP_CREATE_VALID_MASK \
|
|
|
|
(HEAP_NO_SERIALIZE | \
|
|
|
|
HEAP_GROWABLE | \
|
|
|
|
HEAP_GENERATE_EXCEPTIONS | \
|
|
|
|
HEAP_ZERO_MEMORY | \
|
|
|
|
HEAP_REALLOC_IN_PLACE_ONLY | \
|
|
|
|
HEAP_TAIL_CHECKING_ENABLED | \
|
|
|
|
HEAP_FREE_CHECKING_ENABLED | \
|
|
|
|
HEAP_DISABLE_COALESCE_ON_FREE | \
|
|
|
|
HEAP_CLASS_MASK | \
|
|
|
|
HEAP_CREATE_ALIGN_16 | \
|
|
|
|
HEAP_CREATE_ENABLE_TRACING | \
|
|
|
|
HEAP_CREATE_ENABLE_EXECUTE)
|
2007-01-02 10:25:51 +00:00
|
|
|
#ifdef C_ASSERT
|
2006-06-23 21:21:45 +00:00
|
|
|
C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
|
|
|
|
#endif
|
|
|
|
|
2010-12-22 16:14:58 +00:00
|
|
|
//
|
|
|
|
// Native image architecture
|
|
|
|
//
|
|
|
|
#if defined(_M_IX86)
|
|
|
|
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_I386
|
|
|
|
#elif defined(_M_ARM)
|
|
|
|
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARM
|
|
|
|
#elif defined(_M_AMD64)
|
|
|
|
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_AMD64
|
|
|
|
#else
|
|
|
|
#error Define these please!
|
|
|
|
#endif
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Registry Keys
|
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define RTL_REGISTRY_ABSOLUTE 0
|
|
|
|
#define RTL_REGISTRY_SERVICES 1
|
|
|
|
#define RTL_REGISTRY_CONTROL 2
|
|
|
|
#define RTL_REGISTRY_WINDOWS_NT 3
|
|
|
|
#define RTL_REGISTRY_DEVICEMAP 4
|
|
|
|
#define RTL_REGISTRY_USER 5
|
|
|
|
#define RTL_REGISTRY_MAXIMUM 6
|
|
|
|
#define RTL_REGISTRY_HANDLE 0x40000000
|
|
|
|
#define RTL_REGISTRY_OPTIONAL 0x80000000
|
|
|
|
#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001
|
|
|
|
#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002
|
|
|
|
#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004
|
|
|
|
#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008
|
|
|
|
#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010
|
|
|
|
#define RTL_QUERY_REGISTRY_DIRECT 0x00000020
|
|
|
|
#define RTL_QUERY_REGISTRY_DELETE 0x00000040
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Versioning
|
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define VER_MINORVERSION 0x0000001
|
|
|
|
#define VER_MAJORVERSION 0x0000002
|
|
|
|
#define VER_BUILDNUMBER 0x0000004
|
|
|
|
#define VER_PLATFORMID 0x0000008
|
|
|
|
#define VER_SERVICEPACKMINOR 0x0000010
|
|
|
|
#define VER_SERVICEPACKMAJOR 0x0000020
|
|
|
|
#define VER_SUITENAME 0x0000040
|
|
|
|
#define VER_PRODUCT_TYPE 0x0000080
|
|
|
|
#define VER_PLATFORM_WIN32s 0
|
|
|
|
#define VER_PLATFORM_WIN32_WINDOWS 1
|
|
|
|
#define VER_PLATFORM_WIN32_NT 2
|
|
|
|
#define VER_EQUAL 1
|
|
|
|
#define VER_GREATER 2
|
|
|
|
#define VER_GREATER_EQUAL 3
|
|
|
|
#define VER_LESS 4
|
|
|
|
#define VER_LESS_EQUAL 5
|
|
|
|
#define VER_AND 6
|
|
|
|
#define VER_OR 7
|
|
|
|
#define VER_CONDITION_MASK 7
|
|
|
|
#define VER_NUM_BITS_PER_CONDITION_MASK 3
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Timezone IDs
|
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define TIME_ZONE_ID_UNKNOWN 0
|
|
|
|
#define TIME_ZONE_ID_STANDARD 1
|
|
|
|
#define TIME_ZONE_ID_DAYLIGHT 2
|
|
|
|
|
|
|
|
//
|
|
|
|
// Maximum Path Length
|
|
|
|
//
|
|
|
|
#define MAX_PATH 260
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// RTL Lock Type (Critical Section or Resource)
|
|
|
|
//
|
|
|
|
#define RTL_CRITSECT_TYPE 0
|
|
|
|
#define RTL_RESOURCE_TYPE 1
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// RtlAcquirePrivileges Flags
|
|
|
|
//
|
|
|
|
#define RTL_ACQUIRE_PRIVILEGE_IMPERSONATE 1
|
|
|
|
#define RTL_ACQUIRE_PRIVILEGE_PROCESS 2
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// String Hash Algorithms
|
|
|
|
//
|
|
|
|
#define HASH_STRING_ALGORITHM_DEFAULT 0
|
|
|
|
#define HASH_STRING_ALGORITHM_X65599 1
|
|
|
|
#define HASH_STRING_ALGORITHM_INVALID 0xffffffff
|
|
|
|
|
|
|
|
//
|
|
|
|
// RtlDuplicateString Flags
|
|
|
|
//
|
|
|
|
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
|
|
|
|
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
|
|
|
|
|
2008-01-16 23:19:01 +00:00
|
|
|
//
|
|
|
|
// RtlFindCharInUnicodeString Flags
|
|
|
|
//
|
2011-10-12 11:36:52 +00:00
|
|
|
#define RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END 1
|
|
|
|
#define RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET 2
|
2008-01-16 23:19:01 +00:00
|
|
|
#define RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE 4
|
|
|
|
|
2011-07-10 21:55:55 +00:00
|
|
|
//
|
|
|
|
// RtlImageNtHeaderEx Flags
|
|
|
|
//
|
|
|
|
#define RTL_IMAGE_NT_HEADER_EX_FLAG_NO_RANGE_CHECK 0x00000001
|
|
|
|
|
2011-11-06 01:34:06 +00:00
|
|
|
//
|
|
|
|
// RtlDosApplyFileIsolationRedirection_Ustr Flags
|
|
|
|
//
|
|
|
|
#define RTL_DOS_APPLY_FILE_REDIRECTION_USTR_FLAG_RESPECT_DOT_LOCAL 0x01
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Codepages
|
|
|
|
//
|
|
|
|
#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
|
|
|
|
#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
|
|
|
|
#define NLS_OEM_LEAD_BYTE_INFO NlsOemLeadByteInfo
|
2006-05-24 02:45:06 +00:00
|
|
|
|
2011-07-20 14:46:15 +00:00
|
|
|
//
|
|
|
|
// Activation Contexts
|
|
|
|
//
|
|
|
|
#define INVALID_ACTIVATION_CONTEXT (PVOID)0xFFFFFFFF
|
|
|
|
|
2006-05-24 02:45:06 +00:00
|
|
|
//
|
|
|
|
// C++ CONST casting
|
|
|
|
//
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
#define RTL_CONST_CAST(type) const_cast<type>
|
|
|
|
#else
|
|
|
|
#define RTL_CONST_CAST(type) (type)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//
|
|
|
|
// Constant String Macro
|
|
|
|
//
|
|
|
|
#define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
|
|
|
|
{ \
|
|
|
|
sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
|
|
|
|
sizeof(__SOURCE_STRING__), \
|
|
|
|
(__SOURCE_STRING__) \
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Constant Object Attributes Macro
|
|
|
|
//
|
|
|
|
#define RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a) \
|
|
|
|
{ \
|
|
|
|
sizeof(OBJECT_ATTRIBUTES), \
|
|
|
|
NULL, \
|
|
|
|
RTL_CONST_CAST(PUNICODE_STRING)(n), \
|
|
|
|
a, \
|
|
|
|
NULL, \
|
|
|
|
NULL \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
|
|
|
|
RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#else /* NTOS_MODE_USER */
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Message Resource Flag
|
|
|
|
//
|
|
|
|
#define MESSAGE_RESOURCE_UNICODE 0x0001
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* !NTOS_MODE_USER */
|
2005-11-22 04:57:45 +00:00
|
|
|
#define MAXIMUM_LEADBYTES 12
|
|
|
|
|
|
|
|
//
|
|
|
|
// RTL Debug Queries
|
|
|
|
//
|
|
|
|
#define RTL_DEBUG_QUERY_MODULES 0x01
|
|
|
|
#define RTL_DEBUG_QUERY_BACKTRACES 0x02
|
|
|
|
#define RTL_DEBUG_QUERY_HEAPS 0x04
|
|
|
|
#define RTL_DEBUG_QUERY_HEAP_TAGS 0x08
|
|
|
|
#define RTL_DEBUG_QUERY_HEAP_BLOCKS 0x10
|
|
|
|
#define RTL_DEBUG_QUERY_LOCKS 0x20
|
|
|
|
|
|
|
|
//
|
|
|
|
// RTL Handle Flags
|
|
|
|
//
|
|
|
|
#define RTL_HANDLE_VALID 0x1
|
|
|
|
|
|
|
|
//
|
|
|
|
// RTL Atom Flags
|
|
|
|
//
|
|
|
|
#define RTL_ATOM_IS_PINNED 0x1
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Critical section lock bits
|
|
|
|
//
|
|
|
|
#define CS_LOCK_BIT 0x1
|
|
|
|
#define CS_LOCK_BIT_V 0x0
|
|
|
|
#define CS_LOCK_WAITER_WOKEN 0x2
|
|
|
|
#define CS_LOCK_WAITER_INC 0x4
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Codepage Tags
|
|
|
|
//
|
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG;
|
|
|
|
extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Constant String Macro
|
|
|
|
//
|
|
|
|
#define RTL_CONSTANT_STRING(__SOURCE_STRING__) \
|
|
|
|
{ \
|
2005-08-17 07:06:59 +00:00
|
|
|
sizeof(__SOURCE_STRING__) - sizeof((__SOURCE_STRING__)[0]), \
|
2005-11-22 04:57:45 +00:00
|
|
|
sizeof(__SOURCE_STRING__), \
|
|
|
|
(__SOURCE_STRING__) \
|
2005-08-17 07:06:59 +00:00
|
|
|
}
|
2005-09-04 18:00:59 +00:00
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* NTOS_MODE_USER */
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-09-06 06:19:30 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2012-01-31 02:33:02 +00:00
|
|
|
//
|
|
|
|
// Boot Status Data Field Types
|
|
|
|
//
|
|
|
|
typedef enum _RTL_BSD_ITEM_TYPE
|
|
|
|
{
|
|
|
|
RtlBsdItemVersionNumber,
|
|
|
|
RtlBsdItemProductType,
|
|
|
|
RtlBsdItemAabEnabled,
|
|
|
|
RtlBsdItemAabTimeout,
|
|
|
|
RtlBsdItemBootGood,
|
|
|
|
RtlBsdItemBootShutdown,
|
|
|
|
RtlBsdItemMax
|
|
|
|
} RTL_BSD_ITEM_TYPE, *PRTL_BSD_ITEM_TYPE;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Table and Compare result types
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef enum _TABLE_SEARCH_RESULT
|
|
|
|
{
|
|
|
|
TableEmptyTree,
|
|
|
|
TableFoundNode,
|
|
|
|
TableInsertAsLeft,
|
|
|
|
TableInsertAsRight
|
|
|
|
} TABLE_SEARCH_RESULT;
|
|
|
|
|
|
|
|
typedef enum _RTL_GENERIC_COMPARE_RESULTS
|
|
|
|
{
|
|
|
|
GenericLessThan,
|
|
|
|
GenericGreaterThan,
|
|
|
|
GenericEqual
|
|
|
|
} RTL_GENERIC_COMPARE_RESULTS;
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* NTOS_MODE_USER */
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Path Types
|
|
|
|
//
|
2005-11-20 17:16:11 +00:00
|
|
|
typedef enum _RTL_PATH_TYPE
|
2005-06-21 02:08:42 +00:00
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
RtlPathTypeUnknown,
|
|
|
|
RtlPathTypeUncAbsolute,
|
|
|
|
RtlPathTypeDriveAbsolute,
|
|
|
|
RtlPathTypeDriveRelative,
|
|
|
|
RtlPathTypeRooted,
|
|
|
|
RtlPathTypeRelative,
|
|
|
|
RtlPathTypeLocalDevice,
|
|
|
|
RtlPathTypeRootLocalDevice,
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PATH_TYPE;
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
#ifndef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2010-10-11 10:20:40 +00:00
|
|
|
//
|
|
|
|
// Heap Information Class
|
|
|
|
//
|
|
|
|
typedef enum _HEAP_INFORMATION_CLASS
|
|
|
|
{
|
|
|
|
HeapCompatibilityInformation,
|
|
|
|
HeapEnableTerminationOnCorruption
|
|
|
|
} HEAP_INFORMATION_CLASS;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Callback function for RTL Timers or Registered Waits
|
|
|
|
//
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *WAITORTIMERCALLBACKFUNC)(
|
|
|
|
PVOID pvContext,
|
|
|
|
BOOLEAN fTimerOrWaitFired
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Handler during Vectored RTL Exceptions
|
|
|
|
//
|
|
|
|
typedef LONG
|
|
|
|
(NTAPI *PVECTORED_EXCEPTION_HANDLER)(
|
|
|
|
PEXCEPTION_POINTERS ExceptionPointers
|
|
|
|
);
|
2005-11-05 06:44:03 +00:00
|
|
|
|
2006-08-05 16:27:20 +00:00
|
|
|
//
|
|
|
|
// Worker Thread Callback for Rtl
|
|
|
|
//
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *WORKERCALLBACKFUNC)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Context
|
2006-08-05 16:27:20 +00:00
|
|
|
);
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#else /* !NTOS_MODE_USER */
|
2005-11-05 06:44:03 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// RTL Library Allocation/Free Routines
|
|
|
|
//
|
|
|
|
typedef PVOID
|
|
|
|
(NTAPI *PRTL_ALLOCATE_STRING_ROUTINE)(
|
|
|
|
SIZE_T NumberOfBytes
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef PVOID
|
|
|
|
(NTAPI *PRTL_REALLOCATE_STRING_ROUTINE)(
|
|
|
|
SIZE_T NumberOfBytes,
|
|
|
|
PVOID Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef
|
|
|
|
VOID
|
|
|
|
(NTAPI *PRTL_FREE_STRING_ROUTINE)(
|
|
|
|
PVOID Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
|
|
|
|
extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
|
|
|
|
extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* NTOS_MODE_USER */
|
2005-09-05 18:06:20 +00:00
|
|
|
|
2011-12-18 01:50:11 +00:00
|
|
|
//
|
|
|
|
// Unhandled Exception Filter
|
|
|
|
//
|
|
|
|
typedef ULONG
|
|
|
|
(NTAPI *RTLP_UNHANDLED_EXCEPTION_FILTER)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ struct _EXCEPTION_POINTERS *ExceptionInfo
|
2011-12-18 01:50:11 +00:00
|
|
|
);
|
|
|
|
typedef RTLP_UNHANDLED_EXCEPTION_FILTER *PRTLP_UNHANDLED_EXCEPTION_FILTER;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Callback for RTL Heap Enumeration
|
|
|
|
//
|
2005-06-19 03:25:33 +00:00
|
|
|
typedef NTSTATUS
|
2009-08-20 12:09:16 +00:00
|
|
|
(NTAPI *PHEAP_ENUMERATION_ROUTINE)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID HeapHandle,
|
|
|
|
_In_ PVOID UserParam
|
2005-06-19 20:01:07 +00:00
|
|
|
);
|
2005-06-19 03:25:33 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Thread and Process Start Routines for RtlCreateUserThread/Process
|
|
|
|
//
|
2005-09-05 07:51:15 +00:00
|
|
|
typedef ULONG (NTAPI *PTHREAD_START_ROUTINE)(
|
|
|
|
PVOID Parameter
|
2005-06-19 20:01:07 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID
|
2005-07-26 14:00:45 +00:00
|
|
|
(NTAPI *PRTL_BASE_PROCESS_START_ROUTINE)(
|
2005-06-19 20:01:07 +00:00
|
|
|
PTHREAD_START_ROUTINE StartAddress,
|
|
|
|
PVOID Parameter
|
|
|
|
);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
[RTL/NTDLL/KERNEL32]: Rtl provides worker queue and timer queue functionality, which queues a worker thread associated with a caller-supplied callback. In Windows, Rtl by default calls RtlCreateUserThread, but as soon as kernel32 loads, it's DllMain calls an exported function RtlSetThreadPoolStartFunc which changes that default to a special Base function that calls CreateRemoteThread instead. The net result is that Win32 processes using the Rtl functionality get their threads properly registered with CSRSS. In ReactOS, this did not happen, so when those threads called into CSRSS, CSRSS had no CSR_THREAD structure/state for them, which is why CsrCreateThread (and the API loop) are so badly hacked. This commit implements RtlSetThreadPoolStartFunc, implements the kernel32 base functions which wrap CreateRemoteThread, and implements the rtl functions which wrap RtlCreateUserThread. Services, Setup, and any ReactOS application using RPC now have the worker threads correctly registered.
svn path=/trunk/; revision=55706
2012-02-19 10:06:31 +00:00
|
|
|
//
|
|
|
|
// Worker Start/Exit Function
|
|
|
|
//
|
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *PRTL_START_POOL_THREAD)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PTHREAD_START_ROUTINE Function,
|
|
|
|
_In_ PVOID Parameter,
|
|
|
|
_Out_ PHANDLE ThreadHandle
|
[RTL/NTDLL/KERNEL32]: Rtl provides worker queue and timer queue functionality, which queues a worker thread associated with a caller-supplied callback. In Windows, Rtl by default calls RtlCreateUserThread, but as soon as kernel32 loads, it's DllMain calls an exported function RtlSetThreadPoolStartFunc which changes that default to a special Base function that calls CreateRemoteThread instead. The net result is that Win32 processes using the Rtl functionality get their threads properly registered with CSRSS. In ReactOS, this did not happen, so when those threads called into CSRSS, CSRSS had no CSR_THREAD structure/state for them, which is why CsrCreateThread (and the API loop) are so badly hacked. This commit implements RtlSetThreadPoolStartFunc, implements the kernel32 base functions which wrap CreateRemoteThread, and implements the rtl functions which wrap RtlCreateUserThread. Services, Setup, and any ReactOS application using RPC now have the worker threads correctly registered.
svn path=/trunk/; revision=55706
2012-02-19 10:06:31 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *PRTL_EXIT_POOL_THREAD)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ NTSTATUS ExitStatus
|
[RTL/NTDLL/KERNEL32]: Rtl provides worker queue and timer queue functionality, which queues a worker thread associated with a caller-supplied callback. In Windows, Rtl by default calls RtlCreateUserThread, but as soon as kernel32 loads, it's DllMain calls an exported function RtlSetThreadPoolStartFunc which changes that default to a special Base function that calls CreateRemoteThread instead. The net result is that Win32 processes using the Rtl functionality get their threads properly registered with CSRSS. In ReactOS, this did not happen, so when those threads called into CSRSS, CSRSS had no CSR_THREAD structure/state for them, which is why CsrCreateThread (and the API loop) are so badly hacked. This commit implements RtlSetThreadPoolStartFunc, implements the kernel32 base functions which wrap CreateRemoteThread, and implements the rtl functions which wrap RtlCreateUserThread. Services, Setup, and any ReactOS application using RPC now have the worker threads correctly registered.
svn path=/trunk/; revision=55706
2012-02-19 10:06:31 +00:00
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Declare empty structure definitions so that they may be referenced by
|
|
|
|
// routines before they are defined
|
|
|
|
//
|
|
|
|
struct _RTL_AVL_TABLE;
|
|
|
|
struct _RTL_GENERIC_TABLE;
|
|
|
|
struct _RTL_RANGE;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Routines and callbacks for the RTL AVL/Generic Table package
|
|
|
|
//
|
2011-08-05 01:20:28 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef NTSTATUS
|
2011-08-05 01:20:28 +00:00
|
|
|
(NTAPI RTL_AVL_MATCH_FUNCTION)(
|
2005-08-17 07:06:59 +00:00
|
|
|
struct _RTL_AVL_TABLE *Table,
|
|
|
|
PVOID UserData,
|
|
|
|
PVOID MatchData
|
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
typedef RTL_AVL_MATCH_FUNCTION *PRTL_AVL_MATCH_FUNCTION;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
|
|
|
typedef RTL_GENERIC_COMPARE_RESULTS
|
2011-08-05 01:20:28 +00:00
|
|
|
(NTAPI RTL_AVL_COMPARE_ROUTINE) (
|
2005-08-17 07:06:59 +00:00
|
|
|
struct _RTL_AVL_TABLE *Table,
|
|
|
|
PVOID FirstStruct,
|
|
|
|
PVOID SecondStruct
|
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
typedef RTL_AVL_COMPARE_ROUTINE *PRTL_AVL_COMPARE_ROUTINE;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
|
|
|
typedef RTL_GENERIC_COMPARE_RESULTS
|
2011-08-05 01:20:28 +00:00
|
|
|
(NTAPI RTL_GENERIC_COMPARE_ROUTINE) (
|
2005-08-17 07:06:59 +00:00
|
|
|
struct _RTL_GENERIC_TABLE *Table,
|
|
|
|
PVOID FirstStruct,
|
|
|
|
PVOID SecondStruct
|
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
typedef RTL_GENERIC_COMPARE_ROUTINE *PRTL_GENERIC_COMPARE_ROUTINE;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
|
|
|
typedef PVOID
|
2011-08-05 01:20:28 +00:00
|
|
|
(NTAPI RTL_GENERIC_ALLOCATE_ROUTINE) (
|
2005-08-17 07:06:59 +00:00
|
|
|
struct _RTL_GENERIC_TABLE *Table,
|
2005-09-05 07:51:15 +00:00
|
|
|
CLONG ByteSize
|
2005-08-17 07:06:59 +00:00
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
typedef RTL_GENERIC_ALLOCATE_ROUTINE *PRTL_GENERIC_ALLOCATE_ROUTINE;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-09-05 07:51:15 +00:00
|
|
|
typedef PVOID
|
2011-08-05 01:20:28 +00:00
|
|
|
(NTAPI RTL_AVL_ALLOCATE_ROUTINE) (
|
2005-08-17 07:06:59 +00:00
|
|
|
struct _RTL_AVL_TABLE *Table,
|
2005-09-05 07:51:15 +00:00
|
|
|
CLONG ByteSize
|
2005-08-17 07:06:59 +00:00
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
typedef RTL_AVL_ALLOCATE_ROUTINE *PRTL_AVL_ALLOCATE_ROUTINE;
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI RTL_GENERIC_FREE_ROUTINE) (
|
|
|
|
struct _RTL_GENERIC_TABLE *Table,
|
|
|
|
PVOID Buffer
|
|
|
|
);
|
|
|
|
typedef RTL_GENERIC_FREE_ROUTINE *PRTL_GENERIC_FREE_ROUTINE;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
|
|
|
typedef VOID
|
2011-08-05 01:20:28 +00:00
|
|
|
(NTAPI RTL_AVL_FREE_ROUTINE) (
|
2005-08-17 07:06:59 +00:00
|
|
|
struct _RTL_AVL_TABLE *Table,
|
|
|
|
PVOID Buffer
|
|
|
|
);
|
2011-08-05 01:20:28 +00:00
|
|
|
typedef RTL_AVL_FREE_ROUTINE *PRTL_AVL_FREE_ROUTINE;
|
|
|
|
|
|
|
|
#ifdef RTL_USE_AVL_TABLES
|
|
|
|
#undef RTL_GENERIC_COMPARE_ROUTINE
|
|
|
|
#undef PRTL_GENERIC_COMPARE_ROUTINE
|
|
|
|
#undef RTL_GENERIC_ALLOCATE_ROUTINE
|
|
|
|
#undef PRTL_GENERIC_ALLOCATE_ROUTINE
|
|
|
|
#undef RTL_GENERIC_FREE_ROUTINE
|
|
|
|
#undef PRTL_GENERIC_FREE_ROUTINE
|
|
|
|
|
|
|
|
#define RTL_GENERIC_COMPARE_ROUTINE RTL_AVL_COMPARE_ROUTINE
|
|
|
|
#define PRTL_GENERIC_COMPARE_ROUTINE PRTL_AVL_COMPARE_ROUTINE
|
|
|
|
#define RTL_GENERIC_ALLOCATE_ROUTINE RTL_AVL_ALLOCATE_ROUTINE
|
|
|
|
#define PRTL_GENERIC_ALLOCATE_ROUTINE PRTL_AVL_ALLOCATE_ROUTINE
|
|
|
|
#define RTL_GENERIC_FREE_ROUTINE RTL_AVL_FREE_ROUTINE
|
|
|
|
#define PRTL_GENERIC_FREE_ROUTINE PRTL_AVL_FREE_ROUTINE
|
|
|
|
#endif /* RTL_USE_AVL_TABLES */
|
|
|
|
|
|
|
|
#endif /* NTOS_MODE_USER */
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Query Registry callback
|
|
|
|
//
|
2008-12-01 15:12:23 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *PRTL_QUERY_REGISTRY_ROUTINE)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PWSTR ValueName,
|
|
|
|
_In_ ULONG ValueType,
|
|
|
|
_In_ PVOID ValueData,
|
|
|
|
_In_ ULONG ValueLength,
|
|
|
|
_In_ PVOID Context,
|
|
|
|
_In_ PVOID EntryContext
|
2005-08-17 07:06:59 +00:00
|
|
|
);
|
2008-12-01 15:12:23 +00:00
|
|
|
#endif
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2006-06-23 21:21:45 +00:00
|
|
|
//
|
|
|
|
// RTL Secure Memory callbacks
|
|
|
|
//
|
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *PRTL_SECURE_MEMORY_CACHE_CALLBACK)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Address,
|
|
|
|
_In_ SIZE_T Length
|
2006-06-23 21:21:45 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Range List callbacks
|
|
|
|
//
|
2005-09-05 07:51:15 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef BOOLEAN
|
2005-11-22 04:57:45 +00:00
|
|
|
(NTAPI *PRTL_CONFLICT_RANGE_CALLBACK)(
|
2005-08-17 07:06:59 +00:00
|
|
|
PVOID Context,
|
|
|
|
struct _RTL_RANGE *Range
|
|
|
|
);
|
2005-09-05 07:51:15 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Custom Heap Commit Routine for RtlCreateHeap
|
|
|
|
//
|
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI * PRTL_HEAP_COMMIT_ROUTINE)(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PVOID Base,
|
|
|
|
_Inout_ PVOID *CommitAddress,
|
|
|
|
_Inout_ PSIZE_T CommitSize
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Parameters for RtlCreateHeap
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _RTL_HEAP_PARAMETERS
|
|
|
|
{
|
|
|
|
ULONG Length;
|
|
|
|
SIZE_T SegmentReserve;
|
|
|
|
SIZE_T SegmentCommit;
|
|
|
|
SIZE_T DeCommitFreeBlockThreshold;
|
|
|
|
SIZE_T DeCommitTotalFreeThreshold;
|
|
|
|
SIZE_T MaximumAllocationSize;
|
|
|
|
SIZE_T VirtualMemoryThreshold;
|
|
|
|
SIZE_T InitialCommit;
|
|
|
|
SIZE_T InitialReserve;
|
|
|
|
PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
|
|
|
|
SIZE_T Reserved[2];
|
|
|
|
} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Bitmap structures
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _RTL_BITMAP
|
|
|
|
{
|
|
|
|
ULONG SizeOfBitMap;
|
|
|
|
PULONG Buffer;
|
|
|
|
} RTL_BITMAP, *PRTL_BITMAP;
|
|
|
|
|
|
|
|
typedef struct _RTL_BITMAP_RUN
|
|
|
|
{
|
|
|
|
ULONG StartingIndex;
|
|
|
|
ULONG NumberOfBits;
|
|
|
|
} RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RtlGenerateXxxName context
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _GENERATE_NAME_CONTEXT
|
|
|
|
{
|
2005-11-20 17:16:11 +00:00
|
|
|
USHORT Checksum;
|
2005-08-17 07:06:59 +00:00
|
|
|
BOOLEAN CheckSumInserted;
|
2005-11-20 17:16:11 +00:00
|
|
|
UCHAR NameLength;
|
|
|
|
WCHAR NameBuffer[8];
|
|
|
|
ULONG ExtensionLength;
|
|
|
|
WCHAR ExtensionBuffer[4];
|
|
|
|
ULONG LastIndexValue;
|
2005-08-17 07:06:59 +00:00
|
|
|
} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Splay and Balanced Links structures
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _RTL_SPLAY_LINKS
|
|
|
|
{
|
|
|
|
struct _RTL_SPLAY_LINKS *Parent;
|
|
|
|
struct _RTL_SPLAY_LINKS *LeftChild;
|
|
|
|
struct _RTL_SPLAY_LINKS *RightChild;
|
|
|
|
} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
|
2005-08-11 00:01:17 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
typedef struct _RTL_BALANCED_LINKS
|
|
|
|
{
|
|
|
|
struct _RTL_BALANCED_LINKS *Parent;
|
|
|
|
struct _RTL_BALANCED_LINKS *LeftChild;
|
|
|
|
struct _RTL_BALANCED_LINKS *RightChild;
|
|
|
|
CHAR Balance;
|
|
|
|
UCHAR Reserved[3];
|
|
|
|
} RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
|
2005-08-17 07:06:59 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Avl/Generic Tables
|
|
|
|
//
|
2011-08-05 01:20:28 +00:00
|
|
|
#ifndef RTL_USE_AVL_TABLES
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _RTL_GENERIC_TABLE
|
|
|
|
{
|
|
|
|
PRTL_SPLAY_LINKS TableRoot;
|
|
|
|
LIST_ENTRY InsertOrderList;
|
|
|
|
PLIST_ENTRY OrderedPointer;
|
|
|
|
ULONG WhichOrderedElement;
|
|
|
|
ULONG NumberGenericTableElements;
|
|
|
|
PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
|
|
|
|
PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
|
|
|
|
PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
|
|
|
|
PVOID TableContext;
|
|
|
|
} RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* !RTL_USE_AVL_TABLES */
|
2005-08-17 07:06:59 +00:00
|
|
|
|
|
|
|
typedef struct _RTL_AVL_TABLE
|
|
|
|
{
|
|
|
|
RTL_BALANCED_LINKS BalancedRoot;
|
|
|
|
PVOID OrderedPointer;
|
|
|
|
ULONG WhichOrderedElement;
|
|
|
|
ULONG NumberGenericTableElements;
|
|
|
|
ULONG DepthOfTree;
|
|
|
|
PRTL_BALANCED_LINKS RestartKey;
|
|
|
|
ULONG DeleteCount;
|
|
|
|
PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
|
|
|
|
PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
|
|
|
|
PRTL_AVL_FREE_ROUTINE FreeRoutine;
|
|
|
|
PVOID TableContext;
|
|
|
|
} RTL_AVL_TABLE, *PRTL_AVL_TABLE;
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#ifdef RTL_USE_AVL_TABLES
|
|
|
|
#undef RTL_GENERIC_TABLE
|
|
|
|
#undef PRTL_GENERIC_TABLE
|
|
|
|
|
|
|
|
#define RTL_GENERIC_TABLE RTL_AVL_TABLE
|
|
|
|
#define PRTL_GENERIC_TABLE PRTL_AVL_TABLE
|
|
|
|
#endif /* RTL_USE_AVL_TABLES */
|
|
|
|
|
2008-12-01 15:12:23 +00:00
|
|
|
//
|
|
|
|
// RTL Compression Buffer
|
|
|
|
//
|
|
|
|
typedef struct _COMPRESSED_DATA_INFO {
|
|
|
|
USHORT CompressionFormatAndEngine;
|
|
|
|
UCHAR CompressionUnitShift;
|
|
|
|
UCHAR ChunkShift;
|
|
|
|
UCHAR ClusterShift;
|
|
|
|
UCHAR Reserved;
|
|
|
|
USHORT NumberOfChunks;
|
|
|
|
ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
|
|
|
|
} COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RtlQueryRegistry Data
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _RTL_QUERY_REGISTRY_TABLE
|
|
|
|
{
|
|
|
|
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine;
|
|
|
|
ULONG Flags;
|
2009-01-04 14:26:59 +00:00
|
|
|
PCWSTR Name;
|
2005-08-17 07:06:59 +00:00
|
|
|
PVOID EntryContext;
|
|
|
|
ULONG DefaultType;
|
|
|
|
PVOID DefaultData;
|
|
|
|
ULONG DefaultLength;
|
|
|
|
} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Unicode Table Structures
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _UNICODE_PREFIX_TABLE_ENTRY
|
|
|
|
{
|
|
|
|
CSHORT NodeTypeCode;
|
|
|
|
CSHORT NameLength;
|
|
|
|
struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
|
|
|
|
struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
|
|
|
|
RTL_SPLAY_LINKS Links;
|
|
|
|
PUNICODE_STRING Prefix;
|
|
|
|
} UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _UNICODE_PREFIX_TABLE
|
|
|
|
{
|
|
|
|
CSHORT NodeTypeCode;
|
|
|
|
CSHORT NameLength;
|
|
|
|
PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
|
|
|
|
PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
|
|
|
|
} UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Time Structure for RTL Time calls
|
|
|
|
//
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef struct _TIME_FIELDS
|
|
|
|
{
|
|
|
|
CSHORT Year;
|
|
|
|
CSHORT Month;
|
|
|
|
CSHORT Day;
|
|
|
|
CSHORT Hour;
|
|
|
|
CSHORT Minute;
|
|
|
|
CSHORT Second;
|
|
|
|
CSHORT Milliseconds;
|
|
|
|
CSHORT Weekday;
|
|
|
|
} TIME_FIELDS, *PTIME_FIELDS;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Activation Context
|
|
|
|
//
|
|
|
|
typedef PVOID PACTIVATION_CONTEXT;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Activation Context Frame
|
|
|
|
//
|
|
|
|
typedef struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME
|
|
|
|
{
|
2009-01-20 07:40:15 +00:00
|
|
|
struct _RTL_ACTIVATION_CONTEXT_STACK_FRAME *Previous;
|
2006-05-10 17:47:44 +00:00
|
|
|
PACTIVATION_CONTEXT ActivationContext;
|
|
|
|
ULONG Flags;
|
2011-07-20 14:46:15 +00:00
|
|
|
} RTL_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
|
|
|
|
|
|
|
|
typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC
|
|
|
|
{
|
|
|
|
SIZE_T Size;
|
|
|
|
ULONG Format;
|
|
|
|
RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
|
|
|
|
} RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC, *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_BASIC;
|
2006-05-10 17:47:44 +00:00
|
|
|
|
|
|
|
typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
|
|
|
|
{
|
2011-07-20 14:46:15 +00:00
|
|
|
SIZE_T Size;
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG Format;
|
|
|
|
RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
|
|
|
|
PVOID Extra1;
|
|
|
|
PVOID Extra2;
|
|
|
|
PVOID Extra3;
|
|
|
|
PVOID Extra4;
|
2011-07-20 14:46:15 +00:00
|
|
|
} RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED, *PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED;
|
|
|
|
|
|
|
|
typedef RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
|
|
|
|
typedef PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
|
2006-05-10 17:47:44 +00:00
|
|
|
|
2014-09-24 16:00:35 +00:00
|
|
|
typedef struct _RTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME
|
|
|
|
{
|
|
|
|
RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
|
|
|
|
ULONG_PTR Cookie;
|
|
|
|
PVOID ActivationStackBackTrace[8];
|
|
|
|
} RTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME, *PRTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME;
|
|
|
|
|
2010-03-25 12:22:59 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WS03)
|
2008-12-15 10:48:53 +00:00
|
|
|
typedef struct _ACTIVATION_CONTEXT_STACK
|
|
|
|
{
|
|
|
|
PRTL_ACTIVATION_CONTEXT_STACK_FRAME ActiveFrame;
|
|
|
|
LIST_ENTRY FrameListCache;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG NextCookieSequenceNumber;
|
|
|
|
ULONG StackId;
|
2011-07-20 14:46:15 +00:00
|
|
|
} ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
|
2010-03-25 12:22:59 +00:00
|
|
|
#else
|
|
|
|
typedef struct _ACTIVATION_CONTEXT_STACK
|
|
|
|
{
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG NextCookieSequenceNumber;
|
|
|
|
PVOID ActiveFrame;
|
|
|
|
LIST_ENTRY FrameListCache;
|
|
|
|
} ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;
|
|
|
|
#endif
|
2008-12-15 10:48:53 +00:00
|
|
|
|
2013-09-13 22:44:57 +00:00
|
|
|
typedef struct _ACTIVATION_CONTEXT_DATA
|
|
|
|
{
|
|
|
|
ULONG Magic;
|
|
|
|
ULONG HeaderSize;
|
|
|
|
ULONG FormatVersion;
|
|
|
|
ULONG TotalSize;
|
|
|
|
ULONG DefaultTocOffset;
|
|
|
|
ULONG ExtendedTocOffset;
|
|
|
|
ULONG AssemblyRosterOffset;
|
|
|
|
ULONG Flags;
|
|
|
|
} ACTIVATION_CONTEXT_DATA, *PACTIVATION_CONTEXT_DATA;
|
|
|
|
|
2014-09-24 16:00:35 +00:00
|
|
|
typedef struct _ACTIVATION_CONTEXT_STACK_FRAMELIST
|
|
|
|
{
|
|
|
|
ULONG Magic;
|
|
|
|
ULONG FramesInUse;
|
|
|
|
LIST_ENTRY Links;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG NotFramesInUse;
|
|
|
|
RTL_HEAP_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME Frames[32];
|
|
|
|
} ACTIVATION_CONTEXT_STACK_FRAMELIST, *PACTIVATION_CONTEXT_STACK_FRAMELIST;
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* NTOS_MODE_USER */
|
2006-05-10 17:47:44 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// ACE Structure
|
|
|
|
//
|
2005-06-18 23:33:40 +00:00
|
|
|
typedef struct _ACE
|
|
|
|
{
|
|
|
|
ACE_HEADER Header;
|
|
|
|
ACCESS_MASK AccessMask;
|
|
|
|
} ACE, *PACE;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Information Structures for RTL Debug Functions
|
|
|
|
//
|
2005-11-20 17:16:11 +00:00
|
|
|
typedef struct _RTL_PROCESS_MODULE_INFORMATION
|
2005-06-21 02:08:42 +00:00
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG Section;
|
|
|
|
PVOID MappedBase;
|
|
|
|
PVOID ImageBase;
|
|
|
|
ULONG ImageSize;
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG Flags;
|
2006-05-10 17:47:44 +00:00
|
|
|
USHORT LoadOrderIndex;
|
|
|
|
USHORT InitOrderIndex;
|
2005-06-21 02:08:42 +00:00
|
|
|
USHORT LoadCount;
|
2006-05-10 17:47:44 +00:00
|
|
|
USHORT OffsetToFileName;
|
|
|
|
CHAR FullPathName[256];
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_MODULE_INFORMATION, *PRTL_PROCESS_MODULE_INFORMATION;
|
|
|
|
|
|
|
|
typedef struct _RTL_PROCESS_MODULES
|
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG NumberOfModules;
|
|
|
|
RTL_PROCESS_MODULE_INFORMATION Modules[1];
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_MODULES, *PRTL_PROCESS_MODULES;
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
typedef struct _RTL_PROCESS_MODULE_INFORMATION_EX
|
|
|
|
{
|
|
|
|
ULONG NextOffset;
|
|
|
|
RTL_PROCESS_MODULE_INFORMATION BaseInfo;
|
|
|
|
ULONG ImageCheckSum;
|
|
|
|
ULONG TimeDateStamp;
|
|
|
|
PVOID DefaultBase;
|
|
|
|
} RTL_PROCESS_MODULE_INFORMATION_EX, *PRTL_PROCESS_MODULE_INFORMATION_EX;
|
|
|
|
|
2006-06-24 19:49:28 +00:00
|
|
|
typedef struct _RTL_HEAP_TAG_INFO
|
|
|
|
{
|
2012-01-24 21:15:55 +00:00
|
|
|
ULONG NumberOfAllocations;
|
|
|
|
ULONG NumberOfFrees;
|
|
|
|
SIZE_T BytesAllocated;
|
2006-06-24 19:49:28 +00:00
|
|
|
} RTL_HEAP_TAG_INFO, *PRTL_HEAP_TAG_INFO;
|
|
|
|
|
|
|
|
typedef struct _RTL_HEAP_USAGE_ENTRY
|
|
|
|
{
|
|
|
|
struct _RTL_HEAP_USAGE_ENTRY *Next;
|
2012-01-24 21:15:55 +00:00
|
|
|
PVOID Address;
|
|
|
|
SIZE_T Size;
|
|
|
|
USHORT AllocatorBackTraceIndex;
|
|
|
|
USHORT TagIndex;
|
2006-06-24 19:49:28 +00:00
|
|
|
} RTL_HEAP_USAGE_ENTRY, *PRTL_HEAP_USAGE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _RTL_HEAP_USAGE
|
|
|
|
{
|
|
|
|
ULONG Length;
|
2012-01-24 21:15:55 +00:00
|
|
|
SIZE_T BytesAllocated;
|
|
|
|
SIZE_T BytesCommitted;
|
|
|
|
SIZE_T BytesReserved;
|
|
|
|
SIZE_T BytesReservedMaximum;
|
2006-06-24 19:49:28 +00:00
|
|
|
PRTL_HEAP_USAGE_ENTRY Entries;
|
|
|
|
PRTL_HEAP_USAGE_ENTRY AddedEntries;
|
|
|
|
PRTL_HEAP_USAGE_ENTRY RemovedEntries;
|
2012-01-24 21:15:55 +00:00
|
|
|
ULONG_PTR Reserved[8];
|
2006-06-24 19:49:28 +00:00
|
|
|
} RTL_HEAP_USAGE, *PRTL_HEAP_USAGE;
|
|
|
|
|
2012-01-24 21:15:55 +00:00
|
|
|
typedef struct _RTL_HEAP_WALK_ENTRY
|
|
|
|
{
|
|
|
|
PVOID DataAddress;
|
|
|
|
SIZE_T DataSize;
|
|
|
|
UCHAR OverheadBytes;
|
|
|
|
UCHAR SegmentIndex;
|
|
|
|
USHORT Flags;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
SIZE_T Settable;
|
|
|
|
USHORT TagIndex;
|
|
|
|
USHORT AllocatorBackTraceIndex;
|
|
|
|
ULONG Reserved[2];
|
|
|
|
} Block;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
ULONG_PTR CommittedSize;
|
|
|
|
ULONG_PTR UnCommittedSize;
|
|
|
|
PVOID FirstEntry;
|
|
|
|
PVOID LastEntry;
|
|
|
|
} Segment;
|
|
|
|
};
|
|
|
|
} RTL_HEAP_WALK_ENTRY, *PRTL_HEAP_WALK_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _RTL_HEAP_ENTRY
|
|
|
|
{
|
|
|
|
SIZE_T Size;
|
|
|
|
USHORT Flags;
|
|
|
|
USHORT AllocatorBackTraceIndex;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
SIZE_T Settable;
|
|
|
|
ULONG Tag;
|
|
|
|
} s1;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
SIZE_T CommittedSize;
|
|
|
|
PVOID FirstBlock;
|
|
|
|
} s2;
|
|
|
|
} u;
|
|
|
|
} RTL_HEAP_ENTRY, *PRTL_HEAP_ENTRY;
|
|
|
|
|
2012-01-24 21:56:02 +00:00
|
|
|
typedef struct _RTL_HEAP_TAG
|
|
|
|
{
|
|
|
|
ULONG NumberOfAllocations;
|
|
|
|
ULONG NumberOfFrees;
|
|
|
|
SIZE_T BytesAllocated;
|
|
|
|
USHORT TagIndex;
|
|
|
|
USHORT CreatorBackTraceIndex;
|
|
|
|
WCHAR TagName[24];
|
|
|
|
} RTL_HEAP_TAG, *PRTL_HEAP_TAG;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
typedef struct _RTL_HEAP_INFORMATION
|
2005-06-21 02:08:42 +00:00
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
PVOID BaseAddress;
|
2005-06-21 02:08:42 +00:00
|
|
|
ULONG Flags;
|
2006-05-10 17:47:44 +00:00
|
|
|
USHORT EntryOverhead;
|
|
|
|
USHORT CreatorBackTraceIndex;
|
2012-01-24 21:15:55 +00:00
|
|
|
SIZE_T BytesAllocated;
|
|
|
|
SIZE_T BytesCommitted;
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG NumberOfTags;
|
|
|
|
ULONG NumberOfEntries;
|
|
|
|
ULONG NumberOfPseudoTags;
|
|
|
|
ULONG PseudoTagGranularity;
|
|
|
|
ULONG Reserved[4];
|
2012-01-24 21:15:55 +00:00
|
|
|
PRTL_HEAP_TAG Tags;
|
|
|
|
PRTL_HEAP_ENTRY Entries;
|
2006-05-10 17:47:44 +00:00
|
|
|
} RTL_HEAP_INFORMATION, *PRTL_HEAP_INFORMATION;
|
2005-11-20 17:16:11 +00:00
|
|
|
|
|
|
|
typedef struct _RTL_PROCESS_HEAPS
|
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG NumberOfHeaps;
|
|
|
|
RTL_HEAP_INFORMATION Heaps[1];
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_HEAPS, *PRTL_PROCESS_HEAPS;
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-20 17:16:11 +00:00
|
|
|
typedef struct _RTL_PROCESS_LOCK_INFORMATION
|
2005-06-21 02:08:42 +00:00
|
|
|
{
|
|
|
|
PVOID Address;
|
|
|
|
USHORT Type;
|
|
|
|
USHORT CreatorBackTraceIndex;
|
|
|
|
ULONG OwnerThreadId;
|
|
|
|
ULONG ActiveCount;
|
|
|
|
ULONG ContentionCount;
|
|
|
|
ULONG EntryCount;
|
|
|
|
ULONG RecursionCount;
|
|
|
|
ULONG NumberOfSharedWaiters;
|
|
|
|
ULONG NumberOfExclusiveWaiters;
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_LOCK_INFORMATION, *PRTL_PROCESS_LOCK_INFORMATION;
|
|
|
|
|
|
|
|
typedef struct _RTL_PROCESS_LOCKS
|
|
|
|
{
|
2006-05-10 17:47:44 +00:00
|
|
|
ULONG NumberOfLocks;
|
|
|
|
RTL_PROCESS_LOCK_INFORMATION Locks[1];
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_LOCKS, *PRTL_PROCESS_LOCKS;
|
|
|
|
|
|
|
|
typedef struct _RTL_PROCESS_BACKTRACE_INFORMATION
|
|
|
|
{
|
2005-11-27 18:24:32 +00:00
|
|
|
PVOID SymbolicBackTrace;
|
|
|
|
ULONG TraceCount;
|
|
|
|
USHORT Index;
|
|
|
|
USHORT Depth;
|
|
|
|
PVOID BackTrace[16];
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_BACKTRACE_INFORMATION, *PRTL_PROCESS_BACKTRACE_INFORMATION;
|
|
|
|
|
|
|
|
typedef struct _RTL_PROCESS_BACKTRACES
|
|
|
|
{
|
2005-11-27 18:24:32 +00:00
|
|
|
ULONG CommittedMemory;
|
|
|
|
ULONG ReservedMemory;
|
|
|
|
ULONG NumberOfBackTraceLookups;
|
|
|
|
ULONG NumberOfBackTraces;
|
|
|
|
RTL_PROCESS_BACKTRACE_INFORMATION BackTraces[1];
|
2005-11-20 17:16:11 +00:00
|
|
|
} RTL_PROCESS_BACKTRACES, *PRTL_PROCESS_BACKTRACES;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
typedef struct _RTL_PROCESS_VERIFIER_OPTIONS
|
|
|
|
{
|
|
|
|
ULONG SizeStruct;
|
|
|
|
ULONG Option;
|
|
|
|
UCHAR OptionData[1];
|
|
|
|
//
|
|
|
|
// Option array continues below
|
|
|
|
//
|
|
|
|
} RTL_PROCESS_VERIFIER_OPTIONS, *PRTL_PROCESS_VERIFIER_OPTIONS;
|
|
|
|
|
|
|
|
typedef struct _RTL_DEBUG_INFORMATION
|
|
|
|
{
|
|
|
|
HANDLE SectionHandleClient;
|
|
|
|
PVOID ViewBaseClient;
|
|
|
|
PVOID ViewBaseTarget;
|
|
|
|
ULONG ViewBaseDelta;
|
|
|
|
HANDLE EventPairClient;
|
|
|
|
PVOID EventPairTarget;
|
|
|
|
HANDLE TargetProcessId;
|
|
|
|
HANDLE TargetThreadHandle;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG OffsetFree;
|
|
|
|
ULONG CommitSize;
|
|
|
|
ULONG ViewSize;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
PRTL_PROCESS_MODULES Modules;
|
|
|
|
PRTL_PROCESS_MODULE_INFORMATION_EX ModulesEx;
|
|
|
|
};
|
|
|
|
PRTL_PROCESS_BACKTRACES BackTraces;
|
|
|
|
PRTL_PROCESS_HEAPS Heaps;
|
|
|
|
PRTL_PROCESS_LOCKS Locks;
|
|
|
|
HANDLE SpecificHeap;
|
|
|
|
HANDLE TargetProcessHandle;
|
|
|
|
RTL_PROCESS_VERIFIER_OPTIONS VerifierOptions;
|
|
|
|
HANDLE ProcessHeap;
|
|
|
|
HANDLE CriticalSectionHandle;
|
|
|
|
HANDLE CriticalSectionOwnerThread;
|
|
|
|
PVOID Reserved[4];
|
|
|
|
} RTL_DEBUG_INFORMATION, *PRTL_DEBUG_INFORMATION;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Unload Event Trace Structure for RtlGetUnloadEventTrace
|
|
|
|
//
|
|
|
|
typedef struct _RTL_UNLOAD_EVENT_TRACE
|
|
|
|
{
|
|
|
|
PVOID BaseAddress;
|
|
|
|
ULONG SizeOfImage;
|
|
|
|
ULONG Sequence;
|
|
|
|
ULONG TimeDateStamp;
|
|
|
|
ULONG CheckSum;
|
|
|
|
WCHAR ImageName[32];
|
|
|
|
} RTL_UNLOAD_EVENT_TRACE, *PRTL_UNLOAD_EVENT_TRACE;
|
2005-06-21 02:08:42 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Handle Structures
|
|
|
|
//
|
2005-06-24 18:11:16 +00:00
|
|
|
typedef struct _RTL_HANDLE_TABLE_ENTRY
|
|
|
|
{
|
2009-06-15 14:49:31 +00:00
|
|
|
union
|
|
|
|
{
|
|
|
|
ULONG Flags;
|
|
|
|
struct _RTL_HANDLE_TABLE_ENTRY *NextFree;
|
|
|
|
};
|
2005-06-24 18:11:16 +00:00
|
|
|
} RTL_HANDLE_TABLE_ENTRY, *PRTL_HANDLE_TABLE_ENTRY;
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-06-21 02:08:42 +00:00
|
|
|
typedef struct _RTL_HANDLE_TABLE
|
|
|
|
{
|
2005-08-07 17:11:13 +00:00
|
|
|
ULONG MaximumNumberOfHandles;
|
|
|
|
ULONG SizeOfHandleTableEntry;
|
|
|
|
ULONG Reserved[2];
|
|
|
|
PRTL_HANDLE_TABLE_ENTRY FreeHandles;
|
|
|
|
PRTL_HANDLE_TABLE_ENTRY CommittedHandles;
|
|
|
|
PRTL_HANDLE_TABLE_ENTRY UnCommittedHandles;
|
|
|
|
PRTL_HANDLE_TABLE_ENTRY MaxReservedHandles;
|
2005-06-21 02:08:42 +00:00
|
|
|
} RTL_HANDLE_TABLE, *PRTL_HANDLE_TABLE;
|
2005-06-24 18:11:16 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Exception Record
|
|
|
|
//
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
typedef struct _EXCEPTION_REGISTRATION_RECORD
|
2005-06-18 23:33:40 +00:00
|
|
|
{
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
struct _EXCEPTION_REGISTRATION_RECORD *Next;
|
2005-11-23 04:31:58 +00:00
|
|
|
PEXCEPTION_ROUTINE Handler;
|
Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
- Fix KiUserExceptionDispatcher
- Remove useless NTDLL entrypoint
- Implement NTDLL Ki* callbacks in ASM
- Implement RtlCaptureContext
- Fix RtlRaiseException to handle cases when a user-mode debugger is present
- Fix RtlRaiseStatus as above, plus set the exception address and capture context
- Little cleanup of RTL headers
- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of
Context.
- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some
optimizations to increase speed.
- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to
support a PKEXCEPTION_FRAME for future PPC compatibility.
- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
- Export ExRaiseStatus/Exception as Rtl*
- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context
and parameters with SEH.
- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the
user-mode callback.
- Implement KiUnexpectedInterrupt and KiCoprocessorError
- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the
stack when called through System call interface.
- Fix Ntcontinue to respect AlertThread paramter
- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context
flags,...
- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any
exceptions (the kernel-mode code to handle this isn't written yet though)
svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
|
|
|
} EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Current Directory Structures
|
|
|
|
//
|
2005-07-12 01:56:14 +00:00
|
|
|
typedef struct _CURDIR
|
|
|
|
{
|
|
|
|
UNICODE_STRING DosPath;
|
|
|
|
HANDLE Handle;
|
|
|
|
} CURDIR, *PCURDIR;
|
|
|
|
|
2012-01-20 20:18:31 +00:00
|
|
|
typedef struct _RTLP_CURDIR_REF
|
|
|
|
{
|
|
|
|
LONG RefCount;
|
|
|
|
HANDLE Handle;
|
|
|
|
} RTLP_CURDIR_REF, *PRTLP_CURDIR_REF;
|
|
|
|
|
2011-07-14 15:33:29 +00:00
|
|
|
typedef struct _RTL_RELATIVE_NAME_U
|
|
|
|
{
|
|
|
|
UNICODE_STRING RelativeName;
|
|
|
|
HANDLE ContainingDirectory;
|
|
|
|
PRTLP_CURDIR_REF CurDirRef;
|
|
|
|
} RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U;
|
|
|
|
|
2011-04-02 18:32:04 +00:00
|
|
|
typedef struct _RTL_DRIVE_LETTER_CURDIR
|
2005-06-18 23:33:40 +00:00
|
|
|
{
|
|
|
|
USHORT Flags;
|
|
|
|
USHORT Length;
|
|
|
|
ULONG TimeStamp;
|
|
|
|
UNICODE_STRING DosPath;
|
|
|
|
} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2011-04-02 18:32:04 +00:00
|
|
|
typedef struct _RTL_PERTHREAD_CURDIR
|
|
|
|
{
|
|
|
|
PRTL_DRIVE_LETTER_CURDIR CurrentDirectories;
|
|
|
|
PUNICODE_STRING ImageName;
|
|
|
|
PVOID Environment;
|
|
|
|
} RTL_PERTHREAD_CURDIR, *PRTL_PERTHREAD_CURDIR;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Private State structure for RtlAcquirePrivilege/RtlReleasePrivilege
|
|
|
|
//
|
|
|
|
typedef struct _RTL_ACQUIRE_STATE
|
|
|
|
{
|
|
|
|
HANDLE Token;
|
|
|
|
HANDLE OldImpersonationToken;
|
|
|
|
PTOKEN_PRIVILEGES OldPrivileges;
|
|
|
|
PTOKEN_PRIVILEGES NewPrivileges;
|
|
|
|
ULONG Flags;
|
|
|
|
UCHAR OldPrivBuffer[1024];
|
|
|
|
} RTL_ACQUIRE_STATE, *PRTL_ACQUIRE_STATE;
|
|
|
|
|
2005-09-05 07:51:15 +00:00
|
|
|
#ifndef NTOS_MODE_USER
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// RTL Critical Section Structures
|
|
|
|
//
|
2005-09-05 07:51:15 +00:00
|
|
|
typedef struct _RTL_CRITICAL_SECTION_DEBUG
|
|
|
|
{
|
|
|
|
USHORT Type;
|
|
|
|
USHORT CreatorBackTraceIndex;
|
|
|
|
struct _RTL_CRITICAL_SECTION *CriticalSection;
|
|
|
|
LIST_ENTRY ProcessLocksList;
|
|
|
|
ULONG EntryCount;
|
|
|
|
ULONG ContentionCount;
|
|
|
|
ULONG Spare[2];
|
|
|
|
} RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
|
|
|
|
|
|
|
|
typedef struct _RTL_CRITICAL_SECTION
|
|
|
|
{
|
|
|
|
PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
|
|
|
|
LONG LockCount;
|
|
|
|
LONG RecursionCount;
|
|
|
|
HANDLE OwningThread;
|
|
|
|
HANDLE LockSemaphore;
|
|
|
|
ULONG_PTR SpinCount;
|
|
|
|
} RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* !NTOS_MODE_USER */
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2010-10-05 12:42:55 +00:00
|
|
|
//
|
|
|
|
// RTL Private Heap Structures
|
|
|
|
//
|
|
|
|
typedef struct _HEAP_LOCK
|
|
|
|
{
|
|
|
|
union
|
|
|
|
{
|
|
|
|
RTL_CRITICAL_SECTION CriticalSection;
|
|
|
|
#ifndef NTOS_MODE_USER
|
|
|
|
ERESOURCE Resource;
|
|
|
|
#endif
|
|
|
|
UCHAR Padding[0x68]; /* Max ERESOURCE size for x64 build. Needed because RTL is built only once */
|
|
|
|
};
|
|
|
|
} HEAP_LOCK, *PHEAP_LOCK;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Range List Structures
|
|
|
|
//
|
2005-06-19 20:18:30 +00:00
|
|
|
typedef struct _RTL_RANGE_LIST
|
|
|
|
{
|
|
|
|
LIST_ENTRY ListHead;
|
2005-11-22 04:57:45 +00:00
|
|
|
ULONG Flags;
|
2005-06-19 20:18:30 +00:00
|
|
|
ULONG Count;
|
|
|
|
ULONG Stamp;
|
|
|
|
} RTL_RANGE_LIST, *PRTL_RANGE_LIST;
|
|
|
|
|
|
|
|
typedef struct _RTL_RANGE
|
|
|
|
{
|
|
|
|
ULONGLONG Start;
|
|
|
|
ULONGLONG End;
|
|
|
|
PVOID UserData;
|
|
|
|
PVOID Owner;
|
|
|
|
UCHAR Attributes;
|
2005-11-22 04:57:45 +00:00
|
|
|
UCHAR Flags;
|
2005-06-19 20:18:30 +00:00
|
|
|
} RTL_RANGE, *PRTL_RANGE;
|
|
|
|
|
2005-09-05 07:51:15 +00:00
|
|
|
typedef struct _RANGE_LIST_ITERATOR
|
|
|
|
{
|
|
|
|
PLIST_ENTRY RangeListHead;
|
|
|
|
PLIST_ENTRY MergedHead;
|
|
|
|
PVOID Current;
|
|
|
|
ULONG Stamp;
|
|
|
|
} RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Resource
|
|
|
|
//
|
2012-01-24 21:15:55 +00:00
|
|
|
#define RTL_RESOURCE_FLAG_LONG_TERM ((ULONG)0x00000001)
|
|
|
|
|
2005-06-21 02:08:42 +00:00
|
|
|
typedef struct _RTL_RESOURCE
|
|
|
|
{
|
|
|
|
RTL_CRITICAL_SECTION Lock;
|
|
|
|
HANDLE SharedSemaphore;
|
|
|
|
ULONG SharedWaiters;
|
|
|
|
HANDLE ExclusiveSemaphore;
|
|
|
|
ULONG ExclusiveWaiters;
|
|
|
|
LONG NumberActive;
|
|
|
|
HANDLE OwningThread;
|
2012-01-24 21:56:02 +00:00
|
|
|
ULONG TimeoutBoost;
|
|
|
|
PVOID DebugInfo;
|
2005-06-21 02:08:42 +00:00
|
|
|
} RTL_RESOURCE, *PRTL_RESOURCE;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Structures for RtlCreateUserProcess
|
|
|
|
//
|
2005-06-26 01:08:55 +00:00
|
|
|
typedef struct _RTL_USER_PROCESS_PARAMETERS
|
2005-06-18 23:33:40 +00:00
|
|
|
{
|
2005-07-12 01:56:14 +00:00
|
|
|
ULONG MaximumLength;
|
|
|
|
ULONG Length;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG DebugFlags;
|
|
|
|
HANDLE ConsoleHandle;
|
|
|
|
ULONG ConsoleFlags;
|
|
|
|
HANDLE StandardInput;
|
|
|
|
HANDLE StandardOutput;
|
|
|
|
HANDLE StandardError;
|
|
|
|
CURDIR CurrentDirectory;
|
|
|
|
UNICODE_STRING DllPath;
|
|
|
|
UNICODE_STRING ImagePathName;
|
|
|
|
UNICODE_STRING CommandLine;
|
|
|
|
PWSTR Environment;
|
|
|
|
ULONG StartingX;
|
|
|
|
ULONG StartingY;
|
|
|
|
ULONG CountX;
|
|
|
|
ULONG CountY;
|
|
|
|
ULONG CountCharsX;
|
|
|
|
ULONG CountCharsY;
|
2005-07-26 14:00:45 +00:00
|
|
|
ULONG FillAttribute;
|
2005-07-12 01:56:14 +00:00
|
|
|
ULONG WindowFlags;
|
|
|
|
ULONG ShowWindowFlags;
|
|
|
|
UNICODE_STRING WindowTitle;
|
|
|
|
UNICODE_STRING DesktopInfo;
|
|
|
|
UNICODE_STRING ShellInfo;
|
|
|
|
UNICODE_STRING RuntimeData;
|
2012-01-24 21:15:55 +00:00
|
|
|
RTL_DRIVE_LETTER_CURDIR CurrentDirectories[RTL_MAX_DRIVE_LETTERS];
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
|
|
|
|
SIZE_T EnvironmentSize;
|
|
|
|
#endif
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WIN7)
|
|
|
|
SIZE_T EnvironmentVersion;
|
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-07-12 01:56:14 +00:00
|
|
|
typedef struct _RTL_USER_PROCESS_INFORMATION
|
2005-06-18 23:33:40 +00:00
|
|
|
{
|
2005-07-12 01:56:14 +00:00
|
|
|
ULONG Size;
|
|
|
|
HANDLE ProcessHandle;
|
|
|
|
HANDLE ThreadHandle;
|
|
|
|
CLIENT_ID ClientId;
|
|
|
|
SECTION_IMAGE_INFORMATION ImageInformation;
|
|
|
|
} RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION;
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// RTL Atom Table Structures
|
|
|
|
//
|
2005-06-24 18:11:16 +00:00
|
|
|
typedef struct _RTL_ATOM_TABLE_ENTRY
|
|
|
|
{
|
|
|
|
struct _RTL_ATOM_TABLE_ENTRY *HashLink;
|
|
|
|
USHORT HandleIndex;
|
|
|
|
USHORT Atom;
|
|
|
|
USHORT ReferenceCount;
|
|
|
|
UCHAR Flags;
|
|
|
|
UCHAR NameLength;
|
|
|
|
WCHAR Name[1];
|
|
|
|
} RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _RTL_ATOM_TABLE
|
2005-06-18 23:33:40 +00:00
|
|
|
{
|
2005-06-24 18:11:16 +00:00
|
|
|
ULONG Signature;
|
|
|
|
union
|
|
|
|
{
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-06-24 18:11:16 +00:00
|
|
|
RTL_CRITICAL_SECTION CriticalSection;
|
2005-11-22 04:57:45 +00:00
|
|
|
#else
|
2005-06-24 18:11:16 +00:00
|
|
|
FAST_MUTEX FastMutex;
|
2005-11-22 04:57:45 +00:00
|
|
|
#endif
|
2005-06-24 18:11:16 +00:00
|
|
|
};
|
|
|
|
union
|
|
|
|
{
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-06-24 18:11:16 +00:00
|
|
|
RTL_HANDLE_TABLE RtlHandleTable;
|
2005-11-22 04:57:45 +00:00
|
|
|
#else
|
2005-06-24 18:11:16 +00:00
|
|
|
PHANDLE_TABLE ExHandleTable;
|
2005-11-22 04:57:45 +00:00
|
|
|
#endif
|
2005-06-24 18:11:16 +00:00
|
|
|
};
|
|
|
|
ULONG NumberOfBuckets;
|
|
|
|
PRTL_ATOM_TABLE_ENTRY Buckets[1];
|
2005-06-18 23:33:40 +00:00
|
|
|
} RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
|
|
|
|
|
2006-06-23 21:21:45 +00:00
|
|
|
#ifndef _WINBASE_
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// System Time and Timezone Structures
|
|
|
|
//
|
2005-09-05 07:51:15 +00:00
|
|
|
typedef struct _SYSTEMTIME
|
|
|
|
{
|
|
|
|
USHORT wYear;
|
|
|
|
USHORT wMonth;
|
|
|
|
USHORT wDayOfWeek;
|
|
|
|
USHORT wDay;
|
|
|
|
USHORT wHour;
|
|
|
|
USHORT wMinute;
|
|
|
|
USHORT wSecond;
|
|
|
|
USHORT wMilliseconds;
|
|
|
|
} SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
|
|
|
|
|
|
|
|
typedef struct _TIME_ZONE_INFORMATION
|
|
|
|
{
|
|
|
|
LONG Bias;
|
|
|
|
WCHAR StandardName[32];
|
|
|
|
SYSTEMTIME StandardDate;
|
|
|
|
LONG StandardBias;
|
|
|
|
WCHAR DaylightName[32];
|
|
|
|
SYSTEMTIME DaylightDate;
|
|
|
|
LONG DaylightBias;
|
|
|
|
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* !_WINBASE_ */
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2006-06-23 21:21:45 +00:00
|
|
|
//
|
|
|
|
// Native version of Timezone Structure
|
|
|
|
//
|
|
|
|
typedef LPTIME_ZONE_INFORMATION PRTL_TIME_ZONE_INFORMATION;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Hotpatch Header
|
|
|
|
//
|
|
|
|
typedef struct _RTL_PATCH_HEADER
|
|
|
|
{
|
|
|
|
LIST_ENTRY PatchList;
|
|
|
|
PVOID PatchImageBase;
|
|
|
|
struct _RTL_PATCH_HEADER *NextPath;
|
|
|
|
ULONG PatchFlags;
|
|
|
|
LONG PatchRefCount;
|
|
|
|
struct _HOTPATCH_HEADER *HotpatchHeader;
|
|
|
|
UNICODE_STRING TargetDllName;
|
|
|
|
PVOID TargetDllBase;
|
|
|
|
PLDR_DATA_TABLE_ENTRY TargetLdrDataTableEntry;
|
|
|
|
PLDR_DATA_TABLE_ENTRY PatchLdrDataTableEntry;
|
|
|
|
struct _SYSTEM_HOTPATCH_CODE_INFORMATION *CodeInfo;
|
|
|
|
} RTL_PATCH_HEADER, *PRTL_PATCH_HEADER;
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Header for NLS Files
|
|
|
|
//
|
|
|
|
typedef struct _NLS_FILE_HEADER
|
|
|
|
{
|
|
|
|
USHORT HeaderSize;
|
|
|
|
USHORT CodePage;
|
|
|
|
USHORT MaximumCharacterSize;
|
|
|
|
USHORT DefaultChar;
|
|
|
|
USHORT UniDefaultChar;
|
|
|
|
USHORT TransDefaultChar;
|
|
|
|
USHORT TransUniDefaultChar;
|
|
|
|
UCHAR LeadByte[MAXIMUM_LEADBYTES];
|
|
|
|
} NLS_FILE_HEADER, *PNLS_FILE_HEADER;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Stack Traces
|
|
|
|
//
|
|
|
|
typedef struct _RTL_STACK_TRACE_ENTRY
|
|
|
|
{
|
|
|
|
struct _RTL_STACK_TRACE_ENTRY *HashChain;
|
|
|
|
ULONG TraceCount;
|
|
|
|
USHORT Index;
|
|
|
|
USHORT Depth;
|
|
|
|
PVOID BackTrace[32];
|
|
|
|
} RTL_STACK_TRACE_ENTRY, *PRTL_STACK_TRACE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _STACK_TRACE_DATABASE
|
|
|
|
{
|
|
|
|
RTL_CRITICAL_SECTION CriticalSection;
|
|
|
|
} STACK_TRACE_DATABASE, *PSTACK_TRACE_DATABASE;
|
|
|
|
|
2011-02-12 09:28:41 +00:00
|
|
|
typedef struct _RTL_TRACE_BLOCK
|
|
|
|
{
|
|
|
|
ULONG Magic;
|
|
|
|
ULONG Count;
|
|
|
|
ULONG Size;
|
|
|
|
ULONG UserCount;
|
|
|
|
ULONG UserSize;
|
|
|
|
PVOID UserContext;
|
|
|
|
struct _RTL_TRACE_BLOCK *Next;
|
|
|
|
PVOID *Trace;
|
|
|
|
} RTL_TRACE_BLOCK, *PRTL_TRACE_BLOCK;
|
|
|
|
|
2012-01-16 21:27:50 +00:00
|
|
|
//
|
|
|
|
// Auto-Managed Rtl* String Buffer
|
|
|
|
//
|
|
|
|
typedef struct _RTL_BUFFER
|
|
|
|
{
|
|
|
|
PUCHAR Buffer;
|
|
|
|
PUCHAR StaticBuffer;
|
|
|
|
SIZE_T Size;
|
|
|
|
SIZE_T StaticSize;
|
|
|
|
SIZE_T ReservedForAllocatedSize;
|
|
|
|
PVOID ReservedForIMalloc;
|
|
|
|
} RTL_BUFFER, *PRTL_BUFFER;
|
|
|
|
|
|
|
|
typedef struct _RTL_UNICODE_STRING_BUFFER
|
|
|
|
{
|
|
|
|
UNICODE_STRING String;
|
|
|
|
RTL_BUFFER ByteBuffer;
|
|
|
|
WCHAR MinimumStaticBufferForTerminalNul;
|
|
|
|
} RTL_UNICODE_STRING_BUFFER, *PRTL_UNICODE_STRING_BUFFER;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
#ifndef NTOS_MODE_USER
|
|
|
|
|
|
|
|
//
|
|
|
|
// Message Resource Entry, Block and Data
|
|
|
|
//
|
|
|
|
typedef struct _MESSAGE_RESOURCE_ENTRY
|
|
|
|
{
|
|
|
|
USHORT Length;
|
|
|
|
USHORT Flags;
|
|
|
|
UCHAR Text[ANYSIZE_ARRAY];
|
|
|
|
} MESSAGE_RESOURCE_ENTRY, *PMESSAGE_RESOURCE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _MESSAGE_RESOURCE_BLOCK
|
|
|
|
{
|
|
|
|
ULONG LowId;
|
|
|
|
ULONG HighId;
|
|
|
|
ULONG OffsetToEntries;
|
|
|
|
} MESSAGE_RESOURCE_BLOCK, *PMESSAGE_RESOURCE_BLOCK;
|
|
|
|
|
|
|
|
typedef struct _MESSAGE_RESOURCE_DATA
|
|
|
|
{
|
|
|
|
ULONG NumberOfBlocks;
|
|
|
|
MESSAGE_RESOURCE_BLOCK Blocks[ANYSIZE_ARRAY];
|
|
|
|
} MESSAGE_RESOURCE_DATA, *PMESSAGE_RESOURCE_DATA;
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* !NTOS_MODE_USER */
|
2013-06-09 08:54:33 +00:00
|
|
|
|
2013-10-19 17:48:27 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
|
|
|
|
|
|
|
//
|
|
|
|
// Memory Stream
|
|
|
|
//
|
|
|
|
#ifndef CONST_VTBL
|
|
|
|
#ifdef CONST_VTABLE
|
|
|
|
#define CONST_VTBL const
|
|
|
|
#else
|
|
|
|
#define CONST_VTBL
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct IStreamVtbl;
|
|
|
|
struct IStream;
|
|
|
|
struct tagSTATSTG;
|
|
|
|
|
|
|
|
typedef struct _RTL_MEMORY_STREAM RTL_MEMORY_STREAM, *PRTL_MEMORY_STREAM;
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *PRTL_MEMORY_STREAM_FINAL_RELEASE_ROUTINE)(
|
|
|
|
_In_ PRTL_MEMORY_STREAM Stream
|
|
|
|
);
|
|
|
|
|
|
|
|
struct _RTL_MEMORY_STREAM
|
|
|
|
{
|
|
|
|
CONST_VTBL struct IStreamVtbl *Vtbl;
|
|
|
|
LONG RefCount;
|
|
|
|
ULONG Unk1;
|
|
|
|
PVOID Current;
|
|
|
|
PVOID Start;
|
|
|
|
PVOID End;
|
|
|
|
PRTL_MEMORY_STREAM_FINAL_RELEASE_ROUTINE FinalRelease;
|
|
|
|
HANDLE ProcessHandle;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* NTOS_MODE_USER */
|
|
|
|
|
2013-06-09 08:54:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-08-05 01:20:28 +00:00
|
|
|
#endif /* !_RTLTYPES_H */
|