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
|
|
|
|
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
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_SERVER 0x04
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_PROFILE_KERNEL 0x08
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_UNKNOWN 0x10
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB 0x20
|
|
|
|
#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
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_LOCAL_DLL_PATH 0x2000
|
|
|
|
#define RTL_USER_PROCESS_PARAMETERS_NX 0x20000
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Exception Flags
|
|
|
|
//
|
2006-09-07 05:07:34 +00:00
|
|
|
#define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)
|
|
|
|
#define EXCEPTION_UNWINDING 0x02
|
|
|
|
#define EXCEPTION_EXIT_UNWIND 0x04
|
|
|
|
#define EXCEPTION_STACK_INVALID 0x08
|
|
|
|
#define EXCEPTION_UNWIND (EXCEPTION_UNWINDING + EXCEPTION_EXIT_UNWIND)
|
|
|
|
#define EXCEPTION_NESTED_CALL 0x10
|
|
|
|
#define EXCEPTION_TARGET_UNWIND 0x20
|
|
|
|
#define EXCEPTION_COLLIDED_UNWIND 0x20
|
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
|
|
|
//
|
|
|
|
// Activation Context Frame Flags
|
|
|
|
//
|
|
|
|
#define RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_FORMAT_WHISTLER \
|
|
|
|
0x1
|
|
|
|
|
|
|
|
//
|
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
|
|
|
|
|
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
|
|
|
|
//
|
|
|
|
#define RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE 4
|
|
|
|
|
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
|
|
|
|
|
|
|
//
|
|
|
|
// 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)
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
#else
|
|
|
|
//
|
|
|
|
// Message Resource Flag
|
|
|
|
//
|
|
|
|
#define MESSAGE_RESOURCE_UNICODE 0x0001
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#endif
|
|
|
|
#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
|
|
|
|
2005-08-17 07:06:59 +00:00
|
|
|
#endif
|
|
|
|
|
2005-09-06 06:19:30 +00:00
|
|
|
#ifdef NTOS_MODE_USER
|
2005-06-18 23:33:40 +00:00
|
|
|
|
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
|
|
|
|
2005-09-05 07:51:15 +00:00
|
|
|
#endif
|
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)(
|
|
|
|
IN PVOID Context
|
|
|
|
);
|
|
|
|
|
2005-11-05 06:44:03 +00:00
|
|
|
#else
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Handler during regular RTL Exceptions
|
|
|
|
//
|
2005-11-05 06:44:03 +00:00
|
|
|
typedef EXCEPTION_DISPOSITION
|
|
|
|
(NTAPI *PEXCEPTION_ROUTINE)(
|
|
|
|
IN struct _EXCEPTION_RECORD *ExceptionRecord,
|
|
|
|
IN PVOID EstablisherFrame,
|
|
|
|
IN OUT struct _CONTEXT *ContextRecord,
|
|
|
|
IN OUT PVOID DispatcherContext
|
|
|
|
);
|
|
|
|
|
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;
|
|
|
|
|
2005-09-05 18:06:20 +00:00
|
|
|
#endif
|
|
|
|
|
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)(
|
2005-06-19 20:01:07 +00:00
|
|
|
IN PVOID HeapHandle,
|
|
|
|
IN PVOID UserParam
|
|
|
|
);
|
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
|
|
|
|
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
|
|
|
|
//
|
2006-10-20 13:19:13 +00:00
|
|
|
#if defined(NTOS_MODE_USER) || (!defined(NTOS_MODE_USER) && !defined(_NTIFS_))
|
2005-08-17 07:06:59 +00:00
|
|
|
typedef NTSTATUS
|
|
|
|
(NTAPI *PRTL_AVL_MATCH_FUNCTION)(
|
|
|
|
struct _RTL_AVL_TABLE *Table,
|
|
|
|
PVOID UserData,
|
|
|
|
PVOID MatchData
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef RTL_GENERIC_COMPARE_RESULTS
|
|
|
|
(NTAPI *PRTL_AVL_COMPARE_ROUTINE) (
|
|
|
|
struct _RTL_AVL_TABLE *Table,
|
|
|
|
PVOID FirstStruct,
|
|
|
|
PVOID SecondStruct
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef RTL_GENERIC_COMPARE_RESULTS
|
|
|
|
(NTAPI *PRTL_GENERIC_COMPARE_ROUTINE) (
|
|
|
|
struct _RTL_GENERIC_TABLE *Table,
|
|
|
|
PVOID FirstStruct,
|
|
|
|
PVOID SecondStruct
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef PVOID
|
|
|
|
(NTAPI *PRTL_GENERIC_ALLOCATE_ROUTINE) (
|
|
|
|
struct _RTL_GENERIC_TABLE *Table,
|
2005-09-05 07:51:15 +00:00
|
|
|
CLONG ByteSize
|
2005-08-17 07:06:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *PRTL_GENERIC_FREE_ROUTINE) (
|
|
|
|
struct _RTL_GENERIC_TABLE *Table,
|
|
|
|
PVOID Buffer
|
|
|
|
);
|
|
|
|
|
2005-09-05 07:51:15 +00:00
|
|
|
typedef PVOID
|
2005-08-17 07:06:59 +00:00
|
|
|
(NTAPI *PRTL_AVL_ALLOCATE_ROUTINE) (
|
|
|
|
struct _RTL_AVL_TABLE *Table,
|
2005-09-05 07:51:15 +00:00
|
|
|
CLONG ByteSize
|
2005-08-17 07:06:59 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
typedef VOID
|
|
|
|
(NTAPI *PRTL_AVL_FREE_ROUTINE) (
|
|
|
|
struct _RTL_AVL_TABLE *Table,
|
|
|
|
PVOID Buffer
|
|
|
|
);
|
2006-10-20 13:19:13 +00:00
|
|
|
#endif
|
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)(
|
|
|
|
IN PWSTR ValueName,
|
|
|
|
IN ULONG ValueType,
|
|
|
|
IN PVOID ValueData,
|
|
|
|
IN ULONG ValueLength,
|
|
|
|
IN PVOID Context,
|
|
|
|
IN PVOID EntryContext
|
|
|
|
);
|
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)(
|
|
|
|
IN PVOID Address,
|
|
|
|
IN SIZE_T Length
|
|
|
|
);
|
|
|
|
#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)(
|
|
|
|
IN PVOID Base,
|
|
|
|
IN OUT PVOID *CommitAddress,
|
|
|
|
IN OUT PSIZE_T CommitSize
|
|
|
|
);
|
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
|
|
|
|
//
|
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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
} RTL_ACTIVATION_CONTEXT_STACK_FRAME,
|
|
|
|
*PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
|
|
|
|
|
|
|
|
typedef struct _RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED
|
|
|
|
{
|
|
|
|
ULONG Size;
|
|
|
|
ULONG Format;
|
|
|
|
RTL_ACTIVATION_CONTEXT_STACK_FRAME Frame;
|
|
|
|
PVOID Extra1;
|
|
|
|
PVOID Extra2;
|
|
|
|
PVOID Extra3;
|
|
|
|
PVOID Extra4;
|
|
|
|
} RTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED,
|
|
|
|
*PRTL_CALLER_ALLOCATED_ACTIVATION_CONTEXT_STACK_FRAME_EXTENDED;
|
|
|
|
|
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;
|
|
|
|
} 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
|
|
|
|
2005-11-28 21:40:21 +00:00
|
|
|
#endif
|
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
|
|
|
|
{
|
|
|
|
ULONG NumberOfAllocations;
|
|
|
|
ULONG NumberOfFrees;
|
|
|
|
ULONG BytesAllocated;
|
|
|
|
} RTL_HEAP_TAG_INFO, *PRTL_HEAP_TAG_INFO;
|
|
|
|
|
|
|
|
typedef struct _RTL_HEAP_USAGE_ENTRY
|
|
|
|
{
|
|
|
|
struct _RTL_HEAP_USAGE_ENTRY *Next;
|
|
|
|
} RTL_HEAP_USAGE_ENTRY, *PRTL_HEAP_USAGE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _RTL_HEAP_USAGE
|
|
|
|
{
|
|
|
|
ULONG Length;
|
|
|
|
ULONG BytesAllocated;
|
|
|
|
ULONG BytesCommitted;
|
|
|
|
ULONG BytesReserved;
|
|
|
|
ULONG BytesReservedMaximum;
|
|
|
|
PRTL_HEAP_USAGE_ENTRY Entries;
|
|
|
|
PRTL_HEAP_USAGE_ENTRY AddedEntries;
|
|
|
|
PRTL_HEAP_USAGE_ENTRY RemovedEntries;
|
|
|
|
UCHAR Reserved[32];
|
|
|
|
} RTL_HEAP_USAGE, *PRTL_HEAP_USAGE;
|
|
|
|
|
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;
|
|
|
|
ULONG BytesAllocated;
|
|
|
|
ULONG BytesCommitted;
|
|
|
|
ULONG NumberOfTags;
|
|
|
|
ULONG NumberOfEntries;
|
|
|
|
ULONG NumberOfPseudoTags;
|
|
|
|
ULONG PseudoTagGranularity;
|
|
|
|
ULONG Reserved[4];
|
2005-06-21 02:08:42 +00:00
|
|
|
PVOID Tags;
|
2006-05-10 17:47:44 +00:00
|
|
|
PVOID Entries;
|
|
|
|
} 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;
|
|
|
|
|
2005-06-26 01:08:55 +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
|
|
|
|
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;
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
#endif
|
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
|
|
|
|
//
|
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;
|
2005-11-20 17:16:11 +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;
|
|
|
|
RTL_DRIVE_LETTER_CURDIR CurrentDirectories[32];
|
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;
|
2005-06-18 23:33:40 +00:00
|
|
|
#endif
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
#endif
|