[XDK][DDK][PSDK]
authorThomas Faber <thomas.faber@reactos.org>
Mon, 7 Sep 2015 09:46:43 +0000 (09:46 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 7 Sep 2015 09:46:43 +0000 (09:46 +0000)
- Generate XDK headers during build. To make changes to wdm.h, ntddk.h, ntifs.h, devioctl.h, ntdef.h or winnt.h, edit the appropriate files in include/xdk (as you should already have been doing for a long time).
CORE-9586 #resolve

svn path=/trunk/; revision=69083

reactos/CMakeLists.txt
reactos/include/asm/CMakeLists.txt
reactos/include/ddk/ntddk.h [deleted file]
reactos/include/ddk/ntifs.h [deleted file]
reactos/include/ddk/wdm.h [deleted file]
reactos/include/psdk/CMakeLists.txt
reactos/include/psdk/devioctl.h [deleted file]
reactos/include/psdk/ntdef.h [deleted file]
reactos/include/psdk/winnt.h [deleted file]
reactos/include/xdk/CMakeLists.txt [new file with mode: 0644]
reactos/include/xdk/generate.bat [deleted file]

index 6cd3327..dd734f8 100644 (file)
@@ -112,9 +112,9 @@ if(NOT CMAKE_CROSSCOMPILING)
 
     if(NOT NEW_STYLE_BUILD)
         if(NOT MSVC)
 
     if(NOT NEW_STYLE_BUILD)
         if(NOT MSVC)
-            export(TARGETS bin2c widl gendib cabman cdmake mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
+            export(TARGETS bin2c widl gendib cabman cdmake hpp mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
         else()
         else()
-            export(TARGETS bin2c widl gendib cabman cdmake mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
+            export(TARGETS bin2c widl gendib cabman cdmake hpp mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
         endif()
     endif()
 
         endif()
     endif()
 
@@ -234,6 +234,7 @@ else()
         ${REACTOS_BINARY_DIR}/include
         ${REACTOS_BINARY_DIR}/include/psdk
         ${REACTOS_BINARY_DIR}/include/dxsdk
         ${REACTOS_BINARY_DIR}/include
         ${REACTOS_BINARY_DIR}/include/psdk
         ${REACTOS_BINARY_DIR}/include/dxsdk
+        ${REACTOS_BINARY_DIR}/include/ddk
         ${REACTOS_BINARY_DIR}/include/reactos
         include/crt
         include/ddk
         ${REACTOS_BINARY_DIR}/include/reactos
         include/crt
         include/ddk
@@ -247,6 +248,7 @@ else()
 
     add_dependency_header()
 
 
     add_dependency_header()
 
+    add_subdirectory(include/xdk)
     add_subdirectory(include/psdk)
     add_subdirectory(include/dxsdk)
     add_subdirectory(include/reactos/wine)
     add_subdirectory(include/psdk)
     add_subdirectory(include/dxsdk)
     add_subdirectory(include/reactos/wine)
index 02ea87c..d61ba66 100644 (file)
@@ -2,7 +2,7 @@
 add_library(genincdata SHARED genincdata.c)
 
 set_entrypoint(genincdata 0)
 add_library(genincdata SHARED genincdata.c)
 
 set_entrypoint(genincdata 0)
-add_dependencies(genincdata bugcodes psdk)
+add_dependencies(genincdata bugcodes psdk xdk)
 
 if(MSVC)
     set(OPT_MS "-ms")
 
 if(MSVC)
     set(OPT_MS "-ms")
diff --git a/reactos/include/ddk/ntddk.h b/reactos/include/ddk/ntddk.h
deleted file mode 100644 (file)
index 1e7a48c..0000000
+++ /dev/null
@@ -1,6072 +0,0 @@
-/*
- * ntddk.h
- *
- * Windows NT Device Driver Kit
- *
- * This file is part of the ReactOS DDK package.
- *
- * Contributors:
- *   Amine Khaldi
- *   Timo Kreuzer (timo.kreuzer@reactos.org)
- *
- * THIS SOFTWARE IS NOT COPYRIGHTED
- *
- * This source code is offered for use in the public domain. You may
- * use, modify or distribute it freely.
- *
- * This code is distributed in the hope that it will be useful but
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAIMED. This includes but is not limited to warranties of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- */
-
-#pragma once
-
-#define _NTDDK_
-
-#if !defined(_NTHAL_) && !defined(_NTIFS_)
-#define _NTDDK_INCLUDED_
-#define _DDK_DRIVER_
-#endif
-
-/* Dependencies */
-
-#define NT_INCLUDED
-#define _CTYPE_DISABLE_MACROS
-
-#include <wdm.h>
-#include <excpt.h>
-#include <ntdef.h>
-#include <ntstatus.h>
-#include <mce.h>
-#include <bugcodes.h>
-#include <ntiologc.h>
-
-#include <stdarg.h> // FIXME
-#include <basetyps.h> // FIXME
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* GUID and UUID */
-#ifndef _NTLSA_IFS_
-#ifndef _NTLSA_AUDIT_
-#define _NTLSA_AUDIT_
-
-#ifndef GUID_DEFINED
-#include <guiddef.h>
-#endif
-
-#endif /* _NTLSA_AUDIT_ */
-#endif /* _NTLSA_IFS_ */
-
-typedef GUID UUID;
-
-struct _LOADER_PARAMETER_BLOCK;
-struct _CREATE_DISK;
-struct _DRIVE_LAYOUT_INFORMATION_EX;
-struct _SET_PARTITION_INFORMATION_EX;
-struct _DISK_GEOMETRY_EX;
-
-typedef struct _BUS_HANDLER *PBUS_HANDLER;
-typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
-#if defined(_NTHAL_INCLUDED_)
-typedef struct _KAFFINITY_EX *PKAFFINITY_EX;
-#endif
-typedef struct _PEB *PPEB;
-
-#ifndef _NTIMAGE_
-
-typedef struct _IMAGE_NT_HEADERS *PIMAGE_NT_HEADERS32;
-typedef struct _IMAGE_NT_HEADERS64 *PIMAGE_NT_HEADERS64;
-
-#ifdef _WIN64
-typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS;
-#else
-typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS;
-#endif
-
-#endif /* _NTIMAGE_ */
-
-/******************************************************************************
- *                            Executive Types                                 *
- ******************************************************************************/
-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;
-
-#define PROTECTED_POOL                    0x80000000
-
-/******************************************************************************
- *                            Configuration Manager Types                     *
- ******************************************************************************/
-
-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;
-
-#define CmResourceTypeMaximum             8
-
-typedef struct _CM_PCCARD_DEVICE_DATA {
-  UCHAR Flags;
-  UCHAR ErrorCode;
-  USHORT Reserved;
-  ULONG BusData;
-  ULONG DeviceId;
-  ULONG LegacyBaseAddress;
-  UCHAR IRQMap[16];
-} CM_PCCARD_DEVICE_DATA, *PCM_PCCARD_DEVICE_DATA;
-
-/******************************************************************************
- *                         I/O Manager Types                                  *
- ******************************************************************************/
-
-/* 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
-
-#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_ */
-
-/*
-** 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
-
-#define IO_CHECK_CREATE_PARAMETERS      0x0200
-#define IO_ATTACH_DEVICE                0x0400
-#define IO_IGNORE_SHARE_ACCESS_CHECK    0x0800
-
-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 enum _IO_QUERY_DEVICE_DATA_FORMAT {
-  IoQueryDeviceIdentifier = 0,
-  IoQueryDeviceConfigurationData,
-  IoQueryDeviceComponentInformation,
-  IoQueryDeviceMaxData
-} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT;
-
-typedef VOID
-(NTAPI *PDRIVER_REINITIALIZE)(
-  _In_ struct _DRIVER_OBJECT *DriverObject,
-  _In_opt_ PVOID Context,
-  _In_ ULONG Count);
-
-typedef struct _CONTROLLER_OBJECT {
-  CSHORT Type;
-  CSHORT Size;
-  PVOID ControllerExtension;
-  KDEVICE_QUEUE DeviceWaitQueue;
-  ULONG Spare1;
-  LARGE_INTEGER Spare2;
-} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT;
-
-#define DRVO_REINIT_REGISTERED          0x00000008
-#define DRVO_INITIALIZED                0x00000010
-#define DRVO_BOOTREINIT_REGISTERED      0x00000020
-#define DRVO_LEGACY_RESOURCES           0x00000040
-
-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 struct _DISK_SIGNATURE {
-  ULONG PartitionStyle;
-  _ANONYMOUS_UNION union {
-    struct {
-      ULONG Signature;
-      ULONG CheckSum;
-    } Mbr;
-    struct {
-      GUID DiskId;
-    } Gpt;
-  } DUMMYUNIONNAME;
-} DISK_SIGNATURE, *PDISK_SIGNATURE;
-
-typedef struct _TXN_PARAMETER_BLOCK {
-  USHORT Length;
-  USHORT TxFsContext;
-  PVOID TransactionObject;
-} TXN_PARAMETER_BLOCK, *PTXN_PARAMETER_BLOCK;
-
-#define TXF_MINIVERSION_DEFAULT_VIEW        (0xFFFE)
-
-typedef struct _IO_DRIVER_CREATE_CONTEXT {
-  CSHORT Size;
-  struct _ECP_LIST *ExtraCreateParameter;
-  PVOID DeviceObjectHint;
-  PTXN_PARAMETER_BLOCK TxnParameters;
-} IO_DRIVER_CREATE_CONTEXT, *PIO_DRIVER_CREATE_CONTEXT;
-
-typedef struct _AGP_TARGET_BUS_INTERFACE_STANDARD {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PGET_SET_DEVICE_DATA SetBusData;
-  PGET_SET_DEVICE_DATA GetBusData;
-  UCHAR CapabilityID;
-} AGP_TARGET_BUS_INTERFACE_STANDARD, *PAGP_TARGET_BUS_INTERFACE_STANDARD;
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-typedef NTSTATUS
-(NTAPI *PGET_LOCATION_STRING)(
-  _Inout_opt_ PVOID Context,
-  _Outptr_
-  _At_(*LocationStrings,
-    _When_(return == 0, __drv_allocatesMem(Mem)))
-    PZZWSTR *LocationStrings);
-
-typedef struct _PNP_LOCATION_INTERFACE {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PGET_LOCATION_STRING GetLocationString;
-} PNP_LOCATION_INTERFACE, *PPNP_LOCATION_INTERFACE;
-
-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_TEST_ALLOCATION_PARAMETERS {
-  _Inout_ PLIST_ENTRY ArbitrationList;
-  _In_ ULONG AllocateFromCount;
-  _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom;
-} ARBITER_TEST_ALLOCATION_PARAMETERS, *PARBITER_TEST_ALLOCATION_PARAMETERS;
-
-typedef struct _ARBITER_RETEST_ALLOCATION_PARAMETERS {
-  _Inout_ PLIST_ENTRY ArbitrationList;
-  _In_ ULONG AllocateFromCount;
-  _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom;
-} ARBITER_RETEST_ALLOCATION_PARAMETERS, *PARBITER_RETEST_ALLOCATION_PARAMETERS;
-
-typedef struct _ARBITER_BOOT_ALLOCATION_PARAMETERS {
-  _Inout_ PLIST_ENTRY ArbitrationList;
-} ARBITER_BOOT_ALLOCATION_PARAMETERS, *PARBITER_BOOT_ALLOCATION_PARAMETERS;
-
-typedef struct _ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS {
-  _Out_ PCM_PARTIAL_RESOURCE_LIST *AllocatedResources;
-} ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS, *PARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS;
-
-typedef struct _ARBITER_QUERY_CONFLICT_PARAMETERS {
-  _In_ PDEVICE_OBJECT PhysicalDeviceObject;
-  _In_ PIO_RESOURCE_DESCRIPTOR ConflictingResource;
-  _Out_ PULONG ConflictCount;
-  _Out_ PARBITER_CONFLICT_INFO *Conflicts;
-} ARBITER_QUERY_CONFLICT_PARAMETERS, *PARBITER_QUERY_CONFLICT_PARAMETERS;
-
-typedef struct _ARBITER_QUERY_ARBITRATE_PARAMETERS {
-  _In_ PLIST_ENTRY ArbitrationList;
-} ARBITER_QUERY_ARBITRATE_PARAMETERS, *PARBITER_QUERY_ARBITRATE_PARAMETERS;
-
-typedef struct _ARBITER_ADD_RESERVED_PARAMETERS {
-  _In_ PDEVICE_OBJECT ReserveDevice;
-} ARBITER_ADD_RESERVED_PARAMETERS, *PARBITER_ADD_RESERVED_PARAMETERS;
-
-typedef struct _ARBITER_PARAMETERS {
-  union {
-    ARBITER_TEST_ALLOCATION_PARAMETERS TestAllocation;
-    ARBITER_RETEST_ALLOCATION_PARAMETERS RetestAllocation;
-    ARBITER_BOOT_ALLOCATION_PARAMETERS BootAllocation;
-    ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS QueryAllocatedResources;
-    ARBITER_QUERY_CONFLICT_PARAMETERS QueryConflict;
-    ARBITER_QUERY_ARBITRATE_PARAMETERS QueryArbitrate;
-    ARBITER_ADD_RESERVED_PARAMETERS AddReserved;
-  } Parameters;
-} ARBITER_PARAMETERS, *PARBITER_PARAMETERS;
-
-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;
-
-#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)(
-  _Inout_opt_ PVOID Context,
-  _In_ ARBITER_ACTION Action,
-  _Inout_ 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 _RESOURCE_TRANSLATION_DIRECTION {
-  TranslateChildToParent,
-  TranslateParentToChild
-} RESOURCE_TRANSLATION_DIRECTION;
-
-typedef NTSTATUS
-(NTAPI *PTRANSLATE_RESOURCE_HANDLER)(
-  _Inout_opt_ PVOID Context,
-  _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Source,
-  _In_ RESOURCE_TRANSLATION_DIRECTION Direction,
-  _In_opt_ ULONG AlternativesCount,
-  _In_reads_opt_(AlternativesCount) IO_RESOURCE_DESCRIPTOR Alternatives[],
-  _In_ PDEVICE_OBJECT PhysicalDeviceObject,
-  _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Target);
-
-typedef NTSTATUS
-(NTAPI *PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)(
-  _Inout_opt_ PVOID Context,
-  _In_ PIO_RESOURCE_DESCRIPTOR Source,
-  _In_ PDEVICE_OBJECT PhysicalDeviceObject,
-  _Out_ PULONG TargetCount,
-  _Out_writes_(*TargetCount) 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 struct _PCI_AGP_CAPABILITY {
-  PCI_CAPABILITIES_HEADER Header;
-  USHORT Minor:4;
-  USHORT Major:4;
-  USHORT Rsvd1:8;
-  struct _PCI_AGP_STATUS {
-    ULONG Rate:3;
-    ULONG Agp3Mode:1;
-    ULONG FastWrite:1;
-    ULONG FourGB:1;
-    ULONG HostTransDisable:1;
-    ULONG Gart64:1;
-    ULONG ITA_Coherent:1;
-    ULONG SideBandAddressing:1;
-    ULONG CalibrationCycle:3;
-    ULONG AsyncRequestSize:3;
-    ULONG Rsvd1:1;
-    ULONG Isoch:1;
-    ULONG Rsvd2:6;
-    ULONG RequestQueueDepthMaximum:8;
-  } AGPStatus;
-  struct _PCI_AGP_COMMAND {
-    ULONG Rate:3;
-    ULONG Rsvd1:1;
-    ULONG FastWriteEnable:1;
-    ULONG FourGBEnable:1;
-    ULONG Rsvd2:1;
-    ULONG Gart64:1;
-    ULONG AGPEnable:1;
-    ULONG SBAEnable:1;
-    ULONG CalibrationCycle:3;
-    ULONG AsyncReqSize:3;
-    ULONG Rsvd3:8;
-    ULONG RequestQueueDepth:8;
-  } AGPCommand;
-} PCI_AGP_CAPABILITY, *PPCI_AGP_CAPABILITY;
-
-typedef enum _EXTENDED_AGP_REGISTER {
-  IsochStatus,
-  AgpControl,
-  ApertureSize,
-  AperturePageSize,
-  GartLow,
-  GartHigh,
-  IsochCommand
-} EXTENDED_AGP_REGISTER, *PEXTENDED_AGP_REGISTER;
-
-typedef struct _PCI_AGP_ISOCH_STATUS {
-  ULONG ErrorCode:2;
-  ULONG Rsvd1:1;
-  ULONG Isoch_L:3;
-  ULONG Isoch_Y:2;
-  ULONG Isoch_N:8;
-  ULONG Rsvd2:16;
-} PCI_AGP_ISOCH_STATUS, *PPCI_AGP_ISOCH_STATUS;
-
-typedef struct _PCI_AGP_CONTROL {
-  ULONG Rsvd1:7;
-  ULONG GTLB_Enable:1;
-  ULONG AP_Enable:1;
-  ULONG CAL_Disable:1;
-  ULONG Rsvd2:22;
-} PCI_AGP_CONTROL, *PPCI_AGP_CONTROL;
-
-typedef struct _PCI_AGP_APERTURE_PAGE_SIZE {
-  USHORT PageSizeMask:11;
-  USHORT Rsvd1:1;
-  USHORT PageSizeSelect:4;
-} PCI_AGP_APERTURE_PAGE_SIZE, *PPCI_AGP_APERTURE_PAGE_SIZE;
-
-typedef struct _PCI_AGP_ISOCH_COMMAND {
-  USHORT Rsvd1:6;
-  USHORT Isoch_Y:2;
-  USHORT Isoch_N:8;
-} PCI_AGP_ISOCH_COMMAND, *PPCI_AGP_ISOCH_COMMAND;
-
-typedef struct PCI_AGP_EXTENDED_CAPABILITY {
-  PCI_AGP_ISOCH_STATUS IsochStatus;
-  PCI_AGP_CONTROL AgpControl;
-  USHORT ApertureSize;
-  PCI_AGP_APERTURE_PAGE_SIZE AperturePageSize;
-  ULONG GartLow;
-  ULONG GartHigh;
-  PCI_AGP_ISOCH_COMMAND IsochCommand;
-} PCI_AGP_EXTENDED_CAPABILITY, *PPCI_AGP_EXTENDED_CAPABILITY;
-
-#define PCI_AGP_RATE_1X     0x1
-#define PCI_AGP_RATE_2X     0x2
-#define PCI_AGP_RATE_4X     0x4
-
-#define PCIX_MODE_CONVENTIONAL_PCI  0x0
-#define PCIX_MODE1_66MHZ            0x1
-#define PCIX_MODE1_100MHZ           0x2
-#define PCIX_MODE1_133MHZ           0x3
-#define PCIX_MODE2_266_66MHZ        0x9
-#define PCIX_MODE2_266_100MHZ       0xA
-#define PCIX_MODE2_266_133MHZ       0xB
-#define PCIX_MODE2_533_66MHZ        0xD
-#define PCIX_MODE2_533_100MHZ       0xE
-#define PCIX_MODE2_533_133MHZ       0xF
-
-#define PCIX_VERSION_MODE1_ONLY     0x0
-#define PCIX_VERSION_MODE2_ECC      0x1
-#define PCIX_VERSION_DUAL_MODE_ECC  0x2
-
-typedef struct _PCIX_BRIDGE_CAPABILITY {
-  PCI_CAPABILITIES_HEADER Header;
-  union {
-    _ANONYMOUS_STRUCT struct {
-      USHORT Bus64Bit:1;
-      USHORT Bus133MHzCapable:1;
-      USHORT SplitCompletionDiscarded:1;
-      USHORT UnexpectedSplitCompletion:1;
-      USHORT SplitCompletionOverrun:1;
-      USHORT SplitRequestDelayed:1;
-      USHORT BusModeFrequency:4;
-      USHORT Rsvd:2;
-      USHORT Version:2;
-      USHORT Bus266MHzCapable:1;
-      USHORT Bus533MHzCapable:1;
-    } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-  } SecondaryStatus;
-  union {
-    _ANONYMOUS_STRUCT struct {
-      ULONG FunctionNumber:3;
-      ULONG DeviceNumber:5;
-      ULONG BusNumber:8;
-      ULONG Device64Bit:1;
-      ULONG Device133MHzCapable:1;
-      ULONG SplitCompletionDiscarded:1;
-      ULONG UnexpectedSplitCompletion:1;
-      ULONG SplitCompletionOverrun:1;
-      ULONG SplitRequestDelayed:1;
-      ULONG Rsvd:7;
-      ULONG DIMCapable:1;
-      ULONG Device266MHzCapable:1;
-      ULONG Device533MHzCapable:1;
-    } DUMMYSTRUCTNAME;
-    ULONG AsULONG;
-  } BridgeStatus;
-  USHORT UpstreamSplitTransactionCapacity;
-  USHORT UpstreamSplitTransactionLimit;
-  USHORT DownstreamSplitTransactionCapacity;
-  USHORT DownstreamSplitTransactionLimit;
-  union {
-    _ANONYMOUS_STRUCT struct {
-      ULONG SelectSecondaryRegisters:1;
-      ULONG ErrorPresentInOtherBank:1;
-      ULONG AdditionalCorrectableError:1;
-      ULONG AdditionalUncorrectableError:1;
-      ULONG ErrorPhase:3;
-      ULONG ErrorCorrected:1;
-      ULONG Syndrome:8;
-      ULONG ErrorFirstCommand:4;
-      ULONG ErrorSecondCommand:4;
-      ULONG ErrorUpperAttributes:4;
-      ULONG ControlUpdateEnable:1;
-      ULONG Rsvd:1;
-      ULONG DisableSingleBitCorrection:1;
-      ULONG EccMode:1;
-    } DUMMYSTRUCTNAME;
-  ULONG AsULONG;
-  } EccControlStatus;
-  ULONG EccFirstAddress;
-  ULONG EccSecondAddress;
-  ULONG EccAttribute;
-} PCIX_BRIDGE_CAPABILITY, *PPCIX_BRIDGE_CAPABILITY;
-
-typedef struct _PCI_SUBSYSTEM_IDS_CAPABILITY {
-  PCI_CAPABILITIES_HEADER Header;
-  USHORT Reserved;
-  USHORT SubVendorID;
-  USHORT SubSystemID;
-} PCI_SUBSYSTEM_IDS_CAPABILITY, *PPCI_SUBSYSTEM_IDS_CAPABILITY;
-
-#define OSC_FIRMWARE_FAILURE                            0x02
-#define OSC_UNRECOGNIZED_UUID                           0x04
-#define OSC_UNRECOGNIZED_REVISION                       0x08
-#define OSC_CAPABILITIES_MASKED                         0x10
-
-#define PCI_ROOT_BUS_OSC_METHOD_CAPABILITY_REVISION     0x01
-
-typedef struct _PCI_ROOT_BUS_OSC_SUPPORT_FIELD {
-  union {
-    _ANONYMOUS_STRUCT struct {
-      ULONG ExtendedConfigOpRegions:1;
-      ULONG ActiveStatePowerManagement:1;
-      ULONG ClockPowerManagement:1;
-      ULONG SegmentGroups:1;
-      ULONG MessageSignaledInterrupts:1;
-      ULONG WindowsHardwareErrorArchitecture:1;
-      ULONG Reserved:26;
-    } DUMMYSTRUCTNAME;
-    ULONG AsULONG;
-  } u;
-} PCI_ROOT_BUS_OSC_SUPPORT_FIELD, *PPCI_ROOT_BUS_OSC_SUPPORT_FIELD;
-
-typedef struct _PCI_ROOT_BUS_OSC_CONTROL_FIELD {
-  union {
-    _ANONYMOUS_STRUCT struct {
-      ULONG ExpressNativeHotPlug:1;
-      ULONG ShpcNativeHotPlug:1;
-      ULONG ExpressNativePME:1;
-      ULONG ExpressAdvancedErrorReporting:1;
-      ULONG ExpressCapabilityStructure:1;
-      ULONG Reserved:27;
-    } DUMMYSTRUCTNAME;
-  ULONG AsULONG;
-  } u;
-} PCI_ROOT_BUS_OSC_CONTROL_FIELD, *PPCI_ROOT_BUS_OSC_CONTROL_FIELD;
-
-typedef enum _PCI_HARDWARE_INTERFACE {
-  PciConventional,
-  PciXMode1,
-  PciXMode2,
-  PciExpress
-} PCI_HARDWARE_INTERFACE, *PPCI_HARDWARE_INTERFACE;
-
-typedef enum {
-  BusWidth32Bits,
-  BusWidth64Bits
-} PCI_BUS_WIDTH;
-
-typedef struct _PCI_ROOT_BUS_HARDWARE_CAPABILITY {
-  PCI_HARDWARE_INTERFACE SecondaryInterface;
-  _ANONYMOUS_STRUCT struct {
-    BOOLEAN BusCapabilitiesFound;
-    ULONG CurrentSpeedAndMode;
-    ULONG SupportedSpeedsAndModes;
-    BOOLEAN DeviceIDMessagingCapable;
-    PCI_BUS_WIDTH SecondaryBusWidth;
-  } DUMMYSTRUCTNAME;
-  PCI_ROOT_BUS_OSC_SUPPORT_FIELD OscFeatureSupport;
-  PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlRequest;
-  PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlGranted;
-} PCI_ROOT_BUS_HARDWARE_CAPABILITY, *PPCI_ROOT_BUS_HARDWARE_CAPABILITY;
-
-typedef union _PCI_EXPRESS_CAPABILITIES_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT CapabilityVersion:4;
-    USHORT DeviceType:4;
-    USHORT SlotImplemented:1;
-    USHORT InterruptMessageNumber:5;
-    USHORT Rsvd:2;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_CAPABILITIES_REGISTER, *PPCI_EXPRESS_CAPABILITIES_REGISTER;
-
-typedef union _PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    ULONG MaxPayloadSizeSupported:3;
-    ULONG PhantomFunctionsSupported:2;
-    ULONG ExtendedTagSupported:1;
-    ULONG L0sAcceptableLatency:3;
-    ULONG L1AcceptableLatency:3;
-    ULONG Undefined:3;
-    ULONG RoleBasedErrorReporting:1;
-    ULONG Rsvd1:2;
-    ULONG CapturedSlotPowerLimit:8;
-    ULONG CapturedSlotPowerLimitScale:2;
-    ULONG Rsvd2:4;
-  } DUMMYSTRUCTNAME;
-  ULONG AsULONG;
-} PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER, *PPCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER;
-
-#define PCI_EXPRESS_AER_DEVICE_CONTROL_MASK 0x07;
-
-typedef union _PCI_EXPRESS_DEVICE_CONTROL_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT CorrectableErrorEnable:1;
-    USHORT NonFatalErrorEnable:1;
-    USHORT FatalErrorEnable:1;
-    USHORT UnsupportedRequestErrorEnable:1;
-    USHORT EnableRelaxedOrder:1;
-    USHORT MaxPayloadSize:3;
-    USHORT ExtendedTagEnable:1;
-    USHORT PhantomFunctionsEnable:1;
-    USHORT AuxPowerEnable:1;
-    USHORT NoSnoopEnable:1;
-    USHORT MaxReadRequestSize:3;
-    USHORT BridgeConfigRetryEnable:1;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_DEVICE_CONTROL_REGISTER, *PPCI_EXPRESS_DEVICE_CONTROL_REGISTER;
-
-#define PCI_EXPRESS_AER_DEVICE_STATUS_MASK 0x0F;
-
-typedef union _PCI_EXPRESS_DEVICE_STATUS_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT CorrectableErrorDetected:1;
-    USHORT NonFatalErrorDetected:1;
-    USHORT FatalErrorDetected:1;
-    USHORT UnsupportedRequestDetected:1;
-    USHORT AuxPowerDetected:1;
-    USHORT TransactionsPending:1;
-    USHORT Rsvd:10;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_DEVICE_STATUS_REGISTER, *PPCI_EXPRESS_DEVICE_STATUS_REGISTER;
-
-typedef union _PCI_EXPRESS_LINK_CAPABILITIES_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    ULONG MaximumLinkSpeed:4;
-    ULONG MaximumLinkWidth:6;
-    ULONG ActiveStatePMSupport:2;
-    ULONG L0sExitLatency:3;
-    ULONG L1ExitLatency:3;
-    ULONG ClockPowerManagement:1;
-    ULONG SurpriseDownErrorReportingCapable:1;
-    ULONG DataLinkLayerActiveReportingCapable:1;
-    ULONG Rsvd:3;
-    ULONG PortNumber:8;
-  } DUMMYSTRUCTNAME;
-  ULONG AsULONG;
-} PCI_EXPRESS_LINK_CAPABILITIES_REGISTER, *PPCI_EXPRESS_LINK_CAPABILITIES_REGISTER;
-
-typedef union _PCI_EXPRESS_LINK_CONTROL_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT ActiveStatePMControl:2;
-    USHORT Rsvd1:1;
-    USHORT ReadCompletionBoundary:1;
-    USHORT LinkDisable:1;
-    USHORT RetrainLink:1;
-    USHORT CommonClockConfig:1;
-    USHORT ExtendedSynch:1;
-    USHORT EnableClockPowerManagement:1;
-    USHORT Rsvd2:7;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_LINK_CONTROL_REGISTER, *PPCI_EXPRESS_LINK_CONTROL_REGISTER;
-
-typedef union _PCI_EXPRESS_LINK_STATUS_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT LinkSpeed:4;
-    USHORT LinkWidth:6;
-    USHORT Undefined:1;
-    USHORT LinkTraining:1;
-    USHORT SlotClockConfig:1;
-    USHORT DataLinkLayerActive:1;
-    USHORT Rsvd:2;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_LINK_STATUS_REGISTER, *PPCI_EXPRESS_LINK_STATUS_REGISTER;
-
-typedef union _PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    ULONG AttentionButtonPresent:1;
-    ULONG PowerControllerPresent:1;
-    ULONG MRLSensorPresent:1;
-    ULONG AttentionIndicatorPresent:1;
-    ULONG PowerIndicatorPresent:1;
-    ULONG HotPlugSurprise:1;
-    ULONG HotPlugCapable:1;
-    ULONG SlotPowerLimit:8;
-    ULONG SlotPowerLimitScale:2;
-    ULONG ElectromechanicalLockPresent:1;
-    ULONG NoCommandCompletedSupport:1;
-    ULONG PhysicalSlotNumber:13;
-  } DUMMYSTRUCTNAME;
-  ULONG AsULONG;
-} PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_SLOT_CAPABILITIES_REGISTER;
-
-typedef union _PCI_EXPRESS_SLOT_CONTROL_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT AttentionButtonEnable:1;
-    USHORT PowerFaultDetectEnable:1;
-    USHORT MRLSensorEnable:1;
-    USHORT PresenceDetectEnable:1;
-    USHORT CommandCompletedEnable:1;
-    USHORT HotPlugInterruptEnable:1;
-    USHORT AttentionIndicatorControl:2;
-    USHORT PowerIndicatorControl:2;
-    USHORT PowerControllerControl:1;
-    USHORT ElectromechanicalLockControl:1;
-    USHORT DataLinkStateChangeEnable:1;
-    USHORT Rsvd:3;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_SLOT_CONTROL_REGISTER, *PPCI_EXPRESS_SLOT_CONTROL_REGISTER;
-
-typedef union _PCI_EXPRESS_SLOT_STATUS_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT AttentionButtonPressed:1;
-    USHORT PowerFaultDetected:1;
-    USHORT MRLSensorChanged:1;
-    USHORT PresenceDetectChanged:1;
-    USHORT CommandCompleted:1;
-    USHORT MRLSensorState:1;
-    USHORT PresenceDetectState:1;
-    USHORT ElectromechanicalLockEngaged:1;
-    USHORT DataLinkStateChanged:1;
-    USHORT Rsvd:7;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_SLOT_STATUS_REGISTER, *PPCI_EXPRESS_SLOT_STATUS_REGISTER;
-
-typedef union _PCI_EXPRESS_ROOT_CONTROL_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT CorrectableSerrEnable:1;
-    USHORT NonFatalSerrEnable:1;
-    USHORT FatalSerrEnable:1;
-    USHORT PMEInterruptEnable:1;
-    USHORT CRSSoftwareVisibilityEnable:1;
-    USHORT Rsvd:11;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_ROOT_CONTROL_REGISTER, *PPCI_EXPRESS_ROOT_CONTROL_REGISTER;
-
-typedef union _PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    USHORT CRSSoftwareVisibility:1;
-    USHORT Rsvd:15;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_ROOT_CAPABILITIES_REGISTER;
-
-typedef union _PCI_EXPRESS_ROOT_STATUS_REGISTER {
-  _ANONYMOUS_STRUCT struct {
-    ULONG PMERequestorId:16;
-    ULONG PMEStatus:1;
-    ULONG PMEPending:1;
-    ULONG Rsvd:14;
-  } DUMMYSTRUCTNAME;
-  ULONG AsULONG;
-} PCI_EXPRESS_ROOT_STATUS_REGISTER, *PPCI_EXPRESS_ROOT_STATUS_REGISTER;
-
-typedef struct _PCI_EXPRESS_CAPABILITY {
-  PCI_CAPABILITIES_HEADER Header;
-  PCI_EXPRESS_CAPABILITIES_REGISTER ExpressCapabilities;
-  PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER DeviceCapabilities;
-  PCI_EXPRESS_DEVICE_CONTROL_REGISTER DeviceControl;
-  PCI_EXPRESS_DEVICE_STATUS_REGISTER DeviceStatus;
-  PCI_EXPRESS_LINK_CAPABILITIES_REGISTER LinkCapabilities;
-  PCI_EXPRESS_LINK_CONTROL_REGISTER LinkControl;
-  PCI_EXPRESS_LINK_STATUS_REGISTER LinkStatus;
-  PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER SlotCapabilities;
-  PCI_EXPRESS_SLOT_CONTROL_REGISTER SlotControl;
-  PCI_EXPRESS_SLOT_STATUS_REGISTER SlotStatus;
-  PCI_EXPRESS_ROOT_CONTROL_REGISTER RootControl;
-  PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER RootCapabilities;
-  PCI_EXPRESS_ROOT_STATUS_REGISTER RootStatus;
-} PCI_EXPRESS_CAPABILITY, *PPCI_EXPRESS_CAPABILITY;
-
-typedef enum {
-  MRLClosed = 0,
-  MRLOpen
-} PCI_EXPRESS_MRL_STATE;
-
-typedef enum {
-  SlotEmpty = 0,
-  CardPresent
-} PCI_EXPRESS_CARD_PRESENCE;
-
-typedef enum {
-  IndicatorOn = 1,
-  IndicatorBlink,
-  IndicatorOff
-} PCI_EXPRESS_INDICATOR_STATE;
-
-typedef enum {
-  PowerOn = 0,
-  PowerOff
-} PCI_EXPRESS_POWER_STATE;
-
-typedef enum {
-  L0sEntrySupport = 1,
-  L0sAndL1EntrySupport = 3
-} PCI_EXPRESS_ASPM_SUPPORT;
-
-typedef enum {
-  L0sAndL1EntryDisabled,
-  L0sEntryEnabled,
-  L1EntryEnabled,
-  L0sAndL1EntryEnabled
-} PCI_EXPRESS_ASPM_CONTROL;
-
-typedef enum {
-  L0s_Below64ns = 0,
-  L0s_64ns_128ns,
-  L0s_128ns_256ns,
-  L0s_256ns_512ns,
-  L0s_512ns_1us,
-  L0s_1us_2us,
-  L0s_2us_4us,
-  L0s_Above4us
-} PCI_EXPRESS_L0s_EXIT_LATENCY;
-
-typedef enum {
-  L1_Below1us = 0,
-  L1_1us_2us,
-  L1_2us_4us,
-  L1_4us_8us,
-  L1_8us_16us,
-  L1_16us_32us,
-  L1_32us_64us,
-  L1_Above64us
-} PCI_EXPRESS_L1_EXIT_LATENCY;
-
-typedef enum {
-  PciExpressEndpoint = 0,
-  PciExpressLegacyEndpoint,
-  PciExpressRootPort = 4,
-  PciExpressUpstreamSwitchPort,
-  PciExpressDownstreamSwitchPort,
-  PciExpressToPciXBridge,
-  PciXToExpressBridge,
-  PciExpressRootComplexIntegratedEndpoint,
-  PciExpressRootComplexEventCollector
-} PCI_EXPRESS_DEVICE_TYPE;
-
-typedef enum {
-  MaxPayload128Bytes = 0,
-  MaxPayload256Bytes,
-  MaxPayload512Bytes,
-  MaxPayload1024Bytes,
-  MaxPayload2048Bytes,
-  MaxPayload4096Bytes
-} PCI_EXPRESS_MAX_PAYLOAD_SIZE;
-
-typedef union _PCI_EXPRESS_PME_REQUESTOR_ID {
-  _ANONYMOUS_STRUCT struct {
-    USHORT FunctionNumber:3;
-    USHORT DeviceNumber:5;
-    USHORT BusNumber:8;
-  } DUMMYSTRUCTNAME;
-  USHORT AsUSHORT;
-} PCI_EXPRESS_PME_REQUESTOR_ID, *PPCI_EXPRESS_PME_REQUESTOR_ID;
-
-typedef enum _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE {
-  ResourceTypeSingle = 0,
-  ResourceTypeRange,
-  ResourceTypeExtendedCounterConfiguration,
-  ResourceTypeOverflow,
-  ResourceTypeMax
-} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE;
-
-typedef struct _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR {
-  PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE Type;
-  ULONG Flags;
-  union {
-    ULONG CounterIndex;
-    ULONG ExtendedRegisterAddress;
-    struct {
-      ULONG Begin;
-      ULONG End;
-    } Range;
-  } u;
-} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR, *PPHYSICAL_COUNTER_RESOURCE_DESCRIPTOR;
-
-typedef struct _PHYSICAL_COUNTER_RESOURCE_LIST {
-  ULONG Count;
-  PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR Descriptors[ANYSIZE_ARRAY];
-} PHYSICAL_COUNTER_RESOURCE_LIST, *PPHYSICAL_COUNTER_RESOURCE_LIST;
-
-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_reads_bytes_(Length) 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;
-
-#ifndef _PCIINTRF_X_
-#define _PCIINTRF_X_
-
-typedef ULONG
-(NTAPI *PCI_READ_WRITE_CONFIG)(
-  _In_ PVOID Context,
-  _In_ ULONG BusOffset,
-  _In_ ULONG Slot,
-  _In_reads_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Offset,
-  _In_ ULONG Length);
-
-typedef VOID
-(NTAPI *PCI_PIN_TO_LINE)(
-  _In_ PVOID Context,
-  _In_ PPCI_COMMON_CONFIG PciData);
-
-typedef VOID
-(NTAPI *PCI_LINE_TO_PIN)(
-  _In_ PVOID Context,
-  _In_ PPCI_COMMON_CONFIG PciNewData,
-  _In_ PPCI_COMMON_CONFIG PciOldData);
-
-typedef VOID
-(NTAPI *PCI_ROOT_BUS_CAPABILITY)(
-  _In_ PVOID Context,
-  _Out_ PPCI_ROOT_BUS_HARDWARE_CAPABILITY HardwareCapability);
-
-typedef VOID
-(NTAPI *PCI_EXPRESS_WAKE_CONTROL)(
-  _In_ PVOID Context,
-  _In_ BOOLEAN EnableWake);
-
-typedef struct _PCI_BUS_INTERFACE_STANDARD {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PCI_READ_WRITE_CONFIG ReadConfig;
-  PCI_READ_WRITE_CONFIG WriteConfig;
-  PCI_PIN_TO_LINE PinToLine;
-  PCI_LINE_TO_PIN LineToPin;
-  PCI_ROOT_BUS_CAPABILITY RootBusCapability;
-  PCI_EXPRESS_WAKE_CONTROL ExpressWakeControl;
-} PCI_BUS_INTERFACE_STANDARD, *PPCI_BUS_INTERFACE_STANDARD;
-
-#define PCI_BUS_INTERFACE_STANDARD_VERSION 1
-
-#endif /* _PCIINTRF_X_ */
-
-#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,
-  Cmos,
-  EisaConfiguration,
-  Pos,
-  CbusConfiguration,
-  PCIConfiguration,
-  VMEConfiguration,
-  NuBusConfiguration,
-  PCMCIAConfiguration,
-  MPIConfiguration,
-  MPSAConfiguration,
-  PNPISAConfiguration,
-  SgiInternalConfiguration,
-  MaximumBusDataType
-} BUS_DATA_TYPE, *PBUS_DATA_TYPE;
-
-/* Some Server 2003 DDK definitions */
-#define PCI_INT_ROUTE_INTRF_STANDARD_VER 1
-
-typedef NTSTATUS
-(NTAPI *PLEGACY_DEVICE_DETECTION_HANDLER)(
-  IN PVOID Context,
-  IN INTERFACE_TYPE LegacyBusType,
-  IN ULONG BusNumber,
-  IN ULONG SlotNumber,
-  OUT PDEVICE_OBJECT *PhysicalDeviceObject);
-
-typedef struct _ROUTING_TOKEN {
-  PVOID LinkNode;
-  ULONG StaticVector;
-  UCHAR Flags;
-} ROUTING_TOKEN, *PROUTING_TOKEN;
-
-typedef NTSTATUS
-(NTAPI *PGET_INTERRUPT_ROUTING)(
-  IN PDEVICE_OBJECT Pdo,
-  OUT ULONG *Bus,
-  OUT ULONG *PciSlot,
-  OUT UCHAR *InterruptLine,
-  OUT UCHAR *InterruptPin,
-  OUT UCHAR *ClassCode,
-  OUT UCHAR *SubClassCode,
-  OUT PDEVICE_OBJECT *ParentPdo,
-  OUT ROUTING_TOKEN *RoutingToken,
-  OUT UCHAR *Flags);
-
-typedef NTSTATUS
-(NTAPI *PSET_INTERRUPT_ROUTING_TOKEN)(
-  IN PDEVICE_OBJECT Pdo,
-  IN PROUTING_TOKEN RoutingToken);
-
-typedef VOID
-(NTAPI *PUPDATE_INTERRUPT_LINE)(
-  IN PDEVICE_OBJECT Pdo,
-  IN UCHAR LineRegister);
-
-typedef struct _INT_ROUTE_INTERFACE_STANDARD {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PGET_INTERRUPT_ROUTING GetInterruptRouting;
-  PSET_INTERRUPT_ROUTING_TOKEN SetInterruptRoutingToken;
-  PUPDATE_INTERRUPT_LINE UpdateInterruptLine;
-} INT_ROUTE_INTERFACE_STANDARD, *PINT_ROUTE_INTERFACE_STANDARD;
-
-typedef struct _LEGACY_DEVICE_DETECTION_INTERFACE {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PLEGACY_DEVICE_DETECTION_HANDLER LegacyDeviceDetection;
-} LEGACY_DEVICE_DETECTION_INTERFACE, *PLEGACY_DEVICE_DETECTION_INTERFACE;
-
-/* FIXME : These definitions don't exist in public headers */
-
-#define PCI_CB_INTRF_VERSION             1
-#define PCI_PME_INTRF_STANDARD_VER       1
-#define PNP_LOCATION_INTERFACE_VERSION   1
-
-DEFINE_GUID(GUID_PCI_CARDBUS_INTERFACE_PRIVATE, 0xcca82f31, 0x54d6, 0x11d1, 0x82, 0x24, 0x00, 0xa0, 0xc9, 0x32, 0x43, 0x85);
-DEFINE_GUID(GUID_PCI_PME_INTERFACE, 0xaac7e6ac, 0xbb0b, 0x11d2, 0xb4, 0x84, 0x00, 0xc0, 0x4f, 0x72, 0xde, 0x8b);
-
-typedef NTSTATUS
-(NTAPI *PCARDBUSADD)(
-  IN PDEVICE_OBJECT DeviceObject,
-  IN OUT PVOID *DeviceContext);
-
-typedef NTSTATUS
-(NTAPI *PCARDBUSDELETE)(
-  IN PVOID DeviceContext);
-
-typedef NTSTATUS
-(NTAPI *PCARDBUSPCIDISPATCH)(
-  IN PVOID DeviceContext,
-  IN PIRP Irp);
-
-typedef VOID
-(NTAPI *PPME_SET_PME_ENABLE)(
-  IN PDEVICE_OBJECT Pdo,
-  IN BOOLEAN PmeEnable);
-
-typedef VOID
-(NTAPI *PPME_CLEAR_PME_STATUS)(
-  IN PDEVICE_OBJECT Pdo);
-
-typedef VOID
-(NTAPI *PPME_GET_INFORMATION)(
-  IN PDEVICE_OBJECT Pdo,
-  OUT PBOOLEAN PmeCapable,
-  OUT PBOOLEAN PmeStatus,
-  OUT PBOOLEAN PmeEnable);
-
-typedef struct _PCI_CARDBUS_INTERFACE_PRIVATE {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PDRIVER_OBJECT DriverObject;
-  PCARDBUSADD AddCardBus;
-  PCARDBUSDELETE DeleteCardBus;
-  PCARDBUSPCIDISPATCH DispatchPnp;
-} PCI_CARDBUS_INTERFACE_PRIVATE, *PPCI_CARDBUS_INTERFACE_PRIVATE;
-
-typedef struct _PCI_PME_INTERFACE {
-  USHORT Size;
-  USHORT Version;
-  PVOID Context;
-  PINTERFACE_REFERENCE InterfaceReference;
-  PINTERFACE_DEREFERENCE InterfaceDereference;
-  PPME_GET_INFORMATION GetPmeInformation;
-  PPME_CLEAR_PME_STATUS ClearPmeStatus;
-  PPME_SET_PME_ENABLE UpdateEnable;
-} PCI_PME_INTERFACE, *PPCI_PME_INTERFACE;
-
-/* Hardware Abstraction Layer Types */
-
-typedef BOOLEAN
-(NTAPI *PHAL_RESET_DISPLAY_PARAMETERS)(
-  _In_ ULONG Columns,
-  _In_ ULONG Rows);
-
-typedef PBUS_HANDLER
-(FASTCALL *pHalHandlerForBus)(
-  _In_ INTERFACE_TYPE InterfaceType,
-  _In_ ULONG BusNumber);
-
-typedef VOID
-(FASTCALL *pHalReferenceBusHandler)(
-  _In_ PBUS_HANDLER BusHandler);
-
-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 NTSTATUS
-(NTAPI *pHalQuerySystemInformation)(
-  _In_ HAL_QUERY_INFORMATION_CLASS InformationClass,
-  _In_ ULONG BufferSize,
-  _Inout_updates_bytes_to_(BufferSize, *ReturnedLength) PVOID Buffer,
-  _Out_ PULONG ReturnedLength);
-
-typedef NTSTATUS
-(NTAPI *pHalSetSystemInformation)(
-  _In_ HAL_SET_INFORMATION_CLASS InformationClass,
-  _In_ ULONG BufferSize,
-  _In_ PVOID Buffer);
-
-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 NTSTATUS
-(NTAPI *pHalQueryBusSlots)(
-  _In_ PBUS_HANDLER BusHandler,
-  _In_ ULONG BufferSize,
-  _Out_ PULONG SlotNumbers,
-  _Out_ PULONG ReturnedLength);
-
-typedef NTSTATUS
-(NTAPI *pHalInitPnpDriver)(VOID);
-
-typedef struct _PM_DISPATCH_TABLE {
-  ULONG Signature;
-  ULONG Version;
-  PVOID Function[1];
-} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE;
-
-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 BOOLEAN
-(NTAPI *pHalTranslateBusAddress)(
-  _In_ INTERFACE_TYPE InterfaceType,
-  _In_ ULONG BusNumber,
-  _In_ PHYSICAL_ADDRESS BusAddress,
-  _Inout_ PULONG AddressSpace,
-  _Out_ PPHYSICAL_ADDRESS TranslatedAddress);
-
-typedef NTSTATUS
-(NTAPI *pHalAssignSlotResources)(
-  _In_ PUNICODE_STRING RegistryPath,
-  _In_opt_ PUNICODE_STRING DriverClassName,
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ INTERFACE_TYPE BusType,
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _Inout_ PCM_RESOURCE_LIST *AllocatedResources);
-
-typedef VOID
-(NTAPI *pHalHaltSystem)(VOID);
-
-typedef BOOLEAN
-(NTAPI *pHalResetDisplay)(VOID);
-
-typedef struct _MAP_REGISTER_ENTRY {
-  PVOID MapRegister;
-  BOOLEAN WriteToDevice;
-} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY;
-
-typedef UCHAR
-(NTAPI *pHalVectorToIDTEntry)(
-  ULONG Vector);
-
-typedef BOOLEAN
-(NTAPI *pHalFindBusAddressTranslation)(
-  _In_ PHYSICAL_ADDRESS BusAddress,
-  _Inout_ PULONG AddressSpace,
-  _Out_ PPHYSICAL_ADDRESS TranslatedAddress,
-  _Inout_ PULONG_PTR Context,
-  _In_ BOOLEAN NextBus);
-
-typedef VOID
-(NTAPI *pHalEndOfBoot)(VOID);
-
-typedef PVOID
-(NTAPI *pHalGetAcpiTable)(
-  _In_ ULONG Signature,
-  _In_opt_ PCSTR OemId,
-  _In_opt_ PCSTR OemTableId);
-
-#if defined(_IA64_)
-typedef NTSTATUS
-(*pHalGetErrorCapList)(
-  _Inout_ PULONG CapsListLength,
-  _Inout_updates_bytes_(*CapsListLength) PUCHAR ErrorCapList);
-
-typedef NTSTATUS
-(*pHalInjectError)(
-  _In_ ULONG BufferLength,
-  _In_reads_bytes_(BufferLength) PUCHAR Buffer);
-#endif
-
-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;
-
-#ifdef _NTSYSTEM_
-extern HAL_DISPATCH HalDispatchTable;
-#define HALDISPATCH (&HalDispatchTable)
-#else
-__CREATE_NTOS_DATA_IMPORT_ALIAS(HalDispatchTable)
-extern PHAL_DISPATCH 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
-#define HalGetCachedAcpiTable           HALDISPATCH->HalGetCachedAcpiTable
-#define HalSetPciErrorHandlerCallback   HALDISPATCH->HalSetPciErrorHandlerCallback
-#if defined(_IA64_)
-#define HalGetErrorCapList              HALDISPATCH->HalGetErrorCapList
-#define HalInjectError                  HALDISPATCH->HalInjectError
-#endif
-
-typedef struct _HAL_BUS_INFORMATION {
-  INTERFACE_TYPE BusType;
-  BUS_DATA_TYPE ConfigurationType;
-  ULONG BusNumber;
-  ULONG Reserved;
-} HAL_BUS_INFORMATION, *PHAL_BUS_INFORMATION;
-
-typedef struct _HAL_PROFILE_SOURCE_INFORMATION {
-  KPROFILE_SOURCE Source;
-  BOOLEAN Supported;
-  ULONG Interval;
-} HAL_PROFILE_SOURCE_INFORMATION, *PHAL_PROFILE_SOURCE_INFORMATION;
-
-typedef struct _HAL_PROFILE_SOURCE_INFORMATION_EX {
-  KPROFILE_SOURCE Source;
-  BOOLEAN Supported;
-  ULONG_PTR Interval;
-  ULONG_PTR DefInterval;
-  ULONG_PTR MaxInterval;
-  ULONG_PTR MinInterval;
-} HAL_PROFILE_SOURCE_INFORMATION_EX, *PHAL_PROFILE_SOURCE_INFORMATION_EX;
-
-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_LIST {
-  KPROFILE_SOURCE Source;
-  PWSTR Description;
-} HAL_PROFILE_SOURCE_LIST, *PHAL_PROFILE_SOURCE_LIST;
-
-typedef enum _HAL_DISPLAY_BIOS_INFORMATION {
-  HalDisplayInt10Bios,
-  HalDisplayEmulatedBios,
-  HalDisplayNoBios
-} HAL_DISPLAY_BIOS_INFORMATION, *PHAL_DISPLAY_BIOS_INFORMATION;
-
-typedef struct _HAL_POWER_INFORMATION {
-  ULONG TBD;
-} HAL_POWER_INFORMATION, *PHAL_POWER_INFORMATION;
-
-typedef struct _HAL_PROCESSOR_SPEED_INFO {
-  ULONG ProcessorSpeed;
-} HAL_PROCESSOR_SPEED_INFORMATION, *PHAL_PROCESSOR_SPEED_INFORMATION;
-
-typedef struct _HAL_CALLBACKS {
-  PCALLBACK_OBJECT SetSystemInformation;
-  PCALLBACK_OBJECT BusCheck;
-} HAL_CALLBACKS, *PHAL_CALLBACKS;
-
-typedef struct _HAL_PROCESSOR_FEATURE {
-  ULONG UsableFeatureBits;
-} HAL_PROCESSOR_FEATURE;
-
-typedef NTSTATUS
-(NTAPI *PHALIOREADWRITEHANDLER)(
-  _In_ BOOLEAN fRead,
-  _In_ ULONG dwAddr,
-  _In_ ULONG dwSize,
-  _Inout_ PULONG pdwData);
-
-typedef struct _HAL_AMLI_BAD_IO_ADDRESS_LIST {
-  ULONG BadAddrBegin;
-  ULONG BadAddrSize;
-  ULONG OSVersionTrigger;
-  PHALIOREADWRITEHANDLER IOHandler;
-} HAL_AMLI_BAD_IO_ADDRESS_LIST, *PHAL_AMLI_BAD_IO_ADDRESS_LIST;
-
-#if defined(_X86_) || defined(_IA64_) || defined(_AMD64_)
-
-typedef VOID
-(NTAPI *PHALMCAINTERFACELOCK)(VOID);
-
-typedef VOID
-(NTAPI *PHALMCAINTERFACEUNLOCK)(VOID);
-
-typedef NTSTATUS
-(NTAPI *PHALMCAINTERFACEREADREGISTER)(
-  _In_ UCHAR BankNumber,
-  _Inout_ PVOID Exception);
-
-typedef struct _HAL_MCA_INTERFACE {
-  PHALMCAINTERFACELOCK Lock;
-  PHALMCAINTERFACEUNLOCK Unlock;
-  PHALMCAINTERFACEREADREGISTER ReadRegister;
-} HAL_MCA_INTERFACE;
-
-typedef enum {
-  ApicDestinationModePhysical = 1,
-  ApicDestinationModeLogicalFlat,
-  ApicDestinationModeLogicalClustered,
-  ApicDestinationModeUnknown
-} HAL_APIC_DESTINATION_MODE, *PHAL_APIC_DESTINATION_MODE;
-
-#if defined(_AMD64_)
-
-struct _KTRAP_FRAME;
-struct _KEXCEPTION_FRAME;
-
-typedef ERROR_SEVERITY
-(NTAPI *PDRIVER_EXCPTN_CALLBACK)(
-  _In_ PVOID Context,
-  _In_ struct _KTRAP_FRAME *TrapFrame,
-  _In_ struct _KEXCEPTION_FRAME *ExceptionFrame,
-  _In_ PMCA_EXCEPTION Exception);
-
-#endif
-
-#if defined(_X86_) || defined(_IA64_)
-typedef
-#if defined(_IA64_)
-ERROR_SEVERITY
-#else
-VOID
-#endif
-(NTAPI *PDRIVER_EXCPTN_CALLBACK)(
-  _In_ PVOID Context,
-  _In_ PMCA_EXCEPTION BankLog);
-#endif
-
-typedef PDRIVER_EXCPTN_CALLBACK PDRIVER_MCA_EXCEPTION_CALLBACK;
-
-typedef struct _MCA_DRIVER_INFO {
-  PDRIVER_MCA_EXCEPTION_CALLBACK ExceptionCallback;
-  PKDEFERRED_ROUTINE DpcCallback;
-  PVOID DeviceContext;
-} MCA_DRIVER_INFO, *PMCA_DRIVER_INFO;
-
-typedef struct _HAL_ERROR_INFO {
-  ULONG Version;
-  ULONG InitMaxSize;
-  ULONG McaMaxSize;
-  ULONG McaPreviousEventsCount;
-  ULONG McaCorrectedEventsCount;
-  ULONG McaKernelDeliveryFails;
-  ULONG McaDriverDpcQueueFails;
-  ULONG McaReserved;
-  ULONG CmcMaxSize;
-  ULONG CmcPollingInterval;
-  ULONG CmcInterruptsCount;
-  ULONG CmcKernelDeliveryFails;
-  ULONG CmcDriverDpcQueueFails;
-  ULONG CmcGetStateFails;
-  ULONG CmcClearStateFails;
-  ULONG CmcReserved;
-  ULONGLONG CmcLogId;
-  ULONG CpeMaxSize;
-  ULONG CpePollingInterval;
-  ULONG CpeInterruptsCount;
-  ULONG CpeKernelDeliveryFails;
-  ULONG CpeDriverDpcQueueFails;
-  ULONG CpeGetStateFails;
-  ULONG CpeClearStateFails;
-  ULONG CpeInterruptSources;
-  ULONGLONG CpeLogId;
-  ULONGLONG KernelReserved[4];
-} HAL_ERROR_INFO, *PHAL_ERROR_INFO;
-
-#define HAL_MCE_INTERRUPTS_BASED ((ULONG)-1)
-#define HAL_MCE_DISABLED          ((ULONG)0)
-
-#define HAL_CMC_INTERRUPTS_BASED  HAL_MCE_INTERRUPTS_BASED
-#define HAL_CMC_DISABLED          HAL_MCE_DISABLED
-
-#define HAL_CPE_INTERRUPTS_BASED  HAL_MCE_INTERRUPTS_BASED
-#define HAL_CPE_DISABLED          HAL_MCE_DISABLED
-
-#define HAL_MCA_INTERRUPTS_BASED  HAL_MCE_INTERRUPTS_BASED
-#define HAL_MCA_DISABLED          HAL_MCE_DISABLED
-
-typedef VOID
-(NTAPI *PDRIVER_CMC_EXCEPTION_CALLBACK)(
-  _In_ PVOID Context,
-  _In_ PCMC_EXCEPTION CmcLog);
-
-typedef VOID
-(NTAPI *PDRIVER_CPE_EXCEPTION_CALLBACK)(
-  _In_ PVOID Context,
-  _In_ PCPE_EXCEPTION CmcLog);
-
-typedef struct _CMC_DRIVER_INFO {
-  PDRIVER_CMC_EXCEPTION_CALLBACK ExceptionCallback;
-  PKDEFERRED_ROUTINE DpcCallback;
-  PVOID DeviceContext;
-} CMC_DRIVER_INFO, *PCMC_DRIVER_INFO;
-
-typedef struct _CPE_DRIVER_INFO {
-  PDRIVER_CPE_EXCEPTION_CALLBACK ExceptionCallback;
-  PKDEFERRED_ROUTINE DpcCallback;
-  PVOID DeviceContext;
-} CPE_DRIVER_INFO, *PCPE_DRIVER_INFO;
-
-#endif // defined(_X86_) || defined(_IA64_) || defined(_AMD64_)
-
-#if defined(_IA64_)
-
-typedef NTSTATUS
-(*HALSENDCROSSPARTITIONIPI)(
-  _In_ USHORT ProcessorID,
-  _In_ UCHAR HardwareVector);
-
-typedef NTSTATUS
-(*HALRESERVECROSSPARTITIONINTERRUPTVECTOR)(
-  _Out_ PULONG Vector,
-  _Out_ PKIRQL Irql,
-  _Inout_ PGROUP_AFFINITY Affinity,
-  _Out_ PUCHAR HardwareVector);
-
-typedef VOID
-(*HALFREECROSSPARTITIONINTERRUPTVECTOR)(
-  _In_ ULONG Vector,
-  _In_ PGROUP_AFFINITY Affinity);
-
-typedef struct _HAL_CROSS_PARTITION_IPI_INTERFACE {
-  HALSENDCROSSPARTITIONIPI HalSendCrossPartitionIpi;
-  HALRESERVECROSSPARTITIONINTERRUPTVECTOR HalReserveCrossPartitionInterruptVector;
-  HALFREECROSSPARTITIONINTERRUPTVECTOR HalFreeCrossPartitionInterruptVector;
-} HAL_CROSS_PARTITION_IPI_INTERFACE;
-
-#define HAL_CROSS_PARTITION_IPI_INTERFACE_MINIMUM_SIZE \
-    FIELD_OFFSET(HAL_CROSS_PARTITION_IPI_INTERFACE,    \
-                 HalFreeCrossPartitionInterruptVector)
-
-#endif /* defined(_IA64_) */
-
-typedef struct _HAL_PLATFORM_INFORMATION {
-  ULONG PlatformFlags;
-} HAL_PLATFORM_INFORMATION, *PHAL_PLATFORM_INFORMATION;
-
-#define HAL_PLATFORM_DISABLE_WRITE_COMBINING      0x01L
-#define HAL_PLATFORM_DISABLE_PTCG                 0x04L
-#define HAL_PLATFORM_DISABLE_UC_MAIN_MEMORY       0x08L
-#define HAL_PLATFORM_ENABLE_WRITE_COMBINING_MMIO  0x10L
-#define HAL_PLATFORM_ACPI_TABLES_CACHED           0x20L
-
-/******************************************************************************
- *                              Kernel Types                                  *
- ******************************************************************************/
-
-typedef struct _EXCEPTION_REGISTRATION_RECORD
-{
-  struct _EXCEPTION_REGISTRATION_RECORD *Next;
-  PEXCEPTION_ROUTINE Handler;
-} EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
-
-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;
-  _ANONYMOUS_UNION union {
-    ULONG FiberData;
-    ULONG Version;
-  } DUMMYUNIONNAME;
-  ULONG ArbitraryUserPointer;
-  ULONG Self;
-} NT_TIB32,*PNT_TIB32;
-
-typedef struct _NT_TIB64 {
-  ULONG64 ExceptionList;
-  ULONG64 StackBase;
-  ULONG64 StackLimit;
-  ULONG64 SubSystemTib;
-  _ANONYMOUS_UNION union {
-    ULONG64 FiberData;
-    ULONG Version;
-  } DUMMYUNIONNAME;
-  ULONG64 ArbitraryUserPointer;
-  ULONG64 Self;
-} NT_TIB64,*PNT_TIB64;
-
-#define NX_SUPPORT_POLICY_ALWAYSOFF 0
-#define NX_SUPPORT_POLICY_ALWAYSON  1
-#define NX_SUPPORT_POLICY_OPTIN     2
-#define NX_SUPPORT_POLICY_OPTOUT    3
-
-_IRQL_requires_same_
-_Function_class_(EXPAND_STACK_CALLOUT)
-typedef VOID
-(NTAPI EXPAND_STACK_CALLOUT)(
-  _In_opt_ PVOID Parameter);
-typedef EXPAND_STACK_CALLOUT *PEXPAND_STACK_CALLOUT;
-
-typedef VOID
-(NTAPI *PTIMER_APC_ROUTINE)(
-  _In_ PVOID TimerContext,
-  _In_ ULONG TimerLowValue,
-  _In_ LONG TimerHighValue);
-
-typedef enum _TIMER_SET_INFORMATION_CLASS {
-  TimerSetCoalescableTimer,
-  MaxTimerInfoClass
-} TIMER_SET_INFORMATION_CLASS;
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-typedef struct _TIMER_SET_COALESCABLE_TIMER_INFO {
-  _In_ LARGE_INTEGER DueTime;
-  _In_opt_ PTIMER_APC_ROUTINE TimerApcRoutine;
-  _In_opt_ PVOID TimerContext;
-  _In_opt_ struct _COUNTED_REASON_CONTEXT *WakeContext;
-  _In_opt_ ULONG Period;
-  _In_ ULONG TolerableDelay;
-  _Out_opt_ PBOOLEAN PreviousState;
-} TIMER_SET_COALESCABLE_TIMER_INFO, *PTIMER_SET_COALESCABLE_TIMER_INFO;
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-#define XSTATE_LEGACY_FLOATING_POINT        0
-#define XSTATE_LEGACY_SSE                   1
-#define XSTATE_GSSE                         2
-
-#define XSTATE_MASK_LEGACY_FLOATING_POINT   (1LL << (XSTATE_LEGACY_FLOATING_POINT))
-#define XSTATE_MASK_LEGACY_SSE              (1LL << (XSTATE_LEGACY_SSE))
-#define XSTATE_MASK_LEGACY                  (XSTATE_MASK_LEGACY_FLOATING_POINT | XSTATE_MASK_LEGACY_SSE)
-#define XSTATE_MASK_GSSE                    (1LL << (XSTATE_GSSE))
-
-#define MAXIMUM_XSTATE_FEATURES             64
-
-typedef struct _XSTATE_FEATURE {
-  ULONG Offset;
-  ULONG Size;
-} XSTATE_FEATURE, *PXSTATE_FEATURE;
-
-typedef struct _XSTATE_CONFIGURATION {
-  ULONG64 EnabledFeatures;
-  ULONG Size;
-  ULONG OptimizedSave:1;
-  XSTATE_FEATURE Features[MAXIMUM_XSTATE_FEATURES];
-} XSTATE_CONFIGURATION, *PXSTATE_CONFIGURATION;
-
-#define MAX_WOW64_SHARED_ENTRIES 16
-
-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)
-  _ANONYMOUS_UNION union {
-    UCHAR TscQpcData;
-    _ANONYMOUS_STRUCT struct {
-      UCHAR TscQpcEnabled:1;
-      UCHAR TscQpcSpareFlag:1;
-      UCHAR TscQpcShift:6;
-    } DUMMYSTRUCTNAME;
-  } DUMMYUNIONNAME;
-  UCHAR TscQpcPad[2];
-#endif
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-  _ANONYMOUS_UNION union {
-    ULONG SharedDataFlags;
-    _ANONYMOUS_STRUCT 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;
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-extern NTSYSAPI volatile CCHAR KeNumberProcessors;
-#elif (NTDDI_VERSION >= NTDDI_WINXP)
-extern NTSYSAPI CCHAR KeNumberProcessors;
-#else
-extern PCCHAR KeNumberProcessors;
-#endif
-
-
-/******************************************************************************
- *                          Kernel Debugger Types                             *
- ******************************************************************************/
-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 NTSTATUS
-(NTAPI *pKdSetupPciDeviceForDebugging)(
-  _In_opt_ PVOID LoaderBlock,
-  _Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice);
-
-typedef NTSTATUS
-(NTAPI *pKdReleasePciDeviceForDebugging)(
-  _Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice);
-
-typedef PVOID
-(NTAPI *pKdGetAcpiTablePhase0)(
-  _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
-  _In_ ULONG Signature);
-
-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_writes_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Offset,
-  _In_ ULONG Length);
-
-typedef ULONG
-(NTAPI *pKdSetPciDataByOffset)(
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _In_reads_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Offset,
-  _In_ ULONG Length);
-/******************************************************************************
- *                         Memory manager Types                               *
- ******************************************************************************/
-
-typedef struct _PHYSICAL_MEMORY_RANGE {
-  PHYSICAL_ADDRESS BaseAddress;
-  LARGE_INTEGER NumberOfBytes;
-} PHYSICAL_MEMORY_RANGE, *PPHYSICAL_MEMORY_RANGE;
-
-typedef NTSTATUS
-(NTAPI *PMM_ROTATE_COPY_CALLBACK_FUNCTION)(
-  _In_ PMDL DestinationMdl,
-  _In_ PMDL SourceMdl,
-  _In_ PVOID Context);
-
-typedef enum _MM_ROTATE_DIRECTION {
-  MmToFrameBuffer,
-  MmToFrameBufferNoCopy,
-  MmToRegularMemory,
-  MmToRegularMemoryNoCopy,
-  MmMaximumRotateDirection
-} MM_ROTATE_DIRECTION, *PMM_ROTATE_DIRECTION;
-
-
-/******************************************************************************
- *                           Process Manager Types                            *
- ******************************************************************************/
-
-#define QUOTA_LIMITS_HARDWS_MIN_ENABLE  0x00000001
-#define QUOTA_LIMITS_HARDWS_MIN_DISABLE 0x00000002
-#define QUOTA_LIMITS_HARDWS_MAX_ENABLE  0x00000004
-#define QUOTA_LIMITS_HARDWS_MAX_DISABLE 0x00000008
-#define QUOTA_LIMITS_USE_DEFAULT_LIMITS 0x00000010
-
-typedef struct _QUOTA_LIMITS {
-  SIZE_T PagedPoolLimit;
-  SIZE_T NonPagedPoolLimit;
-  SIZE_T MinimumWorkingSetSize;
-  SIZE_T MaximumWorkingSetSize;
-  SIZE_T PagefileLimit;
-  LARGE_INTEGER TimeLimit;
-} QUOTA_LIMITS, *PQUOTA_LIMITS;
-
-typedef union _RATE_QUOTA_LIMIT {
-  ULONG RateData;
-  _ANONYMOUS_STRUCT struct {
-    ULONG RatePercent:7;
-    ULONG Reserved0:25;
-  } DUMMYSTRUCTNAME;
-} RATE_QUOTA_LIMIT, *PRATE_QUOTA_LIMIT;
-
-typedef struct _QUOTA_LIMITS_EX {
-  SIZE_T PagedPoolLimit;
-  SIZE_T NonPagedPoolLimit;
-  SIZE_T MinimumWorkingSetSize;
-  SIZE_T MaximumWorkingSetSize;
-  SIZE_T PagefileLimit;
-  LARGE_INTEGER TimeLimit;
-  SIZE_T WorkingSetLimit;
-  SIZE_T Reserved2;
-  SIZE_T Reserved3;
-  SIZE_T Reserved4;
-  ULONG Flags;
-  RATE_QUOTA_LIMIT CpuRateLimit;
-} QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX;
-
-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;
-
-#define MAX_HW_COUNTERS 16
-#define THREAD_PROFILING_FLAG_DISPATCH  0x00000001
-
-typedef enum _HARDWARE_COUNTER_TYPE {
-  PMCCounter,
-  MaxHardwareCounterType
-} HARDWARE_COUNTER_TYPE, *PHARDWARE_COUNTER_TYPE;
-
-typedef struct _HARDWARE_COUNTER {
-  HARDWARE_COUNTER_TYPE Type;
-  ULONG Reserved;
-  ULONG64 Index;
-} HARDWARE_COUNTER, *PHARDWARE_COUNTER;
-
-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;
-
-typedef struct _PROCESS_ACCESS_TOKEN {
-  HANDLE Token;
-  HANDLE Thread;
-} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN;
-
-#define PROCESS_EXCEPTION_PORT_ALL_STATE_BITS     0x00000003UL
-#define PROCESS_EXCEPTION_PORT_ALL_STATE_FLAGS    ((ULONG_PTR)((1UL << PROCESS_EXCEPTION_PORT_ALL_STATE_BITS) - 1))
-
-typedef struct _PROCESS_EXCEPTION_PORT {
-  _In_ HANDLE ExceptionPortHandle;
-  _Inout_ ULONG StateFlags;
-} PROCESS_EXCEPTION_PORT, *PPROCESS_EXCEPTION_PORT;
-
-typedef VOID
-(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE)(
-  _In_ HANDLE ParentId,
-  _In_ HANDLE ProcessId,
-  _In_ BOOLEAN Create);
-
-typedef struct _PS_CREATE_NOTIFY_INFO {
-  _In_ SIZE_T Size;
-  _ANONYMOUS_UNION union {
-    _In_ ULONG Flags;
-    _ANONYMOUS_STRUCT struct {
-      _In_ ULONG FileOpenNameAvailable:1;
-      _In_ ULONG Reserved:31;
-    } DUMMYSTRUCTNAME;
-  } DUMMYUNIONNAME;
-  _In_ HANDLE ParentProcessId;
-  _In_ CLIENT_ID CreatingThreadId;
-  _Inout_ struct _FILE_OBJECT *FileObject;
-  _In_ PCUNICODE_STRING ImageFileName;
-  _In_opt_ PCUNICODE_STRING CommandLine;
-  _Inout_ NTSTATUS CreationStatus;
-} PS_CREATE_NOTIFY_INFO, *PPS_CREATE_NOTIFY_INFO;
-
-typedef VOID
-(NTAPI *PCREATE_PROCESS_NOTIFY_ROUTINE_EX)(
-  _Inout_ PEPROCESS Process,
-  _In_ HANDLE ProcessId,
-  _Inout_opt_ PPS_CREATE_NOTIFY_INFO CreateInfo);
-
-typedef VOID
-(NTAPI *PCREATE_THREAD_NOTIFY_ROUTINE)(
-  _In_ HANDLE ProcessId,
-  _In_ HANDLE ThreadId,
-  _In_ BOOLEAN Create);
-
-#define IMAGE_ADDRESSING_MODE_32BIT       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:21;
-    } DUMMYSTRUCTNAME;
-  } DUMMYUNIONNAME;
-  PVOID ImageBase;
-  ULONG ImageSelector;
-  SIZE_T ImageSize;
-  ULONG ImageSectionNumber;
-} IMAGE_INFO, *PIMAGE_INFO;
-
-typedef struct _IMAGE_INFO_EX {
-  SIZE_T Size;
-  IMAGE_INFO ImageInfo;
-  struct _FILE_OBJECT *FileObject;
-} IMAGE_INFO_EX, *PIMAGE_INFO_EX;
-
-typedef VOID
-(NTAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)(
-  _In_ PUNICODE_STRING FullImageName,
-  _In_ HANDLE ProcessId,
-  _In_ PIMAGE_INFO ImageInfo);
-
-#define THREAD_CSWITCH_PMU_DISABLE  FALSE
-#define THREAD_CSWITCH_PMU_ENABLE   TRUE
-
-#define PROCESS_LUID_DOSDEVICES_ONLY 0x00000001
-
-#define PROCESS_HANDLE_TRACING_MAX_STACKS 16
-
-typedef enum _PROCESSINFOCLASS {
-  ProcessBasicInformation,
-  ProcessQuotaLimits,
-  ProcessIoCounters,
-  ProcessVmCounters,
-  ProcessTimes,
-  ProcessBasePriority,
-  ProcessRaisePriority,
-  ProcessDebugPort,
-  ProcessExceptionPort,
-  ProcessAccessToken,
-  ProcessLdtInformation,
-  ProcessLdtSize,
-  ProcessDefaultHardErrorMode,
-  ProcessIoPortHandlers,
-  ProcessPooledUsageAndLimits,
-  ProcessWorkingSetWatch,
-  ProcessUserModeIOPL,
-  ProcessEnableAlignmentFaultFixup,
-  ProcessPriorityClass,
-  ProcessWx86Information,
-  ProcessHandleCount,
-  ProcessAffinityMask,
-  ProcessPriorityBoost,
-  ProcessDeviceMap,
-  ProcessSessionInformation,
-  ProcessForegroundInformation,
-  ProcessWow64Information,
-  ProcessImageFileName,
-  ProcessLUIDDeviceMapsEnabled,
-  ProcessBreakOnTermination,
-  ProcessDebugObjectHandle,
-  ProcessDebugFlags,
-  ProcessHandleTracing,
-  ProcessIoPriority,
-  ProcessExecuteFlags,
-  ProcessTlsInformation,
-  ProcessCookie,
-  ProcessImageInformation,
-  ProcessCycleTime,
-  ProcessPagePriority,
-  ProcessInstrumentationCallback,
-  ProcessThreadStackAllocation,
-  ProcessWorkingSetWatchEx,
-  ProcessImageFileNameWin32,
-  ProcessImageFileMapping,
-  ProcessAffinityUpdateMode,
-  ProcessMemoryAllocationMode,
-  ProcessGroupInformation,
-  ProcessTokenVirtualizationEnabled,
-  ProcessConsoleHostProcess,
-  ProcessWindowInformation,
-  MaxProcessInfoClass
-} PROCESSINFOCLASS;
-
-typedef enum _THREADINFOCLASS {
-  ThreadBasicInformation,
-  ThreadTimes,
-  ThreadPriority,
-  ThreadBasePriority,
-  ThreadAffinityMask,
-  ThreadImpersonationToken,
-  ThreadDescriptorTableEntry,
-  ThreadEnableAlignmentFaultFixup,
-  ThreadEventPair_Reusable,
-  ThreadQuerySetWin32StartAddress,
-  ThreadZeroTlsCell,
-  ThreadPerformanceCount,
-  ThreadAmILastThread,
-  ThreadIdealProcessor,
-  ThreadPriorityBoost,
-  ThreadSetTlsArrayAddress,
-  ThreadIsIoPending,
-  ThreadHideFromDebugger,
-  ThreadBreakOnTermination,
-  ThreadSwitchLegacyState,
-  ThreadIsTerminated,
-  ThreadLastSystemCall,
-  ThreadIoPriority,
-  ThreadCycleTime,
-  ThreadPagePriority,
-  ThreadActualBasePriority,
-  ThreadTebInformation,
-  ThreadCSwitchMon,
-  ThreadCSwitchPmu,
-  ThreadWow64Context,
-  ThreadGroupInformation,
-  ThreadUmsInformation,
-  ThreadCounterProfiling,
-  ThreadIdealProcessorEx,
-  MaxThreadInfoClass
-} THREADINFOCLASS;
-
-typedef struct _PAGE_PRIORITY_INFORMATION {
-  ULONG PagePriority;
-} PAGE_PRIORITY_INFORMATION, *PPAGE_PRIORITY_INFORMATION;
-
-typedef struct _PROCESS_WS_WATCH_INFORMATION {
-  PVOID FaultingPc;
-  PVOID FaultingVa;
-} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION;
-
-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_EXTENDED_BASIC_INFORMATION {
-  SIZE_T Size;
-  PROCESS_BASIC_INFORMATION BasicInfo;
-  _ANONYMOUS_UNION union {
-    ULONG Flags;
-    _ANONYMOUS_STRUCT struct {
-      ULONG IsProtectedProcess:1;
-      ULONG IsWow64Process:1;
-      ULONG IsProcessDeleting:1;
-      ULONG IsCrossSessionCreate:1;
-      ULONG SpareBits:28;
-    } DUMMYSTRUCTNAME;
-  } DUMMYUNIONNAME;
-} PROCESS_EXTENDED_BASIC_INFORMATION, *PPROCESS_EXTENDED_BASIC_INFORMATION;
-
-typedef struct _PROCESS_DEVICEMAP_INFORMATION {
-  _ANONYMOUS_UNION union {
-    struct {
-      HANDLE DirectoryHandle;
-    } Set;
-    struct {
-      ULONG DriveMap;
-      UCHAR DriveType[32];
-    } Query;
-  } DUMMYUNIONNAME;
-} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION;
-
-typedef struct _PROCESS_DEVICEMAP_INFORMATION_EX {
-  _ANONYMOUS_UNION union {
-    struct {
-      HANDLE DirectoryHandle;
-    } Set;
-    struct {
-      ULONG DriveMap;
-      UCHAR DriveType[32];
-    } Query;
-  } DUMMYUNIONNAME;
-  ULONG Flags;
-} PROCESS_DEVICEMAP_INFORMATION_EX, *PPROCESS_DEVICEMAP_INFORMATION_EX;
-
-typedef struct _PROCESS_SESSION_INFORMATION {
-  ULONG SessionId;
-} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION;
-
-typedef struct _PROCESS_HANDLE_TRACING_ENABLE {
-  ULONG Flags;
-} PROCESS_HANDLE_TRACING_ENABLE, *PPROCESS_HANDLE_TRACING_ENABLE;
-
-typedef struct _PROCESS_HANDLE_TRACING_ENABLE_EX {
-  ULONG Flags;
-  ULONG TotalSlots;
-} PROCESS_HANDLE_TRACING_ENABLE_EX, *PPROCESS_HANDLE_TRACING_ENABLE_EX;
-
-typedef struct _PROCESS_HANDLE_TRACING_ENTRY {
-  HANDLE Handle;
-  CLIENT_ID ClientId;
-  ULONG Type;
-  PVOID Stacks[PROCESS_HANDLE_TRACING_MAX_STACKS];
-} PROCESS_HANDLE_TRACING_ENTRY, *PPROCESS_HANDLE_TRACING_ENTRY;
-
-typedef struct _PROCESS_HANDLE_TRACING_QUERY {
-  HANDLE Handle;
-  ULONG TotalTraces;
-  PROCESS_HANDLE_TRACING_ENTRY HandleTrace[1];
-} PROCESS_HANDLE_TRACING_QUERY, *PPROCESS_HANDLE_TRACING_QUERY;
-
-extern NTKERNELAPI PEPROCESS PsInitialSystemProcess;
-
-
-/******************************************************************************
- *                           Runtime Library Types                            *
- ******************************************************************************/
-
-
-#ifndef _RTL_RUN_ONCE_DEF
-#define _RTL_RUN_ONCE_DEF
-
-#define RTL_RUN_ONCE_INIT {0}
-
-#define RTL_RUN_ONCE_CHECK_ONLY     0x00000001UL
-#define RTL_RUN_ONCE_ASYNC          0x00000002UL
-#define RTL_RUN_ONCE_INIT_FAILED    0x00000004UL
-
-#define RTL_RUN_ONCE_CTX_RESERVED_BITS 2
-
-#define RTL_HASH_ALLOCATED_HEADER            0x00000001
-
-#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;
-
-_Function_class_(RTL_RUN_ONCE_INIT_FN)
-_IRQL_requires_same_
-typedef ULONG /* LOGICAL */
-(NTAPI *PRTL_RUN_ONCE_INIT_FN) (
-  _Inout_ PRTL_RUN_ONCE RunOnce,
-  _Inout_opt_ PVOID Parameter,
-  _Inout_opt_ PVOID *Context);
-
-#endif /* _RTL_RUN_ONCE_DEF */
-
-typedef enum _TABLE_SEARCH_RESULT {
-  TableEmptyTree,
-  TableFoundNode,
-  TableInsertAsLeft,
-  TableInsertAsRight
-} TABLE_SEARCH_RESULT;
-
-typedef enum _RTL_GENERIC_COMPARE_RESULTS {
-  GenericLessThan,
-  GenericGreaterThan,
-  GenericEqual
-} RTL_GENERIC_COMPARE_RESULTS;
-
-// Forwarder
-struct _RTL_AVL_TABLE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_AVL_COMPARE_ROUTINE)
-typedef RTL_GENERIC_COMPARE_RESULTS
-(NTAPI RTL_AVL_COMPARE_ROUTINE) (
-  _In_ struct _RTL_AVL_TABLE *Table,
-  _In_ PVOID FirstStruct,
-  _In_ PVOID SecondStruct);
-typedef RTL_AVL_COMPARE_ROUTINE *PRTL_AVL_COMPARE_ROUTINE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_AVL_ALLOCATE_ROUTINE)
-__drv_allocatesMem(Mem)
-typedef PVOID
-(NTAPI RTL_AVL_ALLOCATE_ROUTINE) (
-  _In_ struct _RTL_AVL_TABLE *Table,
-  _In_ CLONG ByteSize);
-typedef RTL_AVL_ALLOCATE_ROUTINE *PRTL_AVL_ALLOCATE_ROUTINE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_AVL_FREE_ROUTINE)
-typedef VOID
-(NTAPI RTL_AVL_FREE_ROUTINE) (
-  _In_ struct _RTL_AVL_TABLE *Table,
-  _In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer);
-typedef RTL_AVL_FREE_ROUTINE *PRTL_AVL_FREE_ROUTINE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_AVL_MATCH_FUNCTION)
-typedef NTSTATUS
-(NTAPI RTL_AVL_MATCH_FUNCTION) (
-  _In_ struct _RTL_AVL_TABLE *Table,
-  _In_ PVOID UserData,
-  _In_ PVOID MatchData);
-typedef RTL_AVL_MATCH_FUNCTION *PRTL_AVL_MATCH_FUNCTION;
-
-typedef struct _RTL_BALANCED_LINKS {
-  struct _RTL_BALANCED_LINKS *Parent;
-  struct _RTL_BALANCED_LINKS *LeftChild;
-  struct _RTL_BALANCED_LINKS *RightChild;
-  CHAR Balance;
-  UCHAR Reserved[3];
-} RTL_BALANCED_LINKS, *PRTL_BALANCED_LINKS;
-
-typedef struct _RTL_AVL_TABLE {
-  RTL_BALANCED_LINKS BalancedRoot;
-  PVOID OrderedPointer;
-  ULONG WhichOrderedElement;
-  ULONG NumberGenericTableElements;
-  ULONG DepthOfTree;
-  PRTL_BALANCED_LINKS RestartKey;
-  ULONG DeleteCount;
-  PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
-  PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
-  PRTL_AVL_FREE_ROUTINE FreeRoutine;
-  PVOID TableContext;
-} RTL_AVL_TABLE, *PRTL_AVL_TABLE;
-
-typedef struct _RTL_SPLAY_LINKS {
-  struct _RTL_SPLAY_LINKS *Parent;
-  struct _RTL_SPLAY_LINKS *LeftChild;
-  struct _RTL_SPLAY_LINKS *RightChild;
-} RTL_SPLAY_LINKS, *PRTL_SPLAY_LINKS;
-
-#ifndef RTL_USE_AVL_TABLES
-
-struct _RTL_GENERIC_TABLE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_GENERIC_COMPARE_ROUTINE)
-typedef RTL_GENERIC_COMPARE_RESULTS
-(NTAPI RTL_GENERIC_COMPARE_ROUTINE) (
-  _In_ struct _RTL_GENERIC_TABLE *Table,
-  _In_ PVOID FirstStruct,
-  _In_ PVOID SecondStruct);
-typedef RTL_GENERIC_COMPARE_ROUTINE *PRTL_GENERIC_COMPARE_ROUTINE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_GENERIC_ALLOCATE_ROUTINE)
-__drv_allocatesMem(Mem)
-typedef PVOID
-(NTAPI RTL_GENERIC_ALLOCATE_ROUTINE) (
-  _In_ struct _RTL_GENERIC_TABLE *Table,
-  _In_ CLONG ByteSize);
-typedef RTL_GENERIC_ALLOCATE_ROUTINE *PRTL_GENERIC_ALLOCATE_ROUTINE;
-
-_IRQL_requires_same_
-_Function_class_(RTL_GENERIC_FREE_ROUTINE)
-typedef VOID
-(NTAPI RTL_GENERIC_FREE_ROUTINE) (
-  _In_ struct _RTL_GENERIC_TABLE *Table,
-  _In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer);
-typedef RTL_GENERIC_FREE_ROUTINE *PRTL_GENERIC_FREE_ROUTINE;
-
-typedef struct _RTL_GENERIC_TABLE {
-  PRTL_SPLAY_LINKS TableRoot;
-  LIST_ENTRY InsertOrderList;
-  PLIST_ENTRY OrderedPointer;
-  ULONG WhichOrderedElement;
-  ULONG NumberGenericTableElements;
-  PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine;
-  PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine;
-  PRTL_GENERIC_FREE_ROUTINE FreeRoutine;
-  PVOID TableContext;
-} RTL_GENERIC_TABLE, *PRTL_GENERIC_TABLE;
-
-#endif /* !RTL_USE_AVL_TABLES */
-
-#ifdef RTL_USE_AVL_TABLES
-
-#undef  RTL_GENERIC_COMPARE_ROUTINE
-#undef PRTL_GENERIC_COMPARE_ROUTINE
-#undef  RTL_GENERIC_ALLOCATE_ROUTINE
-#undef PRTL_GENERIC_ALLOCATE_ROUTINE
-#undef  RTL_GENERIC_FREE_ROUTINE
-#undef PRTL_GENERIC_FREE_ROUTINE
-#undef  RTL_GENERIC_TABLE
-#undef PRTL_GENERIC_TABLE
-
-#define  RTL_GENERIC_COMPARE_ROUTINE     RTL_AVL_COMPARE_ROUTINE
-#define PRTL_GENERIC_COMPARE_ROUTINE    PRTL_AVL_COMPARE_ROUTINE
-#define  RTL_GENERIC_ALLOCATE_ROUTINE    RTL_AVL_ALLOCATE_ROUTINE
-#define PRTL_GENERIC_ALLOCATE_ROUTINE   PRTL_AVL_ALLOCATE_ROUTINE
-#define  RTL_GENERIC_FREE_ROUTINE        RTL_AVL_FREE_ROUTINE
-#define PRTL_GENERIC_FREE_ROUTINE       PRTL_AVL_FREE_ROUTINE
-#define  RTL_GENERIC_TABLE               RTL_AVL_TABLE
-#define PRTL_GENERIC_TABLE              PRTL_AVL_TABLE
-
-#endif /* RTL_USE_AVL_TABLES */
-
-#define RTL_HASH_ALLOCATED_HEADER 0x00000001
-
-typedef struct _RTL_DYNAMIC_HASH_TABLE_ENTRY {
-  LIST_ENTRY Linkage;
-  ULONG_PTR Signature;
-} RTL_DYNAMIC_HASH_TABLE_ENTRY, *PRTL_DYNAMIC_HASH_TABLE_ENTRY;
-
-typedef struct _RTL_DYNAMIC_HASH_TABLE_CONTEXT {
-  PLIST_ENTRY ChainHead;
-  PLIST_ENTRY PrevLinkage;
-  ULONG_PTR Signature;
-} RTL_DYNAMIC_HASH_TABLE_CONTEXT, *PRTL_DYNAMIC_HASH_TABLE_CONTEXT;
-
-typedef struct _RTL_DYNAMIC_HASH_TABLE_ENUMERATOR {
-  RTL_DYNAMIC_HASH_TABLE_ENTRY HashEntry;
-  PLIST_ENTRY ChainHead;
-  ULONG BucketIndex;
-} RTL_DYNAMIC_HASH_TABLE_ENUMERATOR, *PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR;
-
-typedef struct _RTL_DYNAMIC_HASH_TABLE {
-  ULONG Flags;
-  ULONG Shift;
-  ULONG TableSize;
-  ULONG Pivot;
-  ULONG DivisorMask;
-  ULONG NumEntries;
-  ULONG NonEmptyBuckets;
-  ULONG NumEnumerators;
-  PVOID Directory;
-} RTL_DYNAMIC_HASH_TABLE, *PRTL_DYNAMIC_HASH_TABLE;
-
-#define HASH_ENTRY_KEY(x)    ((x)->Signature)
-
-/******************************************************************************
- *                            Security Manager Types                          *
- ******************************************************************************/
-#define SE_UNSOLICITED_INPUT_PRIVILEGE    6
-
-
-typedef enum _WELL_KNOWN_SID_TYPE {
-  WinNullSid = 0,
-  WinWorldSid = 1,
-  WinLocalSid = 2,
-  WinCreatorOwnerSid = 3,
-  WinCreatorGroupSid = 4,
-  WinCreatorOwnerServerSid = 5,
-  WinCreatorGroupServerSid = 6,
-  WinNtAuthoritySid = 7,
-  WinDialupSid = 8,
-  WinNetworkSid = 9,
-  WinBatchSid = 10,
-  WinInteractiveSid = 11,
-  WinServiceSid = 12,
-  WinAnonymousSid = 13,
-  WinProxySid = 14,
-  WinEnterpriseControllersSid = 15,
-  WinSelfSid = 16,
-  WinAuthenticatedUserSid = 17,
-  WinRestrictedCodeSid = 18,
-  WinTerminalServerSid = 19,
-  WinRemoteLogonIdSid = 20,
-  WinLogonIdsSid = 21,
-  WinLocalSystemSid = 22,
-  WinLocalServiceSid = 23,
-  WinNetworkServiceSid = 24,
-  WinBuiltinDomainSid = 25,
-  WinBuiltinAdministratorsSid = 26,
-  WinBuiltinUsersSid = 27,
-  WinBuiltinGuestsSid = 28,
-  WinBuiltinPowerUsersSid = 29,
-  WinBuiltinAccountOperatorsSid = 30,
-  WinBuiltinSystemOperatorsSid = 31,
-  WinBuiltinPrintOperatorsSid = 32,
-  WinBuiltinBackupOperatorsSid = 33,
-  WinBuiltinReplicatorSid = 34,
-  WinBuiltinPreWindows2000CompatibleAccessSid = 35,
-  WinBuiltinRemoteDesktopUsersSid = 36,
-  WinBuiltinNetworkConfigurationOperatorsSid = 37,
-  WinAccountAdministratorSid = 38,
-  WinAccountGuestSid = 39,
-  WinAccountKrbtgtSid = 40,
-  WinAccountDomainAdminsSid = 41,
-  WinAccountDomainUsersSid = 42,
-  WinAccountDomainGuestsSid = 43,
-  WinAccountComputersSid = 44,
-  WinAccountControllersSid = 45,
-  WinAccountCertAdminsSid = 46,
-  WinAccountSchemaAdminsSid = 47,
-  WinAccountEnterpriseAdminsSid = 48,
-  WinAccountPolicyAdminsSid = 49,
-  WinAccountRasAndIasServersSid = 50,
-  WinNTLMAuthenticationSid = 51,
-  WinDigestAuthenticationSid = 52,
-  WinSChannelAuthenticationSid = 53,
-  WinThisOrganizationSid = 54,
-  WinOtherOrganizationSid = 55,
-  WinBuiltinIncomingForestTrustBuildersSid = 56,
-  WinBuiltinPerfMonitoringUsersSid = 57,
-  WinBuiltinPerfLoggingUsersSid = 58,
-  WinBuiltinAuthorizationAccessSid = 59,
-  WinBuiltinTerminalServerLicenseServersSid = 60,
-  WinBuiltinDCOMUsersSid = 61,
-  WinBuiltinIUsersSid = 62,
-  WinIUserSid = 63,
-  WinBuiltinCryptoOperatorsSid = 64,
-  WinUntrustedLabelSid = 65,
-  WinLowLabelSid = 66,
-  WinMediumLabelSid = 67,
-  WinHighLabelSid = 68,
-  WinSystemLabelSid = 69,
-  WinWriteRestrictedCodeSid = 70,
-  WinCreatorOwnerRightsSid = 71,
-  WinCacheablePrincipalsGroupSid = 72,
-  WinNonCacheablePrincipalsGroupSid = 73,
-  WinEnterpriseReadonlyControllersSid = 74,
-  WinAccountReadonlyControllersSid = 75,
-  WinBuiltinEventLogReadersGroup = 76,
-  WinNewEnterpriseReadonlyControllersSid = 77,
-  WinBuiltinCertSvcDComAccessGroup = 78,
-  WinMediumPlusLabelSid = 79,
-  WinLocalLogonSid = 80,
-  WinConsoleLogonSid = 81,
-  WinThisOrganizationCertificateSid = 82,
-} WELL_KNOWN_SID_TYPE;
-
-
-#if defined(_M_IX86)
-
-#define PAUSE_PROCESSOR YieldProcessor();
-
-#define KERNEL_STACK_SIZE                   12288
-#define KERNEL_LARGE_STACK_SIZE             61440
-#define KERNEL_LARGE_STACK_COMMIT           12288
-
-#define SIZE_OF_80387_REGISTERS   80
-
-#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)
-#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS |  \
-                     CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS |      \
-                     CONTEXT_EXTENDED_REGISTERS)
-
-#define CONTEXT_XSTATE          (CONTEXT_i386 | 0x00000040L)
-
-#endif /* !defined(RC_INVOKED) */
-
-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"
-
-#define KeGetPcr()                      PCR
-
-#define PCR_MINOR_VERSION 1
-#define PCR_MAJOR_VERSION 1
-
-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;
-
-FORCEINLINE
-ULONG
-KeGetCurrentProcessorNumber(VOID)
-{
-    return (ULONG)__readfsbyte(FIELD_OFFSET(KPCR, Number));
-}
-
-
-
-
-
-
-extern NTKERNELAPI PVOID MmHighestUserAddress;
-extern NTKERNELAPI PVOID MmSystemRangeStart;
-extern NTKERNELAPI ULONG MmUserProbeAddress;
-
-#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
-#define MM_SYSTEM_RANGE_START MmSystemRangeStart
-#if defined(_LOCAL_COPY_USER_PROBE_ADDRESS_)
-#define MM_USER_PROBE_ADDRESS _LOCAL_COPY_USER_PROBE_ADDRESS_
-extern ULONG _LOCAL_COPY_USER_PROBE_ADDRESS_;
-#else
-#define MM_USER_PROBE_ADDRESS MmUserProbeAddress
-#endif
-#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
-#define MM_KSEG0_BASE       MM_SYSTEM_RANGE_START
-#define MM_SYSTEM_SPACE_END 0xFFFFFFFF
-#if !defined (_X86PAE_)
-#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0800000
-#else
-#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0C00000
-#endif
-
-#elif defined(_M_AMD64)
-
-#define PAUSE_PROCESSOR YieldProcessor();
-
-#define KERNEL_STACK_SIZE 0x6000
-#define KERNEL_LARGE_STACK_SIZE 0x12000
-#define KERNEL_LARGE_STACK_COMMIT KERNEL_STACK_SIZE
-
-#define KERNEL_MCA_EXCEPTION_STACK_SIZE 0x2000
-
-#define EXCEPTION_READ_FAULT    0
-#define EXCEPTION_WRITE_FAULT   1
-#define EXCEPTION_EXECUTE_FAULT 8
-
-#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 /* !defined(RC_INVOKED) */
-
-#define INITIAL_MXCSR                  0x1f80
-#define INITIAL_FPCSR                  0x027f
-
-typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
-  ULONG64 P1Home;
-  ULONG64 P2Home;
-  ULONG64 P3Home;
-  ULONG64 P4Home;
-  ULONG64 P5Home;
-  ULONG64 P6Home;
-  ULONG ContextFlags;
-  ULONG MxCsr;
-  USHORT SegCs;
-  USHORT SegDs;
-  USHORT SegEs;
-  USHORT SegFs;
-  USHORT SegGs;
-  USHORT SegSs;
-  ULONG EFlags;
-  ULONG64 Dr0;
-  ULONG64 Dr1;
-  ULONG64 Dr2;
-  ULONG64 Dr3;
-  ULONG64 Dr6;
-  ULONG64 Dr7;
-  ULONG64 Rax;
-  ULONG64 Rcx;
-  ULONG64 Rdx;
-  ULONG64 Rbx;
-  ULONG64 Rsp;
-  ULONG64 Rbp;
-  ULONG64 Rsi;
-  ULONG64 Rdi;
-  ULONG64 R8;
-  ULONG64 R9;
-  ULONG64 R10;
-  ULONG64 R11;
-  ULONG64 R12;
-  ULONG64 R13;
-  ULONG64 R14;
-  ULONG64 R15;
-  ULONG64 Rip;
-  union {
-    XMM_SAVE_AREA32 FltSave;
-    struct {
-      M128A Header[2];
-      M128A Legacy[8];
-      M128A Xmm0;
-      M128A Xmm1;
-      M128A Xmm2;
-      M128A Xmm3;
-      M128A Xmm4;
-      M128A Xmm5;
-      M128A Xmm6;
-      M128A Xmm7;
-      M128A Xmm8;
-      M128A Xmm9;
-      M128A Xmm10;
-      M128A Xmm11;
-      M128A Xmm12;
-      M128A Xmm13;
-      M128A Xmm14;
-      M128A Xmm15;
-    } DUMMYSTRUCTNAME;
-  } DUMMYUNIONNAME;
-  M128A VectorRegister[26];
-  ULONG64 VectorControl;
-  ULONG64 DebugControl;
-  ULONG64 LastBranchToRip;
-  ULONG64 LastBranchFromRip;
-  ULONG64 LastExceptionToRip;
-  ULONG64 LastExceptionFromRip;
-} CONTEXT;
-
-#define PCR_MINOR_VERSION 1
-#define PCR_MAJOR_VERSION 1
-
-typedef struct _KPCR
-{
-    _ANONYMOUS_UNION union
-    {
-        NT_TIB NtTib;
-        _ANONYMOUS_STRUCT struct
-        {
-            union _KGDTENTRY64 *GdtBase;
-            struct _KTSS64 *TssBase;
-            ULONG64 UserRsp;
-            struct _KPCR *Self;
-            struct _KPRCB *CurrentPrcb;
-            PKSPIN_LOCK_QUEUE LockArray;
-            PVOID Used_Self;
-        };
-    };
-    union _KIDTENTRY64 *IdtBase;
-    ULONG64 Unused[2];
-    KIRQL Irql;
-    UCHAR SecondLevelCacheAssociativity;
-    UCHAR ObsoleteNumber;
-    UCHAR Fill0;
-    ULONG Unused0[3];
-    USHORT MajorVersion;
-    USHORT MinorVersion;
-    ULONG StallScaleFactor;
-    PVOID Unused1[3];
-    ULONG KernelReserved[15];
-    ULONG SecondLevelCacheSize;
-    ULONG HalReserved[16];
-    ULONG Unused2;
-    PVOID KdVersionBlock;
-    PVOID Unused3;
-    ULONG PcrAlign1[24];
-} KPCR, *PKPCR;
-
-FORCEINLINE
-PKPCR
-KeGetPcr(VOID)
-{
-    return (PKPCR)__readgsqword(FIELD_OFFSET(KPCR, Self));
-}
-
-FORCEINLINE
-ULONG
-KeGetCurrentProcessorNumber(VOID)
-{
-    return (ULONG)__readgsword(0x184);
-}
-
-
-#define PTI_SHIFT  12L
-#define PDI_SHIFT  21L
-#define PPI_SHIFT  30L
-#define PXI_SHIFT  39L
-#define PTE_PER_PAGE 512
-#define PDE_PER_PAGE 512
-#define PPE_PER_PAGE 512
-#define PXE_PER_PAGE 512
-#define PTI_MASK_AMD64 (PTE_PER_PAGE - 1)
-#define PDI_MASK_AMD64 (PDE_PER_PAGE - 1)
-#define PPI_MASK (PPE_PER_PAGE - 1)
-#define PXI_MASK (PXE_PER_PAGE - 1)
-
-#define PXE_BASE    0xFFFFF6FB7DBED000ULL
-#define PXE_SELFMAP 0xFFFFF6FB7DBEDF68ULL
-#define PPE_BASE    0xFFFFF6FB7DA00000ULL
-#define PDE_BASE    0xFFFFF6FB40000000ULL
-#define PTE_BASE    0xFFFFF68000000000ULL
-#define PXE_TOP     0xFFFFF6FB7DBEDFFFULL
-#define PPE_TOP     0xFFFFF6FB7DBFFFFFULL
-#define PDE_TOP     0xFFFFF6FB7FFFFFFFULL
-#define PTE_TOP     0xFFFFF6FFFFFFFFFFULL
-
-extern NTKERNELAPI PVOID MmHighestUserAddress;
-extern NTKERNELAPI PVOID MmSystemRangeStart;
-extern NTKERNELAPI ULONG64 MmUserProbeAddress;
-
-#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
-#define MM_SYSTEM_RANGE_START MmSystemRangeStart
-#if defined(_LOCAL_COPY_USER_PROBE_ADDRESS_)
-#define MM_USER_PROBE_ADDRESS _LOCAL_COPY_USER_PROBE_ADDRESS_
-extern ULONG64 _LOCAL_COPY_USER_PROBE_ADDRESS_;
-#else
-#define MM_USER_PROBE_ADDRESS MmUserProbeAddress
-#endif
-#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
-#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xFFFF080000000000ULL
-
-#elif defined(_M_IA64)
-
-#elif defined(_M_PPC)
-
-
-#elif defined(_M_MIPS)
-
-#elif defined(_M_ARM)
-
-#define PAUSE_PROCESSOR __yield();
-
-#define KERNEL_STACK_SIZE         0x3000
-#define KERNEL_LARGE_STACK_SIZE   0xF000
-#define KERNEL_LARGE_STACK_COMMIT KERNEL_STACK_SIZE
-
-#define KERNEL_MCA_EXCEPTION_STACK_SIZE 0x2000
-
-#define EXCEPTION_READ_FAULT    0
-#define EXCEPTION_WRITE_FAULT   1
-#define EXCEPTION_EXECUTE_FAULT 8
-
-/* The following flags control the contents of the CONTEXT structure. */
-#define CONTEXT_ARM             0x200000L
-#define CONTEXT_CONTROL         (CONTEXT_ARM | 0x00000001L)
-#define CONTEXT_INTEGER         (CONTEXT_ARM | 0x00000002L)
-#define CONTEXT_FLOATING_POINT  (CONTEXT_ARM | 0x00000004L)
-#define CONTEXT_DEBUG_REGISTERS (CONTEXT_ARM | 0x00000008L)
-#define CONTEXT_FULL            (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
-
-typedef struct _NEON128
-{
-    ULONGLONG Low;
-    LONGLONG High;
-} NEON128, *PNEON128;
-
-#define ARM_MAX_BREAKPOINTS 8
-#define ARM_MAX_WATCHPOINTS 1
-
-typedef struct _CONTEXT
-{
-    /* The flags values within this flag control the contents of
-       a CONTEXT record.
-
-       If the context record is used as an input parameter, then
-       for each portion of the context record controlled by a flag
-       whose value is set, it is assumed that that portion of the
-       context record contains valid context. If the context record
-       is being used to modify a thread's context, then only that
-       portion of the threads context will be modified.
-
-       If the context record is used as an IN OUT parameter to capture
-       the context of a thread, then only those portions of the thread's
-       context corresponding to set flags will be returned.
-
-       The context record is never used as an OUT only parameter. */
-    ULONG ContextFlags;
-
-    /* This section is specified/returned if the ContextFlags word contains
-       the flag CONTEXT_INTEGER. */
-    ULONG R0;
-    ULONG R1;
-    ULONG R2;
-    ULONG R3;
-    ULONG R4;
-    ULONG R5;
-    ULONG R6;
-    ULONG R7;
-    ULONG R8;
-    ULONG R9;
-    ULONG R10;
-    ULONG R11;
-    ULONG R12;
-
-    ULONG Sp;
-    ULONG Lr;
-    ULONG Pc;
-    ULONG Cpsr;
-
-    /* Floating Point/NEON Registers */
-    ULONG Fpscr;
-    ULONG Padding;
-    union
-    {
-        NEON128 Q[16];
-        ULONGLONG D[32];
-        ULONG S[32];
-    } DUMMYUNIONNAME;
-
-    /* Debug registers */
-    ULONG Bvr[ARM_MAX_BREAKPOINTS];
-    ULONG Bcr[ARM_MAX_BREAKPOINTS];
-    ULONG Wvr[ARM_MAX_WATCHPOINTS];
-    ULONG Wcr[ARM_MAX_WATCHPOINTS];
-
-    ULONG Padding2[2];
-} CONTEXT;
-
-#define PCR_MINOR_VERSION 1
-#define PCR_MAJOR_VERSION 1
-
-typedef struct _KPCR
-{
-    _ANONYMOUS_UNION union
-    {
-        NT_TIB NtTib;
-        _ANONYMOUS_STRUCT struct
-        {
-            ULONG TibPad0[2];
-            PVOID Spare1;
-            struct _KPCR *Self;
-            struct _KPRCB *CurrentPrcb;
-            PKSPIN_LOCK_QUEUE LockArray;
-            PVOID Used_Self;
-        };
-    };
-    KIRQL CurrentIrql;
-    UCHAR SecondLevelCacheAssociativity;
-    ULONG Unused0[3];
-    USHORT MajorVersion;
-    USHORT MinorVersion;
-    ULONG StallScaleFactor;
-    PVOID Unused1[3];
-    ULONG KernelReserved[15];
-    ULONG SecondLevelCacheSize;
-    _ANONYMOUS_UNION union
-    {
-        USHORT SoftwareInterruptPending; // Software Interrupt Pending Flag
-        struct
-        {
-            UCHAR ApcInterrupt;          // 0x01 if APC int pending
-            UCHAR DispatchInterrupt;     // 0x01 if dispatch int pending
-        };
-    };
-    USHORT InterruptPad;
-    ULONG HalReserved[32];
-    PVOID KdVersionBlock;
-    PVOID Unused3;
-    ULONG PcrAlign1[8];
-} KPCR, *PKPCR;
-
-#define CP15_PCR_RESERVED_MASK 0xFFF
-//#define KIPCR() ((ULONG_PTR)(_MoveFromCoprocessor(CP15_TPIDRPRW)) & ~CP15_PCR_RESERVED_MASK)
-
-FORCEINLINE
-PKPCR
-KeGetPcr(
-    VOID)
-{
-    return (PKPCR)(_MoveFromCoprocessor(CP15_TPIDRPRW) & ~CP15_PCR_RESERVED_MASK);
-}
-
-#if (NTDDI_VERSION < NTDDI_WIN7) || !defined(NT_PROCESSOR_GROUPS)
-FORCEINLINE
-ULONG
-KeGetCurrentProcessorNumber(
-    VOID)
-
-{
-    return *((PUCHAR)KeGetPcr() + 0x580);
-}
-#endif /* (NTDDI_VERSION < NTDDI_WIN7) || !defined(NT_PROCESSOR_GROUPS) */
-
-
-#define PTI_SHIFT 12
-#define PDI_SHIFT 22
-
-#define PDE_BASE 0xC0300000
-#define PTE_BASE 0xC0000000
-#define PDE_TOP  0xC0300FFF
-#define PTE_TOP  0xC03FFFFF
-
-extern NTKERNELAPI PVOID MmHighestUserAddress;
-extern NTKERNELAPI PVOID MmSystemRangeStart;
-extern NTKERNELAPI ULONG MmUserProbeAddress;
-
-#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress
-#define MM_SYSTEM_RANGE_START MmSystemRangeStart
-#if defined(_LOCAL_COPY_USER_PROBE_ADDRESS_)
-#define MM_USER_PROBE_ADDRESS _LOCAL_COPY_USER_PROBE_ADDRESS_
-extern ULONG _LOCAL_COPY_USER_PROBE_ADDRESS_;
-#else
-#define MM_USER_PROBE_ADDRESS MmUserProbeAddress
-#endif
-#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000
-#define MM_KSEG0_BASE       MM_SYSTEM_RANGE_START
-#define MM_SYSTEM_SPACE_END 0xFFFFFFFF
-
-#else
-#error Unknown Architecture
-#endif
-
-/******************************************************************************
- *                          Executive Functions                               *
- ******************************************************************************/
-
-static __inline PVOID
-ExAllocateFromZone(
-  IN PZONE_HEADER Zone)
-{
-  PVOID Result = (PVOID)Zone->FreeList.Next;
-  if (Zone->FreeList.Next)
-    Zone->FreeList.Next = Zone->FreeList.Next->Next;
-  return Result;
-}
-
-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
-
-#ifndef _M_IX86
-#define RESULT_ZERO     0
-#define RESULT_NEGATIVE 1
-#define RESULT_POSITIVE 2
-#endif
-
-typedef enum _INTERLOCKED_RESULT {
-  ResultNegative = RESULT_NEGATIVE,
-  ResultZero = RESULT_ZERO,
-  ResultPositive = RESULT_POSITIVE
-} INTERLOCKED_RESULT;
-
-#ifdef _X86_
-
-NTKERNELAPI
-INTERLOCKED_RESULT
-FASTCALL
-Exfi386InterlockedIncrementLong(
-  _Inout_ _Interlocked_operand_ LONG volatile *Addend);
-
-NTKERNELAPI
-INTERLOCKED_RESULT
-FASTCALL
-Exfi386InterlockedDecrementLong(
-  _Inout_ _Interlocked_operand_ PLONG Addend);
-
-NTKERNELAPI
-ULONG
-FASTCALL
-Exfi386InterlockedExchangeUlong(
-  _Inout_ _Interlocked_operand_ PULONG Target,
-  _In_ ULONG Value);
-
-#endif
-
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExExtendZone(
-  _Inout_ PZONE_HEADER Zone,
-  _Inout_ PVOID Segment,
-  _In_ ULONG SegmentSize);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExInitializeZone(
-  _Out_ PZONE_HEADER Zone,
-  _In_ ULONG BlockSize,
-  _Inout_ PVOID InitialSegment,
-  _In_ ULONG InitialSegmentSize);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExInterlockedExtendZone(
-  _Inout_ PZONE_HEADER Zone,
-  _Inout_ PVOID Segment,
-  _In_ ULONG SegmentSize,
-  _Inout_ _Requires_lock_not_held_(*_Curr_) PKSPIN_LOCK Lock);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ExUuidCreate(
-  _Out_ UUID *Uuid);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-DECLSPEC_NORETURN
-VOID
-NTAPI
-ExRaiseAccessViolation(VOID);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-DECLSPEC_NORETURN
-VOID
-NTAPI
-ExRaiseDatatypeMisalignment(VOID);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-/* Hardware Abstraction Layer Functions */
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)
-
-/* Nothing here */
-
-#else /* USE_DMA_MACROS ... */
-
-//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 /* USE_DMA_MACROS ... */
-
-#if !defined(NO_LEGACY_DRIVERS)
-NTHALAPI
-NTSTATUS
-NTAPI
-HalAssignSlotResources(
-  _In_ PUNICODE_STRING RegistryPath,
-  _In_opt_ PUNICODE_STRING DriverClassName,
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ INTERFACE_TYPE BusType,
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _Inout_ PCM_RESOURCE_LIST *AllocatedResources);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-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_reads_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Length);
-
-NTHALAPI
-ULONG
-NTAPI
-HalGetBusData(
-  _In_ BUS_DATA_TYPE BusDataType,
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _Out_writes_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Length);
-
-NTHALAPI
-BOOLEAN
-NTAPI
-HalMakeBeep(
-  _In_ ULONG Frequency);
-#endif /* !defined(NO_LEGACY_DRIVERS) */
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTHALAPI
-PADAPTER_OBJECT
-NTAPI
-HalGetAdapter(
-  _In_ PDEVICE_DESCRIPTION DeviceDescription,
-  _Out_ PULONG NumberOfMapRegisters);
-
-VOID
-NTAPI
-HalPutDmaAdapter(
-  _In_ PADAPTER_OBJECT DmaAdapter);
-
-NTHALAPI
-VOID
-NTAPI
-HalAcquireDisplayOwnership(
-  _In_ PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters);
-
-NTHALAPI
-ULONG
-NTAPI
-HalGetBusDataByOffset(
-  _In_ BUS_DATA_TYPE BusDataType,
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _Out_writes_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Offset,
-  _In_ ULONG Length);
-
-NTHALAPI
-ULONG
-NTAPI
-HalSetBusDataByOffset(
-  _In_ BUS_DATA_TYPE BusDataType,
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _In_reads_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Offset,
-  _In_ ULONG Length);
-
-NTHALAPI
-BOOLEAN
-NTAPI
-HalTranslateBusAddress(
-  _In_ INTERFACE_TYPE InterfaceType,
-  _In_ ULONG BusNumber,
-  _In_ PHYSICAL_ADDRESS BusAddress,
-  _Inout_ PULONG AddressSpace,
-  _Out_ PPHYSICAL_ADDRESS TranslatedAddress);
-
-NTHALAPI
-PVOID
-NTAPI
-HalAllocateCrashDumpRegisters(
-  _In_ PADAPTER_OBJECT AdapterObject,
-  _Inout_ PULONG NumberOfMapRegisters);
-
-NTSTATUS
-NTAPI
-HalGetScatterGatherList(
-  _In_ PADAPTER_OBJECT DmaAdapter,
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ PMDL Mdl,
-  _In_ PVOID CurrentVa,
-  _In_ ULONG Length,
-  _In_ PDRIVER_LIST_CONTROL ExecutionRoutine,
-  _In_ PVOID Context,
-  _In_ BOOLEAN WriteToDevice);
-
-VOID
-NTAPI
-HalPutScatterGatherList(
-  _In_ PADAPTER_OBJECT DmaAdapter,
-  _In_ PSCATTER_GATHER_LIST ScatterGather,
-  _In_ BOOLEAN WriteToDevice);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-FASTCALL
-HalExamineMBR(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ ULONG SectorSize,
-  _In_ ULONG MBRTypeIdentifier,
-  _Out_ PVOID *Buffer);
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-NTSTATUS
-NTAPI
-HalAllocateHardwareCounters(
-  _In_reads_(GroupCount) PGROUP_AFFINITY GroupAffinty,
-  _In_ ULONG GroupCount,
-  _In_ PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList,
-  _Out_ PHANDLE CounterSetHandle);
-
-NTSTATUS
-NTAPI
-HalFreeHardwareCounters(
-  _In_ HANDLE CounterSetHandle);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-#if defined(_IA64_)
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-NTHALAPI
-ULONG
-NTAPI
-HalGetDmaAlignmentRequirement(VOID);
-#endif
-#endif /* defined(_IA64_) */
-
-#if defined(_M_IX86) || defined(_M_AMD64)
-#define HalGetDmaAlignmentRequirement() 1L
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR *PWHEA_ERROR_SOURCE_DESCRIPTOR;
-typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD;
-
-NTHALAPI
-VOID
-NTAPI
-HalBugCheckSystem(
-  _In_ PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource,
-  _In_ PWHEA_ERROR_RECORD ErrorRecord);
-
-#else
-
-typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD;
-
-NTHALAPI
-VOID
-NTAPI
-HalBugCheckSystem(
-  _In_ PWHEA_ERROR_RECORD ErrorRecord);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-/******************************************************************************
- *                         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
-
-FORCEINLINE
-VOID
-NTAPI
-IoInitializeDriverCreateContext(
-  PIO_DRIVER_CREATE_CONTEXT DriverContext)
-{
-  RtlZeroMemory(DriverContext, sizeof(IO_DRIVER_CREATE_CONTEXT));
-  DriverContext->Size = sizeof(IO_DRIVER_CREATE_CONTEXT);
-}
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-#if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_))
-_IRQL_requires_max_(DISPATCH_LEVEL)
-_IRQL_requires_min_(DISPATCH_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAllocateAdapterChannel(
-  _In_ PADAPTER_OBJECT AdapterObject,
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ ULONG NumberOfMapRegisters,
-  _In_ PDRIVER_CONTROL ExecutionRoutine,
-  _In_ PVOID Context);
-#endif
-
-#if !defined(DMA_MACROS_DEFINED)
-//DECLSPEC_DEPRECATED_DDK
-NTHALAPI
-PHYSICAL_ADDRESS
-NTAPI
-IoMapTransfer(
-  _In_ PADAPTER_OBJECT AdapterObject,
-  _In_ PMDL Mdl,
-  _In_ PVOID MapRegisterBase,
-  _In_ PVOID CurrentVa,
-  _Inout_ PULONG Length,
-  _In_ BOOLEAN WriteToDevice);
-#endif
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-_IRQL_requires_min_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoAllocateController(
-  _In_ PCONTROLLER_OBJECT ControllerObject,
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ PDRIVER_CONTROL ExecutionRoutine,
-  _In_opt_ PVOID Context);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-PCONTROLLER_OBJECT
-NTAPI
-IoCreateController(
-  _In_ ULONG Size);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoDeleteController(
-  _In_ PCONTROLLER_OBJECT ControllerObject);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-_IRQL_requires_min_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoFreeController(
-  _In_ PCONTROLLER_OBJECT ControllerObject);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-PCONFIGURATION_INFORMATION
-NTAPI
-IoGetConfigurationInformation(VOID);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetDeviceToVerify(
-  _In_ PETHREAD Thread);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoCancelFileOpen(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ PFILE_OBJECT FileObject);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-PGENERIC_MAPPING
-NTAPI
-IoGetFileObjectGenericMapping(VOID);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-PIRP
-NTAPI
-IoMakeAssociatedIrp(
-  _In_ PIRP Irp,
-  _In_ CCHAR StackSize);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoQueryDeviceDescription(
-  _In_opt_ PINTERFACE_TYPE BusType,
-  _In_opt_ PULONG BusNumber,
-  _In_opt_ PCONFIGURATION_TYPE ControllerType,
-  _In_opt_ PULONG ControllerNumber,
-  _In_opt_ PCONFIGURATION_TYPE PeripheralType,
-  _In_opt_ PULONG PeripheralNumber,
-  _In_ PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
-  _Inout_opt_ PVOID Context);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoRaiseHardError(
-  _In_ PIRP Irp,
-  _In_opt_ PVPB Vpb,
-  _In_ PDEVICE_OBJECT RealDeviceObject);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoRaiseInformationalHardError(
-  _In_ NTSTATUS ErrorStatus,
-  _In_opt_ PUNICODE_STRING String,
-  _In_opt_ PKTHREAD Thread);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoRegisterBootDriverReinitialization(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDRIVER_REINITIALIZE DriverReinitializationRoutine,
-  _In_opt_ PVOID Context);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoRegisterDriverReinitialization(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDRIVER_REINITIALIZE DriverReinitializationRoutine,
-  _In_opt_ PVOID Context);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAttachDeviceByPointer(
-  _In_ PDEVICE_OBJECT SourceDevice,
-  _In_ PDEVICE_OBJECT TargetDevice);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReportDetectedDevice(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ INTERFACE_TYPE LegacyBusType,
-  _In_ ULONG BusNumber,
-  _In_ ULONG SlotNumber,
-  _In_opt_ PCM_RESOURCE_LIST ResourceList,
-  _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements,
-  _In_ BOOLEAN ResourceAssigned,
-  _Inout_ PDEVICE_OBJECT *DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReportResourceForDetection(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST DriverList,
-  _In_opt_ ULONG DriverListSize,
-  _In_opt_ PDEVICE_OBJECT DeviceObject,
-  _In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST DeviceList,
-  _In_opt_ ULONG DeviceListSize,
-  _Out_ PBOOLEAN ConflictDetected);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReportResourceUsage(
-  _In_opt_ PUNICODE_STRING DriverClassName,
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_reads_bytes_opt_(DriverListSize) PCM_RESOURCE_LIST DriverList,
-  _In_opt_ ULONG DriverListSize,
-  _In_opt_ PDEVICE_OBJECT DeviceObject,
-  _In_reads_bytes_opt_(DeviceListSize) PCM_RESOURCE_LIST DeviceList,
-  _In_opt_ ULONG DeviceListSize,
-  _In_ BOOLEAN OverrideConflict,
-  _Out_ PBOOLEAN ConflictDetected);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-IoSetHardErrorOrVerifyDevice(
-  _In_ PIRP Irp,
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAssignResources(
-  _In_ PUNICODE_STRING RegistryPath,
-  _In_opt_ PUNICODE_STRING DriverClassName,
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_opt_ PDEVICE_OBJECT DeviceObject,
-  _In_opt_ PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources,
-  _Inout_ PCM_RESOURCE_LIST *AllocatedResources);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoSetThreadHardErrorMode(
-  _In_ BOOLEAN EnableHardErrors);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN2KSP3)
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoIsFileOriginRemote(
-  _In_ PFILE_OBJECT FileObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoSetFileOrigin(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ BOOLEAN Remote);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2KSP3) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-FASTCALL
-IoReadPartitionTable(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ ULONG SectorSize,
-  _In_ BOOLEAN ReturnRecognizedPartitions,
-  _Out_ struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-FASTCALL
-IoSetPartitionInformation(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ ULONG SectorSize,
-  _In_ ULONG PartitionNumber,
-  _In_ ULONG PartitionType);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-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
-IoCreateDisk(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_opt_ struct _CREATE_DISK* Disk);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReadDiskSignature(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ ULONG BytesPerSector,
-  _Out_ PDISK_SIGNATURE Signature);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReadPartitionTableEx(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _Out_ struct _DRIVE_LAYOUT_INFORMATION_EX **PartitionBuffer);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-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
-NTSTATUS
-NTAPI
-IoVerifyPartitionTable(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ BOOLEAN FixErrors);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoVolumeDeviceToDosName(
-  _In_ PVOID VolumeDeviceObject,
-  _Out_ _When_(return==0,
-    _At_(DosName->Buffer, __drv_allocatesMem(Mem)))
-    PUNICODE_STRING DosName);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoWritePartitionTableEx(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_reads_(_Inexpressible_(FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry[0])))
-    struct _DRIVE_LAYOUT_INFORMATION_EX *DriveLayout);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCreateFileSpecifyDeviceObjectHint(
-  _Out_ PHANDLE FileHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_opt_ PLARGE_INTEGER AllocationSize,
-  _In_ ULONG FileAttributes,
-  _In_ ULONG ShareAccess,
-  _In_ ULONG Disposition,
-  _In_ ULONG CreateOptions,
-  _In_opt_ PVOID EaBuffer,
-  _In_ ULONG EaLength,
-  _In_ CREATE_FILE_TYPE CreateFileType,
-  _In_opt_ PVOID InternalParameters,
-  _In_ ULONG Options,
-  _In_opt_ PVOID DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoAttachDeviceToDeviceStackSafe(
-  _In_ PDEVICE_OBJECT SourceDevice,
-  _In_ PDEVICE_OBJECT TargetDevice,
-  _Outptr_ PDEVICE_OBJECT *AttachedToDeviceObject);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WS03)
-NTKERNELAPI
-IO_PAGING_PRIORITY
-FASTCALL
-IoGetPagingIoPriority(
-  _In_ PIRP Irp);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
-#if (NTDDI_VERSION >= NTDDI_WS03SP1)
-
-BOOLEAN
-NTAPI
-IoTranslateBusAddress(
-  _In_ INTERFACE_TYPE InterfaceType,
-  _In_ ULONG BusNumber,
-  _In_ PHYSICAL_ADDRESS BusAddress,
-  _Inout_ PULONG AddressSpace,
-  _Out_ PPHYSICAL_ADDRESS TranslatedAddress);
-#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoUpdateDiskGeometry(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ struct _DISK_GEOMETRY_EX* OldDiskGeometry,
-  _In_ struct _DISK_GEOMETRY_EX* NewDiskGeometry);
-
-PTXN_PARAMETER_BLOCK
-NTAPI
-IoGetTransactionParameterBlock(
-  _In_ PFILE_OBJECT FileObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCreateFileEx(
-  _Out_ PHANDLE FileHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_opt_ PLARGE_INTEGER AllocationSize,
-  _In_ ULONG FileAttributes,
-  _In_ ULONG ShareAccess,
-  _In_ ULONG Disposition,
-  _In_ ULONG CreateOptions,
-  _In_opt_ PVOID EaBuffer,
-  _In_ ULONG EaLength,
-  _In_ CREATE_FILE_TYPE CreateFileType,
-  _In_opt_ PVOID InternalParameters,
-  _In_ ULONG Options,
-  _In_opt_ PIO_DRIVER_CREATE_CONTEXT DriverContext);
-
-NTSTATUS
-NTAPI
-IoSetIrpExtraCreateParameter(
-  _Inout_ PIRP Irp,
-  _In_ struct _ECP_LIST *ExtraCreateParameter);
-
-VOID
-NTAPI
-IoClearIrpExtraCreateParameter(
-  _Inout_ PIRP Irp);
-
-NTSTATUS
-NTAPI
-IoGetIrpExtraCreateParameter(
-  _In_ PIRP Irp,
-  _Outptr_result_maybenull_ struct _ECP_LIST **ExtraCreateParameter);
-
-BOOLEAN
-NTAPI
-IoIsFileObjectIgnoringSharing(
-  _In_ PFILE_OBJECT FileObject);
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-NTSTATUS
-NTAPI
-IoSetFileObjectIgnoreSharing(
-  _In_ PFILE_OBJECT FileObject);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-/******************************************************************************
- *                          Kernel Debugger Functions                         *
- ******************************************************************************/
-NTSYSAPI
-ULONG
-NTAPI
-DbgPrompt(
-  _In_z_ PCCH Prompt,
-  _Out_writes_bytes_(MaximumResponseLength) PCH Response,
-  _In_ ULONG MaximumResponseLength);
-
-/******************************************************************************
- *                              Kernel Functions                              *
- ******************************************************************************/
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-FASTCALL
-KeInvalidateRangeAllCaches(
-  _In_ PVOID BaseAddress,
-  _In_ ULONG Length);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTKERNELAPI
-VOID
-NTAPI
-KeSetImportanceDpc(
-  _Inout_ PRKDPC Dpc,
-  _In_ KDPC_IMPORTANCE Importance);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONG
-NTAPI
-KePulseEvent(
-  _Inout_ PRKEVENT Event,
-  _In_ KPRIORITY Increment,
-  _In_ BOOLEAN Wait);
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONG
-NTAPI
-KeSetBasePriorityThread(
-  _Inout_ PRKTHREAD Thread,
-  _In_ LONG Increment);
-
-_Acquires_lock_(_Global_critical_region_)
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeEnterCriticalRegion(VOID);
-
-_Releases_lock_(_Global_critical_region_)
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeLeaveCriticalRegion(VOID);
-
-NTKERNELAPI
-DECLSPEC_NORETURN
-VOID
-NTAPI
-KeBugCheck(
-  _In_ ULONG BugCheckCode);
-#if defined(SINGLE_GROUP_LEGACY_API)
-
-
-NTKERNELAPI
-VOID
-NTAPI
-KeSetTargetProcessorDpc(
-  _Inout_ PRKDPC Dpc,
-  _In_ CCHAR Number);
-
-NTKERNELAPI
-KAFFINITY
-NTAPI
-KeQueryActiveProcessors(VOID);
-#endif /* defined(SINGLE_GROUP_LEGACY_API) */
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-KeAreApcsDisabled(VOID);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WS03)
-
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-KeInvalidateAllCaches(VOID);
-#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
-#if (NTDDI_VERSION >= NTDDI_WS03SP1)
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-KeExpandKernelStackAndCallout(
-  _In_ PEXPAND_STACK_CALLOUT Callout,
-  _In_opt_ PVOID Parameter,
-  _In_ SIZE_T Size);
-
-_Acquires_lock_(_Global_critical_region_)
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeEnterGuardedRegion(VOID);
-
-_Releases_lock_(_Global_critical_region_)
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeLeaveGuardedRegion(VOID);
-#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-#if defined(SINGLE_GROUP_LEGACY_API)
-
-NTKERNELAPI
-ULONG
-NTAPI
-KeQueryActiveProcessorCount(
-  _Out_opt_ PKAFFINITY ActiveProcessors);
-
-NTKERNELAPI
-ULONG
-NTAPI
-KeQueryMaximumProcessorCount(VOID);
-#endif /* SINGLE_GROUP_LEGACY_API */
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-NTKERNELAPI
-ULONG
-NTAPI
-KeQueryActiveProcessorCountEx(
-  _In_ USHORT GroupNumber);
-
-NTKERNELAPI
-ULONG
-NTAPI
-KeQueryMaximumProcessorCountEx(
-  _In_ USHORT GroupNumber);
-
-NTKERNELAPI
-USHORT
-NTAPI
-KeQueryActiveGroupCount(VOID);
-
-NTKERNELAPI
-USHORT
-NTAPI
-KeQueryMaximumGroupCount(VOID);
-
-NTKERNELAPI
-KAFFINITY
-NTAPI
-KeQueryGroupAffinity(
-  _In_ USHORT GroupNumber);
-
-NTKERNELAPI
-ULONG
-NTAPI
-KeGetCurrentProcessorNumberEx(
-  _Out_opt_ PPROCESSOR_NUMBER ProcNumber);
-
-NTKERNELAPI
-VOID
-NTAPI
-KeQueryNodeActiveAffinity(
-  _In_ USHORT NodeNumber,
-  _Out_opt_ PGROUP_AFFINITY Affinity,
-  _Out_opt_ PUSHORT Count);
-
-NTKERNELAPI
-USHORT
-NTAPI
-KeQueryNodeMaximumProcessorCount(
-  _In_ USHORT NodeNumber);
-
-NTKERNELAPI
-USHORT
-NTAPI
-KeQueryHighestNodeNumber(VOID);
-
-NTKERNELAPI
-USHORT
-NTAPI
-KeGetCurrentNodeNumber(VOID);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-KeQueryLogicalProcessorRelationship(
-  _In_opt_ PPROCESSOR_NUMBER ProcessorNumber,
-  _In_ LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType,
-  _Out_writes_bytes_opt_(*Length) PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Information,
-  _Inout_ PULONG Length);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-KeSetHardwareCounterConfiguration(
-  _In_reads_(Count) PHARDWARE_COUNTER CounterArray,
-  _In_ ULONG Count);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-KeQueryHardwareCounterConfiguration(
-  _Out_writes_to_(MaximumCount, *Count) PHARDWARE_COUNTER CounterArray,
-  _In_ ULONG MaximumCount,
-  _Out_ PULONG Count);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-/******************************************************************************
- *                       Memory manager Functions                             *
- ******************************************************************************/
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-_IRQL_requires_max_ (PASSIVE_LEVEL)
-NTKERNELAPI
-PPHYSICAL_MEMORY_RANGE
-NTAPI
-MmGetPhysicalMemoryRanges(VOID);
-
-NTKERNELAPI
-PHYSICAL_ADDRESS
-NTAPI
-MmGetPhysicalAddress(
-  _In_ PVOID BaseAddress);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsNonPagedSystemAddressValid(
-  _In_ PVOID VirtualAddress);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-_Out_writes_bytes_opt_(NumberOfBytes)
-NTKERNELAPI
-PVOID
-NTAPI
-MmAllocateNonCachedMemory(
-  _In_ SIZE_T NumberOfBytes);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-MmFreeNonCachedMemory(
-  _In_reads_bytes_(NumberOfBytes) PVOID BaseAddress,
-  _In_ SIZE_T NumberOfBytes);
-
-NTKERNELAPI
-PVOID
-NTAPI
-MmGetVirtualForPhysical(
-  _In_ PHYSICAL_ADDRESS PhysicalAddress);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapUserAddressesToPage(
-  _In_reads_bytes_(NumberOfBytes) PVOID BaseAddress,
-  _In_ SIZE_T NumberOfBytes,
-  _In_ PVOID PageAddress);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-_Out_writes_bytes_opt_(NumberOfBytes)
-NTKERNELAPI
-PVOID
-NTAPI
-MmMapVideoDisplay(
-  _In_ PHYSICAL_ADDRESS PhysicalAddress,
-  _In_ SIZE_T NumberOfBytes,
-  _In_ MEMORY_CACHING_TYPE CacheType);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapViewInSessionSpace(
-  _In_ PVOID Section,
-  _Outptr_result_bytebuffer_(*ViewSize) PVOID *MappedBase,
-  _Inout_ PSIZE_T ViewSize);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmMapViewInSystemSpace(
-  _In_ PVOID Section,
-  _Outptr_result_bytebuffer_(*ViewSize) PVOID *MappedBase,
-  _Inout_ PSIZE_T ViewSize);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsAddressValid(
-  _In_ PVOID VirtualAddress);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsThisAnNtAsSystem(VOID);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-MmLockPagableSectionByHandle(
-  _In_ PVOID ImageSectionHandle);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmUnmapViewInSessionSpace(
-  _In_ PVOID MappedBase);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmUnmapViewInSystemSpace(
-  _In_ PVOID MappedBase);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-MmUnsecureVirtualMemory(
-  _In_ HANDLE SecureHandle);
-
-_IRQL_requires_max_ (PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmRemovePhysicalMemory(
-  _In_ PPHYSICAL_ADDRESS StartAddress,
-  _Inout_ PLARGE_INTEGER NumberOfBytes);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-HANDLE
-NTAPI
-MmSecureVirtualMemory(
-  __in_data_source(USER_MODE) _In_reads_bytes_ (Size) PVOID Address,
-  _In_ __in_data_source(USER_MODE) SIZE_T Size,
-  _In_ ULONG ProbeMode);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-MmUnmapVideoDisplay(
-  _In_reads_bytes_(NumberOfBytes) PVOID BaseAddress,
-  _In_ SIZE_T NumberOfBytes);
-
-_IRQL_requires_max_ (PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmAddPhysicalMemory(
-  _In_ PPHYSICAL_ADDRESS StartAddress,
-  _Inout_ PLARGE_INTEGER NumberOfBytes);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-
-#if (NTDDI_VERSION >= NTDDI_WS03)
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmCreateMirror(VOID);
-#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTSTATUS
-NTAPI
-MmRotatePhysicalView(
-  _In_ PVOID VirtualAddress,
-  _Inout_ PSIZE_T NumberOfBytes,
-  _In_opt_ PMDLX NewMdl,
-  _In_ MM_ROTATE_DIRECTION Direction,
-  _In_ PMM_ROTATE_COPY_CALLBACK_FUNCTION CopyFunction,
-  _In_opt_ PVOID Context);
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-/******************************************************************************
- *                          Process Manager Functions                         *
- ******************************************************************************/
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenProcess(
-  _Out_ PHANDLE ProcessHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_opt_ PCLIENT_ID ClientId);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryInformationProcess(
-  _In_ HANDLE ProcessHandle,
-  _In_ PROCESSINFOCLASS ProcessInformationClass,
-  _Out_ PVOID ProcessInformation,
-  _In_ ULONG ProcessInformationLength,
-  _Out_opt_ PULONG ReturnLength);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsSetCreateProcessNotifyRoutine(
-  _In_ PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine,
-  _In_ BOOLEAN Remove);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsSetCreateThreadNotifyRoutine(
-  _In_ PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsSetLoadImageNotifyRoutine(
-  _In_ PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine);
-
-NTKERNELAPI
-HANDLE
-NTAPI
-PsGetCurrentProcessId(VOID);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-HANDLE
-NTAPI
-PsGetCurrentThreadId(VOID);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-PsGetVersion(
-  OUT PULONG MajorVersion OPTIONAL,
-  OUT PULONG MinorVersion OPTIONAL,
-  OUT PULONG BuildNumber OPTIONAL,
-  OUT PUNICODE_STRING CSDVersion OPTIONAL);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-HANDLE
-NTAPI
-PsGetProcessId(
-  _In_ PEPROCESS Process);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-HANDLE
-NTAPI
-PsGetThreadId(
-  _In_ PETHREAD Thread);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsRemoveCreateThreadNotifyRoutine(
-  _In_ PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsRemoveLoadImageNotifyRoutine(
-  _In_ PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONGLONG
-NTAPI
-PsGetProcessCreateTimeQuadPart(
-  _In_ PEPROCESS Process);
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WS03)
-NTKERNELAPI
-HANDLE
-NTAPI
-PsGetThreadProcessId(
-  IN PETHREAD Thread);
-#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-PsSetCurrentThreadPrefetching(
-  IN BOOLEAN Prefetching);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-PsIsCurrentThreadPrefetching(VOID);
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTASP1)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsSetCreateProcessNotifyRoutineEx(
-  IN PCREATE_PROCESS_NOTIFY_ROUTINE_EX NotifyRoutine,
-  IN BOOLEAN Remove);
-#endif /* (NTDDI_VERSION >= NTDDI_VISTASP1) */
-/******************************************************************************
- *                         Runtime Library Functions                          *
- ******************************************************************************/
-
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-#ifndef RTL_USE_AVL_TABLES
-
-NTSYSAPI
-VOID
-NTAPI
-RtlInitializeGenericTable(
-  _Out_ PRTL_GENERIC_TABLE Table,
-  _In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine,
-  _In_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine,
-  _In_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine,
-  _In_opt_ PVOID TableContext);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlInsertElementGenericTable(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_reads_bytes_(BufferSize) PVOID Buffer,
-  _In_ CLONG BufferSize,
-  _Out_opt_ PBOOLEAN NewElement);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlInsertElementGenericTableFull(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_reads_bytes_(BufferSize) PVOID Buffer,
-  _In_ CLONG BufferSize,
-  _Out_opt_ PBOOLEAN NewElement,
-  _In_ PVOID NodeOrParent,
-  _In_ TABLE_SEARCH_RESULT SearchResult);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlDeleteElementGenericTable(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_ PVOID Buffer);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlLookupElementGenericTable(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_ PVOID Buffer);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlLookupElementGenericTableFull(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_ PVOID Buffer,
-  _Out_ PVOID *NodeOrParent,
-  _Out_ TABLE_SEARCH_RESULT *SearchResult);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlEnumerateGenericTable(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_ BOOLEAN Restart);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlEnumerateGenericTableWithoutSplaying(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _Inout_ PVOID *RestartKey);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlGetElementGenericTable(
-  _In_ PRTL_GENERIC_TABLE Table,
-  _In_ ULONG I);
-
-NTSYSAPI
-ULONG
-NTAPI
-RtlNumberGenericTableElements(
-  _In_ PRTL_GENERIC_TABLE Table);
-
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlIsGenericTableEmpty(
-  _In_ PRTL_GENERIC_TABLE Table);
-
-#endif /* !RTL_USE_AVL_TABLES */
-
-#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT     8
-
-NTSYSAPI
-PRTL_SPLAY_LINKS
-NTAPI
-RtlSplay(
-  _Inout_ PRTL_SPLAY_LINKS Links);
-
-NTSYSAPI
-PRTL_SPLAY_LINKS
-NTAPI
-RtlDelete(
-  _In_ PRTL_SPLAY_LINKS Links);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlDeleteNoSplay(
-  _In_ PRTL_SPLAY_LINKS Links,
-  _Inout_ PRTL_SPLAY_LINKS *Root);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_SPLAY_LINKS
-NTAPI
-RtlSubtreeSuccessor(
-  _In_ PRTL_SPLAY_LINKS Links);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_SPLAY_LINKS
-NTAPI
-RtlSubtreePredecessor(
-  _In_ PRTL_SPLAY_LINKS Links);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_SPLAY_LINKS
-NTAPI
-RtlRealSuccessor(
-  _In_ PRTL_SPLAY_LINKS Links);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_SPLAY_LINKS
-NTAPI
-RtlRealPredecessor(
-  _In_ PRTL_SPLAY_LINKS Links);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlPrefixUnicodeString(
-  _In_ PCUNICODE_STRING String1,
-  _In_ PCUNICODE_STRING String2,
-  _In_ BOOLEAN CaseInSensitive);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlUpperString(
-  _Inout_ PSTRING DestinationString,
-  _In_ const STRING *SourceString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_When_(AllocateDestinationString, _Must_inspect_result_)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUpcaseUnicodeString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    PUNICODE_STRING DestinationString,
-  _In_ PCUNICODE_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlMapGenericMask(
-  _Inout_ PACCESS_MASK AccessMask,
-  _In_ PGENERIC_MAPPING GenericMapping);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlVolumeDeviceToDosName(
-  _In_ PVOID VolumeDeviceObject,
-  _Out_ PUNICODE_STRING DosName);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-LONG
-NTAPI
-RtlCompareString(
-  _In_ const STRING *String1,
-  _In_ const STRING *String2,
-  _In_ BOOLEAN CaseInSensitive);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlCopyString(
-  _Out_ PSTRING DestinationString,
-  _In_opt_ const STRING *SourceString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlEqualString(
-  _In_ const STRING *String1,
-  _In_ const STRING *String2,
-  _In_ BOOLEAN CaseInSensitive);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCharToInteger(
-  _In_z_ PCSZ String,
-  _In_opt_ ULONG Base,
-  _Out_ PULONG Value);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-CHAR
-NTAPI
-RtlUpperChar(
-  _In_ CHAR Character);
-
-NTSYSAPI
-ULONG
-NTAPI
-RtlWalkFrameChain(
-  _Out_writes_(Count - (Flags >> RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT))
-    PVOID *Callers,
-  _In_ ULONG Count,
-  _In_ ULONG Flags);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-
-
-NTSYSAPI
-VOID
-NTAPI
-RtlInitializeGenericTableAvl(
-  _Out_ PRTL_AVL_TABLE Table,
-  _In_ PRTL_AVL_COMPARE_ROUTINE CompareRoutine,
-  _In_opt_ PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine,
-  _In_opt_ PRTL_AVL_FREE_ROUTINE FreeRoutine,
-  _In_opt_ PVOID TableContext);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlInsertElementGenericTableAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_reads_bytes_(BufferSize) PVOID Buffer,
-  _In_ CLONG BufferSize,
-  _Out_opt_ PBOOLEAN NewElement);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlInsertElementGenericTableFullAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_reads_bytes_(BufferSize) PVOID Buffer,
-  _In_ CLONG BufferSize,
-  _Out_opt_ PBOOLEAN NewElement,
-  _In_ PVOID NodeOrParent,
-  _In_ TABLE_SEARCH_RESULT SearchResult);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlDeleteElementGenericTableAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_ PVOID Buffer);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlLookupElementGenericTableAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_ PVOID Buffer);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlLookupElementGenericTableFullAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_ PVOID Buffer,
-  _Out_ PVOID *NodeOrParent,
-  _Out_ TABLE_SEARCH_RESULT *SearchResult);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlEnumerateGenericTableAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_ BOOLEAN Restart);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlEnumerateGenericTableWithoutSplayingAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _Inout_ PVOID *RestartKey);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlLookupFirstMatchingElementGenericTableAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_ PVOID Buffer,
-  _Out_ PVOID *RestartKey);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlEnumerateGenericTableLikeADirectory(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_opt_ PRTL_AVL_MATCH_FUNCTION MatchFunction,
-  _In_opt_ PVOID MatchData,
-  _In_ ULONG NextFlag,
-  _Inout_ PVOID *RestartKey,
-  _Inout_ PULONG DeleteCount,
-  _In_ PVOID Buffer);
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlGetElementGenericTableAvl(
-  _In_ PRTL_AVL_TABLE Table,
-  _In_ ULONG I);
-
-NTSYSAPI
-ULONG
-NTAPI
-RtlNumberGenericTableElementsAvl(
-  _In_ PRTL_AVL_TABLE Table);
-
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlIsGenericTableEmptyAvl(
-  _In_ PRTL_AVL_TABLE Table);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlRunOnceInitialize(
-  _Out_ PRTL_RUN_ONCE RunOnce);
-
-_IRQL_requires_max_(APC_LEVEL)
-_Maybe_raises_SEH_exception_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlRunOnceExecuteOnce(
-  _Inout_ PRTL_RUN_ONCE RunOnce,
-  _In_ __inner_callback PRTL_RUN_ONCE_INIT_FN InitFn,
-  _Inout_opt_ PVOID Parameter,
-  _Outptr_opt_result_maybenull_ PVOID *Context);
-
-_IRQL_requires_max_(APC_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlRunOnceBeginInitialize(
-  _Inout_ PRTL_RUN_ONCE RunOnce,
-  _In_ ULONG Flags,
-  _Outptr_opt_result_maybenull_ PVOID *Context);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlRunOnceComplete(
-  _Inout_ PRTL_RUN_ONCE RunOnce,
-  _In_ ULONG Flags,
-  _In_opt_ PVOID Context);
-
-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 (NTDDI_VERSION >= NTDDI_WIN7)
-
-
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlCreateHashTable(
-  _Inout_ _When_(NULL == *HashTable, __drv_allocatesMem(Mem))
-    PRTL_DYNAMIC_HASH_TABLE *HashTable,
-  _In_ ULONG Shift,
-  _In_ _Reserved_ ULONG Flags);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlDeleteHashTable(
-  _In_ _When_((HashTable->Flags & RTL_HASH_ALLOCATED_HEADER), __drv_freesMem(Mem) _Post_invalid_)
-    PRTL_DYNAMIC_HASH_TABLE HashTable);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlInsertEntryHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _In_ __drv_aliasesMem PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry,
-  _In_ ULONG_PTR Signature,
-  _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlRemoveEntryHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _In_ PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry,
-  _Inout_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_DYNAMIC_HASH_TABLE_ENTRY
-NTAPI
-RtlLookupEntryHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _In_ ULONG_PTR Signature,
-  _Out_opt_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_DYNAMIC_HASH_TABLE_ENTRY
-NTAPI
-RtlGetNextEntryHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _In_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlInitEnumerationHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_DYNAMIC_HASH_TABLE_ENTRY
-NTAPI
-RtlEnumerateEntryHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlEndEnumerationHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlInitWeakEnumerationHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _Out_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator);
-
-_Must_inspect_result_
-NTSYSAPI
-PRTL_DYNAMIC_HASH_TABLE_ENTRY
-NTAPI
-RtlWeaklyEnumerateEntryHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlEndWeakEnumerationHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable,
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlExpandHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable);
-
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlContractHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-
-#if defined(_AMD64_) || defined(_IA64_)
-
-
-
-//DECLSPEC_DEPRECATED_DDK_WINXP
-FORCEINLINE
-LARGE_INTEGER
-NTAPI_INLINE
-RtlLargeIntegerDivide(
-  _In_ LARGE_INTEGER Dividend,
-  _In_ LARGE_INTEGER Divisor,
-  _Out_opt_ PLARGE_INTEGER Remainder)
-{
-  LARGE_INTEGER ret;
-  ret.QuadPart = Dividend.QuadPart / Divisor.QuadPart;
-  if (Remainder)
-    Remainder->QuadPart = Dividend.QuadPart % Divisor.QuadPart;
-  return ret;
-}
-
-#else
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-NTSYSAPI
-LARGE_INTEGER
-NTAPI
-RtlLargeIntegerDivide(
-  _In_ LARGE_INTEGER Dividend,
-  _In_ LARGE_INTEGER Divisor,
-  _Out_opt_ PLARGE_INTEGER Remainder);
-#endif
-
-
-#endif /* defined(_AMD64_) || defined(_IA64_) */
-
-
-
-#ifdef RTL_USE_AVL_TABLES
-
-#define RtlInitializeGenericTable               RtlInitializeGenericTableAvl
-#define RtlInsertElementGenericTable            RtlInsertElementGenericTableAvl
-#define RtlInsertElementGenericTableFull        RtlInsertElementGenericTableFullAvl
-#define RtlDeleteElementGenericTable            RtlDeleteElementGenericTableAvl
-#define RtlLookupElementGenericTable            RtlLookupElementGenericTableAvl
-#define RtlLookupElementGenericTableFull        RtlLookupElementGenericTableFullAvl
-#define RtlEnumerateGenericTable                RtlEnumerateGenericTableAvl
-#define RtlEnumerateGenericTableWithoutSplaying RtlEnumerateGenericTableWithoutSplayingAvl
-#define RtlGetElementGenericTable               RtlGetElementGenericTableAvl
-#define RtlNumberGenericTableElements           RtlNumberGenericTableElementsAvl
-#define RtlIsGenericTableEmpty                  RtlIsGenericTableEmptyAvl
-
-#endif /* RTL_USE_AVL_TABLES */
-
-#define RtlInitializeSplayLinks(Links) {    \
-  PRTL_SPLAY_LINKS _SplayLinks;            \
-  _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
-  _SplayLinks->Parent = _SplayLinks;   \
-  _SplayLinks->LeftChild = NULL;       \
-  _SplayLinks->RightChild = NULL;      \
-}
-
-#define RtlIsLeftChild(Links) \
-    (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
-
-#define RtlIsRightChild(Links) \
-    (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
-
-#define RtlRightChild(Links) \
-    ((PRTL_SPLAY_LINKS)(Links))->RightChild
-
-#define RtlIsRoot(Links) \
-    (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
-
-#define RtlLeftChild(Links) \
-    ((PRTL_SPLAY_LINKS)(Links))->LeftChild
-
-#define RtlParent(Links) \
-    ((PRTL_SPLAY_LINKS)(Links))->Parent
-
-#define RtlInsertAsLeftChild(ParentLinks,ChildLinks)    \
-    {                                                   \
-        PRTL_SPLAY_LINKS _SplayParent;                  \
-        PRTL_SPLAY_LINKS _SplayChild;                   \
-        _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
-        _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks);   \
-        _SplayParent->LeftChild = _SplayChild;          \
-        _SplayChild->Parent = _SplayParent;             \
-    }
-
-#define RtlInsertAsRightChild(ParentLinks,ChildLinks)   \
-    {                                                   \
-        PRTL_SPLAY_LINKS _SplayParent;                  \
-        PRTL_SPLAY_LINKS _SplayChild;                   \
-        _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
-        _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks);   \
-        _SplayParent->RightChild = _SplayChild;         \
-        _SplayChild->Parent = _SplayParent;             \
-    }
-
-#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(); \
-    *CallersCaller = NULL;
-#else
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-NTSYSAPI
-VOID
-NTAPI
-RtlGetCallersAddress(
-  _Out_ PVOID *CallersAddress,
-  _Out_ PVOID *CallersCaller);
-#endif
-#endif
-
-#if !defined(MIDL_PASS) && !defined(SORTPP_PASS)
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-FORCEINLINE
-VOID
-NTAPI
-RtlInitHashTableContext(
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
-{
-  Context->ChainHead = NULL;
-  Context->PrevLinkage = NULL;
-}
-
-FORCEINLINE
-VOID
-NTAPI
-RtlInitHashTableContextFromEnumerator(
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context,
-  _In_ PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator)
-{
-  Context->ChainHead = Enumerator->ChainHead;
-  Context->PrevLinkage = Enumerator->HashEntry.Linkage.Blink;
-}
-
-FORCEINLINE
-VOID
-NTAPI
-RtlReleaseHashTableContext(
-  _Inout_ PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context)
-{
-  UNREFERENCED_PARAMETER(Context);
-  return;
-}
-
-FORCEINLINE
-ULONG
-NTAPI
-RtlTotalBucketsHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
-{
-  return HashTable->TableSize;
-}
-
-FORCEINLINE
-ULONG
-NTAPI
-RtlNonEmptyBucketsHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
-{
-  return HashTable->NonEmptyBuckets;
-}
-
-FORCEINLINE
-ULONG
-NTAPI
-RtlEmptyBucketsHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
-{
-  return HashTable->TableSize - HashTable->NonEmptyBuckets;
-}
-
-FORCEINLINE
-ULONG
-NTAPI
-RtlTotalEntriesHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
-{
-  return HashTable->NumEntries;
-}
-
-FORCEINLINE
-ULONG
-NTAPI
-RtlActiveEnumeratorsHashTable(
-  _In_ PRTL_DYNAMIC_HASH_TABLE HashTable)
-{
-  return HashTable->NumEnumerators;
-}
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-#endif /* !defined(MIDL_PASS) && !defined(SORTPP_PASS) */
-
-/******************************************************************************
- *                            Security Manager Functions                      *
- ******************************************************************************/
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeSinglePrivilegeCheck(
-  _In_ LUID PrivilegeValue,
-  _In_ KPROCESSOR_MODE PreviousMode);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-/******************************************************************************
- *                            ZwXxx Functions                                 *
- ******************************************************************************/
-
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwAllocateLocallyUniqueId(
-  _Out_ PLUID Luid);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwTerminateProcess(
-  _In_opt_ HANDLE ProcessHandle,
-  _In_ NTSTATUS ExitStatus);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwOpenProcess(
-  _Out_ PHANDLE ProcessHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_opt_ PCLIENT_ID ClientId);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-ZwCancelTimer(
-  _In_ HANDLE TimerHandle,
-  _Out_opt_ PBOOLEAN CurrentState);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_When_(return == 0, __drv_allocatesMem(TimerObject))
-NTSTATUS
-NTAPI
-ZwCreateTimer(
-  _Out_ PHANDLE TimerHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_ TIMER_TYPE TimerType);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-ZwOpenTimer(
-  _Out_ PHANDLE TimerHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwSetInformationThread(
-  _In_ HANDLE ThreadHandle,
-  _In_ THREADINFOCLASS ThreadInformationClass,
-  _In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation,
-  _In_ ULONG ThreadInformationLength);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-ZwSetTimer(
-  _In_ HANDLE TimerHandle,
-  _In_ PLARGE_INTEGER DueTime,
-  _In_opt_ PTIMER_APC_ROUTINE TimerApcRoutine,
-  _In_opt_ PVOID TimerContext,
-  _In_ BOOLEAN ResumeTimer,
-  _In_opt_ LONG Period,
-  _Out_opt_ PBOOLEAN PreviousState);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwDisplayString(
-  _In_ PUNICODE_STRING String);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwPowerInformation(
-  _In_ POWER_INFORMATION_LEVEL PowerInformationLevel,
-  _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
-  _In_ ULONG InputBufferLength,
-  _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
-  _In_ ULONG OutputBufferLength);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwQueryVolumeInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _Out_writes_bytes_(Length) PVOID FsInformation,
-  _In_ ULONG Length,
-  _In_ FS_INFORMATION_CLASS FsInformationClass);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-ZwDeviceIoControlFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_ ULONG IoControlCode,
-  _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
-  _In_ ULONG InputBufferLength,
-  _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
-  _In_ ULONG OutputBufferLength);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-ZwSetTimerEx(
-  _In_ HANDLE TimerHandle,
-  _In_ TIMER_SET_INFORMATION_CLASS TimerSetInformationClass,
-  _Inout_updates_bytes_opt_(TimerSetInformationLength) PVOID TimerSetInformation,
-  _In_ ULONG TimerSetInformationLength);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-
-
-/* UNSORTED */
-
-#define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType) \
-  ((ConditionMask) = VerSetConditionMask((ConditionMask),             \
-  (TypeBitMask), (ComparisonType)))
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-NTSYSAPI
-ULONGLONG
-NTAPI
-VerSetConditionMask(
-  IN ULONGLONG ConditionMask,
-  IN ULONG TypeMask,
-  IN UCHAR Condition);
-#endif
-
-typedef struct _KERNEL_USER_TIMES {
-  LARGE_INTEGER CreateTime;
-  LARGE_INTEGER ExitTime;
-  LARGE_INTEGER KernelTime;
-  LARGE_INTEGER UserTime;
-} KERNEL_USER_TIMES, *PKERNEL_USER_TIMES;
-
-/* NtXxx Functions */
-
-typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION {
-  SystemFirmwareTable_Enumerate,
-  SystemFirmwareTable_Get
-} SYSTEM_FIRMWARE_TABLE_ACTION;
-
-typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION {
-  ULONG ProviderSignature;
-  SYSTEM_FIRMWARE_TABLE_ACTION Action;
-  ULONG TableID;
-  ULONG TableBufferLength;
-  UCHAR TableBuffer[ANYSIZE_ARRAY];
-} SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
-
-typedef NTSTATUS
-(__cdecl *PFNFTH)(
-  _Inout_ PSYSTEM_FIRMWARE_TABLE_INFORMATION SystemFirmwareTableInfo);
-
-typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER {
-  ULONG ProviderSignature;
-  BOOLEAN Register;
-  PFNFTH FirmwareTableHandler;
-  PVOID DriverObject;
-} SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER;
-
-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
-
-#define SHARED_GLOBAL_FLAGS_ERROR_PORT_V        0x0
-#define SHARED_GLOBAL_FLAGS_ERROR_PORT          (1UL << SHARED_GLOBAL_FLAGS_ERROR_PORT_V)
-
-#define SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED_V 0x1
-#define SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED   (1UL << SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED_V)
-
-#define SHARED_GLOBAL_FLAGS_VIRT_ENABLED_V      0x2
-#define SHARED_GLOBAL_FLAGS_VIRT_ENABLED        (1UL << SHARED_GLOBAL_FLAGS_VIRT_ENABLED_V)
-
-#define SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED_V  0x3
-#define SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED    \
-  (1UL << SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED_V)
-
-#define SHARED_GLOBAL_FLAGS_SPARE_V                     0x4
-#define SHARED_GLOBAL_FLAGS_SPARE                       \
-  (1UL << SHARED_GLOBAL_FLAGS_SPARE_V)
-
-#define SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED_V      0x5
-#define SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED        \
-  (1UL << SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED_V)
-
-#define SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED_V    0x6
-#define SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED        \
-  (1UL << SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED_V)
-
-#define EX_INIT_BITS(Flags, Bit) \
-  *((Flags)) |= (Bit)             // Safe to use before concurrently accessible
-
-#define EX_TEST_SET_BIT(Flags, Bit) \
-  InterlockedBitTestAndSet ((PLONG)(Flags), (Bit))
-
-#define EX_TEST_CLEAR_BIT(Flags, Bit) \
-  InterlockedBitTestAndReset ((PLONG)(Flags), (Bit))
-
-#define PCCARD_MAP_ERROR               0x01
-#define PCCARD_DEVICE_PCI              0x10
-
-#define PCCARD_SCAN_DISABLED           0x01
-#define PCCARD_MAP_ZERO                0x02
-#define PCCARD_NO_TIMER                0x03
-#define PCCARD_NO_PIC                  0x04
-#define PCCARD_NO_LEGACY_BASE          0x05
-#define PCCARD_DUP_LEGACY_BASE         0x06
-#define PCCARD_NO_CONTROLLERS          0x07
-
-#define MAXIMUM_EXPANSION_SIZE (KERNEL_LARGE_STACK_SIZE - (PAGE_SIZE / 2))
-
-/* Filesystem runtime library routines */
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-_Must_inspect_result_
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsTotalDeviceFailure(
-  _In_ NTSTATUS Status);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h
deleted file mode 100644 (file)
index d6ed41c..0000000
+++ /dev/null
@@ -1,11653 +0,0 @@
-/*
- * ntifs.h
- *
- * Windows NT Filesystem Driver Developer Kit
- *
- * This file is part of the ReactOS DDK package.
- *
- * Contributors:
- *   Amine Khaldi
- *   Timo Kreuzer (timo.kreuzer@reactos.org)
- *
- * THIS SOFTWARE IS NOT COPYRIGHTED
- *
- * This source code is offered for use in the public domain. You may
- * use, modify or distribute it freely.
- *
- * This code is distributed in the hope that it will be useful but
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAIMED. This includes but is not limited to warranties of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- */
-
-#pragma once
-
-#define _NTIFS_INCLUDED_
-#define _GNU_NTIFS_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Dependencies */
-#include <ntddk.h>
-#include <excpt.h>
-#include <ntdef.h>
-#include <ntnls.h>
-#include <ntstatus.h>
-#include <bugcodes.h>
-#include <ntiologc.h>
-
-
-#ifndef FlagOn
-#define FlagOn(_F,_SF)        ((_F) & (_SF))
-#endif
-
-#ifndef BooleanFlagOn
-#define BooleanFlagOn(F,SF)   ((BOOLEAN)(((F) & (SF)) != 0))
-#endif
-
-#ifndef SetFlag
-#define SetFlag(_F,_SF)       ((_F) |= (_SF))
-#endif
-
-#ifndef ClearFlag
-#define ClearFlag(_F,_SF)     ((_F) &= ~(_SF))
-#endif
-
-typedef UNICODE_STRING LSA_UNICODE_STRING, *PLSA_UNICODE_STRING;
-typedef STRING LSA_STRING, *PLSA_STRING;
-typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES;
-
-/******************************************************************************
- *                            Security Manager Types                          *
- ******************************************************************************/
-
-#ifndef SID_IDENTIFIER_AUTHORITY_DEFINED
-#define SID_IDENTIFIER_AUTHORITY_DEFINED
-typedef struct _SID_IDENTIFIER_AUTHORITY {
-  UCHAR Value[6];
-} SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
-#endif
-
-#ifndef SID_DEFINED
-#define SID_DEFINED
-typedef struct _SID {
-  UCHAR Revision;
-  UCHAR SubAuthorityCount;
-  SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
-#ifdef MIDL_PASS
-  [size_is(SubAuthorityCount)] ULONG SubAuthority[*];
-#else
-  ULONG SubAuthority[ANYSIZE_ARRAY];
-#endif
-} SID, *PISID;
-#endif
-
-#define SID_REVISION                    1
-#define SID_MAX_SUB_AUTHORITIES         15
-#define SID_RECOMMENDED_SUB_AUTHORITIES 1
-
-#ifndef MIDL_PASS
-#define SECURITY_MAX_SID_SIZE (sizeof(SID) - sizeof(ULONG) + (SID_MAX_SUB_AUTHORITIES * sizeof(ULONG)))
-#endif
-
-typedef enum _SID_NAME_USE {
-  SidTypeUser = 1,
-  SidTypeGroup,
-  SidTypeDomain,
-  SidTypeAlias,
-  SidTypeWellKnownGroup,
-  SidTypeDeletedAccount,
-  SidTypeInvalid,
-  SidTypeUnknown,
-  SidTypeComputer,
-  SidTypeLabel
-} SID_NAME_USE, *PSID_NAME_USE;
-
-typedef struct _SID_AND_ATTRIBUTES {
-#ifdef MIDL_PASS
-  PISID Sid;
-#else
-  PSID Sid;
-#endif
-  ULONG Attributes;
-} SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
-typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
-typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
-
-#define SID_HASH_SIZE 32
-typedef ULONG_PTR SID_HASH_ENTRY, *PSID_HASH_ENTRY;
-
-typedef struct _SID_AND_ATTRIBUTES_HASH {
-  ULONG SidCount;
-  PSID_AND_ATTRIBUTES SidAttr;
-  SID_HASH_ENTRY Hash[SID_HASH_SIZE];
-} SID_AND_ATTRIBUTES_HASH, *PSID_AND_ATTRIBUTES_HASH;
-
-/* Universal well-known SIDs */
-
-#define SECURITY_NULL_SID_AUTHORITY         {0,0,0,0,0,0}
-
-/* S-1-1 */
-#define SECURITY_WORLD_SID_AUTHORITY        {0,0,0,0,0,1}
-
-/* S-1-2 */
-#define SECURITY_LOCAL_SID_AUTHORITY        {0,0,0,0,0,2}
-
-/* S-1-3 */
-#define SECURITY_CREATOR_SID_AUTHORITY      {0,0,0,0,0,3}
-
-/* S-1-4 */
-#define SECURITY_NON_UNIQUE_AUTHORITY       {0,0,0,0,0,4}
-
-#define SECURITY_RESOURCE_MANAGER_AUTHORITY {0,0,0,0,0,9}
-
-#define SECURITY_NULL_RID                   (0x00000000L)
-#define SECURITY_WORLD_RID                  (0x00000000L)
-#define SECURITY_LOCAL_RID                  (0x00000000L)
-#define SECURITY_LOCAL_LOGON_RID            (0x00000001L)
-
-#define SECURITY_CREATOR_OWNER_RID          (0x00000000L)
-#define SECURITY_CREATOR_GROUP_RID          (0x00000001L)
-#define SECURITY_CREATOR_OWNER_SERVER_RID   (0x00000002L)
-#define SECURITY_CREATOR_GROUP_SERVER_RID   (0x00000003L)
-#define SECURITY_CREATOR_OWNER_RIGHTS_RID   (0x00000004L)
-
-/* NT well-known SIDs */
-
-/* S-1-5 */
-#define SECURITY_NT_AUTHORITY               {0,0,0,0,0,5}
-
-#define SECURITY_DIALUP_RID                          (0x00000001L)
-#define SECURITY_NETWORK_RID                         (0x00000002L)
-#define SECURITY_BATCH_RID                           (0x00000003L)
-#define SECURITY_INTERACTIVE_RID                     (0x00000004L)
-#define SECURITY_LOGON_IDS_RID                       (0x00000005L)
-#define SECURITY_LOGON_IDS_RID_COUNT                 (3L)
-#define SECURITY_SERVICE_RID                         (0x00000006L)
-#define SECURITY_ANONYMOUS_LOGON_RID                 (0x00000007L)
-#define SECURITY_PROXY_RID                           (0x00000008L)
-#define SECURITY_ENTERPRISE_CONTROLLERS_RID          (0x00000009L)
-#define SECURITY_SERVER_LOGON_RID                    SECURITY_ENTERPRISE_CONTROLLERS_RID
-#define SECURITY_PRINCIPAL_SELF_RID                  (0x0000000AL)
-#define SECURITY_AUTHENTICATED_USER_RID              (0x0000000BL)
-#define SECURITY_RESTRICTED_CODE_RID                 (0x0000000CL)
-#define SECURITY_TERMINAL_SERVER_RID                 (0x0000000DL)
-#define SECURITY_REMOTE_LOGON_RID                    (0x0000000EL)
-#define SECURITY_THIS_ORGANIZATION_RID               (0x0000000FL)
-#define SECURITY_IUSER_RID                           (0x00000011L)
-#define SECURITY_LOCAL_SYSTEM_RID                    (0x00000012L)
-#define SECURITY_LOCAL_SERVICE_RID                   (0x00000013L)
-#define SECURITY_NETWORK_SERVICE_RID                 (0x00000014L)
-#define SECURITY_NT_NON_UNIQUE                       (0x00000015L)
-#define SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT        (3L)
-#define SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID (0x00000016L)
-
-#define SECURITY_BUILTIN_DOMAIN_RID        (0x00000020L)
-#define SECURITY_WRITE_RESTRICTED_CODE_RID (0x00000021L)
-
-
-#define SECURITY_PACKAGE_BASE_RID     (0x00000040L)
-#define SECURITY_PACKAGE_RID_COUNT    (2L)
-#define SECURITY_PACKAGE_NTLM_RID     (0x0000000AL)
-#define SECURITY_PACKAGE_SCHANNEL_RID (0x0000000EL)
-#define SECURITY_PACKAGE_DIGEST_RID   (0x00000015L)
-
-#define SECURITY_CRED_TYPE_BASE_RID          (0x00000041L)
-#define SECURITY_CRED_TYPE_RID_COUNT         (2L)
-#define SECURITY_CRED_TYPE_THIS_ORG_CERT_RID (0x00000001L)
-
-#define SECURITY_MIN_BASE_RID                               (0x00000050L)
-#define SECURITY_SERVICE_ID_BASE_RID                        (0x00000050L)
-#define SECURITY_SERVICE_ID_RID_COUNT                       (6L)
-#define SECURITY_RESERVED_ID_BASE_RID                       (0x00000051L)
-#define SECURITY_APPPOOL_ID_BASE_RID                        (0x00000052L)
-#define SECURITY_APPPOOL_ID_RID_COUNT                       (6L)
-#define SECURITY_VIRTUALSERVER_ID_BASE_RID                  (0x00000053L)
-#define SECURITY_VIRTUALSERVER_ID_RID_COUNT                 (6L)
-#define SECURITY_USERMODEDRIVERHOST_ID_BASE_RID             (0x00000054L)
-#define SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT            (6L)
-#define SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID  (0x00000055L)
-#define SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT (6L)
-#define SECURITY_WMIHOST_ID_BASE_RID                        (0x00000056L)
-#define SECURITY_WMIHOST_ID_RID_COUNT                       (6L)
-#define SECURITY_TASK_ID_BASE_RID                           (0x00000057L)
-#define SECURITY_NFS_ID_BASE_RID                            (0x00000058L)
-#define SECURITY_COM_ID_BASE_RID                            (0x00000059L)
-#define SECURITY_VIRTUALACCOUNT_ID_RID_COUNT                (6L)
-
-#define SECURITY_MAX_BASE_RID (0x0000006FL)
-
-#define SECURITY_MAX_ALWAYS_FILTERED (0x000003E7L)
-#define SECURITY_MIN_NEVER_FILTERED  (0x000003E8L)
-
-#define SECURITY_OTHER_ORGANIZATION_RID (0x000003E8L)
-
-#define SECURITY_WINDOWSMOBILE_ID_BASE_RID (0x00000070L)
-
-/* Well-known domain relative sub-authority values (RIDs) */
-
-#define DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS (0x000001F2L)
-
-#define FOREST_USER_RID_MAX (0x000001F3L)
-
-/* Well-known users */
-
-#define DOMAIN_USER_RID_ADMIN  (0x000001F4L)
-#define DOMAIN_USER_RID_GUEST  (0x000001F5L)
-#define DOMAIN_USER_RID_KRBTGT (0x000001F6L)
-
-#define DOMAIN_USER_RID_MAX (0x000003E7L)
-
-/* Well-known groups */
-
-#define DOMAIN_GROUP_RID_ADMINS               (0x00000200L)
-#define DOMAIN_GROUP_RID_USERS                (0x00000201L)
-#define DOMAIN_GROUP_RID_GUESTS               (0x00000202L)
-#define DOMAIN_GROUP_RID_COMPUTERS            (0x00000203L)
-#define DOMAIN_GROUP_RID_CONTROLLERS          (0x00000204L)
-#define DOMAIN_GROUP_RID_CERT_ADMINS          (0x00000205L)
-#define DOMAIN_GROUP_RID_SCHEMA_ADMINS        (0x00000206L)
-#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS    (0x00000207L)
-#define DOMAIN_GROUP_RID_POLICY_ADMINS        (0x00000208L)
-#define DOMAIN_GROUP_RID_READONLY_CONTROLLERS (0x00000209L)
-
-/* Well-known aliases */
-
-#define DOMAIN_ALIAS_RID_ADMINS      (0x00000220L)
-#define DOMAIN_ALIAS_RID_USERS       (0x00000221L)
-#define DOMAIN_ALIAS_RID_GUESTS      (0x00000222L)
-#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L)
-
-#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L)
-#define DOMAIN_ALIAS_RID_SYSTEM_OPS  (0x00000225L)
-#define DOMAIN_ALIAS_RID_PRINT_OPS   (0x00000226L)
-#define DOMAIN_ALIAS_RID_BACKUP_OPS  (0x00000227L)
-
-#define DOMAIN_ALIAS_RID_REPLICATOR                     (0x00000228L)
-#define DOMAIN_ALIAS_RID_RAS_SERVERS                    (0x00000229L)
-#define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS               (0x0000022AL)
-#define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS           (0x0000022BL)
-#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS      (0x0000022CL)
-#define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS (0x0000022DL)
-
-#define DOMAIN_ALIAS_RID_MONITORING_USERS    (0x0000022EL)
-#define DOMAIN_ALIAS_RID_LOGGING_USERS       (0x0000022FL)
-#define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS (0x00000230L)
-#define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS  (0x00000231L)
-#define DOMAIN_ALIAS_RID_DCOM_USERS          (0x00000232L)
-
-#define DOMAIN_ALIAS_RID_IUSERS                         (0x00000238L)
-#define DOMAIN_ALIAS_RID_CRYPTO_OPERATORS               (0x00000239L)
-#define DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP     (0x0000023BL)
-#define DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP (0x0000023CL)
-#define DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP        (0x0000023DL)
-#define DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP      (0x0000023EL)
-
-#define SECURITY_MANDATORY_LABEL_AUTHORITY       {0,0,0,0,0,16}
-#define SECURITY_MANDATORY_UNTRUSTED_RID         (0x00000000L)
-#define SECURITY_MANDATORY_LOW_RID               (0x00001000L)
-#define SECURITY_MANDATORY_MEDIUM_RID            (0x00002000L)
-#define SECURITY_MANDATORY_HIGH_RID              (0x00003000L)
-#define SECURITY_MANDATORY_SYSTEM_RID            (0x00004000L)
-#define SECURITY_MANDATORY_PROTECTED_PROCESS_RID (0x00005000L)
-
-/* SECURITY_MANDATORY_MAXIMUM_USER_RID is the highest RID that
-   can be set by a usermode caller.*/
-
-#define SECURITY_MANDATORY_MAXIMUM_USER_RID SECURITY_MANDATORY_SYSTEM_RID
-
-#define MANDATORY_LEVEL_TO_MANDATORY_RID(IL) (IL * 0x1000)
-
-/* Allocate the System Luid.  The first 1000 LUIDs are reserved.
-   Use #999 here (0x3e7 = 999) */
-
-#define SYSTEM_LUID          {0x3e7, 0x0}
-#define ANONYMOUS_LOGON_LUID {0x3e6, 0x0}
-#define LOCALSERVICE_LUID    {0x3e5, 0x0}
-#define NETWORKSERVICE_LUID  {0x3e4, 0x0}
-#define IUSER_LUID           {0x3e3, 0x0}
-
-typedef struct _ACE_HEADER {
-  UCHAR AceType;
-  UCHAR AceFlags;
-  USHORT AceSize;
-} ACE_HEADER, *PACE_HEADER;
-
-#define ACCESS_MIN_MS_ACE_TYPE                  (0x0)
-#define ACCESS_ALLOWED_ACE_TYPE                 (0x0)
-#define ACCESS_DENIED_ACE_TYPE                  (0x1)
-#define SYSTEM_AUDIT_ACE_TYPE                   (0x2)
-#define SYSTEM_ALARM_ACE_TYPE                   (0x3)
-#define ACCESS_MAX_MS_V2_ACE_TYPE               (0x3)
-#define ACCESS_ALLOWED_COMPOUND_ACE_TYPE        (0x4)
-#define ACCESS_MAX_MS_V3_ACE_TYPE               (0x4)
-#define ACCESS_MIN_MS_OBJECT_ACE_TYPE           (0x5)
-#define ACCESS_ALLOWED_OBJECT_ACE_TYPE          (0x5)
-#define ACCESS_DENIED_OBJECT_ACE_TYPE           (0x6)
-#define SYSTEM_AUDIT_OBJECT_ACE_TYPE            (0x7)
-#define SYSTEM_ALARM_OBJECT_ACE_TYPE            (0x8)
-#define ACCESS_MAX_MS_OBJECT_ACE_TYPE           (0x8)
-#define ACCESS_MAX_MS_V4_ACE_TYPE               (0x8)
-#define ACCESS_MAX_MS_ACE_TYPE                  (0x8)
-#define ACCESS_ALLOWED_CALLBACK_ACE_TYPE        (0x9)
-#define ACCESS_DENIED_CALLBACK_ACE_TYPE         (0xA)
-#define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB)
-#define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE  (0xC)
-#define SYSTEM_AUDIT_CALLBACK_ACE_TYPE          (0xD)
-#define SYSTEM_ALARM_CALLBACK_ACE_TYPE          (0xE)
-#define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE   (0xF)
-#define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE   (0x10)
-#define ACCESS_MAX_MS_V5_ACE_TYPE               (0x11)
-#define SYSTEM_MANDATORY_LABEL_ACE_TYPE         (0x11)
-
-/* The following are the inherit flags that go into the AceFlags field
-   of an Ace header. */
-
-#define OBJECT_INHERIT_ACE       (0x1)
-#define CONTAINER_INHERIT_ACE    (0x2)
-#define NO_PROPAGATE_INHERIT_ACE (0x4)
-#define INHERIT_ONLY_ACE         (0x8)
-#define INHERITED_ACE            (0x10)
-#define VALID_INHERIT_FLAGS      (0x1F)
-
-#define SUCCESSFUL_ACCESS_ACE_FLAG (0x40)
-#define FAILED_ACCESS_ACE_FLAG     (0x80)
-
-typedef struct _ACCESS_ALLOWED_ACE {
-  ACE_HEADER Header;
-  ACCESS_MASK Mask;
-  ULONG SidStart;
-} ACCESS_ALLOWED_ACE, *PACCESS_ALLOWED_ACE;
-
-typedef struct _ACCESS_DENIED_ACE {
-  ACE_HEADER Header;
-  ACCESS_MASK Mask;
-  ULONG SidStart;
-} ACCESS_DENIED_ACE, *PACCESS_DENIED_ACE;
-
-typedef struct _SYSTEM_AUDIT_ACE {
-  ACE_HEADER Header;
-  ACCESS_MASK Mask;
-  ULONG SidStart;
-} SYSTEM_AUDIT_ACE, *PSYSTEM_AUDIT_ACE;
-
-typedef struct _SYSTEM_ALARM_ACE {
-  ACE_HEADER Header;
-  ACCESS_MASK Mask;
-  ULONG SidStart;
-} SYSTEM_ALARM_ACE, *PSYSTEM_ALARM_ACE;
-
-typedef struct _SYSTEM_MANDATORY_LABEL_ACE {
-  ACE_HEADER Header;
-  ACCESS_MASK Mask;
-  ULONG SidStart;
-} SYSTEM_MANDATORY_LABEL_ACE, *PSYSTEM_MANDATORY_LABEL_ACE;
-
-#define SYSTEM_MANDATORY_LABEL_NO_WRITE_UP   0x1
-#define SYSTEM_MANDATORY_LABEL_NO_READ_UP    0x2
-#define SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP 0x4
-#define SYSTEM_MANDATORY_LABEL_VALID_MASK    (SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | \
-                                              SYSTEM_MANDATORY_LABEL_NO_READ_UP  | \
-                                              SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP)
-
-#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR))
-
-typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL;
-
-#define SE_OWNER_DEFAULTED       0x0001
-#define SE_GROUP_DEFAULTED       0x0002
-#define SE_DACL_PRESENT          0x0004
-#define SE_DACL_DEFAULTED        0x0008
-#define SE_SACL_PRESENT          0x0010
-#define SE_SACL_DEFAULTED        0x0020
-#define SE_DACL_UNTRUSTED        0x0040
-#define SE_SERVER_SECURITY       0x0080
-#define SE_DACL_AUTO_INHERIT_REQ 0x0100
-#define SE_SACL_AUTO_INHERIT_REQ 0x0200
-#define SE_DACL_AUTO_INHERITED   0x0400
-#define SE_SACL_AUTO_INHERITED   0x0800
-#define SE_DACL_PROTECTED        0x1000
-#define SE_SACL_PROTECTED        0x2000
-#define SE_RM_CONTROL_VALID      0x4000
-#define SE_SELF_RELATIVE         0x8000
-
-typedef struct _SECURITY_DESCRIPTOR_RELATIVE {
-  UCHAR Revision;
-  UCHAR Sbz1;
-  SECURITY_DESCRIPTOR_CONTROL Control;
-  ULONG Owner;
-  ULONG Group;
-  ULONG Sacl;
-  ULONG Dacl;
-} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
-
-typedef struct _SECURITY_DESCRIPTOR {
-  UCHAR Revision;
-  UCHAR Sbz1;
-  SECURITY_DESCRIPTOR_CONTROL Control;
-  PSID Owner;
-  PSID Group;
-  PACL Sacl;
-  PACL Dacl;
-} SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
-
-typedef struct _OBJECT_TYPE_LIST {
-  USHORT Level;
-  USHORT Sbz;
-  GUID *ObjectType;
-} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST;
-
-#define ACCESS_OBJECT_GUID       0
-#define ACCESS_PROPERTY_SET_GUID 1
-#define ACCESS_PROPERTY_GUID     2
-#define ACCESS_MAX_LEVEL         4
-
-typedef enum _AUDIT_EVENT_TYPE {
-  AuditEventObjectAccess,
-  AuditEventDirectoryServiceAccess
-} AUDIT_EVENT_TYPE, *PAUDIT_EVENT_TYPE;
-
-#define AUDIT_ALLOW_NO_PRIVILEGE 0x1
-
-#define ACCESS_DS_SOURCE_A "DS"
-#define ACCESS_DS_SOURCE_W L"DS"
-#define ACCESS_DS_OBJECT_TYPE_NAME_A "Directory Service Object"
-#define ACCESS_DS_OBJECT_TYPE_NAME_W L"Directory Service Object"
-
-#define ACCESS_REASON_TYPE_MASK 0xffff0000
-#define ACCESS_REASON_DATA_MASK 0x0000ffff
-
-typedef enum _ACCESS_REASON_TYPE {
-  AccessReasonNone = 0x00000000,
-  AccessReasonAllowedAce = 0x00010000,
-  AccessReasonDeniedAce = 0x00020000,
-  AccessReasonAllowedParentAce = 0x00030000,
-  AccessReasonDeniedParentAce = 0x00040000,
-  AccessReasonMissingPrivilege = 0x00100000,
-  AccessReasonFromPrivilege = 0x00200000,
-  AccessReasonIntegrityLevel = 0x00300000,
-  AccessReasonOwnership = 0x00400000,
-  AccessReasonNullDacl = 0x00500000,
-  AccessReasonEmptyDacl = 0x00600000,
-  AccessReasonNoSD = 0x00700000,
-  AccessReasonNoGrant = 0x00800000
-} ACCESS_REASON_TYPE;
-
-typedef ULONG ACCESS_REASON;
-
-typedef struct _ACCESS_REASONS {
-  ACCESS_REASON Data[32];
-} ACCESS_REASONS, *PACCESS_REASONS;
-
-#define SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE 0x00000001
-#define SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE 0x00000002
-#define SE_SECURITY_DESCRIPTOR_VALID_FLAGS       0x00000003
-
-typedef struct _SE_SECURITY_DESCRIPTOR {
-  ULONG Size;
-  ULONG Flags;
-  PSECURITY_DESCRIPTOR SecurityDescriptor;
-} SE_SECURITY_DESCRIPTOR, *PSE_SECURITY_DESCRIPTOR;
-
-typedef struct _SE_ACCESS_REQUEST {
-  ULONG Size;
-  PSE_SECURITY_DESCRIPTOR SeSecurityDescriptor;
-  ACCESS_MASK DesiredAccess;
-  ACCESS_MASK PreviouslyGrantedAccess;
-  PSID PrincipalSelfSid;
-  PGENERIC_MAPPING GenericMapping;
-  ULONG ObjectTypeListCount;
-  POBJECT_TYPE_LIST ObjectTypeList;
-} SE_ACCESS_REQUEST, *PSE_ACCESS_REQUEST;
-
-#define TOKEN_ASSIGN_PRIMARY    (0x0001)
-#define TOKEN_DUPLICATE         (0x0002)
-#define TOKEN_IMPERSONATE       (0x0004)
-#define TOKEN_QUERY             (0x0008)
-#define TOKEN_QUERY_SOURCE      (0x0010)
-#define TOKEN_ADJUST_PRIVILEGES (0x0020)
-#define TOKEN_ADJUST_GROUPS     (0x0040)
-#define TOKEN_ADJUST_DEFAULT    (0x0080)
-#define TOKEN_ADJUST_SESSIONID  (0x0100)
-
-#define TOKEN_ALL_ACCESS_P (STANDARD_RIGHTS_REQUIRED |\
-                            TOKEN_ASSIGN_PRIMARY     |\
-                            TOKEN_DUPLICATE          |\
-                            TOKEN_IMPERSONATE        |\
-                            TOKEN_QUERY              |\
-                            TOKEN_QUERY_SOURCE       |\
-                            TOKEN_ADJUST_PRIVILEGES  |\
-                            TOKEN_ADJUST_GROUPS      |\
-                            TOKEN_ADJUST_DEFAULT)
-
-#if ((defined(_WIN32_WINNT) && (_WIN32_WINNT > 0x0400)) || (!defined(_WIN32_WINNT)))
-#define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P | TOKEN_ADJUST_SESSIONID)
-#else
-#define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P)
-#endif
-
-#define TOKEN_READ (STANDARD_RIGHTS_READ | TOKEN_QUERY)
-
-#define TOKEN_WRITE (STANDARD_RIGHTS_WRITE   |\
-                     TOKEN_ADJUST_PRIVILEGES |\
-                     TOKEN_ADJUST_GROUPS     |\
-                     TOKEN_ADJUST_DEFAULT)
-
-#define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
-
-typedef enum _TOKEN_TYPE {
-  TokenPrimary = 1,
-  TokenImpersonation
-} TOKEN_TYPE, *PTOKEN_TYPE;
-
-typedef enum _TOKEN_INFORMATION_CLASS {
-  TokenUser = 1,
-  TokenGroups,
-  TokenPrivileges,
-  TokenOwner,
-  TokenPrimaryGroup,
-  TokenDefaultDacl,
-  TokenSource,
-  TokenType,
-  TokenImpersonationLevel,
-  TokenStatistics,
-  TokenRestrictedSids,
-  TokenSessionId,
-  TokenGroupsAndPrivileges,
-  TokenSessionReference,
-  TokenSandBoxInert,
-  TokenAuditPolicy,
-  TokenOrigin,
-  TokenElevationType,
-  TokenLinkedToken,
-  TokenElevation,
-  TokenHasRestrictions,
-  TokenAccessInformation,
-  TokenVirtualizationAllowed,
-  TokenVirtualizationEnabled,
-  TokenIntegrityLevel,
-  TokenUIAccess,
-  TokenMandatoryPolicy,
-  TokenLogonSid,
-  MaxTokenInfoClass
-} TOKEN_INFORMATION_CLASS, *PTOKEN_INFORMATION_CLASS;
-
-typedef struct _TOKEN_USER {
-  SID_AND_ATTRIBUTES User;
-} TOKEN_USER, *PTOKEN_USER;
-
-typedef struct _TOKEN_GROUPS {
-  ULONG GroupCount;
-#ifdef MIDL_PASS
-  [size_is(GroupCount)] SID_AND_ATTRIBUTES Groups[*];
-#else
-  SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
-#endif
-} TOKEN_GROUPS, *PTOKEN_GROUPS, *LPTOKEN_GROUPS;
-
-typedef struct _TOKEN_PRIVILEGES {
-  ULONG PrivilegeCount;
-  LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
-} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES, *LPTOKEN_PRIVILEGES;
-
-typedef struct _TOKEN_OWNER {
-  PSID Owner;
-} TOKEN_OWNER, *PTOKEN_OWNER;
-
-typedef struct _TOKEN_PRIMARY_GROUP {
-  PSID PrimaryGroup;
-} TOKEN_PRIMARY_GROUP, *PTOKEN_PRIMARY_GROUP;
-
-typedef struct _TOKEN_DEFAULT_DACL {
-  PACL DefaultDacl;
-} TOKEN_DEFAULT_DACL, *PTOKEN_DEFAULT_DACL;
-
-typedef struct _TOKEN_GROUPS_AND_PRIVILEGES {
-  ULONG SidCount;
-  ULONG SidLength;
-  PSID_AND_ATTRIBUTES Sids;
-  ULONG RestrictedSidCount;
-  ULONG RestrictedSidLength;
-  PSID_AND_ATTRIBUTES RestrictedSids;
-  ULONG PrivilegeCount;
-  ULONG PrivilegeLength;
-  PLUID_AND_ATTRIBUTES Privileges;
-  LUID AuthenticationId;
-} TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES;
-
-typedef struct _TOKEN_LINKED_TOKEN {
-  HANDLE LinkedToken;
-} TOKEN_LINKED_TOKEN, *PTOKEN_LINKED_TOKEN;
-
-typedef struct _TOKEN_ELEVATION {
-  ULONG TokenIsElevated;
-} TOKEN_ELEVATION, *PTOKEN_ELEVATION;
-
-typedef struct _TOKEN_MANDATORY_LABEL {
-  SID_AND_ATTRIBUTES Label;
-} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL;
-
-#define TOKEN_MANDATORY_POLICY_OFF             0x0
-#define TOKEN_MANDATORY_POLICY_NO_WRITE_UP     0x1
-#define TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN 0x2
-
-#define TOKEN_MANDATORY_POLICY_VALID_MASK (TOKEN_MANDATORY_POLICY_NO_WRITE_UP | \
-                                           TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN)
-
-#define POLICY_AUDIT_SUBCATEGORY_COUNT (56)
-
-typedef struct _TOKEN_AUDIT_POLICY {
-  UCHAR PerUserPolicy[((POLICY_AUDIT_SUBCATEGORY_COUNT) >> 1) + 1];
-} TOKEN_AUDIT_POLICY, *PTOKEN_AUDIT_POLICY;
-
-#define TOKEN_SOURCE_LENGTH 8
-
-typedef struct _TOKEN_SOURCE {
-  CHAR SourceName[TOKEN_SOURCE_LENGTH];
-  LUID SourceIdentifier;
-} TOKEN_SOURCE, *PTOKEN_SOURCE;
-
-#include <pshpack4.h>
-typedef struct _TOKEN_STATISTICS {
-  LUID TokenId;
-  LUID AuthenticationId;
-  LARGE_INTEGER ExpirationTime;
-  TOKEN_TYPE TokenType;
-  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
-  ULONG DynamicCharged;
-  ULONG DynamicAvailable;
-  ULONG GroupCount;
-  ULONG PrivilegeCount;
-  LUID ModifiedId;
-} TOKEN_STATISTICS, *PTOKEN_STATISTICS;
-#include <poppack.h>
-
-typedef struct _TOKEN_CONTROL {
-  LUID TokenId;
-  LUID AuthenticationId;
-  LUID ModifiedId;
-  TOKEN_SOURCE TokenSource;
-} TOKEN_CONTROL, *PTOKEN_CONTROL;
-
-typedef struct _TOKEN_ORIGIN {
-  LUID OriginatingLogonSession;
-} TOKEN_ORIGIN, *PTOKEN_ORIGIN;
-
-typedef enum _MANDATORY_LEVEL {
-  MandatoryLevelUntrusted = 0,
-  MandatoryLevelLow,
-  MandatoryLevelMedium,
-  MandatoryLevelHigh,
-  MandatoryLevelSystem,
-  MandatoryLevelSecureProcess,
-  MandatoryLevelCount
-} MANDATORY_LEVEL, *PMANDATORY_LEVEL;
-
-
-typedef struct _SE_ACCESS_REPLY {
-  ULONG Size;
-  ULONG ResultListCount;
-  PACCESS_MASK GrantedAccess;
-  PNTSTATUS AccessStatus;
-  PACCESS_REASONS AccessReason;
-  PPRIVILEGE_SET* Privileges;
-} SE_ACCESS_REPLY, *PSE_ACCESS_REPLY;
-
-typedef enum _SE_AUDIT_OPERATION {
-  AuditPrivilegeObject,
-  AuditPrivilegeService,
-  AuditAccessCheck,
-  AuditOpenObject,
-  AuditOpenObjectWithTransaction,
-  AuditCloseObject,
-  AuditDeleteObject,
-  AuditOpenObjectForDelete,
-  AuditOpenObjectForDeleteWithTransaction,
-  AuditCloseNonObject,
-  AuditOpenNonObject,
-  AuditObjectReference,
-  AuditHandleCreation,
-} SE_AUDIT_OPERATION, *PSE_AUDIT_OPERATION;
-
-typedef struct _SE_AUDIT_INFO {
-  ULONG Size;
-  AUDIT_EVENT_TYPE AuditType;
-  SE_AUDIT_OPERATION AuditOperation;
-  ULONG AuditFlags;
-  UNICODE_STRING SubsystemName;
-  UNICODE_STRING ObjectTypeName;
-  UNICODE_STRING ObjectName;
-  PVOID HandleId;
-  GUID* TransactionId;
-  LUID* OperationId;
-  BOOLEAN ObjectCreation;
-  BOOLEAN GenerateOnClose;
-} SE_AUDIT_INFO, *PSE_AUDIT_INFO;
-
-typedef struct _TOKEN_MANDATORY_POLICY {
-  ULONG Policy;
-} TOKEN_MANDATORY_POLICY, *PTOKEN_MANDATORY_POLICY;
-
-typedef struct _TOKEN_ACCESS_INFORMATION {
-  PSID_AND_ATTRIBUTES_HASH SidHash;
-  PSID_AND_ATTRIBUTES_HASH RestrictedSidHash;
-  PTOKEN_PRIVILEGES Privileges;
-  LUID AuthenticationId;
-  TOKEN_TYPE TokenType;
-  SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
-  TOKEN_MANDATORY_POLICY MandatoryPolicy;
-  ULONG Flags;
-} TOKEN_ACCESS_INFORMATION, *PTOKEN_ACCESS_INFORMATION;
-
-#define TOKEN_HAS_TRAVERSE_PRIVILEGE    0x0001
-#define TOKEN_HAS_BACKUP_PRIVILEGE      0x0002
-#define TOKEN_HAS_RESTORE_PRIVILEGE     0x0004
-#define TOKEN_WRITE_RESTRICTED          0x0008
-#define TOKEN_IS_RESTRICTED             0x0010
-#define TOKEN_SESSION_NOT_REFERENCED    0x0020
-#define TOKEN_SANDBOX_INERT             0x0040
-#define TOKEN_HAS_IMPERSONATE_PRIVILEGE 0x0080
-#define SE_BACKUP_PRIVILEGES_CHECKED    0x0100
-#define TOKEN_VIRTUALIZE_ALLOWED        0x0200
-#define TOKEN_VIRTUALIZE_ENABLED        0x0400
-#define TOKEN_IS_FILTERED               0x0800
-#define TOKEN_UIACCESS                  0x1000
-#define TOKEN_NOT_LOW                   0x2000
-
-typedef struct _SE_EXPORTS {
-  LUID SeCreateTokenPrivilege;
-  LUID SeAssignPrimaryTokenPrivilege;
-  LUID SeLockMemoryPrivilege;
-  LUID SeIncreaseQuotaPrivilege;
-  LUID SeUnsolicitedInputPrivilege;
-  LUID SeTcbPrivilege;
-  LUID SeSecurityPrivilege;
-  LUID SeTakeOwnershipPrivilege;
-  LUID SeLoadDriverPrivilege;
-  LUID SeCreatePagefilePrivilege;
-  LUID SeIncreaseBasePriorityPrivilege;
-  LUID SeSystemProfilePrivilege;
-  LUID SeSystemtimePrivilege;
-  LUID SeProfileSingleProcessPrivilege;
-  LUID SeCreatePermanentPrivilege;
-  LUID SeBackupPrivilege;
-  LUID SeRestorePrivilege;
-  LUID SeShutdownPrivilege;
-  LUID SeDebugPrivilege;
-  LUID SeAuditPrivilege;
-  LUID SeSystemEnvironmentPrivilege;
-  LUID SeChangeNotifyPrivilege;
-  LUID SeRemoteShutdownPrivilege;
-  PSID SeNullSid;
-  PSID SeWorldSid;
-  PSID SeLocalSid;
-  PSID SeCreatorOwnerSid;
-  PSID SeCreatorGroupSid;
-  PSID SeNtAuthoritySid;
-  PSID SeDialupSid;
-  PSID SeNetworkSid;
-  PSID SeBatchSid;
-  PSID SeInteractiveSid;
-  PSID SeLocalSystemSid;
-  PSID SeAliasAdminsSid;
-  PSID SeAliasUsersSid;
-  PSID SeAliasGuestsSid;
-  PSID SeAliasPowerUsersSid;
-  PSID SeAliasAccountOpsSid;
-  PSID SeAliasSystemOpsSid;
-  PSID SeAliasPrintOpsSid;
-  PSID SeAliasBackupOpsSid;
-  PSID SeAuthenticatedUsersSid;
-  PSID SeRestrictedSid;
-  PSID SeAnonymousLogonSid;
-  LUID SeUndockPrivilege;
-  LUID SeSyncAgentPrivilege;
-  LUID SeEnableDelegationPrivilege;
-  PSID SeLocalServiceSid;
-  PSID SeNetworkServiceSid;
-  LUID SeManageVolumePrivilege;
-  LUID SeImpersonatePrivilege;
-  LUID SeCreateGlobalPrivilege;
-  LUID SeTrustedCredManAccessPrivilege;
-  LUID SeRelabelPrivilege;
-  LUID SeIncreaseWorkingSetPrivilege;
-  LUID SeTimeZonePrivilege;
-  LUID SeCreateSymbolicLinkPrivilege;
-  PSID SeIUserSid;
-  PSID SeUntrustedMandatorySid;
-  PSID SeLowMandatorySid;
-  PSID SeMediumMandatorySid;
-  PSID SeHighMandatorySid;
-  PSID SeSystemMandatorySid;
-  PSID SeOwnerRightsSid;
-} SE_EXPORTS, *PSE_EXPORTS;
-
-typedef NTSTATUS
-(NTAPI *PSE_LOGON_SESSION_TERMINATED_ROUTINE)(
-  IN PLUID LogonId);
-
-typedef struct _SECURITY_CLIENT_CONTEXT {
-  SECURITY_QUALITY_OF_SERVICE SecurityQos;
-  PACCESS_TOKEN ClientToken;
-  BOOLEAN DirectlyAccessClientToken;
-  BOOLEAN DirectAccessEffectiveOnly;
-  BOOLEAN ServerIsRemote;
-  TOKEN_CONTROL ClientTokenControl;
-} SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT;
-
-/******************************************************************************
- *                            Object Manager Types                            *
- ******************************************************************************/
-
-typedef enum _OBJECT_INFORMATION_CLASS {
-  ObjectBasicInformation = 0,
-  ObjectTypeInformation = 2,
-  /* Not for public use */
-  ObjectNameInformation = 1,
-  ObjectTypesInformation = 3,
-  ObjectHandleFlagInformation = 4,
-  ObjectSessionInformation = 5,
-  MaxObjectInfoClass
-} OBJECT_INFORMATION_CLASS;
-
-
-/******************************************************************************
- *                           Runtime Library Types                            *
- ******************************************************************************/
-
-
-#define RTL_SYSTEM_VOLUME_INFORMATION_FOLDER    L"System Volume Information"
-
-_Function_class_(RTL_ALLOCATE_STRING_ROUTINE)
-_IRQL_requires_max_(PASSIVE_LEVEL)
-__drv_allocatesMem(Mem)
-typedef PVOID
-(NTAPI *PRTL_ALLOCATE_STRING_ROUTINE)(
-  _In_ SIZE_T NumberOfBytes);
-
-#if _WIN32_WINNT >= 0x0600
-_Function_class_(RTL_REALLOCATE_STRING_ROUTINE)
-_IRQL_requires_max_(PASSIVE_LEVEL)
-__drv_allocatesMem(Mem)
-typedef PVOID
-(NTAPI *PRTL_REALLOCATE_STRING_ROUTINE)(
-  _In_ SIZE_T NumberOfBytes,
-  IN PVOID Buffer);
-#endif
-
-typedef VOID
-(NTAPI *PRTL_FREE_STRING_ROUTINE)(
-  _In_ __drv_freesMem(Mem) _Post_invalid_ PVOID Buffer);
-
-extern NTKERNELAPI const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine;
-extern NTKERNELAPI const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine;
-
-#if _WIN32_WINNT >= 0x0600
-extern NTKERNELAPI const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine;
-#endif
-
-_Function_class_(RTL_HEAP_COMMIT_ROUTINE)
-_IRQL_requires_same_
-typedef NTSTATUS
-(NTAPI *PRTL_HEAP_COMMIT_ROUTINE) (
-  _In_ PVOID Base,
-  _Inout_ PVOID *CommitAddress,
-  _Inout_ PSIZE_T CommitSize);
-
-typedef struct _RTL_HEAP_PARAMETERS {
-  ULONG Length;
-  SIZE_T SegmentReserve;
-  SIZE_T SegmentCommit;
-  SIZE_T DeCommitFreeBlockThreshold;
-  SIZE_T DeCommitTotalFreeThreshold;
-  SIZE_T MaximumAllocationSize;
-  SIZE_T VirtualMemoryThreshold;
-  SIZE_T InitialCommit;
-  SIZE_T InitialReserve;
-  PRTL_HEAP_COMMIT_ROUTINE CommitRoutine;
-  SIZE_T Reserved[2];
-} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS;
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-typedef struct _GENERATE_NAME_CONTEXT {
-  USHORT Checksum;
-  BOOLEAN CheckSumInserted;
-  _Field_range_(<=, 8) UCHAR NameLength;
-  WCHAR NameBuffer[8];
-  _Field_range_(<=, 4) ULONG ExtensionLength;
-  WCHAR ExtensionBuffer[4];
-  ULONG LastIndexValue;
-} GENERATE_NAME_CONTEXT, *PGENERATE_NAME_CONTEXT;
-
-typedef struct _PREFIX_TABLE_ENTRY {
-  CSHORT NodeTypeCode;
-  CSHORT NameLength;
-  struct _PREFIX_TABLE_ENTRY *NextPrefixTree;
-  RTL_SPLAY_LINKS Links;
-  PSTRING Prefix;
-} PREFIX_TABLE_ENTRY, *PPREFIX_TABLE_ENTRY;
-
-typedef struct _PREFIX_TABLE {
-  CSHORT NodeTypeCode;
-  CSHORT NameLength;
-  PPREFIX_TABLE_ENTRY NextPrefixTree;
-} PREFIX_TABLE, *PPREFIX_TABLE;
-
-typedef struct _UNICODE_PREFIX_TABLE_ENTRY {
-  CSHORT NodeTypeCode;
-  CSHORT NameLength;
-  struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree;
-  struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch;
-  RTL_SPLAY_LINKS Links;
-  PUNICODE_STRING Prefix;
-} UNICODE_PREFIX_TABLE_ENTRY, *PUNICODE_PREFIX_TABLE_ENTRY;
-
-typedef struct _UNICODE_PREFIX_TABLE {
-  CSHORT NodeTypeCode;
-  CSHORT NameLength;
-  PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree;
-  PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry;
-} UNICODE_PREFIX_TABLE, *PUNICODE_PREFIX_TABLE;
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-typedef struct _COMPRESSED_DATA_INFO {
-  USHORT CompressionFormatAndEngine;
-  UCHAR CompressionUnitShift;
-  UCHAR ChunkShift;
-  UCHAR ClusterShift;
-  UCHAR Reserved;
-  USHORT NumberOfChunks;
-  ULONG CompressedChunkSizes[ANYSIZE_ARRAY];
-} COMPRESSED_DATA_INFO, *PCOMPRESSED_DATA_INFO;
-#endif
-/******************************************************************************
- *                         Runtime Library Functions                          *
- ******************************************************************************/
-
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-_Must_inspect_result_
-_Ret_maybenull_
-_Post_writable_byte_size_(Size)
-NTSYSAPI
-PVOID
-NTAPI
-RtlAllocateHeap(
-  _In_ HANDLE HeapHandle,
-  _In_opt_ ULONG Flags,
-  _In_ SIZE_T Size);
-
-_Success_(return != 0)
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlFreeHeap(
-  _In_ PVOID HeapHandle,
-  _In_opt_ ULONG Flags,
-  _In_ _Post_invalid_ PVOID BaseAddress);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlCaptureContext(
-  _Out_ PCONTEXT ContextRecord);
-
-_Ret_range_(<, MAXLONG)
-NTSYSAPI
-ULONG
-NTAPI
-RtlRandom(
-  _Inout_ PULONG Seed);
-
-_IRQL_requires_max_(APC_LEVEL)
-_Success_(return != 0)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlCreateUnicodeString(
-  _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem))
-    PUNICODE_STRING DestinationString,
-  _In_z_ PCWSTR SourceString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlPrefixString(
-  _In_ const STRING *String1,
-  _In_ const STRING *String2,
-  _In_ BOOLEAN CaseInsensitive);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlAppendStringToString(
-  _Inout_ PSTRING Destination,
-  _In_ const STRING *Source);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlOemStringToUnicodeString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    PUNICODE_STRING DestinationString,
-  _In_ PCOEM_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeStringToOemString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    POEM_STRING DestinationString,
-  _In_ PCUNICODE_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUpcaseUnicodeStringToOemString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    POEM_STRING DestinationString,
-  _In_ PCUNICODE_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlOemStringToCountedUnicodeString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    PUNICODE_STRING DestinationString,
-  _In_ PCOEM_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeStringToCountedOemString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    POEM_STRING DestinationString,
-  _In_ PCUNICODE_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUpcaseUnicodeStringToCountedOemString(
-  _When_(AllocateDestinationString, _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    POEM_STRING DestinationString,
-  _In_ PCUNICODE_STRING SourceString,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_When_(AllocateDestinationString, _Must_inspect_result_)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDowncaseUnicodeString(
-  _When_(AllocateDestinationString, _Out_ _At_(UniDest->Buffer, __drv_allocatesMem(Mem)))
-  _When_(!AllocateDestinationString, _Inout_)
-    PUNICODE_STRING UniDest,
-  _In_ PCUNICODE_STRING UniSource,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlFreeOemString(
-  _Inout_ _At_(OemString->Buffer, __drv_freesMem(Mem)) POEM_STRING OemString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-ULONG
-NTAPI
-RtlxUnicodeStringToOemSize(
-  _In_ PCUNICODE_STRING UnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-ULONG
-NTAPI
-RtlxOemStringToUnicodeSize(
-  _In_ PCOEM_STRING OemString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlMultiByteToUnicodeN(
-  _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
-  _In_ ULONG MaxBytesInUnicodeString,
-  _Out_opt_ PULONG BytesInUnicodeString,
-  _In_reads_bytes_(BytesInMultiByteString) const CHAR *MultiByteString,
-  _In_ ULONG BytesInMultiByteString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlMultiByteToUnicodeSize(
-  _Out_ PULONG BytesInUnicodeString,
-  _In_reads_bytes_(BytesInMultiByteString) const CHAR *MultiByteString,
-  _In_ ULONG BytesInMultiByteString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeToMultiByteSize(
-  _Out_ PULONG BytesInMultiByteString,
-  _In_reads_bytes_(BytesInUnicodeString) PCWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeToMultiByteN(
-  _Out_writes_bytes_to_(MaxBytesInMultiByteString, *BytesInMultiByteString) PCHAR MultiByteString,
-  _In_ ULONG MaxBytesInMultiByteString,
-  _Out_opt_ PULONG BytesInMultiByteString,
-  _In_reads_bytes_(BytesInUnicodeString) PCWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUpcaseUnicodeToMultiByteN(
-  _Out_writes_bytes_to_(MaxBytesInMultiByteString, *BytesInMultiByteString) PCHAR MultiByteString,
-  _In_ ULONG MaxBytesInMultiByteString,
-  _Out_opt_ PULONG BytesInMultiByteString,
-  _In_reads_bytes_(BytesInUnicodeString) PCWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlOemToUnicodeN(
-  _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWSTR UnicodeString,
-  _In_ ULONG MaxBytesInUnicodeString,
-  _Out_opt_ PULONG BytesInUnicodeString,
-  _In_reads_bytes_(BytesInOemString) PCCH OemString,
-  _In_ ULONG BytesInOemString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeToOemN(
-  _Out_writes_bytes_to_(MaxBytesInOemString, *BytesInOemString) PCHAR OemString,
-  _In_ ULONG MaxBytesInOemString,
-  _Out_opt_ PULONG BytesInOemString,
-  _In_reads_bytes_(BytesInUnicodeString) PCWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUpcaseUnicodeToOemN(
-  _Out_writes_bytes_to_(MaxBytesInOemString, *BytesInOemString) PCHAR OemString,
-  _In_ ULONG MaxBytesInOemString,
-  _Out_opt_ PULONG BytesInOemString,
-  _In_reads_bytes_(BytesInUnicodeString) PCWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-#if (NTDDI_VERSION >= NTDDI_VISTASP1)
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGenerate8dot3Name(
-  _In_ PCUNICODE_STRING Name,
-  _In_ BOOLEAN AllowExtendedCharacters,
-  _Inout_ PGENERATE_NAME_CONTEXT Context,
-  _Inout_ PUNICODE_STRING Name8dot3);
-#else
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlGenerate8dot3Name(
-  _In_ PCUNICODE_STRING Name,
-  _In_ BOOLEAN AllowExtendedCharacters,
-  _Inout_ PGENERATE_NAME_CONTEXT Context,
-  _Inout_ PUNICODE_STRING Name8dot3);
-#endif
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlIsNameLegalDOS8Dot3(
-  _In_ PCUNICODE_STRING Name,
-  _Inout_opt_ POEM_STRING OemName,
-  _Out_opt_ PBOOLEAN NameContainsSpaces);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlIsValidOemCharacter(
-  _Inout_ PWCHAR Char);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-PfxInitialize(
-  _Out_ PPREFIX_TABLE PrefixTable);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-BOOLEAN
-NTAPI
-PfxInsertPrefix(
-  _In_ PPREFIX_TABLE PrefixTable,
-  _In_ __drv_aliasesMem PSTRING Prefix,
-  _Out_ PPREFIX_TABLE_ENTRY PrefixTableEntry);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-PfxRemovePrefix(
-  _In_ PPREFIX_TABLE PrefixTable,
-  _In_ PPREFIX_TABLE_ENTRY PrefixTableEntry);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-PPREFIX_TABLE_ENTRY
-NTAPI
-PfxFindPrefix(
-  _In_ PPREFIX_TABLE PrefixTable,
-  _In_ PSTRING FullName);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlInitializeUnicodePrefix(
-  _Out_ PUNICODE_PREFIX_TABLE PrefixTable);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlInsertUnicodePrefix(
-  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
-  _In_ __drv_aliasesMem PUNICODE_STRING Prefix,
-  _Out_ PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlRemoveUnicodePrefix(
-  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
-  _In_ PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-PUNICODE_PREFIX_TABLE_ENTRY
-NTAPI
-RtlFindUnicodePrefix(
-  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
-  _In_ PUNICODE_STRING FullName,
-  _In_ ULONG CaseInsensitiveIndex);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-PUNICODE_PREFIX_TABLE_ENTRY
-NTAPI
-RtlNextUnicodePrefix(
-  _In_ PUNICODE_PREFIX_TABLE PrefixTable,
-  _In_ BOOLEAN Restart);
-
-_Must_inspect_result_
-NTSYSAPI
-SIZE_T
-NTAPI
-RtlCompareMemoryUlong(
-  _In_reads_bytes_(Length) PVOID Source,
-  _In_ SIZE_T Length,
-  _In_ ULONG Pattern);
-
-_Success_(return != 0)
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlTimeToSecondsSince1980(
-  _In_ PLARGE_INTEGER Time,
-  _Out_ PULONG ElapsedSeconds);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlSecondsSince1980ToTime(
-  _In_ ULONG ElapsedSeconds,
-  _Out_ PLARGE_INTEGER Time);
-
-_Success_(return != 0)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlTimeToSecondsSince1970(
-    _In_ PLARGE_INTEGER Time,
-    _Out_ PULONG ElapsedSeconds);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlSecondsSince1970ToTime(
-  _In_ ULONG ElapsedSeconds,
-  _Out_ PLARGE_INTEGER Time);
-
-_IRQL_requires_max_(APC_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlValidSid(
-  _In_ PSID Sid);
-
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlEqualSid(
-  _In_ PSID Sid1,
-  _In_ PSID Sid2);
-
-_IRQL_requires_max_(APC_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-BOOLEAN
-NTAPI
-RtlEqualPrefixSid(
-  _In_ PSID Sid1,
-  _In_ PSID Sid2);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-ULONG
-NTAPI
-RtlLengthRequiredSid(
-  _In_ ULONG SubAuthorityCount);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlFreeSid(
-  _In_ _Post_invalid_ PSID Sid);
-
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlAllocateAndInitializeSid(
-  _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
-  _In_ UCHAR SubAuthorityCount,
-  _In_ ULONG SubAuthority0,
-  _In_ ULONG SubAuthority1,
-  _In_ ULONG SubAuthority2,
-  _In_ ULONG SubAuthority3,
-  _In_ ULONG SubAuthority4,
-  _In_ ULONG SubAuthority5,
-  _In_ ULONG SubAuthority6,
-  _In_ ULONG SubAuthority7,
-  _Outptr_ PSID *Sid);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlInitializeSid(
-  _Out_ PSID Sid,
-  _In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
-  _In_ UCHAR SubAuthorityCount);
-
-NTSYSAPI
-PULONG
-NTAPI
-RtlSubAuthoritySid(
-  _In_ PSID Sid,
-  _In_ ULONG SubAuthority);
-
-_Post_satisfies_(return >= 8 && return <= SECURITY_MAX_SID_SIZE)
-NTSYSAPI
-ULONG
-NTAPI
-RtlLengthSid(
-  _In_ PSID Sid);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCopySid(
-  _In_ ULONG DestinationSidLength,
-  _Out_writes_bytes_(DestinationSidLength) PSID DestinationSid,
-  _In_ PSID SourceSid);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlConvertSidToUnicodeString(
-  _Inout_ PUNICODE_STRING UnicodeString,
-  _In_ PSID Sid,
-  _In_ BOOLEAN AllocateDestinationString);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlCopyLuid(
-  _Out_ PLUID DestinationLuid,
-  _In_ PLUID SourceLuid);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCreateAcl(
-  _Out_writes_bytes_(AclLength) PACL Acl,
-  _In_ ULONG AclLength,
-  _In_ ULONG AclRevision);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlAddAce(
-  _Inout_ PACL Acl,
-  _In_ ULONG AceRevision,
-  _In_ ULONG StartingAceIndex,
-  _In_reads_bytes_(AceListLength) PVOID AceList,
-  _In_ ULONG AceListLength);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDeleteAce(
-  _Inout_ PACL Acl,
-  _In_ ULONG AceIndex);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGetAce(
-  _In_ PACL Acl,
-  _In_ ULONG AceIndex,
-  _Outptr_ PVOID *Ace);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlAddAccessAllowedAce(
-  _Inout_ PACL Acl,
-  _In_ ULONG AceRevision,
-  _In_ ACCESS_MASK AccessMask,
-  _In_ PSID Sid);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlAddAccessAllowedAceEx(
-  _Inout_ PACL Acl,
-  _In_ ULONG AceRevision,
-  _In_ ULONG AceFlags,
-  _In_ ACCESS_MASK AccessMask,
-  _In_ PSID Sid);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCreateSecurityDescriptorRelative(
-  _Out_ PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
-  _In_ ULONG Revision);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGetDaclSecurityDescriptor(
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _Out_ PBOOLEAN DaclPresent,
-  _Out_ PACL *Dacl,
-  _Out_ PBOOLEAN DaclDefaulted);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlSetOwnerSecurityDescriptor(
-  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSID Owner,
-  _In_opt_ BOOLEAN OwnerDefaulted);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGetOwnerSecurityDescriptor(
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _Out_ PSID *Owner,
-  _Out_ PBOOLEAN OwnerDefaulted);
-
-_IRQL_requires_max_(APC_LEVEL)
-_When_(Status < 0, _Out_range_(>, 0))
-_When_(Status >= 0, _Out_range_(==, 0))
-NTSYSAPI
-ULONG
-NTAPI
-RtlNtStatusToDosError(
-  _In_ NTSTATUS Status);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCustomCPToUnicodeN(
-  _In_ PCPTABLEINFO CustomCP,
-  _Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString,
-  _In_ ULONG MaxBytesInUnicodeString,
-  _Out_opt_ PULONG BytesInUnicodeString,
-  _In_reads_bytes_(BytesInCustomCPString) PCH CustomCPString,
-  _In_ ULONG BytesInCustomCPString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeToCustomCPN(
-  _In_ PCPTABLEINFO CustomCP,
-  _Out_writes_bytes_to_(MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString,
-  _In_ ULONG MaxBytesInCustomCPString,
-  _Out_opt_ PULONG BytesInCustomCPString,
-  _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUpcaseUnicodeToCustomCPN(
-  _In_ PCPTABLEINFO CustomCP,
-  _Out_writes_bytes_to_(MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString,
-  _In_ ULONG MaxBytesInCustomCPString,
-  _Out_opt_ PULONG BytesInCustomCPString,
-  _In_reads_bytes_(BytesInUnicodeString) PWCH UnicodeString,
-  _In_ ULONG BytesInUnicodeString);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-VOID
-NTAPI
-RtlInitCodePageTable(
-  _In_ PUSHORT TableBase,
-  _Out_ PCPTABLEINFO CodePageTable);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-
-
-_Must_inspect_result_
-NTSYSAPI
-PVOID
-NTAPI
-RtlCreateHeap(
-  _In_ ULONG Flags,
-  _In_opt_ PVOID HeapBase,
-  _In_opt_ SIZE_T ReserveSize,
-  _In_opt_ SIZE_T CommitSize,
-  _In_opt_ PVOID Lock,
-  _In_opt_ PRTL_HEAP_PARAMETERS Parameters);
-
-NTSYSAPI
-PVOID
-NTAPI
-RtlDestroyHeap(
-  _In_ _Post_invalid_ PVOID HeapHandle);
-
-NTSYSAPI
-USHORT
-NTAPI
-RtlCaptureStackBackTrace(
-  _In_ ULONG FramesToSkip,
-  _In_ ULONG FramesToCapture,
-  _Out_writes_to_(FramesToCapture, return) PVOID *BackTrace,
-  _Out_opt_ PULONG BackTraceHash);
-
-_Ret_range_(<, MAXLONG)
-NTSYSAPI
-ULONG
-NTAPI
-RtlRandomEx(
-  _Inout_ PULONG Seed);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlInitUnicodeStringEx(
-  _Out_ PUNICODE_STRING DestinationString,
-  _In_opt_z_ __drv_aliasesMem PCWSTR SourceString);
-
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlValidateUnicodeString(
-  _In_ ULONG Flags,
-  _In_ PCUNICODE_STRING String);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDuplicateUnicodeString(
-  _In_ ULONG Flags,
-  _In_ PCUNICODE_STRING SourceString,
-  _Out_ _At_(DestinationString->Buffer, __drv_allocatesMem(Mem)) PUNICODE_STRING DestinationString);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGetCompressionWorkSpaceSize(
-  _In_ USHORT CompressionFormatAndEngine,
-  _Out_ PULONG CompressBufferWorkSpaceSize,
-  _Out_ PULONG CompressFragmentWorkSpaceSize);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCompressBuffer(
-  _In_ USHORT CompressionFormatAndEngine,
-  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
-  _In_ ULONG UncompressedBufferSize,
-  _Out_writes_bytes_to_(CompressedBufferSize, *FinalCompressedSize) PUCHAR CompressedBuffer,
-  _In_ ULONG CompressedBufferSize,
-  _In_ ULONG UncompressedChunkSize,
-  _Out_ PULONG FinalCompressedSize,
-  _In_ PVOID WorkSpace);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDecompressBuffer(
-  _In_ USHORT CompressionFormat,
-  _Out_writes_bytes_to_(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer,
-  _In_ ULONG UncompressedBufferSize,
-  _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
-  _In_ ULONG CompressedBufferSize,
-  _Out_ PULONG FinalUncompressedSize);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDecompressFragment(
-  _In_ USHORT CompressionFormat,
-  _Out_writes_bytes_to_(UncompressedFragmentSize, *FinalUncompressedSize) PUCHAR UncompressedFragment,
-  _In_ ULONG UncompressedFragmentSize,
-  _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
-  _In_ ULONG CompressedBufferSize,
-  _In_range_(<, CompressedBufferSize) ULONG FragmentOffset,
-  _Out_ PULONG FinalUncompressedSize,
-  _In_ PVOID WorkSpace);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDescribeChunk(
-  _In_ USHORT CompressionFormat,
-  _Inout_ PUCHAR *CompressedBuffer,
-  _In_ PUCHAR EndOfCompressedBufferPlus1,
-  _Out_ PUCHAR *ChunkBuffer,
-  _Out_ PULONG ChunkSize);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlReserveChunk(
-  _In_ USHORT CompressionFormat,
-  _Inout_ PUCHAR *CompressedBuffer,
-  _In_ PUCHAR EndOfCompressedBufferPlus1,
-  _Out_ PUCHAR *ChunkBuffer,
-  _In_ ULONG ChunkSize);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlDecompressChunks(
-  _Out_writes_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
-  _In_ ULONG UncompressedBufferSize,
-  _In_reads_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
-  _In_ ULONG CompressedBufferSize,
-  _In_reads_bytes_(CompressedTailSize) PUCHAR CompressedTail,
-  _In_ ULONG CompressedTailSize,
-  _In_ PCOMPRESSED_DATA_INFO CompressedDataInfo);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCompressChunks(
-  _In_reads_bytes_(UncompressedBufferSize) PUCHAR UncompressedBuffer,
-  _In_ ULONG UncompressedBufferSize,
-  _Out_writes_bytes_(CompressedBufferSize) PUCHAR CompressedBuffer,
-  _In_range_(>=, (UncompressedBufferSize - (UncompressedBufferSize / 16))) ULONG CompressedBufferSize,
-  _Inout_updates_bytes_(CompressedDataInfoLength) PCOMPRESSED_DATA_INFO CompressedDataInfo,
-  _In_range_(>, sizeof(COMPRESSED_DATA_INFO)) ULONG CompressedDataInfoLength,
-  _In_ PVOID WorkSpace);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-PSID_IDENTIFIER_AUTHORITY
-NTAPI
-RtlIdentifierAuthoritySid(
-  _In_ PSID Sid);
-
-NTSYSAPI
-PUCHAR
-NTAPI
-RtlSubAuthorityCountSid(
-  _In_ PSID Sid);
-
-_When_(Status < 0, _Out_range_(>, 0))
-_When_(Status >= 0, _Out_range_(==, 0))
-NTSYSAPI
-ULONG
-NTAPI
-RtlNtStatusToDosErrorNoTeb(
-  _In_ NTSTATUS Status);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCreateSystemVolumeInformationFolder(
-  _In_ PCUNICODE_STRING VolumeRootPath);
-
-#if defined(_M_AMD64)
-
-FORCEINLINE
-VOID
-RtlFillMemoryUlong(
-  _Out_writes_bytes_all_(Length) PVOID Destination,
-  _In_ SIZE_T Length,
-  _In_ ULONG Pattern)
-{
-  PULONG Address = (PULONG)Destination;
-  if ((Length /= 4) != 0) {
-    if (((ULONG64)Address & 4) != 0) {
-      *Address = Pattern;
-      if ((Length -= 1) == 0) {
-        return;
-      }
-      Address += 1;
-    }
-    __stosq((PULONG64)(Address), Pattern | ((ULONG64)Pattern << 32), Length / 2);
-    if ((Length & 1) != 0) Address[Length - 1] = Pattern;
-  }
-  return;
-}
-
-#define RtlFillMemoryUlonglong(Destination, Length, Pattern)                \
-    __stosq((PULONG64)(Destination), Pattern, (Length) / 8)
-
-#else
-
-NTSYSAPI
-VOID
-NTAPI
-RtlFillMemoryUlong(
-  OUT PVOID Destination,
-  IN SIZE_T Length,
-  IN ULONG Pattern);
-
-NTSYSAPI
-VOID
-NTAPI
-RtlFillMemoryUlonglong(
-  _Out_writes_bytes_all_(Length) PVOID Destination,
-  _In_ SIZE_T Length,
-  _In_ ULONGLONG Pattern);
-
-#endif /* defined(_M_AMD64) */
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WS03)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlInitAnsiStringEx(
-  _Out_ PANSI_STRING DestinationString,
-  _In_opt_z_ __drv_aliasesMem PCSZ SourceString);
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WS03SP1)
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGetSaclSecurityDescriptor(
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _Out_ PBOOLEAN SaclPresent,
-  _Out_ PACL *Sacl,
-  _Out_ PBOOLEAN SaclDefaulted);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlSetGroupSecurityDescriptor(
-  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSID Group,
-  _In_opt_ BOOLEAN GroupDefaulted);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlGetGroupSecurityDescriptor(
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _Out_ PSID *Group,
-  _Out_ PBOOLEAN GroupDefaulted);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlAbsoluteToSelfRelativeSD(
-  _In_ PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
-  _Out_writes_bytes_to_opt_(*BufferLength, *BufferLength) PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
-  _Inout_ PULONG BufferLength);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlSelfRelativeToAbsoluteSD(
-  _In_ PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
-  _Out_writes_bytes_to_opt_(*AbsoluteSecurityDescriptorSize, *AbsoluteSecurityDescriptorSize) PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
-  _Inout_ PULONG AbsoluteSecurityDescriptorSize,
-  _Out_writes_bytes_to_opt_(*DaclSize, *DaclSize) PACL Dacl,
-  _Inout_ PULONG DaclSize,
-  _Out_writes_bytes_to_opt_(*SaclSize, *SaclSize) PACL Sacl,
-  _Inout_ PULONG SaclSize,
-  _Out_writes_bytes_to_opt_(*OwnerSize, *OwnerSize) PSID Owner,
-  _Inout_ PULONG OwnerSize,
-  _Out_writes_bytes_to_opt_(*PrimaryGroupSize, *PrimaryGroupSize) PSID PrimaryGroup,
-  _Inout_ PULONG PrimaryGroupSize);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlNormalizeString(
-  _In_ ULONG NormForm,
-  _In_ PCWSTR SourceString,
-  _In_ LONG SourceStringLength,
-  _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString,
-  _Inout_ PLONG DestinationStringLength);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlIsNormalizedString(
-  _In_ ULONG NormForm,
-  _In_ PCWSTR SourceString,
-  _In_ LONG SourceStringLength,
-  _Out_ PBOOLEAN Normalized);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlIdnToAscii(
-  _In_ ULONG Flags,
-  _In_ PCWSTR SourceString,
-  _In_ LONG SourceStringLength,
-  _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString,
-  _Inout_ PLONG DestinationStringLength);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlIdnToUnicode(
-  IN ULONG Flags,
-  IN PCWSTR SourceString,
-  IN LONG SourceStringLength,
-  OUT PWSTR DestinationString,
-  IN OUT PLONG DestinationStringLength);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlIdnToNameprepUnicode(
-  _In_ ULONG Flags,
-  _In_ PCWSTR SourceString,
-  _In_ LONG SourceStringLength,
-  _Out_writes_to_(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString,
-  _Inout_ PLONG DestinationStringLength);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCreateServiceSid(
-  _In_ PUNICODE_STRING ServiceName,
-  _Out_writes_bytes_opt_(*ServiceSidLength) PSID ServiceSid,
-  _Inout_ PULONG ServiceSidLength);
-
-NTSYSAPI
-LONG
-NTAPI
-RtlCompareAltitudes(
-  _In_ PCUNICODE_STRING Altitude1,
-  _In_ PCUNICODE_STRING Altitude2);
-
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUnicodeToUTF8N(
-  _Out_writes_bytes_to_(UTF8StringMaxByteCount, *UTF8StringActualByteCount) PCHAR UTF8StringDestination,
-  _In_ ULONG UTF8StringMaxByteCount,
-  _Out_ PULONG UTF8StringActualByteCount,
-  _In_reads_bytes_(UnicodeStringByteCount) PCWCH UnicodeStringSource,
-  _In_ ULONG UnicodeStringByteCount);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlUTF8ToUnicodeN(
-  _Out_writes_bytes_to_(UnicodeStringMaxByteCount, *UnicodeStringActualByteCount) PWSTR UnicodeStringDestination,
-  _In_ ULONG UnicodeStringMaxByteCount,
-  _Out_ PULONG UnicodeStringActualByteCount,
-  _In_reads_bytes_(UTF8StringByteCount) PCCH UTF8StringSource,
-  _In_ ULONG UTF8StringByteCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlReplaceSidInSd(
-  _Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PSID OldSid,
-  _In_ PSID NewSid,
-  _Out_ ULONG *NumChanges);
-
-NTSYSAPI
-NTSTATUS
-NTAPI
-RtlCreateVirtualAccountSid(
-  _In_ PCUNICODE_STRING Name,
-  _In_ ULONG BaseSubAuthority,
-  _Out_writes_bytes_(*SidLength) PSID Sid,
-  _Inout_ PULONG SidLength);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-
-#if defined(_AMD64_) || defined(_IA64_)
-
-
-
-#endif /* defined(_AMD64_) || defined(_IA64_) */
-
-
-
-#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE 1
-#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING 2
-
-#define RtlUnicodeStringToOemSize(STRING) (NLS_MB_OEM_CODE_PAGE_TAG ?                                \
-                                           RtlxUnicodeStringToOemSize(STRING) :                      \
-                                           ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \
-)
-
-#define RtlOemStringToUnicodeSize(STRING) (                 \
-    NLS_MB_OEM_CODE_PAGE_TAG ?                              \
-    RtlxOemStringToUnicodeSize(STRING) :                    \
-    ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR)  \
-)
-
-#define RtlOemStringToCountedUnicodeSize(STRING) (                    \
-    (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \
-)
-
-#define RtlOffsetToPointer(B,O) ((PCHAR)(((PCHAR)(B)) + ((ULONG_PTR)(O))))
-#define RtlPointerToOffset(B,P) ((ULONG)(((PCHAR)(P)) - ((PCHAR)(B))))
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryObject(
-  _In_opt_ HANDLE Handle,
-  _In_ OBJECT_INFORMATION_CLASS ObjectInformationClass,
-  _Out_writes_bytes_opt_(ObjectInformationLength) PVOID ObjectInformation,
-  _In_ ULONG ObjectInformationLength,
-  _Out_opt_ PULONG ReturnLength);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenThreadToken(
-  _In_ HANDLE ThreadHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ BOOLEAN OpenAsSelf,
-  _Out_ PHANDLE TokenHandle);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenProcessToken(
-  _In_ HANDLE ProcessHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _Out_ PHANDLE TokenHandle);
-
-_When_(TokenInformationClass == TokenAccessInformation,
-  _At_(TokenInformationLength,
-       _In_range_(>=, sizeof(TOKEN_ACCESS_INFORMATION))))
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryInformationToken(
-  _In_ HANDLE TokenHandle,
-  _In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
-  _Out_writes_bytes_to_opt_(TokenInformationLength, *ReturnLength) PVOID TokenInformation,
-  _In_ ULONG TokenInformationLength,
-  _Out_ PULONG ReturnLength);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAdjustPrivilegesToken(
-    _In_ HANDLE TokenHandle,
-    _In_ BOOLEAN DisableAllPrivileges,
-    _In_opt_ PTOKEN_PRIVILEGES NewState,
-    _In_ ULONG BufferLength,
-    _Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PTOKEN_PRIVILEGES PreviousState,
-    _When_(PreviousState != NULL, _Out_) PULONG ReturnLength);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtCreateFile(
-  _Out_ PHANDLE FileHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_opt_ PLARGE_INTEGER AllocationSize,
-  _In_ ULONG FileAttributes,
-  _In_ ULONG ShareAccess,
-  _In_ ULONG CreateDisposition,
-  _In_ ULONG CreateOptions,
-  _In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
-  _In_ ULONG EaLength);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtDeviceIoControlFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_ ULONG IoControlCode,
-  _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
-  _In_ ULONG InputBufferLength,
-  _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
-  _In_ ULONG OutputBufferLength);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtFsControlFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_ ULONG FsControlCode,
-  _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
-  _In_ ULONG InputBufferLength,
-  _Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
-  _In_ ULONG OutputBufferLength);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtLockFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_ PLARGE_INTEGER ByteOffset,
-  _In_ PLARGE_INTEGER Length,
-  _In_ ULONG Key,
-  _In_ BOOLEAN FailImmediately,
-  _In_ BOOLEAN ExclusiveLock);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenFile(
-  _Out_ PHANDLE FileHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_ ULONG ShareAccess,
-  _In_ ULONG OpenOptions);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryDirectoryFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _Out_writes_bytes_(Length) PVOID FileInformation,
-  _In_ ULONG Length,
-  _In_ FILE_INFORMATION_CLASS FileInformationClass,
-  _In_ BOOLEAN ReturnSingleEntry,
-  _In_opt_ PUNICODE_STRING FileName,
-  _In_ BOOLEAN RestartScan);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _Out_writes_bytes_(Length) PVOID FileInformation,
-  _In_ ULONG Length,
-  _In_ FILE_INFORMATION_CLASS FileInformationClass);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryQuotaInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _Out_writes_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Length,
-  _In_ BOOLEAN ReturnSingleEntry,
-  _In_reads_bytes_opt_(SidListLength) PVOID SidList,
-  _In_ ULONG SidListLength,
-  _In_reads_bytes_opt_((8 + (4 * ((SID *)StartSid)->SubAuthorityCount))) PSID StartSid,
-  _In_ BOOLEAN RestartScan);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQueryVolumeInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _Out_writes_bytes_(Length) PVOID FsInformation,
-  _In_ ULONG Length,
-  _In_ FS_INFORMATION_CLASS FsInformationClass);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtReadFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _Out_writes_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Length,
-  _In_opt_ PLARGE_INTEGER ByteOffset,
-  _In_opt_ PULONG Key);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtSetInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_reads_bytes_(Length) PVOID FileInformation,
-  _In_ ULONG Length,
-  _In_ FILE_INFORMATION_CLASS FileInformationClass);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtSetQuotaInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_reads_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Length);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtSetVolumeInformationFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_reads_bytes_(Length) PVOID FsInformation,
-  _In_ ULONG Length,
-  _In_ FS_INFORMATION_CLASS FsInformationClass);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtWriteFile(
-  _In_ HANDLE FileHandle,
-  _In_opt_ HANDLE Event,
-  _In_opt_ PIO_APC_ROUTINE ApcRoutine,
-  _In_opt_ PVOID ApcContext,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_reads_bytes_(Length) PVOID Buffer,
-  _In_ ULONG Length,
-  _In_opt_ PLARGE_INTEGER ByteOffset,
-  _In_opt_ PULONG Key);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtUnlockFile(
-  _In_ HANDLE FileHandle,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
-  _In_ PLARGE_INTEGER ByteOffset,
-  _In_ PLARGE_INTEGER Length,
-  _In_ ULONG Key);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtSetSecurityObject(
-  _In_ HANDLE Handle,
-  _In_ SECURITY_INFORMATION SecurityInformation,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtQuerySecurityObject(
-  _In_ HANDLE Handle,
-  _In_ SECURITY_INFORMATION SecurityInformation,
-  _Out_writes_bytes_opt_(Length) PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ ULONG Length,
-  _Out_ PULONG LengthNeeded);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtClose(
-  _In_ HANDLE Handle);
-
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenThreadTokenEx(
-  _In_ HANDLE ThreadHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ BOOLEAN OpenAsSelf,
-  _In_ ULONG HandleAttributes,
-  _Out_ PHANDLE TokenHandle);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenProcessTokenEx(
-  _In_ HANDLE ProcessHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ ULONG HandleAttributes,
-  _Out_ PHANDLE TokenHandle);
-
-_Must_inspect_result_
-NTSYSAPI
-NTSTATUS
-NTAPI
-NtOpenJobObjectToken(
-  _In_ HANDLE JobHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _Out_ PHANDLE TokenHandle);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtDuplicateToken(
-  _In_ HANDLE ExistingTokenHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_ BOOLEAN EffectiveOnly,
-  _In_ TOKEN_TYPE TokenType,
-  _Out_ PHANDLE NewTokenHandle);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtFilterToken(
-  _In_ HANDLE ExistingTokenHandle,
-  _In_ ULONG Flags,
-  _In_opt_ PTOKEN_GROUPS SidsToDisable,
-  _In_opt_ PTOKEN_PRIVILEGES PrivilegesToDelete,
-  _In_opt_ PTOKEN_GROUPS RestrictedSids,
-  _Out_ PHANDLE NewTokenHandle);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtImpersonateAnonymousToken(
-  _In_ HANDLE ThreadHandle);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtSetInformationToken(
-  _In_ HANDLE TokenHandle,
-  _In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
-  _In_reads_bytes_(TokenInformationLength) PVOID TokenInformation,
-  _In_ ULONG TokenInformationLength);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAdjustGroupsToken(
-  _In_ HANDLE TokenHandle,
-  _In_ BOOLEAN ResetToDefault,
-  _In_opt_ PTOKEN_GROUPS NewState,
-  _In_opt_ ULONG BufferLength,
-  _Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PTOKEN_GROUPS PreviousState,
-  _Out_ PULONG ReturnLength);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtPrivilegeCheck(
-  _In_ HANDLE ClientToken,
-  _Inout_ PPRIVILEGE_SET RequiredPrivileges,
-  _Out_ PBOOLEAN Result);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAccessCheckAndAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_ PUNICODE_STRING ObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ PGENERIC_MAPPING GenericMapping,
-  _In_ BOOLEAN ObjectCreation,
-  _Out_ PACCESS_MASK GrantedAccess,
-  _Out_ PNTSTATUS AccessStatus,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAccessCheckByTypeAndAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_ PUNICODE_STRING ObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSID PrincipalSelfSid,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ AUDIT_EVENT_TYPE AuditType,
-  _In_ ULONG Flags,
-  _In_reads_opt_(ObjectTypeLength) POBJECT_TYPE_LIST ObjectTypeList,
-  _In_ ULONG ObjectTypeLength,
-  _In_ PGENERIC_MAPPING GenericMapping,
-  _In_ BOOLEAN ObjectCreation,
-  _Out_ PACCESS_MASK GrantedAccess,
-  _Out_ PNTSTATUS AccessStatus,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAccessCheckByTypeResultListAndAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_ PUNICODE_STRING ObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSID PrincipalSelfSid,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ AUDIT_EVENT_TYPE AuditType,
-  _In_ ULONG Flags,
-  _In_reads_opt_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
-  _In_ ULONG ObjectTypeListLength,
-  _In_ PGENERIC_MAPPING GenericMapping,
-  _In_ BOOLEAN ObjectCreation,
-  _Out_writes_(ObjectTypeListLength) PACCESS_MASK GrantedAccess,
-  _Out_writes_(ObjectTypeListLength) PNTSTATUS AccessStatus,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAccessCheckByTypeResultListAndAuditAlarmByHandle(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ HANDLE ClientToken,
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_ PUNICODE_STRING ObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSID PrincipalSelfSid,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ AUDIT_EVENT_TYPE AuditType,
-  _In_ ULONG Flags,
-  _In_reads_opt_(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList,
-  _In_ ULONG ObjectTypeListLength,
-  _In_ PGENERIC_MAPPING GenericMapping,
-  _In_ BOOLEAN ObjectCreation,
-  _Out_writes_(ObjectTypeListLength) PACCESS_MASK GrantedAccess,
-  _Out_writes_(ObjectTypeListLength) PNTSTATUS AccessStatus,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtOpenObjectAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_ PUNICODE_STRING ObjectName,
-  _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ HANDLE ClientToken,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ ACCESS_MASK GrantedAccess,
-  _In_opt_ PPRIVILEGE_SET Privileges,
-  _In_ BOOLEAN ObjectCreation,
-  _In_ BOOLEAN AccessGranted,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtPrivilegeObjectAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ HANDLE ClientToken,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ PPRIVILEGE_SET Privileges,
-  _In_ BOOLEAN AccessGranted);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtCloseObjectAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ BOOLEAN GenerateOnClose);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtDeleteObjectAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_opt_ PVOID HandleId,
-  _In_ BOOLEAN GenerateOnClose);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtPrivilegedServiceAuditAlarm(
-  _In_ PUNICODE_STRING SubsystemName,
-  _In_ PUNICODE_STRING ServiceName,
-  _In_ HANDLE ClientToken,
-  _In_ PPRIVILEGE_SET Privileges,
-  _In_ BOOLEAN AccessGranted);
-
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtSetInformationThread(
-  _In_ HANDLE ThreadHandle,
-  _In_ THREADINFOCLASS ThreadInformationClass,
-  _In_reads_bytes_(ThreadInformationLength) PVOID ThreadInformation,
-  _In_ ULONG ThreadInformationLength);
-
-_Must_inspect_result_
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtCreateSection(
-  _Out_ PHANDLE SectionHandle,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_opt_ PLARGE_INTEGER MaximumSize,
-  _In_ ULONG SectionPageProtection,
-  _In_ ULONG AllocationAttributes,
-  _In_opt_ HANDLE FileHandle);
-
-#endif
-
-#define COMPRESSION_FORMAT_NONE         (0x0000)
-#define COMPRESSION_FORMAT_DEFAULT      (0x0001)
-#define COMPRESSION_FORMAT_LZNT1        (0x0002)
-#define COMPRESSION_ENGINE_STANDARD     (0x0000)
-#define COMPRESSION_ENGINE_MAXIMUM      (0x0100)
-#define COMPRESSION_ENGINE_HIBER        (0x0200)
-
-#define MAX_UNICODE_STACK_BUFFER_LENGTH 256
-
-#define METHOD_FROM_CTL_CODE(ctrlCode)  ((ULONG)(ctrlCode & 3))
-
-#define METHOD_DIRECT_TO_HARDWARE       METHOD_IN_DIRECT
-#define METHOD_DIRECT_FROM_HARDWARE     METHOD_OUT_DIRECT
-
-typedef ULONG LSA_OPERATIONAL_MODE, *PLSA_OPERATIONAL_MODE;
-
-typedef enum _SECURITY_LOGON_TYPE {
-  UndefinedLogonType = 0,
-  Interactive = 2,
-  Network,
-  Batch,
-  Service,
-  Proxy,
-  Unlock,
-  NetworkCleartext,
-  NewCredentials,
-#if (_WIN32_WINNT >= 0x0501)
-  RemoteInteractive,
-  CachedInteractive,
-#endif
-#if (_WIN32_WINNT >= 0x0502)
-  CachedRemoteInteractive,
-  CachedUnlock
-#endif
-} SECURITY_LOGON_TYPE, *PSECURITY_LOGON_TYPE;
-
-#ifndef _NTLSA_AUDIT_
-#define _NTLSA_AUDIT_
-
-#ifndef GUID_DEFINED
-#include <guiddef.h>
-#endif
-
-#endif /* _NTLSA_AUDIT_ */
-
-_IRQL_requires_same_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-LsaRegisterLogonProcess(
-  _In_ PLSA_STRING LogonProcessName,
-  _Out_ PHANDLE LsaHandle,
-  _Out_ PLSA_OPERATIONAL_MODE SecurityMode);
-
-_IRQL_requires_same_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-LsaLogonUser(
-  _In_ HANDLE LsaHandle,
-  _In_ PLSA_STRING OriginName,
-  _In_ SECURITY_LOGON_TYPE LogonType,
-  _In_ ULONG AuthenticationPackage,
-  _In_reads_bytes_(AuthenticationInformationLength) PVOID AuthenticationInformation,
-  _In_ ULONG AuthenticationInformationLength,
-  _In_opt_ PTOKEN_GROUPS LocalGroups,
-  _In_ PTOKEN_SOURCE SourceContext,
-  _Out_ PVOID *ProfileBuffer,
-  _Out_ PULONG ProfileBufferLength,
-  _Inout_ PLUID LogonId,
-  _Out_ PHANDLE Token,
-  _Out_ PQUOTA_LIMITS Quotas,
-  _Out_ PNTSTATUS SubStatus);
-
-_IRQL_requires_same_
-NTSTATUS
-NTAPI
-LsaFreeReturnBuffer(
-  _In_ PVOID Buffer);
-
-#ifndef _NTLSA_IFS_
-#define _NTLSA_IFS_
-#endif
-
-#define MSV1_0_PACKAGE_NAME     "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"
-#define MSV1_0_PACKAGE_NAMEW    L"MICROSOFT_AUTHENTICATION_PACKAGE_V1_0"
-#define MSV1_0_PACKAGE_NAMEW_LENGTH sizeof(MSV1_0_PACKAGE_NAMEW) - sizeof(WCHAR)
-
-#define MSV1_0_SUBAUTHENTICATION_KEY "SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0"
-#define MSV1_0_SUBAUTHENTICATION_VALUE "Auth"
-
-#define MSV1_0_CHALLENGE_LENGTH                8
-#define MSV1_0_USER_SESSION_KEY_LENGTH         16
-#define MSV1_0_LANMAN_SESSION_KEY_LENGTH       8
-
-#define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED      0x02
-#define MSV1_0_UPDATE_LOGON_STATISTICS         0x04
-#define MSV1_0_RETURN_USER_PARAMETERS          0x08
-#define MSV1_0_DONT_TRY_GUEST_ACCOUNT          0x10
-#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT      0x20
-#define MSV1_0_RETURN_PASSWORD_EXPIRY          0x40
-#define MSV1_0_USE_CLIENT_CHALLENGE            0x80
-#define MSV1_0_TRY_GUEST_ACCOUNT_ONLY          0x100
-#define MSV1_0_RETURN_PROFILE_PATH             0x200
-#define MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY       0x400
-#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x800
-
-#define MSV1_0_DISABLE_PERSONAL_FALLBACK     0x00001000
-#define MSV1_0_ALLOW_FORCE_GUEST             0x00002000
-
-#if (_WIN32_WINNT >= 0x0502)
-#define MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED   0x00004000
-#define MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY   0x00008000
-#endif
-
-#define MSV1_0_SUBAUTHENTICATION_DLL_EX      0x00100000
-#define MSV1_0_ALLOW_MSVCHAPV2               0x00010000
-
-#if (_WIN32_WINNT >= 0x0600)
-#define MSV1_0_S4U2SELF                      0x00020000
-#define MSV1_0_CHECK_LOGONHOURS_FOR_S4U      0x00040000
-#endif
-
-#define MSV1_0_SUBAUTHENTICATION_DLL         0xFF000000
-#define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT   24
-#define MSV1_0_MNS_LOGON                     0x01000000
-
-#define MSV1_0_SUBAUTHENTICATION_DLL_RAS     2
-#define MSV1_0_SUBAUTHENTICATION_DLL_IIS     132
-
-#define LOGON_GUEST                 0x01
-#define LOGON_NOENCRYPTION          0x02
-#define LOGON_CACHED_ACCOUNT        0x04
-#define LOGON_USED_LM_PASSWORD      0x08
-#define LOGON_EXTRA_SIDS            0x20
-#define LOGON_SUBAUTH_SESSION_KEY   0x40
-#define LOGON_SERVER_TRUST_ACCOUNT  0x80
-#define LOGON_NTLMV2_ENABLED        0x100
-#define LOGON_RESOURCE_GROUPS       0x200
-#define LOGON_PROFILE_PATH_RETURNED 0x400
-#define LOGON_NT_V2                 0x800
-#define LOGON_LM_V2                 0x1000
-#define LOGON_NTLM_V2               0x2000
-
-#if (_WIN32_WINNT >= 0x0600)
-
-#define LOGON_OPTIMIZED             0x4000
-#define LOGON_WINLOGON              0x8000
-#define LOGON_PKINIT               0x10000
-#define LOGON_NO_OPTIMIZED         0x20000
-
-#endif
-
-#define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000
-
-#define LOGON_GRACE_LOGON              0x01000000
-
-#define MSV1_0_OWF_PASSWORD_LENGTH 16
-#define MSV1_0_CRED_LM_PRESENT 0x1
-#define MSV1_0_CRED_NT_PRESENT 0x2
-#define MSV1_0_CRED_VERSION 0
-
-#define MSV1_0_NTLM3_RESPONSE_LENGTH 16
-#define MSV1_0_NTLM3_OWF_LENGTH 16
-
-#if (_WIN32_WINNT == 0x0500)
-#define MSV1_0_MAX_NTLM3_LIFE 1800
-#else
-#define MSV1_0_MAX_NTLM3_LIFE 129600
-#endif
-#define MSV1_0_MAX_AVL_SIZE 64000
-
-#if (_WIN32_WINNT >= 0x0501)
-
-#define MSV1_0_AV_FLAG_FORCE_GUEST                  0x00000001
-
-#if (_WIN32_WINNT >= 0x0600)
-#define MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES       0x00000002
-#endif
-
-#endif
-
-#define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_RESPONSE_LENGTH)
-
-#if(_WIN32_WINNT >= 0x0502)
-#define MSV1_0_NTLM3_MIN_NT_RESPONSE_LENGTH RTL_SIZEOF_THROUGH_FIELD(MSV1_0_NTLM3_RESPONSE, AvPairsOff)
-#endif
-
-#define USE_PRIMARY_PASSWORD            0x01
-#define RETURN_PRIMARY_USERNAME         0x02
-#define RETURN_PRIMARY_LOGON_DOMAINNAME 0x04
-#define RETURN_NON_NT_USER_SESSION_KEY  0x08
-#define GENERATE_CLIENT_CHALLENGE       0x10
-#define GCR_NTLM3_PARMS                 0x20
-#define GCR_TARGET_INFO                 0x40
-#define RETURN_RESERVED_PARAMETER       0x80
-#define GCR_ALLOW_NTLM                 0x100
-#define GCR_USE_OEM_SET                0x200
-#define GCR_MACHINE_CREDENTIAL         0x400
-#define GCR_USE_OWF_PASSWORD           0x800
-#define GCR_ALLOW_LM                  0x1000
-#define GCR_ALLOW_NO_TARGET           0x2000
-
-typedef enum _MSV1_0_LOGON_SUBMIT_TYPE {
-  MsV1_0InteractiveLogon = 2,
-  MsV1_0Lm20Logon,
-  MsV1_0NetworkLogon,
-  MsV1_0SubAuthLogon,
-  MsV1_0WorkstationUnlockLogon = 7,
-  MsV1_0S4ULogon = 12,
-  MsV1_0VirtualLogon = 82
-} MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE;
-
-typedef enum _MSV1_0_PROFILE_BUFFER_TYPE {
-  MsV1_0InteractiveProfile = 2,
-  MsV1_0Lm20LogonProfile,
-  MsV1_0SmartCardProfile
-} MSV1_0_PROFILE_BUFFER_TYPE, *PMSV1_0_PROFILE_BUFFER_TYPE;
-
-typedef struct _MSV1_0_INTERACTIVE_LOGON {
-  MSV1_0_LOGON_SUBMIT_TYPE MessageType;
-  UNICODE_STRING LogonDomainName;
-  UNICODE_STRING UserName;
-  UNICODE_STRING Password;
-} MSV1_0_INTERACTIVE_LOGON, *PMSV1_0_INTERACTIVE_LOGON;
-
-typedef struct _MSV1_0_INTERACTIVE_PROFILE {
-  MSV1_0_PROFILE_BUFFER_TYPE MessageType;
-  USHORT LogonCount;
-  USHORT BadPasswordCount;
-  LARGE_INTEGER LogonTime;
-  LARGE_INTEGER LogoffTime;
-  LARGE_INTEGER KickOffTime;
-  LARGE_INTEGER PasswordLastSet;
-  LARGE_INTEGER PasswordCanChange;
-  LARGE_INTEGER PasswordMustChange;
-  UNICODE_STRING LogonScript;
-  UNICODE_STRING HomeDirectory;
-  UNICODE_STRING FullName;
-  UNICODE_STRING ProfilePath;
-  UNICODE_STRING HomeDirectoryDrive;
-  UNICODE_STRING LogonServer;
-  ULONG UserFlags;
-} MSV1_0_INTERACTIVE_PROFILE, *PMSV1_0_INTERACTIVE_PROFILE;
-
-typedef struct _MSV1_0_LM20_LOGON {
-  MSV1_0_LOGON_SUBMIT_TYPE MessageType;
-  UNICODE_STRING LogonDomainName;
-  UNICODE_STRING UserName;
-  UNICODE_STRING Workstation;
-  UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
-  STRING CaseSensitiveChallengeResponse;
-  STRING CaseInsensitiveChallengeResponse;
-  ULONG ParameterControl;
-} MSV1_0_LM20_LOGON, * PMSV1_0_LM20_LOGON;
-
-typedef struct _MSV1_0_SUBAUTH_LOGON {
-  MSV1_0_LOGON_SUBMIT_TYPE MessageType;
-  UNICODE_STRING LogonDomainName;
-  UNICODE_STRING UserName;
-  UNICODE_STRING Workstation;
-  UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
-  STRING AuthenticationInfo1;
-  STRING AuthenticationInfo2;
-  ULONG ParameterControl;
-  ULONG SubAuthPackageId;
-} MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON;
-
-#if (_WIN32_WINNT >= 0x0600)
-
-#define MSV1_0_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2
-
-typedef struct _MSV1_0_S4U_LOGON {
-  MSV1_0_LOGON_SUBMIT_TYPE MessageType;
-  ULONG Flags;
-  UNICODE_STRING UserPrincipalName;
-  UNICODE_STRING DomainName;
-} MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON;
-
-#endif
-
-typedef struct _MSV1_0_LM20_LOGON_PROFILE {
-  MSV1_0_PROFILE_BUFFER_TYPE MessageType;
-  LARGE_INTEGER KickOffTime;
-  LARGE_INTEGER LogoffTime;
-  ULONG UserFlags;
-  UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
-  UNICODE_STRING LogonDomainName;
-  UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
-  UNICODE_STRING LogonServer;
-  UNICODE_STRING UserParameters;
-} MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE;
-
-typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL {
-  ULONG Version;
-  ULONG Flags;
-  UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH];
-  UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH];
-} MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
-
-typedef struct _MSV1_0_NTLM3_RESPONSE {
-  UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH];
-  UCHAR RespType;
-  UCHAR HiRespType;
-  USHORT Flags;
-  ULONG MsgWord;
-  ULONGLONG TimeStamp;
-  UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH];
-  ULONG AvPairsOff;
-  UCHAR Buffer[1];
-} MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE;
-
-typedef enum _MSV1_0_AVID {
-  MsvAvEOL,
-  MsvAvNbComputerName,
-  MsvAvNbDomainName,
-  MsvAvDnsComputerName,
-  MsvAvDnsDomainName,
-#if (_WIN32_WINNT >= 0x0501)
-  MsvAvDnsTreeName,
-  MsvAvFlags,
-#if (_WIN32_WINNT >= 0x0600)
-  MsvAvTimestamp,
-  MsvAvRestrictions,
-  MsvAvTargetName,
-  MsvAvChannelBindings,
-#endif
-#endif
-} MSV1_0_AVID;
-
-typedef struct _MSV1_0_AV_PAIR {
-  USHORT AvId;
-  USHORT AvLen;
-} MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR;
-
-typedef enum _MSV1_0_PROTOCOL_MESSAGE_TYPE {
-  MsV1_0Lm20ChallengeRequest = 0,
-  MsV1_0Lm20GetChallengeResponse,
-  MsV1_0EnumerateUsers,
-  MsV1_0GetUserInfo,
-  MsV1_0ReLogonUsers,
-  MsV1_0ChangePassword,
-  MsV1_0ChangeCachedPassword,
-  MsV1_0GenericPassthrough,
-  MsV1_0CacheLogon,
-  MsV1_0SubAuth,
-  MsV1_0DeriveCredential,
-  MsV1_0CacheLookup,
-#if (_WIN32_WINNT >= 0x0501)
-  MsV1_0SetProcessOption,
-#endif
-#if (_WIN32_WINNT >= 0x0600)
-  MsV1_0ConfigLocalAliases,
-  MsV1_0ClearCachedCredentials,
-#endif
-} MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE;
-
-typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-} MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST;
-
-typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
-} MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE;
-
-typedef struct _MSV1_0_GETCHALLENRESP_REQUEST_V1 {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  ULONG ParameterControl;
-  LUID LogonId;
-  UNICODE_STRING Password;
-  UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
-} MSV1_0_GETCHALLENRESP_REQUEST_V1, *PMSV1_0_GETCHALLENRESP_REQUEST_V1;
-
-typedef struct _MSV1_0_GETCHALLENRESP_REQUEST {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  ULONG ParameterControl;
-  LUID LogonId;
-  UNICODE_STRING Password;
-  UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH];
-  UNICODE_STRING UserName;
-  UNICODE_STRING LogonDomainName;
-  UNICODE_STRING ServerName;
-} MSV1_0_GETCHALLENRESP_REQUEST, *PMSV1_0_GETCHALLENRESP_REQUEST;
-
-typedef struct _MSV1_0_GETCHALLENRESP_RESPONSE {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  STRING CaseSensitiveChallengeResponse;
-  STRING CaseInsensitiveChallengeResponse;
-  UNICODE_STRING UserName;
-  UNICODE_STRING LogonDomainName;
-  UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH];
-  UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH];
-} MSV1_0_GETCHALLENRESP_RESPONSE, *PMSV1_0_GETCHALLENRESP_RESPONSE;
-
-typedef struct _MSV1_0_ENUMUSERS_REQUEST {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-} MSV1_0_ENUMUSERS_REQUEST, *PMSV1_0_ENUMUSERS_REQUEST;
-
-typedef struct _MSV1_0_ENUMUSERS_RESPONSE {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  ULONG NumberOfLoggedOnUsers;
-  PLUID LogonIds;
-  PULONG EnumHandles;
-} MSV1_0_ENUMUSERS_RESPONSE, *PMSV1_0_ENUMUSERS_RESPONSE;
-
-typedef struct _MSV1_0_GETUSERINFO_REQUEST {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  LUID LogonId;
-} MSV1_0_GETUSERINFO_REQUEST, *PMSV1_0_GETUSERINFO_REQUEST;
-
-typedef struct _MSV1_0_GETUSERINFO_RESPONSE {
-  MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType;
-  PSID UserSid;
-  UNICODE_STRING UserName;
-  UNICODE_STRING LogonDomainName;
-  UNICODE_STRING LogonServer;
-  SECURITY_LOGON_TYPE LogonType;
-} MSV1_0_GETUSERINFO_RESPONSE, *PMSV1_0_GETUSERINFO_RESPONSE;
-
-
-
-#define FILE_OPLOCK_BROKEN_TO_LEVEL_2   0x00000007
-#define FILE_OPLOCK_BROKEN_TO_NONE      0x00000008
-#define FILE_OPBATCH_BREAK_UNDERWAY     0x00000009
-
-/* also in winnt.h */
-#define FILE_NOTIFY_CHANGE_FILE_NAME    0x00000001
-#define FILE_NOTIFY_CHANGE_DIR_NAME     0x00000002
-#define FILE_NOTIFY_CHANGE_NAME         0x00000003
-#define FILE_NOTIFY_CHANGE_ATTRIBUTES   0x00000004
-#define FILE_NOTIFY_CHANGE_SIZE         0x00000008
-#define FILE_NOTIFY_CHANGE_LAST_WRITE   0x00000010
-#define FILE_NOTIFY_CHANGE_LAST_ACCESS  0x00000020
-#define FILE_NOTIFY_CHANGE_CREATION     0x00000040
-#define FILE_NOTIFY_CHANGE_EA           0x00000080
-#define FILE_NOTIFY_CHANGE_SECURITY     0x00000100
-#define FILE_NOTIFY_CHANGE_STREAM_NAME  0x00000200
-#define FILE_NOTIFY_CHANGE_STREAM_SIZE  0x00000400
-#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
-#define FILE_NOTIFY_VALID_MASK          0x00000fff
-
-#define FILE_ACTION_ADDED                   0x00000001
-#define FILE_ACTION_REMOVED                 0x00000002
-#define FILE_ACTION_MODIFIED                0x00000003
-#define FILE_ACTION_RENAMED_OLD_NAME        0x00000004
-#define FILE_ACTION_RENAMED_NEW_NAME        0x00000005
-#define FILE_ACTION_ADDED_STREAM            0x00000006
-#define FILE_ACTION_REMOVED_STREAM          0x00000007
-#define FILE_ACTION_MODIFIED_STREAM         0x00000008
-#define FILE_ACTION_REMOVED_BY_DELETE       0x00000009
-#define FILE_ACTION_ID_NOT_TUNNELLED        0x0000000A
-#define FILE_ACTION_TUNNELLED_ID_COLLISION  0x0000000B
-/* end  winnt.h */
-
-#define FILE_PIPE_BYTE_STREAM_TYPE          0x00000000
-#define FILE_PIPE_MESSAGE_TYPE              0x00000001
-
-#define FILE_PIPE_ACCEPT_REMOTE_CLIENTS     0x00000000
-#define FILE_PIPE_REJECT_REMOTE_CLIENTS     0x00000002
-
-#define FILE_PIPE_ACCEPT_REMOTE_CLIENTS     0x00000000
-#define FILE_PIPE_REJECT_REMOTE_CLIENTS     0x00000002
-#define FILE_PIPE_TYPE_VALID_MASK           0x00000003
-
-#define FILE_PIPE_BYTE_STREAM_MODE          0x00000000
-#define FILE_PIPE_MESSAGE_MODE              0x00000001
-
-#define FILE_PIPE_QUEUE_OPERATION           0x00000000
-#define FILE_PIPE_COMPLETE_OPERATION        0x00000001
-
-#define FILE_PIPE_INBOUND                   0x00000000
-#define FILE_PIPE_OUTBOUND                  0x00000001
-#define FILE_PIPE_FULL_DUPLEX               0x00000002
-
-#define FILE_PIPE_DISCONNECTED_STATE        0x00000001
-#define FILE_PIPE_LISTENING_STATE           0x00000002
-#define FILE_PIPE_CONNECTED_STATE           0x00000003
-#define FILE_PIPE_CLOSING_STATE             0x00000004
-
-#define FILE_PIPE_CLIENT_END                0x00000000
-#define FILE_PIPE_SERVER_END                0x00000001
-
-#define FILE_CASE_SENSITIVE_SEARCH          0x00000001
-#define FILE_CASE_PRESERVED_NAMES           0x00000002
-#define FILE_UNICODE_ON_DISK                0x00000004
-#define FILE_PERSISTENT_ACLS                0x00000008
-#define FILE_FILE_COMPRESSION               0x00000010
-#define FILE_VOLUME_QUOTAS                  0x00000020
-#define FILE_SUPPORTS_SPARSE_FILES          0x00000040
-#define FILE_SUPPORTS_REPARSE_POINTS        0x00000080
-#define FILE_SUPPORTS_REMOTE_STORAGE        0x00000100
-#define FILE_VOLUME_IS_COMPRESSED           0x00008000
-#define FILE_SUPPORTS_OBJECT_IDS            0x00010000
-#define FILE_SUPPORTS_ENCRYPTION            0x00020000
-#define FILE_NAMED_STREAMS                  0x00040000
-#define FILE_READ_ONLY_VOLUME               0x00080000
-#define FILE_SEQUENTIAL_WRITE_ONCE          0x00100000
-#define FILE_SUPPORTS_TRANSACTIONS          0x00200000
-#define FILE_SUPPORTS_HARD_LINKS            0x00400000
-#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES   0x00800000
-#define FILE_SUPPORTS_OPEN_BY_FILE_ID       0x01000000
-#define FILE_SUPPORTS_USN_JOURNAL           0x02000000
-
-#define FILE_NEED_EA                    0x00000080
-
-#define FILE_EA_TYPE_BINARY             0xfffe
-#define FILE_EA_TYPE_ASCII              0xfffd
-#define FILE_EA_TYPE_BITMAP             0xfffb
-#define FILE_EA_TYPE_METAFILE           0xfffa
-#define FILE_EA_TYPE_ICON               0xfff9
-#define FILE_EA_TYPE_EA                 0xffee
-#define FILE_EA_TYPE_MVMT               0xffdf
-#define FILE_EA_TYPE_MVST               0xffde
-#define FILE_EA_TYPE_ASN1               0xffdd
-#define FILE_EA_TYPE_FAMILY_IDS         0xff01
-
-typedef struct _FILE_NOTIFY_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG Action;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_NOTIFY_INFORMATION, *PFILE_NOTIFY_INFORMATION;
-
-typedef struct _FILE_DIRECTORY_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  LARGE_INTEGER CreationTime;
-  LARGE_INTEGER LastAccessTime;
-  LARGE_INTEGER LastWriteTime;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER EndOfFile;
-  LARGE_INTEGER AllocationSize;
-  ULONG FileAttributes;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION;
-
-typedef struct _FILE_FULL_DIR_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  LARGE_INTEGER CreationTime;
-  LARGE_INTEGER LastAccessTime;
-  LARGE_INTEGER LastWriteTime;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER EndOfFile;
-  LARGE_INTEGER AllocationSize;
-  ULONG FileAttributes;
-  ULONG FileNameLength;
-  ULONG EaSize;
-  WCHAR FileName[1];
-} FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION;
-
-typedef struct _FILE_ID_FULL_DIR_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  LARGE_INTEGER CreationTime;
-  LARGE_INTEGER LastAccessTime;
-  LARGE_INTEGER LastWriteTime;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER EndOfFile;
-  LARGE_INTEGER AllocationSize;
-  ULONG FileAttributes;
-  ULONG FileNameLength;
-  ULONG EaSize;
-  LARGE_INTEGER FileId;
-  WCHAR FileName[1];
-} FILE_ID_FULL_DIR_INFORMATION, *PFILE_ID_FULL_DIR_INFORMATION;
-
-typedef struct _FILE_BOTH_DIR_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  LARGE_INTEGER CreationTime;
-  LARGE_INTEGER LastAccessTime;
-  LARGE_INTEGER LastWriteTime;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER EndOfFile;
-  LARGE_INTEGER AllocationSize;
-  ULONG FileAttributes;
-  ULONG FileNameLength;
-  ULONG EaSize;
-  CCHAR ShortNameLength;
-  WCHAR ShortName[12];
-  WCHAR FileName[1];
-} FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION;
-
-typedef struct _FILE_ID_BOTH_DIR_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  LARGE_INTEGER CreationTime;
-  LARGE_INTEGER LastAccessTime;
-  LARGE_INTEGER LastWriteTime;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER EndOfFile;
-  LARGE_INTEGER AllocationSize;
-  ULONG FileAttributes;
-  ULONG FileNameLength;
-  ULONG EaSize;
-  CCHAR ShortNameLength;
-  WCHAR ShortName[12];
-  LARGE_INTEGER FileId;
-  WCHAR FileName[1];
-} FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION;
-
-typedef struct _FILE_NAMES_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION;
-
-typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  LARGE_INTEGER CreationTime;
-  LARGE_INTEGER LastAccessTime;
-  LARGE_INTEGER LastWriteTime;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER EndOfFile;
-  LARGE_INTEGER AllocationSize;
-  ULONG FileAttributes;
-  ULONG FileNameLength;
-  LARGE_INTEGER FileId;
-  GUID LockingTransactionId;
-  ULONG TxInfoFlags;
-  WCHAR FileName[1];
-} FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION;
-
-#define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_WRITELOCKED         0x00000001
-#define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_VISIBLE_TO_TX       0x00000002
-#define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_VISIBLE_OUTSIDE_TX  0x00000004
-
-typedef struct _FILE_OBJECTID_INFORMATION {
-  LONGLONG FileReference;
-  UCHAR ObjectId[16];
-  _ANONYMOUS_UNION union {
-    _ANONYMOUS_STRUCT struct {
-      UCHAR BirthVolumeId[16];
-      UCHAR BirthObjectId[16];
-      UCHAR DomainId[16];
-    } DUMMYSTRUCTNAME;
-    UCHAR ExtendedInfo[48];
-  } DUMMYUNIONNAME;
-} FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION;
-
-#define ANSI_DOS_STAR                   ('<')
-#define ANSI_DOS_QM                     ('>')
-#define ANSI_DOS_DOT                    ('"')
-
-#define DOS_STAR                        (L'<')
-#define DOS_QM                          (L'>')
-#define DOS_DOT                         (L'"')
-
-typedef struct _FILE_INTERNAL_INFORMATION {
-  LARGE_INTEGER IndexNumber;
-} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION;
-
-typedef struct _FILE_EA_INFORMATION {
-  ULONG EaSize;
-} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;
-
-typedef struct _FILE_ACCESS_INFORMATION {
-  ACCESS_MASK AccessFlags;
-} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION;
-
-typedef struct _FILE_MODE_INFORMATION {
-  ULONG Mode;
-} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION;
-
-typedef struct _FILE_ALL_INFORMATION {
-  FILE_BASIC_INFORMATION BasicInformation;
-  FILE_STANDARD_INFORMATION StandardInformation;
-  FILE_INTERNAL_INFORMATION InternalInformation;
-  FILE_EA_INFORMATION EaInformation;
-  FILE_ACCESS_INFORMATION AccessInformation;
-  FILE_POSITION_INFORMATION PositionInformation;
-  FILE_MODE_INFORMATION ModeInformation;
-  FILE_ALIGNMENT_INFORMATION AlignmentInformation;
-  FILE_NAME_INFORMATION NameInformation;
-} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
-
-typedef struct _FILE_ALLOCATION_INFORMATION {
-  LARGE_INTEGER AllocationSize;
-} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION;
-
-typedef struct _FILE_COMPRESSION_INFORMATION {
-  LARGE_INTEGER CompressedFileSize;
-  USHORT CompressionFormat;
-  UCHAR CompressionUnitShift;
-  UCHAR ChunkShift;
-  UCHAR ClusterShift;
-  UCHAR Reserved[3];
-} FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION;
-
-typedef struct _FILE_LINK_INFORMATION {
-  BOOLEAN ReplaceIfExists;
-  HANDLE RootDirectory;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION;
-
-typedef struct _FILE_MOVE_CLUSTER_INFORMATION {
-  ULONG ClusterCount;
-  HANDLE RootDirectory;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_MOVE_CLUSTER_INFORMATION, *PFILE_MOVE_CLUSTER_INFORMATION;
-
-typedef struct _FILE_RENAME_INFORMATION {
-  BOOLEAN ReplaceIfExists;
-  HANDLE RootDirectory;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION;
-
-typedef struct _FILE_STREAM_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG StreamNameLength;
-  LARGE_INTEGER StreamSize;
-  LARGE_INTEGER StreamAllocationSize;
-  WCHAR StreamName[1];
-} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
-
-typedef struct _FILE_TRACKING_INFORMATION {
-  HANDLE DestinationFile;
-  ULONG ObjectInformationLength;
-  CHAR ObjectInformation[1];
-} FILE_TRACKING_INFORMATION, *PFILE_TRACKING_INFORMATION;
-
-typedef struct _FILE_COMPLETION_INFORMATION {
-  HANDLE Port;
-  PVOID Key;
-} FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION;
-
-typedef struct _FILE_PIPE_INFORMATION {
-  ULONG ReadMode;
-  ULONG CompletionMode;
-} FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION;
-
-typedef struct _FILE_PIPE_LOCAL_INFORMATION {
-  ULONG NamedPipeType;
-  ULONG NamedPipeConfiguration;
-  ULONG MaximumInstances;
-  ULONG CurrentInstances;
-  ULONG InboundQuota;
-  ULONG ReadDataAvailable;
-  ULONG OutboundQuota;
-  ULONG WriteQuotaAvailable;
-  ULONG NamedPipeState;
-  ULONG NamedPipeEnd;
-} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
-
-typedef struct _FILE_PIPE_REMOTE_INFORMATION {
-  LARGE_INTEGER CollectDataTime;
-  ULONG MaximumCollectionCount;
-} FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION;
-
-typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
-  ULONG MaximumMessageSize;
-  ULONG MailslotQuota;
-  ULONG NextMessageSize;
-  ULONG MessagesAvailable;
-  LARGE_INTEGER ReadTimeout;
-} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
-
-typedef struct _FILE_MAILSLOT_SET_INFORMATION {
-  PLARGE_INTEGER ReadTimeout;
-} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
-
-typedef struct _FILE_REPARSE_POINT_INFORMATION {
-  LONGLONG FileReference;
-  ULONG Tag;
-} FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION;
-
-typedef struct _FILE_LINK_ENTRY_INFORMATION {
-  ULONG NextEntryOffset;
-  LONGLONG ParentFileId;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_LINK_ENTRY_INFORMATION, *PFILE_LINK_ENTRY_INFORMATION;
-
-typedef struct _FILE_LINKS_INFORMATION {
-  ULONG BytesNeeded;
-  ULONG EntriesReturned;
-  FILE_LINK_ENTRY_INFORMATION Entry;
-} FILE_LINKS_INFORMATION, *PFILE_LINKS_INFORMATION;
-
-typedef struct _FILE_NETWORK_PHYSICAL_NAME_INFORMATION {
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FILE_NETWORK_PHYSICAL_NAME_INFORMATION, *PFILE_NETWORK_PHYSICAL_NAME_INFORMATION;
-
-typedef struct _FILE_STANDARD_LINK_INFORMATION {
-  ULONG NumberOfAccessibleLinks;
-  ULONG TotalNumberOfLinks;
-  BOOLEAN DeletePending;
-  BOOLEAN Directory;
-} FILE_STANDARD_LINK_INFORMATION, *PFILE_STANDARD_LINK_INFORMATION;
-
-typedef struct _FILE_GET_EA_INFORMATION {
-  ULONG NextEntryOffset;
-  UCHAR EaNameLength;
-  CHAR  EaName[1];
-} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
-
-#define REMOTE_PROTOCOL_FLAG_LOOPBACK       0x00000001
-#define REMOTE_PROTOCOL_FLAG_OFFLINE        0x00000002
-
-typedef struct _FILE_REMOTE_PROTOCOL_INFORMATION {
-  USHORT StructureVersion;
-  USHORT StructureSize;
-  ULONG  Protocol;
-  USHORT ProtocolMajorVersion;
-  USHORT ProtocolMinorVersion;
-  USHORT ProtocolRevision;
-  USHORT Reserved;
-  ULONG  Flags;
-  struct {
-    ULONG Reserved[8];
-  } GenericReserved;
-  struct {
-    ULONG Reserved[16];
-  } ProtocolSpecificReserved;
-} FILE_REMOTE_PROTOCOL_INFORMATION, *PFILE_REMOTE_PROTOCOL_INFORMATION;
-
-typedef struct _FILE_GET_QUOTA_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG SidLength;
-  SID Sid;
-} FILE_GET_QUOTA_INFORMATION, *PFILE_GET_QUOTA_INFORMATION;
-
-typedef struct _FILE_QUOTA_INFORMATION {
-  ULONG NextEntryOffset;
-  ULONG SidLength;
-  LARGE_INTEGER ChangeTime;
-  LARGE_INTEGER QuotaUsed;
-  LARGE_INTEGER QuotaThreshold;
-  LARGE_INTEGER QuotaLimit;
-  SID Sid;
-} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION;
-
-typedef struct _FILE_FS_ATTRIBUTE_INFORMATION {
-  ULONG FileSystemAttributes;
-  ULONG MaximumComponentNameLength;
-  ULONG FileSystemNameLength;
-  WCHAR FileSystemName[1];
-} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION;
-
-typedef struct _FILE_FS_DRIVER_PATH_INFORMATION {
-  BOOLEAN DriverInPath;
-  ULONG DriverNameLength;
-  WCHAR DriverName[1];
-} FILE_FS_DRIVER_PATH_INFORMATION, *PFILE_FS_DRIVER_PATH_INFORMATION;
-
-typedef struct _FILE_FS_VOLUME_FLAGS_INFORMATION {
-  ULONG Flags;
-} FILE_FS_VOLUME_FLAGS_INFORMATION, *PFILE_FS_VOLUME_FLAGS_INFORMATION;
-
-#define FILE_VC_QUOTA_NONE              0x00000000
-#define FILE_VC_QUOTA_TRACK             0x00000001
-#define FILE_VC_QUOTA_ENFORCE           0x00000002
-#define FILE_VC_QUOTA_MASK              0x00000003
-#define FILE_VC_CONTENT_INDEX_DISABLED  0x00000008
-#define FILE_VC_LOG_QUOTA_THRESHOLD     0x00000010
-#define FILE_VC_LOG_QUOTA_LIMIT         0x00000020
-#define FILE_VC_LOG_VOLUME_THRESHOLD    0x00000040
-#define FILE_VC_LOG_VOLUME_LIMIT        0x00000080
-#define FILE_VC_QUOTAS_INCOMPLETE       0x00000100
-#define FILE_VC_QUOTAS_REBUILDING       0x00000200
-#define FILE_VC_VALID_MASK              0x000003ff
-
-typedef struct _FILE_FS_CONTROL_INFORMATION {
-  LARGE_INTEGER FreeSpaceStartFiltering;
-  LARGE_INTEGER FreeSpaceThreshold;
-  LARGE_INTEGER FreeSpaceStopFiltering;
-  LARGE_INTEGER DefaultQuotaThreshold;
-  LARGE_INTEGER DefaultQuotaLimit;
-  ULONG FileSystemControlFlags;
-} FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION;
-
-#ifndef _FILESYSTEMFSCTL_
-#define _FILESYSTEMFSCTL_
-
-#define FSCTL_REQUEST_OPLOCK_LEVEL_1    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  0, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_OPLOCK_LEVEL_2    CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  1, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_BATCH_OPLOCK      CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  2, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE  CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  3, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  4, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OPLOCK_BREAK_NOTIFY       CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  5, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_LOCK_VOLUME               CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  6, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_UNLOCK_VOLUME             CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  7, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DISMOUNT_VOLUME           CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  8, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_IS_VOLUME_MOUNTED         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_IS_PATHNAME_VALID         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_MARK_VOLUME_DIRTY         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_RETRIEVAL_POINTERS  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_GET_COMPRESSION           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_COMPRESSION           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_SET_BOOTLOADER_ACCESSED   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER,  FILE_ANY_ACCESS)
-
-#define FSCTL_OPLOCK_BREAK_ACK_NO_2     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_INVALIDATE_VOLUMES        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_FAT_BPB             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_FILTER_OPLOCK     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#if (_WIN32_WINNT >= 0x0400)
-
-#define FSCTL_GET_NTFS_VOLUME_DATA      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_NTFS_FILE_RECORD      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_VOLUME_BITMAP         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_GET_RETRIEVAL_POINTERS    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_MOVE_FILE                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_IS_VOLUME_DIRTY           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_ALLOW_EXTENDED_DASD_IO    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER,  FILE_ANY_ACCESS)
-
-#endif
-
-#if (_WIN32_WINNT >= 0x0500)
-
-#define FSCTL_FIND_FILES_BY_SID         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_SET_OBJECT_ID             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_GET_OBJECT_ID             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DELETE_OBJECT_ID          CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_SET_REPARSE_POINT         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_GET_REPARSE_POINT         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DELETE_REPARSE_POINT      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_ENUM_USN_DATA             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_SECURITY_ID_CHECK         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER,  FILE_READ_DATA)
-#define FSCTL_READ_USN_JOURNAL          CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_SET_OBJECT_ID_EXTENDED    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_CREATE_OR_GET_OBJECT_ID   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_SPARSE                CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_SET_ZERO_DATA             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_QUERY_ALLOCATED_RANGES    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER,  FILE_READ_DATA)
-#define FSCTL_ENABLE_UPGRADE            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_SET_ENCRYPTION            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_ENCRYPTION_FSCTL_IO       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_WRITE_RAW_ENCRYPTED       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER,  FILE_SPECIAL_ACCESS)
-#define FSCTL_READ_RAW_ENCRYPTED        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER,  FILE_SPECIAL_ACCESS)
-#define FSCTL_CREATE_USN_JOURNAL        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_READ_FILE_USN_DATA        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_WRITE_USN_CLOSE_RECORD    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_EXTEND_VOLUME             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_USN_JOURNAL         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DELETE_USN_JOURNAL        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_MARK_HANDLE               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SIS_COPYFILE              CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SIS_LINK_FILES            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_RECALL_FILE               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
-#define FSCTL_READ_FROM_PLEX            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
-#define FSCTL_FILE_PREFETCH             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-
-#endif
-
-#if (_WIN32_WINNT >= 0x0600)
-
-#define FSCTL_MAKE_MEDIA_COMPATIBLE         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 76, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_SET_DEFECT_MANAGEMENT         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 77, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_QUERY_SPARING_INFO            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 78, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_ON_DISK_VOLUME_INFO     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 79, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_VOLUME_COMPRESSION_STATE  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 80, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_TXFS_MODIFY_RM                CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 81, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_QUERY_RM_INFORMATION     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 82, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_TXFS_ROLLFORWARD_REDO         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 84, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_ROLLFORWARD_UNDO         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 85, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_START_RM                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 86, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_SHUTDOWN_RM              CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 87, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_READ_BACKUP_INFORMATION  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 88, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 89, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_CREATE_SECONDARY_RM      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 90, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_GET_METADATA_INFO        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 91, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_TXFS_GET_TRANSACTED_VERSION   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 92, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_TXFS_SAVEPOINT_INFORMATION    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 94, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_CREATE_MINIVERSION       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 95, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_TXFS_TRANSACTION_ACTIVE       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 99, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_SET_ZERO_ON_DEALLOCATION      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 101, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_SET_REPAIR                    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_REPAIR                    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_WAIT_FOR_REPAIR               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_INITIATE_REPAIR               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSC_INTERNAL                  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 107, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_SHRINK_VOLUME                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 108, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
-#define FSCTL_SET_SHORT_NAME_BEHAVIOR       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 109, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DFSR_SET_GHOST_HANDLE_STATE   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 110, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES \
-                                            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_TXFS_LIST_TRANSACTIONS        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 121, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_QUERY_PAGEFILE_ENCRYPTION     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 122, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_RESET_VOLUME_ALLOCATION_HINTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 123, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_TXFS_READ_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 126, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#endif
-
-#if (_WIN32_WINNT >= 0x0601)
-
-#define FSCTL_QUERY_DEPENDENT_VOLUME        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 124, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SD_GLOBAL_CHANGE              CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 125, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_LOOKUP_STREAM_FROM_CLUSTER    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 127, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 128, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_FILE_TYPE_NOTIFICATION        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 129, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_BOOT_AREA_INFO            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 140, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_RETRIEVAL_POINTER_BASE    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 141, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_PERSISTENT_VOLUME_STATE   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 143, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REQUEST_OPLOCK                CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 144, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_TUNNEL_REQUEST            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 145, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_IS_CSV_FILE                   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 146, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_FILE_SYSTEM_RECOGNITION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 147, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_GET_VOLUME_PATH_NAME      CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 148, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 149, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 150,  METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_IS_FILE_ON_CSV_VOLUME         CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 151,  METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_INTERNAL                  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 155,  METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-typedef struct _CSV_NAMESPACE_INFO {
-  ULONG Version;
-  ULONG DeviceNumber;
-  LARGE_INTEGER StartingOffset;
-  ULONG SectorSize;
-} CSV_NAMESPACE_INFO, *PCSV_NAMESPACE_INFO;
-
-#define CSV_NAMESPACE_INFO_V1 (sizeof(CSV_NAMESPACE_INFO))
-#define CSV_INVALID_DEVICE_NUMBER 0xFFFFFFFF
-
-#endif
-
-#if (_WIN32_WINNT >= 0x0602)
-
-#define FSCTL_FILE_LEVEL_TRIM               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 130, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_CORRUPTION_HANDLING           CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 152, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_OFFLOAD_READ                  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 153, METHOD_BUFFERED, FILE_READ_ACCESS)
-#define FSCTL_OFFLOAD_WRITE                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 154, METHOD_BUFFERED, FILE_WRITE_ACCESS)
-#define FSCTL_SET_PURGE_FAILURE_MODE        CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 156, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_QUERY_FILE_LAYOUT             CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 157, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_IS_VOLUME_OWNED_BYCSVFS       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 158, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_INTEGRITY_INFORMATION     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 159, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_SET_INTEGRITY_INFORMATION     CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 160, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_QUERY_FILE_REGIONS            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 161, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DEDUP_FILE                    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 165, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_DEDUP_QUERY_FILE_HASHES       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 166, METHOD_NEITHER,  FILE_READ_DATA)
-#define FSCTL_RKF_INTERNAL                  CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 171, METHOD_NEITHER,  FILE_ANY_ACCESS)
-#define FSCTL_SCRUB_DATA                    CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 172, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_REPAIR_COPIES                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 173, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_DISABLE_LOCAL_BUFFERING       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 174, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_MGMT_LOCK                 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 175, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_QUERY_DOWN_LEVEL_FILE_SYSTEM_CHARACTERISTICS \
-                                            CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 176, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_ADVANCE_FILE_ID               CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 177, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_SYNC_TUNNEL_REQUEST       CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 178, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_QUERY_VETO_FILE_DIRECT_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 179, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_WRITE_USN_REASON              CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 180, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_CSV_CONTROL                   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 181, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_GET_REFS_VOLUME_DATA          CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 182, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-#endif
-
-#define FSCTL_MARK_AS_SYSTEM_HIVE           FSCTL_SET_BOOTLOADER_ACCESSED
-
-typedef struct _PATHNAME_BUFFER {
-  ULONG PathNameLength;
-  WCHAR Name[1];
-} PATHNAME_BUFFER, *PPATHNAME_BUFFER;
-
-typedef struct _FSCTL_QUERY_FAT_BPB_BUFFER {
-  UCHAR First0x24BytesOfBootSector[0x24];
-} FSCTL_QUERY_FAT_BPB_BUFFER, *PFSCTL_QUERY_FAT_BPB_BUFFER;
-
-#if (_WIN32_WINNT >= 0x0400)
-
-typedef struct _NTFS_VOLUME_DATA_BUFFER {
-  LARGE_INTEGER VolumeSerialNumber;
-  LARGE_INTEGER NumberSectors;
-  LARGE_INTEGER TotalClusters;
-  LARGE_INTEGER FreeClusters;
-  LARGE_INTEGER TotalReserved;
-  ULONG BytesPerSector;
-  ULONG BytesPerCluster;
-  ULONG BytesPerFileRecordSegment;
-  ULONG ClustersPerFileRecordSegment;
-  LARGE_INTEGER MftValidDataLength;
-  LARGE_INTEGER MftStartLcn;
-  LARGE_INTEGER Mft2StartLcn;
-  LARGE_INTEGER MftZoneStart;
-  LARGE_INTEGER MftZoneEnd;
-} NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER;
-
-typedef struct _NTFS_EXTENDED_VOLUME_DATA {
-  ULONG ByteCount;
-  USHORT MajorVersion;
-  USHORT MinorVersion;
-} NTFS_EXTENDED_VOLUME_DATA, *PNTFS_EXTENDED_VOLUME_DATA;
-
-typedef struct _STARTING_LCN_INPUT_BUFFER {
-  LARGE_INTEGER StartingLcn;
-} STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER;
-
-typedef struct _VOLUME_BITMAP_BUFFER {
-  LARGE_INTEGER StartingLcn;
-  LARGE_INTEGER BitmapSize;
-  UCHAR Buffer[1];
-} VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER;
-
-typedef struct _STARTING_VCN_INPUT_BUFFER {
-  LARGE_INTEGER StartingVcn;
-} STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER;
-
-typedef struct _RETRIEVAL_POINTERS_BUFFER {
-  ULONG ExtentCount;
-  LARGE_INTEGER StartingVcn;
-  struct {
-    LARGE_INTEGER NextVcn;
-    LARGE_INTEGER Lcn;
-  } Extents[1];
-} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
-
-typedef struct _NTFS_FILE_RECORD_INPUT_BUFFER {
-  LARGE_INTEGER FileReferenceNumber;
-} NTFS_FILE_RECORD_INPUT_BUFFER, *PNTFS_FILE_RECORD_INPUT_BUFFER;
-
-typedef struct _NTFS_FILE_RECORD_OUTPUT_BUFFER {
-  LARGE_INTEGER FileReferenceNumber;
-  ULONG FileRecordLength;
-  UCHAR FileRecordBuffer[1];
-} NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER;
-
-typedef struct _MOVE_FILE_DATA {
-  HANDLE FileHandle;
-  LARGE_INTEGER StartingVcn;
-  LARGE_INTEGER StartingLcn;
-  ULONG ClusterCount;
-} MOVE_FILE_DATA, *PMOVE_FILE_DATA;
-
-typedef struct _MOVE_FILE_RECORD_DATA {
-  HANDLE FileHandle;
-  LARGE_INTEGER SourceFileRecord;
-  LARGE_INTEGER TargetFileRecord;
-} MOVE_FILE_RECORD_DATA, *PMOVE_FILE_RECORD_DATA;
-
-#if defined(_WIN64)
-typedef struct _MOVE_FILE_DATA32 {
-  UINT32 FileHandle;
-  LARGE_INTEGER StartingVcn;
-  LARGE_INTEGER StartingLcn;
-  ULONG ClusterCount;
-} MOVE_FILE_DATA32, *PMOVE_FILE_DATA32;
-#endif
-
-#endif /* (_WIN32_WINNT >= 0x0400) */
-
-#if (_WIN32_WINNT >= 0x0500)
-
-typedef struct _FIND_BY_SID_DATA {
-  ULONG Restart;
-  SID Sid;
-} FIND_BY_SID_DATA, *PFIND_BY_SID_DATA;
-
-typedef struct _FIND_BY_SID_OUTPUT {
-  ULONG NextEntryOffset;
-  ULONG FileIndex;
-  ULONG FileNameLength;
-  WCHAR FileName[1];
-} FIND_BY_SID_OUTPUT, *PFIND_BY_SID_OUTPUT;
-
-typedef struct _MFT_ENUM_DATA {
-  ULONGLONG StartFileReferenceNumber;
-  USN LowUsn;
-  USN HighUsn;
-} MFT_ENUM_DATA, *PMFT_ENUM_DATA;
-
-typedef struct _CREATE_USN_JOURNAL_DATA {
-  ULONGLONG MaximumSize;
-  ULONGLONG AllocationDelta;
-} CREATE_USN_JOURNAL_DATA, *PCREATE_USN_JOURNAL_DATA;
-
-typedef struct _READ_USN_JOURNAL_DATA {
-  USN StartUsn;
-  ULONG ReasonMask;
-  ULONG ReturnOnlyOnClose;
-  ULONGLONG Timeout;
-  ULONGLONG BytesToWaitFor;
-  ULONGLONG UsnJournalID;
-} READ_USN_JOURNAL_DATA, *PREAD_USN_JOURNAL_DATA;
-
-typedef struct _USN_RECORD {
-  ULONG RecordLength;
-  USHORT MajorVersion;
-  USHORT MinorVersion;
-  ULONGLONG FileReferenceNumber;
-  ULONGLONG ParentFileReferenceNumber;
-  USN Usn;
-  LARGE_INTEGER TimeStamp;
-  ULONG Reason;
-  ULONG SourceInfo;
-  ULONG SecurityId;
-  ULONG FileAttributes;
-  USHORT FileNameLength;
-  USHORT FileNameOffset;
-  WCHAR FileName[1];
-} USN_RECORD, *PUSN_RECORD;
-
-#define USN_PAGE_SIZE                    (0x1000)
-
-#define USN_REASON_DATA_OVERWRITE        (0x00000001)
-#define USN_REASON_DATA_EXTEND           (0x00000002)
-#define USN_REASON_DATA_TRUNCATION       (0x00000004)
-#define USN_REASON_NAMED_DATA_OVERWRITE  (0x00000010)
-#define USN_REASON_NAMED_DATA_EXTEND     (0x00000020)
-#define USN_REASON_NAMED_DATA_TRUNCATION (0x00000040)
-#define USN_REASON_FILE_CREATE           (0x00000100)
-#define USN_REASON_FILE_DELETE           (0x00000200)
-#define USN_REASON_EA_CHANGE             (0x00000400)
-#define USN_REASON_SECURITY_CHANGE       (0x00000800)
-#define USN_REASON_RENAME_OLD_NAME       (0x00001000)
-#define USN_REASON_RENAME_NEW_NAME       (0x00002000)
-#define USN_REASON_INDEXABLE_CHANGE      (0x00004000)
-#define USN_REASON_BASIC_INFO_CHANGE     (0x00008000)
-#define USN_REASON_HARD_LINK_CHANGE      (0x00010000)
-#define USN_REASON_COMPRESSION_CHANGE    (0x00020000)
-#define USN_REASON_ENCRYPTION_CHANGE     (0x00040000)
-#define USN_REASON_OBJECT_ID_CHANGE      (0x00080000)
-#define USN_REASON_REPARSE_POINT_CHANGE  (0x00100000)
-#define USN_REASON_STREAM_CHANGE         (0x00200000)
-#define USN_REASON_TRANSACTED_CHANGE     (0x00400000)
-#define USN_REASON_CLOSE                 (0x80000000)
-
-typedef struct _USN_JOURNAL_DATA {
-  ULONGLONG UsnJournalID;
-  USN FirstUsn;
-  USN NextUsn;
-  USN LowestValidUsn;
-  USN MaxUsn;
-  ULONGLONG MaximumSize;
-  ULONGLONG AllocationDelta;
-} USN_JOURNAL_DATA, *PUSN_JOURNAL_DATA;
-
-typedef struct _DELETE_USN_JOURNAL_DATA {
-  ULONGLONG UsnJournalID;
-  ULONG DeleteFlags;
-} DELETE_USN_JOURNAL_DATA, *PDELETE_USN_JOURNAL_DATA;
-
-#define USN_DELETE_FLAG_DELETE              (0x00000001)
-#define USN_DELETE_FLAG_NOTIFY              (0x00000002)
-#define USN_DELETE_VALID_FLAGS              (0x00000003)
-
-typedef struct _MARK_HANDLE_INFO {
-  ULONG UsnSourceInfo;
-  HANDLE VolumeHandle;
-  ULONG HandleInfo;
-} MARK_HANDLE_INFO, *PMARK_HANDLE_INFO;
-
-#if defined(_WIN64)
-typedef struct _MARK_HANDLE_INFO32 {
-  ULONG UsnSourceInfo;
-  UINT32 VolumeHandle;
-  ULONG HandleInfo;
-} MARK_HANDLE_INFO32, *PMARK_HANDLE_INFO32;
-#endif
-
-#define USN_SOURCE_DATA_MANAGEMENT          (0x00000001)
-#define USN_SOURCE_AUXILIARY_DATA           (0x00000002)
-#define USN_SOURCE_REPLICATION_MANAGEMENT   (0x00000004)
-
-#define MARK_HANDLE_PROTECT_CLUSTERS        (0x00000001)
-#define MARK_HANDLE_TXF_SYSTEM_LOG          (0x00000004)
-#define MARK_HANDLE_NOT_TXF_SYSTEM_LOG      (0x00000008)
-
-typedef struct _BULK_SECURITY_TEST_DATA {
-  ACCESS_MASK DesiredAccess;
-  ULONG SecurityIds[1];
-} BULK_SECURITY_TEST_DATA, *PBULK_SECURITY_TEST_DATA;
-
-#define VOLUME_IS_DIRTY                  (0x00000001)
-#define VOLUME_UPGRADE_SCHEDULED         (0x00000002)
-#define VOLUME_SESSION_OPEN              (0x00000004)
-
-typedef struct _FILE_PREFETCH {
-  ULONG Type;
-  ULONG Count;
-  ULONGLONG Prefetch[1];
-} FILE_PREFETCH, *PFILE_PREFETCH;
-
-typedef struct _FILE_PREFETCH_EX {
-  ULONG Type;
-  ULONG Count;
-  PVOID Context;
-  ULONGLONG Prefetch[1];
-} FILE_PREFETCH_EX, *PFILE_PREFETCH_EX;
-
-#define FILE_PREFETCH_TYPE_FOR_CREATE       0x1
-#define FILE_PREFETCH_TYPE_FOR_DIRENUM      0x2
-#define FILE_PREFETCH_TYPE_FOR_CREATE_EX    0x3
-#define FILE_PREFETCH_TYPE_FOR_DIRENUM_EX   0x4
-
-#define FILE_PREFETCH_TYPE_MAX              0x4
-
-typedef struct _FILE_OBJECTID_BUFFER {
-  UCHAR ObjectId[16];
-  _ANONYMOUS_UNION union {
-    _ANONYMOUS_STRUCT struct {
-      UCHAR BirthVolumeId[16];
-      UCHAR BirthObjectId[16];
-      UCHAR DomainId[16];
-    } DUMMYSTRUCTNAME;
-    UCHAR ExtendedInfo[48];
-  } DUMMYUNIONNAME;
-} FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER;
-
-typedef struct _FILE_SET_SPARSE_BUFFER {
-  BOOLEAN SetSparse;
-} FILE_SET_SPARSE_BUFFER, *PFILE_SET_SPARSE_BUFFER;
-
-typedef struct _FILE_ZERO_DATA_INFORMATION {
-  LARGE_INTEGER FileOffset;
-  LARGE_INTEGER BeyondFinalZero;
-} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
-
-typedef struct _FILE_ALLOCATED_RANGE_BUFFER {
-  LARGE_INTEGER FileOffset;
-  LARGE_INTEGER Length;
-} FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER;
-
-typedef struct _ENCRYPTION_BUFFER {
-  ULONG EncryptionOperation;
-  UCHAR Private[1];
-} ENCRYPTION_BUFFER, *PENCRYPTION_BUFFER;
-
-#define FILE_SET_ENCRYPTION         0x00000001
-#define FILE_CLEAR_ENCRYPTION       0x00000002
-#define STREAM_SET_ENCRYPTION       0x00000003
-#define STREAM_CLEAR_ENCRYPTION     0x00000004
-
-#define MAXIMUM_ENCRYPTION_VALUE    0x00000004
-
-typedef struct _DECRYPTION_STATUS_BUFFER {
-  BOOLEAN NoEncryptedStreams;
-} DECRYPTION_STATUS_BUFFER, *PDECRYPTION_STATUS_BUFFER;
-
-#define ENCRYPTION_FORMAT_DEFAULT        (0x01)
-
-#define COMPRESSION_FORMAT_SPARSE        (0x4000)
-
-typedef struct _REQUEST_RAW_ENCRYPTED_DATA {
-  LONGLONG FileOffset;
-  ULONG Length;
-} REQUEST_RAW_ENCRYPTED_DATA, *PREQUEST_RAW_ENCRYPTED_DATA;
-
-typedef struct _ENCRYPTED_DATA_INFO {
-  ULONGLONG StartingFileOffset;
-  ULONG OutputBufferOffset;
-  ULONG BytesWithinFileSize;
-  ULONG BytesWithinValidDataLength;
-  USHORT CompressionFormat;
-  UCHAR DataUnitShift;
-  UCHAR ChunkShift;
-  UCHAR ClusterShift;
-  UCHAR EncryptionFormat;
-  USHORT NumberOfDataBlocks;
-  ULONG DataBlockSize[ANYSIZE_ARRAY];
-} ENCRYPTED_DATA_INFO, *PENCRYPTED_DATA_INFO;
-
-typedef struct _PLEX_READ_DATA_REQUEST {
-  LARGE_INTEGER ByteOffset;
-  ULONG ByteLength;
-  ULONG PlexNumber;
-} PLEX_READ_DATA_REQUEST, *PPLEX_READ_DATA_REQUEST;
-
-typedef struct _SI_COPYFILE {
-  ULONG SourceFileNameLength;
-  ULONG DestinationFileNameLength;
-  ULONG Flags;
-  WCHAR FileNameBuffer[1];
-} SI_COPYFILE, *PSI_COPYFILE;
-
-#define COPYFILE_SIS_LINK       0x0001
-#define COPYFILE_SIS_REPLACE    0x0002
-#define COPYFILE_SIS_FLAGS      0x0003
-
-#endif /* (_WIN32_WINNT >= 0x0500) */
-
-#if (_WIN32_WINNT >= 0x0600)
-
-typedef struct _FILE_MAKE_COMPATIBLE_BUFFER {
-  BOOLEAN CloseDisc;
-} FILE_MAKE_COMPATIBLE_BUFFER, *PFILE_MAKE_COMPATIBLE_BUFFER;
-
-typedef struct _FILE_SET_DEFECT_MGMT_BUFFER {
-  BOOLEAN Disable;
-} FILE_SET_DEFECT_MGMT_BUFFER, *PFILE_SET_DEFECT_MGMT_BUFFER;
-
-typedef struct _FILE_QUERY_SPARING_BUFFER {
-  ULONG SparingUnitBytes;
-  BOOLEAN SoftwareSparing;
-  ULONG TotalSpareBlocks;
-  ULONG FreeSpareBlocks;
-} FILE_QUERY_SPARING_BUFFER, *PFILE_QUERY_SPARING_BUFFER;
-
-typedef struct _FILE_QUERY_ON_DISK_VOL_INFO_BUFFER {
-  LARGE_INTEGER DirectoryCount;
-  LARGE_INTEGER FileCount;
-  USHORT FsFormatMajVersion;
-  USHORT FsFormatMinVersion;
-  WCHAR FsFormatName[12];
-  LARGE_INTEGER FormatTime;
-  LARGE_INTEGER LastUpdateTime;
-  WCHAR CopyrightInfo[34];
-  WCHAR AbstractInfo[34];
-  WCHAR FormattingImplementationInfo[34];
-  WCHAR LastModifyingImplementationInfo[34];
-} FILE_QUERY_ON_DISK_VOL_INFO_BUFFER, *PFILE_QUERY_ON_DISK_VOL_INFO_BUFFER;
-
-#define SET_REPAIR_ENABLED                                      (0x00000001)
-#define SET_REPAIR_VOLUME_BITMAP_SCAN                           (0x00000002)
-#define SET_REPAIR_DELETE_CROSSLINK                             (0x00000004)
-#define SET_REPAIR_WARN_ABOUT_DATA_LOSS                         (0x00000008)
-#define SET_REPAIR_DISABLED_AND_BUGCHECK_ON_CORRUPT             (0x00000010)
-#define SET_REPAIR_VALID_MASK                                   (0x0000001F)
-
-typedef enum _SHRINK_VOLUME_REQUEST_TYPES {
-  ShrinkPrepare = 1,
-  ShrinkCommit,
-  ShrinkAbort
-} SHRINK_VOLUME_REQUEST_TYPES, *PSHRINK_VOLUME_REQUEST_TYPES;
-
-typedef struct _SHRINK_VOLUME_INFORMATION {
-  SHRINK_VOLUME_REQUEST_TYPES ShrinkRequestType;
-  ULONGLONG Flags;
-  LONGLONG NewNumberOfSectors;
-} SHRINK_VOLUME_INFORMATION, *PSHRINK_VOLUME_INFORMATION;
-
-#define TXFS_RM_FLAG_LOGGING_MODE                           0x00000001
-#define TXFS_RM_FLAG_RENAME_RM                              0x00000002
-#define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX                0x00000004
-#define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN                0x00000008
-#define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS    0x00000010
-#define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT           0x00000020
-#define TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE             0x00000040
-#define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX             0x00000080
-#define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN             0x00000100
-#define TXFS_RM_FLAG_GROW_LOG                               0x00000400
-#define TXFS_RM_FLAG_SHRINK_LOG                             0x00000800
-#define TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE                   0x00001000
-#define TXFS_RM_FLAG_PRESERVE_CHANGES                       0x00002000
-#define TXFS_RM_FLAG_RESET_RM_AT_NEXT_START                 0x00004000
-#define TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START          0x00008000
-#define TXFS_RM_FLAG_PREFER_CONSISTENCY                     0x00010000
-#define TXFS_RM_FLAG_PREFER_AVAILABILITY                    0x00020000
-
-#define TXFS_LOGGING_MODE_SIMPLE        (0x0001)
-#define TXFS_LOGGING_MODE_FULL          (0x0002)
-
-#define TXFS_TRANSACTION_STATE_NONE         0x00
-#define TXFS_TRANSACTION_STATE_ACTIVE       0x01
-#define TXFS_TRANSACTION_STATE_PREPARED     0x02
-#define TXFS_TRANSACTION_STATE_NOTACTIVE    0x03
-
-#define TXFS_MODIFY_RM_VALID_FLAGS (TXFS_RM_FLAG_LOGGING_MODE                        | \
-                                    TXFS_RM_FLAG_RENAME_RM                           | \
-                                    TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX             | \
-                                    TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN             | \
-                                    TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \
-                                    TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT        | \
-                                    TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE          | \
-                                    TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX          | \
-                                    TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN          | \
-                                    TXFS_RM_FLAG_SHRINK_LOG                          | \
-                                    TXFS_RM_FLAG_GROW_LOG                            | \
-                                    TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE                | \
-                                    TXFS_RM_FLAG_PRESERVE_CHANGES                    | \
-                                    TXFS_RM_FLAG_RESET_RM_AT_NEXT_START              | \
-                                    TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START       | \
-                                    TXFS_RM_FLAG_PREFER_CONSISTENCY                  | \
-                                    TXFS_RM_FLAG_PREFER_AVAILABILITY)
-
-typedef struct _TXFS_MODIFY_RM {
-  ULONG Flags;
-  ULONG LogContainerCountMax;
-  ULONG LogContainerCountMin;
-  ULONG LogContainerCount;
-  ULONG LogGrowthIncrement;
-  ULONG LogAutoShrinkPercentage;
-  ULONGLONG Reserved;
-  USHORT LoggingMode;
-} TXFS_MODIFY_RM, *PTXFS_MODIFY_RM;
-
-#define TXFS_RM_STATE_NOT_STARTED       0
-#define TXFS_RM_STATE_STARTING          1
-#define TXFS_RM_STATE_ACTIVE            2
-#define TXFS_RM_STATE_SHUTTING_DOWN     3
-
-#define TXFS_QUERY_RM_INFORMATION_VALID_FLAGS                           \
-                (TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS   |   \
-                 TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT          |   \
-                 TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX            |   \
-                 TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN            |   \
-                 TXFS_RM_FLAG_RESET_RM_AT_NEXT_START                |   \
-                 TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START         |   \
-                 TXFS_RM_FLAG_PREFER_CONSISTENCY                    |   \
-                 TXFS_RM_FLAG_PREFER_AVAILABILITY)
-
-typedef struct _TXFS_QUERY_RM_INFORMATION {
-  ULONG BytesRequired;
-  ULONGLONG TailLsn;
-  ULONGLONG CurrentLsn;
-  ULONGLONG ArchiveTailLsn;
-  ULONGLONG LogContainerSize;
-  LARGE_INTEGER HighestVirtualClock;
-  ULONG LogContainerCount;
-  ULONG LogContainerCountMax;
-  ULONG LogContainerCountMin;
-  ULONG LogGrowthIncrement;
-  ULONG LogAutoShrinkPercentage;
-  ULONG Flags;
-  USHORT LoggingMode;
-  USHORT Reserved;
-  ULONG RmState;
-  ULONGLONG LogCapacity;
-  ULONGLONG LogFree;
-  ULONGLONG TopsSize;
-  ULONGLONG TopsUsed;
-  ULONGLONG TransactionCount;
-  ULONGLONG OnePCCount;
-  ULONGLONG TwoPCCount;
-  ULONGLONG NumberLogFileFull;
-  ULONGLONG OldestTransactionAge;
-  GUID RMName;
-  ULONG TmLogPathOffset;
-} TXFS_QUERY_RM_INFORMATION, *PTXFS_QUERY_RM_INFORMATION;
-
-#define TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_REDO_LSN        0x01
-#define TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_VIRTUAL_CLOCK   0x02
-
-#define TXFS_ROLLFORWARD_REDO_VALID_FLAGS                               \
-                (TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_REDO_LSN |         \
-                 TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_VIRTUAL_CLOCK)
-
-typedef struct _TXFS_ROLLFORWARD_REDO_INFORMATION {
-  LARGE_INTEGER LastVirtualClock;
-  ULONGLONG LastRedoLsn;
-  ULONGLONG HighestRecoveryLsn;
-  ULONG Flags;
-} TXFS_ROLLFORWARD_REDO_INFORMATION, *PTXFS_ROLLFORWARD_REDO_INFORMATION;
-
-#define TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MAX              0x00000001
-#define TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN              0x00000002
-#define TXFS_START_RM_FLAG_LOG_CONTAINER_SIZE                   0x00000004
-#define TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS  0x00000008
-#define TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT         0x00000010
-#define TXFS_START_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE           0x00000020
-#define TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX           0x00000040
-#define TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN           0x00000080
-
-#define TXFS_START_RM_FLAG_RECOVER_BEST_EFFORT                  0x00000200
-#define TXFS_START_RM_FLAG_LOGGING_MODE                         0x00000400
-#define TXFS_START_RM_FLAG_PRESERVE_CHANGES                     0x00000800
-
-#define TXFS_START_RM_FLAG_PREFER_CONSISTENCY                   0x00001000
-#define TXFS_START_RM_FLAG_PREFER_AVAILABILITY                  0x00002000
-
-#define TXFS_START_RM_VALID_FLAGS                                           \
-                (TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MAX             |   \
-                 TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN             |   \
-                 TXFS_START_RM_FLAG_LOG_CONTAINER_SIZE                  |   \
-                 TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS |   \
-                 TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT        |   \
-                 TXFS_START_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE          |   \
-                 TXFS_START_RM_FLAG_RECOVER_BEST_EFFORT                 |   \
-                 TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX          |   \
-                 TXFS_START_RM_FLAG_LOGGING_MODE                        |   \
-                 TXFS_START_RM_FLAG_PRESERVE_CHANGES                    |   \
-                 TXFS_START_RM_FLAG_PREFER_CONSISTENCY                  |   \
-                 TXFS_START_RM_FLAG_PREFER_AVAILABILITY)
-
-typedef struct _TXFS_START_RM_INFORMATION {
-  ULONG Flags;
-  ULONGLONG LogContainerSize;
-  ULONG LogContainerCountMin;
-  ULONG LogContainerCountMax;
-  ULONG LogGrowthIncrement;
-  ULONG LogAutoShrinkPercentage;
-  ULONG TmLogPathOffset;
-  USHORT TmLogPathLength;
-  USHORT LoggingMode;
-  USHORT LogPathLength;
-  USHORT Reserved;
-  WCHAR LogPath[1];
-} TXFS_START_RM_INFORMATION, *PTXFS_START_RM_INFORMATION;
-
-typedef struct _TXFS_GET_METADATA_INFO_OUT {
-  struct {
-    LONGLONG LowPart;
-    LONGLONG HighPart;
-  } TxfFileId;
-  GUID LockingTransaction;
-  ULONGLONG LastLsn;
-  ULONG TransactionState;
-} TXFS_GET_METADATA_INFO_OUT, *PTXFS_GET_METADATA_INFO_OUT;
-
-#define TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_CREATED   0x00000001
-#define TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_DELETED   0x00000002
-
-typedef struct _TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY {
-  ULONGLONG Offset;
-  ULONG NameFlags;
-  LONGLONG FileId;
-  ULONG Reserved1;
-  ULONG Reserved2;
-  LONGLONG Reserved3;
-  WCHAR FileName[1];
-} TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY, *PTXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY;
-
-typedef struct _TXFS_LIST_TRANSACTION_LOCKED_FILES {
-  GUID KtmTransaction;
-  ULONGLONG NumberOfFiles;
-  ULONGLONG BufferSizeRequired;
-  ULONGLONG Offset;
-} TXFS_LIST_TRANSACTION_LOCKED_FILES, *PTXFS_LIST_TRANSACTION_LOCKED_FILES;
-
-typedef struct _TXFS_LIST_TRANSACTIONS_ENTRY {
-  GUID TransactionId;
-  ULONG TransactionState;
-  ULONG Reserved1;
-  ULONG Reserved2;
-  LONGLONG Reserved3;
-} TXFS_LIST_TRANSACTIONS_ENTRY, *PTXFS_LIST_TRANSACTIONS_ENTRY;
-
-typedef struct _TXFS_LIST_TRANSACTIONS {
-  ULONGLONG NumberOfTransactions;
-  ULONGLONG BufferSizeRequired;
-} TXFS_LIST_TRANSACTIONS, *PTXFS_LIST_TRANSACTIONS;
-
-typedef struct _TXFS_READ_BACKUP_INFORMATION_OUT {
-  _ANONYMOUS_UNION union {
-    ULONG BufferLength;
-    UCHAR Buffer[1];
-  } DUMMYUNIONNAME;
-} TXFS_READ_BACKUP_INFORMATION_OUT, *PTXFS_READ_BACKUP_INFORMATION_OUT;
-
-typedef struct _TXFS_WRITE_BACKUP_INFORMATION {
-  UCHAR Buffer[1];
-} TXFS_WRITE_BACKUP_INFORMATION, *PTXFS_WRITE_BACKUP_INFORMATION;
-
-#define TXFS_TRANSACTED_VERSION_NONTRANSACTED   0xFFFFFFFE
-#define TXFS_TRANSACTED_VERSION_UNCOMMITTED     0xFFFFFFFF
-
-typedef struct _TXFS_GET_TRANSACTED_VERSION {
-  ULONG ThisBaseVersion;
-  ULONG LatestVersion;
-  USHORT ThisMiniVersion;
-  USHORT FirstMiniVersion;
-  USHORT LatestMiniVersion;
-} TXFS_GET_TRANSACTED_VERSION, *PTXFS_GET_TRANSACTED_VERSION;
-
-#define TXFS_SAVEPOINT_SET                      0x00000001
-#define TXFS_SAVEPOINT_ROLLBACK                 0x00000002
-#define TXFS_SAVEPOINT_CLEAR                    0x00000004
-#define TXFS_SAVEPOINT_CLEAR_ALL                0x00000010
-
-typedef struct _TXFS_SAVEPOINT_INFORMATION {
-  HANDLE KtmTransaction;
-  ULONG ActionCode;
-  ULONG SavepointId;
-} TXFS_SAVEPOINT_INFORMATION, *PTXFS_SAVEPOINT_INFORMATION;
-
-typedef struct _TXFS_CREATE_MINIVERSION_INFO {
-  USHORT StructureVersion;
-  USHORT StructureLength;
-  ULONG BaseVersion;
-  USHORT MiniVersion;
-} TXFS_CREATE_MINIVERSION_INFO, *PTXFS_CREATE_MINIVERSION_INFO;
-
-typedef struct _TXFS_TRANSACTION_ACTIVE_INFO {
-  BOOLEAN TransactionsActiveAtSnapshot;
-} TXFS_TRANSACTION_ACTIVE_INFO, *PTXFS_TRANSACTION_ACTIVE_INFO;
-
-#endif /* (_WIN32_WINNT >= 0x0600) */
-
-#if (_WIN32_WINNT >= 0x0601)
-
-#define MARK_HANDLE_REALTIME                (0x00000020)
-#define MARK_HANDLE_NOT_REALTIME            (0x00000040)
-
-#define NO_8DOT3_NAME_PRESENT               (0x00000001)
-#define REMOVED_8DOT3_NAME                  (0x00000002)
-
-#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED        (0x00000001)
-
-typedef struct _BOOT_AREA_INFO {
-  ULONG BootSectorCount;
-  struct {
-    LARGE_INTEGER Offset;
-  } BootSectors[2];
-} BOOT_AREA_INFO, *PBOOT_AREA_INFO;
-
-typedef struct _RETRIEVAL_POINTER_BASE {
-  LARGE_INTEGER FileAreaOffset;
-} RETRIEVAL_POINTER_BASE, *PRETRIEVAL_POINTER_BASE;
-
-typedef struct _FILE_FS_PERSISTENT_VOLUME_INFORMATION {
-  ULONG VolumeFlags;
-  ULONG FlagMask;
-  ULONG Version;
-  ULONG Reserved;
-} FILE_FS_PERSISTENT_VOLUME_INFORMATION, *PFILE_FS_PERSISTENT_VOLUME_INFORMATION;
-
-typedef struct _FILE_SYSTEM_RECOGNITION_INFORMATION {
-  CHAR FileSystem[9];
-} FILE_SYSTEM_RECOGNITION_INFORMATION, *PFILE_SYSTEM_RECOGNITION_INFORMATION;
-
-#define OPLOCK_LEVEL_CACHE_READ         (0x00000001)
-#define OPLOCK_LEVEL_CACHE_HANDLE       (0x00000002)
-#define OPLOCK_LEVEL_CACHE_WRITE        (0x00000004)
-
-#define REQUEST_OPLOCK_INPUT_FLAG_REQUEST               (0x00000001)
-#define REQUEST_OPLOCK_INPUT_FLAG_ACK                   (0x00000002)
-#define REQUEST_OPLOCK_INPUT_FLAG_COMPLETE_ACK_ON_CLOSE (0x00000004)
-
-#define REQUEST_OPLOCK_CURRENT_VERSION          1
-
-typedef struct _REQUEST_OPLOCK_INPUT_BUFFER {
-  USHORT StructureVersion;
-  USHORT StructureLength;
-  ULONG RequestedOplockLevel;
-  ULONG Flags;
-} REQUEST_OPLOCK_INPUT_BUFFER, *PREQUEST_OPLOCK_INPUT_BUFFER;
-
-#define REQUEST_OPLOCK_OUTPUT_FLAG_ACK_REQUIRED     (0x00000001)
-#define REQUEST_OPLOCK_OUTPUT_FLAG_MODES_PROVIDED   (0x00000002)
-
-typedef struct _REQUEST_OPLOCK_OUTPUT_BUFFER {
-  USHORT StructureVersion;
-  USHORT StructureLength;
-  ULONG OriginalOplockLevel;
-  ULONG NewOplockLevel;
-  ULONG Flags;
-  ACCESS_MASK AccessMode;
-  USHORT ShareMode;
-} REQUEST_OPLOCK_OUTPUT_BUFFER, *PREQUEST_OPLOCK_OUTPUT_BUFFER;
-
-#define SD_GLOBAL_CHANGE_TYPE_MACHINE_SID   1
-
-typedef struct _SD_CHANGE_MACHINE_SID_INPUT {
-  USHORT CurrentMachineSIDOffset;
-  USHORT CurrentMachineSIDLength;
-  USHORT NewMachineSIDOffset;
-  USHORT NewMachineSIDLength;
-} SD_CHANGE_MACHINE_SID_INPUT, *PSD_CHANGE_MACHINE_SID_INPUT;
-
-typedef struct _SD_CHANGE_MACHINE_SID_OUTPUT {
-  ULONGLONG NumSDChangedSuccess;
-  ULONGLONG NumSDChangedFail;
-  ULONGLONG NumSDUnused;
-  ULONGLONG NumSDTotal;
-  ULONGLONG NumMftSDChangedSuccess;
-  ULONGLONG NumMftSDChangedFail;
-  ULONGLONG NumMftSDTotal;
-} SD_CHANGE_MACHINE_SID_OUTPUT, *PSD_CHANGE_MACHINE_SID_OUTPUT;
-
-typedef struct _SD_GLOBAL_CHANGE_INPUT {
-  ULONG Flags;
-  ULONG ChangeType;
-  _ANONYMOUS_UNION union {
-    SD_CHANGE_MACHINE_SID_INPUT SdChange;
-  } DUMMYUNIONNAME;
-} SD_GLOBAL_CHANGE_INPUT, *PSD_GLOBAL_CHANGE_INPUT;
-
-typedef struct _SD_GLOBAL_CHANGE_OUTPUT {
-  ULONG Flags;
-  ULONG ChangeType;
-  _ANONYMOUS_UNION union {
-    SD_CHANGE_MACHINE_SID_OUTPUT SdChange;
-  } DUMMYUNIONNAME;
-} SD_GLOBAL_CHANGE_OUTPUT, *PSD_GLOBAL_CHANGE_OUTPUT;
-
-#define ENCRYPTED_DATA_INFO_SPARSE_FILE    1
-
-typedef struct _EXTENDED_ENCRYPTED_DATA_INFO {
-  ULONG ExtendedCode;
-  ULONG Length;
-  ULONG Flags;
-  ULONG Reserved;
-} EXTENDED_ENCRYPTED_DATA_INFO, *PEXTENDED_ENCRYPTED_DATA_INFO;
-
-typedef struct _LOOKUP_STREAM_FROM_CLUSTER_INPUT {
-  ULONG Flags;
-  ULONG NumberOfClusters;
-  LARGE_INTEGER Cluster[1];
-} LOOKUP_STREAM_FROM_CLUSTER_INPUT, *PLOOKUP_STREAM_FROM_CLUSTER_INPUT;
-
-typedef struct _LOOKUP_STREAM_FROM_CLUSTER_OUTPUT {
-  ULONG Offset;
-  ULONG NumberOfMatches;
-  ULONG BufferSizeRequired;
-} LOOKUP_STREAM_FROM_CLUSTER_OUTPUT, *PLOOKUP_STREAM_FROM_CLUSTER_OUTPUT;
-
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_PAGE_FILE          0x00000001
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_DENY_DEFRAG_SET    0x00000002
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_FS_SYSTEM_FILE     0x00000004
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_TXF_SYSTEM_FILE    0x00000008
-
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_MASK          0xff000000
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_DATA          0x01000000
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_INDEX         0x02000000
-#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_SYSTEM        0x03000000
-
-typedef struct _LOOKUP_STREAM_FROM_CLUSTER_ENTRY {
-  ULONG OffsetToNext;
-  ULONG Flags;
-  LARGE_INTEGER Reserved;
-  LARGE_INTEGER Cluster;
-  WCHAR FileName[1];
-} LOOKUP_STREAM_FROM_CLUSTER_ENTRY, *PLOOKUP_STREAM_FROM_CLUSTER_ENTRY;
-
-typedef struct _FILE_TYPE_NOTIFICATION_INPUT {
-  ULONG Flags;
-  ULONG NumFileTypeIDs;
-  GUID FileTypeID[1];
-} FILE_TYPE_NOTIFICATION_INPUT, *PFILE_TYPE_NOTIFICATION_INPUT;
-
-#define FILE_TYPE_NOTIFICATION_FLAG_USAGE_BEGIN     0x00000001
-#define FILE_TYPE_NOTIFICATION_FLAG_USAGE_END       0x00000002
-
-DEFINE_GUID(FILE_TYPE_NOTIFICATION_GUID_PAGE_FILE,         0x0d0a64a1, 0x38fc, 0x4db8, 0x9f, 0xe7, 0x3f, 0x43, 0x52, 0xcd, 0x7c, 0x5c);
-DEFINE_GUID(FILE_TYPE_NOTIFICATION_GUID_HIBERNATION_FILE,  0xb7624d64, 0xb9a3, 0x4cf8, 0x80, 0x11, 0x5b, 0x86, 0xc9, 0x40, 0xe7, 0xb7);
-DEFINE_GUID(FILE_TYPE_NOTIFICATION_GUID_CRASHDUMP_FILE,    0x9d453eb7, 0xd2a6, 0x4dbd, 0xa2, 0xe3, 0xfb, 0xd0, 0xed, 0x91, 0x09, 0xa9);
-
-#ifndef _VIRTUAL_STORAGE_TYPE_DEFINED
-#define _VIRTUAL_STORAGE_TYPE_DEFINED
-typedef struct _VIRTUAL_STORAGE_TYPE {
-  ULONG DeviceId;
-  GUID VendorId;
-} VIRTUAL_STORAGE_TYPE, *PVIRTUAL_STORAGE_TYPE;
-#endif
-
-typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_REQUEST {
-  ULONG RequestLevel;
-  ULONG RequestFlags;
-} STORAGE_QUERY_DEPENDENT_VOLUME_REQUEST, *PSTORAGE_QUERY_DEPENDENT_VOLUME_REQUEST;
-
-#define QUERY_DEPENDENT_VOLUME_REQUEST_FLAG_HOST_VOLUMES    0x1
-#define QUERY_DEPENDENT_VOLUME_REQUEST_FLAG_GUEST_VOLUMES   0x2
-
-typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY {
-  ULONG EntryLength;
-  ULONG DependencyTypeFlags;
-  ULONG ProviderSpecificFlags;
-  VIRTUAL_STORAGE_TYPE VirtualStorageType;
-} STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY, *PSTORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY;
-
-typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY {
-  ULONG EntryLength;
-  ULONG DependencyTypeFlags;
-  ULONG ProviderSpecificFlags;
-  VIRTUAL_STORAGE_TYPE VirtualStorageType;
-  ULONG AncestorLevel;
-  ULONG HostVolumeNameOffset;
-  ULONG HostVolumeNameSize;
-  ULONG DependentVolumeNameOffset;
-  ULONG DependentVolumeNameSize;
-  ULONG RelativePathOffset;
-  ULONG RelativePathSize;
-  ULONG DependentDeviceNameOffset;
-  ULONG DependentDeviceNameSize;
-} STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY, *PSTORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY;
-
-typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE {
-  ULONG ResponseLevel;
-  ULONG NumberEntries;
-  _ANONYMOUS_UNION union {
-    STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY Lev1Depends[0];
-    STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY Lev2Depends[0];
-  } DUMMYUNIONNAME;
-} STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE, *PSTORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE;
-
-#endif /* (_WIN32_WINNT >= 0x0601) */
-
-typedef struct _FILESYSTEM_STATISTICS {
-  USHORT FileSystemType;
-  USHORT Version;
-  ULONG SizeOfCompleteStructure;
-  ULONG UserFileReads;
-  ULONG UserFileReadBytes;
-  ULONG UserDiskReads;
-  ULONG UserFileWrites;
-  ULONG UserFileWriteBytes;
-  ULONG UserDiskWrites;
-  ULONG MetaDataReads;
-  ULONG MetaDataReadBytes;
-  ULONG MetaDataDiskReads;
-  ULONG MetaDataWrites;
-  ULONG MetaDataWriteBytes;
-  ULONG MetaDataDiskWrites;
-} FILESYSTEM_STATISTICS, *PFILESYSTEM_STATISTICS;
-
-#define FILESYSTEM_STATISTICS_TYPE_NTFS     1
-#define FILESYSTEM_STATISTICS_TYPE_FAT      2
-#define FILESYSTEM_STATISTICS_TYPE_EXFAT    3
-
-typedef struct _FAT_STATISTICS {
-  ULONG CreateHits;
-  ULONG SuccessfulCreates;
-  ULONG FailedCreates;
-  ULONG NonCachedReads;
-  ULONG NonCachedReadBytes;
-  ULONG NonCachedWrites;
-  ULONG NonCachedWriteBytes;
-  ULONG NonCachedDiskReads;
-  ULONG NonCachedDiskWrites;
-} FAT_STATISTICS, *PFAT_STATISTICS;
-
-typedef struct _EXFAT_STATISTICS {
-  ULONG CreateHits;
-  ULONG SuccessfulCreates;
-  ULONG FailedCreates;
-  ULONG NonCachedReads;
-  ULONG NonCachedReadBytes;
-  ULONG NonCachedWrites;
-  ULONG NonCachedWriteBytes;
-  ULONG NonCachedDiskReads;
-  ULONG NonCachedDiskWrites;
-} EXFAT_STATISTICS, *PEXFAT_STATISTICS;
-
-typedef struct _NTFS_STATISTICS {
-  ULONG LogFileFullExceptions;
-  ULONG OtherExceptions;
-  ULONG MftReads;
-  ULONG MftReadBytes;
-  ULONG MftWrites;
-  ULONG MftWriteBytes;
-  struct {
-    USHORT Write;
-    USHORT Create;
-    USHORT SetInfo;
-    USHORT Flush;
-  } MftWritesUserLevel;
-  USHORT MftWritesFlushForLogFileFull;
-  USHORT MftWritesLazyWriter;
-  USHORT MftWritesUserRequest;
-  ULONG Mft2Writes;
-  ULONG Mft2WriteBytes;
-  struct {
-    USHORT Write;
-    USHORT Create;
-    USHORT SetInfo;
-    USHORT Flush;
-  } Mft2WritesUserLevel;
-  USHORT Mft2WritesFlushForLogFileFull;
-  USHORT Mft2WritesLazyWriter;
-  USHORT Mft2WritesUserRequest;
-  ULONG RootIndexReads;
-  ULONG RootIndexReadBytes;
-  ULONG RootIndexWrites;
-  ULONG RootIndexWriteBytes;
-  ULONG BitmapReads;
-  ULONG BitmapReadBytes;
-  ULONG BitmapWrites;
-  ULONG BitmapWriteBytes;
-  USHORT BitmapWritesFlushForLogFileFull;
-  USHORT BitmapWritesLazyWriter;
-  USHORT BitmapWritesUserRequest;
-  struct {
-    USHORT Write;
-    USHORT Create;
-    USHORT SetInfo;
-  } BitmapWritesUserLevel;
-  ULONG MftBitmapReads;
-  ULONG MftBitmapReadBytes;
-  ULONG MftBitmapWrites;
-  ULONG MftBitmapWriteBytes;
-  USHORT MftBitmapWritesFlushForLogFileFull;
-  USHORT MftBitmapWritesLazyWriter;
-  USHORT MftBitmapWritesUserRequest;
-  struct {
-    USHORT Write;
-    USHORT Create;
-    USHORT SetInfo;
-    USHORT Flush;
-  } MftBitmapWritesUserLevel;
-  ULONG UserIndexReads;
-  ULONG UserIndexReadBytes;
-  ULONG UserIndexWrites;
-  ULONG UserIndexWriteBytes;
-  ULONG LogFileReads;
-  ULONG LogFileReadBytes;
-  ULONG LogFileWrites;
-  ULONG LogFileWriteBytes;
-  struct {
-    ULONG Calls;
-    ULONG Clusters;
-    ULONG Hints;
-    ULONG RunsReturned;
-    ULONG HintsHonored;
-    ULONG HintsClusters;
-    ULONG Cache;
-    ULONG CacheClusters;
-    ULONG CacheMiss;
-    ULONG CacheMissClusters;
-  } Allocate;
-} NTFS_STATISTICS, *PNTFS_STATISTICS;
-
-#endif /* _FILESYSTEMFSCTL_ */
-
-#define SYMLINK_FLAG_RELATIVE   1
-
-typedef struct _REPARSE_DATA_BUFFER {
-  ULONG ReparseTag;
-  USHORT ReparseDataLength;
-  USHORT Reserved;
-  _ANONYMOUS_UNION union {
-    struct {
-      USHORT SubstituteNameOffset;
-      USHORT SubstituteNameLength;
-      USHORT PrintNameOffset;
-      USHORT PrintNameLength;
-      ULONG Flags;
-      WCHAR PathBuffer[1];
-    } SymbolicLinkReparseBuffer;
-    struct {
-      USHORT SubstituteNameOffset;
-      USHORT SubstituteNameLength;
-      USHORT PrintNameOffset;
-      USHORT PrintNameLength;
-      WCHAR PathBuffer[1];
-    } MountPointReparseBuffer;
-    struct {
-      UCHAR DataBuffer[1];
-    } GenericReparseBuffer;
-  } DUMMYUNIONNAME;
-} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
-
-#define REPARSE_DATA_BUFFER_HEADER_SIZE   FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer)
-
-typedef struct _REPARSE_GUID_DATA_BUFFER {
-  ULONG ReparseTag;
-  USHORT ReparseDataLength;
-  USHORT Reserved;
-  GUID ReparseGuid;
-  struct {
-    UCHAR DataBuffer[1];
-  } GenericReparseBuffer;
-} REPARSE_GUID_DATA_BUFFER, *PREPARSE_GUID_DATA_BUFFER;
-
-#define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE   FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer)
-
-#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE      ( 16 * 1024 )
-
-/* Reserved reparse tags */
-#define IO_REPARSE_TAG_RESERVED_ZERO            (0)
-#define IO_REPARSE_TAG_RESERVED_ONE             (1)
-#define IO_REPARSE_TAG_RESERVED_RANGE           IO_REPARSE_TAG_RESERVED_ONE
-
-#define IsReparseTagMicrosoft(_tag)             (((_tag) & 0x80000000))
-#define IsReparseTagNameSurrogate(_tag)         (((_tag) & 0x20000000))
-
-#define IO_REPARSE_TAG_VALID_VALUES             (0xF000FFFF)
-
-#define IsReparseTagValid(tag) (                               \
-                  !((tag) & ~IO_REPARSE_TAG_VALID_VALUES) &&   \
-                  ((tag) > IO_REPARSE_TAG_RESERVED_RANGE)      \
-                )
-
-/* MicroSoft reparse point tags */
-#define IO_REPARSE_TAG_MOUNT_POINT              (0xA0000003L)
-#define IO_REPARSE_TAG_HSM                      (0xC0000004L)
-#define IO_REPARSE_TAG_DRIVE_EXTENDER           (0x80000005L)
-#define IO_REPARSE_TAG_HSM2                     (0x80000006L)
-#define IO_REPARSE_TAG_SIS                      (0x80000007L)
-#define IO_REPARSE_TAG_WIM                      (0x80000008L)
-#define IO_REPARSE_TAG_CSV                      (0x80000009L)
-#define IO_REPARSE_TAG_DFS                      (0x8000000AL)
-#define IO_REPARSE_TAG_FILTER_MANAGER           (0x8000000BL)
-#define IO_REPARSE_TAG_SYMLINK                  (0xA000000CL)
-#define IO_REPARSE_TAG_IIS_CACHE                (0xA0000010L)
-#define IO_REPARSE_TAG_DFSR                     (0x80000012L)
-
-#pragma pack(4)
-typedef struct _REPARSE_INDEX_KEY {
-  ULONG FileReparseTag;
-  LARGE_INTEGER FileId;
-} REPARSE_INDEX_KEY, *PREPARSE_INDEX_KEY;
-#pragma pack()
-
-#define FSCTL_LMR_GET_LINK_TRACKING_INFORMATION   CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM,58,METHOD_BUFFERED,FILE_ANY_ACCESS)
-#define FSCTL_LMR_SET_LINK_TRACKING_INFORMATION   CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM,59,METHOD_BUFFERED,FILE_ANY_ACCESS)
-#define IOCTL_LMR_ARE_FILE_OBJECTS_ON_SAME_SERVER CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM,60,METHOD_BUFFERED,FILE_ANY_ACCESS)
-
-#define FSCTL_PIPE_ASSIGN_EVENT             CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_DISCONNECT               CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_LISTEN                   CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_PEEK                     CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_PIPE_QUERY_EVENT              CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_TRANSCEIVE               CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER,  FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_PIPE_WAIT                     CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_IMPERSONATE              CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_SET_CLIENT_PROCESS       CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_QUERY_CLIENT_PROCESS     CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_GET_PIPE_ATTRIBUTE       CTL_CODE(FILE_DEVICE_NAMED_PIPE, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_SET_PIPE_ATTRIBUTE       CTL_CODE(FILE_DEVICE_NAMED_PIPE, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_SET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_GET_HANDLE_ATTRIBUTE     CTL_CODE(FILE_DEVICE_NAMED_PIPE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_SET_HANDLE_ATTRIBUTE     CTL_CODE(FILE_DEVICE_NAMED_PIPE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define FSCTL_PIPE_FLUSH                    CTL_CODE(FILE_DEVICE_NAMED_PIPE, 16, METHOD_BUFFERED, FILE_WRITE_DATA)
-
-#define FSCTL_PIPE_INTERNAL_READ            CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA)
-#define FSCTL_PIPE_INTERNAL_WRITE           CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA)
-#define FSCTL_PIPE_INTERNAL_TRANSCEIVE      CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
-#define FSCTL_PIPE_INTERNAL_READ_OVFLOW     CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA)
-
-#define FILE_PIPE_READ_DATA                 0x00000000
-#define FILE_PIPE_WRITE_SPACE               0x00000001
-
-typedef struct _FILE_PIPE_ASSIGN_EVENT_BUFFER {
-  HANDLE EventHandle;
-  ULONG KeyValue;
-} FILE_PIPE_ASSIGN_EVENT_BUFFER, *PFILE_PIPE_ASSIGN_EVENT_BUFFER;
-
-typedef struct _FILE_PIPE_EVENT_BUFFER {
-  ULONG NamedPipeState;
-  ULONG EntryType;
-  ULONG ByteCount;
-  ULONG KeyValue;
-  ULONG NumberRequests;
-} FILE_PIPE_EVENT_BUFFER, *PFILE_PIPE_EVENT_BUFFER;
-
-typedef struct _FILE_PIPE_PEEK_BUFFER {
-  ULONG NamedPipeState;
-  ULONG ReadDataAvailable;
-  ULONG NumberOfMessages;
-  ULONG MessageLength;
-  CHAR Data[1];
-} FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER;
-
-typedef struct _FILE_PIPE_WAIT_FOR_BUFFER {
-  LARGE_INTEGER Timeout;
-  ULONG NameLength;
-  BOOLEAN TimeoutSpecified;
-  WCHAR Name[1];
-} FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER;
-
-typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER {
-#if !defined(BUILD_WOW6432)
-  PVOID ClientSession;
-  PVOID ClientProcess;
-#else
-  ULONGLONG ClientSession;
-  ULONGLONG ClientProcess;
-#endif
-} FILE_PIPE_CLIENT_PROCESS_BUFFER, *PFILE_PIPE_CLIENT_PROCESS_BUFFER;
-
-#define FILE_PIPE_COMPUTER_NAME_LENGTH 15
-
-typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER_EX {
-#if !defined(BUILD_WOW6432)
-  PVOID ClientSession;
-  PVOID ClientProcess;
-#else
-  ULONGLONG ClientSession;
-  ULONGLONG ClientProcess;
-#endif
-  USHORT ClientComputerNameLength;
-  WCHAR ClientComputerBuffer[FILE_PIPE_COMPUTER_NAME_LENGTH+1];
-} FILE_PIPE_CLIENT_PROCESS_BUFFER_EX, *PFILE_PIPE_CLIENT_PROCESS_BUFFER_EX;
-
-#define FSCTL_MAILSLOT_PEEK             CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA)
-
-typedef enum _LINK_TRACKING_INFORMATION_TYPE {
-  NtfsLinkTrackingInformation,
-  DfsLinkTrackingInformation
-} LINK_TRACKING_INFORMATION_TYPE, *PLINK_TRACKING_INFORMATION_TYPE;
-
-typedef struct _LINK_TRACKING_INFORMATION {
-  LINK_TRACKING_INFORMATION_TYPE Type;
-  UCHAR VolumeId[16];
-} LINK_TRACKING_INFORMATION, *PLINK_TRACKING_INFORMATION;
-
-typedef struct _REMOTE_LINK_TRACKING_INFORMATION {
-  PVOID TargetFileObject;
-  ULONG TargetLinkTrackingInformationLength;
-  UCHAR TargetLinkTrackingInformationBuffer[1];
-} REMOTE_LINK_TRACKING_INFORMATION, *PREMOTE_LINK_TRACKING_INFORMATION;
-
-#define IO_OPEN_PAGING_FILE                 0x0002
-#define IO_OPEN_TARGET_DIRECTORY            0x0004
-#define IO_STOP_ON_SYMLINK                  0x0008
-#define IO_MM_PAGING_FILE                   0x0010
-
-typedef VOID
-(NTAPI *PDRIVER_FS_NOTIFICATION) (
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ BOOLEAN FsActive);
-
-typedef enum _FS_FILTER_SECTION_SYNC_TYPE {
-  SyncTypeOther = 0,
-  SyncTypeCreateSection
-} FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE;
-
-typedef enum _FS_FILTER_STREAM_FO_NOTIFICATION_TYPE {
-  NotifyTypeCreate = 0,
-  NotifyTypeRetired
-} FS_FILTER_STREAM_FO_NOTIFICATION_TYPE, *PFS_FILTER_STREAM_FO_NOTIFICATION_TYPE;
-
-typedef union _FS_FILTER_PARAMETERS {
-  struct {
-    PLARGE_INTEGER EndingOffset;
-    PERESOURCE *ResourceToRelease;
-  } AcquireForModifiedPageWriter;
-  struct {
-    PERESOURCE ResourceToRelease;
-  } ReleaseForModifiedPageWriter;
-  struct {
-    FS_FILTER_SECTION_SYNC_TYPE SyncType;
-    ULONG PageProtection;
-  } AcquireForSectionSynchronization;
-  struct {
-    FS_FILTER_STREAM_FO_NOTIFICATION_TYPE NotificationType;
-    BOOLEAN POINTER_ALIGNMENT SafeToRecurse;
-  } NotifyStreamFileObject;
-  struct {
-    PVOID Argument1;
-    PVOID Argument2;
-    PVOID Argument3;
-    PVOID Argument4;
-    PVOID Argument5;
-  } Others;
-} FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS;
-
-#define FS_FILTER_ACQUIRE_FOR_SECTION_SYNCHRONIZATION      (UCHAR)-1
-#define FS_FILTER_RELEASE_FOR_SECTION_SYNCHRONIZATION      (UCHAR)-2
-#define FS_FILTER_ACQUIRE_FOR_MOD_WRITE                    (UCHAR)-3
-#define FS_FILTER_RELEASE_FOR_MOD_WRITE                    (UCHAR)-4
-#define FS_FILTER_ACQUIRE_FOR_CC_FLUSH                     (UCHAR)-5
-#define FS_FILTER_RELEASE_FOR_CC_FLUSH                     (UCHAR)-6
-
-typedef struct _FS_FILTER_CALLBACK_DATA {
-  ULONG SizeOfFsFilterCallbackData;
-  UCHAR Operation;
-  UCHAR Reserved;
-  struct _DEVICE_OBJECT *DeviceObject;
-  struct _FILE_OBJECT *FileObject;
-  FS_FILTER_PARAMETERS Parameters;
-} FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA;
-
-typedef NTSTATUS
-(NTAPI *PFS_FILTER_CALLBACK) (
-  _In_ PFS_FILTER_CALLBACK_DATA Data,
-  _Out_ PVOID *CompletionContext);
-
-typedef VOID
-(NTAPI *PFS_FILTER_COMPLETION_CALLBACK) (
-  _In_ PFS_FILTER_CALLBACK_DATA Data,
-  _In_ NTSTATUS OperationStatus,
-  _In_ PVOID CompletionContext);
-
-typedef struct _FS_FILTER_CALLBACKS {
-  ULONG SizeOfFsFilterCallbacks;
-  ULONG Reserved;
-  PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization;
-  PFS_FILTER_COMPLETION_CALLBACK PostAcquireForSectionSynchronization;
-  PFS_FILTER_CALLBACK PreReleaseForSectionSynchronization;
-  PFS_FILTER_COMPLETION_CALLBACK PostReleaseForSectionSynchronization;
-  PFS_FILTER_CALLBACK PreAcquireForCcFlush;
-  PFS_FILTER_COMPLETION_CALLBACK PostAcquireForCcFlush;
-  PFS_FILTER_CALLBACK PreReleaseForCcFlush;
-  PFS_FILTER_COMPLETION_CALLBACK PostReleaseForCcFlush;
-  PFS_FILTER_CALLBACK PreAcquireForModifiedPageWriter;
-  PFS_FILTER_COMPLETION_CALLBACK PostAcquireForModifiedPageWriter;
-  PFS_FILTER_CALLBACK PreReleaseForModifiedPageWriter;
-  PFS_FILTER_COMPLETION_CALLBACK PostReleaseForModifiedPageWriter;
-} FS_FILTER_CALLBACKS, *PFS_FILTER_CALLBACKS;
-
-extern NTKERNELAPI KSPIN_LOCK    IoStatisticsLock;
-extern NTKERNELAPI ULONG         IoReadOperationCount;
-extern NTKERNELAPI ULONG         IoWriteOperationCount;
-extern NTKERNELAPI ULONG         IoOtherOperationCount;
-extern NTKERNELAPI LARGE_INTEGER IoReadTransferCount;
-extern NTKERNELAPI LARGE_INTEGER IoWriteTransferCount;
-extern NTKERNELAPI LARGE_INTEGER IoOtherTransferCount;
-
-#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE    64
-#define IO_FILE_OBJECT_PAGED_POOL_CHARGE        1024
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-typedef struct _IO_PRIORITY_INFO {
-  ULONG Size;
-  ULONG ThreadPriority;
-  ULONG PagePriority;
-  IO_PRIORITY_HINT IoPriority;
-} IO_PRIORITY_INFO, *PIO_PRIORITY_INFO;
-#endif
-
-typedef struct _PUBLIC_OBJECT_BASIC_INFORMATION {
-  ULONG Attributes;
-  ACCESS_MASK GrantedAccess;
-  ULONG HandleCount;
-  ULONG PointerCount;
-  ULONG Reserved[10];
-} PUBLIC_OBJECT_BASIC_INFORMATION, *PPUBLIC_OBJECT_BASIC_INFORMATION;
-
-typedef struct _PUBLIC_OBJECT_TYPE_INFORMATION {
-  UNICODE_STRING TypeName;
-  ULONG Reserved [22];
-} PUBLIC_OBJECT_TYPE_INFORMATION, *PPUBLIC_OBJECT_TYPE_INFORMATION;
-
-#define SYSTEM_PAGE_PRIORITY_BITS       3
-#define SYSTEM_PAGE_PRIORITY_LEVELS     (1 << SYSTEM_PAGE_PRIORITY_BITS)
-
-/******************************************************************************
- *                              Kernel Types                                  *
- ******************************************************************************/
-typedef struct _KAPC_STATE {
-  LIST_ENTRY ApcListHead[MaximumMode];
-  PKPROCESS Process;
-  BOOLEAN KernelApcInProgress;
-  BOOLEAN KernelApcPending;
-  BOOLEAN UserApcPending;
-} KAPC_STATE, *PKAPC_STATE, *RESTRICTED_POINTER PRKAPC_STATE;
-
-#define KAPC_STATE_ACTUAL_LENGTH (FIELD_OFFSET(KAPC_STATE, UserApcPending) + sizeof(BOOLEAN))
-
-#define ASSERT_QUEUE(Q) ASSERT(((Q)->Header.Type & KOBJECT_TYPE_MASK) == QueueObject);
-
-typedef struct _KQUEUE {
-  DISPATCHER_HEADER Header;
-  LIST_ENTRY EntryListHead;
-  volatile ULONG CurrentCount;
-  ULONG MaximumCount;
-  LIST_ENTRY ThreadListHead;
-} KQUEUE, *PKQUEUE, *RESTRICTED_POINTER PRKQUEUE;
-
-
-/******************************************************************************
- *                              Kernel Functions                              *
- ******************************************************************************/
-
-NTSTATUS
-NTAPI
-KeGetProcessorNumberFromIndex(
-  _In_ ULONG ProcIndex,
-  _Out_ PPROCESSOR_NUMBER ProcNumber);
-
-ULONG
-NTAPI
-KeGetProcessorIndexFromNumber(
-  _In_ PPROCESSOR_NUMBER ProcNumber);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-
-
-NTKERNELAPI
-VOID
-NTAPI
-KeInitializeMutant(
-  _Out_ PRKMUTANT Mutant,
-  _In_ BOOLEAN InitialOwner);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONG
-NTAPI
-KeReadStateMutant(
-  _In_ PRKMUTANT Mutant);
-
-_When_(Wait==0, _IRQL_requires_max_(DISPATCH_LEVEL))
-_When_(Wait==1, _IRQL_requires_max_(APC_LEVEL))
-NTKERNELAPI
-LONG
-NTAPI
-KeReleaseMutant(
-  _Inout_ PRKMUTANT Mutant,
-  _In_ KPRIORITY Increment,
-  _In_ BOOLEAN Abandoned,
-  _In_ BOOLEAN Wait);
-
-NTKERNELAPI
-VOID
-NTAPI
-KeInitializeQueue(
-  _Out_ PRKQUEUE Queue,
-  _In_ ULONG Count);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONG
-NTAPI
-KeReadStateQueue(
-  _In_ PRKQUEUE Queue);
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONG
-NTAPI
-KeInsertQueue(
-  _Inout_ PRKQUEUE Queue,
-  _Inout_ PLIST_ENTRY Entry);
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-LONG
-NTAPI
-KeInsertHeadQueue(
-  _Inout_ PRKQUEUE Queue,
-  _Inout_ PLIST_ENTRY Entry);
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_When_((Timeout==NULL || Timeout->QuadPart!=0), _IRQL_requires_max_(APC_LEVEL))
-_When_((Timeout!=NULL && Timeout->QuadPart==0), _IRQL_requires_max_(DISPATCH_LEVEL))
-NTKERNELAPI
-PLIST_ENTRY
-NTAPI
-KeRemoveQueue(
-  _Inout_ PRKQUEUE Queue,
-  _In_ KPROCESSOR_MODE WaitMode,
-  _In_opt_ PLARGE_INTEGER Timeout);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeAttachProcess(
-  _Inout_ PKPROCESS Process);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeDetachProcess(VOID);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-PLIST_ENTRY
-NTAPI
-KeRundownQueue(
-  _Inout_ PRKQUEUE Queue);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeStackAttachProcess(
-  _Inout_ PKPROCESS Process,
-  _Out_ PKAPC_STATE ApcState);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-KeUnstackDetachProcess(
-  _In_ PKAPC_STATE ApcState);
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-UCHAR
-NTAPI
-KeSetIdealProcessorThread(
-  _Inout_ PKTHREAD Thread,
-  _In_ UCHAR Processor);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-KeSetKernelStackSwapEnable(
-  _In_ BOOLEAN Enable);
-
-#if defined(_X86_)
-_Requires_lock_not_held_(*SpinLock)
-_Acquires_lock_(*SpinLock)
-_IRQL_raises_(SYNCH_LEVEL)
-_IRQL_saves_
-NTHALAPI
-KIRQL
-FASTCALL
-KeAcquireSpinLockRaiseToSynch(
-  _Inout_ PKSPIN_LOCK SpinLock);
-#else
-_Requires_lock_not_held_(*SpinLock)
-_Acquires_lock_(*SpinLock)
-_IRQL_raises_(SYNCH_LEVEL)
-_IRQL_saves_
-NTKERNELAPI
-KIRQL
-KeAcquireSpinLockRaiseToSynch(
-  _Inout_ PKSPIN_LOCK SpinLock);
-#endif
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-
-_Requires_lock_not_held_(Number)
-_Acquires_lock_(Number)
-_IRQL_raises_(DISPATCH_LEVEL)
-_DECL_HAL_KE_IMPORT
-KIRQL
-FASTCALL
-KeAcquireQueuedSpinLock(
-  _In_ KSPIN_LOCK_QUEUE_NUMBER Number);
-
-_Requires_lock_held_(Number)
-_Releases_lock_(Number)
-_DECL_HAL_KE_IMPORT
-VOID
-FASTCALL
-KeReleaseQueuedSpinLock(
-  _In_ KSPIN_LOCK_QUEUE_NUMBER Number,
-  _In_ KIRQL OldIrql);
-
-_Must_inspect_result_
-_Post_satisfies_(return == 1 || return == 0)
-_DECL_HAL_KE_IMPORT
-LOGICAL
-FASTCALL
-KeTryToAcquireQueuedSpinLock(
-  _In_ KSPIN_LOCK_QUEUE_NUMBER Number,
-  _Out_ _At_(*OldIrql, _IRQL_saves_) PKIRQL OldIrql);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-
-
-
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-KeQueryOwnerMutant(
-  _In_ PKMUTANT Mutant,
-  _Out_ PCLIENT_ID ClientId);
-
-_IRQL_requires_min_(PASSIVE_LEVEL)
-_When_((Timeout==NULL || *Timeout!=0), _IRQL_requires_max_(APC_LEVEL))
-_When_((Timeout!=NULL && *Timeout==0), _IRQL_requires_max_(DISPATCH_LEVEL))
-NTKERNELAPI
-ULONG
-NTAPI
-KeRemoveQueueEx(
-  _Inout_ PKQUEUE Queue,
-  _In_ KPROCESSOR_MODE WaitMode,
-  _In_ BOOLEAN Alertable,
-  _In_opt_ PLARGE_INTEGER Timeout,
-  _Out_writes_to_(Count, return) PLIST_ENTRY *EntryArray,
-  _In_ ULONG Count);
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-
-#define INVALID_PROCESSOR_INDEX     0xffffffff
-
-#define EX_PUSH_LOCK ULONG_PTR
-#define PEX_PUSH_LOCK PULONG_PTR
-/******************************************************************************
- *                          Executive Functions                               *
- ******************************************************************************/
-
-
-#define ExDisableResourceBoost ExDisableResourceBoostLite
-
-VOID
-NTAPI
-ExInitializePushLock(
-  _Out_ PEX_PUSH_LOCK PushLock);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-SIZE_T
-NTAPI
-ExQueryPoolBlockSize(
-  _In_ PVOID PoolBlock,
-  _Out_ PBOOLEAN QuotaCharged);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-VOID
-ExAdjustLookasideDepth(VOID);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-ExDisableResourceBoostLite(
-  _In_ PERESOURCE Resource);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-PSLIST_ENTRY
-FASTCALL
-InterlockedPushListSList(
-  _Inout_ PSLIST_HEADER ListHead,
-  _Inout_ __drv_aliasesMem PSLIST_ENTRY List,
-  _Inout_ PSLIST_ENTRY ListEnd,
-  _In_ ULONG Count);
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-/******************************************************************************
- *                            Security Manager Functions                      *
- ******************************************************************************/
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-NTKERNELAPI
-VOID
-NTAPI
-SeReleaseSubjectContext(
-  _Inout_ PSECURITY_SUBJECT_CONTEXT SubjectContext);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SePrivilegeCheck(
-  _Inout_ PPRIVILEGE_SET RequiredPrivileges,
-  _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext,
-  _In_ KPROCESSOR_MODE AccessMode);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeOpenObjectAuditAlarm(
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_opt_ PVOID Object,
-  _In_opt_ PUNICODE_STRING AbsoluteObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PACCESS_STATE AccessState,
-  _In_ BOOLEAN ObjectCreated,
-  _In_ BOOLEAN AccessGranted,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeOpenObjectForDeleteAuditAlarm(
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_opt_ PVOID Object,
-  _In_opt_ PUNICODE_STRING AbsoluteObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PACCESS_STATE AccessState,
-  _In_ BOOLEAN ObjectCreated,
-  _In_ BOOLEAN AccessGranted,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeDeleteObjectAuditAlarm(
-  _In_ PVOID Object,
-  _In_ HANDLE Handle);
-
-NTKERNELAPI
-TOKEN_TYPE
-NTAPI
-SeTokenType(
-  _In_ PACCESS_TOKEN Token);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeTokenIsAdmin(
-  _In_ PACCESS_TOKEN Token);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeTokenIsRestricted(
-  _In_ PACCESS_TOKEN Token);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeQueryAuthenticationIdToken(
-  _In_ PACCESS_TOKEN Token,
-  _Out_ PLUID AuthenticationId);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeQuerySessionIdToken(
-  _In_ PACCESS_TOKEN Token,
-  _Out_ PULONG SessionId);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeCreateClientSecurity(
-  _In_ PETHREAD ClientThread,
-  _In_ PSECURITY_QUALITY_OF_SERVICE ClientSecurityQos,
-  _In_ BOOLEAN RemoteSession,
-  _Out_ PSECURITY_CLIENT_CONTEXT ClientContext);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeImpersonateClient(
-  _In_ PSECURITY_CLIENT_CONTEXT ClientContext,
-  _In_opt_ PETHREAD ServerThread);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeImpersonateClientEx(
-  _In_ PSECURITY_CLIENT_CONTEXT ClientContext,
-  _In_opt_ PETHREAD ServerThread);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeCreateClientSecurityFromSubjectContext(
-  _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext,
-  _In_ PSECURITY_QUALITY_OF_SERVICE ClientSecurityQos,
-  _In_ BOOLEAN ServerIsRemote,
-  _Out_ PSECURITY_CLIENT_CONTEXT ClientContext);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeQuerySecurityDescriptorInfo(
-  _In_ PSECURITY_INFORMATION SecurityInformation,
-  _Out_writes_bytes_(*Length) PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _Inout_ PULONG Length,
-  _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeSetSecurityDescriptorInfo(
-  _In_opt_ PVOID Object,
-  _In_ PSECURITY_INFORMATION SecurityInformation,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
-  _In_ POOL_TYPE PoolType,
-  _In_ PGENERIC_MAPPING GenericMapping);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeSetSecurityDescriptorInfoEx(
-  _In_opt_ PVOID Object,
-  _In_ PSECURITY_INFORMATION SecurityInformation,
-  _In_ PSECURITY_DESCRIPTOR ModificationDescriptor,
-  _Inout_ PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
-  _In_ ULONG AutoInheritFlags,
-  _In_ POOL_TYPE PoolType,
-  _In_ PGENERIC_MAPPING GenericMapping);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeAppendPrivileges(
-  _Inout_ PACCESS_STATE AccessState,
-  _In_ PPRIVILEGE_SET Privileges);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeAuditingFileEvents(
-  _In_ BOOLEAN AccessGranted,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeAuditingFileOrGlobalEvents(
-  _In_ BOOLEAN AccessGranted,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext);
-
-VOID
-NTAPI
-SeSetAccessStateGenericMapping(
-  _Inout_ PACCESS_STATE AccessState,
-  _In_ PGENERIC_MAPPING GenericMapping);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeRegisterLogonSessionTerminatedRoutine(
-  _In_ PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeUnregisterLogonSessionTerminatedRoutine(
-  _In_ PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeMarkLogonSessionForTerminationNotification(
-  _In_ PLUID LogonId);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeQueryInformationToken(
-  _In_ PACCESS_TOKEN Token,
-  _In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
-  _Outptr_result_buffer_(_Inexpressible_(token-dependent)) PVOID *TokenInformation);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-#if (NTDDI_VERSION >= NTDDI_WIN2KSP3)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeAuditingHardLinkEvents(
-  _In_ BOOLEAN AccessGranted,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor);
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeFilterToken(
-  _In_ PACCESS_TOKEN ExistingToken,
-  _In_ ULONG Flags,
-  _In_opt_ PTOKEN_GROUPS SidsToDisable,
-  _In_opt_ PTOKEN_PRIVILEGES PrivilegesToDelete,
-  _In_opt_ PTOKEN_GROUPS RestrictedSids,
-  _Outptr_ PACCESS_TOKEN *FilteredToken);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeAuditHardLinkCreation(
-  _In_ PUNICODE_STRING FileName,
-  _In_ PUNICODE_STRING LinkName,
-  _In_ BOOLEAN bSuccess);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXPSP2)
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeAuditingFileEventsWithContext(
-  _In_ BOOLEAN AccessGranted,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeAuditingHardLinkEventsWithContext(
-  _In_ BOOLEAN AccessGranted,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext);
-
-#endif
-
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-NTKERNELAPI
-VOID
-NTAPI
-SeOpenObjectAuditAlarmWithTransaction(
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_opt_ PVOID Object,
-  _In_opt_ PUNICODE_STRING AbsoluteObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PACCESS_STATE AccessState,
-  _In_ BOOLEAN ObjectCreated,
-  _In_ BOOLEAN AccessGranted,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _In_opt_ GUID *TransactionId,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeOpenObjectForDeleteAuditAlarmWithTransaction(
-  _In_ PUNICODE_STRING ObjectTypeName,
-  _In_opt_ PVOID Object,
-  _In_opt_ PUNICODE_STRING AbsoluteObjectName,
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PACCESS_STATE AccessState,
-  _In_ BOOLEAN ObjectCreated,
-  _In_ BOOLEAN AccessGranted,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _In_opt_ GUID *TransactionId,
-  _Out_ PBOOLEAN GenerateOnClose);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeExamineSacl(
-  _In_ PACL Sacl,
-  _In_ PACCESS_TOKEN Token,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ BOOLEAN AccessGranted,
-  _Out_ PBOOLEAN GenerateAudit,
-  _Out_ PBOOLEAN GenerateAlarm);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeDeleteObjectAuditAlarmWithTransaction(
-  _In_ PVOID Object,
-  _In_ HANDLE Handle,
-  _In_opt_ GUID *TransactionId);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeQueryTokenIntegrity(
-  _In_ PACCESS_TOKEN Token,
-  _Inout_ PSID_AND_ATTRIBUTES IntegritySA);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-SeSetSessionIdToken(
-  _In_ PACCESS_TOKEN Token,
-  _In_ ULONG SessionId);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeAuditHardLinkCreationWithTransaction(
-  _In_ PUNICODE_STRING FileName,
-  _In_ PUNICODE_STRING LinkName,
-  _In_ BOOLEAN bSuccess,
-  _In_opt_ GUID *TransactionId);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeAuditTransactionStateChange(
-  _In_ GUID *TransactionId,
-  _In_ GUID *ResourceManagerId,
-  _In_ ULONG NewTransactionState);
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA || (NTDDI_VERSION >= NTDDI_WINXPSP2 && NTDDI_VERSION < NTDDI_WS03))
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeTokenIsWriteRestricted(
-  _In_ PACCESS_TOKEN Token);
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-SeAuditingAnyFileEventsWithContext(
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext,
-  _Out_opt_ PBOOLEAN StagingEnabled);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeExamineGlobalSacl(
-  _In_ PUNICODE_STRING ObjectType,
-  _In_ PACL ResourceSacl,
-  _In_ PACCESS_TOKEN Token,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ BOOLEAN AccessGranted,
-  _Inout_ PBOOLEAN GenerateAudit,
-  _Inout_opt_ PBOOLEAN GenerateAlarm);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeMaximumAuditMaskFromGlobalSacl(
-  _In_opt_ PUNICODE_STRING ObjectTypeName,
-  _In_ ACCESS_MASK GrantedAccess,
-  _In_ PACCESS_TOKEN Token,
-  _Inout_ PACCESS_MASK AuditMask);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-NTSTATUS
-NTAPI
-SeReportSecurityEventWithSubCategory(
-  _In_ ULONG Flags,
-  _In_ PUNICODE_STRING SourceName,
-  _In_opt_ PSID UserSid,
-  _In_ PSE_ADT_PARAMETER_ARRAY AuditParameters,
-  _In_ ULONG AuditSubcategoryId);
-
-BOOLEAN
-NTAPI
-SeAccessCheckFromState(
-  _In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
-  _In_ PTOKEN_ACCESS_INFORMATION PrimaryTokenInformation,
-  _In_opt_ PTOKEN_ACCESS_INFORMATION ClientTokenInformation,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ ACCESS_MASK PreviouslyGrantedAccess,
-  _Outptr_opt_result_maybenull_ PPRIVILEGE_SET *Privileges,
-  _In_ PGENERIC_MAPPING GenericMapping,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _Out_ PACCESS_MASK GrantedAccess,
-  _Out_ PNTSTATUS AccessStatus);
-
-NTKERNELAPI
-VOID
-NTAPI
-SeFreePrivileges(
-  _In_ PPRIVILEGE_SET Privileges);
-
-NTSTATUS
-NTAPI
-SeLocateProcessImageName(
-  _Inout_ PEPROCESS Process,
-  _Outptr_ PUNICODE_STRING *pImageFileName);
-
-#define SeLengthSid( Sid ) \
-    (8 + (4 * ((SID *)Sid)->SubAuthorityCount))
-
-#define SeDeleteClientSecurity(C)  {                                           \
-            if (SeTokenType((C)->ClientToken) == TokenPrimary) {               \
-                PsDereferencePrimaryToken( (C)->ClientToken );                 \
-            } else {                                                           \
-                PsDereferenceImpersonationToken( (C)->ClientToken );           \
-            }                                                                  \
-}
-
-#define SeStopImpersonatingClient() PsRevertToSelf()
-
-#define SeQuerySubjectContextToken( SubjectContext )                \
-    ( ARGUMENT_PRESENT(                                             \
-        ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken   \
-        ) ?                                                         \
-    ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken :     \
-    ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->PrimaryToken )
-
-extern NTKERNELAPI PSE_EXPORTS SeExports;
-
-/******************************************************************************
- *                          Process Manager Functions                         *
- ******************************************************************************/
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsLookupProcessByProcessId(
-  _In_ HANDLE ProcessId,
-  _Outptr_ PEPROCESS *Process);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsLookupThreadByThreadId(
-  _In_ HANDLE UniqueThreadId,
-  _Outptr_ PETHREAD *Thread);
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-PACCESS_TOKEN
-NTAPI
-PsReferenceImpersonationToken(
-  _Inout_ PETHREAD Thread,
-  _Out_ PBOOLEAN CopyOnOpen,
-  _Out_ PBOOLEAN EffectiveOnly,
-  _Out_ PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-LARGE_INTEGER
-NTAPI
-PsGetProcessExitTime(VOID);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-PsIsThreadTerminating(
-  _In_ PETHREAD Thread);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsImpersonateClient(
-  _Inout_ PETHREAD Thread,
-  _In_opt_ PACCESS_TOKEN Token,
-  _In_ BOOLEAN CopyOnOpen,
-  _In_ BOOLEAN EffectiveOnly,
-  _In_ SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-PsDisableImpersonation(
-  _Inout_ PETHREAD Thread,
-  _Inout_ PSE_IMPERSONATION_STATE ImpersonationState);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-PsRestoreImpersonation(
-  _Inout_ PETHREAD Thread,
-  _In_ PSE_IMPERSONATION_STATE ImpersonationState);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-PsRevertToSelf(VOID);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-PsChargePoolQuota(
-  _In_ PEPROCESS Process,
-  _In_ POOL_TYPE PoolType,
-  _In_ ULONG_PTR Amount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-PsReturnPoolQuota(
-  _In_ PEPROCESS Process,
-  _In_ POOL_TYPE PoolType,
-  _In_ ULONG_PTR Amount);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsAssignImpersonationToken(
-  _In_ PETHREAD Thread,
-  _In_opt_ HANDLE Token);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-HANDLE
-NTAPI
-PsReferencePrimaryToken(
-  _Inout_ PEPROCESS Process);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-PsDereferencePrimaryToken(
-  _In_ PACCESS_TOKEN PrimaryToken);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-PsDereferenceImpersonationToken(
-  _In_ PACCESS_TOKEN ImpersonationToken);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PsChargeProcessPoolQuota(
-  _In_ PEPROCESS Process,
-  _In_ POOL_TYPE PoolType,
-  _In_ ULONG_PTR Amount);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-PsIsSystemThread(
-  _In_ PETHREAD Thread);
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-/******************************************************************************
- *                         I/O Manager Functions                              *
- ******************************************************************************/
-
-#define IoIsFileOpenedExclusively(FileObject) ( \
-    (BOOLEAN) !(                                \
-    (FileObject)->SharedRead ||                 \
-    (FileObject)->SharedWrite ||                \
-    (FileObject)->SharedDelete                  \
-    )                                           \
-)
-
-#if (NTDDI_VERSION == NTDDI_WIN2K)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoRegisterFsRegistrationChangeEx(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine);
-#endif
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-
-NTKERNELAPI
-VOID
-NTAPI
-IoAcquireVpbSpinLock(
-  _Out_ PKIRQL Irql);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCheckDesiredAccess(
-  _Inout_ PACCESS_MASK DesiredAccess,
-  _In_ ACCESS_MASK GrantedAccess);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCheckEaBufferValidity(
-  _In_ PFILE_FULL_EA_INFORMATION EaBuffer,
-  _In_ ULONG EaLength,
-  _Out_ PULONG ErrorOffset);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCheckFunctionAccess(
-  _In_ ACCESS_MASK GrantedAccess,
-  _In_ UCHAR MajorFunction,
-  _In_ UCHAR MinorFunction,
-  _In_ ULONG IoControlCode,
-  _In_opt_ PVOID Argument1,
-  _In_opt_ PVOID Argument2);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCheckQuerySetFileInformation(
-  _In_ FILE_INFORMATION_CLASS FileInformationClass,
-  _In_ ULONG Length,
-  _In_ BOOLEAN SetOperation);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCheckQuerySetVolumeInformation(
-  _In_ FS_INFORMATION_CLASS FsInformationClass,
-  _In_ ULONG Length,
-  _In_ BOOLEAN SetOperation);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoCheckQuotaBufferValidity(
-  _In_ PFILE_QUOTA_INFORMATION QuotaBuffer,
-  _In_ ULONG QuotaLength,
-  _Out_ PULONG ErrorOffset);
-
-NTKERNELAPI
-PFILE_OBJECT
-NTAPI
-IoCreateStreamFileObject(
-  _In_opt_ PFILE_OBJECT FileObject,
-  _In_opt_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-PFILE_OBJECT
-NTAPI
-IoCreateStreamFileObjectLite(
-  _In_opt_ PFILE_OBJECT FileObject,
-  _In_opt_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoFastQueryNetworkAttributes(
-  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_ ULONG OpenOptions,
-  _Out_ PIO_STATUS_BLOCK IoStatus,
-  _Out_ PFILE_NETWORK_OPEN_INFORMATION Buffer);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoPageRead(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PMDL Mdl,
-  _In_ PLARGE_INTEGER Offset,
-  _In_ PKEVENT Event,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetBaseFileSystemDeviceObject(
-  _In_ PFILE_OBJECT FileObject);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-PCONFIGURATION_INFORMATION
-NTAPI
-IoGetConfigurationInformation(VOID);
-
-NTKERNELAPI
-ULONG
-NTAPI
-IoGetRequestorProcessId(
-  _In_ PIRP Irp);
-
-NTKERNELAPI
-PEPROCESS
-NTAPI
-IoGetRequestorProcess(
-  _In_ PIRP Irp);
-
-NTKERNELAPI
-PIRP
-NTAPI
-IoGetTopLevelIrp(VOID);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoIsOperationSynchronous(
-  _In_ PIRP Irp);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoIsSystemThread(
-  _In_ PETHREAD Thread);
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-IoIsValidNameGraftingBuffer(
-  _In_ PIRP Irp,
-  _In_ PREPARSE_DATA_BUFFER ReparseBuffer);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoQueryFileInformation(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ FILE_INFORMATION_CLASS FileInformationClass,
-  _In_ ULONG Length,
-  _Out_ PVOID FileInformation,
-  _Out_ PULONG ReturnedLength);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoQueryVolumeInformation(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ FS_INFORMATION_CLASS FsInformationClass,
-  _In_ ULONG Length,
-  _Out_ PVOID FsInformation,
-  _Out_ PULONG ReturnedLength);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoQueueThreadIrp(
-  _In_ PIRP Irp);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoRegisterFileSystem(
-  _In_ __drv_aliasesMem PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoRegisterFsRegistrationChange(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoReleaseVpbSpinLock(
-  _In_ KIRQL Irql);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoSetDeviceToVerify(
-  _In_ PETHREAD Thread,
-  _In_opt_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoSetInformation(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ FILE_INFORMATION_CLASS FileInformationClass,
-  _In_ ULONG Length,
-  _In_ PVOID FileInformation);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoSetTopLevelIrp(
-  _In_opt_ PIRP Irp);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoSynchronousPageWrite(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PMDL Mdl,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ PKEVENT Event,
-  _Out_ PIO_STATUS_BLOCK IoStatusBlock);
-
-NTKERNELAPI
-PEPROCESS
-NTAPI
-IoThreadToProcess(
-  _In_ PETHREAD Thread);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoUnregisterFileSystem(
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-VOID
-NTAPI
-IoUnregisterFsRegistrationChange(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoVerifyVolume(
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ BOOLEAN AllowRawMount);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetRequestorSessionId(
-  _In_ PIRP Irp,
-  _Out_ PULONG pSessionId);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-
-NTKERNELAPI
-PFILE_OBJECT
-NTAPI
-IoCreateStreamFileObjectEx(
-  _In_opt_ PFILE_OBJECT FileObject,
-  _In_opt_ PDEVICE_OBJECT DeviceObject,
-  _Out_opt_ PHANDLE FileObjectHandle);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoQueryFileDosDeviceName(
-  _In_ PFILE_OBJECT FileObject,
-  _Out_ POBJECT_NAME_INFORMATION *ObjectNameInformation);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoEnumerateDeviceObjectList(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _Out_writes_bytes_to_opt_(DeviceObjectListSize,(*ActualNumberDeviceObjects)*sizeof(PDEVICE_OBJECT))
-    PDEVICE_OBJECT *DeviceObjectList,
-  _In_ ULONG DeviceObjectListSize,
-  _Out_ PULONG ActualNumberDeviceObjects);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetLowerDeviceObject(
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-PDEVICE_OBJECT
-NTAPI
-IoGetDeviceAttachmentBaseRef(
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoGetDiskDeviceObject(
-  _In_ PDEVICE_OBJECT FileSystemDeviceObject,
-  _Out_ PDEVICE_OBJECT *DiskDeviceObject);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WS03SP1)
-
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoEnumerateRegisteredFiltersList(
-  _Out_writes_bytes_to_opt_(DriverObjectListSize,(*ActualNumberDriverObjects)*sizeof(PDRIVER_OBJECT))
-    PDRIVER_OBJECT *DriverObjectList,
-  _In_ ULONG DriverObjectListSize,
-  _Out_ PULONG ActualNumberDriverObjects);
-#endif /* (NTDDI_VERSION >= NTDDI_WS03SP1) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-FORCEINLINE
-VOID
-NTAPI
-IoInitializePriorityInfo(
-    _In_ PIO_PRIORITY_INFO PriorityInfo)
-{
-    PriorityInfo->Size = sizeof(IO_PRIORITY_INFO);
-    PriorityInfo->ThreadPriority = 0xffff;
-    PriorityInfo->IoPriority = IoPriorityNormal;
-    PriorityInfo->PagePriority = 0;
-}
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoRegisterFsRegistrationChangeMountAware(
-  _In_ PDRIVER_OBJECT DriverObject,
-  _In_ PDRIVER_FS_NOTIFICATION DriverNotificationRoutine,
-  _In_ BOOLEAN SynchronizeWithMounts);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-IoReplaceFileObjectName(
-  _In_ PFILE_OBJECT FileObject,
-  _In_reads_bytes_(FileNameLength) PWSTR NewFileName,
-  _In_ USHORT FileNameLength);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-
-#define PO_CB_SYSTEM_POWER_POLICY       0
-#define PO_CB_AC_STATUS                 1
-#define PO_CB_BUTTON_COLLISION          2
-#define PO_CB_SYSTEM_STATE_LOCK         3
-#define PO_CB_LID_SWITCH_STATE          4
-#define PO_CB_PROCESSOR_POWER_POLICY    5
-
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-PoQueueShutdownWorkItem(
-  _Inout_ __drv_aliasesMem PWORK_QUEUE_ITEM WorkItem);
-#endif
-/******************************************************************************
- *                         Memory manager Types                               *
- ******************************************************************************/
-typedef enum _MMFLUSH_TYPE {
-  MmFlushForDelete,
-  MmFlushForWrite
-} MMFLUSH_TYPE;
-
-typedef struct _READ_LIST {
-  PFILE_OBJECT FileObject;
-  ULONG NumberOfEntries;
-  LOGICAL IsImage;
-  FILE_SEGMENT_ELEMENT List[ANYSIZE_ARRAY];
-} READ_LIST, *PREAD_LIST;
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-typedef union _MM_PREFETCH_FLAGS {
-  struct {
-    ULONG Priority : SYSTEM_PAGE_PRIORITY_BITS;
-    ULONG RepurposePriority : SYSTEM_PAGE_PRIORITY_BITS;
-  } Flags;
-  ULONG AllFlags;
-} MM_PREFETCH_FLAGS, *PMM_PREFETCH_FLAGS;
-
-#define MM_PREFETCH_FLAGS_MASK ((1 << (2*SYSTEM_PAGE_PRIORITY_BITS)) - 1)
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#define HEAP_NO_SERIALIZE               0x00000001
-#define HEAP_GROWABLE                   0x00000002
-#define HEAP_GENERATE_EXCEPTIONS        0x00000004
-#define HEAP_ZERO_MEMORY                0x00000008
-#define HEAP_REALLOC_IN_PLACE_ONLY      0x00000010
-#define HEAP_TAIL_CHECKING_ENABLED      0x00000020
-#define HEAP_FREE_CHECKING_ENABLED      0x00000040
-#define HEAP_DISABLE_COALESCE_ON_FREE   0x00000080
-
-#define HEAP_CREATE_ALIGN_16            0x00010000
-#define HEAP_CREATE_ENABLE_TRACING      0x00020000
-#define HEAP_CREATE_ENABLE_EXECUTE      0x00040000
-
-#define HEAP_SETTABLE_USER_VALUE        0x00000100
-#define HEAP_SETTABLE_USER_FLAG1        0x00000200
-#define HEAP_SETTABLE_USER_FLAG2        0x00000400
-#define HEAP_SETTABLE_USER_FLAG3        0x00000800
-#define HEAP_SETTABLE_USER_FLAGS        0x00000E00
-
-#define HEAP_CLASS_0                    0x00000000
-#define HEAP_CLASS_1                    0x00001000
-#define HEAP_CLASS_2                    0x00002000
-#define HEAP_CLASS_3                    0x00003000
-#define HEAP_CLASS_4                    0x00004000
-#define HEAP_CLASS_5                    0x00005000
-#define HEAP_CLASS_6                    0x00006000
-#define HEAP_CLASS_7                    0x00007000
-#define HEAP_CLASS_8                    0x00008000
-#define HEAP_CLASS_MASK                 0x0000F000
-
-#define HEAP_MAXIMUM_TAG                0x0FFF
-#define HEAP_GLOBAL_TAG                 0x0800
-#define HEAP_PSEUDO_TAG_FLAG            0x8000
-#define HEAP_TAG_SHIFT                  18
-#define HEAP_TAG_MASK                  (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
-
-#define HEAP_CREATE_VALID_MASK         (HEAP_NO_SERIALIZE             |   \
-                                        HEAP_GROWABLE                 |   \
-                                        HEAP_GENERATE_EXCEPTIONS      |   \
-                                        HEAP_ZERO_MEMORY              |   \
-                                        HEAP_REALLOC_IN_PLACE_ONLY    |   \
-                                        HEAP_TAIL_CHECKING_ENABLED    |   \
-                                        HEAP_FREE_CHECKING_ENABLED    |   \
-                                        HEAP_DISABLE_COALESCE_ON_FREE |   \
-                                        HEAP_CLASS_MASK               |   \
-                                        HEAP_CREATE_ALIGN_16          |   \
-                                        HEAP_CREATE_ENABLE_TRACING    |   \
-                                        HEAP_CREATE_ENABLE_EXECUTE)
-
-/******************************************************************************
- *                       Memory manager Functions                             *
- ******************************************************************************/
-
-FORCEINLINE
-ULONG
-HEAP_MAKE_TAG_FLAGS(
-  _In_ ULONG TagBase,
-  _In_ ULONG Tag)
-{
-  //__assume_bound(TagBase); // FIXME
-  return ((ULONG)((TagBase) + ((Tag) << HEAP_TAG_SHIFT)));
-}
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmIsRecursiveIoFault(VOID);
-
-_IRQL_requires_max_ (APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmForceSectionClosed(
-  _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer,
-  _In_ BOOLEAN DelayClose);
-
-_IRQL_requires_max_ (APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmFlushImageSection(
-  _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer,
-  _In_ MMFLUSH_TYPE FlushType);
-
-_IRQL_requires_max_ (APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmCanFileBeTruncated(
-  _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer,
-  _In_opt_ PLARGE_INTEGER NewFileSize);
-
-_IRQL_requires_max_ (APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-MmSetAddressRangeModified(
-  _In_reads_bytes_ (Length) PVOID Address,
-  _In_ SIZE_T Length);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-
-_IRQL_requires_max_ (PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-MmPrefetchPages(
-  _In_ ULONG NumberOfLists,
-  _In_reads_ (NumberOfLists) PREAD_LIST *ReadLists);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-_IRQL_requires_max_ (APC_LEVEL)
-NTKERNELAPI
-ULONG
-NTAPI
-MmDoesFileHaveUserWritableReferences(
-  _In_ PSECTION_OBJECT_POINTERS SectionPointer);
-
-_Must_inspect_result_
-_At_(*BaseAddress, __drv_allocatesMem(Mem))
-__kernel_entry
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtAllocateVirtualMemory(
-    _In_ HANDLE ProcessHandle,
-    _Inout_ _Outptr_result_buffer_(*RegionSize) PVOID *BaseAddress,
-    _In_ ULONG_PTR ZeroBits,
-    _Inout_ PSIZE_T RegionSize,
-    _In_ ULONG AllocationType,
-    _In_ ULONG Protect);
-
-__kernel_entry
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSYSCALLAPI
-NTSTATUS
-NTAPI
-NtFreeVirtualMemory(
-    _In_ HANDLE ProcessHandle,
-    _Inout_ __drv_freesMem(Mem) PVOID *BaseAddress,
-    _Inout_ PSIZE_T RegionSize,
-    _In_ ULONG FreeType);
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ObInsertObject(
-  _In_ PVOID Object,
-  _Inout_opt_ PACCESS_STATE PassedAccessState,
-  _In_opt_ ACCESS_MASK DesiredAccess,
-  _In_ ULONG ObjectPointerBias,
-  _Out_opt_ PVOID *NewObject,
-  _Out_opt_ PHANDLE Handle);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ObOpenObjectByPointer(
-  _In_ PVOID Object,
-  _In_ ULONG HandleAttributes,
-  _In_opt_ PACCESS_STATE PassedAccessState,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_opt_ POBJECT_TYPE ObjectType,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _Out_ PHANDLE Handle);
-
-NTKERNELAPI
-VOID
-NTAPI
-ObMakeTemporaryObject(
-  _In_ PVOID Object);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ObQueryNameString(
-  _In_ PVOID Object,
-  _Out_writes_bytes_opt_(Length) POBJECT_NAME_INFORMATION ObjectNameInfo,
-  _In_ ULONG Length,
-  _Out_ PULONG ReturnLength);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ObQueryObjectAuditingByHandle(
-  _In_ HANDLE Handle,
-  _Out_ PBOOLEAN GenerateOnClose);
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-NTKERNELAPI
-BOOLEAN
-NTAPI
-ObIsKernelHandle(
-  _In_ HANDLE Handle);
-#endif
-
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-ObOpenObjectByPointerWithTag(
-  _In_ PVOID Object,
-  _In_ ULONG HandleAttributes,
-  _In_opt_ PACCESS_STATE PassedAccessState,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_opt_ POBJECT_TYPE ObjectType,
-  _In_ KPROCESSOR_MODE AccessMode,
-  _In_ ULONG Tag,
-  _Out_ PHANDLE Handle);
-
-NTKERNELAPI
-ULONG
-NTAPI
-ObGetObjectPointerCount(
-    _In_ PVOID Object
-);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN7) */
-
-/* FSRTL Types */
-
-typedef ULONG LBN;
-typedef LBN *PLBN;
-
-typedef ULONG VBN;
-typedef VBN *PVBN;
-
-#define FSRTL_COMMON_FCB_HEADER_LAYOUT \
-  CSHORT NodeTypeCode; \
-  CSHORT NodeByteSize; \
-  UCHAR Flags; \
-  UCHAR IsFastIoPossible; \
-  UCHAR Flags2; \
-  UCHAR Reserved:4; \
-  UCHAR Version:4; \
-  PERESOURCE Resource; \
-  PERESOURCE PagingIoResource; \
-  LARGE_INTEGER AllocationSize; \
-  LARGE_INTEGER FileSize; \
-  LARGE_INTEGER ValidDataLength;
-
-typedef struct _FSRTL_COMMON_FCB_HEADER {
-  FSRTL_COMMON_FCB_HEADER_LAYOUT
-} FSRTL_COMMON_FCB_HEADER, *PFSRTL_COMMON_FCB_HEADER;
-
-#ifdef __cplusplus
-typedef struct _FSRTL_ADVANCED_FCB_HEADER:FSRTL_COMMON_FCB_HEADER {
-#else /* __cplusplus */
-typedef struct _FSRTL_ADVANCED_FCB_HEADER {
-  FSRTL_COMMON_FCB_HEADER_LAYOUT
-#endif  /* __cplusplus */
-  PFAST_MUTEX FastMutex;
-  LIST_ENTRY FilterContexts;
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-  EX_PUSH_LOCK PushLock;
-  PVOID *FileContextSupportPointer;
-#endif
-} FSRTL_ADVANCED_FCB_HEADER, *PFSRTL_ADVANCED_FCB_HEADER;
-
-#define FSRTL_FCB_HEADER_V0             (0x00)
-#define FSRTL_FCB_HEADER_V1             (0x01)
-
-#define FSRTL_FLAG_FILE_MODIFIED        (0x01)
-#define FSRTL_FLAG_FILE_LENGTH_CHANGED  (0x02)
-#define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04)
-#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08)
-#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10)
-#define FSRTL_FLAG_USER_MAPPED_FILE     (0x20)
-#define FSRTL_FLAG_ADVANCED_HEADER      (0x40)
-#define FSRTL_FLAG_EOF_ADVANCE_ACTIVE   (0x80)
-
-#define FSRTL_FLAG2_DO_MODIFIED_WRITE        (0x01)
-#define FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS (0x02)
-#define FSRTL_FLAG2_PURGE_WHEN_MAPPED        (0x04)
-#define FSRTL_FLAG2_IS_PAGING_FILE           (0x08)
-
-#define FSRTL_FSP_TOP_LEVEL_IRP         (0x01)
-#define FSRTL_CACHE_TOP_LEVEL_IRP       (0x02)
-#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP   (0x03)
-#define FSRTL_FAST_IO_TOP_LEVEL_IRP     (0x04)
-#define FSRTL_NETWORK1_TOP_LEVEL_IRP    ((LONG_PTR)0x05)
-#define FSRTL_NETWORK2_TOP_LEVEL_IRP    ((LONG_PTR)0x06)
-#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG    ((LONG_PTR)0xFFFF)
-
-typedef struct _FSRTL_AUXILIARY_BUFFER {
-  PVOID Buffer;
-  ULONG Length;
-  ULONG Flags;
-  PMDL Mdl;
-} FSRTL_AUXILIARY_BUFFER, *PFSRTL_AUXILIARY_BUFFER;
-
-#define FSRTL_AUXILIARY_FLAG_DEALLOCATE 0x00000001
-
-typedef enum _FSRTL_COMPARISON_RESULT {
-  LessThan = -1,
-  EqualTo = 0,
-  GreaterThan = 1
-} FSRTL_COMPARISON_RESULT;
-
-#define FSRTL_FAT_LEGAL                 0x01
-#define FSRTL_HPFS_LEGAL                0x02
-#define FSRTL_NTFS_LEGAL                0x04
-#define FSRTL_WILD_CHARACTER            0x08
-#define FSRTL_OLE_LEGAL                 0x10
-#define FSRTL_NTFS_STREAM_LEGAL         (FSRTL_NTFS_LEGAL | FSRTL_OLE_LEGAL)
-
-#define FSRTL_VOLUME_DISMOUNT           1
-#define FSRTL_VOLUME_DISMOUNT_FAILED    2
-#define FSRTL_VOLUME_LOCK               3
-#define FSRTL_VOLUME_LOCK_FAILED        4
-#define FSRTL_VOLUME_UNLOCK             5
-#define FSRTL_VOLUME_MOUNT              6
-#define FSRTL_VOLUME_NEEDS_CHKDSK       7
-#define FSRTL_VOLUME_WORM_NEAR_FULL     8
-#define FSRTL_VOLUME_WEARING_OUT        9
-#define FSRTL_VOLUME_FORCED_CLOSED      10
-#define FSRTL_VOLUME_INFO_MAKE_COMPAT   11
-#define FSRTL_VOLUME_PREPARING_EJECT    12
-#define FSRTL_VOLUME_CHANGE_SIZE        13
-#define FSRTL_VOLUME_BACKGROUND_FORMAT  14
-
-typedef VOID
-(NTAPI *PFSRTL_STACK_OVERFLOW_ROUTINE)(
-  _In_ PVOID Context,
-  _In_ PKEVENT Event);
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-#define FSRTL_UNC_PROVIDER_FLAGS_MAILSLOTS_SUPPORTED    0x00000001
-#define FSRTL_UNC_PROVIDER_FLAGS_CSC_ENABLED            0x00000002
-#define FSRTL_UNC_PROVIDER_FLAGS_DOMAIN_SVC_AWARE       0x00000004
-
-#define FSRTL_ALLOCATE_ECPLIST_FLAG_CHARGE_QUOTA        0x00000001
-
-#define FSRTL_ALLOCATE_ECP_FLAG_CHARGE_QUOTA            0x00000001
-#define FSRTL_ALLOCATE_ECP_FLAG_NONPAGED_POOL           0x00000002
-
-#define FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL          0x00000002
-
-#define FSRTL_VIRTDISK_FULLY_ALLOCATED  0x00000001
-#define FSRTL_VIRTDISK_NO_DRIVE_LETTER  0x00000002
-
-typedef struct _FSRTL_MUP_PROVIDER_INFO_LEVEL_1 {
-  ULONG32 ProviderId;
-} FSRTL_MUP_PROVIDER_INFO_LEVEL_1, *PFSRTL_MUP_PROVIDER_INFO_LEVEL_1;
-
-typedef struct _FSRTL_MUP_PROVIDER_INFO_LEVEL_2 {
-  ULONG32 ProviderId;
-  UNICODE_STRING ProviderName;
-} FSRTL_MUP_PROVIDER_INFO_LEVEL_2, *PFSRTL_MUP_PROVIDER_INFO_LEVEL_2;
-
-typedef VOID
-(*PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK) (
-  _Inout_ PVOID EcpContext,
-  _In_ LPCGUID EcpType);
-
-typedef struct _ECP_LIST ECP_LIST, *PECP_LIST;
-
-typedef ULONG FSRTL_ALLOCATE_ECPLIST_FLAGS;
-typedef ULONG FSRTL_ALLOCATE_ECP_FLAGS;
-typedef ULONG FSRTL_ECP_LOOKASIDE_FLAGS;
-
-typedef enum _FSRTL_CHANGE_BACKING_TYPE {
-  ChangeDataControlArea,
-  ChangeImageControlArea,
-  ChangeSharedCacheMap
-} FSRTL_CHANGE_BACKING_TYPE, *PFSRTL_CHANGE_BACKING_TYPE;
-
-#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */
-
-typedef struct _FSRTL_PER_FILE_CONTEXT {
-  LIST_ENTRY Links;
-  PVOID OwnerId;
-  PVOID InstanceId;
-  PFREE_FUNCTION FreeCallback;
-} FSRTL_PER_FILE_CONTEXT, *PFSRTL_PER_FILE_CONTEXT;
-
-typedef struct _FSRTL_PER_STREAM_CONTEXT {
-  LIST_ENTRY Links;
-  PVOID OwnerId;
-  PVOID InstanceId;
-  PFREE_FUNCTION FreeCallback;
-} FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT;
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-typedef VOID
-(*PFN_FSRTLTEARDOWNPERSTREAMCONTEXTS) (
-  _In_ PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader);
-#endif
-
-typedef struct _FSRTL_PER_FILEOBJECT_CONTEXT {
-  LIST_ENTRY Links;
-  PVOID OwnerId;
-  PVOID InstanceId;
-} FSRTL_PER_FILEOBJECT_CONTEXT, *PFSRTL_PER_FILEOBJECT_CONTEXT;
-
-#define FSRTL_CC_FLUSH_ERROR_FLAG_NO_HARD_ERROR  0x1
-#define FSRTL_CC_FLUSH_ERROR_FLAG_NO_LOG_ENTRY   0x2
-
-typedef NTSTATUS
-(NTAPI *PCOMPLETE_LOCK_IRP_ROUTINE) (
-  _In_ PVOID Context,
-  _In_ PIRP Irp);
-
-typedef struct _FILE_LOCK_INFO {
-  LARGE_INTEGER StartingByte;
-  LARGE_INTEGER Length;
-  BOOLEAN ExclusiveLock;
-  ULONG Key;
-  PFILE_OBJECT FileObject;
-  PVOID ProcessId;
-  LARGE_INTEGER EndingByte;
-} FILE_LOCK_INFO, *PFILE_LOCK_INFO;
-
-typedef VOID
-(NTAPI *PUNLOCK_ROUTINE) (
-  _In_ PVOID Context,
-  _In_ PFILE_LOCK_INFO FileLockInfo);
-
-typedef struct _FILE_LOCK {
-  PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine;
-  PUNLOCK_ROUTINE UnlockRoutine;
-  BOOLEAN FastIoIsQuestionable;
-  BOOLEAN SpareC[3];
-  PVOID LockInformation;
-  FILE_LOCK_INFO LastReturnedLockInfo;
-  PVOID LastReturnedLock;
-  LONG volatile LockRequestsInProgress;
-} FILE_LOCK, *PFILE_LOCK;
-
-typedef struct _TUNNEL {
-  FAST_MUTEX Mutex;
-  PRTL_SPLAY_LINKS Cache;
-  LIST_ENTRY TimerQueue;
-  USHORT NumEntries;
-} TUNNEL, *PTUNNEL;
-
-typedef struct _BASE_MCB {
-  ULONG MaximumPairCount;
-  ULONG PairCount;
-  USHORT PoolType;
-  USHORT Flags;
-  PVOID Mapping;
-} BASE_MCB, *PBASE_MCB;
-
-typedef struct _LARGE_MCB {
-  PKGUARDED_MUTEX GuardedMutex;
-  BASE_MCB BaseMcb;
-} LARGE_MCB, *PLARGE_MCB;
-
-#define MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE 1
-
-typedef struct _MCB {
-  LARGE_MCB DummyFieldThatSizesThisStructureCorrectly;
-} MCB, *PMCB;
-
-typedef enum _FAST_IO_POSSIBLE {
-  FastIoIsNotPossible = 0,
-  FastIoIsPossible,
-  FastIoIsQuestionable
-} FAST_IO_POSSIBLE;
-
-typedef struct _EOF_WAIT_BLOCK {
-  LIST_ENTRY EofWaitLinks;
-  KEVENT Event;
-} EOF_WAIT_BLOCK, *PEOF_WAIT_BLOCK;
-
-typedef PVOID OPLOCK, *POPLOCK;
-
-typedef VOID
-(NTAPI *POPLOCK_WAIT_COMPLETE_ROUTINE) (
-  _In_ PVOID Context,
-  _In_ PIRP Irp);
-
-typedef VOID
-(NTAPI *POPLOCK_FS_PREPOST_IRP) (
-  _In_ PVOID Context,
-  _In_ PIRP Irp);
-
-#if (NTDDI_VERSION >= NTDDI_VISTASP1)
-#define OPLOCK_FLAG_COMPLETE_IF_OPLOCKED    0x00000001
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-#define OPLOCK_FLAG_OPLOCK_KEY_CHECK_ONLY   0x00000002
-#define OPLOCK_FLAG_BACK_OUT_ATOMIC_OPLOCK  0x00000004
-#define OPLOCK_FLAG_IGNORE_OPLOCK_KEYS      0x00000008
-#define OPLOCK_FSCTRL_FLAG_ALL_KEYS_MATCH   0x00000001
-#endif
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-
-typedef struct _OPLOCK_KEY_ECP_CONTEXT {
-  GUID OplockKey;
-  ULONG Reserved;
-} OPLOCK_KEY_ECP_CONTEXT, *POPLOCK_KEY_ECP_CONTEXT;
-
-DEFINE_GUID(GUID_ECP_OPLOCK_KEY, 0x48850596, 0x3050, 0x4be7, 0x98, 0x63, 0xfe, 0xc3, 0x50, 0xce, 0x8d, 0x7f);
-
-#endif
-
-typedef PVOID PNOTIFY_SYNC;
-
-#if (NTDDI_VERSION >= NTDDI_WIN7)
-typedef struct _ECP_HEADER ECP_HEADER, *PECP_HEADER;
-#endif
-
-typedef BOOLEAN
-(NTAPI *PCHECK_FOR_TRAVERSE_ACCESS) (
-  _In_ PVOID NotifyContext,
-  _In_opt_ PVOID TargetContext,
-  _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext);
-
-typedef BOOLEAN
-(NTAPI *PFILTER_REPORT_CHANGE) (
-  _In_ PVOID NotifyContext,
-  _In_ PVOID FilterContext);
-/* FSRTL Functions */
-
-#define FsRtlEnterFileSystem    KeEnterCriticalRegion
-#define FsRtlExitFileSystem     KeLeaveCriticalRegion
-
-#if (NTDDI_VERSION >= NTDDI_WIN2K)
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlCopyRead(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ ULONG Length,
-  _In_ BOOLEAN Wait,
-  _In_ ULONG LockKey,
-  _Out_writes_bytes_(Length) PVOID Buffer,
-  _Out_ PIO_STATUS_BLOCK IoStatus,
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlCopyWrite(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ ULONG Length,
-  _In_ BOOLEAN Wait,
-  _In_ ULONG LockKey,
-  _In_reads_bytes_(Length) PVOID Buffer,
-  _Out_ PIO_STATUS_BLOCK IoStatus,
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlMdlReadDev(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ ULONG Length,
-  _In_ ULONG LockKey,
-  _Outptr_ PMDL *MdlChain,
-  _Out_ PIO_STATUS_BLOCK IoStatus,
-  _In_opt_ PDEVICE_OBJECT DeviceObject);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlMdlReadCompleteDev(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PMDL MdlChain,
-  _In_opt_ PDEVICE_OBJECT DeviceObject);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlPrepareMdlWriteDev(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ ULONG Length,
-  _In_ ULONG LockKey,
-  _Outptr_ PMDL *MdlChain,
-  _Out_ PIO_STATUS_BLOCK IoStatus,
-  _In_ PDEVICE_OBJECT DeviceObject);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlMdlWriteCompleteDev(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ PMDL MdlChain,
-  _In_opt_ PDEVICE_OBJECT DeviceObject);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlAcquireFileExclusive(
-  _In_ PFILE_OBJECT FileObject);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlReleaseFile(
-  _In_ PFILE_OBJECT FileObject);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlGetFileSize(
-  _In_ PFILE_OBJECT FileObject,
-  _Out_ PLARGE_INTEGER FileSize);
-
-_Must_inspect_result_
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsTotalDeviceFailure(
-  _In_ NTSTATUS Status);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-PFILE_LOCK
-NTAPI
-FsRtlAllocateFileLock(
-  _In_opt_ PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine,
-  _In_opt_ PUNLOCK_ROUTINE UnlockRoutine);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlFreeFileLock(
-  _In_ PFILE_LOCK FileLock);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitializeFileLock(
-  _Out_ PFILE_LOCK FileLock,
-  _In_opt_ PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine,
-  _In_opt_ PUNLOCK_ROUTINE UnlockRoutine);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlUninitializeFileLock(
-  _Inout_ PFILE_LOCK FileLock);
-
-/*
-  FsRtlProcessFileLock:
-
-  ret:
-    -STATUS_INVALID_DEVICE_REQUEST
-    -STATUS_RANGE_NOT_LOCKED from unlock routines.
-    -STATUS_PENDING, STATUS_LOCK_NOT_GRANTED from FsRtlPrivateLock
-    (redirected IoStatus->Status).
-
-  Internals:
-    -switch ( Irp->CurrentStackLocation->MinorFunction )
-        lock: return FsRtlPrivateLock;
-        unlocksingle: return FsRtlFastUnlockSingle;
-        unlockall: return FsRtlFastUnlockAll;
-        unlockallbykey: return FsRtlFastUnlockAllByKey;
-        default: IofCompleteRequest with STATUS_INVALID_DEVICE_REQUEST;
-                 return STATUS_INVALID_DEVICE_REQUEST;
-
-    -'AllwaysZero' is passed thru as 'AllwaysZero' to lock / unlock routines.
-    -'Irp' is passet thru as 'Irp' to FsRtlPrivateLock.
-*/
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlProcessFileLock(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PIRP Irp,
-  _In_opt_ PVOID Context);
-
-/*
-  FsRtlCheckLockForReadAccess:
-
-  All this really does is pick out the lock parameters from the irp (io stack
-  location?), get IoGetRequestorProcess, and pass values on to
-  FsRtlFastCheckLockForRead.
-*/
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlCheckLockForReadAccess(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PIRP Irp);
-
-/*
-  FsRtlCheckLockForWriteAccess:
-
-  All this really does is pick out the lock parameters from the irp (io stack
-  location?), get IoGetRequestorProcess, and pass values on to
-  FsRtlFastCheckLockForWrite.
-*/
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlCheckLockForWriteAccess(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PIRP Irp);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlFastCheckLockForRead(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ PLARGE_INTEGER Length,
-  _In_ ULONG Key,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PVOID Process);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlFastCheckLockForWrite(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ PLARGE_INTEGER Length,
-  _In_ ULONG Key,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PVOID Process);
-
-/*
-  FsRtlGetNextFileLock:
-
-  ret: NULL if no more locks
-
-  Internals:
-    FsRtlGetNextFileLock uses FileLock->LastReturnedLockInfo and
-    FileLock->LastReturnedLock as storage.
-    LastReturnedLock is a pointer to the 'raw' lock inkl. double linked
-    list, and FsRtlGetNextFileLock needs this to get next lock on subsequent
-    calls with Restart = FALSE.
-*/
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-PFILE_LOCK_INFO
-NTAPI
-FsRtlGetNextFileLock(
-  _In_ PFILE_LOCK FileLock,
-  _In_ BOOLEAN Restart);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlFastUnlockSingle(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ PLARGE_INTEGER Length,
-  _In_ PEPROCESS Process,
-  _In_ ULONG Key,
-  _In_opt_ PVOID Context,
-  _In_ BOOLEAN AlreadySynchronized);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlFastUnlockAll(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PEPROCESS Process,
-  _In_opt_ PVOID Context);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlFastUnlockAllByKey(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PEPROCESS Process,
-  _In_ ULONG Key,
-  _In_opt_ PVOID Context);
-
-/*
-  FsRtlPrivateLock:
-
-  ret: IoStatus->Status: STATUS_PENDING, STATUS_LOCK_NOT_GRANTED
-
-  Internals:
-    -Calls IoCompleteRequest if Irp
-    -Uses exception handling / ExRaiseStatus with STATUS_INSUFFICIENT_RESOURCES
-*/
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-__drv_preferredFunction(FsRtlFastLock, "Obsolete")
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlPrivateLock(
-  _In_ PFILE_LOCK FileLock,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ PLARGE_INTEGER FileOffset,
-  _In_ PLARGE_INTEGER Length,
-  _In_ PEPROCESS Process,
-  _In_ ULONG Key,
-  _In_ BOOLEAN FailImmediately,
-  _In_ BOOLEAN ExclusiveLock,
-  _Out_ PIO_STATUS_BLOCK IoStatus,
-  _In_opt_ PIRP Irp,
-  _In_opt_ __drv_aliasesMem PVOID Context,
-  _In_ BOOLEAN AlreadySynchronized);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitializeTunnelCache(
-  _In_ PTUNNEL Cache);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlAddToTunnelCache(
-  _In_ PTUNNEL Cache,
-  _In_ ULONGLONG DirectoryKey,
-  _In_ PUNICODE_STRING ShortName,
-  _In_ PUNICODE_STRING LongName,
-  _In_ BOOLEAN KeyByShortName,
-  _In_ ULONG DataLength,
-  _In_reads_bytes_(DataLength) PVOID Data);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlFindInTunnelCache(
-  _In_ PTUNNEL Cache,
-  _In_ ULONGLONG DirectoryKey,
-  _In_ PUNICODE_STRING Name,
-  _Out_ PUNICODE_STRING ShortName,
-  _Out_ PUNICODE_STRING LongName,
-  _Inout_ PULONG DataLength,
-  _Out_writes_bytes_to_(*DataLength, *DataLength) PVOID Data);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlDeleteKeyFromTunnelCache(
-  _In_ PTUNNEL Cache,
-  _In_ ULONGLONG DirectoryKey);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlDeleteTunnelCache(
-  _In_ PTUNNEL Cache);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlDissectDbcs(
-  _In_ ANSI_STRING Name,
-  _Out_ PANSI_STRING FirstPart,
-  _Out_ PANSI_STRING RemainingPart);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlDoesDbcsContainWildCards(
-  _In_ PANSI_STRING Name);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsDbcsInExpression(
-  _In_ PANSI_STRING Expression,
-  _In_ PANSI_STRING Name);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsFatDbcsLegal(
-  _In_ ANSI_STRING DbcsName,
-  _In_ BOOLEAN WildCardsPermissible,
-  _In_ BOOLEAN PathNamePermissible,
-  _In_ BOOLEAN LeadingBackslashPermissible);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsHpfsDbcsLegal(
-  _In_ ANSI_STRING DbcsName,
-  _In_ BOOLEAN WildCardsPermissible,
-  _In_ BOOLEAN PathNamePermissible,
-  _In_ BOOLEAN LeadingBackslashPermissible);
-
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlNormalizeNtstatus(
-  _In_ NTSTATUS Exception,
-  _In_ NTSTATUS GenericException);
-
-_Must_inspect_result_
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsNtstatusExpected(
-  _In_ NTSTATUS Ntstatus);
-
-_IRQL_requires_max_(APC_LEVEL)
-__drv_preferredFunction(ExAllocateFromNPagedLookasideList, "The FsRtlAllocateResource routine is obsolete, but is exported to support existing driver binaries. Use ExAllocateFromNPagedLookasideList and ExInitializeResourceLite instead.")
-NTKERNELAPI
-PERESOURCE
-NTAPI
-FsRtlAllocateResource(VOID);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitializeLargeMcb(
-  _Out_ PLARGE_MCB Mcb,
-  _In_ POOL_TYPE PoolType);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlUninitializeLargeMcb(
-  _Inout_ PLARGE_MCB Mcb);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlResetLargeMcb(
-  _Inout_ PLARGE_MCB Mcb,
-  _In_ BOOLEAN SelfSynchronized);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlTruncateLargeMcb(
-  _Inout_ PLARGE_MCB Mcb,
-  _In_ LONGLONG Vbn);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlAddLargeMcbEntry(
-  _Inout_ PLARGE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG Lbn,
-  _In_ LONGLONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlRemoveLargeMcbEntry(
-  _Inout_ PLARGE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupLargeMcbEntry(
-  _In_ PLARGE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _Out_opt_ PLONGLONG Lbn,
-  _Out_opt_ PLONGLONG SectorCountFromLbn,
-  _Out_opt_ PLONGLONG StartingLbn,
-  _Out_opt_ PLONGLONG SectorCountFromStartingLbn,
-  _Out_opt_ PULONG Index);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupLastLargeMcbEntry(
-  _In_ PLARGE_MCB Mcb,
-  _Out_ PLONGLONG Vbn,
-  _Out_ PLONGLONG Lbn);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupLastLargeMcbEntryAndIndex(
-  _In_ PLARGE_MCB OpaqueMcb,
-  _Out_ PLONGLONG LargeVbn,
-  _Out_ PLONGLONG LargeLbn,
-  _Out_ PULONG Index);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-ULONG
-NTAPI
-FsRtlNumberOfRunsInLargeMcb(
-  _In_ PLARGE_MCB Mcb);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlGetNextLargeMcbEntry(
-  _In_ PLARGE_MCB Mcb,
-  _In_ ULONG RunIndex,
-  _Out_ PLONGLONG Vbn,
-  _Out_ PLONGLONG Lbn,
-  _Out_ PLONGLONG SectorCount);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlSplitLargeMcb(
-  _Inout_ PLARGE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG Amount);
-
-_IRQL_requires_max_(APC_LEVEL)
-__drv_preferredFunction(FsRtlInitializeLargeMcb, "Obsolete")
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitializeMcb(
-  _Out_ PMCB Mcb,
-  _In_ POOL_TYPE PoolType);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlUninitializeMcb(
-  _Inout_ PMCB Mcb);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlTruncateMcb(
-  _Inout_ PMCB Mcb,
-  _In_ VBN Vbn);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlAddMcbEntry(
-  _Inout_ PMCB Mcb,
-  _In_ VBN Vbn,
-  _In_ LBN Lbn,
-  _In_ ULONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlRemoveMcbEntry(
-  _Inout_ PMCB Mcb,
-  _In_ VBN Vbn,
-  _In_ ULONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupMcbEntry(
-  _In_ PMCB Mcb,
-  _In_ VBN Vbn,
-  _Out_ PLBN Lbn,
-  _Out_opt_ PULONG SectorCount,
-  _Out_ PULONG Index);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupLastMcbEntry(
-  _In_ PMCB Mcb,
-  _Out_ PVBN Vbn,
-  _Out_ PLBN Lbn);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-ULONG
-NTAPI
-FsRtlNumberOfRunsInMcb(
-  _In_ PMCB Mcb);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlGetNextMcbEntry(
-  _In_ PMCB Mcb,
-  _In_ ULONG RunIndex,
-  _Out_ PVBN Vbn,
-  _Out_ PLBN Lbn,
-  _Out_ PULONG SectorCount);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlBalanceReads(
-  _In_ PDEVICE_OBJECT TargetDevice);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitializeOplock(
-  _Inout_ POPLOCK Oplock);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlUninitializeOplock(
-  _Inout_ POPLOCK Oplock);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlOplockFsctrl(
-  _In_ POPLOCK Oplock,
-  _In_ PIRP Irp,
-  _In_ ULONG OpenCount);
-
-_When_(CompletionRoutine != NULL, _Must_inspect_result_)
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlCheckOplock(
-  _In_ POPLOCK Oplock,
-  _In_ PIRP Irp,
-  _In_opt_ PVOID Context,
-  _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
-  _In_opt_ POPLOCK_FS_PREPOST_IRP PostIrpRoutine);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlOplockIsFastIoPossible(
-  _In_ POPLOCK Oplock);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlCurrentBatchOplock(
-  _In_ POPLOCK Oplock);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlNotifyVolumeEvent(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ ULONG EventCode);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyInitializeSync(
-  _In_ PNOTIFY_SYNC *NotifySync);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyUninitializeSync(
-  _In_ PNOTIFY_SYNC *NotifySync);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyFullChangeDirectory(
-  _In_ PNOTIFY_SYNC NotifySync,
-  _In_ PLIST_ENTRY NotifyList,
-  _In_ PVOID FsContext,
-  _In_ PSTRING FullDirectoryName,
-  _In_ BOOLEAN WatchTree,
-  _In_ BOOLEAN IgnoreBuffer,
-  _In_ ULONG CompletionFilter,
-  _In_opt_ PIRP NotifyIrp,
-  _In_opt_ PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback,
-  _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectContext);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyFilterReportChange(
-  _In_ PNOTIFY_SYNC NotifySync,
-  _In_ PLIST_ENTRY NotifyList,
-  _In_ PSTRING FullTargetName,
-  _In_ USHORT TargetNameOffset,
-  _In_opt_ PSTRING StreamName,
-  _In_opt_ PSTRING NormalizedParentName,
-  _In_ ULONG FilterMatch,
-  _In_ ULONG Action,
-  _In_opt_ PVOID TargetContext,
-  _In_opt_ PVOID FilterContext);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyFullReportChange(
-  _In_ PNOTIFY_SYNC NotifySync,
-  _In_ PLIST_ENTRY NotifyList,
-  _In_ PSTRING FullTargetName,
-  _In_ USHORT TargetNameOffset,
-  _In_opt_ PSTRING StreamName,
-  _In_opt_ PSTRING NormalizedParentName,
-  _In_ ULONG FilterMatch,
-  _In_ ULONG Action,
-  _In_opt_ PVOID TargetContext);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyCleanup(
-  _In_ PNOTIFY_SYNC NotifySync,
-  _In_ PLIST_ENTRY NotifyList,
-  _In_ PVOID FsContext);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlDissectName(
-  _In_ UNICODE_STRING Name,
-  _Out_ PUNICODE_STRING FirstPart,
-  _Out_ PUNICODE_STRING RemainingPart);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlDoesNameContainWildCards(
-  _In_ PUNICODE_STRING Name);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlAreNamesEqual(
-  _In_ PCUNICODE_STRING Name1,
-  _In_ PCUNICODE_STRING Name2,
-  _In_ BOOLEAN IgnoreCase,
-  _In_reads_opt_(0x10000) PCWCH UpcaseTable);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlIsNameInExpression(
-  _In_ PUNICODE_STRING Expression,
-  _In_ PUNICODE_STRING Name,
-  _In_ BOOLEAN IgnoreCase,
-  _In_opt_ PWCHAR UpcaseTable);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlPostPagingFileStackOverflow(
-  _In_ PVOID Context,
-  _In_ PKEVENT Event,
-  _In_ PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlPostStackOverflow (
-  _In_ PVOID Context,
-  _In_ PKEVENT Event,
-  _In_ PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlRegisterUncProvider(
-  _Out_ PHANDLE MupHandle,
-  _In_ PUNICODE_STRING RedirectorDeviceName,
-  _In_ BOOLEAN MailslotsSupported);
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlDeregisterUncProvider(
-  _In_ HANDLE Handle);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlTeardownPerStreamContexts(
-  _In_ PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlCreateSectionForDataScan(
-  _Out_ PHANDLE SectionHandle,
-  _Outptr_ PVOID *SectionObject,
-  _Out_opt_ PLARGE_INTEGER SectionFileSize,
-  _In_ PFILE_OBJECT FileObject,
-  _In_ ACCESS_MASK DesiredAccess,
-  _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
-  _In_opt_ PLARGE_INTEGER MaximumSize,
-  _In_ ULONG SectionPageProtection,
-  _In_ ULONG AllocationAttributes,
-  _In_ ULONG Flags);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyFilterChangeDirectory(
-  _In_ PNOTIFY_SYNC NotifySync,
-  _In_ PLIST_ENTRY NotifyList,
-  _In_ PVOID FsContext,
-  _In_ PSTRING FullDirectoryName,
-  _In_ BOOLEAN WatchTree,
-  _In_ BOOLEAN IgnoreBuffer,
-  _In_ ULONG CompletionFilter,
-  _In_opt_ PIRP NotifyIrp,
-  _In_opt_ PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback,
-  _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectContext,
-  _In_opt_ PFILTER_REPORT_CHANGE FilterCallback);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlInsertPerStreamContext(
-  _In_ PFSRTL_ADVANCED_FCB_HEADER PerStreamContext,
-  _In_ PFSRTL_PER_STREAM_CONTEXT Ptr);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-PFSRTL_PER_STREAM_CONTEXT
-NTAPI
-FsRtlLookupPerStreamContextInternal(
-  _In_ PFSRTL_ADVANCED_FCB_HEADER StreamContext,
-  _In_opt_ PVOID OwnerId,
-  _In_opt_ PVOID InstanceId);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-PFSRTL_PER_STREAM_CONTEXT
-NTAPI
-FsRtlRemovePerStreamContext(
-  _In_ PFSRTL_ADVANCED_FCB_HEADER StreamContext,
-  _In_opt_ PVOID OwnerId,
-  _In_opt_ PVOID InstanceId);
-
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlIncrementCcFastReadNotPossible(
-  VOID);
-
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlIncrementCcFastReadWait(VOID);
-
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlIncrementCcFastReadNoWait(VOID);
-
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlIncrementCcFastReadResourceMiss(VOID);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-LOGICAL
-NTAPI
-FsRtlIsPagingFile(
-  _In_ PFILE_OBJECT FileObject);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
-
-#if (NTDDI_VERSION >= NTDDI_WS03)
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitializeBaseMcb(
-  _Out_ PBASE_MCB Mcb,
-  _In_ POOL_TYPE PoolType);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlUninitializeBaseMcb(
-  _In_ PBASE_MCB Mcb);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlResetBaseMcb(
-  _Out_ PBASE_MCB Mcb);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlTruncateBaseMcb(
-  _Inout_ PBASE_MCB Mcb,
-  _In_ LONGLONG Vbn);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlAddBaseMcbEntry(
-  _Inout_ PBASE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG Lbn,
-  _In_ LONGLONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlRemoveBaseMcbEntry(
-  _Inout_ PBASE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupBaseMcbEntry(
-  _In_ PBASE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _Out_opt_ PLONGLONG Lbn,
-  _Out_opt_ PLONGLONG SectorCountFromLbn,
-  _Out_opt_ PLONGLONG StartingLbn,
-  _Out_opt_ PLONGLONG SectorCountFromStartingLbn,
-  _Out_opt_ PULONG Index);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupLastBaseMcbEntry(
-  _In_ PBASE_MCB Mcb,
-  _Out_ PLONGLONG Vbn,
-  _Out_ PLONGLONG Lbn);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlLookupLastBaseMcbEntryAndIndex(
-  _In_ PBASE_MCB OpaqueMcb,
-  _Inout_ PLONGLONG LargeVbn,
-  _Inout_ PLONGLONG LargeLbn,
-  _Inout_ PULONG Index);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-ULONG
-NTAPI
-FsRtlNumberOfRunsInBaseMcb(
-  _In_ PBASE_MCB Mcb);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlGetNextBaseMcbEntry(
-  _In_ PBASE_MCB Mcb,
-  _In_ ULONG RunIndex,
-  _Out_ PLONGLONG Vbn,
-  _Out_ PLONGLONG Lbn,
-  _Out_ PLONGLONG SectorCount);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlSplitBaseMcb(
-  _Inout_ PBASE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG Amount);
-
-#endif /* (NTDDI_VERSION >= NTDDI_WS03) */
-
-#if (NTDDI_VERSION >= NTDDI_VISTA)
-
-_When_(!Flags & MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE, _Must_inspect_result_)
-_IRQL_requires_max_(APC_LEVEL)
-BOOLEAN
-NTAPI
-FsRtlInitializeBaseMcbEx(
-  _Out_ PBASE_MCB Mcb,
-  _In_ POOL_TYPE PoolType,
-  _In_ USHORT Flags);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTSTATUS
-NTAPI
-FsRtlAddBaseMcbEntryEx(
-  _Inout_ PBASE_MCB Mcb,
-  _In_ LONGLONG Vbn,
-  _In_ LONGLONG Lbn,
-  _In_ LONGLONG SectorCount);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-BOOLEAN
-NTAPI
-FsRtlCurrentOplock(
-  _In_ POPLOCK Oplock);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlOplockBreakToNone(
-  _Inout_ POPLOCK Oplock,
-  _In_opt_ PIO_STACK_LOCATION IrpSp,
-  _In_ PIRP Irp,
-  _In_opt_ PVOID Context,
-  _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine,
-  _In_opt_ POPLOCK_FS_PREPOST_IRP PostIrpRoutine);
-
-_IRQL_requires_max_(DISPATCH_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlNotifyVolumeEventEx(
-  _In_ PFILE_OBJECT FileObject,
-  _In_ ULONG EventCode,
-  _In_ PTARGET_DEVICE_CUSTOM_NOTIFICATION Event);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlNotifyCleanupAll(
-  _In_ PNOTIFY_SYNC NotifySync,
-  _In_ PLIST_ENTRY NotifyList);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTSTATUS
-NTAPI
-FsRtlRegisterUncProviderEx(
-  _Out_ PHANDLE MupHandle,
-  _In_ PUNICODE_STRING RedirDevName,
-  _In_ PDEVICE_OBJECT DeviceObject,
-  _In_ ULONG Flags);
-
-_Must_inspect_result_
-_When_(Irp!=NULL, _IRQL_requires_max_(PASSIVE_LEVEL))
-_When_(Irp==NULL, _IRQL_requires_max_(APC_LEVEL))
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlCancellableWaitForSingleObject(
-  _In_ PVOID Object,
-  _In_opt_ PLARGE_INTEGER Timeout,
-  _In_opt_ PIRP Irp);
-
-_Must_inspect_result_
-_When_(Irp != NULL, _IRQL_requires_max_(PASSIVE_LEVEL))
-_When_(Irp == NULL, _IRQL_requires_max_(APC_LEVEL))
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlCancellableWaitForMultipleObjects(
-  _In_ ULONG Count,
-  _In_reads_(Count) PVOID ObjectArray[],
-  _In_ WAIT_TYPE WaitType,
-  _In_opt_ PLARGE_INTEGER Timeout,
-  _In_opt_ PKWAIT_BLOCK WaitBlockArray,
-  _In_opt_ PIRP Irp);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlMupGetProviderInfoFromFileObject(
-  _In_ PFILE_OBJECT pFileObject,
-  _In_ ULONG Level,
-  _Out_writes_bytes_(*pBufferSize) PVOID pBuffer,
-  _Inout_ PULONG pBufferSize);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlMupGetProviderIdFromName(
-  _In_ PUNICODE_STRING pProviderName,
-  _Out_ PULONG32 pProviderId);
-
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlIncrementCcFastMdlReadWait(VOID);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlValidateReparsePointBuffer(
-  _In_ ULONG BufferLength,
-  _In_reads_bytes_(BufferLength) PREPARSE_DATA_BUFFER ReparseBuffer);
-
-_Must_inspect_result_
-_IRQL_requires_max_(PASSIVE_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlRemoveDotsFromPath(
-  _Inout_updates_bytes_(PathLength) PWSTR OriginalString,
-  _In_ USHORT PathLength,
-  _Out_ USHORT *NewLength);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlAllocateExtraCreateParameterList(
-  _In_ FSRTL_ALLOCATE_ECPLIST_FLAGS Flags,
-  _Outptr_ PECP_LIST *EcpList);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlFreeExtraCreateParameterList(
-  _In_ PECP_LIST EcpList);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlAllocateExtraCreateParameter(
-  _In_ LPCGUID EcpType,
-  _In_ ULONG SizeOfContext,
-  _In_ FSRTL_ALLOCATE_ECP_FLAGS Flags,
-  _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback,
-  _In_ ULONG PoolTag,
-  _Outptr_result_bytebuffer_(SizeOfContext) PVOID *EcpContext);
-
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlFreeExtraCreateParameter(
-  _In_ PVOID EcpContext);
-
-_When_(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL, _IRQL_requires_max_(DISPATCH_LEVEL))
-_When_(!(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL), _IRQL_requires_max_(APC_LEVEL))
-NTKERNELAPI
-VOID
-NTAPI
-FsRtlInitExtraCreateParameterLookasideList(
-  _Inout_ PVOID Lookaside,
-  _In_ FSRTL_ECP_LOOKASIDE_FLAGS Flags,
-  _In_ SIZE_T Size,
-  _In_ ULONG Tag);
-
-_When_(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL, _IRQL_requires_max_(DISPATCH_LEVEL))
-_When_(!(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL), _IRQL_requires_max_(APC_LEVEL))
-VOID
-NTAPI
-FsRtlDeleteExtraCreateParameterLookasideList(
-  _Inout_ PVOID Lookaside,
-  _In_ FSRTL_ECP_LOOKASIDE_FLAGS Flags);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlAllocateExtraCreateParameterFromLookasideList(
-  _In_ LPCGUID EcpType,
-  ULONG SizeOfContext,
-  _In_ FSRTL_ALLOCATE_ECP_FLAGS Flags,
-  _In_opt_ PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback,
-  _Inout_ PVOID LookasideList,
-  _Outptr_ PVOID *EcpContext);
-
-_Must_inspect_result_
-_IRQL_requires_max_(APC_LEVEL)
-NTKERNELAPI
-NTSTATUS
-NTAPI
-FsRtlInsertExtraCreateParameter(
<