Author: akhaldi
Date: Thu Mar 11 18:27:44 2010
New Revision: 46100
URL:
http://svn.reactos.org/svn/reactos?rev=46100&view=rev
Log:
[NTDDK]
- Continue moving ntddk related definitions from winddk.h, fixing the conflicts caused by
r46097
- pKdUnmapVirtualAddress and pKdMapPhysicalMemory64 : Add missing FlushCurrentTLB
- Update HAL_DISPATCH and HalDispatchTable definitions
- DDKAPI -> NTAPI
- IMAGE_INFO : Add missing ExtendedInfoPresent
- Update (X86) KPCR definition
Modified:
branches/header-work/include/ddk/ntddk.h
branches/header-work/include/ddk/winddk.h
Modified: branches/header-work/include/ddk/ntddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/ntddk.h…
==============================================================================
--- branches/header-work/include/ddk/ntddk.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/ntddk.h [iso-8859-1] Thu Mar 11 18:27:44 2010
@@ -69,10 +69,6 @@
typedef GUID UUID;
typedef struct _BUS_HANDLER *PBUS_HANDLER;
-
-#define KERNEL_STACK_SIZE 12288
-#define KERNEL_LARGE_STACK_SIZE 61440
-#define KERNEL_LARGE_STACK_COMMIT 12288
#define EXCEPTION_READ_FAULT 0
#define EXCEPTION_WRITE_FAULT 1
@@ -294,7 +290,7 @@
} ARBITER_LIST_ENTRY, *PARBITER_LIST_ENTRY;
typedef NTSTATUS
-(DDKAPI *PARBITER_HANDLER)(
+(NTAPI *PARBITER_HANDLER)(
IN OUT PVOID Context,
IN ARBITER_ACTION Action,
IN OUT PARBITER_PARAMETERS Parameters);
@@ -417,7 +413,7 @@
} RESOURCE_TRANSLATION_DIRECTION;
typedef NTSTATUS
-(DDKAPI *PTRANSLATE_RESOURCE_HANDLER)(
+(NTAPI *PTRANSLATE_RESOURCE_HANDLER)(
IN OUT PVOID Context,
IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source,
IN RESOURCE_TRANSLATION_DIRECTION Direction,
@@ -427,7 +423,7 @@
OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target);
typedef NTSTATUS
-(DDKAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)(
+(NTAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)(
IN PVOID Context OPTIONAL,
IN PIO_RESOURCE_DESCRIPTOR Source,
IN PDEVICE_OBJECT PhysicalDeviceObject,
@@ -483,42 +479,42 @@
IN PBUS_HANDLER BusHandler);
typedef NTSTATUS
-(DDKAPI *pHalQuerySystemInformation)(
+(NTAPI *pHalQuerySystemInformation)(
IN HAL_QUERY_INFORMATION_CLASS InformationClass,
IN ULONG BufferSize,
IN OUT PVOID Buffer,
OUT PULONG ReturnedLength);
typedef NTSTATUS
-(DDKAPI *pHalSetSystemInformation)(
+(NTAPI *pHalSetSystemInformation)(
IN HAL_SET_INFORMATION_CLASS InformationClass,
IN ULONG BufferSize,
IN PVOID Buffer);
typedef NTSTATUS
-(DDKAPI *pHalQueryBusSlots)(
+(NTAPI *pHalQueryBusSlots)(
IN PBUS_HANDLER BusHandler,
IN ULONG BufferSize,
OUT PULONG SlotNumbers,
OUT PULONG ReturnedLength);
typedef NTSTATUS
-(DDKAPI *pHalInitPnpDriver)(
+(NTAPI *pHalInitPnpDriver)(
VOID);
typedef NTSTATUS
-(DDKAPI *pHalInitPowerManagement)(
+(NTAPI *pHalInitPowerManagement)(
IN PPM_DISPATCH_TABLE PmDriverDispatchTable,
OUT PPM_DISPATCH_TABLE *PmHalDispatchTable);
typedef struct _DMA_ADAPTER*
-(DDKAPI *pHalGetDmaAdapter)(
+(NTAPI *pHalGetDmaAdapter)(
IN PVOID Context,
IN struct _DEVICE_DESCRIPTION *DeviceDescriptor,
OUT PULONG NumberOfMapRegisters);
typedef NTSTATUS
-(DDKAPI *pHalGetInterruptTranslator)(
+(NTAPI *pHalGetInterruptTranslator)(
IN INTERFACE_TYPE ParentInterfaceType,
IN ULONG ParentBusNumber,
IN INTERFACE_TYPE BridgeInterfaceType,
@@ -528,30 +524,30 @@
OUT PULONG BridgeBusNumber);
typedef NTSTATUS
-(DDKAPI *pHalStartMirroring)(
+(NTAPI *pHalStartMirroring)(
VOID);
typedef NTSTATUS
-(DDKAPI *pHalEndMirroring)(
+(NTAPI *pHalEndMirroring)(
IN ULONG PassNumber);
typedef NTSTATUS
-(DDKAPI *pHalMirrorPhysicalMemory)(
+(NTAPI *pHalMirrorPhysicalMemory)(
IN PHYSICAL_ADDRESS PhysicalAddress,
IN LARGE_INTEGER NumberOfBytes);
typedef NTSTATUS
-(DDKAPI *pHalMirrorVerify)(
+(NTAPI *pHalMirrorVerify)(
IN PHYSICAL_ADDRESS PhysicalAddress,
IN LARGE_INTEGER NumberOfBytes);
typedef VOID
-(DDKAPI *pHalEndOfBoot)(
+(NTAPI *pHalEndOfBoot)(
VOID);
typedef
BOOLEAN
-(DDKAPI *pHalTranslateBusAddress)(
+(NTAPI *pHalTranslateBusAddress)(
IN INTERFACE_TYPE InterfaceType,
IN ULONG BusNumber,
IN PHYSICAL_ADDRESS BusAddress,
@@ -560,7 +556,7 @@
typedef
NTSTATUS
-(DDKAPI *pHalAssignSlotResources)(
+(NTAPI *pHalAssignSlotResources)(
IN PUNICODE_STRING RegistryPath,
IN PUNICODE_STRING DriverClassName OPTIONAL,
IN PDRIVER_OBJECT DriverObject,
@@ -572,22 +568,22 @@
typedef
VOID
-(DDKAPI *pHalHaltSystem)(
+(NTAPI *pHalHaltSystem)(
VOID);
typedef
BOOLEAN
-(DDKAPI *pHalResetDisplay)(
+(NTAPI *pHalResetDisplay)(
VOID);
typedef
UCHAR
-(DDKAPI *pHalVectorToIDTEntry)(
+(NTAPI *pHalVectorToIDTEntry)(
ULONG Vector);
typedef
BOOLEAN
-(DDKAPI *pHalFindBusAddressTranslation)(
+(NTAPI *pHalFindBusAddressTranslation)(
IN PHYSICAL_ADDRESS BusAddress,
IN OUT PULONG AddressSpace,
OUT PPHYSICAL_ADDRESS TranslatedAddress,
@@ -596,582 +592,213 @@
typedef
NTSTATUS
-(DDKAPI *pKdSetupPciDeviceForDebugging)(
+(NTAPI *pKdSetupPciDeviceForDebugging)(
IN PVOID LoaderBlock OPTIONAL,
IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice);
typedef
NTSTATUS
-(DDKAPI *pKdReleasePciDeviceForDebugging)(
+(NTAPI *pKdReleasePciDeviceForDebugging)(
IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice);
typedef
PVOID
-(DDKAPI *pKdGetAcpiTablePhase0)(
+(NTAPI *pKdGetAcpiTablePhase0)(
IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
IN ULONG Signature);
typedef
VOID
-(DDKAPI *pKdCheckPowerButton)(
+(NTAPI *pKdCheckPowerButton)(
VOID);
-typedef struct _KUSER_SHARED_DATA
-{
- ULONG TickCountLowDeprecated;
- ULONG TickCountMultiplier;
- volatile KSYSTEM_TIME InterruptTime;
- volatile KSYSTEM_TIME SystemTime;
- volatile KSYSTEM_TIME TimeZoneBias;
- USHORT ImageNumberLow;
- USHORT ImageNumberHigh;
- WCHAR NtSystemRoot[260];
- ULONG MaxStackTraceDepth;
- ULONG CryptoExponent;
- ULONG TimeZoneId;
- ULONG LargePageMinimum;
- ULONG Reserved2[7];
- NT_PRODUCT_TYPE NtProductType;
- BOOLEAN ProductTypeIsValid;
- ULONG NtMajorVersion;
- ULONG NtMinorVersion;
- BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
- ULONG Reserved1;
- ULONG Reserved3;
- volatile ULONG TimeSlip;
- ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
- ULONG AltArchitecturePad[1];
- LARGE_INTEGER SystemExpirationDate;
- ULONG SuiteMask;
- BOOLEAN KdDebuggerEnabled;
-#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
- UCHAR NXSupportPolicy;
-#endif
- volatile ULONG ActiveConsoleId;
- volatile ULONG DismountCount;
- ULONG ComPlusPackage;
- ULONG LastSystemRITEventTickCount;
- ULONG NumberOfPhysicalPages;
- BOOLEAN SafeBootMode;
-#if (NTDDI_VERSION >= NTDDI_WIN7)
- union {
- UCHAR TscQpcData;
- struct {
- UCHAR TscQpcEnabled:1;
- UCHAR TscQpcSpareFlag:1;
- UCHAR TscQpcShift:6;
- } DUMMYSTRUCTNAME;
- } DUMMYUNIONNAME;
- UCHAR TscQpcPad[2];
-#endif
-#if (NTDDI_VERSION >= NTDDI_VISTA)
- union {
- ULONG SharedDataFlags;
- struct {
- ULONG DbgErrorPortPresent:1;
- ULONG DbgElevationEnabled:1;
- ULONG DbgVirtEnabled:1;
- ULONG DbgInstallerDetectEnabled:1;
- ULONG DbgSystemDllRelocated:1;
- ULONG DbgDynProcessorEnabled:1;
- ULONG DbgSEHValidationEnabled:1;
- ULONG SpareBits:25;
- } DUMMYSTRUCTNAME2;
- } DUMMYUNIONNAME2;
-#else
- ULONG TraceLogging;
-#endif
- ULONG DataFlagsPad[1];
- ULONGLONG TestRetInstruction;
- ULONG SystemCall;
- ULONG SystemCallReturn;
- ULONGLONG SystemCallPad[3];
- _ANONYMOUS_UNION union {
- volatile KSYSTEM_TIME TickCount;
- volatile ULONG64 TickCountQuad;
- _ANONYMOUS_STRUCT struct {
- ULONG ReservedTickCountOverlay[3];
- ULONG TickCountPad[1];
- } DUMMYSTRUCTNAME;
- } DUMMYUNIONNAME3;
- ULONG Cookie;
- ULONG CookiePad[1];
-#if (NTDDI_VERSION >= NTDDI_WS03)
- LONGLONG ConsoleSessionForegroundProcessId;
- ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
-#endif
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-#if (NTDDI_VERSION >= NTDDI_WIN7)
- USHORT UserModeGlobalLogger[16];
-#else
- USHORT UserModeGlobalLogger[8];
- ULONG HeapTracingPid[2];
- ULONG CritSecTracingPid[2];
-#endif
- ULONG ImageFileExecutionOptions;
-#if (NTDDI_VERSION >= NTDDI_VISTASP1)
- ULONG LangGenerationCount;
-#else
- /* 4 bytes padding */
-#endif
- ULONGLONG Reserved5;
- volatile ULONG64 InterruptTimeBias;
-#endif
-#if (NTDDI_VERSION >= NTDDI_WIN7)
- volatile ULONG64 TscQpcBias;
- volatile ULONG ActiveProcessorCount;
- volatile USHORT ActiveGroupCount;
- USHORT Reserved4;
- volatile ULONG AitSamplingValue;
- volatile ULONG AppCompatFlag;
- ULONGLONG SystemDllNativeRelocation;
- ULONG SystemDllWowRelocation;
- ULONG XStatePad[1];
- XSTATE_CONFIGURATION XState;
-#endif
-} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
-
-#ifdef _X86_
-
-#define SIZE_OF_80387_REGISTERS 80
-
-typedef struct _FLOATING_SAVE_AREA {
- ULONG ControlWord;
- ULONG StatusWord;
- ULONG TagWord;
- ULONG ErrorOffset;
- ULONG ErrorSelector;
- ULONG DataOffset;
- ULONG DataSelector;
- UCHAR RegisterArea[SIZE_OF_80387_REGISTERS];
- ULONG Cr0NpxState;
-} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
-
-#include "pshpack4.h"
-typedef struct _CONTEXT {
- ULONG ContextFlags;
- ULONG Dr0;
- ULONG Dr1;
- ULONG Dr2;
- ULONG Dr3;
- ULONG Dr6;
- ULONG Dr7;
- FLOATING_SAVE_AREA FloatSave;
- ULONG SegGs;
- ULONG SegFs;
- ULONG SegEs;
- ULONG SegDs;
- ULONG Edi;
- ULONG Esi;
- ULONG Ebx;
- ULONG Edx;
- ULONG Ecx;
- ULONG Eax;
- ULONG Ebp;
- ULONG Eip;
- ULONG SegCs;
- ULONG EFlags;
- ULONG Esp;
- ULONG SegSs;
- UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
-} CONTEXT;
-#include "poppack.h"
-
-#endif /* _X86_ */
-
-#ifdef _AMD64_
-
-#if !defined(RC_INVOKED)
-
-#define CONTEXT_AMD64 0x100000
-
-#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
-#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
-#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
-#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
-#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
-
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
-#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS |
CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
-
-#define CONTEXT_XSTATE (CONTEXT_AMD64 | 0x20L)
-
-#define CONTEXT_EXCEPTION_ACTIVE 0x8000000
-#define CONTEXT_SERVICE_ACTIVE 0x10000000
-#define CONTEXT_EXCEPTION_REQUEST 0x40000000
-#define CONTEXT_EXCEPTION_REPORTING 0x80000000
-
-#endif /* RC_INVOKED */
-
-#endif /* _AMD64_ */
-
-typedef enum _INTERLOCKED_RESULT {
- ResultNegative = RESULT_NEGATIVE,
- ResultZero = RESULT_ZERO,
- ResultPositive = RESULT_POSITIVE
-} INTERLOCKED_RESULT;
-
-typedef struct _OSVERSIONINFOA {
- ULONG dwOSVersionInfoSize;
- ULONG dwMajorVersion;
- ULONG dwMinorVersion;
- ULONG dwBuildNumber;
- ULONG dwPlatformId;
- CHAR szCSDVersion[128];
-} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
-
-typedef struct _OSVERSIONINFOW {
- ULONG dwOSVersionInfoSize;
- ULONG dwMajorVersion;
- ULONG dwMinorVersion;
- ULONG dwBuildNumber;
- ULONG dwPlatformId;
- WCHAR szCSDVersion[128];
-} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW,
*PRTL_OSVERSIONINFOW;
-
-typedef struct _OSVERSIONINFOEXA {
- ULONG dwOSVersionInfoSize;
- ULONG dwMajorVersion;
- ULONG dwMinorVersion;
- ULONG dwBuildNumber;
- ULONG dwPlatformId;
- CHAR szCSDVersion[128];
- USHORT wServicePackMajor;
- USHORT wServicePackMinor;
- USHORT wSuiteMask;
- UCHAR wProductType;
- UCHAR wReserved;
-} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
-
-typedef struct _OSVERSIONINFOEXW {
- ULONG dwOSVersionInfoSize;
- ULONG dwMajorVersion;
- ULONG dwMinorVersion;
- ULONG dwBuildNumber;
- ULONG dwPlatformId;
- WCHAR szCSDVersion[128];
- USHORT wServicePackMajor;
- USHORT wServicePackMinor;
- USHORT wSuiteMask;
- UCHAR wProductType;
- UCHAR wReserved;
-} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW,
*PRTL_OSVERSIONINFOEXW;
-
-#ifdef UNICODE
-typedef OSVERSIONINFOEXW OSVERSIONINFOEX;
-typedef POSVERSIONINFOEXW POSVERSIONINFOEX;
-typedef LPOSVERSIONINFOEXW LPOSVERSIONINFOEX;
-typedef OSVERSIONINFOW OSVERSIONINFO;
-typedef POSVERSIONINFOW POSVERSIONINFO;
-typedef LPOSVERSIONINFOW LPOSVERSIONINFO;
-#else
-typedef OSVERSIONINFOEXA OSVERSIONINFOEX;
-typedef POSVERSIONINFOEXA POSVERSIONINFOEX;
-typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX;
-typedef OSVERSIONINFOA OSVERSIONINFO;
-typedef POSVERSIONINFOA POSVERSIONINFO;
-typedef LPOSVERSIONINFOA LPOSVERSIONINFO;
-#endif /* UNICODE */
-
-/* Executive Types */
-
-#define PROTECTED_POOL 0x80000000
-
-typedef struct _ZONE_SEGMENT_HEADER {
- SINGLE_LIST_ENTRY SegmentList;
- PVOID Reserved;
-} ZONE_SEGMENT_HEADER, *PZONE_SEGMENT_HEADER;
-
-typedef struct _ZONE_HEADER {
- SINGLE_LIST_ENTRY FreeList;
- SINGLE_LIST_ENTRY SegmentList;
- ULONG BlockSize;
- ULONG TotalSegmentSize;
-} ZONE_HEADER, *PZONE_HEADER;
-
-/* Executive Functions */
-
-static __inline PVOID
-ExAllocateFromZone(
- IN PZONE_HEADER Zone)
-{
- if (Zone->FreeList.Next)
- Zone->FreeList.Next = Zone->FreeList.Next->Next;
- return (PVOID) Zone->FreeList.Next;
-}
-
-static __inline PVOID
-ExFreeToZone(
- IN PZONE_HEADER Zone,
- IN PVOID Block)
-{
- ((PSINGLE_LIST_ENTRY) Block)->Next = Zone->FreeList.Next;
- Zone->FreeList.Next = ((PSINGLE_LIST_ENTRY) Block);
- return ((PSINGLE_LIST_ENTRY) Block)->Next;
-}
-
-/*
- * PVOID
- * ExInterlockedAllocateFromZone(
- * IN PZONE_HEADER Zone,
- * IN PKSPIN_LOCK Lock)
- */
-#define ExInterlockedAllocateFromZone(Zone, Lock) \
- ((PVOID) ExInterlockedPopEntryList(&Zone->FreeList, Lock))
-
-/* PVOID
- * ExInterlockedFreeToZone(
- * IN PZONE_HEADER Zone,
- * IN PVOID Block,
- * IN PKSPIN_LOCK Lock);
- */
-#define ExInterlockedFreeToZone(Zone, Block, Lock) \
- ExInterlockedPushEntryList(&(Zone)->FreeList, (PSINGLE_LIST_ENTRY)(Block),
Lock)
-
-/*
- * BOOLEAN
- * ExIsFullZone(
- * IN PZONE_HEADER Zone)
- */
-#define ExIsFullZone(Zone) \
- ((Zone)->FreeList.Next == (PSINGLE_LIST_ENTRY) NULL)
-
-/* BOOLEAN
- * ExIsObjectInFirstZoneSegment(
- * IN PZONE_HEADER Zone,
- * IN PVOID Object);
- */
-#define ExIsObjectInFirstZoneSegment(Zone,Object) \
- ((BOOLEAN)( ((PUCHAR)(Object) >= (PUCHAR)(Zone)->SegmentList.Next) &&
\
- ((PUCHAR)(Object) < (PUCHAR)(Zone)->SegmentList.Next + \
- (Zone)->TotalSegmentSize)) )
-
-#define ExAcquireResourceExclusive ExAcquireResourceExclusiveLite
-#define ExAcquireResourceShared ExAcquireResourceSharedLite
-#define ExConvertExclusiveToShared ExConvertExclusiveToSharedLite
-#define ExDeleteResource ExDeleteResourceLite
-#define ExInitializeResource ExInitializeResourceLite
-#define ExIsResourceAcquiredExclusive ExIsResourceAcquiredExclusiveLite
-#define ExIsResourceAcquiredShared ExIsResourceAcquiredSharedLite
-#define ExIsResourceAcquired ExIsResourceAcquiredSharedLite
-#define ExReleaseResourceForThread ExReleaseResourceForThreadLite
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExExtendZone(
- IN OUT PZONE_HEADER Zone,
- IN OUT PVOID Segment,
- IN ULONG SegmentSize);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExInitializeZone(
- OUT PZONE_HEADER Zone,
- IN ULONG BlockSize,
- IN OUT PVOID InitialSegment,
- IN ULONG InitialSegmentSize);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExInterlockedExtendZone(
- IN OUT PZONE_HEADER Zone,
- IN OUT PVOID Segment,
- IN ULONG SegmentSize,
- IN OUT PKSPIN_LOCK Lock);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExUuidCreate(
- OUT UUID *Uuid);
-
-NTKERNELAPI
-DECLSPEC_NORETURN
-VOID
-NTAPI
-ExRaiseAccessViolation(
- VOID);
-
-NTKERNELAPI
-DECLSPEC_NORETURN
-VOID
-NTAPI
-ExRaiseDatatypeMisalignment(
- VOID);
-
-#endif
-
-#ifdef _X86_
-
-NTKERNELAPI
-INTERLOCKED_RESULT
-FASTCALL
-Exfi386InterlockedIncrementLong(
- IN OUT LONG volatile *Addend);
-
-NTKERNELAPI
-INTERLOCKED_RESULT
-FASTCALL
-Exfi386InterlockedDecrementLong(
- IN PLONG Addend);
-
-NTKERNELAPI
+typedef
+PVOID
+(NTAPI *pKdMapPhysicalMemory64)(
+ IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN ULONG NumberPages,
+ IN BOOLEAN FlushCurrentTLB);
+
+typedef
+VOID
+(NTAPI *pKdUnmapVirtualAddress)(
+ IN PVOID VirtualAddress,
+ IN ULONG NumberPages,
+ IN BOOLEAN FlushCurrentTLB);
+
+typedef
ULONG
-FASTCALL
-Exfi386InterlockedExchangeUlong(
- IN PULONG Target,
- IN ULONG Value);
-
-#endif /* _X86_ */
-
-#ifndef _ARC_DDK_
-#define _ARC_DDK_
-typedef enum _CONFIGURATION_TYPE {
- ArcSystem,
- CentralProcessor,
- FloatingPointProcessor,
- PrimaryIcache,
- PrimaryDcache,
- SecondaryIcache,
- SecondaryDcache,
- SecondaryCache,
- EisaAdapter,
- TcAdapter,
- ScsiAdapter,
- DtiAdapter,
- MultiFunctionAdapter,
- DiskController,
- TapeController,
- CdromController,
- WormController,
- SerialController,
- NetworkController,
- DisplayController,
- ParallelController,
- PointerController,
- KeyboardController,
- AudioController,
- OtherController,
- DiskPeripheral,
- FloppyDiskPeripheral,
- TapePeripheral,
- ModemPeripheral,
- MonitorPeripheral,
- PrinterPeripheral,
- PointerPeripheral,
- KeyboardPeripheral,
- TerminalPeripheral,
- OtherPeripheral,
- LinePeripheral,
- NetworkPeripheral,
- SystemMemory,
- DockingInformation,
- RealModeIrqRoutingTable,
- RealModePCIEnumeration,
- MaximumType
-} CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
-#endif /* !_ARC_DDK_ */
-
-typedef struct _CONTROLLER_OBJECT {
- CSHORT Type;
- CSHORT Size;
- PVOID ControllerExtension;
- KDEVICE_QUEUE DeviceWaitQueue;
- ULONG Spare1;
- LARGE_INTEGER Spare2;
-} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT;
-
-typedef struct _CONFIGURATION_INFORMATION {
- ULONG DiskCount;
- ULONG FloppyCount;
- ULONG CdRomCount;
- ULONG TapeCount;
- ULONG ScsiPortCount;
- ULONG SerialCount;
- ULONG ParallelCount;
- BOOLEAN AtDiskPrimaryAddressClaimed;
- BOOLEAN AtDiskSecondaryAddressClaimed;
- ULONG Version;
- ULONG MediumChangerCount;
-} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
+(NTAPI *pKdGetPciDataByOffset)(
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ OUT PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length);
typedef
-NTSTATUS
-(DDKAPI *PIO_QUERY_DEVICE_ROUTINE)(
- IN PVOID Context,
- IN PUNICODE_STRING PathName,
- IN INTERFACE_TYPE BusType,
+ULONG
+(NTAPI *pKdSetPciDataByOffset)(
IN ULONG BusNumber,
- IN PKEY_VALUE_FULL_INFORMATION *BusInformation,
- IN CONFIGURATION_TYPE ControllerType,
- IN ULONG ControllerNumber,
- IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation,
- IN CONFIGURATION_TYPE PeripheralType,
- IN ULONG PeripheralNumber,
- IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation);
-
-typedef
-VOID
-(DDKAPI DRIVER_REINITIALIZE)(
- IN struct _DRIVER_OBJECT *DriverObject,
- IN PVOID Context,
- IN ULONG Count);
-
-typedef DRIVER_REINITIALIZE *PDRIVER_REINITIALIZE;
-
-/** Filesystem runtime library routines **/
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsTotalDeviceFailure(
- IN NTSTATUS Status);
-#endif
-
-/* Hardware Abstraction Layer Types */
-
-typedef VOID
-(NTAPI *PciPin2Line)(
- IN struct _BUS_HANDLER *BusHandler,
- IN struct _BUS_HANDLER *RootHandler,
- IN PCI_SLOT_NUMBER SlotNumber,
- IN PPCI_COMMON_CONFIG PciData);
-
-typedef VOID
-(NTAPI *PciLine2Pin)(
- IN struct _BUS_HANDLER *BusHandler,
- IN struct _BUS_HANDLER *RootHandler,
- IN PCI_SLOT_NUMBER SlotNumber,
- IN PPCI_COMMON_CONFIG PciNewData,
- IN PPCI_COMMON_CONFIG PciOldData);
-
-typedef VOID
-(NTAPI *PciReadWriteConfig)(
- IN struct _BUS_HANDLER *BusHandler,
- IN PCI_SLOT_NUMBER Slot,
+ IN ULONG SlotNumber,
IN PVOID Buffer,
IN ULONG Offset,
IN ULONG Length);
-#define PCI_DATA_TAG ' ICP'
-#define PCI_DATA_VERSION 1
-
-typedef struct _PCIBUSDATA {
- ULONG Tag;
+typedef BOOLEAN
+(NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)(
+ IN ULONG Columns,
+ IN ULONG Rows);
+
+typedef struct _HAL_DISPATCH {
ULONG Version;
- PciReadWriteConfig ReadConfig;
- PciReadWriteConfig WriteConfig;
- PciPin2Line Pin2Line;
- PciLine2Pin Line2Pin;
- PCI_SLOT_NUMBER ParentSlot;
- PVOID Reserved[4];
-} PCIBUSDATA, *PPCIBUSDATA;
+ pHalQuerySystemInformation HalQuerySystemInformation;
+ pHalSetSystemInformation HalSetSystemInformation;
+ pHalQueryBusSlots HalQueryBusSlots;
+ ULONG Spare1;
+ pHalExamineMBR HalExamineMBR;
+ pHalIoReadPartitionTable HalIoReadPartitionTable;
+ pHalIoSetPartitionInformation HalIoSetPartitionInformation;
+ pHalIoWritePartitionTable HalIoWritePartitionTable;
+ pHalHandlerForBus HalReferenceHandlerForBus;
+ pHalReferenceBusHandler HalReferenceBusHandler;
+ pHalReferenceBusHandler HalDereferenceBusHandler;
+ pHalInitPnpDriver HalInitPnpDriver;
+ pHalInitPowerManagement HalInitPowerManagement;
+ pHalGetDmaAdapter HalGetDmaAdapter;
+ pHalGetInterruptTranslator HalGetInterruptTranslator;
+ pHalStartMirroring HalStartMirroring;
+ pHalEndMirroring HalEndMirroring;
+ pHalMirrorPhysicalMemory HalMirrorPhysicalMemory;
+ pHalEndOfBoot HalEndOfBoot;
+ pHalMirrorVerify HalMirrorVerify;
+ pHalGetAcpiTable HalGetCachedAcpiTable;
+ pHalSetPciErrorHandlerCallback HalSetPciErrorHandlerCallback;
+#if defined(_IA64_)
+ pHalGetErrorCapList HalGetErrorCapList;
+ pHalInjectError HalInjectError;
+#endif
+} HAL_DISPATCH, *PHAL_DISPATCH;
+
+#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_)
+
+extern PHAL_DISPATCH HalDispatchTable;
+#define HALDISPATCH HalDispatchTable
+
+#else
+
+extern HAL_DISPATCH HalDispatchTable;
+#define HALDISPATCH (&HalDispatchTable)
+
+#endif
+
+#define HAL_DISPATCH_VERSION 3
+#define HalDispatchTableVersion HALDISPATCH->Version
+#define HalQuerySystemInformation HALDISPATCH->HalQuerySystemInformation
+#define HalSetSystemInformation HALDISPATCH->HalSetSystemInformation
+#define HalQueryBusSlots HALDISPATCH->HalQueryBusSlots
+#define HalReferenceHandlerForBus HALDISPATCH->HalReferenceHandlerForBus
+#define HalReferenceBusHandler HALDISPATCH->HalReferenceBusHandler
+#define HalDereferenceBusHandler HALDISPATCH->HalDereferenceBusHandler
+#define HalInitPnpDriver HALDISPATCH->HalInitPnpDriver
+#define HalInitPowerManagement HALDISPATCH->HalInitPowerManagement
+#define HalGetDmaAdapter HALDISPATCH->HalGetDmaAdapter
+#define HalGetInterruptTranslator HALDISPATCH->HalGetInterruptTranslator
+#define HalStartMirroring HALDISPATCH->HalStartMirroring
+#define HalEndMirroring HALDISPATCH->HalEndMirroring
+#define HalMirrorPhysicalMemory HALDISPATCH->HalMirrorPhysicalMemory
+#define HalEndOfBoot HALDISPATCH->HalEndOfBoot
+#define HalMirrorVerify HALDISPATCH->HalMirrorVerify
+
+typedef struct _FILE_ALIGNMENT_INFORMATION {
+ ULONG AlignmentRequirement;
+} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
+
+typedef struct _FILE_NAME_INFORMATION {
+ ULONG FileNameLength;
+ WCHAR FileName[1];
+} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
+
+
+typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION {
+ ULONG FileAttributes;
+ ULONG ReparseTag;
+} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
+
+typedef struct _FILE_DISPOSITION_INFORMATION {
+ BOOLEAN DeleteFile;
+} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
+
+typedef struct _FILE_END_OF_FILE_INFORMATION {
+ LARGE_INTEGER EndOfFile;
+} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
+
+typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION {
+ LARGE_INTEGER ValidDataLength;
+} FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
+
+typedef union _FILE_SEGMENT_ELEMENT {
+ PVOID64 Buffer;
+ ULONGLONG Alignment;
+}FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
+
+#define SE_UNSOLICITED_INPUT_PRIVILEGE 6
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+NTSYSAPI
+ULONGLONG
+NTAPI
+VerSetConditionMask(
+ IN ULONGLONG ConditionMask,
+ IN ULONG TypeMask,
+ IN UCHAR Condition);
+#endif
+
+#define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
+ ((ConditionMask) = VerSetConditionMask((ConditionMask), \
+ (TypeBitMask), (ComparisonType)))
+
+/* RtlVerifyVersionInfo() TypeMask */
+
+#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
+
+/* RtlVerifyVersionInfo() ComparisonType */
+
+#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
+
+typedef struct _IMAGE_INFO {
+ _ANONYMOUS_UNION union {
+ ULONG Properties;
+ _ANONYMOUS_STRUCT struct {
+ ULONG ImageAddressingMode:8;
+ ULONG SystemModeImage:1;
+ ULONG ImageMappedToAllPids:1;
+ ULONG ExtendedInfoPresent:1;
+ ULONG Reserved:22;
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME;
+ PVOID ImageBase;
+ ULONG ImageSelector;
+ SIZE_T ImageSize;
+ ULONG ImageSectionNumber;
+} IMAGE_INFO, *PIMAGE_INFO;
+
+#define IMAGE_ADDRESSING_MODE_32BIT 3
typedef enum _BUS_DATA_TYPE {
ConfigurationSpaceUndefined = -1,
@@ -1190,797 +817,44 @@
MaximumBusDataType
} BUS_DATA_TYPE, *PBUS_DATA_TYPE;
-typedef
-PVOID
-(NTAPI *pHalGetAcpiTable)(
- IN ULONG Signature,
- IN PCSTR OemId OPTIONAL,
- IN PCSTR OemTableId OPTIONAL);
-
-typedef
-VOID
-(NTAPI *PCI_ERROR_HANDLER_CALLBACK)(
- VOID);
-
-typedef
-VOID
-(NTAPI *pHalSetPciErrorHandlerCallback)(
- IN PCI_ERROR_HANDLER_CALLBACK Callback);
-
-#if 1 /* Not present in WDK 7600 */
-typedef VOID
-(FASTCALL *pHalIoAssignDriveLetters)(
- IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
- IN PSTRING NtDeviceName,
- OUT PUCHAR NtSystemPath,
- OUT PSTRING NtSystemPathString);
-#endif
-
-typedef struct {
- ULONG Version;
- pHalQuerySystemInformation HalQuerySystemInformation;
- pHalSetSystemInformation HalSetSystemInformation;
- pHalQueryBusSlots HalQueryBusSlots;
- ULONG Spare1;
- pHalExamineMBR HalExamineMBR;
-#if 1 /* Not present in WDK 7600 */
- pHalIoAssignDriveLetters HalIoAssignDriveLetters;
-#endif
- pHalIoReadPartitionTable HalIoReadPartitionTable;
- pHalIoSetPartitionInformation HalIoSetPartitionInformation;
- pHalIoWritePartitionTable HalIoWritePartitionTable;
- pHalHandlerForBus HalReferenceHandlerForBus;
- pHalReferenceBusHandler HalReferenceBusHandler;
- pHalReferenceBusHandler HalDereferenceBusHandler;
- pHalInitPnpDriver HalInitPnpDriver;
- pHalInitPowerManagement HalInitPowerManagement;
- pHalGetDmaAdapter HalGetDmaAdapter;
- pHalGetInterruptTranslator HalGetInterruptTranslator;
- pHalStartMirroring HalStartMirroring;
- pHalEndMirroring HalEndMirroring;
- pHalMirrorPhysicalMemory HalMirrorPhysicalMemory;
- pHalEndOfBoot HalEndOfBoot;
- pHalMirrorVerify HalMirrorVerify;
- pHalGetAcpiTable HalGetCachedAcpiTable;
- pHalSetPciErrorHandlerCallback HalSetPciErrorHandlerCallback;
-#if defined(_IA64_)
- pHalGetErrorCapList HalGetErrorCapList;
- pHalInjectError HalInjectError;
-#endif
-} HAL_DISPATCH, *PHAL_DISPATCH;
-
-/* GCC/MSVC and WDK compatible declaration */
-extern NTKERNELAPI HAL_DISPATCH HalDispatchTable;
-
-#if defined(_NTOSKRNL_) || defined(_BLDR_)
-#define HALDISPATCH (&HalDispatchTable)
-#else
-/* This is a WDK compatibility definition */
-#define HalDispatchTable (&HalDispatchTable)
-#define HALDISPATCH HalDispatchTable
-#endif
-
-#define HAL_DISPATCH_VERSION 3 // FIXME: when to use 4?
-#define HalDispatchTableVersion HALDISPATCH->Version
-#define HalQuerySystemInformation HALDISPATCH->HalQuerySystemInformation
-#define HalSetSystemInformation HALDISPATCH->HalSetSystemInformation
-#define HalQueryBusSlots HALDISPATCH->HalQueryBusSlots
-#define HalReferenceHandlerForBus HALDISPATCH->HalReferenceHandlerForBus
-#define HalReferenceBusHandler HALDISPATCH->HalReferenceBusHandler
-#define HalDereferenceBusHandler HALDISPATCH->HalDereferenceBusHandler
-#define HalInitPnpDriver HALDISPATCH->HalInitPnpDriver
-#define HalInitPowerManagement HALDISPATCH->HalInitPowerManagement
-#define HalGetDmaAdapter HALDISPATCH->HalGetDmaAdapter
-#define HalGetInterruptTranslator HALDISPATCH->HalGetInterruptTranslator
-#define HalStartMirroring HALDISPATCH->HalStartMirroring
-#define HalEndMirroring HALDISPATCH->HalEndMirroring
-#define HalMirrorPhysicalMemory HALDISPATCH->HalMirrorPhysicalMemory
-#define HalEndOfBoot HALDISPATCH->HalEndOfBoot
-#define HalMirrorVerify HALDISPATCH->HalMirrorVerify
-
-/* Hardware Abstraction Layer Functions */
-
-#if !defined(NO_LEGACY_DRIVERS)
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTHALAPI
-NTSTATUS
-NTAPI
-HalAssignSlotResources(
- IN PUNICODE_STRING RegistryPath,
- IN PUNICODE_STRING DriverClassName,
- IN PDRIVER_OBJECT DriverObject,
- IN PDEVICE_OBJECT DeviceObject,
- IN INTERFACE_TYPE BusType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN OUT PCM_RESOURCE_LIST *AllocatedResources);
-
-NTHALAPI
-ULONG
-NTAPI
-HalGetInterruptVector(
- IN INTERFACE_TYPE InterfaceType,
- IN ULONG BusNumber,
- IN ULONG BusInterruptLevel,
- IN ULONG BusInterruptVector,
- OUT PKIRQL Irql,
- OUT PKAFFINITY Affinity);
-
-NTHALAPI
-ULONG
-NTAPI
-HalSetBusData(
- IN BUS_DATA_TYPE BusDataType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN PVOID Buffer,
- IN ULONG Length);
-
-#endif
-
-#endif /* !defined(NO_LEGACY_DRIVERS) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTHALAPI
-PADAPTER_OBJECT
-NTAPI
-HalGetAdapter(
- IN PDEVICE_DESCRIPTION DeviceDescription,
- IN OUT PULONG NumberOfMapRegisters);
-
-NTHALAPI
-BOOLEAN
-NTAPI
-HalMakeBeep(
- IN ULONG Frequency);
-
-VOID
-NTAPI
-HalPutDmaAdapter(
- IN PADAPTER_OBJECT DmaAdapter);
-
-typedef
-BOOLEAN
-(DDKAPI *PHAL_RESET_DISPLAY_PARAMETERS)(
- ULONG Columns,
- ULONG Rows);
-
-NTHALAPI
-VOID
-NTAPI
-HalAcquireDisplayOwnership(
- IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
-
-NTHALAPI
-ULONG
-NTAPI
-HalGetBusData(
- IN BUS_DATA_TYPE BusDataType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- OUT PVOID Buffer,
- IN ULONG Length);
-
-NTHALAPI
-ULONG
-NTAPI
-HalGetBusDataByOffset(
- IN BUS_DATA_TYPE BusDataType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- OUT PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length);
-
-NTHALAPI
-ULONG
-NTAPI
-HalSetBusDataByOffset(
- IN BUS_DATA_TYPE BusDataType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length);
-
-NTHALAPI
-BOOLEAN
-NTAPI
-HalTranslateBusAddress(
- IN INTERFACE_TYPE InterfaceType,
- IN ULONG BusNumber,
- IN PHYSICAL_ADDRESS BusAddress,
- IN OUT PULONG AddressSpace,
- OUT PPHYSICAL_ADDRESS TranslatedAddress);
-
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-NTKERNELAPI
-VOID
-FASTCALL
-HalExamineMBR(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG MBRTypeIdentifier,
- OUT PVOID *Buffer);
-#endif
-
-typedef struct _DISK_SIGNATURE {
- ULONG PartitionStyle;
+typedef struct _NT_TIB {
+ struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
+ PVOID StackBase;
+ PVOID StackLimit;
+ PVOID SubSystemTib;
_ANONYMOUS_UNION union {
- struct {
- ULONG Signature;
- ULONG CheckSum;
- } Mbr;
- struct {
- GUID DiskId;
- } Gpt;
+ PVOID FiberData;
+ ULONG Version;
} DUMMYUNIONNAME;
-} DISK_SIGNATURE, *PDISK_SIGNATURE;
-
-#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) ||
defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
-// nothing here
-#else
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-VOID
-NTAPI
-IoFreeAdapterChannel(
- IN PADAPTER_OBJECT AdapterObject);
-
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-BOOLEAN
-NTAPI
-IoFlushAdapterBuffers(
- IN PADAPTER_OBJECT AdapterObject,
- IN PMDL Mdl,
- IN PVOID MapRegisterBase,
- IN PVOID CurrentVa,
- IN ULONG Length,
- IN BOOLEAN WriteToDevice);
-
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-VOID
-NTAPI
-IoFreeMapRegisters(
- IN PADAPTER_OBJECT AdapterObject,
- IN PVOID MapRegisterBase,
- IN ULONG NumberOfMapRegisters);
-
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-PVOID
-NTAPI
-HalAllocateCommonBuffer(
- IN PADAPTER_OBJECT AdapterObject,
- IN ULONG Length,
- OUT PPHYSICAL_ADDRESS LogicalAddress,
- IN BOOLEAN CacheEnabled);
-
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-VOID
-NTAPI
-HalFreeCommonBuffer(
- IN PADAPTER_OBJECT AdapterObject,
- IN ULONG Length,
- IN PHYSICAL_ADDRESS LogicalAddress,
- IN PVOID VirtualAddress,
- IN BOOLEAN CacheEnabled);
-
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-ULONG
-NTAPI
-HalReadDmaCounter(
- IN PADAPTER_OBJECT AdapterObject);
-
-NTHALAPI
-NTSTATUS
-NTAPI
-HalAllocateAdapterChannel(
- IN PADAPTER_OBJECT AdapterObject,
- IN PWAIT_CONTEXT_BLOCK Wcb,
- IN ULONG NumberOfMapRegisters,
- IN PDRIVER_CONTROL ExecutionRoutine);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#endif /* defined(USE_DMA_MACROS) && !defined(_NTHAL_) &&
(defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) */
-
-/* I/O Manager Functions */
-
-/*
- * VOID IoAssignArcName(
- * IN PUNICODE_STRING ArcName,
- * IN PUNICODE_STRING DeviceName);
- */
-#define IoAssignArcName(_ArcName, _DeviceName) ( \
- IoCreateSymbolicLink((_ArcName), (_DeviceName)))
-
-/*
- * VOID
- * IoDeassignArcName(
- * IN PUNICODE_STRING ArcName)
- */
-#define IoDeassignArcName IoDeleteSymbolicLink
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-#if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) ||
defined(_WDM_INCLUDED_))
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAllocateAdapterChannel(
- IN PADAPTER_OBJECT AdapterObject,
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG NumberOfMapRegisters,
- IN PDRIVER_CONTROL ExecutionRoutine,
- IN PVOID Context);
-#endif
-
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-PHYSICAL_ADDRESS
-NTAPI
-IoMapTransfer(
- IN PADAPTER_OBJECT AdapterObject,
- IN PMDL Mdl,
- IN PVOID MapRegisterBase,
- IN PVOID CurrentVa,
- IN OUT PULONG Length,
- IN BOOLEAN WriteToDevice);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoAllocateController(
- IN PCONTROLLER_OBJECT ControllerObject,
- IN PDEVICE_OBJECT DeviceObject,
- IN PDRIVER_CONTROL ExecutionRoutine,
- IN PVOID Context OPTIONAL);
-
-NTKERNELAPI
-PCONTROLLER_OBJECT
-NTAPI
-IoCreateController(
- IN ULONG Size);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoDeleteController(
- IN PCONTROLLER_OBJECT ControllerObject);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoFreeController(
- IN PCONTROLLER_OBJECT ControllerObject);
-
-NTKERNELAPI
-PCONFIGURATION_INFORMATION
-NTAPI
-IoGetConfigurationInformation(
- VOID);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetDeviceToVerify(
- IN PETHREAD Thread);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoCancelFileOpen(
- IN PDEVICE_OBJECT DeviceObject,
- IN PFILE_OBJECT FileObject);
-
-NTKERNELAPI
-PGENERIC_MAPPING
-NTAPI
-IoGetFileObjectGenericMapping(
- VOID);
-
-NTKERNELAPI
-PIRP
-NTAPI
-IoMakeAssociatedIrp(
- IN PIRP Irp,
- IN CCHAR StackSize);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoQueryDeviceDescription(
- IN PINTERFACE_TYPE BusType OPTIONAL,
- IN PULONG BusNumber OPTIONAL,
- IN PCONFIGURATION_TYPE ControllerType OPTIONAL,
- IN PULONG ControllerNumber OPTIONAL,
- IN PCONFIGURATION_TYPE PeripheralType OPTIONAL,
- IN PULONG PeripheralNumber OPTIONAL,
- IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
- IN OUT PVOID Context OPTIONAL);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoRaiseHardError(
- IN PIRP Irp,
- IN PVPB Vpb OPTIONAL,
- IN PDEVICE_OBJECT RealDeviceObject);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoRaiseInformationalHardError(
- IN NTSTATUS ErrorStatus,
- IN PUNICODE_STRING String OPTIONAL,
- IN PKTHREAD Thread OPTIONAL);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoRegisterBootDriverReinitialization(
- IN PDRIVER_OBJECT DriverObject,
- IN PDRIVER_REINITIALIZE DriverReinitializationRoutine,
- IN PVOID Context OPTIONAL);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoRegisterDriverReinitialization(
- IN PDRIVER_OBJECT DriverObject,
- IN PDRIVER_REINITIALIZE DriverReinitializationRoutine,
- IN PVOID Context OPTIONAL);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAttachDeviceByPointer(
- IN PDEVICE_OBJECT SourceDevice,
- IN PDEVICE_OBJECT TargetDevice);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReportDetectedDevice(
- IN PDRIVER_OBJECT DriverObject,
- IN INTERFACE_TYPE LegacyBusType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN PCM_RESOURCE_LIST ResourceList OPTIONAL,
- IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL,
- IN BOOLEAN ResourceAssigned,
- IN OUT PDEVICE_OBJECT *DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReportResourceForDetection(
- IN PDRIVER_OBJECT DriverObject,
- IN PCM_RESOURCE_LIST DriverList OPTIONAL,
- IN ULONG DriverListSize OPTIONAL,
- IN PDEVICE_OBJECT DeviceObject OPTIONAL,
- IN PCM_RESOURCE_LIST DeviceList OPTIONAL,
- IN ULONG DeviceListSize OPTIONAL,
- OUT PBOOLEAN ConflictDetected);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReportResourceUsage(
- IN PUNICODE_STRING DriverClassName OPTIONAL,
- IN PDRIVER_OBJECT DriverObject,
- IN PCM_RESOURCE_LIST DriverList OPTIONAL,
- IN ULONG DriverListSize OPTIONAL,
- IN PDEVICE_OBJECT DeviceObject,
- IN PCM_RESOURCE_LIST DeviceList OPTIONAL,
- IN ULONG DeviceListSize OPTIONAL,
- IN BOOLEAN OverrideConflict,
- OUT PBOOLEAN ConflictDetected);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoSetHardErrorOrVerifyDevice(
- IN PIRP Irp,
- IN PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAssignResources(
- IN PUNICODE_STRING RegistryPath,
- IN PUNICODE_STRING DriverClassName OPTIONAL,
- IN PDRIVER_OBJECT DriverObject,
- IN PDEVICE_OBJECT DeviceObject OPTIONAL,
- IN PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources OPTIONAL,
- IN OUT PCM_RESOURCE_LIST *AllocatedResources);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCreateDisk(
- IN PDEVICE_OBJECT DeviceObject,
- IN struct _CREATE_DISK* Disk OPTIONAL);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReadDiskSignature(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG BytesPerSector,
- OUT PDISK_SIGNATURE Signature);
-
-NTKERNELAPI
-NTSTATUS
-FASTCALL
-IoReadPartitionTable(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN BOOLEAN ReturnRecognizedPartitions,
- OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReadPartitionTableEx(
- IN PDEVICE_OBJECT DeviceObject,
- IN struct _DRIVE_LAYOUT_INFORMATION_EX **PartitionBuffer);
-
-NTKERNELAPI
-NTSTATUS
-FASTCALL
-IoSetPartitionInformation(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG PartitionNumber,
- IN ULONG PartitionType);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoSetPartitionInformationEx(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG PartitionNumber,
- IN struct _SET_PARTITION_INFORMATION_EX *PartitionInfo);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoSetSystemPartition(
- IN PUNICODE_STRING VolumeNameString);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoSetThreadHardErrorMode(
- IN BOOLEAN EnableHardErrors);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoVerifyPartitionTable(
- IN PDEVICE_OBJECT DeviceObject,
- IN BOOLEAN FixErrors);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoVolumeDeviceToDosName(
- IN PVOID VolumeDeviceObject,
- OUT PUNICODE_STRING DosName);
-
-NTKERNELAPI
-NTSTATUS
-FASTCALL
-IoWritePartitionTable(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG SectorsPerTrack,
- IN ULONG NumberOfHeads,
- IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoWritePartitionTableEx(
- IN PDEVICE_OBJECT DeviceObject,
- IN struct _DRIVE_LAYOUT_INFORMATION_EX *DriveLayout);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-/** Kernel debugger routines **/
-
-NTSYSAPI
-ULONG
-NTAPI
-DbgPrompt(
- IN PCCH Prompt,
- OUT PCH Response,
- IN ULONG MaximumResponseLength);
-
-/* Kernel Functions */
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTKERNELAPI
-DECLSPEC_NORETURN
-VOID
-NTAPI
-KeBugCheck(
- IN ULONG BugCheckCode);
-
-NTKERNELAPI
-LONG
-NTAPI
-KePulseEvent(
- IN OUT PRKEVENT Event,
- IN KPRIORITY Increment,
- IN BOOLEAN Wait);
-
-NTKERNELAPI
-LONG
-NTAPI
-KeSetBasePriorityThread(
- IN OUT PRKTHREAD Thread,
- IN LONG Increment);
-
-#endif
-
-/* Memory Manager Types */
-
-typedef struct _PHYSICAL_MEMORY_RANGE {
- PHYSICAL_ADDRESS BaseAddress;
- LARGE_INTEGER NumberOfBytes;
-} PHYSICAL_MEMORY_RANGE, *PPHYSICAL_MEMORY_RANGE;
-
-/* Memory Manager Functions */
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTKERNELAPI
-PPHYSICAL_MEMORY_RANGE
-NTAPI
-MmGetPhysicalMemoryRanges(
- VOID);
-
-NTKERNELAPI
-PHYSICAL_ADDRESS
-NTAPI
-MmGetPhysicalAddress(
- IN PVOID BaseAddress);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsNonPagedSystemAddressValid(
- IN PVOID VirtualAddress);
-
-NTKERNELAPI
-PVOID
-NTAPI
-MmAllocateNonCachedMemory(
- IN SIZE_T NumberOfBytes);
-
-NTKERNELAPI
-VOID
-NTAPI
-MmFreeNonCachedMemory(
- IN PVOID BaseAddress,
- IN SIZE_T NumberOfBytes);
-
-NTKERNELAPI
-PVOID
-NTAPI
-MmGetVirtualForPhysical(
- IN PHYSICAL_ADDRESS PhysicalAddress);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapUserAddressesToPage(
- IN PVOID BaseAddress,
- IN SIZE_T NumberOfBytes,
- IN PVOID PageAddress);
-
-NTKERNELAPI
-PVOID
-NTAPI
-MmMapVideoDisplay(
- IN PHYSICAL_ADDRESS PhysicalAddress,
- IN SIZE_T NumberOfBytes,
- IN MEMORY_CACHING_TYPE CacheType);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapViewInSessionSpace(
- IN PVOID Section,
- OUT PVOID *MappedBase,
- IN OUT PSIZE_T ViewSize);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapViewInSystemSpace(
- IN PVOID Section,
- OUT PVOID *MappedBase,
- IN OUT PSIZE_T ViewSize);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsAddressValid(
- IN PVOID VirtualAddress);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsThisAnNtAsSystem(
- VOID);
-
-NTKERNELAPI
-VOID
-NTAPI
-MmLockPagableSectionByHandle(
- IN PVOID ImageSectionHandle);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmUnmapViewInSessionSpace(
- IN PVOID MappedBase);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmUnmapViewInSystemSpace(
- IN PVOID MappedBase);
-
-NTKERNELAPI
-VOID
-NTAPI
-MmUnsecureVirtualMemory(
- IN HANDLE SecureHandle);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmRemovePhysicalMemory(
- IN PPHYSICAL_ADDRESS StartAddress,
- IN OUT PLARGE_INTEGER NumberOfBytes);
-
-NTKERNELAPI
-HANDLE
-NTAPI
-MmSecureVirtualMemory(
- IN PVOID Address,
- IN SIZE_T Size,
- IN ULONG ProbeMode);
-
-NTKERNELAPI
-VOID
-NTAPI
-MmUnmapVideoDisplay(
- IN PVOID BaseAddress,
- IN SIZE_T NumberOfBytes);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
+ PVOID ArbitraryUserPointer;
+ struct _NT_TIB *Self;
+} NT_TIB, *PNT_TIB;
+
+typedef struct _NT_TIB32 {
+ ULONG ExceptionList;
+ ULONG StackBase;
+ ULONG StackLimit;
+ ULONG SubSystemTib;
+ __GNU_EXTENSION union {
+ ULONG FiberData;
+ ULONG Version;
+ };
+ ULONG ArbitraryUserPointer;
+ ULONG Self;
+} NT_TIB32,*PNT_TIB32;
+
+typedef struct _NT_TIB64 {
+ ULONG64 ExceptionList;
+ ULONG64 StackBase;
+ ULONG64 StackLimit;
+ ULONG64 SubSystemTib;
+ __GNU_EXTENSION union {
+ ULONG64 FiberData;
+ ULONG Version;
+ };
+ ULONG64 ArbitraryUserPointer;
+ ULONG64 Self;
+} NT_TIB64,*PNT_TIB64;
typedef enum _PROCESSINFOCLASS {
ProcessBasicInformation,
@@ -2075,6 +949,1416 @@
MaxThreadInfoClass
} THREADINFOCLASS;
+typedef struct _PROCESS_BASIC_INFORMATION {
+ NTSTATUS ExitStatus;
+ struct _PEB *PebBaseAddress;
+ ULONG_PTR AffinityMask;
+ KPRIORITY BasePriority;
+ ULONG_PTR UniqueProcessId;
+ ULONG_PTR InheritedFromUniqueProcessId;
+} PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION;
+
+typedef struct _PROCESS_WS_WATCH_INFORMATION {
+ PVOID FaultingPc;
+ PVOID FaultingVa;
+} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION;
+
+typedef struct _PROCESS_DEVICEMAP_INFORMATION {
+ __GNU_EXTENSION union {
+ struct {
+ HANDLE DirectoryHandle;
+ } Set;
+ struct {
+ ULONG DriveMap;
+ UCHAR DriveType[32];
+ } Query;
+ };
+} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
+
+typedef struct _KERNEL_USER_TIMES {
+ LARGE_INTEGER CreateTime;
+ LARGE_INTEGER ExitTime;
+ LARGE_INTEGER KernelTime;
+ LARGE_INTEGER UserTime;
+} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
+
+typedef struct _PROCESS_ACCESS_TOKEN {
+ HANDLE Token;
+ HANDLE Thread;
+} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN;
+
+typedef struct _PROCESS_SESSION_INFORMATION {
+ ULONG SessionId;
+} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
+
+typedef enum _IO_QUERY_DEVICE_DATA_FORMAT {
+ IoQueryDeviceIdentifier = 0,
+ IoQueryDeviceConfigurationData,
+ IoQueryDeviceComponentInformation,
+ IoQueryDeviceMaxData
+} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT;
+
+typedef struct _DISK_SIGNATURE {
+ ULONG PartitionStyle;
+ _ANONYMOUS_UNION union {
+ struct {
+ ULONG Signature;
+ ULONG CheckSum;
+ } Mbr;
+ struct {
+ GUID DiskId;
+ } Gpt;
+ } DUMMYUNIONNAME;
+} DISK_SIGNATURE, *PDISK_SIGNATURE;
+
+typedef ULONG_PTR
+(NTAPI *PDRIVER_VERIFIER_THUNK_ROUTINE)(
+ IN PVOID Context);
+
+typedef struct _DRIVER_VERIFIER_THUNK_PAIRS {
+ PDRIVER_VERIFIER_THUNK_ROUTINE PristineRoutine;
+ PDRIVER_VERIFIER_THUNK_ROUTINE NewRoutine;
+} DRIVER_VERIFIER_THUNK_PAIRS, *PDRIVER_VERIFIER_THUNK_PAIRS;
+
+#define DRIVER_VERIFIER_SPECIAL_POOLING 0x0001
+#define DRIVER_VERIFIER_FORCE_IRQL_CHECKING 0x0002
+#define DRIVER_VERIFIER_INJECT_ALLOCATION_FAILURES 0x0004
+#define DRIVER_VERIFIER_TRACK_POOL_ALLOCATIONS 0x0008
+#define DRIVER_VERIFIER_IO_CHECKING 0x0010
+
+typedef VOID
+(NTAPI *PTIMER_APC_ROUTINE)(
+ IN PVOID TimerContext,
+ IN ULONG TimerLowValue,
+ IN LONG TimerHighValue);
+
+typedef struct _KUSER_SHARED_DATA
+{
+ ULONG TickCountLowDeprecated;
+ ULONG TickCountMultiplier;
+ volatile KSYSTEM_TIME InterruptTime;
+ volatile KSYSTEM_TIME SystemTime;
+ volatile KSYSTEM_TIME TimeZoneBias;
+ USHORT ImageNumberLow;
+ USHORT ImageNumberHigh;
+ WCHAR NtSystemRoot[260];
+ ULONG MaxStackTraceDepth;
+ ULONG CryptoExponent;
+ ULONG TimeZoneId;
+ ULONG LargePageMinimum;
+ ULONG Reserved2[7];
+ NT_PRODUCT_TYPE NtProductType;
+ BOOLEAN ProductTypeIsValid;
+ ULONG NtMajorVersion;
+ ULONG NtMinorVersion;
+ BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX];
+ ULONG Reserved1;
+ ULONG Reserved3;
+ volatile ULONG TimeSlip;
+ ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture;
+ ULONG AltArchitecturePad[1];
+ LARGE_INTEGER SystemExpirationDate;
+ ULONG SuiteMask;
+ BOOLEAN KdDebuggerEnabled;
+#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
+ UCHAR NXSupportPolicy;
+#endif
+ volatile ULONG ActiveConsoleId;
+ volatile ULONG DismountCount;
+ ULONG ComPlusPackage;
+ ULONG LastSystemRITEventTickCount;
+ ULONG NumberOfPhysicalPages;
+ BOOLEAN SafeBootMode;
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+ union {
+ UCHAR TscQpcData;
+ struct {
+ UCHAR TscQpcEnabled:1;
+ UCHAR TscQpcSpareFlag:1;
+ UCHAR TscQpcShift:6;
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME;
+ UCHAR TscQpcPad[2];
+#endif
+#if (NTDDI_VERSION >= NTDDI_VISTA)
+ union {
+ ULONG SharedDataFlags;
+ struct {
+ ULONG DbgErrorPortPresent:1;
+ ULONG DbgElevationEnabled:1;
+ ULONG DbgVirtEnabled:1;
+ ULONG DbgInstallerDetectEnabled:1;
+ ULONG DbgSystemDllRelocated:1;
+ ULONG DbgDynProcessorEnabled:1;
+ ULONG DbgSEHValidationEnabled:1;
+ ULONG SpareBits:25;
+ } DUMMYSTRUCTNAME2;
+ } DUMMYUNIONNAME2;
+#else
+ ULONG TraceLogging;
+#endif
+ ULONG DataFlagsPad[1];
+ ULONGLONG TestRetInstruction;
+ ULONG SystemCall;
+ ULONG SystemCallReturn;
+ ULONGLONG SystemCallPad[3];
+ _ANONYMOUS_UNION union {
+ volatile KSYSTEM_TIME TickCount;
+ volatile ULONG64 TickCountQuad;
+ _ANONYMOUS_STRUCT struct {
+ ULONG ReservedTickCountOverlay[3];
+ ULONG TickCountPad[1];
+ } DUMMYSTRUCTNAME;
+ } DUMMYUNIONNAME3;
+ ULONG Cookie;
+ ULONG CookiePad[1];
+#if (NTDDI_VERSION >= NTDDI_WS03)
+ LONGLONG ConsoleSessionForegroundProcessId;
+ ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES];
+#endif
+#if (NTDDI_VERSION >= NTDDI_VISTA)
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+ USHORT UserModeGlobalLogger[16];
+#else
+ USHORT UserModeGlobalLogger[8];
+ ULONG HeapTracingPid[2];
+ ULONG CritSecTracingPid[2];
+#endif
+ ULONG ImageFileExecutionOptions;
+#if (NTDDI_VERSION >= NTDDI_VISTASP1)
+ ULONG LangGenerationCount;
+#else
+ /* 4 bytes padding */
+#endif
+ ULONGLONG Reserved5;
+ volatile ULONG64 InterruptTimeBias;
+#endif
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+ volatile ULONG64 TscQpcBias;
+ volatile ULONG ActiveProcessorCount;
+ volatile USHORT ActiveGroupCount;
+ USHORT Reserved4;
+ volatile ULONG AitSamplingValue;
+ volatile ULONG AppCompatFlag;
+ ULONGLONG SystemDllNativeRelocation;
+ ULONG SystemDllWowRelocation;
+ ULONG XStatePad[1];
+ XSTATE_CONFIGURATION XState;
+#endif
+} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA;
+
+#ifdef _X86_
+
+#define KERNEL_STACK_SIZE 12288
+#define KERNEL_LARGE_STACK_SIZE 61440
+#define KERNEL_LARGE_STACK_COMMIT 12288
+
+#define SIZE_OF_80387_REGISTERS 80
+
+#define PCR_MINOR_VERSION 1
+#define PCR_MAJOR_VERSION 1
+
+#if !defined(RC_INVOKED)
+
+#define CONTEXT_i386 0x10000
+#define CONTEXT_i486 0x10000
+#define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
+#define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
+#define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
+#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
+#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
+#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
+
+#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
+
+#endif /* !defined(RC_INVOKED) */
+
+typedef struct _KPCR {
+ union {
+ NT_TIB NtTib;
+ struct {
+ struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList;
+ PVOID Used_StackBase;
+ PVOID Spare2;
+ PVOID TssCopy;
+ ULONG ContextSwitches;
+ KAFFINITY SetMemberCopy;
+ PVOID Used_Self;
+ };
+ };
+ struct _KPCR *SelfPcr;
+ struct _KPRCB *Prcb;
+ KIRQL Irql;
+ ULONG IRR;
+ ULONG IrrActive;
+ ULONG IDR;
+ PVOID KdVersionBlock;
+ struct _KIDTENTRY *IDT;
+ struct _KGDTENTRY *GDT;
+ struct _KTSS *TSS;
+ USHORT MajorVersion;
+ USHORT MinorVersion;
+ KAFFINITY SetMember;
+ ULONG StallScaleFactor;
+ UCHAR SpareUnused;
+ UCHAR Number;
+ UCHAR Spare0;
+ UCHAR SecondLevelCacheAssociativity;
+ ULONG VdmAlert;
+ ULONG KernelReserved[14];
+ ULONG SecondLevelCacheSize;
+ ULONG HalReserved[16];
+} KPCR, *PKPCR;
+
+typedef struct _FLOATING_SAVE_AREA {
+ ULONG ControlWord;
+ ULONG StatusWord;
+ ULONG TagWord;
+ ULONG ErrorOffset;
+ ULONG ErrorSelector;
+ ULONG DataOffset;
+ ULONG DataSelector;
+ UCHAR RegisterArea[SIZE_OF_80387_REGISTERS];
+ ULONG Cr0NpxState;
+} FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
+
+#include "pshpack4.h"
+typedef struct _CONTEXT {
+ ULONG ContextFlags;
+ ULONG Dr0;
+ ULONG Dr1;
+ ULONG Dr2;
+ ULONG Dr3;
+ ULONG Dr6;
+ ULONG Dr7;
+ FLOATING_SAVE_AREA FloatSave;
+ ULONG SegGs;
+ ULONG SegFs;
+ ULONG SegEs;
+ ULONG SegDs;
+ ULONG Edi;
+ ULONG Esi;
+ ULONG Ebx;
+ ULONG Edx;
+ ULONG Ecx;
+ ULONG Eax;
+ ULONG Ebp;
+ ULONG Eip;
+ ULONG SegCs;
+ ULONG EFlags;
+ ULONG Esp;
+ ULONG SegSs;
+ UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
+} CONTEXT;
+#include "poppack.h"
+
+#endif /* _X86_ */
+
+#ifdef _AMD64_
+
+#if !defined(RC_INVOKED)
+
+#define CONTEXT_AMD64 0x100000
+
+#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
+#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
+#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
+#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
+#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
+
+#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
+#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS |
CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
+
+#define CONTEXT_XSTATE (CONTEXT_AMD64 | 0x20L)
+
+#define CONTEXT_EXCEPTION_ACTIVE 0x8000000
+#define CONTEXT_SERVICE_ACTIVE 0x10000000
+#define CONTEXT_EXCEPTION_REQUEST 0x40000000
+#define CONTEXT_EXCEPTION_REPORTING 0x80000000
+
+#endif /* RC_INVOKED */
+
+#endif /* _AMD64_ */
+
+typedef enum _INTERLOCKED_RESULT {
+ ResultNegative = RESULT_NEGATIVE,
+ ResultZero = RESULT_ZERO,
+ ResultPositive = RESULT_POSITIVE
+} INTERLOCKED_RESULT;
+
+typedef struct _OSVERSIONINFOA {
+ ULONG dwOSVersionInfoSize;
+ ULONG dwMajorVersion;
+ ULONG dwMinorVersion;
+ ULONG dwBuildNumber;
+ ULONG dwPlatformId;
+ CHAR szCSDVersion[128];
+} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
+
+typedef struct _OSVERSIONINFOW {
+ ULONG dwOSVersionInfoSize;
+ ULONG dwMajorVersion;
+ ULONG dwMinorVersion;
+ ULONG dwBuildNumber;
+ ULONG dwPlatformId;
+ WCHAR szCSDVersion[128];
+} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW,
*PRTL_OSVERSIONINFOW;
+
+typedef struct _OSVERSIONINFOEXA {
+ ULONG dwOSVersionInfoSize;
+ ULONG dwMajorVersion;
+ ULONG dwMinorVersion;
+ ULONG dwBuildNumber;
+ ULONG dwPlatformId;
+ CHAR szCSDVersion[128];
+ USHORT wServicePackMajor;
+ USHORT wServicePackMinor;
+ USHORT wSuiteMask;
+ UCHAR wProductType;
+ UCHAR wReserved;
+} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
+
+typedef struct _OSVERSIONINFOEXW {
+ ULONG dwOSVersionInfoSize;
+ ULONG dwMajorVersion;
+ ULONG dwMinorVersion;
+ ULONG dwBuildNumber;
+ ULONG dwPlatformId;
+ WCHAR szCSDVersion[128];
+ USHORT wServicePackMajor;
+ USHORT wServicePackMinor;
+ USHORT wSuiteMask;
+ UCHAR wProductType;
+ UCHAR wReserved;
+} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW,
*PRTL_OSVERSIONINFOEXW;
+
+#ifdef UNICODE
+typedef OSVERSIONINFOEXW OSVERSIONINFOEX;
+typedef POSVERSIONINFOEXW POSVERSIONINFOEX;
+typedef LPOSVERSIONINFOEXW LPOSVERSIONINFOEX;
+typedef OSVERSIONINFOW OSVERSIONINFO;
+typedef POSVERSIONINFOW POSVERSIONINFO;
+typedef LPOSVERSIONINFOW LPOSVERSIONINFO;
+#else
+typedef OSVERSIONINFOEXA OSVERSIONINFOEX;
+typedef POSVERSIONINFOEXA POSVERSIONINFOEX;
+typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX;
+typedef OSVERSIONINFOA OSVERSIONINFO;
+typedef POSVERSIONINFOA POSVERSIONINFO;
+typedef LPOSVERSIONINFOA LPOSVERSIONINFO;
+#endif /* UNICODE */
+
+/* Executive Types */
+
+#define PROTECTED_POOL 0x80000000
+
+typedef struct _ZONE_SEGMENT_HEADER {
+ SINGLE_LIST_ENTRY SegmentList;
+ PVOID Reserved;
+} ZONE_SEGMENT_HEADER, *PZONE_SEGMENT_HEADER;
+
+typedef struct _ZONE_HEADER {
+ SINGLE_LIST_ENTRY FreeList;
+ SINGLE_LIST_ENTRY SegmentList;
+ ULONG BlockSize;
+ ULONG TotalSegmentSize;
+} ZONE_HEADER, *PZONE_HEADER;
+
+/* Executive Functions */
+
+static __inline PVOID
+ExAllocateFromZone(
+ IN PZONE_HEADER Zone)
+{
+ if (Zone->FreeList.Next)
+ Zone->FreeList.Next = Zone->FreeList.Next->Next;
+ return (PVOID) Zone->FreeList.Next;
+}
+
+static __inline PVOID
+ExFreeToZone(
+ IN PZONE_HEADER Zone,
+ IN PVOID Block)
+{
+ ((PSINGLE_LIST_ENTRY) Block)->Next = Zone->FreeList.Next;
+ Zone->FreeList.Next = ((PSINGLE_LIST_ENTRY) Block);
+ return ((PSINGLE_LIST_ENTRY) Block)->Next;
+}
+
+/*
+ * PVOID
+ * ExInterlockedAllocateFromZone(
+ * IN PZONE_HEADER Zone,
+ * IN PKSPIN_LOCK Lock)
+ */
+#define ExInterlockedAllocateFromZone(Zone, Lock) \
+ ((PVOID) ExInterlockedPopEntryList(&Zone->FreeList, Lock))
+
+/* PVOID
+ * ExInterlockedFreeToZone(
+ * IN PZONE_HEADER Zone,
+ * IN PVOID Block,
+ * IN PKSPIN_LOCK Lock);
+ */
+#define ExInterlockedFreeToZone(Zone, Block, Lock) \
+ ExInterlockedPushEntryList(&(Zone)->FreeList, (PSINGLE_LIST_ENTRY)(Block),
Lock)
+
+/*
+ * BOOLEAN
+ * ExIsFullZone(
+ * IN PZONE_HEADER Zone)
+ */
+#define ExIsFullZone(Zone) \
+ ((Zone)->FreeList.Next == (PSINGLE_LIST_ENTRY) NULL)
+
+/* BOOLEAN
+ * ExIsObjectInFirstZoneSegment(
+ * IN PZONE_HEADER Zone,
+ * IN PVOID Object);
+ */
+#define ExIsObjectInFirstZoneSegment(Zone,Object) \
+ ((BOOLEAN)( ((PUCHAR)(Object) >= (PUCHAR)(Zone)->SegmentList.Next) &&
\
+ ((PUCHAR)(Object) < (PUCHAR)(Zone)->SegmentList.Next + \
+ (Zone)->TotalSegmentSize)) )
+
+#define ExAcquireResourceExclusive ExAcquireResourceExclusiveLite
+#define ExAcquireResourceShared ExAcquireResourceSharedLite
+#define ExConvertExclusiveToShared ExConvertExclusiveToSharedLite
+#define ExDeleteResource ExDeleteResourceLite
+#define ExInitializeResource ExInitializeResourceLite
+#define ExIsResourceAcquiredExclusive ExIsResourceAcquiredExclusiveLite
+#define ExIsResourceAcquiredShared ExIsResourceAcquiredSharedLite
+#define ExIsResourceAcquired ExIsResourceAcquiredSharedLite
+#define ExReleaseResourceForThread ExReleaseResourceForThreadLite
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+ExExtendZone(
+ IN OUT PZONE_HEADER Zone,
+ IN OUT PVOID Segment,
+ IN ULONG SegmentSize);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+ExInitializeZone(
+ OUT PZONE_HEADER Zone,
+ IN ULONG BlockSize,
+ IN OUT PVOID InitialSegment,
+ IN ULONG InitialSegmentSize);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+ExInterlockedExtendZone(
+ IN OUT PZONE_HEADER Zone,
+ IN OUT PVOID Segment,
+ IN ULONG SegmentSize,
+ IN OUT PKSPIN_LOCK Lock);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+ExUuidCreate(
+ OUT UUID *Uuid);
+
+NTKERNELAPI
+DECLSPEC_NORETURN
+VOID
+NTAPI
+ExRaiseAccessViolation(
+ VOID);
+
+NTKERNELAPI
+DECLSPEC_NORETURN
+VOID
+NTAPI
+ExRaiseDatatypeMisalignment(
+ VOID);
+
+#endif
+
+#ifdef _X86_
+
+NTKERNELAPI
+INTERLOCKED_RESULT
+FASTCALL
+Exfi386InterlockedIncrementLong(
+ IN OUT LONG volatile *Addend);
+
+NTKERNELAPI
+INTERLOCKED_RESULT
+FASTCALL
+Exfi386InterlockedDecrementLong(
+ IN PLONG Addend);
+
+NTKERNELAPI
+ULONG
+FASTCALL
+Exfi386InterlockedExchangeUlong(
+ IN PULONG Target,
+ IN ULONG Value);
+
+#endif /* _X86_ */
+
+#ifndef _ARC_DDK_
+#define _ARC_DDK_
+typedef enum _CONFIGURATION_TYPE {
+ ArcSystem,
+ CentralProcessor,
+ FloatingPointProcessor,
+ PrimaryIcache,
+ PrimaryDcache,
+ SecondaryIcache,
+ SecondaryDcache,
+ SecondaryCache,
+ EisaAdapter,
+ TcAdapter,
+ ScsiAdapter,
+ DtiAdapter,
+ MultiFunctionAdapter,
+ DiskController,
+ TapeController,
+ CdromController,
+ WormController,
+ SerialController,
+ NetworkController,
+ DisplayController,
+ ParallelController,
+ PointerController,
+ KeyboardController,
+ AudioController,
+ OtherController,
+ DiskPeripheral,
+ FloppyDiskPeripheral,
+ TapePeripheral,
+ ModemPeripheral,
+ MonitorPeripheral,
+ PrinterPeripheral,
+ PointerPeripheral,
+ KeyboardPeripheral,
+ TerminalPeripheral,
+ OtherPeripheral,
+ LinePeripheral,
+ NetworkPeripheral,
+ SystemMemory,
+ DockingInformation,
+ RealModeIrqRoutingTable,
+ RealModePCIEnumeration,
+ MaximumType
+} CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
+#endif /* !_ARC_DDK_ */
+
+typedef struct _CONTROLLER_OBJECT {
+ CSHORT Type;
+ CSHORT Size;
+ PVOID ControllerExtension;
+ KDEVICE_QUEUE DeviceWaitQueue;
+ ULONG Spare1;
+ LARGE_INTEGER Spare2;
+} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT;
+
+typedef struct _CONFIGURATION_INFORMATION {
+ ULONG DiskCount;
+ ULONG FloppyCount;
+ ULONG CdRomCount;
+ ULONG TapeCount;
+ ULONG ScsiPortCount;
+ ULONG SerialCount;
+ ULONG ParallelCount;
+ BOOLEAN AtDiskPrimaryAddressClaimed;
+ BOOLEAN AtDiskSecondaryAddressClaimed;
+ ULONG Version;
+ ULONG MediumChangerCount;
+} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
+
+typedef
+NTSTATUS
+(NTAPI *PIO_QUERY_DEVICE_ROUTINE)(
+ IN PVOID Context,
+ IN PUNICODE_STRING PathName,
+ IN INTERFACE_TYPE BusType,
+ IN ULONG BusNumber,
+ IN PKEY_VALUE_FULL_INFORMATION *BusInformation,
+ IN CONFIGURATION_TYPE ControllerType,
+ IN ULONG ControllerNumber,
+ IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation,
+ IN CONFIGURATION_TYPE PeripheralType,
+ IN ULONG PeripheralNumber,
+ IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation);
+
+typedef
+VOID
+(NTAPI DRIVER_REINITIALIZE)(
+ IN struct _DRIVER_OBJECT *DriverObject,
+ IN PVOID Context,
+ IN ULONG Count);
+
+typedef DRIVER_REINITIALIZE *PDRIVER_REINITIALIZE;
+
+/** Filesystem runtime library routines **/
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+NTKERNELAPI
+BOOLEAN
+NTAPI
+FsRtlIsTotalDeviceFailure(
+ IN NTSTATUS Status);
+#endif
+
+/* Hardware Abstraction Layer Types */
+
+typedef VOID
+(NTAPI *PciPin2Line)(
+ IN struct _BUS_HANDLER *BusHandler,
+ IN struct _BUS_HANDLER *RootHandler,
+ IN PCI_SLOT_NUMBER SlotNumber,
+ IN PPCI_COMMON_CONFIG PciData);
+
+typedef VOID
+(NTAPI *PciLine2Pin)(
+ IN struct _BUS_HANDLER *BusHandler,
+ IN struct _BUS_HANDLER *RootHandler,
+ IN PCI_SLOT_NUMBER SlotNumber,
+ IN PPCI_COMMON_CONFIG PciNewData,
+ IN PPCI_COMMON_CONFIG PciOldData);
+
+typedef VOID
+(NTAPI *PciReadWriteConfig)(
+ IN struct _BUS_HANDLER *BusHandler,
+ IN PCI_SLOT_NUMBER Slot,
+ IN PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length);
+
+#define PCI_DATA_TAG ' ICP'
+#define PCI_DATA_VERSION 1
+
+typedef struct _PCIBUSDATA {
+ ULONG Tag;
+ ULONG Version;
+ PciReadWriteConfig ReadConfig;
+ PciReadWriteConfig WriteConfig;
+ PciPin2Line Pin2Line;
+ PciLine2Pin Line2Pin;
+ PCI_SLOT_NUMBER ParentSlot;
+ PVOID Reserved[4];
+} PCIBUSDATA, *PPCIBUSDATA;
+
+typedef
+PVOID
+(NTAPI *pHalGetAcpiTable)(
+ IN ULONG Signature,
+ IN PCSTR OemId OPTIONAL,
+ IN PCSTR OemTableId OPTIONAL);
+
+typedef
+VOID
+(NTAPI *PCI_ERROR_HANDLER_CALLBACK)(
+ VOID);
+
+typedef
+VOID
+(NTAPI *pHalSetPciErrorHandlerCallback)(
+ IN PCI_ERROR_HANDLER_CALLBACK Callback);
+
+#if 1 /* Not present in WDK 7600 */
+typedef VOID
+(FASTCALL *pHalIoAssignDriveLetters)(
+ IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
+ IN PSTRING NtDeviceName,
+ OUT PUCHAR NtSystemPath,
+ OUT PSTRING NtSystemPathString);
+#endif
+
+/* Hardware Abstraction Layer Functions */
+
+#if !defined(NO_LEGACY_DRIVERS)
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
+NTHALAPI
+NTSTATUS
+NTAPI
+HalAssignSlotResources(
+ IN PUNICODE_STRING RegistryPath,
+ IN PUNICODE_STRING DriverClassName,
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN INTERFACE_TYPE BusType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ IN OUT PCM_RESOURCE_LIST *AllocatedResources);
+
+NTHALAPI
+ULONG
+NTAPI
+HalGetInterruptVector(
+ IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber,
+ IN ULONG BusInterruptLevel,
+ IN ULONG BusInterruptVector,
+ OUT PKIRQL Irql,
+ OUT PKAFFINITY Affinity);
+
+NTHALAPI
+ULONG
+NTAPI
+HalSetBusData(
+ IN BUS_DATA_TYPE BusDataType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ IN PVOID Buffer,
+ IN ULONG Length);
+
+#endif
+
+#endif /* !defined(NO_LEGACY_DRIVERS) */
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
+NTHALAPI
+PADAPTER_OBJECT
+NTAPI
+HalGetAdapter(
+ IN PDEVICE_DESCRIPTION DeviceDescription,
+ IN OUT PULONG NumberOfMapRegisters);
+
+NTHALAPI
+BOOLEAN
+NTAPI
+HalMakeBeep(
+ IN ULONG Frequency);
+
+VOID
+NTAPI
+HalPutDmaAdapter(
+ IN PADAPTER_OBJECT DmaAdapter);
+
+NTHALAPI
+VOID
+NTAPI
+HalAcquireDisplayOwnership(
+ IN PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
+
+NTHALAPI
+ULONG
+NTAPI
+HalGetBusData(
+ IN BUS_DATA_TYPE BusDataType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ OUT PVOID Buffer,
+ IN ULONG Length);
+
+NTHALAPI
+ULONG
+NTAPI
+HalGetBusDataByOffset(
+ IN BUS_DATA_TYPE BusDataType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ OUT PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length);
+
+NTHALAPI
+ULONG
+NTAPI
+HalSetBusDataByOffset(
+ IN BUS_DATA_TYPE BusDataType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ IN PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length);
+
+NTHALAPI
+BOOLEAN
+NTAPI
+HalTranslateBusAddress(
+ IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber,
+ IN PHYSICAL_ADDRESS BusAddress,
+ IN OUT PULONG AddressSpace,
+ OUT PPHYSICAL_ADDRESS TranslatedAddress);
+
+#endif
+
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+NTKERNELAPI
+VOID
+FASTCALL
+HalExamineMBR(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG MBRTypeIdentifier,
+ OUT PVOID *Buffer);
+#endif
+
+#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) ||
defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
+// nothing here
+#else
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+VOID
+NTAPI
+IoFreeAdapterChannel(
+ IN PADAPTER_OBJECT AdapterObject);
+
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+BOOLEAN
+NTAPI
+IoFlushAdapterBuffers(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN PMDL Mdl,
+ IN PVOID MapRegisterBase,
+ IN PVOID CurrentVa,
+ IN ULONG Length,
+ IN BOOLEAN WriteToDevice);
+
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+VOID
+NTAPI
+IoFreeMapRegisters(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN PVOID MapRegisterBase,
+ IN ULONG NumberOfMapRegisters);
+
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+PVOID
+NTAPI
+HalAllocateCommonBuffer(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN ULONG Length,
+ OUT PPHYSICAL_ADDRESS LogicalAddress,
+ IN BOOLEAN CacheEnabled);
+
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+VOID
+NTAPI
+HalFreeCommonBuffer(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN ULONG Length,
+ IN PHYSICAL_ADDRESS LogicalAddress,
+ IN PVOID VirtualAddress,
+ IN BOOLEAN CacheEnabled);
+
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+ULONG
+NTAPI
+HalReadDmaCounter(
+ IN PADAPTER_OBJECT AdapterObject);
+
+NTHALAPI
+NTSTATUS
+NTAPI
+HalAllocateAdapterChannel(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN PWAIT_CONTEXT_BLOCK Wcb,
+ IN ULONG NumberOfMapRegisters,
+ IN PDRIVER_CONTROL ExecutionRoutine);
+
+#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
+
+#endif /* defined(USE_DMA_MACROS) && !defined(_NTHAL_) &&
(defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) */
+
+/* I/O Manager Functions */
+
+/*
+ * VOID IoAssignArcName(
+ * IN PUNICODE_STRING ArcName,
+ * IN PUNICODE_STRING DeviceName);
+ */
+#define IoAssignArcName(_ArcName, _DeviceName) ( \
+ IoCreateSymbolicLink((_ArcName), (_DeviceName)))
+
+/*
+ * VOID
+ * IoDeassignArcName(
+ * IN PUNICODE_STRING ArcName)
+ */
+#define IoDeassignArcName IoDeleteSymbolicLink
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
+#if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) ||
defined(_WDM_INCLUDED_))
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoAllocateAdapterChannel(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG NumberOfMapRegisters,
+ IN PDRIVER_CONTROL ExecutionRoutine,
+ IN PVOID Context);
+#endif
+
+//DECLSPEC_DEPRECATED_DDK
+NTHALAPI
+PHYSICAL_ADDRESS
+NTAPI
+IoMapTransfer(
+ IN PADAPTER_OBJECT AdapterObject,
+ IN PMDL Mdl,
+ IN PVOID MapRegisterBase,
+ IN PVOID CurrentVa,
+ IN OUT PULONG Length,
+ IN BOOLEAN WriteToDevice);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoAllocateController(
+ IN PCONTROLLER_OBJECT ControllerObject,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PDRIVER_CONTROL ExecutionRoutine,
+ IN PVOID Context OPTIONAL);
+
+NTKERNELAPI
+PCONTROLLER_OBJECT
+NTAPI
+IoCreateController(
+ IN ULONG Size);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoDeleteController(
+ IN PCONTROLLER_OBJECT ControllerObject);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoFreeController(
+ IN PCONTROLLER_OBJECT ControllerObject);
+
+NTKERNELAPI
+PCONFIGURATION_INFORMATION
+NTAPI
+IoGetConfigurationInformation(
+ VOID);
+
+NTKERNELAPI
+PDEVICE_OBJECT
+NTAPI
+IoGetDeviceToVerify(
+ IN PETHREAD Thread);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoCancelFileOpen(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PFILE_OBJECT FileObject);
+
+NTKERNELAPI
+PGENERIC_MAPPING
+NTAPI
+IoGetFileObjectGenericMapping(
+ VOID);
+
+NTKERNELAPI
+PIRP
+NTAPI
+IoMakeAssociatedIrp(
+ IN PIRP Irp,
+ IN CCHAR StackSize);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoQueryDeviceDescription(
+ IN PINTERFACE_TYPE BusType OPTIONAL,
+ IN PULONG BusNumber OPTIONAL,
+ IN PCONFIGURATION_TYPE ControllerType OPTIONAL,
+ IN PULONG ControllerNumber OPTIONAL,
+ IN PCONFIGURATION_TYPE PeripheralType OPTIONAL,
+ IN PULONG PeripheralNumber OPTIONAL,
+ IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
+ IN OUT PVOID Context OPTIONAL);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoRaiseHardError(
+ IN PIRP Irp,
+ IN PVPB Vpb OPTIONAL,
+ IN PDEVICE_OBJECT RealDeviceObject);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+IoRaiseInformationalHardError(
+ IN NTSTATUS ErrorStatus,
+ IN PUNICODE_STRING String OPTIONAL,
+ IN PKTHREAD Thread OPTIONAL);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoRegisterBootDriverReinitialization(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDRIVER_REINITIALIZE DriverReinitializationRoutine,
+ IN PVOID Context OPTIONAL);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoRegisterDriverReinitialization(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDRIVER_REINITIALIZE DriverReinitializationRoutine,
+ IN PVOID Context OPTIONAL);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoAttachDeviceByPointer(
+ IN PDEVICE_OBJECT SourceDevice,
+ IN PDEVICE_OBJECT TargetDevice);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoReportDetectedDevice(
+ IN PDRIVER_OBJECT DriverObject,
+ IN INTERFACE_TYPE LegacyBusType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ IN PCM_RESOURCE_LIST ResourceList OPTIONAL,
+ IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL,
+ IN BOOLEAN ResourceAssigned,
+ IN OUT PDEVICE_OBJECT *DeviceObject);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoReportResourceForDetection(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PCM_RESOURCE_LIST DriverList OPTIONAL,
+ IN ULONG DriverListSize OPTIONAL,
+ IN PDEVICE_OBJECT DeviceObject OPTIONAL,
+ IN PCM_RESOURCE_LIST DeviceList OPTIONAL,
+ IN ULONG DeviceListSize OPTIONAL,
+ OUT PBOOLEAN ConflictDetected);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoReportResourceUsage(
+ IN PUNICODE_STRING DriverClassName OPTIONAL,
+ IN PDRIVER_OBJECT DriverObject,
+ IN PCM_RESOURCE_LIST DriverList OPTIONAL,
+ IN ULONG DriverListSize OPTIONAL,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PCM_RESOURCE_LIST DeviceList OPTIONAL,
+ IN ULONG DeviceListSize OPTIONAL,
+ IN BOOLEAN OverrideConflict,
+ OUT PBOOLEAN ConflictDetected);
+
+NTKERNELAPI
+VOID
+NTAPI
+IoSetHardErrorOrVerifyDevice(
+ IN PIRP Irp,
+ IN PDEVICE_OBJECT DeviceObject);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoAssignResources(
+ IN PUNICODE_STRING RegistryPath,
+ IN PUNICODE_STRING DriverClassName OPTIONAL,
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT DeviceObject OPTIONAL,
+ IN PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources OPTIONAL,
+ IN OUT PCM_RESOURCE_LIST *AllocatedResources);
+
+#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
+
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoCreateDisk(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN struct _CREATE_DISK* Disk OPTIONAL);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoReadDiskSignature(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG BytesPerSector,
+ OUT PDISK_SIGNATURE Signature);
+
+NTKERNELAPI
+NTSTATUS
+FASTCALL
+IoReadPartitionTable(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN BOOLEAN ReturnRecognizedPartitions,
+ OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoReadPartitionTableEx(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN struct _DRIVE_LAYOUT_INFORMATION_EX **PartitionBuffer);
+
+NTKERNELAPI
+NTSTATUS
+FASTCALL
+IoSetPartitionInformation(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG PartitionNumber,
+ IN ULONG PartitionType);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoSetPartitionInformationEx(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG PartitionNumber,
+ IN struct _SET_PARTITION_INFORMATION_EX *PartitionInfo);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoSetSystemPartition(
+ IN PUNICODE_STRING VolumeNameString);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+IoSetThreadHardErrorMode(
+ IN BOOLEAN EnableHardErrors);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoVerifyPartitionTable(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN BOOLEAN FixErrors);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoVolumeDeviceToDosName(
+ IN PVOID VolumeDeviceObject,
+ OUT PUNICODE_STRING DosName);
+
+NTKERNELAPI
+NTSTATUS
+FASTCALL
+IoWritePartitionTable(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG SectorsPerTrack,
+ IN ULONG NumberOfHeads,
+ IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoWritePartitionTableEx(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN struct _DRIVE_LAYOUT_INFORMATION_EX *DriveLayout);
+
+#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
+
+/** Kernel debugger routines **/
+
+NTSYSAPI
+ULONG
+NTAPI
+DbgPrompt(
+ IN PCCH Prompt,
+ OUT PCH Response,
+ IN ULONG MaximumResponseLength);
+
+/* Kernel Functions */
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
+NTKERNELAPI
+DECLSPEC_NORETURN
+VOID
+NTAPI
+KeBugCheck(
+ IN ULONG BugCheckCode);
+
+NTKERNELAPI
+LONG
+NTAPI
+KePulseEvent(
+ IN OUT PRKEVENT Event,
+ IN KPRIORITY Increment,
+ IN BOOLEAN Wait);
+
+NTKERNELAPI
+LONG
+NTAPI
+KeSetBasePriorityThread(
+ IN OUT PRKTHREAD Thread,
+ IN LONG Increment);
+
+#endif
+
+/* Memory Manager Types */
+
+typedef struct _PHYSICAL_MEMORY_RANGE {
+ PHYSICAL_ADDRESS BaseAddress;
+ LARGE_INTEGER NumberOfBytes;
+} PHYSICAL_MEMORY_RANGE, *PPHYSICAL_MEMORY_RANGE;
+
+/* Memory Manager Functions */
+
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
+
+NTKERNELAPI
+PPHYSICAL_MEMORY_RANGE
+NTAPI
+MmGetPhysicalMemoryRanges(
+ VOID);
+
+NTKERNELAPI
+PHYSICAL_ADDRESS
+NTAPI
+MmGetPhysicalAddress(
+ IN PVOID BaseAddress);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+MmIsNonPagedSystemAddressValid(
+ IN PVOID VirtualAddress);
+
+NTKERNELAPI
+PVOID
+NTAPI
+MmAllocateNonCachedMemory(
+ IN SIZE_T NumberOfBytes);
+
+NTKERNELAPI
+VOID
+NTAPI
+MmFreeNonCachedMemory(
+ IN PVOID BaseAddress,
+ IN SIZE_T NumberOfBytes);
+
+NTKERNELAPI
+PVOID
+NTAPI
+MmGetVirtualForPhysical(
+ IN PHYSICAL_ADDRESS PhysicalAddress);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+MmMapUserAddressesToPage(
+ IN PVOID BaseAddress,
+ IN SIZE_T NumberOfBytes,
+ IN PVOID PageAddress);
+
+NTKERNELAPI
+PVOID
+NTAPI
+MmMapVideoDisplay(
+ IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN SIZE_T NumberOfBytes,
+ IN MEMORY_CACHING_TYPE CacheType);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+MmMapViewInSessionSpace(
+ IN PVOID Section,
+ OUT PVOID *MappedBase,
+ IN OUT PSIZE_T ViewSize);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+MmMapViewInSystemSpace(
+ IN PVOID Section,
+ OUT PVOID *MappedBase,
+ IN OUT PSIZE_T ViewSize);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+MmIsAddressValid(
+ IN PVOID VirtualAddress);
+
+NTKERNELAPI
+BOOLEAN
+NTAPI
+MmIsThisAnNtAsSystem(
+ VOID);
+
+NTKERNELAPI
+VOID
+NTAPI
+MmLockPagableSectionByHandle(
+ IN PVOID ImageSectionHandle);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+MmUnmapViewInSessionSpace(
+ IN PVOID MappedBase);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+MmUnmapViewInSystemSpace(
+ IN PVOID MappedBase);
+
+NTKERNELAPI
+VOID
+NTAPI
+MmUnsecureVirtualMemory(
+ IN HANDLE SecureHandle);
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+MmRemovePhysicalMemory(
+ IN PPHYSICAL_ADDRESS StartAddress,
+ IN OUT PLARGE_INTEGER NumberOfBytes);
+
+NTKERNELAPI
+HANDLE
+NTAPI
+MmSecureVirtualMemory(
+ IN PVOID Address,
+ IN SIZE_T Size,
+ IN ULONG ProbeMode);
+
+NTKERNELAPI
+VOID
+NTAPI
+MmUnmapVideoDisplay(
+ IN PVOID BaseAddress,
+ IN SIZE_T NumberOfBytes);
+
+#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
+
/* NtXxx Functions */
NTSYSCALLAPI
@@ -2098,36 +2382,20 @@
/** Process manager types **/
-typedef struct _IMAGE_INFO {
- _ANONYMOUS_UNION union {
- ULONG Properties;
- _ANONYMOUS_STRUCT struct {
- ULONG ImageAddressingMode : 8;
- ULONG SystemModeImage : 1;
- ULONG ImageMappedToAllPids : 1;
- ULONG Reserved : 22;
- } DUMMYSTRUCTNAME;
- } DUMMYUNIONNAME;
- PVOID ImageBase;
- ULONG ImageSelector;
- SIZE_T ImageSize;
- ULONG ImageSectionNumber;
-} IMAGE_INFO, *PIMAGE_INFO;
-
typedef VOID
-(DDKAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)(
+(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)(
IN HANDLE ParentId,
IN HANDLE ProcessId,
IN BOOLEAN Create);
typedef VOID
-(DDKAPI *PCREATE_THREAD_NOTIFY_ROUTINE)(
+(NTAPI *PCREATE_THREAD_NOTIFY_ROUTINE)(
IN HANDLE ProcessId,
IN HANDLE ThreadId,
IN BOOLEAN Create);
typedef VOID
-(DDKAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)(
+(NTAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)(
IN PUNICODE_STRING FullImageName,
IN HANDLE ProcessId,
IN PIMAGE_INFO ImageInfo);
@@ -2404,12 +2672,6 @@
IN KPROCESSOR_MODE PreviousMode);
#endif
-typedef VOID
-(DDKAPI *PTIMER_APC_ROUTINE)(
- IN PVOID TimerContext,
- IN ULONG TimerLowValue,
- IN LONG TimerHighValue);
-
/* ZwXxx Functions */
#if (NTDDI_VERSION >= NTDDI_WIN2K)
Modified: branches/header-work/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/winddk.…
==============================================================================
--- branches/header-work/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/header-work/include/ddk/winddk.h [iso-8859-1] Thu Mar 11 18:27:44 2010
@@ -325,115 +325,11 @@
OUT PKINTERRUPT_POLARITY Polarity
);
-typedef
-PVOID
-(DDKAPI *pKdMapPhysicalMemory64)(
- IN PHYSICAL_ADDRESS PhysicalAddress,
- IN ULONG NumberPages
-);
-
-typedef
-VOID
-(DDKAPI *pKdUnmapVirtualAddress)(
- IN PVOID VirtualAddress,
- IN ULONG NumberPages
-);
-
-typedef
-ULONG
-(DDKAPI *pKdGetPciDataByOffset)(
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- OUT PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length
-);
-
-typedef
-ULONG
-(DDKAPI *pKdSetPciDataByOffset)(
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length
-);
-
-typedef struct _FILE_ALIGNMENT_INFORMATION {
- ULONG AlignmentRequirement;
-} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION;
-
-typedef struct _FILE_NAME_INFORMATION {
- ULONG FileNameLength;
- WCHAR FileName[1];
-} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;
-
-
-typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION {
- ULONG FileAttributes;
- ULONG ReparseTag;
-} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
-
-typedef struct _FILE_DISPOSITION_INFORMATION {
- BOOLEAN DeleteFile;
-} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION;
-
-typedef struct _FILE_END_OF_FILE_INFORMATION {
- LARGE_INTEGER EndOfFile;
-} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION;
-
-typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION {
- LARGE_INTEGER ValidDataLength;
-} FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
-
-typedef union _FILE_SEGMENT_ELEMENT {
- PVOID64 Buffer;
- ULONGLONG Alignment;
-}FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
-
-#define SE_UNSOLICITED_INPUT_PRIVILEGE 6
-
typedef struct _KEY_USER_FLAGS_INFORMATION {
ULONG UserFlags;
} KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
#define PCI_ADDRESS_MEMORY_SPACE 0x00000000
-
-NTSYSAPI
-ULONGLONG
-DDKAPI
-VerSetConditionMask(
- IN ULONGLONG ConditionMask,
- IN ULONG TypeMask,
- IN UCHAR Condition);
-
-#define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
- ((ConditionMask) = VerSetConditionMask((ConditionMask), \
- (TypeBitMask), (ComparisonType)))
-
-/* RtlVerifyVersionInfo() TypeMask */
-
-#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
-
-/* RtlVerifyVersionInfo() ComparisonType */
-
-#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
struct _RTL_RANGE;
@@ -442,107 +338,6 @@
PVOID Context,
struct _RTL_RANGE *Range
);
-
-typedef enum _IO_QUERY_DEVICE_DATA_FORMAT {
- IoQueryDeviceIdentifier = 0,
- IoQueryDeviceConfigurationData,
- IoQueryDeviceComponentInformation,
- IoQueryDeviceMaxData
-} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT;
-
-
-
-#define IMAGE_ADDRESSING_MODE_32BIT 3
-
-typedef struct _NT_TIB {
- struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
- PVOID StackBase;
- PVOID StackLimit;
- PVOID SubSystemTib;
- _ANONYMOUS_UNION union {
- PVOID FiberData;
- ULONG Version;
- } DUMMYUNIONNAME;
- PVOID ArbitraryUserPointer;
- struct _NT_TIB *Self;
-} NT_TIB, *PNT_TIB;
-
-typedef struct _NT_TIB32 {
- ULONG ExceptionList;
- ULONG StackBase;
- ULONG StackLimit;
- ULONG SubSystemTib;
- __GNU_EXTENSION union {
- ULONG FiberData;
- ULONG Version;
- };
- ULONG ArbitraryUserPointer;
- ULONG Self;
-} NT_TIB32,*PNT_TIB32;
-
-typedef struct _NT_TIB64 {
- ULONG64 ExceptionList;
- ULONG64 StackBase;
- ULONG64 StackLimit;
- ULONG64 SubSystemTib;
- __GNU_EXTENSION union {
- ULONG64 FiberData;
- ULONG Version;
- };
- ULONG64 ArbitraryUserPointer;
- ULONG64 Self;
-} NT_TIB64,*PNT_TIB64;
-
-typedef struct _PROCESS_BASIC_INFORMATION
-{
- NTSTATUS ExitStatus;
- struct _PEB *PebBaseAddress;
- ULONG_PTR AffinityMask;
- KPRIORITY BasePriority;
- ULONG_PTR UniqueProcessId;
- ULONG_PTR InheritedFromUniqueProcessId;
-} PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION;
-
-typedef struct _PROCESS_WS_WATCH_INFORMATION
-{
- PVOID FaultingPc;
- PVOID FaultingVa;
-} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION;
-
-typedef struct _PROCESS_DEVICEMAP_INFORMATION
-{
- __GNU_EXTENSION union
- {
- struct
- {
- HANDLE DirectoryHandle;
- } Set;
- struct
- {
- ULONG DriveMap;
- UCHAR DriveType[32];
- } Query;
- };
-} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
-
-typedef struct _KERNEL_USER_TIMES
-{
- LARGE_INTEGER CreateTime;
- LARGE_INTEGER ExitTime;
- LARGE_INTEGER KernelTime;
- LARGE_INTEGER UserTime;
-} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
-
-typedef struct _PROCESS_ACCESS_TOKEN
-{
- HANDLE Token;
- HANDLE Thread;
-} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN;
-
-typedef struct _PROCESS_SESSION_INFORMATION
-{
- ULONG SessionId;
-} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
/*
** Storage structures
@@ -575,38 +370,11 @@
IN HANDLE ThreadId,
IN KPROCESSOR_MODE Mode);
-typedef ULONG_PTR
-(NTAPI *PDRIVER_VERIFIER_THUNK_ROUTINE)(
- IN PVOID Context);
-
-typedef struct _DRIVER_VERIFIER_THUNK_PAIRS {
- PDRIVER_VERIFIER_THUNK_ROUTINE PristineRoutine;
- PDRIVER_VERIFIER_THUNK_ROUTINE NewRoutine;
-} DRIVER_VERIFIER_THUNK_PAIRS, *PDRIVER_VERIFIER_THUNK_PAIRS;
-
-#define DRIVER_VERIFIER_SPECIAL_POOLING 0x0001
-#define DRIVER_VERIFIER_FORCE_IRQL_CHECKING 0x0002
-#define DRIVER_VERIFIER_INJECT_ALLOCATION_FAILURES 0x0004
-#define DRIVER_VERIFIER_TRACK_POOL_ALLOCATIONS 0x0008
-#define DRIVER_VERIFIER_IO_CHECKING 0x0010
-
/*
** Architecture specific structures
*/
-#define PCR_MINOR_VERSION 1
-#define PCR_MAJOR_VERSION 1
#ifdef _X86_
-
-#define CONTEXT_i386 0x10000
-#define CONTEXT_i486 0x10000
-#define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
-#define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
-#define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
-#define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
-#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
-#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
-#define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
typedef struct _KPCR_TIB {
PVOID ExceptionList; /* 00 */
@@ -620,32 +388,6 @@
PVOID ArbitraryUserPointer; /* 14 */
struct _KPCR_TIB *Self; /* 18 */
} KPCR_TIB, *PKPCR_TIB; /* 1C */
-
-typedef struct _KPCR {
- KPCR_TIB Tib; /* 00 */
- struct _KPCR *Self; /* 1C */
- struct _KPRCB *Prcb; /* 20 */
- KIRQL Irql; /* 24 */
- ULONG IRR; /* 28 */
- ULONG IrrActive; /* 2C */
- ULONG IDR; /* 30 */
- PVOID KdVersionBlock; /* 34 */
- PUSHORT IDT; /* 38 */
- PUSHORT GDT; /* 3C */
- struct _KTSS *TSS; /* 40 */
- USHORT MajorVersion; /* 44 */
- USHORT MinorVersion; /* 46 */
- KAFFINITY SetMember; /* 48 */
- ULONG StallScaleFactor; /* 4C */
- UCHAR SpareUnused; /* 50 */
- UCHAR Number; /* 51 */
- UCHAR Spare0;
- UCHAR SecondLevelCacheAssociativity;
- ULONG VdmAlert;
- ULONG KernelReserved[14]; // For use by the kernel
- ULONG SecondLevelCacheSize;
- ULONG HalReserved[16]; // For use by Hal
-} KPCR, *PKPCR; /* 54 */
#define KeGetPcr() PCR