Author: akhaldi
Date: Tue Mar 16 14:40:22 2010
New Revision: 46226
URL:
http://svn.reactos.org/svn/reactos?rev=46226&view=rev
Log:
[XDK]
- Add METHOD_FROM_CTL_CODE, METHOD_DIRECT_TO_HARDWARE and METHOD_DIRECT_FROM_HARDWARE
definitions
[NTDDK]
- Add RtlGetProductInfo, VER_*, FILE_CHARACTERISTICS_*, IOCTL_AVIO_* and THREAD_CSWITCH_*
- Add FILE_FS_* and KEY_* structures
Modified:
branches/header-work/include/ddk/ntddk.h
branches/header-work/include/xdk/iotypes.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] Tue Mar 16 14:40:22 2010
@@ -383,6 +383,38 @@
#define RTL_HASH_RESERVED_SIGNATURE 0
+/* 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
+
+/* 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
+
+#define VER_NT_WORKSTATION 0x0000001
+#define VER_NT_DOMAIN_CONTROLLER 0x0000002
+#define VER_NT_SERVER 0x0000003
+
+#define VER_PLATFORM_WIN32s 0
+#define VER_PLATFORM_WIN32_WINDOWS 1
+#define VER_PLATFORM_WIN32_NT 2
+
typedef union _RTL_RUN_ONCE {
PVOID Ptr;
} RTL_RUN_ONCE, *PRTL_RUN_ONCE;
@@ -648,6 +680,68 @@
PVOID Directory;
} RTL_DYNAMIC_HASH_TABLE, *PRTL_DYNAMIC_HASH_TABLE;
+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 */
+
#define HASH_ENTRY_KEY(x) ((x)->Signature)
#define RtlInitializeSplayLinks(Links) { \
@@ -696,6 +790,43 @@
_SplayChild->Parent = _SplayParent; \
}
+#define RtlEqualLuid(L1, L2) (((L1)->LowPart == (L2)->LowPart) && \
+ ((L1)->HighPart == (L2)->HighPart))
+
+#define RtlIsZeroLuid(L1) ((BOOLEAN) (((L1)->LowPart | (L1)->HighPart) == 0))
+
+#if !defined(MIDL_PASS)
+
+FORCEINLINE
+LUID
+NTAPI_INLINE
+RtlConvertLongToLuid(
+ IN LONG Val)
+{
+ LUID Luid;
+ LARGE_INTEGER Temp;
+
+ Temp.QuadPart = Val;
+ Luid.LowPart = Temp.u.LowPart;
+ Luid.HighPart = Temp.u.HighPart;
+ return Luid;
+}
+
+FORCEINLINE
+LUID
+NTAPI_INLINE
+RtlConvertUlongToLuid(
+ IN ULONG Val)
+{
+ LUID Luid;
+
+ Luid.LowPart = Val;
+ Luid.HighPart = 0;
+ return Luid;
+}
+
+#endif /* !defined(MIDL_PASS) */
+
#if (defined(_M_AMD64) || defined(_M_IA64)) &&
!defined(_REALLY_GET_CALLERS_CALLER_)
#define RtlGetCallersAddress(CallersAddress, CallersCaller) \
*CallersAddress = (PVOID)_ReturnAddress(); \
@@ -967,7 +1098,7 @@
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-#if (NTDDI_VERSION >= NTDDI_WIN6)
+#if (NTDDI_VERSION >= NTDDI_VISTA)
NTSYSAPI
VOID
@@ -1000,7 +1131,17 @@
IN ULONG Flags,
IN PVOID Context OPTIONAL);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN6) */
+NTSYSAPI
+BOOLEAN
+NTAPI
+RtlGetProductInfo(
+ IN ULONG OSMajorVersion,
+ IN ULONG OSMinorVersion,
+ IN ULONG SpMajorVersion,
+ IN ULONG SpMinorVersion,
+ OUT PULONG ReturnedProductType);
+
+#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
#if !defined(MIDL_PASS) && !defined(SORTPP_PASS)
@@ -1221,710 +1362,9 @@
#endif /* defined(_AMD64_) || defined(_IA64_) */
-struct _LOADER_PARAMETER_BLOCK;
-struct _CREATE_DISK;
-struct _DRIVE_LAYOUT_INFORMATION_EX;
-struct _SET_PARTITION_INFORMATION_EX;
-
-//
-// GUID and UUID
-//
-#ifndef GUID_DEFINED
-#include <guiddef.h>
-#endif
-typedef GUID UUID;
-
-#define MAX_WOW64_SHARED_ENTRIES 16
-
-#define NX_SUPPORT_POLICY_ALWAYSOFF 0
-#define NX_SUPPORT_POLICY_ALWAYSON 1
-#define NX_SUPPORT_POLICY_OPTIN 2
-#define NX_SUPPORT_POLICY_OPTOUT 3
-
-/*
-** IRP function codes
-*/
-
-#define IRP_MN_QUERY_DIRECTORY 0x01
-#define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02
-
-#define IRP_MN_USER_FS_REQUEST 0x00
-#define IRP_MN_MOUNT_VOLUME 0x01
-#define IRP_MN_VERIFY_VOLUME 0x02
-#define IRP_MN_LOAD_FILE_SYSTEM 0x03
-#define IRP_MN_TRACK_LINK 0x04
-#define IRP_MN_KERNEL_CALL 0x04
-
-#define IRP_MN_LOCK 0x01
-#define IRP_MN_UNLOCK_SINGLE 0x02
-#define IRP_MN_UNLOCK_ALL 0x03
-#define IRP_MN_UNLOCK_ALL_BY_KEY 0x04
-
-#define IRP_MN_FLUSH_AND_PURGE 0x01
-
-#define IRP_MN_NORMAL 0x00
-#define IRP_MN_DPC 0x01
-#define IRP_MN_MDL 0x02
-#define IRP_MN_COMPLETE 0x04
-#define IRP_MN_COMPRESSED 0x08
-
-#define IRP_MN_MDL_DPC (IRP_MN_MDL | IRP_MN_DPC)
-#define IRP_MN_COMPLETE_MDL (IRP_MN_COMPLETE | IRP_MN_MDL)
-#define IRP_MN_COMPLETE_MDL_DPC (IRP_MN_COMPLETE_MDL | IRP_MN_DPC)
-
-#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
-
-typedef struct _IO_COUNTERS {
- ULONGLONG ReadOperationCount;
- ULONGLONG WriteOperationCount;
- ULONGLONG OtherOperationCount;
- ULONGLONG ReadTransferCount;
- ULONGLONG WriteTransferCount;
- ULONGLONG OtherTransferCount;
-} IO_COUNTERS, *PIO_COUNTERS;
-
-typedef struct _VM_COUNTERS {
- SIZE_T PeakVirtualSize;
- SIZE_T VirtualSize;
- ULONG PageFaultCount;
- SIZE_T PeakWorkingSetSize;
- SIZE_T WorkingSetSize;
- SIZE_T QuotaPeakPagedPoolUsage;
- SIZE_T QuotaPagedPoolUsage;
- SIZE_T QuotaPeakNonPagedPoolUsage;
- SIZE_T QuotaNonPagedPoolUsage;
- SIZE_T PagefileUsage;
- SIZE_T PeakPagefileUsage;
-} VM_COUNTERS, *PVM_COUNTERS;
-
-typedef struct _VM_COUNTERS_EX
-{
- SIZE_T PeakVirtualSize;
- SIZE_T VirtualSize;
- ULONG PageFaultCount;
- SIZE_T PeakWorkingSetSize;
- SIZE_T WorkingSetSize;
- SIZE_T QuotaPeakPagedPoolUsage;
- SIZE_T QuotaPagedPoolUsage;
- SIZE_T QuotaPeakNonPagedPoolUsage;
- SIZE_T QuotaNonPagedPoolUsage;
- SIZE_T PagefileUsage;
- SIZE_T PeakPagefileUsage;
- SIZE_T PrivateUsage;
-} VM_COUNTERS_EX, *PVM_COUNTERS_EX;
-
-typedef struct _POOLED_USAGE_AND_LIMITS
-{
- SIZE_T PeakPagedPoolUsage;
- SIZE_T PagedPoolUsage;
- SIZE_T PagedPoolLimit;
- SIZE_T PeakNonPagedPoolUsage;
- SIZE_T NonPagedPoolUsage;
- SIZE_T NonPagedPoolLimit;
- SIZE_T PeakPagefileUsage;
- SIZE_T PagefileUsage;
- SIZE_T PagefileLimit;
-} POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS;
-
-/* DEVICE_OBJECT.Flags */
-
-#define DO_DEVICE_HAS_NAME 0x00000040
-#define DO_SYSTEM_BOOT_PARTITION 0x00000100
-#define DO_LONG_TERM_REQUESTS 0x00000200
-#define DO_NEVER_LAST_DEVICE 0x00000400
-#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000
-#define DO_SUPPORTS_TRANSACTIONS 0x00040000
-#define DO_FORCE_NEITHER_IO 0x00080000
-#define DO_VOLUME_DEVICE_OBJECT 0x00100000
-#define DO_SYSTEM_SYSTEM_PARTITION 0x00200000
-#define DO_SYSTEM_CRITICAL_PARTITION 0x00400000
-#define DO_DISALLOW_EXECUTE 0x00800000
-
-#define DRVO_REINIT_REGISTERED 0x00000008
-#define DRVO_INITIALIZED 0x00000010
-#define DRVO_BOOTREINIT_REGISTERED 0x00000020
-#define DRVO_LEGACY_RESOURCES 0x00000040
-
-typedef enum _ARBITER_REQUEST_SOURCE {
- ArbiterRequestUndefined = -1,
- ArbiterRequestLegacyReported,
- ArbiterRequestHalReported,
- ArbiterRequestLegacyAssigned,
- ArbiterRequestPnpDetected,
- ArbiterRequestPnpEnumerated
-} ARBITER_REQUEST_SOURCE;
-
-typedef enum _ARBITER_RESULT {
- ArbiterResultUndefined = -1,
- ArbiterResultSuccess,
- ArbiterResultExternalConflict,
- ArbiterResultNullRequest
-} ARBITER_RESULT;
-
-typedef enum _ARBITER_ACTION {
- ArbiterActionTestAllocation,
- ArbiterActionRetestAllocation,
- ArbiterActionCommitAllocation,
- ArbiterActionRollbackAllocation,
- ArbiterActionQueryAllocatedResources,
- ArbiterActionWriteReservedResources,
- ArbiterActionQueryConflict,
- ArbiterActionQueryArbitrate,
- ArbiterActionAddReserved,
- ArbiterActionBootAllocation
-} ARBITER_ACTION, *PARBITER_ACTION;
-
-typedef struct _ARBITER_CONFLICT_INFO {
- PDEVICE_OBJECT OwningObject;
- ULONGLONG Start;
- ULONGLONG End;
-} ARBITER_CONFLICT_INFO, *PARBITER_CONFLICT_INFO;
-
-typedef struct _ARBITER_PARAMETERS {
- union {
- struct {
- IN OUT PLIST_ENTRY ArbitrationList;
- IN ULONG AllocateFromCount;
- IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom;
- } TestAllocation;
- struct {
- IN OUT PLIST_ENTRY ArbitrationList;
- IN ULONG AllocateFromCount;
- IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom;
- } RetestAllocation;
- struct {
- IN OUT PLIST_ENTRY ArbitrationList;
- } BootAllocation;
- struct {
- OUT PCM_PARTIAL_RESOURCE_LIST *AllocatedResources;
- } QueryAllocatedResources;
- struct {
- IN PDEVICE_OBJECT PhysicalDeviceObject;
- IN PIO_RESOURCE_DESCRIPTOR ConflictingResource;
- OUT PULONG ConflictCount;
- OUT PARBITER_CONFLICT_INFO *Conflicts;
- } QueryConflict;
- struct {
- IN PLIST_ENTRY ArbitrationList;
- } QueryArbitrate;
- struct {
- IN PDEVICE_OBJECT ReserveDevice;
- } AddReserved;
- } Parameters;
-} ARBITER_PARAMETERS, *PARBITER_PARAMETERS;
-
-#define ARBITER_FLAG_BOOT_CONFIG 0x00000001
-
-typedef struct _ARBITER_LIST_ENTRY {
- LIST_ENTRY ListEntry;
- ULONG AlternativeCount;
- PIO_RESOURCE_DESCRIPTOR Alternatives;
- PDEVICE_OBJECT PhysicalDeviceObject;
- ARBITER_REQUEST_SOURCE RequestSource;
- ULONG Flags;
- LONG_PTR WorkSpace;
- INTERFACE_TYPE InterfaceType;
- ULONG SlotNumber;
- ULONG BusNumber;
- PCM_PARTIAL_RESOURCE_DESCRIPTOR Assignment;
- PIO_RESOURCE_DESCRIPTOR SelectedAlternative;
- ARBITER_RESULT Result;
-} ARBITER_LIST_ENTRY, *PARBITER_LIST_ENTRY;
-
-typedef NTSTATUS
-(NTAPI *PARBITER_HANDLER)(
- IN OUT PVOID Context,
- IN ARBITER_ACTION Action,
- IN OUT PARBITER_PARAMETERS Parameters);
-
-#define ARBITER_PARTIAL 0x00000001
-
-typedef struct _ARBITER_INTERFACE {
- USHORT Size;
- USHORT Version;
- PVOID Context;
- PINTERFACE_REFERENCE InterfaceReference;
- PINTERFACE_DEREFERENCE InterfaceDereference;
- PARBITER_HANDLER ArbiterHandler;
- ULONG Flags;
-} ARBITER_INTERFACE, *PARBITER_INTERFACE;
-
-typedef enum _HAL_QUERY_INFORMATION_CLASS {
- HalInstalledBusInformation,
- HalProfileSourceInformation,
- HalInformationClassUnused1,
- HalPowerInformation,
- HalProcessorSpeedInformation,
- HalCallbackInformation,
- HalMapRegisterInformation,
- HalMcaLogInformation,
- HalFrameBufferCachingInformation,
- HalDisplayBiosInformation,
- HalProcessorFeatureInformation,
- HalNumaTopologyInterface,
- HalErrorInformation,
- HalCmcLogInformation,
- HalCpeLogInformation,
- HalQueryMcaInterface,
- HalQueryAMLIIllegalIOPortAddresses,
- HalQueryMaxHotPlugMemoryAddress,
- HalPartitionIpiInterface,
- HalPlatformInformation,
- HalQueryProfileSourceList,
- HalInitLogInformation,
- HalFrequencyInformation,
- HalProcessorBrandString,
- HalHypervisorInformation,
- HalPlatformTimerInformation,
- HalAcpiAuditInformation
-} HAL_QUERY_INFORMATION_CLASS, *PHAL_QUERY_INFORMATION_CLASS;
-
-typedef enum _HAL_SET_INFORMATION_CLASS {
- HalProfileSourceInterval,
- HalProfileSourceInterruptHandler,
- HalMcaRegisterDriver,
- HalKernelErrorHandler,
- HalCmcRegisterDriver,
- HalCpeRegisterDriver,
- HalMcaLog,
- HalCmcLog,
- HalCpeLog,
- HalGenerateCmcInterrupt,
- HalProfileSourceTimerHandler,
- HalEnlightenment,
- HalProfileDpgoSourceInterruptHandler
-} HAL_SET_INFORMATION_CLASS, *PHAL_SET_INFORMATION_CLASS;
-
-typedef struct _HAL_PROFILE_SOURCE_INTERVAL {
- KPROFILE_SOURCE Source;
- ULONG_PTR Interval;
-} HAL_PROFILE_SOURCE_INTERVAL, *PHAL_PROFILE_SOURCE_INTERVAL;
-
-typedef struct _HAL_PROFILE_SOURCE_INFORMATION {
- KPROFILE_SOURCE Source;
- BOOLEAN Supported;
- ULONG Interval;
-} HAL_PROFILE_SOURCE_INFORMATION, *PHAL_PROFILE_SOURCE_INFORMATION;
-
-typedef struct _MAP_REGISTER_ENTRY {
- PVOID MapRegister;
- BOOLEAN WriteToDevice;
-} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY;
-
-typedef struct _DEBUG_DEVICE_ADDRESS {
- UCHAR Type;
- BOOLEAN Valid;
- UCHAR Reserved[2];
- PUCHAR TranslatedAddress;
- ULONG Length;
-} DEBUG_DEVICE_ADDRESS, *PDEBUG_DEVICE_ADDRESS;
-
-typedef struct _DEBUG_MEMORY_REQUIREMENTS {
- PHYSICAL_ADDRESS Start;
- PHYSICAL_ADDRESS MaxEnd;
- PVOID VirtualAddress;
- ULONG Length;
- BOOLEAN Cached;
- BOOLEAN Aligned;
-} DEBUG_MEMORY_REQUIREMENTS, *PDEBUG_MEMORY_REQUIREMENTS;
-
-typedef struct _DEBUG_DEVICE_DESCRIPTOR {
- ULONG Bus;
- ULONG Slot;
- USHORT Segment;
- USHORT VendorID;
- USHORT DeviceID;
- UCHAR BaseClass;
- UCHAR SubClass;
- UCHAR ProgIf;
- BOOLEAN Initialized;
- BOOLEAN Configured;
- DEBUG_DEVICE_ADDRESS BaseAddress[6];
- DEBUG_MEMORY_REQUIREMENTS Memory;
-} DEBUG_DEVICE_DESCRIPTOR, *PDEBUG_DEVICE_DESCRIPTOR;
-
-typedef struct _PM_DISPATCH_TABLE {
- ULONG Signature;
- ULONG Version;
- PVOID Function[1];
-} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE;
-
-typedef enum _RESOURCE_TRANSLATION_DIRECTION {
- TranslateChildToParent,
- TranslateParentToChild
-} RESOURCE_TRANSLATION_DIRECTION;
-
-typedef NTSTATUS
-(NTAPI *PTRANSLATE_RESOURCE_HANDLER)(
- IN OUT PVOID Context,
- IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source,
- IN RESOURCE_TRANSLATION_DIRECTION Direction,
- IN ULONG AlternativesCount OPTIONAL,
- IN IO_RESOURCE_DESCRIPTOR Alternatives[],
- IN PDEVICE_OBJECT PhysicalDeviceObject,
- OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target);
-
-typedef NTSTATUS
-(NTAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)(
- IN PVOID Context OPTIONAL,
- IN PIO_RESOURCE_DESCRIPTOR Source,
- IN PDEVICE_OBJECT PhysicalDeviceObject,
- OUT PULONG TargetCount,
- OUT PIO_RESOURCE_DESCRIPTOR *Target);
-
-typedef struct _TRANSLATOR_INTERFACE {
- USHORT Size;
- USHORT Version;
- PVOID Context;
- PINTERFACE_REFERENCE InterfaceReference;
- PINTERFACE_DEREFERENCE InterfaceDereference;
- PTRANSLATE_RESOURCE_HANDLER TranslateResources;
- PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements;
-} TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE;
-
-typedef VOID
-(FASTCALL *pHalExamineMBR)(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG MBRTypeIdentifier,
- OUT PVOID *Buffer);
-
-typedef NTSTATUS
-(FASTCALL *pHalIoReadPartitionTable)(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN BOOLEAN ReturnRecognizedPartitions,
- OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer);
-
-typedef NTSTATUS
-(FASTCALL *pHalIoSetPartitionInformation)(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG PartitionNumber,
- IN ULONG PartitionType);
-
-typedef NTSTATUS
-(FASTCALL *pHalIoWritePartitionTable)(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG SectorSize,
- IN ULONG SectorsPerTrack,
- IN ULONG NumberOfHeads,
- IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer);
-
-typedef PBUS_HANDLER
-(FASTCALL *pHalHandlerForBus)(
- IN INTERFACE_TYPE InterfaceType,
- IN ULONG BusNumber);
-
-typedef VOID
-(FASTCALL *pHalReferenceBusHandler)(
- IN PBUS_HANDLER BusHandler);
-
-typedef NTSTATUS
-(NTAPI *pHalQuerySystemInformation)(
- IN HAL_QUERY_INFORMATION_CLASS InformationClass,
- IN ULONG BufferSize,
- IN OUT PVOID Buffer,
- OUT PULONG ReturnedLength);
-
-typedef NTSTATUS
-(NTAPI *pHalSetSystemInformation)(
- IN HAL_SET_INFORMATION_CLASS InformationClass,
- IN ULONG BufferSize,
- IN PVOID Buffer);
-
-typedef NTSTATUS
-(NTAPI *pHalQueryBusSlots)(
- IN PBUS_HANDLER BusHandler,
- IN ULONG BufferSize,
- OUT PULONG SlotNumbers,
- OUT PULONG ReturnedLength);
-
-typedef NTSTATUS
-(NTAPI *pHalInitPnpDriver)(
- VOID);
-
-typedef NTSTATUS
-(NTAPI *pHalInitPowerManagement)(
- IN PPM_DISPATCH_TABLE PmDriverDispatchTable,
- OUT PPM_DISPATCH_TABLE *PmHalDispatchTable);
-
-typedef struct _DMA_ADAPTER*
-(NTAPI *pHalGetDmaAdapter)(
- IN PVOID Context,
- IN struct _DEVICE_DESCRIPTION *DeviceDescriptor,
- OUT PULONG NumberOfMapRegisters);
-
-typedef NTSTATUS
-(NTAPI *pHalGetInterruptTranslator)(
- IN INTERFACE_TYPE ParentInterfaceType,
- IN ULONG ParentBusNumber,
- IN INTERFACE_TYPE BridgeInterfaceType,
- IN USHORT Size,
- IN USHORT Version,
- OUT PTRANSLATOR_INTERFACE Translator,
- OUT PULONG BridgeBusNumber);
-
-typedef NTSTATUS
-(NTAPI *pHalStartMirroring)(
- VOID);
-
-typedef NTSTATUS
-(NTAPI *pHalEndMirroring)(
- IN ULONG PassNumber);
-
-typedef NTSTATUS
-(NTAPI *pHalMirrorPhysicalMemory)(
- IN PHYSICAL_ADDRESS PhysicalAddress,
- IN LARGE_INTEGER NumberOfBytes);
-
-typedef NTSTATUS
-(NTAPI *pHalMirrorVerify)(
- IN PHYSICAL_ADDRESS PhysicalAddress,
- IN LARGE_INTEGER NumberOfBytes);
-
-typedef VOID
-(NTAPI *pHalEndOfBoot)(
- VOID);
-
-typedef
-BOOLEAN
-(NTAPI *pHalTranslateBusAddress)(
- IN INTERFACE_TYPE InterfaceType,
- IN ULONG BusNumber,
- IN PHYSICAL_ADDRESS BusAddress,
- IN OUT PULONG AddressSpace,
- OUT PPHYSICAL_ADDRESS TranslatedAddress);
-
-typedef
-NTSTATUS
-(NTAPI *pHalAssignSlotResources)(
- IN PUNICODE_STRING RegistryPath,
- IN PUNICODE_STRING DriverClassName OPTIONAL,
- IN PDRIVER_OBJECT DriverObject,
- IN PDEVICE_OBJECT DeviceObject,
- IN INTERFACE_TYPE BusType,
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN OUT PCM_RESOURCE_LIST *AllocatedResources);
-
-typedef
-VOID
-(NTAPI *pHalHaltSystem)(
- VOID);
-
-typedef
-BOOLEAN
-(NTAPI *pHalResetDisplay)(
- VOID);
-
-typedef
-UCHAR
-(NTAPI *pHalVectorToIDTEntry)(
- ULONG Vector);
-
-typedef
-BOOLEAN
-(NTAPI *pHalFindBusAddressTranslation)(
- IN PHYSICAL_ADDRESS BusAddress,
- IN OUT PULONG AddressSpace,
- OUT PPHYSICAL_ADDRESS TranslatedAddress,
- IN OUT PULONG_PTR Context,
- IN BOOLEAN NextBus);
-
-typedef
-NTSTATUS
-(NTAPI *pKdSetupPciDeviceForDebugging)(
- IN PVOID LoaderBlock OPTIONAL,
- IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice);
-
-typedef
-NTSTATUS
-(NTAPI *pKdReleasePciDeviceForDebugging)(
- IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice);
-
-typedef
-PVOID
-(NTAPI *pKdGetAcpiTablePhase0)(
- IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
- IN ULONG Signature);
-
-typedef
-PVOID
-(NTAPI *pHalGetAcpiTable)(
- IN ULONG Signature,
- IN PCSTR OemId OPTIONAL,
- IN PCSTR OemTableId OPTIONAL);
-
-typedef
-VOID
-(NTAPI *pKdCheckPowerButton)(
- VOID);
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-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);
-#else
-typedef
-PVOID
-(NTAPI *pKdMapPhysicalMemory64)(
- IN PHYSICAL_ADDRESS PhysicalAddress,
- IN ULONG NumberPages);
-
-typedef
-VOID
-(NTAPI *pKdUnmapVirtualAddress)(
- IN PVOID VirtualAddress,
- IN ULONG NumberPages);
-#endif
-
-
-typedef
-ULONG
-(NTAPI *pKdGetPciDataByOffset)(
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- OUT PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length);
-
-typedef
-ULONG
-(NTAPI *pKdSetPciDataByOffset)(
- IN ULONG BusNumber,
- IN ULONG SlotNumber,
- IN PVOID Buffer,
- IN ULONG Offset,
- IN ULONG Length);
-
-typedef BOOLEAN
-(NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)(
- IN ULONG Columns,
- IN ULONG Rows);
-
-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
-
-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 VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
+ ((ConditionMask) = VerSetConditionMask((ConditionMask), \
+ (TypeBitMask), (ComparisonType)))
#if (NTDDI_VERSION >= NTDDI_WIN2K)
NTSYSAPI
@@ -1936,52 +1376,114 @@
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
+/** Kernel debugger routines **/
+
+NTSYSAPI
+ULONG
+NTAPI
+DbgPrompt(
+ IN PCCH Prompt,
+ OUT PCH Response,
+ IN ULONG MaximumResponseLength);
+
+#if (NTDDI_VERSION >= NTDDI_WIN7)
+
+#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_EX 0x00004000
+#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_EX 0x00008000
+#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK_EX \
+ (FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_EX | \
+ FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_EX)
+
+#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_DEPRECATED 0x00000200
+#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_DEPRECATED 0x00000300
+#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK_DEPRECATED 0x00000300
+
+#else
+
+#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL 0x00000200
+#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL 0x00000300
+#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK 0x00000300
+
+#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_EX
FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL
+#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_EX
FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL
+#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK_EX
FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK
+
+#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
+
+#define FILE_CHARACTERISTICS_PROPAGATED ( FILE_REMOVABLE_MEDIA | \
+ FILE_READ_ONLY_DEVICE | \
+ FILE_FLOPPY_DISKETTE | \
+ FILE_WRITE_ONCE_MEDIA | \
+ FILE_DEVICE_SECURE_OPEN )
+
+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 struct _FILE_FS_LABEL_INFORMATION {
+ ULONG VolumeLabelLength;
+ WCHAR VolumeLabel[1];
+} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION;
+
+typedef struct _FILE_FS_VOLUME_INFORMATION {
+ LARGE_INTEGER VolumeCreationTime;
+ ULONG VolumeSerialNumber;
+ ULONG VolumeLabelLength;
+ BOOLEAN SupportsObjects;
+ WCHAR VolumeLabel[1];
+} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION;
+
+typedef struct _FILE_FS_SIZE_INFORMATION {
+ LARGE_INTEGER TotalAllocationUnits;
+ LARGE_INTEGER AvailableAllocationUnits;
+ ULONG SectorsPerAllocationUnit;
+ ULONG BytesPerSector;
+} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION;
+
+typedef struct _FILE_FS_FULL_SIZE_INFORMATION {
+ LARGE_INTEGER TotalAllocationUnits;
+ LARGE_INTEGER CallerAvailableAllocationUnits;
+ LARGE_INTEGER ActualAvailableAllocationUnits;
+ ULONG SectorsPerAllocationUnit;
+ ULONG BytesPerSector;
+} FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION;
+
+typedef struct _FILE_FS_OBJECTID_INFORMATION {
+ UCHAR ObjectId[16];
+ UCHAR ExtendedInfo[48];
+} FILE_FS_OBJECTID_INFORMATION, *PFILE_FS_OBJECTID_INFORMATION;
+
+typedef union _FILE_SEGMENT_ELEMENT {
+ PVOID64 Buffer;
+ ULONGLONG Alignment;
+}FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT;
+
+#define IOCTL_AVIO_ALLOCATE_STREAM CTL_CODE(FILE_DEVICE_AVIO, 1, METHOD_BUFFERED,
FILE_SPECIAL_ACCESS)
+#define IOCTL_AVIO_FREE_STREAM CTL_CODE(FILE_DEVICE_AVIO, 2, METHOD_BUFFERED,
FILE_SPECIAL_ACCESS)
+#define IOCTL_AVIO_MODIFY_STREAM CTL_CODE(FILE_DEVICE_AVIO, 3, METHOD_BUFFERED,
FILE_SPECIAL_ACCESS)
typedef enum _BUS_DATA_TYPE {
ConfigurationSpaceUndefined = -1,
@@ -1999,6 +1501,31 @@
SgiInternalConfiguration,
MaximumBusDataType
} BUS_DATA_TYPE, *PBUS_DATA_TYPE;
+
+typedef struct _KEY_NAME_INFORMATION {
+ ULONG NameLength;
+ WCHAR Name[1];
+} KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
+
+typedef struct _KEY_CACHED_INFORMATION {
+ LARGE_INTEGER LastWriteTime;
+ ULONG TitleIndex;
+ ULONG SubKeys;
+ ULONG MaxNameLen;
+ ULONG Values;
+ ULONG MaxValueNameLen;
+ ULONG MaxValueDataLen;
+ ULONG NameLength;
+} KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
+
+typedef struct _KEY_VIRTUALIZATION_INFORMATION {
+ ULONG VirtualizationCandidate:1;
+ ULONG VirtualizationEnabled:1;
+ ULONG VirtualTarget:1;
+ ULONG VirtualStore:1;
+ ULONG VirtualSource:1;
+ ULONG Reserved:27;
+} KEY_VIRTUALIZATION_INFORMATION, *PKEY_VIRTUALIZATION_INFORMATION;
typedef struct _NT_TIB {
struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList;
@@ -2131,6 +1658,701 @@
ThreadIdealProcessorEx,
MaxThreadInfoClass
} THREADINFOCLASS;
+
+#define THREAD_CSWITCH_PMU_DISABLE FALSE
+#define THREAD_CSWITCH_PMU_ENABLE TRUE
+
+struct _LOADER_PARAMETER_BLOCK;
+struct _CREATE_DISK;
+struct _DRIVE_LAYOUT_INFORMATION_EX;
+struct _SET_PARTITION_INFORMATION_EX;
+
+//
+// GUID and UUID
+//
+#ifndef GUID_DEFINED
+#include <guiddef.h>
+#endif
+typedef GUID UUID;
+
+#define MAX_WOW64_SHARED_ENTRIES 16
+
+#define NX_SUPPORT_POLICY_ALWAYSOFF 0
+#define NX_SUPPORT_POLICY_ALWAYSON 1
+#define NX_SUPPORT_POLICY_OPTIN 2
+#define NX_SUPPORT_POLICY_OPTOUT 3
+
+/*
+** IRP function codes
+*/
+
+#define IRP_MN_QUERY_DIRECTORY 0x01
+#define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02
+
+#define IRP_MN_USER_FS_REQUEST 0x00
+#define IRP_MN_MOUNT_VOLUME 0x01
+#define IRP_MN_VERIFY_VOLUME 0x02
+#define IRP_MN_LOAD_FILE_SYSTEM 0x03
+#define IRP_MN_TRACK_LINK 0x04
+#define IRP_MN_KERNEL_CALL 0x04
+
+#define IRP_MN_LOCK 0x01
+#define IRP_MN_UNLOCK_SINGLE 0x02
+#define IRP_MN_UNLOCK_ALL 0x03
+#define IRP_MN_UNLOCK_ALL_BY_KEY 0x04
+
+#define IRP_MN_FLUSH_AND_PURGE 0x01
+
+#define IRP_MN_NORMAL 0x00
+#define IRP_MN_DPC 0x01
+#define IRP_MN_MDL 0x02
+#define IRP_MN_COMPLETE 0x04
+#define IRP_MN_COMPRESSED 0x08
+
+#define IRP_MN_MDL_DPC (IRP_MN_MDL | IRP_MN_DPC)
+#define IRP_MN_COMPLETE_MDL (IRP_MN_COMPLETE | IRP_MN_MDL)
+#define IRP_MN_COMPLETE_MDL_DPC (IRP_MN_COMPLETE_MDL | IRP_MN_DPC)
+
+#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
+
+typedef struct _IO_COUNTERS {
+ ULONGLONG ReadOperationCount;
+ ULONGLONG WriteOperationCount;
+ ULONGLONG OtherOperationCount;
+ ULONGLONG ReadTransferCount;
+ ULONGLONG WriteTransferCount;
+ ULONGLONG OtherTransferCount;
+} IO_COUNTERS, *PIO_COUNTERS;
+
+typedef struct _VM_COUNTERS {
+ SIZE_T PeakVirtualSize;
+ SIZE_T VirtualSize;
+ ULONG PageFaultCount;
+ SIZE_T PeakWorkingSetSize;
+ SIZE_T WorkingSetSize;
+ SIZE_T QuotaPeakPagedPoolUsage;
+ SIZE_T QuotaPagedPoolUsage;
+ SIZE_T QuotaPeakNonPagedPoolUsage;
+ SIZE_T QuotaNonPagedPoolUsage;
+ SIZE_T PagefileUsage;
+ SIZE_T PeakPagefileUsage;
+} VM_COUNTERS, *PVM_COUNTERS;
+
+typedef struct _VM_COUNTERS_EX
+{
+ SIZE_T PeakVirtualSize;
+ SIZE_T VirtualSize;
+ ULONG PageFaultCount;
+ SIZE_T PeakWorkingSetSize;
+ SIZE_T WorkingSetSize;
+ SIZE_T QuotaPeakPagedPoolUsage;
+ SIZE_T QuotaPagedPoolUsage;
+ SIZE_T QuotaPeakNonPagedPoolUsage;
+ SIZE_T QuotaNonPagedPoolUsage;
+ SIZE_T PagefileUsage;
+ SIZE_T PeakPagefileUsage;
+ SIZE_T PrivateUsage;
+} VM_COUNTERS_EX, *PVM_COUNTERS_EX;
+
+typedef struct _POOLED_USAGE_AND_LIMITS
+{
+ SIZE_T PeakPagedPoolUsage;
+ SIZE_T PagedPoolUsage;
+ SIZE_T PagedPoolLimit;
+ SIZE_T PeakNonPagedPoolUsage;
+ SIZE_T NonPagedPoolUsage;
+ SIZE_T NonPagedPoolLimit;
+ SIZE_T PeakPagefileUsage;
+ SIZE_T PagefileUsage;
+ SIZE_T PagefileLimit;
+} POOLED_USAGE_AND_LIMITS, *PPOOLED_USAGE_AND_LIMITS;
+
+/* DEVICE_OBJECT.Flags */
+
+#define DO_DEVICE_HAS_NAME 0x00000040
+#define DO_SYSTEM_BOOT_PARTITION 0x00000100
+#define DO_LONG_TERM_REQUESTS 0x00000200
+#define DO_NEVER_LAST_DEVICE 0x00000400
+#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000
+#define DO_SUPPORTS_TRANSACTIONS 0x00040000
+#define DO_FORCE_NEITHER_IO 0x00080000
+#define DO_VOLUME_DEVICE_OBJECT 0x00100000
+#define DO_SYSTEM_SYSTEM_PARTITION 0x00200000
+#define DO_SYSTEM_CRITICAL_PARTITION 0x00400000
+#define DO_DISALLOW_EXECUTE 0x00800000
+
+#define DRVO_REINIT_REGISTERED 0x00000008
+#define DRVO_INITIALIZED 0x00000010
+#define DRVO_BOOTREINIT_REGISTERED 0x00000020
+#define DRVO_LEGACY_RESOURCES 0x00000040
+
+typedef enum _ARBITER_REQUEST_SOURCE {
+ ArbiterRequestUndefined = -1,
+ ArbiterRequestLegacyReported,
+ ArbiterRequestHalReported,
+ ArbiterRequestLegacyAssigned,
+ ArbiterRequestPnpDetected,
+ ArbiterRequestPnpEnumerated
+} ARBITER_REQUEST_SOURCE;
+
+typedef enum _ARBITER_RESULT {
+ ArbiterResultUndefined = -1,
+ ArbiterResultSuccess,
+ ArbiterResultExternalConflict,
+ ArbiterResultNullRequest
+} ARBITER_RESULT;
+
+typedef enum _ARBITER_ACTION {
+ ArbiterActionTestAllocation,
+ ArbiterActionRetestAllocation,
+ ArbiterActionCommitAllocation,
+ ArbiterActionRollbackAllocation,
+ ArbiterActionQueryAllocatedResources,
+ ArbiterActionWriteReservedResources,
+ ArbiterActionQueryConflict,
+ ArbiterActionQueryArbitrate,
+ ArbiterActionAddReserved,
+ ArbiterActionBootAllocation
+} ARBITER_ACTION, *PARBITER_ACTION;
+
+typedef struct _ARBITER_CONFLICT_INFO {
+ PDEVICE_OBJECT OwningObject;
+ ULONGLONG Start;
+ ULONGLONG End;
+} ARBITER_CONFLICT_INFO, *PARBITER_CONFLICT_INFO;
+
+typedef struct _ARBITER_PARAMETERS {
+ union {
+ struct {
+ IN OUT PLIST_ENTRY ArbitrationList;
+ IN ULONG AllocateFromCount;
+ IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom;
+ } TestAllocation;
+ struct {
+ IN OUT PLIST_ENTRY ArbitrationList;
+ IN ULONG AllocateFromCount;
+ IN PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom;
+ } RetestAllocation;
+ struct {
+ IN OUT PLIST_ENTRY ArbitrationList;
+ } BootAllocation;
+ struct {
+ OUT PCM_PARTIAL_RESOURCE_LIST *AllocatedResources;
+ } QueryAllocatedResources;
+ struct {
+ IN PDEVICE_OBJECT PhysicalDeviceObject;
+ IN PIO_RESOURCE_DESCRIPTOR ConflictingResource;
+ OUT PULONG ConflictCount;
+ OUT PARBITER_CONFLICT_INFO *Conflicts;
+ } QueryConflict;
+ struct {
+ IN PLIST_ENTRY ArbitrationList;
+ } QueryArbitrate;
+ struct {
+ IN PDEVICE_OBJECT ReserveDevice;
+ } AddReserved;
+ } Parameters;
+} ARBITER_PARAMETERS, *PARBITER_PARAMETERS;
+
+#define ARBITER_FLAG_BOOT_CONFIG 0x00000001
+
+typedef struct _ARBITER_LIST_ENTRY {
+ LIST_ENTRY ListEntry;
+ ULONG AlternativeCount;
+ PIO_RESOURCE_DESCRIPTOR Alternatives;
+ PDEVICE_OBJECT PhysicalDeviceObject;
+ ARBITER_REQUEST_SOURCE RequestSource;
+ ULONG Flags;
+ LONG_PTR WorkSpace;
+ INTERFACE_TYPE InterfaceType;
+ ULONG SlotNumber;
+ ULONG BusNumber;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR Assignment;
+ PIO_RESOURCE_DESCRIPTOR SelectedAlternative;
+ ARBITER_RESULT Result;
+} ARBITER_LIST_ENTRY, *PARBITER_LIST_ENTRY;
+
+typedef NTSTATUS
+(NTAPI *PARBITER_HANDLER)(
+ IN OUT PVOID Context,
+ IN ARBITER_ACTION Action,
+ IN OUT PARBITER_PARAMETERS Parameters);
+
+#define ARBITER_PARTIAL 0x00000001
+
+typedef struct _ARBITER_INTERFACE {
+ USHORT Size;
+ USHORT Version;
+ PVOID Context;
+ PINTERFACE_REFERENCE InterfaceReference;
+ PINTERFACE_DEREFERENCE InterfaceDereference;
+ PARBITER_HANDLER ArbiterHandler;
+ ULONG Flags;
+} ARBITER_INTERFACE, *PARBITER_INTERFACE;
+
+typedef enum _HAL_QUERY_INFORMATION_CLASS {
+ HalInstalledBusInformation,
+ HalProfileSourceInformation,
+ HalInformationClassUnused1,
+ HalPowerInformation,
+ HalProcessorSpeedInformation,
+ HalCallbackInformation,
+ HalMapRegisterInformation,
+ HalMcaLogInformation,
+ HalFrameBufferCachingInformation,
+ HalDisplayBiosInformation,
+ HalProcessorFeatureInformation,
+ HalNumaTopologyInterface,
+ HalErrorInformation,
+ HalCmcLogInformation,
+ HalCpeLogInformation,
+ HalQueryMcaInterface,
+ HalQueryAMLIIllegalIOPortAddresses,
+ HalQueryMaxHotPlugMemoryAddress,
+ HalPartitionIpiInterface,
+ HalPlatformInformation,
+ HalQueryProfileSourceList,
+ HalInitLogInformation,
+ HalFrequencyInformation,
+ HalProcessorBrandString,
+ HalHypervisorInformation,
+ HalPlatformTimerInformation,
+ HalAcpiAuditInformation
+} HAL_QUERY_INFORMATION_CLASS, *PHAL_QUERY_INFORMATION_CLASS;
+
+typedef enum _HAL_SET_INFORMATION_CLASS {
+ HalProfileSourceInterval,
+ HalProfileSourceInterruptHandler,
+ HalMcaRegisterDriver,
+ HalKernelErrorHandler,
+ HalCmcRegisterDriver,
+ HalCpeRegisterDriver,
+ HalMcaLog,
+ HalCmcLog,
+ HalCpeLog,
+ HalGenerateCmcInterrupt,
+ HalProfileSourceTimerHandler,
+ HalEnlightenment,
+ HalProfileDpgoSourceInterruptHandler
+} HAL_SET_INFORMATION_CLASS, *PHAL_SET_INFORMATION_CLASS;
+
+typedef struct _HAL_PROFILE_SOURCE_INTERVAL {
+ KPROFILE_SOURCE Source;
+ ULONG_PTR Interval;
+} HAL_PROFILE_SOURCE_INTERVAL, *PHAL_PROFILE_SOURCE_INTERVAL;
+
+typedef struct _HAL_PROFILE_SOURCE_INFORMATION {
+ KPROFILE_SOURCE Source;
+ BOOLEAN Supported;
+ ULONG Interval;
+} HAL_PROFILE_SOURCE_INFORMATION, *PHAL_PROFILE_SOURCE_INFORMATION;
+
+typedef struct _MAP_REGISTER_ENTRY {
+ PVOID MapRegister;
+ BOOLEAN WriteToDevice;
+} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY;
+
+typedef struct _DEBUG_DEVICE_ADDRESS {
+ UCHAR Type;
+ BOOLEAN Valid;
+ UCHAR Reserved[2];
+ PUCHAR TranslatedAddress;
+ ULONG Length;
+} DEBUG_DEVICE_ADDRESS, *PDEBUG_DEVICE_ADDRESS;
+
+typedef struct _DEBUG_MEMORY_REQUIREMENTS {
+ PHYSICAL_ADDRESS Start;
+ PHYSICAL_ADDRESS MaxEnd;
+ PVOID VirtualAddress;
+ ULONG Length;
+ BOOLEAN Cached;
+ BOOLEAN Aligned;
+} DEBUG_MEMORY_REQUIREMENTS, *PDEBUG_MEMORY_REQUIREMENTS;
+
+typedef struct _DEBUG_DEVICE_DESCRIPTOR {
+ ULONG Bus;
+ ULONG Slot;
+ USHORT Segment;
+ USHORT VendorID;
+ USHORT DeviceID;
+ UCHAR BaseClass;
+ UCHAR SubClass;
+ UCHAR ProgIf;
+ BOOLEAN Initialized;
+ BOOLEAN Configured;
+ DEBUG_DEVICE_ADDRESS BaseAddress[6];
+ DEBUG_MEMORY_REQUIREMENTS Memory;
+} DEBUG_DEVICE_DESCRIPTOR, *PDEBUG_DEVICE_DESCRIPTOR;
+
+typedef struct _PM_DISPATCH_TABLE {
+ ULONG Signature;
+ ULONG Version;
+ PVOID Function[1];
+} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE;
+
+typedef enum _RESOURCE_TRANSLATION_DIRECTION {
+ TranslateChildToParent,
+ TranslateParentToChild
+} RESOURCE_TRANSLATION_DIRECTION;
+
+typedef NTSTATUS
+(NTAPI *PTRANSLATE_RESOURCE_HANDLER)(
+ IN OUT PVOID Context,
+ IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Source,
+ IN RESOURCE_TRANSLATION_DIRECTION Direction,
+ IN ULONG AlternativesCount OPTIONAL,
+ IN IO_RESOURCE_DESCRIPTOR Alternatives[],
+ IN PDEVICE_OBJECT PhysicalDeviceObject,
+ OUT PCM_PARTIAL_RESOURCE_DESCRIPTOR Target);
+
+typedef NTSTATUS
+(NTAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)(
+ IN PVOID Context OPTIONAL,
+ IN PIO_RESOURCE_DESCRIPTOR Source,
+ IN PDEVICE_OBJECT PhysicalDeviceObject,
+ OUT PULONG TargetCount,
+ OUT PIO_RESOURCE_DESCRIPTOR *Target);
+
+typedef struct _TRANSLATOR_INTERFACE {
+ USHORT Size;
+ USHORT Version;
+ PVOID Context;
+ PINTERFACE_REFERENCE InterfaceReference;
+ PINTERFACE_DEREFERENCE InterfaceDereference;
+ PTRANSLATE_RESOURCE_HANDLER TranslateResources;
+ PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements;
+} TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE;
+
+typedef VOID
+(FASTCALL *pHalExamineMBR)(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG MBRTypeIdentifier,
+ OUT PVOID *Buffer);
+
+typedef NTSTATUS
+(FASTCALL *pHalIoReadPartitionTable)(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN BOOLEAN ReturnRecognizedPartitions,
+ OUT struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer);
+
+typedef NTSTATUS
+(FASTCALL *pHalIoSetPartitionInformation)(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG PartitionNumber,
+ IN ULONG PartitionType);
+
+typedef NTSTATUS
+(FASTCALL *pHalIoWritePartitionTable)(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN ULONG SectorSize,
+ IN ULONG SectorsPerTrack,
+ IN ULONG NumberOfHeads,
+ IN struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer);
+
+typedef PBUS_HANDLER
+(FASTCALL *pHalHandlerForBus)(
+ IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber);
+
+typedef VOID
+(FASTCALL *pHalReferenceBusHandler)(
+ IN PBUS_HANDLER BusHandler);
+
+typedef NTSTATUS
+(NTAPI *pHalQuerySystemInformation)(
+ IN HAL_QUERY_INFORMATION_CLASS InformationClass,
+ IN ULONG BufferSize,
+ IN OUT PVOID Buffer,
+ OUT PULONG ReturnedLength);
+
+typedef NTSTATUS
+(NTAPI *pHalSetSystemInformation)(
+ IN HAL_SET_INFORMATION_CLASS InformationClass,
+ IN ULONG BufferSize,
+ IN PVOID Buffer);
+
+typedef NTSTATUS
+(NTAPI *pHalQueryBusSlots)(
+ IN PBUS_HANDLER BusHandler,
+ IN ULONG BufferSize,
+ OUT PULONG SlotNumbers,
+ OUT PULONG ReturnedLength);
+
+typedef NTSTATUS
+(NTAPI *pHalInitPnpDriver)(
+ VOID);
+
+typedef NTSTATUS
+(NTAPI *pHalInitPowerManagement)(
+ IN PPM_DISPATCH_TABLE PmDriverDispatchTable,
+ OUT PPM_DISPATCH_TABLE *PmHalDispatchTable);
+
+typedef struct _DMA_ADAPTER*
+(NTAPI *pHalGetDmaAdapter)(
+ IN PVOID Context,
+ IN struct _DEVICE_DESCRIPTION *DeviceDescriptor,
+ OUT PULONG NumberOfMapRegisters);
+
+typedef NTSTATUS
+(NTAPI *pHalGetInterruptTranslator)(
+ IN INTERFACE_TYPE ParentInterfaceType,
+ IN ULONG ParentBusNumber,
+ IN INTERFACE_TYPE BridgeInterfaceType,
+ IN USHORT Size,
+ IN USHORT Version,
+ OUT PTRANSLATOR_INTERFACE Translator,
+ OUT PULONG BridgeBusNumber);
+
+typedef NTSTATUS
+(NTAPI *pHalStartMirroring)(
+ VOID);
+
+typedef NTSTATUS
+(NTAPI *pHalEndMirroring)(
+ IN ULONG PassNumber);
+
+typedef NTSTATUS
+(NTAPI *pHalMirrorPhysicalMemory)(
+ IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN LARGE_INTEGER NumberOfBytes);
+
+typedef NTSTATUS
+(NTAPI *pHalMirrorVerify)(
+ IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN LARGE_INTEGER NumberOfBytes);
+
+typedef VOID
+(NTAPI *pHalEndOfBoot)(
+ VOID);
+
+typedef
+BOOLEAN
+(NTAPI *pHalTranslateBusAddress)(
+ IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber,
+ IN PHYSICAL_ADDRESS BusAddress,
+ IN OUT PULONG AddressSpace,
+ OUT PPHYSICAL_ADDRESS TranslatedAddress);
+
+typedef
+NTSTATUS
+(NTAPI *pHalAssignSlotResources)(
+ IN PUNICODE_STRING RegistryPath,
+ IN PUNICODE_STRING DriverClassName OPTIONAL,
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN INTERFACE_TYPE BusType,
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ IN OUT PCM_RESOURCE_LIST *AllocatedResources);
+
+typedef
+VOID
+(NTAPI *pHalHaltSystem)(
+ VOID);
+
+typedef
+BOOLEAN
+(NTAPI *pHalResetDisplay)(
+ VOID);
+
+typedef
+UCHAR
+(NTAPI *pHalVectorToIDTEntry)(
+ ULONG Vector);
+
+typedef
+BOOLEAN
+(NTAPI *pHalFindBusAddressTranslation)(
+ IN PHYSICAL_ADDRESS BusAddress,
+ IN OUT PULONG AddressSpace,
+ OUT PPHYSICAL_ADDRESS TranslatedAddress,
+ IN OUT PULONG_PTR Context,
+ IN BOOLEAN NextBus);
+
+typedef
+NTSTATUS
+(NTAPI *pKdSetupPciDeviceForDebugging)(
+ IN PVOID LoaderBlock OPTIONAL,
+ IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice);
+
+typedef
+NTSTATUS
+(NTAPI *pKdReleasePciDeviceForDebugging)(
+ IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice);
+
+typedef
+PVOID
+(NTAPI *pKdGetAcpiTablePhase0)(
+ IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
+ IN ULONG Signature);
+
+typedef
+PVOID
+(NTAPI *pHalGetAcpiTable)(
+ IN ULONG Signature,
+ IN PCSTR OemId OPTIONAL,
+ IN PCSTR OemTableId OPTIONAL);
+
+typedef
+VOID
+(NTAPI *pKdCheckPowerButton)(
+ VOID);
+
+#if (NTDDI_VERSION >= NTDDI_VISTA)
+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);
+#else
+typedef
+PVOID
+(NTAPI *pKdMapPhysicalMemory64)(
+ IN PHYSICAL_ADDRESS PhysicalAddress,
+ IN ULONG NumberPages);
+
+typedef
+VOID
+(NTAPI *pKdUnmapVirtualAddress)(
+ IN PVOID VirtualAddress,
+ IN ULONG NumberPages);
+#endif
+
+
+typedef
+ULONG
+(NTAPI *pKdGetPciDataByOffset)(
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ OUT PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length);
+
+typedef
+ULONG
+(NTAPI *pKdSetPciDataByOffset)(
+ IN ULONG BusNumber,
+ IN ULONG SlotNumber,
+ IN PVOID Buffer,
+ IN ULONG Offset,
+ IN ULONG Length);
+
+typedef BOOLEAN
+(NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)(
+ IN ULONG Columns,
+ IN ULONG Rows);
+
+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
+
+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 struct _PROCESS_BASIC_INFORMATION {
NTSTATUS ExitStatus;
@@ -2495,68 +2717,6 @@
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
@@ -3364,16 +3524,6 @@
#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)
@@ -3652,40 +3802,6 @@
#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
extern NTKERNELAPI PEPROCESS PsInitialSystemProcess;
-
-/* RTL Functions */
-
-#if !defined(MIDL_PASS)
-
-FORCEINLINE
-LUID
-NTAPI_INLINE
-RtlConvertLongToLuid(
- IN LONG Val)
-{
- LUID Luid;
- LARGE_INTEGER Temp;
-
- Temp.QuadPart = Val;
- Luid.LowPart = Temp.u.LowPart;
- Luid.HighPart = Temp.u.HighPart;
- return Luid;
-}
-
-FORCEINLINE
-LUID
-NTAPI_INLINE
-RtlConvertUlongToLuid(
- IN ULONG Val)
-{
- LUID Luid;
-
- Luid.LowPart = Val;
- Luid.HighPart = 0;
- return Luid;
-}
-
-#endif
/* Security reference monitor routines */
Modified: branches/header-work/include/xdk/iotypes.h
URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/xdk/iotypes…
==============================================================================
--- branches/header-work/include/xdk/iotypes.h [iso-8859-1] (original)
+++ branches/header-work/include/xdk/iotypes.h [iso-8859-1] Tue Mar 16 14:40:22 2010
@@ -1423,6 +1423,8 @@
#define DEVICE_TYPE_FROM_CTL_CODE(ctl) (((ULONG) (ctl & 0xffff0000)) >> 16)
+#define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3))
+
#define IRP_NOCACHE 0x00000001
#define IRP_PAGING_IO 0x00000002
#define IRP_MOUNT_COMPLETION 0x00000002
@@ -2352,6 +2354,8 @@
#define METHOD_OUT_DIRECT 2
#define METHOD_NEITHER 3
+#define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT
+#define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT
#define FILE_SUPERSEDED 0x00000000
#define FILE_OPENED 0x00000001