mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 16:27:00 +00:00
- Update the NDK to the current vendor import.
svn path=/trunk/; revision=22550
This commit is contained in:
parent
4de9cf5a44
commit
b3653a9abd
13 changed files with 314 additions and 88 deletions
|
@ -340,8 +340,8 @@ NTAPI
|
||||||
NtQuerySystemInformation(
|
NtQuerySystemInformation(
|
||||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
OUT PVOID SystemInformation,
|
OUT PVOID SystemInformation,
|
||||||
IN ULONG Length,
|
IN SIZE_T Length,
|
||||||
OUT PULONG ResultLength
|
OUT PSIZE_T ResultLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSCALLAPI
|
NTSYSCALLAPI
|
||||||
|
@ -481,7 +481,7 @@ NTAPI
|
||||||
NtSetSystemInformation(
|
NtSetSystemInformation(
|
||||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
IN PVOID SystemInformation,
|
IN PVOID SystemInformation,
|
||||||
IN ULONG SystemInformationLength
|
IN SIZE_T SystemInformationLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSCALLAPI
|
NTSYSCALLAPI
|
||||||
|
@ -784,8 +784,8 @@ NTAPI
|
||||||
ZwQuerySystemInformation(
|
ZwQuerySystemInformation(
|
||||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
OUT PVOID SystemInformation,
|
OUT PVOID SystemInformation,
|
||||||
IN ULONG Length,
|
IN SIZE_T Length,
|
||||||
OUT PULONG ResultLength
|
OUT PSIZE_T ResultLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
|
@ -908,7 +908,7 @@ NTAPI
|
||||||
ZwSetSystemInformation(
|
ZwSetSystemInformation(
|
||||||
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||||
IN PVOID SystemInformation,
|
IN PVOID SystemInformation,
|
||||||
IN ULONG SystemInformationLength
|
IN SIZE_T SystemInformationLength
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef NTOS_MODE_USER
|
#ifdef NTOS_MODE_USER
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION
|
||||||
} SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
|
} SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION;
|
||||||
|
|
||||||
// Class 44
|
// Class 44
|
||||||
typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
|
//typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION;
|
||||||
|
|
||||||
// Class 45
|
// Class 45
|
||||||
typedef struct _SYSTEM_LOOKASIDE_INFORMATION
|
typedef struct _SYSTEM_LOOKASIDE_INFORMATION
|
||||||
|
|
|
@ -31,8 +31,8 @@ Author:
|
||||||
// The DDK steals these away from you.
|
// The DDK steals these away from you.
|
||||||
//
|
//
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma intrinsic(_enable)
|
//#pragma intrinsic(_enable)
|
||||||
#pragma intrinsic(_disable)
|
//#pragma intrinsic(_disable)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -129,9 +129,9 @@ NTHALAPI
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
HalGetEnvironmentVariable(
|
HalGetEnvironmentVariable(
|
||||||
PCH Name,
|
PCH Variable,
|
||||||
PCH Value,
|
USHORT Length,
|
||||||
USHORT ValueLength
|
PCH Buffer
|
||||||
);
|
);
|
||||||
|
|
||||||
NTHALAPI
|
NTHALAPI
|
||||||
|
@ -159,7 +159,7 @@ NTHALAPI
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
HalHandleNMI(
|
HalHandleNMI(
|
||||||
ULONG Unknown
|
PVOID NmiInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -192,7 +192,7 @@ HalSetEnvironmentVariable(
|
||||||
// Time Functions
|
// Time Functions
|
||||||
//
|
//
|
||||||
NTHALAPI
|
NTHALAPI
|
||||||
VOID
|
BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
HalQueryRealTimeClock(
|
HalQueryRealTimeClock(
|
||||||
IN PTIME_FIELDS RtcTime
|
IN PTIME_FIELDS RtcTime
|
||||||
|
|
|
@ -23,6 +23,13 @@ Author:
|
||||||
// Dependencies
|
// Dependencies
|
||||||
//
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
// Machine Types
|
||||||
|
//
|
||||||
|
#define MACHINE_TYPE_ISA 0x0000
|
||||||
|
#define MACHINE_TYPE_EISA 0x0001
|
||||||
|
#define MACHINE_TYPE_MCA 0x0002
|
||||||
|
|
||||||
//
|
//
|
||||||
// X86 80386 Segment Types
|
// X86 80386 Segment Types
|
||||||
//
|
//
|
||||||
|
@ -38,16 +45,16 @@ Author:
|
||||||
//
|
//
|
||||||
#define RPL_MASK 0x0003
|
#define RPL_MASK 0x0003
|
||||||
#define MODE_MASK 0x0001
|
#define MODE_MASK 0x0001
|
||||||
#define KGDT_R0_CODE (0x8)
|
#define KGDT_R0_CODE 0x8
|
||||||
#define KGDT_R0_DATA (0x10)
|
#define KGDT_R0_DATA 0x10
|
||||||
#define KGDT_R3_CODE (0x18)
|
#define KGDT_R3_CODE 0x18
|
||||||
#define KGDT_R3_DATA (0x20)
|
#define KGDT_R3_DATA 0x20
|
||||||
#define KGDT_TSS (0x28)
|
#define KGDT_TSS 0x28
|
||||||
#define KGDT_R0_PCR (0x30)
|
#define KGDT_R0_PCR 0x30
|
||||||
#define KGDT_R3_TEB (0x38)
|
#define KGDT_R3_TEB 0x38
|
||||||
#define KGDT_LDT (0x48)
|
#define KGDT_LDT 0x48
|
||||||
#define KGDT_DF_TSS (0x50)
|
#define KGDT_DF_TSS 0x50
|
||||||
#define KGDT_NMI_TSS (0x58)
|
#define KGDT_NMI_TSS 0x58
|
||||||
|
|
||||||
//
|
//
|
||||||
// CR4
|
// CR4
|
||||||
|
@ -66,9 +73,12 @@ Author:
|
||||||
//
|
//
|
||||||
// EFlags
|
// EFlags
|
||||||
//
|
//
|
||||||
#define EFLAGS_TF 0x100
|
#define EFLAGS_CF 0x01L
|
||||||
#define EFLAGS_INTERRUPT_MASK 0x200
|
#define EFLAGS_ZF 0x40L
|
||||||
#define EFLAGS_NESTED_TASK 0x4000
|
#define EFLAGS_TF 0x100L
|
||||||
|
#define EFLAGS_INTERRUPT_MASK 0x200L
|
||||||
|
#define EFLAGS_DF 0x400L
|
||||||
|
#define EFLAGS_NESTED_TASK 0x4000L
|
||||||
#define EFLAGS_V86_MASK 0x20000
|
#define EFLAGS_V86_MASK 0x20000
|
||||||
#define EFLAGS_ALIGN_CHECK 0x40000
|
#define EFLAGS_ALIGN_CHECK 0x40000
|
||||||
#define EFLAGS_VIF 0x80000
|
#define EFLAGS_VIF 0x80000
|
||||||
|
@ -76,7 +86,6 @@ Author:
|
||||||
#define EFLAG_SIGN 0x8000
|
#define EFLAG_SIGN 0x8000
|
||||||
#define EFLAG_ZERO 0x4000
|
#define EFLAG_ZERO 0x4000
|
||||||
|
|
||||||
#ifndef NTOS_MODE_USER
|
|
||||||
//
|
//
|
||||||
// IPI Types
|
// IPI Types
|
||||||
//
|
//
|
||||||
|
@ -87,48 +96,17 @@ Author:
|
||||||
#define IPI_SYNCH_REQUEST 16
|
#define IPI_SYNCH_REQUEST 16
|
||||||
|
|
||||||
//
|
//
|
||||||
// FN/FX (FPU) Save Area Structures
|
// Static Kernel-Mode Address start (use MM_KSEG0_BASE for actual)
|
||||||
//
|
//
|
||||||
typedef struct _FNSAVE_FORMAT
|
#define KSEG0_BASE 0x80000000
|
||||||
{
|
|
||||||
ULONG ControlWord;
|
|
||||||
ULONG StatusWord;
|
|
||||||
ULONG TagWord;
|
|
||||||
ULONG ErrorOffset;
|
|
||||||
ULONG ErrorSelector;
|
|
||||||
ULONG DataOffset;
|
|
||||||
ULONG DataSelector;
|
|
||||||
UCHAR RegisterArea[80];
|
|
||||||
} FNSAVE_FORMAT, *PFNSAVE_FORMAT;
|
|
||||||
|
|
||||||
typedef struct _FXSAVE_FORMAT
|
//
|
||||||
{
|
// Macro to get current KPRCB
|
||||||
USHORT ControlWord;
|
//
|
||||||
USHORT StatusWord;
|
#ifndef _REACTOS_ // fixme
|
||||||
USHORT TagWord;
|
#define KeGetCurrentPrcb() \
|
||||||
USHORT ErrorOpcode;
|
(PKPRCB)__readfsdword(KPCR_PRCB);
|
||||||
ULONG ErrorOffset;
|
#endif
|
||||||
ULONG ErrorSelector;
|
|
||||||
ULONG DataOffset;
|
|
||||||
ULONG DataSelector;
|
|
||||||
ULONG MXCsr;
|
|
||||||
ULONG MXCsrMask;
|
|
||||||
UCHAR RegisterArea[128];
|
|
||||||
UCHAR Reserved3[128];
|
|
||||||
UCHAR Reserved4[224];
|
|
||||||
UCHAR Align16Byte[8];
|
|
||||||
} FXSAVE_FORMAT, *PFXSAVE_FORMAT;
|
|
||||||
|
|
||||||
typedef struct _FX_SAVE_AREA
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
FNSAVE_FORMAT FnArea;
|
|
||||||
FXSAVE_FORMAT FxArea;
|
|
||||||
} U;
|
|
||||||
ULONG NpxSavedCpu;
|
|
||||||
ULONG Cr0NpxState;
|
|
||||||
} FX_SAVE_AREA, *PFX_SAVE_AREA;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Trap Frame Definition
|
// Trap Frame Definition
|
||||||
|
@ -154,7 +132,7 @@ typedef struct _KTRAP_FRAME
|
||||||
ULONG Ecx;
|
ULONG Ecx;
|
||||||
ULONG Eax;
|
ULONG Eax;
|
||||||
ULONG PreviousPreviousMode;
|
ULONG PreviousPreviousMode;
|
||||||
struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
|
struct _EXCEPTION_REGISTRATION_RECORD FAR *ExceptionList;
|
||||||
ULONG SegFs;
|
ULONG SegFs;
|
||||||
ULONG Edi;
|
ULONG Edi;
|
||||||
ULONG Esi;
|
ULONG Esi;
|
||||||
|
@ -175,6 +153,8 @@ typedef struct _KTRAP_FRAME
|
||||||
//
|
//
|
||||||
// LDT Entry Definition
|
// LDT Entry Definition
|
||||||
//
|
//
|
||||||
|
#ifndef _LDT_ENTRY_DEFINED
|
||||||
|
#define _LDT_ENTRY_DEFINED
|
||||||
typedef struct _LDT_ENTRY
|
typedef struct _LDT_ENTRY
|
||||||
{
|
{
|
||||||
USHORT LimitLow;
|
USHORT LimitLow;
|
||||||
|
@ -203,6 +183,7 @@ typedef struct _LDT_ENTRY
|
||||||
} Bits;
|
} Bits;
|
||||||
} HighWord;
|
} HighWord;
|
||||||
} LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
|
} LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// GDT Entry Definition
|
// GDT Entry Definition
|
||||||
|
@ -266,12 +247,60 @@ typedef struct _KIDTENTRY
|
||||||
USHORT ExtendedOffset;
|
USHORT ExtendedOffset;
|
||||||
} KIDTENTRY, *PKIDTENTRY;
|
} KIDTENTRY, *PKIDTENTRY;
|
||||||
|
|
||||||
|
#include <pshpack2.h>
|
||||||
typedef struct _DESCRIPTOR
|
typedef struct _DESCRIPTOR
|
||||||
{
|
{
|
||||||
USHORT Pad;
|
|
||||||
USHORT Limit;
|
USHORT Limit;
|
||||||
ULONG Base;
|
ULONG Base;
|
||||||
|
USHORT Padding;
|
||||||
} KDESCRIPTOR, *PKDESCRIPTOR;
|
} KDESCRIPTOR, *PKDESCRIPTOR;
|
||||||
|
#include <poppack.h>
|
||||||
|
|
||||||
|
#ifndef NTOS_MODE_USER
|
||||||
|
|
||||||
|
//
|
||||||
|
// FN/FX (FPU) Save Area Structures
|
||||||
|
//
|
||||||
|
typedef struct _FNSAVE_FORMAT
|
||||||
|
{
|
||||||
|
ULONG ControlWord;
|
||||||
|
ULONG StatusWord;
|
||||||
|
ULONG TagWord;
|
||||||
|
ULONG ErrorOffset;
|
||||||
|
ULONG ErrorSelector;
|
||||||
|
ULONG DataOffset;
|
||||||
|
ULONG DataSelector;
|
||||||
|
UCHAR RegisterArea[80];
|
||||||
|
} FNSAVE_FORMAT, *PFNSAVE_FORMAT;
|
||||||
|
|
||||||
|
typedef struct _FXSAVE_FORMAT
|
||||||
|
{
|
||||||
|
USHORT ControlWord;
|
||||||
|
USHORT StatusWord;
|
||||||
|
USHORT TagWord;
|
||||||
|
USHORT ErrorOpcode;
|
||||||
|
ULONG ErrorOffset;
|
||||||
|
ULONG ErrorSelector;
|
||||||
|
ULONG DataOffset;
|
||||||
|
ULONG DataSelector;
|
||||||
|
ULONG MXCsr;
|
||||||
|
ULONG MXCsrMask;
|
||||||
|
UCHAR RegisterArea[128];
|
||||||
|
UCHAR Reserved3[128];
|
||||||
|
UCHAR Reserved4[224];
|
||||||
|
UCHAR Align16Byte[8];
|
||||||
|
} FXSAVE_FORMAT, *PFXSAVE_FORMAT;
|
||||||
|
|
||||||
|
typedef struct _FX_SAVE_AREA
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
FNSAVE_FORMAT FnArea;
|
||||||
|
FXSAVE_FORMAT FxArea;
|
||||||
|
} U;
|
||||||
|
ULONG NpxSavedCpu;
|
||||||
|
ULONG Cr0NpxState;
|
||||||
|
} FX_SAVE_AREA, *PFX_SAVE_AREA;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Special Registers Structure (outside of CONTEXT)
|
// Special Registers Structure (outside of CONTEXT)
|
||||||
|
@ -329,6 +358,7 @@ typedef struct _KPRCB
|
||||||
ULONG CFlushSize;
|
ULONG CFlushSize;
|
||||||
UCHAR PrcbPad0[88];
|
UCHAR PrcbPad0[88];
|
||||||
#else
|
#else
|
||||||
|
ULONG CFlushSize;
|
||||||
UCHAR PrcbPad0[92];
|
UCHAR PrcbPad0[92];
|
||||||
#endif
|
#endif
|
||||||
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock];
|
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock];
|
||||||
|
|
|
@ -28,6 +28,24 @@ Author:
|
||||||
//
|
//
|
||||||
#define PAGE_SIZE 0x1000
|
#define PAGE_SIZE 0x1000
|
||||||
#define PAGE_SHIFT 12L
|
#define PAGE_SHIFT 12L
|
||||||
|
#define MM_ALLOCATION_GRANULARITY 0x10000
|
||||||
|
#define MM_ALLOCATION_GRANULARITY_SHIFT 16L
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sanity checks for Paging Macros
|
||||||
|
//
|
||||||
|
#ifndef __GNUC__
|
||||||
|
C_ASSERT(PAGE_SIZE == (1 << PAGE_SHIFT));
|
||||||
|
C_ASSERT(MM_ALLOCATION_GRANULARITY == (1 << MM_ALLOCATION_GRANULARITY_SHIFT));
|
||||||
|
C_ASSERT(MM_ALLOCATION_GRANULARITY &&
|
||||||
|
!(MM_ALLOCATION_GRANULARITY & (MM_ALLOCATION_GRANULARITY - 1)));
|
||||||
|
C_ASSERT(MM_ALLOCATION_GRANULARITY >= PAGE_SIZE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// PAE SEG0 Base?
|
||||||
|
//
|
||||||
|
#define KSEG0_BASE_PAE 0xE0000000
|
||||||
|
|
||||||
//
|
//
|
||||||
// Page Table Entry Definitions
|
// Page Table Entry Definitions
|
||||||
|
|
|
@ -180,8 +180,8 @@ NtQuerySection(
|
||||||
IN HANDLE SectionHandle,
|
IN HANDLE SectionHandle,
|
||||||
IN SECTION_INFORMATION_CLASS SectionInformationClass,
|
IN SECTION_INFORMATION_CLASS SectionInformationClass,
|
||||||
OUT PVOID SectionInformation,
|
OUT PVOID SectionInformation,
|
||||||
IN ULONG Length,
|
IN SIZE_T Length,
|
||||||
OUT PULONG ResultLength
|
OUT PSIZE_T ResultLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSCALLAPI
|
NTSYSCALLAPI
|
||||||
|
@ -192,8 +192,8 @@ NtQueryVirtualMemory(
|
||||||
IN PVOID Address,
|
IN PVOID Address,
|
||||||
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
||||||
OUT PVOID VirtualMemoryInformation,
|
OUT PVOID VirtualMemoryInformation,
|
||||||
IN ULONG Length,
|
IN SIZE_T Length,
|
||||||
OUT PULONG ResultLength
|
OUT PSIZE_T ResultLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSCALLAPI
|
NTSYSCALLAPI
|
||||||
|
@ -350,8 +350,8 @@ ZwQuerySection(
|
||||||
IN HANDLE SectionHandle,
|
IN HANDLE SectionHandle,
|
||||||
IN SECTION_INFORMATION_CLASS SectionInformationClass,
|
IN SECTION_INFORMATION_CLASS SectionInformationClass,
|
||||||
OUT PVOID SectionInformation,
|
OUT PVOID SectionInformation,
|
||||||
IN ULONG Length,
|
IN SIZE_T Length,
|
||||||
OUT PULONG ResultLength
|
OUT PSIZE_T ResultLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
|
@ -362,8 +362,8 @@ ZwQueryVirtualMemory(
|
||||||
IN PVOID Address,
|
IN PVOID Address,
|
||||||
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass,
|
||||||
OUT PVOID VirtualMemoryInformation,
|
OUT PVOID VirtualMemoryInformation,
|
||||||
IN ULONG Length,
|
IN SIZE_T Length,
|
||||||
OUT PULONG ResultLength
|
OUT PSIZE_T ResultLength
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
|
|
|
@ -31,6 +31,11 @@ Author:
|
||||||
#define PAGE_ROUND_DOWN(x) (((ULONG_PTR)x)&(~(PAGE_SIZE-1)))
|
#define PAGE_ROUND_DOWN(x) (((ULONG_PTR)x)&(~(PAGE_SIZE-1)))
|
||||||
#define PAGE_ROUND_UP(x) \
|
#define PAGE_ROUND_UP(x) \
|
||||||
( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
|
( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
#define ROUND_TO_PAGES(Size) (((ULONG_PTR)(Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
|
||||||
|
#endif
|
||||||
|
#define ROUND_TO_ALLOCATION_GRANULARITY(Size) (((ULONG_PTR)(Size) + MM_ALLOCATION_GRANULARITY - 1) \
|
||||||
|
& ~(MM_ALLOCATION_GRANULARITY - 1))
|
||||||
|
|
||||||
//
|
//
|
||||||
// Macro for generating pool tags
|
// Macro for generating pool tags
|
||||||
|
@ -578,6 +583,24 @@ typedef struct _MEMORY_BASIC_INFORMATION
|
||||||
ULONG Type;
|
ULONG Type;
|
||||||
} MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
|
} MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Mm Global Variables
|
||||||
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
// Default heap size values. For user mode, these values are copied to a new
|
||||||
|
// process's PEB by the kernel in MmCreatePeb. In kernel mode, RtlCreateHeap
|
||||||
|
// reads these variables directly.
|
||||||
|
//
|
||||||
|
// These variables should be considered "const"; they are written only once,
|
||||||
|
// during MmInitSystem.
|
||||||
|
//
|
||||||
|
extern SIZE_T MmHeapSegmentReserve;
|
||||||
|
extern SIZE_T MmHeapSegmentCommit;
|
||||||
|
extern SIZE_T MmHeapDeCommitTotalFreeThreshold;
|
||||||
|
extern SIZE_T MmHeapDeCommitFreeBlockThreshold;
|
||||||
|
|
||||||
#endif // !NTOS_MODE_USER
|
#endif // !NTOS_MODE_USER
|
||||||
|
|
||||||
#endif // _MMTYPES_H
|
#endif // _MMTYPES_H
|
||||||
|
|
|
@ -34,6 +34,8 @@ Author:
|
||||||
//
|
//
|
||||||
// Headers needed for NDK
|
// Headers needed for NDK
|
||||||
//
|
//
|
||||||
|
#include <stdio.h> // C Standard Header
|
||||||
|
#include <excpt.h> // C Standard Header
|
||||||
#include <stdarg.h> // C Standard Header
|
#include <stdarg.h> // C Standard Header
|
||||||
#include <umtypes.h> // General Definitions
|
#include <umtypes.h> // General Definitions
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,19 @@ PsGetThreadWin32Thread(
|
||||||
PETHREAD Thread
|
PETHREAD Thread
|
||||||
);
|
);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
PsGetThreadHardErrorsAreDisabled(
|
||||||
|
PETHREAD Thread
|
||||||
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
NTAPI
|
||||||
|
PsSetThreadHardErrorsAreDisabled(
|
||||||
|
PETHREAD Thread,
|
||||||
|
IN BOOLEAN Disabled
|
||||||
|
);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
PsEstablishWin32Callouts(
|
PsEstablishWin32Callouts(
|
||||||
|
|
|
@ -212,6 +212,11 @@ RtlConvertUlongToLuid(ULONG Ulong)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// This macro does nothing in kernel mode
|
||||||
|
//
|
||||||
|
#define RTL_PAGED_CODE NOP_FUNCTION
|
||||||
|
|
||||||
//
|
//
|
||||||
// RTL Splay Tree Functions
|
// RTL Splay Tree Functions
|
||||||
//
|
//
|
||||||
|
@ -301,6 +306,16 @@ RtlRealPredecessor(PRTL_SPLAY_LINKS Links);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NTOS_KERNEL_RUNTIME
|
||||||
|
|
||||||
|
//
|
||||||
|
// Executing RTL functions at DISPATCH_LEVEL or higher will result in a
|
||||||
|
// bugcheck.
|
||||||
|
//
|
||||||
|
#define RTL_PAGED_CODE PAGED_CODE
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Error and Exception Functions
|
// Error and Exception Functions
|
||||||
//
|
//
|
||||||
|
@ -441,6 +456,18 @@ RtlCompactHeap(
|
||||||
ULONG flags
|
ULONG flags
|
||||||
);
|
);
|
||||||
|
|
||||||
|
NTSYSAPI
|
||||||
|
PVOID
|
||||||
|
NTAPI
|
||||||
|
RtlDebugCreateHeap(
|
||||||
|
IN ULONG Flags,
|
||||||
|
IN PVOID BaseAddress OPTIONAL,
|
||||||
|
IN SIZE_T SizeToReserve OPTIONAL,
|
||||||
|
IN SIZE_T SizeToCommit OPTIONAL,
|
||||||
|
IN PVOID Lock OPTIONAL,
|
||||||
|
IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
HANDLE
|
HANDLE
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -456,6 +483,12 @@ RtlFreeHeap(
|
||||||
);
|
);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
|
ULONG
|
||||||
|
NTAPI
|
||||||
|
RtlGetNtGlobalFlags(
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
ULONG
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlGetProcessHeaps(
|
RtlGetProcessHeaps(
|
||||||
|
@ -2677,7 +2710,7 @@ NTSYSAPI
|
||||||
ULONG
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlComputeCrc32(
|
RtlComputeCrc32(
|
||||||
IN UINT PartialCrc,
|
IN USHORT PartialCrc,
|
||||||
IN PUCHAR Buffer,
|
IN PUCHAR Buffer,
|
||||||
IN ULONG Length
|
IN ULONG Length
|
||||||
);
|
);
|
||||||
|
@ -2737,11 +2770,10 @@ RtlIpv6StringToAddressExW(
|
||||||
//
|
//
|
||||||
// Time Functions
|
// Time Functions
|
||||||
//
|
//
|
||||||
struct _RTL_TIME_ZONE_INFORMATION;
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlQueryTimeZoneInformation(LPTIME_ZONE_INFORMATION TimeZoneInformation);
|
RtlQueryTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
VOID
|
VOID
|
||||||
|
@ -2754,7 +2786,7 @@ RtlSecondsSince1970ToTime(
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlSetTimeZoneInformation(LPTIME_ZONE_INFORMATION TimeZoneInformation);
|
RtlSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation);
|
||||||
|
|
||||||
NTSYSAPI
|
NTSYSAPI
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
|
@ -2802,6 +2834,25 @@ BOOLEAN
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlGetNtProductType(OUT PNT_PRODUCT_TYPE ProductType);
|
RtlGetNtProductType(OUT PNT_PRODUCT_TYPE ProductType);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Secure Memory Functions
|
||||||
|
//
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
NTSYSAPI
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
RtlRegisterSecureMemoryCacheCallback(
|
||||||
|
IN PRTL_SECURE_MEMORY_CACHE_CALLBACK Callback);
|
||||||
|
|
||||||
|
NTSYSAPI
|
||||||
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
RtlFlushSecureMemoryCache(
|
||||||
|
IN PVOID MemoryCache,
|
||||||
|
IN OPTIONAL SIZE_T MemoryLength
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -74,8 +74,30 @@ Author:
|
||||||
0x1
|
0x1
|
||||||
|
|
||||||
//
|
//
|
||||||
// Heap Flags
|
// 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
|
||||||
|
//
|
||||||
|
#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
|
||||||
#define HEAP_CLASS_0 0x00000000
|
#define HEAP_CLASS_0 0x00000000
|
||||||
#define HEAP_CLASS_1 0x00001000
|
#define HEAP_CLASS_1 0x00001000
|
||||||
#define HEAP_CLASS_2 0x00002000
|
#define HEAP_CLASS_2 0x00002000
|
||||||
|
@ -87,6 +109,39 @@ Author:
|
||||||
#define HEAP_CLASS_8 0x00008000
|
#define HEAP_CLASS_8 0x00008000
|
||||||
#define HEAP_CLASS_MASK 0x0000F000
|
#define HEAP_CLASS_MASK 0x0000F000
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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)
|
||||||
|
#ifndef __GNUC__
|
||||||
|
C_ASSERT(HEAP_CREATE_VALID_MASK == 0x0007F0FF);
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Registry Keys
|
// Registry Keys
|
||||||
//
|
//
|
||||||
|
@ -461,6 +516,17 @@ typedef NTSTATUS
|
||||||
IN PVOID EntryContext
|
IN PVOID EntryContext
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// RTL Secure Memory callbacks
|
||||||
|
//
|
||||||
|
#ifdef NTOS_MODE_USER
|
||||||
|
typedef NTSTATUS
|
||||||
|
(NTAPI *PRTL_SECURE_MEMORY_CACHE_CALLBACK)(
|
||||||
|
IN PVOID Address,
|
||||||
|
IN SIZE_T Length
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// RTL Range List callbacks
|
// RTL Range List callbacks
|
||||||
//
|
//
|
||||||
|
@ -497,6 +563,7 @@ typedef ACL_SIZE_INFORMATION *PACL_SIZE_INFORMATION;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Parameters for RtlCreateHeap
|
// Parameters for RtlCreateHeap
|
||||||
|
// FIXME: Determine whether Length is SIZE_T or ULONG
|
||||||
//
|
//
|
||||||
typedef struct _RTL_HEAP_PARAMETERS
|
typedef struct _RTL_HEAP_PARAMETERS
|
||||||
{
|
{
|
||||||
|
@ -1064,8 +1131,7 @@ typedef struct _RTL_ATOM_TABLE
|
||||||
PRTL_ATOM_TABLE_ENTRY Buckets[1];
|
PRTL_ATOM_TABLE_ENTRY Buckets[1];
|
||||||
} RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
|
} RTL_ATOM_TABLE, *PRTL_ATOM_TABLE;
|
||||||
|
|
||||||
#ifndef NTOS_MODE_USER
|
#ifndef _WINBASE_
|
||||||
|
|
||||||
//
|
//
|
||||||
// System Time and Timezone Structures
|
// System Time and Timezone Structures
|
||||||
//
|
//
|
||||||
|
@ -1091,9 +1157,13 @@ typedef struct _TIME_ZONE_INFORMATION
|
||||||
SYSTEMTIME DaylightDate;
|
SYSTEMTIME DaylightDate;
|
||||||
LONG DaylightBias;
|
LONG DaylightBias;
|
||||||
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
|
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// Native version of Timezone Structure
|
||||||
|
//
|
||||||
|
typedef LPTIME_ZONE_INFORMATION PRTL_TIME_ZONE_INFORMATION;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Hotpatch Header
|
// Hotpatch Header
|
||||||
//
|
//
|
||||||
|
|
|
@ -19,15 +19,34 @@ Author:
|
||||||
#if !defined(_NTDEF_) && !defined(_NTDEF_H)
|
#if !defined(_NTDEF_) && !defined(_NTDEF_H)
|
||||||
#define _NTDEF_
|
#define _NTDEF_
|
||||||
#define _NTDEF_H
|
#define _NTDEF_H
|
||||||
#undef WIN32_NO_STATUS
|
|
||||||
|
//
|
||||||
|
// NDK Applications must use Unicode
|
||||||
|
//
|
||||||
|
#ifndef UNICODE
|
||||||
|
#define UNICODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// Don't use the SDK status values
|
||||||
|
//
|
||||||
|
#ifndef WIN32_NO_STATUS
|
||||||
|
#define WIN32_NO_STATUS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// Let the NDK know we're in Application Mode
|
||||||
|
//
|
||||||
#define NTOS_MODE_USER
|
#define NTOS_MODE_USER
|
||||||
|
|
||||||
//
|
//
|
||||||
// Dependencies
|
// Dependencies
|
||||||
//
|
//
|
||||||
|
#include <windef.h>
|
||||||
|
#undef WIN32_NO_STATUS
|
||||||
|
#include <ntstatus.h>
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#include <ntnls.h>
|
#include <ntnls.h>
|
||||||
#include <ntstatus.h>
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Compiler Definitions
|
// Compiler Definitions
|
||||||
|
|
Loading…
Reference in a new issue