win-pvdrivers

changeset 345:718e0ffe104c

suck in some headers from mingw, since they're wrong so we can fix them. Hopefully these can go away once mingw is fixed.
author Andy Grover <andy.grover@oracle.com>
date Tue Jul 01 15:17:56 2008 -0700 (2008-07-01)
parents f6841337b2c2
children a3e81bb18d0b
files mingw/inc/ntddk.h mingw/inc/winddk.h
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mingw/inc/ntddk.h	Tue Jul 01 15:17:56 2008 -0700
     1.3 @@ -0,0 +1,93 @@
     1.4 +/* Private copy because we needed tweak winddk.h */
     1.5 +
     1.6 +/*
     1.7 + * ntddk.h
     1.8 + *
     1.9 + * Windows Device Driver Kit
    1.10 + *
    1.11 + * This file is part of the w32api package.
    1.12 + *
    1.13 + * Contributors:
    1.14 + *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
    1.15 + *
    1.16 + * THIS SOFTWARE IS NOT COPYRIGHTED
    1.17 + *
    1.18 + * This source code is offered for use in the public domain. You may
    1.19 + * use, modify or distribute it freely.
    1.20 + *
    1.21 + * This code is distributed in the hope that it will be useful but
    1.22 + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
    1.23 + * DISCLAIMED. This includes but is not limited to warranties of
    1.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    1.25 + *
    1.26 + * DEFINES:
    1.27 + *    DBG             - Debugging enabled/disabled (0/1)
    1.28 + *    POOL_TAGGING    - Enable pool tagging
    1.29 + *    _X86_           - X86 environment
    1.30 + *   __USE_NTOSKRNL__ - Use ntoskrnl.exe exports instead of kernel32.dll
    1.31 + */
    1.32 +
    1.33 +#ifndef __NTDDK_H
    1.34 +#define __NTDDK_H
    1.35 +
    1.36 +#if __GNUC__ >= 3
    1.37 +#pragma GCC system_header
    1.38 +#endif
    1.39 +
    1.40 +#ifndef __USE_NTOSKRNL__
    1.41 +#define __USE_NTOSKRNL__ 1
    1.42 +#endif
    1.43 +
    1.44 +#ifdef __cplusplus
    1.45 +extern "C" {
    1.46 +#endif
    1.47 +
    1.48 +#include <stdarg.h>
    1.49 +#include <windef.h>
    1.50 +#include <ntdef.h>
    1.51 +#include <basetyps.h>
    1.52 +
    1.53 +/* Base types, structures and definitions */
    1.54 +typedef short CSHORT;
    1.55 +typedef CONST int CINT;
    1.56 +typedef CONST char *PCSZ;
    1.57 +
    1.58 +#ifndef STATIC
    1.59 +#define STATIC static
    1.60 +#endif
    1.61 +
    1.62 +#ifndef CALLBACK
    1.63 +#define CALLBACK
    1.64 +#endif
    1.65 +
    1.66 +#ifndef DECL_IMPORT
    1.67 +#define DECL_IMPORT __declspec(dllimport)
    1.68 +#endif
    1.69 +
    1.70 +#ifndef DECL_EXPORT
    1.71 +#define DECL_EXPORT __declspec(dllexport)
    1.72 +#endif
    1.73 +
    1.74 +/* Windows NT status codes */
    1.75 +#include "ntstatus.h"
    1.76 +
    1.77 +/* Windows NT definitions exported to user mode */
    1.78 +#include <winnt.h>
    1.79 +
    1.80 +/* Windows Device Driver Kit */
    1.81 +#include "winddk.h"
    1.82 +
    1.83 +/* Definitions only in Windows XP */
    1.84 +#include "winxp.h"
    1.85 +
    1.86 +/* Definitions only in Windows 2000 */
    1.87 +#include "win2k.h"
    1.88 +
    1.89 +/* Definitions only in Windows NT 4 */
    1.90 +#include "winnt4.h"
    1.91 +
    1.92 +#ifdef __cplusplus
    1.93 +}
    1.94 +#endif
    1.95 +
    1.96 +#endif /* __NTDDK_H */
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mingw/inc/winddk.h	Tue Jul 01 15:17:56 2008 -0700
     2.3 @@ -0,0 +1,9252 @@
     2.4 +/* Private copy of header because Interlocked{Increment,Decrement} were wrong.
     2.5 +   Please check for corrected headers and ditch these when possible. */
     2.6 +
     2.7 +/*
     2.8 + * winddk.h
     2.9 + *
    2.10 + * Windows Device Driver Kit
    2.11 + *
    2.12 + * This file is part of the w32api package.
    2.13 + *
    2.14 + * Contributors:
    2.15 + *   Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
    2.16 + *
    2.17 + * THIS SOFTWARE IS NOT COPYRIGHTED
    2.18 + *
    2.19 + * This source code is offered for use in the public domain. You may
    2.20 + * use, modify or distribute it freely.
    2.21 + *
    2.22 + * This code is distributed in the hope that it will be useful but
    2.23 + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
    2.24 + * DISCLAIMED. This includes but is not limited to warranties of
    2.25 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    2.26 + *
    2.27 + */
    2.28 +
    2.29 +#ifndef __WINDDK_H
    2.30 +#define __WINDDK_H
    2.31 +
    2.32 +#if __GNUC__ >= 3
    2.33 +#pragma GCC system_header
    2.34 +#endif
    2.35 +
    2.36 +#ifdef __cplusplus
    2.37 +extern "C" {
    2.38 +#endif
    2.39 +
    2.40 +/*
    2.41 +** Definitions specific to this Device Driver Kit
    2.42 +*/
    2.43 +#define DDKAPI __stdcall
    2.44 +#define DDKFASTAPI __fastcall
    2.45 +#define DDKCDECLAPI __cdecl
    2.46 +
    2.47 +#if defined(_NTOSKRNL_)
    2.48 +#ifndef NTOSAPI
    2.49 +#define NTOSAPI DECL_EXPORT
    2.50 +#endif
    2.51 +#define DECLARE_INTERNAL_OBJECT(x) typedef struct _##x; typedef struct _##x *P##x;
    2.52 +#define DECLARE_INTERNAL_OBJECT2(x,y) typedef struct _##x; typedef struct _##x *P##y;
    2.53 +#else
    2.54 +#ifndef NTOSAPI
    2.55 +#define NTOSAPI DECL_IMPORT
    2.56 +#endif
    2.57 +#define DECLARE_INTERNAL_OBJECT(x) struct _##x; typedef struct _##x *P##x;
    2.58 +#define DECLARE_INTERNAL_OBJECT2(x,y) struct _##x; typedef struct _##x *P##y;
    2.59 +#endif
    2.60 +
    2.61 +/* Pseudo modifiers for parameters 
    2.62 +   We don't use these unnecessary defines in the w32api headers. Define
    2.63 +   them by default since that is what people expect, but allow users
    2.64 +   to avoid the pollution.  */
    2.65 +#ifndef _NO_W32_PSEUDO_MODIFIERS
    2.66 +#define IN
    2.67 +#define OUT
    2.68 +#define OPTIONAL
    2.69 +#define UNALLIGNED
    2.70 +#endif
    2.71 +
    2.72 +#define CONST const
    2.73 +#define VOLATILE volatile
    2.74 +
    2.75 +#define RESTRICTED_POINTER
    2.76 +#define POINTER_ALIGNMENT
    2.77 +
    2.78 +#ifdef NONAMELESSUNION
    2.79 +# define _DDK_DUMMYUNION_MEMBER(name) DUMMYUNIONNAME.name
    2.80 +# define _DDK_DUMMYUNION_N_MEMBER(n, name) DUMMYUNIONNAME##n.name
    2.81 +#else
    2.82 +# define _DDK_DUMMYUNION_MEMBER(name) name
    2.83 +# define _DDK_DUMMYUNION_N_MEMBER(n, name) name
    2.84 +#endif
    2.85 +
    2.86 +/*
    2.87 +** Forward declarations
    2.88 +*/
    2.89 +
    2.90 +struct _IRP;
    2.91 +struct _MDL;
    2.92 +struct _KAPC;
    2.93 +struct _KDPC;
    2.94 +struct _KPCR;
    2.95 +struct _KPRCB;
    2.96 +struct _KTSS;
    2.97 +struct _FILE_OBJECT;
    2.98 +struct _DMA_ADAPTER;
    2.99 +struct _DEVICE_OBJECT;
   2.100 +struct _DRIVER_OBJECT;
   2.101 +struct _SECTION_OBJECT;
   2.102 +struct _IO_STATUS_BLOCK;
   2.103 +struct _DEVICE_DESCRIPTION;
   2.104 +struct _SCATTER_GATHER_LIST;
   2.105 +
   2.106 +DECLARE_INTERNAL_OBJECT(ADAPTER_OBJECT)
   2.107 +DECLARE_INTERNAL_OBJECT(DMA_ADAPTER)
   2.108 +DECLARE_INTERNAL_OBJECT(IO_STATUS_BLOCK)
   2.109 +DECLARE_INTERNAL_OBJECT(SECTION_OBJECT)
   2.110 +
   2.111 +#if 1
   2.112 +/* FIXME: Unknown definitions */
   2.113 +struct _SET_PARTITION_INFORMATION_EX;
   2.114 +typedef ULONG WAIT_TYPE;
   2.115 +typedef HANDLE TRACEHANDLE;
   2.116 +typedef PVOID PWMILIB_CONTEXT;
   2.117 +typedef PVOID PSYSCTL_IRP_DISPOSITION;
   2.118 +typedef ULONG LOGICAL;
   2.119 +#endif
   2.120 +
   2.121 +/*
   2.122 +** Routines specific to this DDK
   2.123 +*/
   2.124 +
   2.125 +#define TAG(_a, _b, _c, _d) (ULONG) \
   2.126 +	(((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
   2.127 +
   2.128 +#ifdef __GNUC__
   2.129 +static __inline struct _KPCR * KeGetCurrentKPCR(
   2.130 +  VOID)
   2.131 +{
   2.132 +  ULONG Value;
   2.133 +
   2.134 +  __asm__ __volatile__ (
   2.135 +#if (__GNUC__ >= 3)
   2.136 +    /* support -masm=intel */
   2.137 +    "mov{l} {%%fs:0x18, %0|%0, %%fs:0x18}\n\t"
   2.138 +#else
   2.139 +    "movl %%fs:0x18, %0\n\t"
   2.140 +#endif
   2.141 +     : "=r" (Value)
   2.142 +     : /* no inputs */
   2.143 +  );
   2.144 +  return (struct _KPCR *) Value;
   2.145 +}
   2.146 +
   2.147 +#elif defined( __WATCOMC__ )
   2.148 +
   2.149 +extern struct _KPCR * KeGetCurrentKPCR( void );
   2.150 +#pragma aux KeGetCurrentKPCR = \
   2.151 +  "mov eax, fs:[0x18]" \
   2.152 +  value [ eax ];
   2.153 +
   2.154 +#endif
   2.155 +
   2.156 +/*
   2.157 +** Simple structures
   2.158 +*/
   2.159 +
   2.160 +typedef LONG KPRIORITY;
   2.161 +typedef UCHAR KIRQL, *PKIRQL;
   2.162 +typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK;
   2.163 +typedef ULONG_PTR KAFFINITY, *PKAFFINITY;
   2.164 +typedef CCHAR KPROCESSOR_MODE;
   2.165 +
   2.166 +typedef enum _MODE {
   2.167 +  KernelMode,
   2.168 +  UserMode,
   2.169 +  MaximumMode
   2.170 +} MODE;
   2.171 +
   2.172 +
   2.173 +/* Structures not exposed to drivers */
   2.174 +typedef struct _IO_TIMER *PIO_TIMER;
   2.175 +typedef struct _EPROCESS *PEPROCESS;
   2.176 +typedef struct _ETHREAD *PETHREAD;
   2.177 +typedef struct _KINTERRUPT *PKINTERRUPT;
   2.178 +typedef struct _OBJECT_TYPE *POBJECT_TYPE;
   2.179 +typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
   2.180 +typedef struct _COMPRESSED_DATA_INFO *PCOMPRESSED_DATA_INFO;
   2.181 +typedef struct _HAL_DISPATCH_TABLE *PHAL_DISPATCH_TABLE;
   2.182 +typedef struct _HAL_PRIVATE_DISPATCH_TABLE *PHAL_PRIVATE_DISPATCH_TABLE;
   2.183 +typedef struct _DRIVE_LAYOUT_INFORMATION *PDRIVE_LAYOUT_INFORMATION;
   2.184 +typedef struct _DRIVE_LAYOUT_INFORMATION_EX *PDRIVE_LAYOUT_INFORMATION_EX;
   2.185 +
   2.186 +/* Constants */
   2.187 +#define	MAXIMUM_PROCESSORS                32
   2.188 +
   2.189 +#define MAXIMUM_WAIT_OBJECTS              64
   2.190 +
   2.191 +#define METHOD_BUFFERED                   0
   2.192 +#define METHOD_IN_DIRECT                  1
   2.193 +#define METHOD_OUT_DIRECT                 2
   2.194 +#define METHOD_NEITHER                    3
   2.195 +
   2.196 +#define LOW_PRIORITY                      0
   2.197 +#define LOW_REALTIME_PRIORITY             16
   2.198 +#define HIGH_PRIORITY                     31
   2.199 +#define MAXIMUM_PRIORITY                  32
   2.200 +
   2.201 +#define FILE_SUPERSEDED                   0x00000000
   2.202 +#define FILE_OPENED                       0x00000001
   2.203 +#define FILE_CREATED                      0x00000002
   2.204 +#define FILE_OVERWRITTEN                  0x00000003
   2.205 +#define FILE_EXISTS                       0x00000004
   2.206 +#define FILE_DOES_NOT_EXIST               0x00000005
   2.207 +
   2.208 +/* also in winnt.h */
   2.209 +#define FILE_LIST_DIRECTORY               0x00000001
   2.210 +#define FILE_READ_DATA                    0x00000001
   2.211 +#define FILE_ADD_FILE                     0x00000002
   2.212 +#define FILE_WRITE_DATA                   0x00000002
   2.213 +#define FILE_ADD_SUBDIRECTORY             0x00000004
   2.214 +#define FILE_APPEND_DATA                  0x00000004
   2.215 +#define FILE_CREATE_PIPE_INSTANCE         0x00000004
   2.216 +#define FILE_READ_EA                      0x00000008
   2.217 +#define FILE_WRITE_EA                     0x00000010
   2.218 +#define FILE_EXECUTE                      0x00000020
   2.219 +#define FILE_TRAVERSE                     0x00000020
   2.220 +#define FILE_DELETE_CHILD                 0x00000040
   2.221 +#define FILE_READ_ATTRIBUTES              0x00000080
   2.222 +#define FILE_WRITE_ATTRIBUTES             0x00000100
   2.223 +
   2.224 +#define FILE_SHARE_READ                   0x00000001
   2.225 +#define FILE_SHARE_WRITE                  0x00000002
   2.226 +#define FILE_SHARE_DELETE                 0x00000004
   2.227 +#define FILE_SHARE_VALID_FLAGS            0x00000007
   2.228 +
   2.229 +#define FILE_ATTRIBUTE_READONLY           0x00000001
   2.230 +#define FILE_ATTRIBUTE_HIDDEN             0x00000002
   2.231 +#define FILE_ATTRIBUTE_SYSTEM             0x00000004
   2.232 +#define FILE_ATTRIBUTE_DIRECTORY          0x00000010
   2.233 +#define FILE_ATTRIBUTE_ARCHIVE            0x00000020
   2.234 +#define FILE_ATTRIBUTE_DEVICE             0x00000040
   2.235 +#define FILE_ATTRIBUTE_NORMAL             0x00000080
   2.236 +#define FILE_ATTRIBUTE_TEMPORARY          0x00000100
   2.237 +#define FILE_ATTRIBUTE_SPARSE_FILE        0x00000200
   2.238 +#define FILE_ATTRIBUTE_REPARSE_POINT      0x00000400
   2.239 +#define FILE_ATTRIBUTE_COMPRESSED         0x00000800
   2.240 +#define FILE_ATTRIBUTE_OFFLINE            0x00001000
   2.241 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
   2.242 +#define FILE_ATTRIBUTE_ENCRYPTED          0x00004000
   2.243 +
   2.244 +#define FILE_ATTRIBUTE_VALID_FLAGS        0x00007fb7
   2.245 +#define FILE_ATTRIBUTE_VALID_SET_FLAGS    0x000031a7
   2.246 +
   2.247 +#define FILE_COPY_STRUCTURED_STORAGE      0x00000041
   2.248 +#define FILE_STRUCTURED_STORAGE           0x00000441
   2.249 +
   2.250 +#define FILE_VALID_OPTION_FLAGS           0x00ffffff
   2.251 +#define FILE_VALID_PIPE_OPTION_FLAGS      0x00000032
   2.252 +#define FILE_VALID_MAILSLOT_OPTION_FLAGS  0x00000032
   2.253 +#define FILE_VALID_SET_FLAGS              0x00000036
   2.254 +
   2.255 +#define FILE_SUPERSEDE                    0x00000000
   2.256 +#define FILE_OPEN                         0x00000001
   2.257 +#define FILE_CREATE                       0x00000002
   2.258 +#define FILE_OPEN_IF                      0x00000003
   2.259 +#define FILE_OVERWRITE                    0x00000004
   2.260 +#define FILE_OVERWRITE_IF                 0x00000005
   2.261 +#define FILE_MAXIMUM_DISPOSITION          0x00000005
   2.262 +
   2.263 +#define FILE_DIRECTORY_FILE               0x00000001
   2.264 +#define FILE_WRITE_THROUGH                0x00000002
   2.265 +#define FILE_SEQUENTIAL_ONLY              0x00000004
   2.266 +#define FILE_NO_INTERMEDIATE_BUFFERING    0x00000008
   2.267 +#define FILE_SYNCHRONOUS_IO_ALERT         0x00000010
   2.268 +#define FILE_SYNCHRONOUS_IO_NONALERT      0x00000020
   2.269 +#define FILE_NON_DIRECTORY_FILE           0x00000040
   2.270 +#define FILE_CREATE_TREE_CONNECTION       0x00000080
   2.271 +#define FILE_COMPLETE_IF_OPLOCKED         0x00000100
   2.272 +#define FILE_NO_EA_KNOWLEDGE              0x00000200
   2.273 +#define FILE_OPEN_FOR_RECOVERY            0x00000400
   2.274 +#define FILE_RANDOM_ACCESS                0x00000800
   2.275 +#define FILE_DELETE_ON_CLOSE              0x00001000
   2.276 +#define FILE_OPEN_BY_FILE_ID              0x00002000
   2.277 +#define FILE_OPEN_FOR_BACKUP_INTENT       0x00004000
   2.278 +#define FILE_NO_COMPRESSION               0x00008000
   2.279 +#define FILE_RESERVE_OPFILTER             0x00100000
   2.280 +#define FILE_OPEN_REPARSE_POINT           0x00200000
   2.281 +#define FILE_OPEN_NO_RECALL               0x00400000
   2.282 +#define FILE_OPEN_FOR_FREE_SPACE_QUERY    0x00800000
   2.283 +
   2.284 +#define FILE_ANY_ACCESS                   0x00000000
   2.285 +#define FILE_SPECIAL_ACCESS               FILE_ANY_ACCESS
   2.286 +#define FILE_READ_ACCESS                  0x00000001
   2.287 +#define FILE_WRITE_ACCESS                 0x00000002
   2.288 +
   2.289 +#define FILE_ALL_ACCESS \
   2.290 +  (STANDARD_RIGHTS_REQUIRED | \
   2.291 +   SYNCHRONIZE | \
   2.292 +   0x1FF)
   2.293 +
   2.294 +#define FILE_GENERIC_EXECUTE \
   2.295 +  (STANDARD_RIGHTS_EXECUTE | \
   2.296 +   FILE_READ_ATTRIBUTES | \
   2.297 +   FILE_EXECUTE | \
   2.298 +   SYNCHRONIZE)
   2.299 +
   2.300 +#define FILE_GENERIC_READ \
   2.301 +  (STANDARD_RIGHTS_READ | \
   2.302 +   FILE_READ_DATA | \
   2.303 +   FILE_READ_ATTRIBUTES | \
   2.304 +   FILE_READ_EA | \
   2.305 +   SYNCHRONIZE)
   2.306 +
   2.307 +#define FILE_GENERIC_WRITE \
   2.308 +  (STANDARD_RIGHTS_WRITE | \
   2.309 +   FILE_WRITE_DATA | \
   2.310 +   FILE_WRITE_ATTRIBUTES | \
   2.311 +   FILE_WRITE_EA | \
   2.312 +   FILE_APPEND_DATA | \
   2.313 +   SYNCHRONIZE)
   2.314 +/* end winnt.h */
   2.315 +
   2.316 +#define DIRECTORY_QUERY (0x0001)
   2.317 +#define DIRECTORY_TRAVERSE (0x0002)
   2.318 +#define DIRECTORY_CREATE_OBJECT (0x0004)
   2.319 +#define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
   2.320 +#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
   2.321 +  
   2.322 +/* Exported object types */
   2.323 +extern NTOSAPI POBJECT_TYPE ExDesktopObjectType;
   2.324 +extern NTOSAPI POBJECT_TYPE ExEventObjectType;
   2.325 +extern NTOSAPI POBJECT_TYPE ExSemaphoreObjectType;
   2.326 +extern NTOSAPI POBJECT_TYPE ExWindowStationObjectType;
   2.327 +extern NTOSAPI POBJECT_TYPE IoAdapterObjectType;
   2.328 +extern NTOSAPI ULONG IoDeviceHandlerObjectSize;
   2.329 +extern NTOSAPI POBJECT_TYPE IoDeviceHandlerObjectType;
   2.330 +extern NTOSAPI POBJECT_TYPE IoDeviceObjectType;
   2.331 +extern NTOSAPI POBJECT_TYPE IoDriverObjectType;
   2.332 +extern NTOSAPI POBJECT_TYPE IoFileObjectType;
   2.333 +extern NTOSAPI POBJECT_TYPE LpcPortObjectType;
   2.334 +extern NTOSAPI POBJECT_TYPE MmSectionObjectType;
   2.335 +extern NTOSAPI POBJECT_TYPE SeTokenObjectType;
   2.336 +
   2.337 +extern NTOSAPI CCHAR KeNumberProcessors;
   2.338 +extern NTOSAPI PHAL_DISPATCH_TABLE HalDispatchTable;
   2.339 +extern NTOSAPI PHAL_PRIVATE_DISPATCH_TABLE HalPrivateDispatchTable;
   2.340 +
   2.341 +
   2.342 +/*
   2.343 +** IRP function codes
   2.344 +*/
   2.345 +
   2.346 +#define IRP_MJ_CREATE                     0x00
   2.347 +#define IRP_MJ_CREATE_NAMED_PIPE          0x01
   2.348 +#define IRP_MJ_CLOSE                      0x02
   2.349 +#define IRP_MJ_READ                       0x03
   2.350 +#define IRP_MJ_WRITE                      0x04
   2.351 +#define IRP_MJ_QUERY_INFORMATION          0x05
   2.352 +#define IRP_MJ_SET_INFORMATION            0x06
   2.353 +#define IRP_MJ_QUERY_EA                   0x07
   2.354 +#define IRP_MJ_SET_EA                     0x08
   2.355 +#define IRP_MJ_FLUSH_BUFFERS              0x09
   2.356 +#define IRP_MJ_QUERY_VOLUME_INFORMATION   0x0a
   2.357 +#define IRP_MJ_SET_VOLUME_INFORMATION     0x0b
   2.358 +#define IRP_MJ_DIRECTORY_CONTROL          0x0c
   2.359 +#define IRP_MJ_FILE_SYSTEM_CONTROL        0x0d
   2.360 +#define IRP_MJ_DEVICE_CONTROL             0x0e
   2.361 +#define IRP_MJ_INTERNAL_DEVICE_CONTROL    0x0f
   2.362 +#define IRP_MJ_SCSI                       0x0f
   2.363 +#define IRP_MJ_SHUTDOWN                   0x10
   2.364 +#define IRP_MJ_LOCK_CONTROL               0x11
   2.365 +#define IRP_MJ_CLEANUP                    0x12
   2.366 +#define IRP_MJ_CREATE_MAILSLOT            0x13
   2.367 +#define IRP_MJ_QUERY_SECURITY             0x14
   2.368 +#define IRP_MJ_SET_SECURITY               0x15
   2.369 +#define IRP_MJ_POWER                      0x16
   2.370 +#define IRP_MJ_SYSTEM_CONTROL             0x17
   2.371 +#define IRP_MJ_DEVICE_CHANGE              0x18
   2.372 +#define IRP_MJ_QUERY_QUOTA                0x19
   2.373 +#define IRP_MJ_SET_QUOTA                  0x1a
   2.374 +#define IRP_MJ_PNP                        0x1b
   2.375 +#define IRP_MJ_PNP_POWER                  0x1b
   2.376 +#define IRP_MJ_MAXIMUM_FUNCTION           0x1b
   2.377 +
   2.378 +#define IRP_MN_QUERY_DIRECTORY            0x01
   2.379 +#define IRP_MN_NOTIFY_CHANGE_DIRECTORY    0x02
   2.380 +
   2.381 +#define IRP_MN_USER_FS_REQUEST            0x00
   2.382 +#define IRP_MN_MOUNT_VOLUME               0x01
   2.383 +#define IRP_MN_VERIFY_VOLUME              0x02
   2.384 +#define IRP_MN_LOAD_FILE_SYSTEM           0x03
   2.385 +#define IRP_MN_TRACK_LINK                 0x04
   2.386 +#define IRP_MN_KERNEL_CALL                0x04
   2.387 +
   2.388 +#define IRP_MN_LOCK                       0x01
   2.389 +#define IRP_MN_UNLOCK_SINGLE              0x02
   2.390 +#define IRP_MN_UNLOCK_ALL                 0x03
   2.391 +#define IRP_MN_UNLOCK_ALL_BY_KEY          0x04
   2.392 +
   2.393 +#define IRP_MN_NORMAL                     0x00
   2.394 +#define IRP_MN_DPC                        0x01
   2.395 +#define IRP_MN_MDL                        0x02
   2.396 +#define IRP_MN_COMPLETE                   0x04
   2.397 +#define IRP_MN_COMPRESSED                 0x08
   2.398 +
   2.399 +#define IRP_MN_MDL_DPC                    (IRP_MN_MDL | IRP_MN_DPC)
   2.400 +#define IRP_MN_COMPLETE_MDL               (IRP_MN_COMPLETE | IRP_MN_MDL)
   2.401 +#define IRP_MN_COMPLETE_MDL_DPC           (IRP_MN_COMPLETE_MDL | IRP_MN_DPC)
   2.402 +
   2.403 +#define IRP_MN_SCSI_CLASS                 0x01
   2.404 +
   2.405 +#define IRP_MN_START_DEVICE               0x00
   2.406 +#define IRP_MN_QUERY_REMOVE_DEVICE        0x01
   2.407 +#define IRP_MN_REMOVE_DEVICE              0x02
   2.408 +#define IRP_MN_CANCEL_REMOVE_DEVICE       0x03
   2.409 +#define IRP_MN_STOP_DEVICE                0x04
   2.410 +#define IRP_MN_QUERY_STOP_DEVICE          0x05
   2.411 +#define IRP_MN_CANCEL_STOP_DEVICE         0x06
   2.412 +
   2.413 +#define IRP_MN_QUERY_DEVICE_RELATIONS       0x07
   2.414 +#define IRP_MN_QUERY_INTERFACE              0x08
   2.415 +#define IRP_MN_QUERY_CAPABILITIES           0x09
   2.416 +#define IRP_MN_QUERY_RESOURCES              0x0A
   2.417 +#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS  0x0B
   2.418 +#define IRP_MN_QUERY_DEVICE_TEXT            0x0C
   2.419 +#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
   2.420 +
   2.421 +#define IRP_MN_READ_CONFIG                  0x0F
   2.422 +#define IRP_MN_WRITE_CONFIG                 0x10
   2.423 +#define IRP_MN_EJECT                        0x11
   2.424 +#define IRP_MN_SET_LOCK                     0x12
   2.425 +#define IRP_MN_QUERY_ID                     0x13
   2.426 +#define IRP_MN_QUERY_PNP_DEVICE_STATE       0x14
   2.427 +#define IRP_MN_QUERY_BUS_INFORMATION        0x15
   2.428 +#define IRP_MN_DEVICE_USAGE_NOTIFICATION    0x16
   2.429 +#define IRP_MN_SURPRISE_REMOVAL             0x17
   2.430 +#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
   2.431 +
   2.432 +#define IRP_MN_WAIT_WAKE                  0x00
   2.433 +#define IRP_MN_POWER_SEQUENCE             0x01
   2.434 +#define IRP_MN_SET_POWER                  0x02
   2.435 +#define IRP_MN_QUERY_POWER                0x03
   2.436 +
   2.437 +#define IRP_MN_QUERY_ALL_DATA             0x00
   2.438 +#define IRP_MN_QUERY_SINGLE_INSTANCE      0x01
   2.439 +#define IRP_MN_CHANGE_SINGLE_INSTANCE     0x02
   2.440 +#define IRP_MN_CHANGE_SINGLE_ITEM         0x03
   2.441 +#define IRP_MN_ENABLE_EVENTS              0x04
   2.442 +#define IRP_MN_DISABLE_EVENTS             0x05
   2.443 +#define IRP_MN_ENABLE_COLLECTION          0x06
   2.444 +#define IRP_MN_DISABLE_COLLECTION         0x07
   2.445 +#define IRP_MN_REGINFO                    0x08
   2.446 +#define IRP_MN_EXECUTE_METHOD             0x09
   2.447 +
   2.448 +#define IRP_MN_REGINFO_EX                 0x0b
   2.449 +
   2.450 +typedef enum _IO_ALLOCATION_ACTION {
   2.451 +  KeepObject = 1,
   2.452 +  DeallocateObject,
   2.453 +  DeallocateObjectKeepRegisters
   2.454 +} IO_ALLOCATION_ACTION, *PIO_ALLOCATION_ACTION;
   2.455 +
   2.456 +typedef IO_ALLOCATION_ACTION
   2.457 +(DDKAPI *PDRIVER_CONTROL)(
   2.458 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.459 +  /*IN*/ struct _IRP  *Irp,
   2.460 +  /*IN*/ PVOID  MapRegisterBase,
   2.461 +  /*IN*/ PVOID  Context);
   2.462 +
   2.463 +typedef VOID
   2.464 +(DDKAPI *PDRIVER_LIST_CONTROL)(
   2.465 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.466 +  /*IN*/ struct _IRP  *Irp,
   2.467 +  /*IN*/ struct _SCATTER_GATHER_LIST  *ScatterGather,
   2.468 +  /*IN*/ PVOID  Context);
   2.469 +
   2.470 +typedef NTSTATUS
   2.471 +(DDKAPI *PDRIVER_ADD_DEVICE)(
   2.472 +  /*IN*/ struct _DRIVER_OBJECT  *DriverObject,
   2.473 +  /*IN*/ struct _DEVICE_OBJECT  *PhysicalDeviceObject);
   2.474 +
   2.475 +typedef NTSTATUS
   2.476 +(DDKAPI *PIO_COMPLETION_ROUTINE)(
   2.477 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.478 +  /*IN*/ struct _IRP  *Irp,
   2.479 +  /*IN*/ PVOID  Context);
   2.480 +
   2.481 +typedef VOID
   2.482 +(DDKAPI *PDRIVER_CANCEL)(
   2.483 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.484 +  /*IN*/ struct _IRP  *Irp);
   2.485 +
   2.486 +typedef VOID
   2.487 +(DDKAPI *PKDEFERRED_ROUTINE)(
   2.488 +  /*IN*/ struct _KDPC  *Dpc,
   2.489 +  /*IN*/ PVOID  DeferredContext,
   2.490 +  /*IN*/ PVOID  SystemArgument1,
   2.491 +  /*IN*/ PVOID  SystemArgument2);
   2.492 +
   2.493 +typedef NTSTATUS
   2.494 +(DDKAPI *PDRIVER_DISPATCH)(
   2.495 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.496 +  /*IN*/ struct _IRP  *Irp);
   2.497 +
   2.498 +typedef VOID
   2.499 +(DDKAPI *PIO_DPC_ROUTINE)(
   2.500 +  /*IN*/ struct _KDPC  *Dpc,
   2.501 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.502 +  /*IN*/ struct _IRP  *Irp,
   2.503 +  /*IN*/ PVOID  Context);
   2.504 +
   2.505 +typedef NTSTATUS
   2.506 +(DDKAPI *PMM_DLL_INITIALIZE)(
   2.507 +  /*IN*/ PUNICODE_STRING  RegistryPath);
   2.508 +
   2.509 +typedef NTSTATUS
   2.510 +(DDKAPI *PMM_DLL_UNLOAD)(
   2.511 +  VOID);
   2.512 +
   2.513 +typedef NTSTATUS
   2.514 +(DDKAPI *PDRIVER_ENTRY)( 
   2.515 +  /*IN*/ struct _DRIVER_OBJECT  *DriverObject, 
   2.516 +  /*IN*/ PUNICODE_STRING  RegistryPath); 
   2.517 +
   2.518 +typedef NTSTATUS
   2.519 +(DDKAPI *PDRIVER_INITIALIZE)(
   2.520 +  /*IN*/ struct _DRIVER_OBJECT  *DriverObject, 
   2.521 +  /*IN*/ PUNICODE_STRING  RegistryPath);
   2.522 +
   2.523 +typedef BOOLEAN
   2.524 +(DDKAPI *PKSERVICE_ROUTINE)(
   2.525 +  /*IN*/ struct _KINTERRUPT  *Interrupt,
   2.526 +  /*IN*/ PVOID  ServiceContext);
   2.527 +
   2.528 +typedef VOID
   2.529 +(DDKAPI *PIO_TIMER_ROUTINE)(
   2.530 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.531 +  /*IN*/ PVOID  Context);
   2.532 +
   2.533 +typedef VOID
   2.534 +(DDKAPI *PDRIVER_REINITIALIZE)( 
   2.535 +  /*IN*/ struct _DRIVER_OBJECT  *DriverObject, 
   2.536 +  /*IN*/ PVOID  Context, 
   2.537 +  /*IN*/ ULONG  Count); 
   2.538 +
   2.539 +typedef NTSTATUS
   2.540 +(DDKAPI *PDRIVER_STARTIO)(
   2.541 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject,
   2.542 +  /*IN*/ struct _IRP  *Irp);
   2.543 +
   2.544 +typedef BOOLEAN
   2.545 +(DDKAPI *PKSYNCHRONIZE_ROUTINE)(
   2.546 +  /*IN*/ PVOID  SynchronizeContext);
   2.547 +
   2.548 +typedef VOID
   2.549 +(DDKAPI *PDRIVER_UNLOAD)( 
   2.550 +  /*IN*/ struct _DRIVER_OBJECT  *DriverObject); 
   2.551 +
   2.552 +
   2.553 +
   2.554 +/*
   2.555 +** Plug and Play structures
   2.556 +*/
   2.557 +
   2.558 +typedef VOID DDKAPI
   2.559 +(*PINTERFACE_REFERENCE)(
   2.560 +  PVOID  Context);
   2.561 +
   2.562 +typedef VOID DDKAPI
   2.563 +(*PINTERFACE_DEREFERENCE)(
   2.564 +  PVOID Context);
   2.565 +
   2.566 +typedef BOOLEAN DDKAPI
   2.567 +(*PTRANSLATE_BUS_ADDRESS)(
   2.568 +  /*IN*/ PVOID  Context,
   2.569 +  /*IN*/ PHYSICAL_ADDRESS  BusAddress,
   2.570 +  /*IN*/ ULONG  Length,
   2.571 +  /*IN OUT*/ PULONG  AddressSpace,
   2.572 +  /*OUT*/ PPHYSICAL_ADDRESS  TranslatedAddress);
   2.573 +
   2.574 +typedef struct _DMA_ADAPTER* DDKAPI
   2.575 +(*PGET_DMA_ADAPTER)(
   2.576 +  /*IN*/ PVOID  Context,
   2.577 +  /*IN*/ struct _DEVICE_DESCRIPTION  *DeviceDescriptor,
   2.578 +  /*OUT*/ PULONG  NumberOfMapRegisters);
   2.579 +
   2.580 +typedef ULONG DDKAPI
   2.581 +(*PGET_SET_DEVICE_DATA)(
   2.582 +  /*IN*/ PVOID  Context,
   2.583 +  /*IN*/ ULONG  DataType,
   2.584 +  /*IN*/ PVOID  Buffer,
   2.585 +  /*IN*/ ULONG  Offset,
   2.586 +  /*IN*/ ULONG  Length);
   2.587 +
   2.588 +typedef union _POWER_STATE {
   2.589 +  SYSTEM_POWER_STATE  SystemState;
   2.590 +  DEVICE_POWER_STATE  DeviceState;
   2.591 +} POWER_STATE, *PPOWER_STATE;
   2.592 +
   2.593 +typedef enum _POWER_STATE_TYPE {
   2.594 +  SystemPowerState,
   2.595 +  DevicePowerState
   2.596 +} POWER_STATE_TYPE, *PPOWER_STATE_TYPE;
   2.597 +
   2.598 +typedef struct _BUS_INTERFACE_STANDARD {
   2.599 +  USHORT  Size;
   2.600 +  USHORT  Version;
   2.601 +  PVOID  Context;
   2.602 +  PINTERFACE_REFERENCE  InterfaceReference;
   2.603 +  PINTERFACE_DEREFERENCE  InterfaceDereference;
   2.604 +  PTRANSLATE_BUS_ADDRESS  TranslateBusAddress;
   2.605 +  PGET_DMA_ADAPTER  GetDmaAdapter;
   2.606 +  PGET_SET_DEVICE_DATA  SetBusData;
   2.607 +  PGET_SET_DEVICE_DATA  GetBusData;
   2.608 +} BUS_INTERFACE_STANDARD, *PBUS_INTERFACE_STANDARD;
   2.609 +
   2.610 +typedef struct _DEVICE_CAPABILITIES {
   2.611 +  USHORT  Size;
   2.612 +  USHORT  Version;
   2.613 +  ULONG  DeviceD1 : 1;
   2.614 +  ULONG  DeviceD2 : 1;
   2.615 +  ULONG  LockSupported : 1;
   2.616 +  ULONG  EjectSupported : 1;
   2.617 +  ULONG  Removable : 1;
   2.618 +  ULONG  DockDevice : 1;
   2.619 +  ULONG  UniqueID : 1;
   2.620 +  ULONG  SilentInstall : 1;
   2.621 +  ULONG  RawDeviceOK : 1;
   2.622 +  ULONG  SurpriseRemovalOK : 1;
   2.623 +  ULONG  WakeFromD0 : 1;
   2.624 +  ULONG  WakeFromD1 : 1;
   2.625 +  ULONG  WakeFromD2 : 1;
   2.626 +  ULONG  WakeFromD3 : 1;
   2.627 +  ULONG  HardwareDisabled : 1;
   2.628 +  ULONG  NonDynamic : 1;
   2.629 +  ULONG  WarmEjectSupported : 1;
   2.630 +  ULONG  NoDisplayInUI : 1;
   2.631 +  ULONG  Reserved : 14;
   2.632 +  ULONG  Address;
   2.633 +  ULONG  UINumber;
   2.634 +  DEVICE_POWER_STATE  DeviceState[PowerSystemMaximum];
   2.635 +  SYSTEM_POWER_STATE  SystemWake;
   2.636 +  DEVICE_POWER_STATE  DeviceWake;
   2.637 +  ULONG  D1Latency;
   2.638 +  ULONG  D2Latency;
   2.639 +  ULONG  D3Latency;
   2.640 +} DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
   2.641 +
   2.642 +typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION {
   2.643 +  USHORT  Version;
   2.644 +  USHORT  Size;
   2.645 +  GUID  Event;
   2.646 +  GUID  InterfaceClassGuid;
   2.647 +  PUNICODE_STRING  SymbolicLinkName;
   2.648 +} DEVICE_INTERFACE_CHANGE_NOTIFICATION, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION;
   2.649 +
   2.650 +typedef struct _HWPROFILE_CHANGE_NOTIFICATION {
   2.651 +  USHORT  Version;
   2.652 +  USHORT  Size;
   2.653 +  GUID  Event;
   2.654 +} HWPROFILE_CHANGE_NOTIFICATION, *PHWPROFILE_CHANGE_NOTIFICATION;
   2.655 +
   2.656 +#undef INTERFACE
   2.657 +
   2.658 +typedef struct _INTERFACE {
   2.659 +  USHORT  Size;
   2.660 +  USHORT  Version;
   2.661 +  PVOID  Context;
   2.662 +  PINTERFACE_REFERENCE  InterfaceReference;
   2.663 +  PINTERFACE_DEREFERENCE  InterfaceDereference;
   2.664 +} INTERFACE, *PINTERFACE; 
   2.665 +
   2.666 +typedef struct _PLUGPLAY_NOTIFICATION_HEADER {
   2.667 +  USHORT  Version; 
   2.668 +  USHORT  Size; 
   2.669 +  GUID  Event;
   2.670 +} PLUGPLAY_NOTIFICATION_HEADER, *PPLUGPLAY_NOTIFICATION_HEADER;
   2.671 +
   2.672 +typedef ULONG PNP_DEVICE_STATE, *PPNP_DEVICE_STATE;
   2.673 +
   2.674 +/* PNP_DEVICE_STATE */
   2.675 +
   2.676 +#define PNP_DEVICE_DISABLED                      0x00000001
   2.677 +#define PNP_DEVICE_DONT_DISPLAY_IN_UI            0x00000002
   2.678 +#define PNP_DEVICE_FAILED                        0x00000004
   2.679 +#define PNP_DEVICE_REMOVED                       0x00000008
   2.680 +#define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED 0x00000010
   2.681 +#define PNP_DEVICE_NOT_DISABLEABLE               0x00000020
   2.682 +
   2.683 +typedef struct _TARGET_DEVICE_CUSTOM_NOTIFICATION {
   2.684 +  USHORT  Version;
   2.685 +  USHORT  Size;
   2.686 +  GUID  Event;
   2.687 +  struct _FILE_OBJECT  *FileObject;
   2.688 +  LONG  NameBufferOffset;
   2.689 +  UCHAR  CustomDataBuffer[1];
   2.690 +} TARGET_DEVICE_CUSTOM_NOTIFICATION, *PTARGET_DEVICE_CUSTOM_NOTIFICATION;
   2.691 +
   2.692 +typedef struct _TARGET_DEVICE_REMOVAL_NOTIFICATION {
   2.693 +  USHORT  Version;
   2.694 +  USHORT  Size;
   2.695 +  GUID  Event;
   2.696 +  struct _FILE_OBJECT  *FileObject;
   2.697 +} TARGET_DEVICE_REMOVAL_NOTIFICATION, *PTARGET_DEVICE_REMOVAL_NOTIFICATION;
   2.698 +
   2.699 +typedef enum _BUS_QUERY_ID_TYPE {
   2.700 +  BusQueryDeviceID,
   2.701 +  BusQueryHardwareIDs,
   2.702 +  BusQueryCompatibleIDs,
   2.703 +  BusQueryInstanceID,
   2.704 +  BusQueryDeviceSerialNumber
   2.705 +} BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE;
   2.706 +
   2.707 +typedef enum _DEVICE_TEXT_TYPE {
   2.708 +  DeviceTextDescription,
   2.709 +  DeviceTextLocationInformation
   2.710 +} DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE;
   2.711 +
   2.712 +typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
   2.713 +  DeviceUsageTypeUndefined,
   2.714 +  DeviceUsageTypePaging,
   2.715 +  DeviceUsageTypeHibernation,
   2.716 +  DeviceUsageTypeDumpFile
   2.717 +} DEVICE_USAGE_NOTIFICATION_TYPE;
   2.718 +
   2.719 +typedef struct _POWER_SEQUENCE {
   2.720 +  ULONG  SequenceD1;
   2.721 +  ULONG  SequenceD2;
   2.722 +  ULONG  SequenceD3;
   2.723 +} POWER_SEQUENCE, *PPOWER_SEQUENCE;
   2.724 +
   2.725 +typedef enum {
   2.726 +  DevicePropertyDeviceDescription,
   2.727 +  DevicePropertyHardwareID,
   2.728 +  DevicePropertyCompatibleIDs,
   2.729 +  DevicePropertyBootConfiguration,
   2.730 +  DevicePropertyBootConfigurationTranslated,
   2.731 +  DevicePropertyClassName,
   2.732 +  DevicePropertyClassGuid,
   2.733 +  DevicePropertyDriverKeyName,
   2.734 +  DevicePropertyManufacturer,
   2.735 +  DevicePropertyFriendlyName,
   2.736 +  DevicePropertyLocationInformation,
   2.737 +  DevicePropertyPhysicalDeviceObjectName,
   2.738 +  DevicePropertyBusTypeGuid,
   2.739 +  DevicePropertyLegacyBusType,
   2.740 +  DevicePropertyBusNumber,
   2.741 +  DevicePropertyEnumeratorName,
   2.742 +  DevicePropertyAddress,
   2.743 +  DevicePropertyUINumber,
   2.744 +  DevicePropertyInstallState,
   2.745 +  DevicePropertyRemovalPolicy
   2.746 +} DEVICE_REGISTRY_PROPERTY;
   2.747 +
   2.748 +typedef enum _IO_NOTIFICATION_EVENT_CATEGORY {
   2.749 +  EventCategoryReserved,
   2.750 +  EventCategoryHardwareProfileChange,
   2.751 +  EventCategoryDeviceInterfaceChange,
   2.752 +  EventCategoryTargetDeviceChange
   2.753 +} IO_NOTIFICATION_EVENT_CATEGORY;
   2.754 +
   2.755 +#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES    0x00000001
   2.756 +
   2.757 +typedef NTSTATUS DDKAPI
   2.758 +(*PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(
   2.759 +  /*IN*/ PVOID NotificationStructure,
   2.760 +  /*IN*/ PVOID Context);
   2.761 +
   2.762 +typedef VOID DDKAPI
   2.763 +(*PDEVICE_CHANGE_COMPLETE_CALLBACK)(
   2.764 +  /*IN*/ PVOID Context);
   2.765 +
   2.766 +
   2.767 +
   2.768 +/*
   2.769 +** System structures
   2.770 +*/
   2.771 +
   2.772 +#define SYMBOLIC_LINK_QUERY               0x0001
   2.773 +#define SYMBOLIC_LINK_ALL_ACCESS          (STANDARD_RIGHTS_REQUIRED | 0x1)
   2.774 +
   2.775 +/* also in winnt,h */
   2.776 +#define DUPLICATE_CLOSE_SOURCE            0x00000001
   2.777 +#define DUPLICATE_SAME_ACCESS             0x00000002
   2.778 +#define DUPLICATE_SAME_ATTRIBUTES         0x00000004
   2.779 +/* end winnt.h */
   2.780 +
   2.781 +typedef struct _OBJECT_NAME_INFORMATION {               
   2.782 +  UNICODE_STRING  Name;                                
   2.783 +} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION;   
   2.784 +
   2.785 +typedef VOID DDKAPI
   2.786 +(*PIO_APC_ROUTINE)(
   2.787 +  /*IN*/ PVOID ApcContext,
   2.788 +  /*IN*/ PIO_STATUS_BLOCK IoStatusBlock,
   2.789 +  /*IN*/ ULONG Reserved);
   2.790 +
   2.791 +typedef struct _IO_STATUS_BLOCK {
   2.792 +  _ANONYMOUS_UNION union {
   2.793 +    NTSTATUS  Status;
   2.794 +    PVOID  Pointer;
   2.795 +  } DUMMYUNIONNAME;
   2.796 +  ULONG_PTR  Information;
   2.797 +} IO_STATUS_BLOCK;
   2.798 +
   2.799 +typedef VOID DDKAPI
   2.800 +(*PKNORMAL_ROUTINE)(
   2.801 +  /*IN*/ PVOID  NormalContext,
   2.802 +  /*IN*/ PVOID  SystemArgument1,
   2.803 +  /*IN*/ PVOID  SystemArgument2);
   2.804 +
   2.805 +typedef VOID DDKAPI
   2.806 +(*PKKERNEL_ROUTINE)(
   2.807 +  /*IN*/ struct _KAPC  *Apc,
   2.808 +  /*IN OUT*/ PKNORMAL_ROUTINE  *NormalRoutine,
   2.809 +  /*IN OUT*/ PVOID  *NormalContext,
   2.810 +  /*IN OUT*/ PVOID  *SystemArgument1,
   2.811 +  /*IN OUT*/ PVOID  *SystemArgument2);
   2.812 +
   2.813 +typedef VOID DDKAPI
   2.814 +(*PKRUNDOWN_ROUTINE)(
   2.815 +  /*IN*/ struct _KAPC  *Apc);
   2.816 +
   2.817 +typedef BOOLEAN DDKAPI
   2.818 +(*PKTRANSFER_ROUTINE)(
   2.819 +  VOID);
   2.820 +
   2.821 +typedef struct _KAPC {
   2.822 +  CSHORT  Type;
   2.823 +  CSHORT  Size;
   2.824 +  ULONG  Spare0;
   2.825 +  struct _KTHREAD  *Thread;
   2.826 +  LIST_ENTRY  ApcListEntry;
   2.827 +  PKKERNEL_ROUTINE  KernelRoutine;
   2.828 +  PKRUNDOWN_ROUTINE  RundownRoutine;
   2.829 +  PKNORMAL_ROUTINE  NormalRoutine;
   2.830 +  PVOID  NormalContext;
   2.831 +  PVOID  SystemArgument1;
   2.832 +  PVOID  SystemArgument2;
   2.833 +  CCHAR  ApcStateIndex;
   2.834 +  KPROCESSOR_MODE  ApcMode;
   2.835 +  BOOLEAN  Inserted;
   2.836 +} KAPC, *PKAPC, *RESTRICTED_POINTER PRKAPC;
   2.837 +
   2.838 +typedef struct _KDEVICE_QUEUE {
   2.839 +  CSHORT  Type;
   2.840 +  CSHORT  Size;
   2.841 +  LIST_ENTRY  DeviceListHead;
   2.842 +  KSPIN_LOCK  Lock;
   2.843 +  BOOLEAN  Busy;
   2.844 +} KDEVICE_QUEUE, *PKDEVICE_QUEUE, *RESTRICTED_POINTER PRKDEVICE_QUEUE;
   2.845 +
   2.846 +typedef struct _KDEVICE_QUEUE_ENTRY {
   2.847 +  LIST_ENTRY  DeviceListEntry;
   2.848 +  ULONG  SortKey;
   2.849 +  BOOLEAN  Inserted;
   2.850 +} KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY,
   2.851 +*RESTRICTED_POINTER PRKDEVICE_QUEUE_ENTRY;
   2.852 +
   2.853 +#define LOCK_QUEUE_WAIT                   1
   2.854 +#define LOCK_QUEUE_OWNER                  2
   2.855 +
   2.856 +typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
   2.857 +  LockQueueDispatcherLock,
   2.858 +  LockQueueContextSwapLock,
   2.859 +  LockQueuePfnLock,
   2.860 +  LockQueueSystemSpaceLock,
   2.861 +  LockQueueVacbLock,
   2.862 +  LockQueueMasterLock,
   2.863 +  LockQueueNonPagedPoolLock,
   2.864 +  LockQueueIoCancelLock,
   2.865 +  LockQueueWorkQueueLock,
   2.866 +  LockQueueIoVpbLock,
   2.867 +  LockQueueIoDatabaseLock,
   2.868 +  LockQueueIoCompletionLock,
   2.869 +  LockQueueNtfsStructLock,
   2.870 +  LockQueueAfdWorkQueueLock,
   2.871 +  LockQueueBcbLock,
   2.872 +  LockQueueMaximumLock
   2.873 +} KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER;
   2.874 +
   2.875 +typedef struct _KSPIN_LOCK_QUEUE {
   2.876 +  struct _KSPIN_LOCK_QUEUE  *VOLATILE Next;
   2.877 +  PKSPIN_LOCK VOLATILE  Lock;
   2.878 +} KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE;
   2.879 +
   2.880 +typedef struct _KLOCK_QUEUE_HANDLE {
   2.881 +  KSPIN_LOCK_QUEUE  LockQueue;
   2.882 +  KIRQL  OldIrql;
   2.883 +} KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE;
   2.884 +
   2.885 +typedef struct _KDPC {
   2.886 +  CSHORT  Type;
   2.887 +  UCHAR  Number;
   2.888 +  UCHAR  Importance;
   2.889 +  LIST_ENTRY  DpcListEntry;
   2.890 +  PKDEFERRED_ROUTINE  DeferredRoutine;
   2.891 +  PVOID  DeferredContext;
   2.892 +  PVOID  SystemArgument1;
   2.893 +  PVOID  SystemArgument2;
   2.894 +  PULONG_PTR  Lock;
   2.895 +} KDPC, *PKDPC, *RESTRICTED_POINTER PRKDPC;
   2.896 +
   2.897 +typedef struct _WAIT_CONTEXT_BLOCK {
   2.898 +  KDEVICE_QUEUE_ENTRY  WaitQueueEntry;
   2.899 +  struct _DRIVER_CONTROL  *DeviceRoutine;
   2.900 +  PVOID  DeviceContext;
   2.901 +  ULONG  NumberOfMapRegisters;
   2.902 +  PVOID  DeviceObject;
   2.903 +  PVOID  CurrentIrp;
   2.904 +  PKDPC  BufferChainingDpc;
   2.905 +} WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK;
   2.906 +
   2.907 +typedef struct _DISPATCHER_HEADER {
   2.908 +  UCHAR  Type;
   2.909 +  UCHAR  Absolute;
   2.910 +  UCHAR  Size;
   2.911 +  UCHAR  Inserted;
   2.912 +  LONG  SignalState;
   2.913 +  LIST_ENTRY  WaitListHead;
   2.914 +} DISPATCHER_HEADER, *PDISPATCHER_HEADER;
   2.915 +
   2.916 +typedef struct _KEVENT {
   2.917 +  DISPATCHER_HEADER  Header;
   2.918 +} KEVENT, *PKEVENT, *RESTRICTED_POINTER PRKEVENT;
   2.919 +
   2.920 +typedef struct _KSEMAPHORE {
   2.921 +    DISPATCHER_HEADER Header;
   2.922 +    LONG Limit;
   2.923 +} KSEMAPHORE, *PKSEMAPHORE, *RESTRICTED_POINTER PRKSEMAPHORE;
   2.924 +
   2.925 +typedef struct _FAST_MUTEX {
   2.926 +  LONG  Count;
   2.927 +  struct _KTHREAD  *Owner;
   2.928 +  ULONG  Contention;
   2.929 +  KEVENT  Event;
   2.930 +  ULONG  OldIrql;
   2.931 +} FAST_MUTEX, *PFAST_MUTEX;
   2.932 +
   2.933 +typedef struct _KTIMER {
   2.934 +  DISPATCHER_HEADER  Header;
   2.935 +  ULARGE_INTEGER  DueTime;
   2.936 +  LIST_ENTRY  TimerListEntry;
   2.937 +  struct _KDPC  *Dpc;
   2.938 +  LONG  Period;
   2.939 +} KTIMER, *PKTIMER, *RESTRICTED_POINTER PRKTIMER;
   2.940 +
   2.941 +typedef struct _KMUTANT {
   2.942 +  DISPATCHER_HEADER  Header;
   2.943 +  LIST_ENTRY  MutantListEntry;
   2.944 +  struct _KTHREAD  *RESTRICTED_POINTER OwnerThread;
   2.945 +  BOOLEAN  Abandoned;
   2.946 +  UCHAR  ApcDisable;
   2.947 +} KMUTANT, *PKMUTANT, *RESTRICTED_POINTER PRKMUTANT, KMUTEX, *PKMUTEX, *RESTRICTED_POINTER PRKMUTEX;
   2.948 +
   2.949 +typedef enum _TIMER_TYPE {
   2.950 +  NotificationTimer,
   2.951 +  SynchronizationTimer
   2.952 +} TIMER_TYPE;
   2.953 +
   2.954 +#define EVENT_INCREMENT                   1
   2.955 +#define IO_NO_INCREMENT                   0
   2.956 +#define IO_CD_ROM_INCREMENT               1
   2.957 +#define IO_DISK_INCREMENT                 1
   2.958 +#define IO_KEYBOARD_INCREMENT             6
   2.959 +#define IO_MAILSLOT_INCREMENT             2
   2.960 +#define IO_MOUSE_INCREMENT                6
   2.961 +#define IO_NAMED_PIPE_INCREMENT           2
   2.962 +#define IO_NETWORK_INCREMENT              2
   2.963 +#define IO_PARALLEL_INCREMENT             1
   2.964 +#define IO_SERIAL_INCREMENT               2
   2.965 +#define IO_SOUND_INCREMENT                8
   2.966 +#define IO_VIDEO_INCREMENT                1
   2.967 +#define SEMAPHORE_INCREMENT               1
   2.968 +
   2.969 +typedef struct _IRP {
   2.970 +  CSHORT  Type;
   2.971 +  USHORT  Size;
   2.972 +  struct _MDL  *MdlAddress;
   2.973 +  ULONG  Flags;
   2.974 +  union {
   2.975 +    struct _IRP  *MasterIrp;
   2.976 +    LONG  IrpCount;
   2.977 +    PVOID  SystemBuffer;
   2.978 +  } AssociatedIrp;
   2.979 +  LIST_ENTRY  ThreadListEntry;
   2.980 +  IO_STATUS_BLOCK  IoStatus;
   2.981 +  KPROCESSOR_MODE  RequestorMode;
   2.982 +  BOOLEAN  PendingReturned;
   2.983 +  CHAR  StackCount;
   2.984 +  CHAR  CurrentLocation;
   2.985 +  BOOLEAN  Cancel;
   2.986 +  KIRQL  CancelIrql;
   2.987 +  CCHAR  ApcEnvironment;
   2.988 +  UCHAR  AllocationFlags;
   2.989 +  PIO_STATUS_BLOCK  UserIosb;
   2.990 +  PKEVENT  UserEvent;
   2.991 +  union {
   2.992 +    struct {
   2.993 +      PIO_APC_ROUTINE  UserApcRoutine;
   2.994 +      PVOID  UserApcContext;
   2.995 +    } AsynchronousParameters;
   2.996 +    LARGE_INTEGER  AllocationSize;
   2.997 +  } Overlay;
   2.998 +  PDRIVER_CANCEL  CancelRoutine;
   2.999 +  PVOID  UserBuffer;
  2.1000 +  union {
  2.1001 +    struct {
  2.1002 +      _ANONYMOUS_UNION union {
  2.1003 +        KDEVICE_QUEUE_ENTRY  DeviceQueueEntry;
  2.1004 +        _ANONYMOUS_STRUCT struct {
  2.1005 +          PVOID  DriverContext[4];
  2.1006 +        } DUMMYSTRUCTNAME;
  2.1007 +      } DUMMYUNIONNAME;
  2.1008 +      PETHREAD  Thread;
  2.1009 +      PCHAR  AuxiliaryBuffer;
  2.1010 +      _ANONYMOUS_STRUCT struct {
  2.1011 +        LIST_ENTRY  ListEntry;
  2.1012 +        _ANONYMOUS_UNION union {
  2.1013 +          struct _IO_STACK_LOCATION  *CurrentStackLocation;
  2.1014 +          ULONG  PacketType;
  2.1015 +        } DUMMYUNIONNAME;
  2.1016 +      } DUMMYSTRUCTNAME;
  2.1017 +      struct _FILE_OBJECT  *OriginalFileObject;
  2.1018 +    } Overlay;
  2.1019 +    KAPC  Apc;
  2.1020 +    PVOID  CompletionKey;
  2.1021 +  } Tail;
  2.1022 +} IRP;
  2.1023 +typedef struct _IRP *PIRP;
  2.1024 +
  2.1025 +/* IRP.Flags */
  2.1026 +
  2.1027 +#define SL_FORCE_ACCESS_CHECK             0x01
  2.1028 +#define SL_OPEN_PAGING_FILE               0x02
  2.1029 +#define SL_OPEN_TARGET_DIRECTORY          0x04
  2.1030 +#define SL_CASE_SENSITIVE                 0x80
  2.1031 +
  2.1032 +#define SL_KEY_SPECIFIED                  0x01
  2.1033 +#define SL_OVERRIDE_VERIFY_VOLUME         0x02
  2.1034 +#define SL_WRITE_THROUGH                  0x04
  2.1035 +#define SL_FT_SEQUENTIAL_WRITE            0x08
  2.1036 +
  2.1037 +#define SL_FAIL_IMMEDIATELY               0x01
  2.1038 +#define SL_EXCLUSIVE_LOCK                 0x02
  2.1039 +
  2.1040 +#define SL_RESTART_SCAN                   0x01
  2.1041 +#define SL_RETURN_SINGLE_ENTRY            0x02
  2.1042 +#define SL_INDEX_SPECIFIED                0x04
  2.1043 +
  2.1044 +#define SL_WATCH_TREE                     0x01
  2.1045 +
  2.1046 +#define SL_ALLOW_RAW_MOUNT                0x01
  2.1047 +
  2.1048 +#define CTL_CODE(DeviceType, Function, Method, Access)( \
  2.1049 +  ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
  2.1050 +
  2.1051 +#define DEVICE_TYPE_FROM_CTL_CODE(ctl) (((ULONG) (ctl & 0xffff0000)) >> 16)
  2.1052 +
  2.1053 +enum
  2.1054 +{
  2.1055 +   IRP_NOCACHE = 0x1,
  2.1056 +   IRP_PAGING_IO = 0x2,
  2.1057 +   IRP_MOUNT_COMPLETION = 0x2,
  2.1058 +   IRP_SYNCHRONOUS_API = 0x4,
  2.1059 +   IRP_ASSOCIATED_IRP = 0x8,
  2.1060 +   IRP_BUFFERED_IO = 0x10,
  2.1061 +   IRP_DEALLOCATE_BUFFER = 0x20,
  2.1062 +   IRP_INPUT_OPERATION = 0x40,
  2.1063 +   IRP_SYNCHRONOUS_PAGING_IO = 0x40,
  2.1064 +   IRP_CREATE_OPERATION = 0x80,
  2.1065 +   IRP_READ_OPERATION = 0x100,
  2.1066 +   IRP_WRITE_OPERATION = 0x200,
  2.1067 +   IRP_CLOSE_OPERATION = 0x400,
  2.1068 +   IRP_DEFER_IO_COMPLETION = 0x800,
  2.1069 +   IRP_OB_QUERY_NAME = 0x1000,
  2.1070 +   IRP_HOLD_DEVICE_QUEUE = 0x2000,
  2.1071 +   IRP_RETRY_IO_COMPLETION = 0x4000
  2.1072 +};
  2.1073 +
  2.1074 +
  2.1075 +typedef struct _DRIVE_LAYOUT_INFORMATION_MBR {
  2.1076 +  ULONG  Signature;
  2.1077 +} DRIVE_LAYOUT_INFORMATION_MBR, *PDRIVE_LAYOUT_INFORMATION_MBR;
  2.1078 +
  2.1079 +typedef struct _DRIVE_LAYOUT_INFORMATION_GPT {
  2.1080 +  GUID  DiskId;
  2.1081 +  LARGE_INTEGER  StartingUsableOffset;
  2.1082 +  LARGE_INTEGER  UsableLength;
  2.1083 +  ULONG  MaxPartitionCount;
  2.1084 +} DRIVE_LAYOUT_INFORMATION_GPT, *PDRIVE_LAYOUT_INFORMATION_GPT;
  2.1085 +
  2.1086 +typedef struct _PARTITION_INFORMATION_MBR {
  2.1087 +  UCHAR  PartitionType;
  2.1088 +  BOOLEAN  BootIndicator;
  2.1089 +  BOOLEAN  RecognizedPartition;
  2.1090 +  ULONG  HiddenSectors;
  2.1091 +} PARTITION_INFORMATION_MBR, *PPARTITION_INFORMATION_MBR;
  2.1092 +
  2.1093 +
  2.1094 +typedef struct _BOOTDISK_INFORMATION {
  2.1095 +  LONGLONG  BootPartitionOffset;
  2.1096 +  LONGLONG  SystemPartitionOffset;
  2.1097 +  ULONG  BootDeviceSignature;
  2.1098 +  ULONG  SystemDeviceSignature;
  2.1099 +} BOOTDISK_INFORMATION, *PBOOTDISK_INFORMATION;
  2.1100 +
  2.1101 +typedef struct _BOOTDISK_INFORMATION_EX {
  2.1102 +  LONGLONG  BootPartitionOffset;
  2.1103 +  LONGLONG  SystemPartitionOffset;
  2.1104 +  ULONG  BootDeviceSignature;
  2.1105 +  ULONG  SystemDeviceSignature;
  2.1106 +  GUID  BootDeviceGuid;
  2.1107 +  GUID  SystemDeviceGuid;
  2.1108 +  BOOLEAN  BootDeviceIsGpt;
  2.1109 +  BOOLEAN  SystemDeviceIsGpt;
  2.1110 +} BOOTDISK_INFORMATION_EX, *PBOOTDISK_INFORMATION_EX;
  2.1111 +
  2.1112 +typedef struct _EISA_MEMORY_TYPE {
  2.1113 +  UCHAR  ReadWrite : 1;
  2.1114 +  UCHAR  Cached : 1;
  2.1115 +  UCHAR  Reserved0 : 1;
  2.1116 +  UCHAR  Type : 2;
  2.1117 +  UCHAR  Shared : 1;
  2.1118 +  UCHAR  Reserved1 : 1;
  2.1119 +  UCHAR  MoreEntries : 1;
  2.1120 +} EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE;
  2.1121 +
  2.1122 +#include <pshpack1.h>
  2.1123 +typedef struct _EISA_MEMORY_CONFIGURATION {
  2.1124 +  EISA_MEMORY_TYPE  ConfigurationByte;
  2.1125 +  UCHAR  DataSize;
  2.1126 +  USHORT  AddressLowWord;
  2.1127 +  UCHAR  AddressHighByte;
  2.1128 +  USHORT  MemorySize;
  2.1129 +} EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION;
  2.1130 +#include <poppack.h>
  2.1131 +
  2.1132 +typedef struct _EISA_IRQ_DESCRIPTOR {
  2.1133 +  UCHAR  Interrupt : 4;
  2.1134 +  UCHAR  Reserved : 1;
  2.1135 +  UCHAR  LevelTriggered : 1;
  2.1136 +  UCHAR  Shared : 1;
  2.1137 +  UCHAR  MoreEntries : 1;
  2.1138 +} EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR;
  2.1139 +
  2.1140 +typedef struct _EISA_IRQ_CONFIGURATION {
  2.1141 +  EISA_IRQ_DESCRIPTOR  ConfigurationByte;
  2.1142 +  UCHAR  Reserved;
  2.1143 +} EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION;
  2.1144 +
  2.1145 +typedef struct _DMA_CONFIGURATION_BYTE0 {
  2.1146 +  UCHAR Channel : 3;
  2.1147 +  UCHAR Reserved : 3;
  2.1148 +  UCHAR Shared : 1;
  2.1149 +  UCHAR MoreEntries : 1;
  2.1150 +} DMA_CONFIGURATION_BYTE0;
  2.1151 +
  2.1152 +typedef struct _DMA_CONFIGURATION_BYTE1 {
  2.1153 +  UCHAR  Reserved0 : 2;
  2.1154 +  UCHAR  TransferSize : 2;
  2.1155 +  UCHAR  Timing : 2;
  2.1156 +  UCHAR  Reserved1 : 2;
  2.1157 +} DMA_CONFIGURATION_BYTE1;
  2.1158 +
  2.1159 +typedef struct _EISA_DMA_CONFIGURATION {
  2.1160 +  DMA_CONFIGURATION_BYTE0  ConfigurationByte0;
  2.1161 +  DMA_CONFIGURATION_BYTE1  ConfigurationByte1;
  2.1162 +} EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION;
  2.1163 +
  2.1164 +#include <pshpack1.h>
  2.1165 +typedef struct _EISA_PORT_DESCRIPTOR {
  2.1166 +  UCHAR  NumberPorts : 5;
  2.1167 +  UCHAR  Reserved : 1;
  2.1168 +  UCHAR  Shared : 1;
  2.1169 +  UCHAR  MoreEntries : 1;
  2.1170 +} EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR;
  2.1171 +
  2.1172 +typedef struct _EISA_PORT_CONFIGURATION {
  2.1173 +  EISA_PORT_DESCRIPTOR  Configuration;
  2.1174 +  USHORT  PortAddress;
  2.1175 +} EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION;
  2.1176 +#include <poppack.h>
  2.1177 +
  2.1178 +typedef struct _CM_EISA_FUNCTION_INFORMATION {
  2.1179 +  ULONG  CompressedId;
  2.1180 +  UCHAR  IdSlotFlags1;
  2.1181 +  UCHAR  IdSlotFlags2;
  2.1182 +  UCHAR  MinorRevision;
  2.1183 +  UCHAR  MajorRevision;
  2.1184 +  UCHAR  Selections[26];
  2.1185 +  UCHAR  FunctionFlags;
  2.1186 +  UCHAR  TypeString[80];
  2.1187 +  EISA_MEMORY_CONFIGURATION  EisaMemory[9];
  2.1188 +  EISA_IRQ_CONFIGURATION  EisaIrq[7];
  2.1189 +  EISA_DMA_CONFIGURATION  EisaDma[4];
  2.1190 +  EISA_PORT_CONFIGURATION  EisaPort[20];
  2.1191 +  UCHAR  InitializationData[60];
  2.1192 +} CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION;
  2.1193 +
  2.1194 +/* CM_EISA_FUNCTION_INFORMATION.FunctionFlags */
  2.1195 +
  2.1196 +#define EISA_FUNCTION_ENABLED           0x80
  2.1197 +#define EISA_FREE_FORM_DATA             0x40
  2.1198 +#define EISA_HAS_PORT_INIT_ENTRY        0x20
  2.1199 +#define EISA_HAS_PORT_RANGE             0x10
  2.1200 +#define EISA_HAS_DMA_ENTRY              0x08
  2.1201 +#define EISA_HAS_IRQ_ENTRY              0x04
  2.1202 +#define EISA_HAS_MEMORY_ENTRY           0x02
  2.1203 +#define EISA_HAS_TYPE_ENTRY             0x01
  2.1204 +#define EISA_HAS_INFORMATION \
  2.1205 +  (EISA_HAS_PORT_RANGE + EISA_HAS_DMA_ENTRY + EISA_HAS_IRQ_ENTRY \
  2.1206 +  + EISA_HAS_MEMORY_ENTRY + EISA_HAS_TYPE_ENTRY)
  2.1207 +
  2.1208 +typedef struct _CM_EISA_SLOT_INFORMATION {
  2.1209 +  UCHAR  ReturnCode;
  2.1210 +  UCHAR  ReturnFlags;
  2.1211 +  UCHAR  MajorRevision;
  2.1212 +  UCHAR  MinorRevision;
  2.1213 +  USHORT  Checksum;
  2.1214 +  UCHAR  NumberFunctions;
  2.1215 +  UCHAR  FunctionInformation;
  2.1216 +  ULONG  CompressedId;
  2.1217 +} CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION;
  2.1218 +
  2.1219 +/* CM_EISA_SLOT_INFORMATION.ReturnCode */
  2.1220 +
  2.1221 +#define EISA_INVALID_SLOT               0x80
  2.1222 +#define EISA_INVALID_FUNCTION           0x81
  2.1223 +#define EISA_INVALID_CONFIGURATION      0x82
  2.1224 +#define EISA_EMPTY_SLOT                 0x83
  2.1225 +#define EISA_INVALID_BIOS_CALL          0x86
  2.1226 +
  2.1227 +typedef struct _CM_FLOPPY_DEVICE_DATA {
  2.1228 +  USHORT  Version;
  2.1229 +  USHORT  Revision;
  2.1230 +  CHAR  Size[8];
  2.1231 +  ULONG  MaxDensity;
  2.1232 +  ULONG  MountDensity;
  2.1233 +  UCHAR  StepRateHeadUnloadTime;
  2.1234 +  UCHAR  HeadLoadTime;
  2.1235 +  UCHAR  MotorOffTime;
  2.1236 +  UCHAR  SectorLengthCode;
  2.1237 +  UCHAR  SectorPerTrack;
  2.1238 +  UCHAR  ReadWriteGapLength;
  2.1239 +  UCHAR  DataTransferLength;
  2.1240 +  UCHAR  FormatGapLength;
  2.1241 +  UCHAR  FormatFillCharacter;
  2.1242 +  UCHAR  HeadSettleTime;
  2.1243 +  UCHAR  MotorSettleTime;
  2.1244 +  UCHAR  MaximumTrackValue;
  2.1245 +  UCHAR  DataTransferRate;
  2.1246 +} CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA;
  2.1247 +
  2.1248 +typedef enum _INTERFACE_TYPE {
  2.1249 +  InterfaceTypeUndefined = -1,
  2.1250 +  Internal,
  2.1251 +  Isa,
  2.1252 +  Eisa,
  2.1253 +  MicroChannel,
  2.1254 +  TurboChannel,
  2.1255 +  PCIBus,
  2.1256 +  VMEBus,
  2.1257 +  NuBus,
  2.1258 +  PCMCIABus,
  2.1259 +  CBus,
  2.1260 +  MPIBus,
  2.1261 +  MPSABus,
  2.1262 +  ProcessorInternal,
  2.1263 +  InternalPowerBus,
  2.1264 +  PNPISABus,
  2.1265 +  PNPBus,
  2.1266 +  MaximumInterfaceType
  2.1267 +} INTERFACE_TYPE, *PINTERFACE_TYPE;
  2.1268 +
  2.1269 +typedef struct _PNP_BUS_INFORMATION {
  2.1270 +  GUID  BusTypeGuid;
  2.1271 +  INTERFACE_TYPE  LegacyBusType;
  2.1272 +  ULONG  BusNumber;
  2.1273 +} PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION;
  2.1274 +
  2.1275 +#include <pshpack1.h>
  2.1276 +typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
  2.1277 +  UCHAR Type;
  2.1278 +  UCHAR ShareDisposition;
  2.1279 +  USHORT Flags;
  2.1280 +  union {
  2.1281 +    struct {
  2.1282 +      PHYSICAL_ADDRESS Start;
  2.1283 +      ULONG Length;
  2.1284 +    } Generic;
  2.1285 +    struct {
  2.1286 +      PHYSICAL_ADDRESS Start;
  2.1287 +      ULONG Length;
  2.1288 +    } Port;
  2.1289 +    struct {
  2.1290 +      ULONG Level;
  2.1291 +      ULONG Vector;
  2.1292 +      ULONG Affinity;
  2.1293 +    } Interrupt;
  2.1294 +    struct {
  2.1295 +      PHYSICAL_ADDRESS Start;
  2.1296 +      ULONG Length;
  2.1297 +    } Memory;
  2.1298 +    struct {
  2.1299 +      ULONG Channel;
  2.1300 +      ULONG Port;
  2.1301 +      ULONG Reserved1;
  2.1302 +    } Dma;
  2.1303 +    struct {
  2.1304 +      ULONG Data[3];
  2.1305 +    } DevicePrivate;
  2.1306 +    struct {
  2.1307 +      ULONG Start;
  2.1308 +      ULONG Length;
  2.1309 +      ULONG Reserved;
  2.1310 +    } BusNumber;
  2.1311 +    struct {
  2.1312 +      ULONG DataSize;
  2.1313 +      ULONG Reserved1;
  2.1314 +      ULONG Reserved2;
  2.1315 +    } DeviceSpecificData;
  2.1316 +  } u;
  2.1317 +} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
  2.1318 +
  2.1319 +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Type */
  2.1320 +
  2.1321 +#define CmResourceTypeNull                0
  2.1322 +#define CmResourceTypePort                1
  2.1323 +#define CmResourceTypeInterrupt           2
  2.1324 +#define CmResourceTypeMemory              3
  2.1325 +#define CmResourceTypeDma                 4
  2.1326 +#define CmResourceTypeDeviceSpecific      5
  2.1327 +#define CmResourceTypeBusNumber           6
  2.1328 +#define CmResourceTypeMaximum             7
  2.1329 +#define CmResourceTypeNonArbitrated     128
  2.1330 +#define CmResourceTypeConfigData        128
  2.1331 +#define CmResourceTypeDevicePrivate     129
  2.1332 +#define CmResourceTypePcCardConfig      130
  2.1333 +#define CmResourceTypeMfCardConfig      131
  2.1334 +
  2.1335 +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.ShareDisposition */
  2.1336 +
  2.1337 +typedef enum _CM_SHARE_DISPOSITION {
  2.1338 +  CmResourceShareUndetermined,
  2.1339 +  CmResourceShareDeviceExclusive,
  2.1340 +  CmResourceShareDriverExclusive,
  2.1341 +  CmResourceShareShared
  2.1342 +} CM_SHARE_DISPOSITION;
  2.1343 +
  2.1344 +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypePort */
  2.1345 +
  2.1346 +#define CM_RESOURCE_PORT_MEMORY           0x0000
  2.1347 +#define CM_RESOURCE_PORT_IO               0x0001
  2.1348 +#define CM_RESOURCE_PORT_10_BIT_DECODE    0x0004
  2.1349 +#define CM_RESOURCE_PORT_12_BIT_DECODE    0x0008
  2.1350 +#define CM_RESOURCE_PORT_16_BIT_DECODE    0x0010
  2.1351 +#define CM_RESOURCE_PORT_POSITIVE_DECODE  0x0020
  2.1352 +#define CM_RESOURCE_PORT_PASSIVE_DECODE   0x0040
  2.1353 +#define CM_RESOURCE_PORT_WINDOW_DECODE    0x0080
  2.1354 +
  2.1355 +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeInterrupt */
  2.1356 +
  2.1357 +#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000
  2.1358 +#define CM_RESOURCE_INTERRUPT_LATCHED         0x0001
  2.1359 +
  2.1360 +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeMemory */
  2.1361 +
  2.1362 +#define CM_RESOURCE_MEMORY_READ_WRITE     0x0000
  2.1363 +#define CM_RESOURCE_MEMORY_READ_ONLY      0x0001
  2.1364 +#define CM_RESOURCE_MEMORY_WRITE_ONLY     0x0002
  2.1365 +#define CM_RESOURCE_MEMORY_PREFETCHABLE   0x0004
  2.1366 +#define CM_RESOURCE_MEMORY_COMBINEDWRITE  0x0008
  2.1367 +#define CM_RESOURCE_MEMORY_24             0x0010
  2.1368 +#define CM_RESOURCE_MEMORY_CACHEABLE      0x0020
  2.1369 +
  2.1370 +/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeDma */
  2.1371 +
  2.1372 +#define CM_RESOURCE_DMA_8                 0x0000
  2.1373 +#define CM_RESOURCE_DMA_16                0x0001
  2.1374 +#define CM_RESOURCE_DMA_32                0x0002
  2.1375 +#define CM_RESOURCE_DMA_8_AND_16          0x0004
  2.1376 +#define CM_RESOURCE_DMA_BUS_MASTER        0x0008
  2.1377 +#define CM_RESOURCE_DMA_TYPE_A            0x0010
  2.1378 +#define CM_RESOURCE_DMA_TYPE_B            0x0020
  2.1379 +#define CM_RESOURCE_DMA_TYPE_F            0x0040
  2.1380 +
  2.1381 +typedef struct _CM_PARTIAL_RESOURCE_LIST {
  2.1382 +  USHORT  Version;
  2.1383 +  USHORT  Revision;
  2.1384 +  ULONG  Count;
  2.1385 +  CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
  2.1386 +} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
  2.1387 +
  2.1388 +typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
  2.1389 +  INTERFACE_TYPE  InterfaceType;
  2.1390 +  ULONG  BusNumber;
  2.1391 +  CM_PARTIAL_RESOURCE_LIST  PartialResourceList;
  2.1392 +} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
  2.1393 +
  2.1394 +typedef struct _CM_RESOURCE_LIST {
  2.1395 +  ULONG  Count;
  2.1396 +  CM_FULL_RESOURCE_DESCRIPTOR  List[1];
  2.1397 +} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
  2.1398 +
  2.1399 +typedef struct _CM_INT13_DRIVE_PARAMETER {
  2.1400 +  USHORT  DriveSelect;
  2.1401 +  ULONG  MaxCylinders;
  2.1402 +  USHORT  SectorsPerTrack;
  2.1403 +  USHORT  MaxHeads;
  2.1404 +  USHORT  NumberDrives;
  2.1405 +} CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
  2.1406 +#include <poppack.h>
  2.1407 +
  2.1408 +typedef struct _CM_KEYBOARD_DEVICE_DATA {
  2.1409 +  USHORT  Version;
  2.1410 +  USHORT  Revision;
  2.1411 +  UCHAR  Type;
  2.1412 +  UCHAR  Subtype;
  2.1413 +  USHORT  KeyboardFlags;
  2.1414 +} CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA;
  2.1415 +
  2.1416 +#define KEYBOARD_INSERT_ON                0x80
  2.1417 +#define KEYBOARD_CAPS_LOCK_ON             0x40
  2.1418 +#define KEYBOARD_NUM_LOCK_ON              0x20
  2.1419 +#define KEYBOARD_SCROLL_LOCK_ON           0x10
  2.1420 +#define KEYBOARD_ALT_KEY_DOWN             0x08
  2.1421 +#define KEYBOARD_CTRL_KEY_DOWN            0x04
  2.1422 +#define KEYBOARD_LEFT_SHIFT_DOWN          0x02
  2.1423 +#define KEYBOARD_RIGHT_SHIFT_DOWN         0x01
  2.1424 +
  2.1425 +typedef struct _CM_MCA_POS_DATA {
  2.1426 +  USHORT  AdapterId;
  2.1427 +  UCHAR  PosData1;
  2.1428 +  UCHAR  PosData2;
  2.1429 +  UCHAR  PosData3;
  2.1430 +  UCHAR  PosData4;
  2.1431 +} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA;
  2.1432 +
  2.1433 +typedef struct CM_Power_Data_s {
  2.1434 +  ULONG  PD_Size;
  2.1435 +  DEVICE_POWER_STATE  PD_MostRecentPowerState;
  2.1436 +  ULONG  PD_Capabilities;
  2.1437 +  ULONG  PD_D1Latency;
  2.1438 +  ULONG  PD_D2Latency;
  2.1439 +  ULONG  PD_D3Latency;
  2.1440 +  DEVICE_POWER_STATE  PD_PowerStateMapping[PowerSystemMaximum];
  2.1441 +} CM_POWER_DATA, *PCM_POWER_DATA;
  2.1442 +
  2.1443 +#define PDCAP_D0_SUPPORTED                0x00000001
  2.1444 +#define PDCAP_D1_SUPPORTED                0x00000002
  2.1445 +#define PDCAP_D2_SUPPORTED                0x00000004
  2.1446 +#define PDCAP_D3_SUPPORTED                0x00000008
  2.1447 +#define PDCAP_WAKE_FROM_D0_SUPPORTED      0x00000010
  2.1448 +#define PDCAP_WAKE_FROM_D1_SUPPORTED      0x00000020
  2.1449 +#define PDCAP_WAKE_FROM_D2_SUPPORTED      0x00000040
  2.1450 +#define PDCAP_WAKE_FROM_D3_SUPPORTED      0x00000080
  2.1451 +#define PDCAP_WARM_EJECT_SUPPORTED        0x00000100
  2.1452 +
  2.1453 +typedef struct _CM_SCSI_DEVICE_DATA {
  2.1454 +  USHORT  Version;
  2.1455 +  USHORT  Revision;
  2.1456 +  UCHAR  HostIdentifier;
  2.1457 +} CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA;
  2.1458 +
  2.1459 +typedef struct _CM_SERIAL_DEVICE_DATA {
  2.1460 +  USHORT  Version;
  2.1461 +  USHORT  Revision;
  2.1462 +  ULONG  BaudClock;
  2.1463 +} CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA;
  2.1464 +
  2.1465 +/* IO_RESOURCE_DESCRIPTOR.Option */
  2.1466 +
  2.1467 +#define IO_RESOURCE_PREFERRED             0x01
  2.1468 +#define IO_RESOURCE_DEFAULT               0x02
  2.1469 +#define IO_RESOURCE_ALTERNATIVE           0x08
  2.1470 +
  2.1471 +typedef struct _IO_RESOURCE_DESCRIPTOR {
  2.1472 +  UCHAR  Option;
  2.1473 +  UCHAR  Type;
  2.1474 +  UCHAR  ShareDisposition;
  2.1475 +  UCHAR  Spare1;
  2.1476 +  USHORT  Flags;
  2.1477 +  USHORT  Spare2;
  2.1478 +  union {
  2.1479 +    struct {
  2.1480 +      ULONG  Length;
  2.1481 +      ULONG  Alignment;
  2.1482 +      PHYSICAL_ADDRESS  MinimumAddress;
  2.1483 +      PHYSICAL_ADDRESS  MaximumAddress;
  2.1484 +    } Port;
  2.1485 +    struct {
  2.1486 +      ULONG  Length;
  2.1487 +      ULONG  Alignment;
  2.1488 +      PHYSICAL_ADDRESS  MinimumAddress;
  2.1489 +      PHYSICAL_ADDRESS  MaximumAddress;
  2.1490 +    } Memory;
  2.1491 +    struct {
  2.1492 +      ULONG  MinimumVector;
  2.1493 +      ULONG  MaximumVector;
  2.1494 +    } Interrupt;
  2.1495 +    struct {
  2.1496 +      ULONG  MinimumChannel;
  2.1497 +      ULONG  MaximumChannel;
  2.1498 +    } Dma;
  2.1499 +    struct {
  2.1500 +      ULONG  Length;
  2.1501 +      ULONG  Alignment;
  2.1502 +      PHYSICAL_ADDRESS  MinimumAddress;
  2.1503 +      PHYSICAL_ADDRESS  MaximumAddress;
  2.1504 +    } Generic;
  2.1505 +    struct {
  2.1506 +      ULONG  Data[3];
  2.1507 +    } DevicePrivate;
  2.1508 +    struct {
  2.1509 +      ULONG  Length;
  2.1510 +      ULONG  MinBusNumber;
  2.1511 +      ULONG  MaxBusNumber;
  2.1512 +      ULONG  Reserved;
  2.1513 +    } BusNumber;
  2.1514 +    struct {
  2.1515 +      ULONG  Priority;
  2.1516 +      ULONG  Reserved1;
  2.1517 +      ULONG  Reserved2;
  2.1518 +    } ConfigData;
  2.1519 +  } u;
  2.1520 +} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
  2.1521 +
  2.1522 +typedef struct _IO_RESOURCE_LIST {
  2.1523 +  USHORT  Version;
  2.1524 +  USHORT  Revision;
  2.1525 +  ULONG  Count;
  2.1526 +  IO_RESOURCE_DESCRIPTOR  Descriptors[1];
  2.1527 +} IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
  2.1528 +
  2.1529 +typedef struct _IO_RESOURCE_REQUIREMENTS_LIST {
  2.1530 +  ULONG  ListSize;
  2.1531 +  INTERFACE_TYPE  InterfaceType;
  2.1532 +  ULONG  BusNumber;
  2.1533 +  ULONG  SlotNumber;
  2.1534 +  ULONG  Reserved[3];
  2.1535 +  ULONG  AlternativeLists;
  2.1536 +  IO_RESOURCE_LIST  List[1];
  2.1537 +} IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
  2.1538 +
  2.1539 +typedef struct _CONTROLLER_OBJECT {
  2.1540 +  CSHORT  Type;
  2.1541 +  CSHORT  Size;
  2.1542 +  PVOID  ControllerExtension;
  2.1543 +  KDEVICE_QUEUE  DeviceWaitQueue;
  2.1544 +  ULONG  Spare1;
  2.1545 +  LARGE_INTEGER  Spare2;
  2.1546 +} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT;
  2.1547 +
  2.1548 +typedef enum _DMA_WIDTH {
  2.1549 +  Width8Bits,
  2.1550 +  Width16Bits,
  2.1551 +  Width32Bits,
  2.1552 +  MaximumDmaWidth
  2.1553 +} DMA_WIDTH, *PDMA_WIDTH;
  2.1554 +
  2.1555 +typedef enum _DMA_SPEED {
  2.1556 +  Compatible,
  2.1557 +  TypeA,
  2.1558 +  TypeB,
  2.1559 +  TypeC,
  2.1560 +  TypeF,
  2.1561 +  MaximumDmaSpeed
  2.1562 +} DMA_SPEED, *PDMA_SPEED;
  2.1563 +
  2.1564 +/* DEVICE_DESCRIPTION.Version */
  2.1565 +
  2.1566 +#define DEVICE_DESCRIPTION_VERSION        0x0000
  2.1567 +#define DEVICE_DESCRIPTION_VERSION1       0x0001
  2.1568 +#define DEVICE_DESCRIPTION_VERSION2       0x0002
  2.1569 +
  2.1570 +typedef struct _DEVICE_DESCRIPTION {
  2.1571 +  ULONG  Version;
  2.1572 +  BOOLEAN  Master;
  2.1573 +  BOOLEAN  ScatterGather;
  2.1574 +  BOOLEAN  DemandMode;
  2.1575 +  BOOLEAN  AutoInitialize;
  2.1576 +  BOOLEAN  Dma32BitAddresses;
  2.1577 +  BOOLEAN  IgnoreCount;
  2.1578 +  BOOLEAN  Reserved1;
  2.1579 +  BOOLEAN  Dma64BitAddresses;
  2.1580 +  ULONG  BusNumber; 
  2.1581 +  ULONG  DmaChannel;
  2.1582 +  INTERFACE_TYPE  InterfaceType;
  2.1583 +  DMA_WIDTH  DmaWidth;
  2.1584 +  DMA_SPEED  DmaSpeed;
  2.1585 +  ULONG  MaximumLength;
  2.1586 +  ULONG  DmaPort;
  2.1587 +} DEVICE_DESCRIPTION, *PDEVICE_DESCRIPTION;
  2.1588 +
  2.1589 +/* VPB.Flags */
  2.1590 +#define VPB_MOUNTED                       0x0001
  2.1591 +#define VPB_LOCKED                        0x0002
  2.1592 +#define VPB_PERSISTENT                    0x0004
  2.1593 +#define VPB_REMOVE_PENDING                0x0008
  2.1594 +#define VPB_RAW_MOUNT                     0x0010
  2.1595 +
  2.1596 +#define MAXIMUM_VOLUME_LABEL_LENGTH       (32 * sizeof(WCHAR))
  2.1597 +
  2.1598 +typedef struct _VPB {
  2.1599 +  CSHORT  Type;
  2.1600 +  CSHORT  Size;
  2.1601 +  USHORT  Flags;
  2.1602 +  USHORT  VolumeLabelLength;
  2.1603 +  struct _DEVICE_OBJECT  *DeviceObject;
  2.1604 +  struct _DEVICE_OBJECT  *RealDevice;
  2.1605 +  ULONG  SerialNumber;
  2.1606 +  ULONG  ReferenceCount;
  2.1607 +  WCHAR  VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)];
  2.1608 +} VPB, *PVPB;
  2.1609 +
  2.1610 +/* DEVICE_OBJECT.Flags */
  2.1611 +
  2.1612 +#define DO_VERIFY_VOLUME                  0x00000002      
  2.1613 +#define DO_BUFFERED_IO                    0x00000004      
  2.1614 +#define DO_EXCLUSIVE                      0x00000008      
  2.1615 +#define DO_DIRECT_IO                      0x00000010      
  2.1616 +#define DO_MAP_IO_BUFFER                  0x00000020      
  2.1617 +#define DO_DEVICE_HAS_NAME                0x00000040      
  2.1618 +#define DO_DEVICE_INITIALIZING            0x00000080      
  2.1619 +#define DO_SYSTEM_BOOT_PARTITION          0x00000100      
  2.1620 +#define DO_LONG_TERM_REQUESTS             0x00000200      
  2.1621 +#define DO_NEVER_LAST_DEVICE              0x00000400      
  2.1622 +#define DO_SHUTDOWN_REGISTERED            0x00000800      
  2.1623 +#define DO_BUS_ENUMERATED_DEVICE          0x00001000      
  2.1624 +#define DO_POWER_PAGABLE                  0x00002000      
  2.1625 +#define DO_POWER_INRUSH                   0x00004000      
  2.1626 +#define DO_LOW_PRIORITY_FILESYSTEM        0x00010000      
  2.1627 +
  2.1628 +/* DEVICE_OBJECT.Characteristics */
  2.1629 +
  2.1630 +#define FILE_REMOVABLE_MEDIA            0x00000001
  2.1631 +#define FILE_READ_ONLY_DEVICE           0x00000002
  2.1632 +#define FILE_FLOPPY_DISKETTE            0x00000004
  2.1633 +#define FILE_WRITE_ONCE_MEDIA           0x00000008
  2.1634 +#define FILE_REMOTE_DEVICE              0x00000010
  2.1635 +#define FILE_DEVICE_IS_MOUNTED          0x00000020
  2.1636 +#define FILE_VIRTUAL_VOLUME             0x00000040
  2.1637 +#define FILE_AUTOGENERATED_DEVICE_NAME  0x00000080
  2.1638 +#define FILE_DEVICE_SECURE_OPEN         0x00000100
  2.1639 +
  2.1640 +/* DEVICE_OBJECT.AlignmentRequirement */
  2.1641 +
  2.1642 +#define FILE_BYTE_ALIGNMENT             0x00000000
  2.1643 +#define FILE_WORD_ALIGNMENT             0x00000001
  2.1644 +#define FILE_LONG_ALIGNMENT             0x00000003
  2.1645 +#define FILE_QUAD_ALIGNMENT             0x00000007
  2.1646 +#define FILE_OCTA_ALIGNMENT             0x0000000f
  2.1647 +#define FILE_32_BYTE_ALIGNMENT          0x0000001f
  2.1648 +#define FILE_64_BYTE_ALIGNMENT          0x0000003f
  2.1649 +#define FILE_128_BYTE_ALIGNMENT         0x0000007f
  2.1650 +#define FILE_256_BYTE_ALIGNMENT         0x000000ff
  2.1651 +#define FILE_512_BYTE_ALIGNMENT         0x000001ff
  2.1652 +
  2.1653 +/* DEVICE_OBJECT.DeviceType */
  2.1654 +
  2.1655 +#define DEVICE_TYPE ULONG
  2.1656 +
  2.1657 +#define FILE_DEVICE_BEEP                  0x00000001
  2.1658 +#define FILE_DEVICE_CD_ROM                0x00000002
  2.1659 +#define FILE_DEVICE_CD_ROM_FILE_SYSTEM    0x00000003
  2.1660 +#define FILE_DEVICE_CONTROLLER            0x00000004
  2.1661 +#define FILE_DEVICE_DATALINK              0x00000005
  2.1662 +#define FILE_DEVICE_DFS                   0x00000006
  2.1663 +#define FILE_DEVICE_DISK                  0x00000007
  2.1664 +#define FILE_DEVICE_DISK_FILE_SYSTEM      0x00000008
  2.1665 +#define FILE_DEVICE_FILE_SYSTEM           0x00000009
  2.1666 +#define FILE_DEVICE_INPORT_PORT           0x0000000a
  2.1667 +#define FILE_DEVICE_KEYBOARD              0x0000000b
  2.1668 +#define FILE_DEVICE_MAILSLOT              0x0000000c
  2.1669 +#define FILE_DEVICE_MIDI_IN               0x0000000d
  2.1670 +#define FILE_DEVICE_MIDI_OUT              0x0000000e
  2.1671 +#define FILE_DEVICE_MOUSE                 0x0000000f
  2.1672 +#define FILE_DEVICE_MULTI_UNC_PROVIDER    0x00000010
  2.1673 +#define FILE_DEVICE_NAMED_PIPE            0x00000011
  2.1674 +#define FILE_DEVICE_NETWORK               0x00000012
  2.1675 +#define FILE_DEVICE_NETWORK_BROWSER       0x00000013
  2.1676 +#define FILE_DEVICE_NETWORK_FILE_SYSTEM   0x00000014
  2.1677 +#define FILE_DEVICE_NULL                  0x00000015
  2.1678 +#define FILE_DEVICE_PARALLEL_PORT         0x00000016
  2.1679 +#define FILE_DEVICE_PHYSICAL_NETCARD      0x00000017
  2.1680 +#define FILE_DEVICE_PRINTER               0x00000018
  2.1681 +#define FILE_DEVICE_SCANNER               0x00000019
  2.1682 +#define FILE_DEVICE_SERIAL_MOUSE_PORT     0x0000001a
  2.1683 +#define FILE_DEVICE_SERIAL_PORT           0x0000001b
  2.1684 +#define FILE_DEVICE_SCREEN                0x0000001c
  2.1685 +#define FILE_DEVICE_SOUND                 0x0000001d
  2.1686 +#define FILE_DEVICE_STREAMS               0x0000001e
  2.1687 +#define FILE_DEVICE_TAPE                  0x0000001f
  2.1688 +#define FILE_DEVICE_TAPE_FILE_SYSTEM      0x00000020
  2.1689 +#define FILE_DEVICE_TRANSPORT             0x00000021
  2.1690 +#define FILE_DEVICE_UNKNOWN               0x00000022
  2.1691 +#define FILE_DEVICE_VIDEO                 0x00000023
  2.1692 +#define FILE_DEVICE_VIRTUAL_DISK          0x00000024
  2.1693 +#define FILE_DEVICE_WAVE_IN               0x00000025
  2.1694 +#define FILE_DEVICE_WAVE_OUT              0x00000026
  2.1695 +#define FILE_DEVICE_8042_PORT             0x00000027
  2.1696 +#define FILE_DEVICE_NETWORK_REDIRECTOR    0x00000028
  2.1697 +#define FILE_DEVICE_BATTERY               0x00000029
  2.1698 +#define FILE_DEVICE_BUS_EXTENDER          0x0000002a
  2.1699 +#define FILE_DEVICE_MODEM                 0x0000002b
  2.1700 +#define FILE_DEVICE_VDM                   0x0000002c
  2.1701 +#define FILE_DEVICE_MASS_STORAGE          0x0000002d
  2.1702 +#define FILE_DEVICE_SMB                   0x0000002e
  2.1703 +#define FILE_DEVICE_KS                    0x0000002f
  2.1704 +#define FILE_DEVICE_CHANGER               0x00000030
  2.1705 +#define FILE_DEVICE_SMARTCARD             0x00000031
  2.1706 +#define FILE_DEVICE_ACPI                  0x00000032
  2.1707 +#define FILE_DEVICE_DVD                   0x00000033
  2.1708 +#define FILE_DEVICE_FULLSCREEN_VIDEO      0x00000034
  2.1709 +#define FILE_DEVICE_DFS_FILE_SYSTEM       0x00000035
  2.1710 +#define FILE_DEVICE_DFS_VOLUME            0x00000036
  2.1711 +#define FILE_DEVICE_SERENUM               0x00000037
  2.1712 +#define FILE_DEVICE_TERMSRV               0x00000038
  2.1713 +#define FILE_DEVICE_KSEC                  0x00000039
  2.1714 +#define FILE_DEVICE_FIPS		              0x0000003a
  2.1715 +
  2.1716 +typedef struct _DEVICE_OBJECT {
  2.1717 +  CSHORT  Type;
  2.1718 +  USHORT  Size;
  2.1719 +  LONG  ReferenceCount;
  2.1720 +  struct _DRIVER_OBJECT  *DriverObject;
  2.1721 +  struct _DEVICE_OBJECT  *NextDevice;
  2.1722 +  struct _DEVICE_OBJECT  *AttachedDevice;
  2.1723 +  struct _IRP  *CurrentIrp;
  2.1724 +  PIO_TIMER  Timer;
  2.1725 +  ULONG  Flags;
  2.1726 +  ULONG  Characteristics;
  2.1727 +  PVPB  Vpb;
  2.1728 +  PVOID  DeviceExtension;
  2.1729 +  DEVICE_TYPE  DeviceType;
  2.1730 +  CCHAR  StackSize;
  2.1731 +  union {
  2.1732 +    LIST_ENTRY  ListEntry;
  2.1733 +    WAIT_CONTEXT_BLOCK  Wcb;
  2.1734 +  } Queue;
  2.1735 +  ULONG  AlignmentRequirement;
  2.1736 +  KDEVICE_QUEUE  DeviceQueue;
  2.1737 +  KDPC  Dpc;
  2.1738 +  ULONG  ActiveThreadCount;
  2.1739 +  PSECURITY_DESCRIPTOR  SecurityDescriptor;
  2.1740 +  KEVENT  DeviceLock;
  2.1741 +  USHORT  SectorSize;
  2.1742 +  USHORT  Spare1;
  2.1743 +  struct _DEVOBJ_EXTENSION  *DeviceObjectExtension;
  2.1744 +  PVOID  Reserved;
  2.1745 +} DEVICE_OBJECT;
  2.1746 +typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
  2.1747 +
  2.1748 +typedef enum _DEVICE_RELATION_TYPE {
  2.1749 +  BusRelations,
  2.1750 +  EjectionRelations,
  2.1751 +  PowerRelations,
  2.1752 +  RemovalRelations,
  2.1753 +  TargetDeviceRelation,
  2.1754 +  SingleBusRelations
  2.1755 +} DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
  2.1756 +
  2.1757 +typedef struct _DEVICE_RELATIONS {
  2.1758 +  ULONG  Count;
  2.1759 +  PDEVICE_OBJECT Objects[1];
  2.1760 +} DEVICE_RELATIONS, *PDEVICE_RELATIONS;
  2.1761 +
  2.1762 +typedef struct _SCATTER_GATHER_ELEMENT {
  2.1763 +  PHYSICAL_ADDRESS  Address;   
  2.1764 +  ULONG  Length;          
  2.1765 +  ULONG_PTR  Reserved;
  2.1766 +} SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT;
  2.1767 +
  2.1768 +typedef struct _SCATTER_GATHER_LIST {
  2.1769 +  ULONG  NumberOfElements;
  2.1770 +  ULONG_PTR  Reserved;
  2.1771 +  SCATTER_GATHER_ELEMENT  Elements[0];
  2.1772 +} SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
  2.1773 +
  2.1774 +typedef struct _MDL {
  2.1775 +  struct _MDL  *Next;
  2.1776 +  CSHORT  Size;
  2.1777 +  CSHORT  MdlFlags;
  2.1778 +  struct _EPROCESS  *Process;
  2.1779 +  PVOID  MappedSystemVa;
  2.1780 +  PVOID  StartVa;
  2.1781 +  ULONG  ByteCount;
  2.1782 +  ULONG  ByteOffset;
  2.1783 +} MDL, *PMDL;
  2.1784 +
  2.1785 +#define MDL_MAPPED_TO_SYSTEM_VA           0x0001
  2.1786 +#define MDL_PAGES_LOCKED                  0x0002
  2.1787 +#define MDL_SOURCE_IS_NONPAGED_POOL       0x0004
  2.1788 +#define MDL_ALLOCATED_FIXED_SIZE          0x0008
  2.1789 +#define MDL_PARTIAL                       0x0010
  2.1790 +#define MDL_PARTIAL_HAS_BEEN_MAPPED       0x0020
  2.1791 +#define MDL_IO_PAGE_READ                  0x0040
  2.1792 +#define MDL_WRITE_OPERATION               0x0080
  2.1793 +#define MDL_PARENT_MAPPED_SYSTEM_VA       0x0100
  2.1794 +#define MDL_FREE_EXTRA_PTES               0x0200
  2.1795 +#define MDL_IO_SPACE                      0x0800
  2.1796 +#define MDL_NETWORK_HEADER                0x1000
  2.1797 +#define MDL_MAPPING_CAN_FAIL              0x2000
  2.1798 +#define MDL_ALLOCATED_MUST_SUCCEED        0x4000
  2.1799 +
  2.1800 +#define MDL_MAPPING_FLAGS ( \
  2.1801 +  MDL_MAPPED_TO_SYSTEM_VA     | \
  2.1802 +  MDL_PAGES_LOCKED            | \
  2.1803 +  MDL_SOURCE_IS_NONPAGED_POOL | \
  2.1804 +  MDL_PARTIAL_HAS_BEEN_MAPPED | \
  2.1805 +  MDL_PARENT_MAPPED_SYSTEM_VA | \
  2.1806 +  MDL_SYSTEM_VA               | \
  2.1807 +  MDL_IO_SPACE)
  2.1808 +
  2.1809 +typedef VOID DDKAPI
  2.1810 +(*PPUT_DMA_ADAPTER)(
  2.1811 +  /*IN*/ PDMA_ADAPTER  DmaAdapter);
  2.1812 +
  2.1813 +typedef PVOID DDKAPI
  2.1814 +(*PALLOCATE_COMMON_BUFFER)(
  2.1815 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1816 +  /*IN*/ ULONG  Length,
  2.1817 +  /*OUT*/ PPHYSICAL_ADDRESS  LogicalAddress,
  2.1818 +  /*IN*/ BOOLEAN  CacheEnabled);
  2.1819 +
  2.1820 +typedef VOID DDKAPI
  2.1821 +(*PFREE_COMMON_BUFFER)(
  2.1822 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1823 +  /*IN*/ ULONG  Length,
  2.1824 +  /*IN*/ PHYSICAL_ADDRESS  LogicalAddress,
  2.1825 +  /*IN*/ PVOID  VirtualAddress,
  2.1826 +  /*IN*/ BOOLEAN  CacheEnabled);
  2.1827 +
  2.1828 +typedef NTSTATUS DDKAPI
  2.1829 +(*PALLOCATE_ADAPTER_CHANNEL)(
  2.1830 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1831 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.1832 +  /*IN*/ ULONG  NumberOfMapRegisters,
  2.1833 +  /*IN*/ PDRIVER_CONTROL  ExecutionRoutine,
  2.1834 +  /*IN*/ PVOID  Context);
  2.1835 +
  2.1836 +typedef BOOLEAN DDKAPI
  2.1837 +(*PFLUSH_ADAPTER_BUFFERS)(
  2.1838 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1839 +  /*IN*/ PMDL  Mdl,
  2.1840 +  /*IN*/ PVOID  MapRegisterBase,
  2.1841 +  /*IN*/ PVOID  CurrentVa,
  2.1842 +  /*IN*/ ULONG  Length,
  2.1843 +  /*IN*/ BOOLEAN  WriteToDevice);
  2.1844 +
  2.1845 +typedef VOID DDKAPI
  2.1846 +(*PFREE_ADAPTER_CHANNEL)(
  2.1847 +  /*IN*/ PDMA_ADAPTER  DmaAdapter);
  2.1848 +
  2.1849 +typedef VOID DDKAPI
  2.1850 +(*PFREE_MAP_REGISTERS)(
  2.1851 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1852 +  PVOID  MapRegisterBase,
  2.1853 +  ULONG  NumberOfMapRegisters);
  2.1854 +
  2.1855 +typedef PHYSICAL_ADDRESS DDKAPI
  2.1856 +(*PMAP_TRANSFER)(
  2.1857 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1858 +  /*IN*/ PMDL  Mdl,
  2.1859 +  /*IN*/ PVOID  MapRegisterBase,
  2.1860 +  /*IN*/ PVOID  CurrentVa,
  2.1861 +  /*IN OUT*/ PULONG  Length,
  2.1862 +  /*IN*/ BOOLEAN  WriteToDevice);
  2.1863 +
  2.1864 +typedef ULONG DDKAPI
  2.1865 +(*PGET_DMA_ALIGNMENT)(
  2.1866 +  /*IN*/ PDMA_ADAPTER  DmaAdapter);
  2.1867 +
  2.1868 +typedef ULONG DDKAPI
  2.1869 +(*PREAD_DMA_COUNTER)(
  2.1870 +  /*IN*/ PDMA_ADAPTER  DmaAdapter);
  2.1871 +
  2.1872 +typedef NTSTATUS DDKAPI
  2.1873 +(*PGET_SCATTER_GATHER_LIST)(
  2.1874 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1875 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.1876 +  /*IN*/ PMDL  Mdl,
  2.1877 +  /*IN*/ PVOID  CurrentVa,
  2.1878 +  /*IN*/ ULONG  Length,
  2.1879 +  /*IN*/ PDRIVER_LIST_CONTROL  ExecutionRoutine,
  2.1880 +  /*IN*/ PVOID  Context,
  2.1881 +  /*IN*/ BOOLEAN  WriteToDevice);
  2.1882 +
  2.1883 +typedef VOID DDKAPI
  2.1884 +(*PPUT_SCATTER_GATHER_LIST)(
  2.1885 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1886 +  /*IN*/ PSCATTER_GATHER_LIST  ScatterGather,
  2.1887 +  /*IN*/ BOOLEAN  WriteToDevice);
  2.1888 +
  2.1889 +typedef NTSTATUS DDKAPI
  2.1890 +(*PCALCULATE_SCATTER_GATHER_LIST_SIZE)(
  2.1891 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1892 +  /*IN*/ PMDL  Mdl  /*OPTIONAL*/,
  2.1893 +  /*IN*/ PVOID  CurrentVa,
  2.1894 +  /*IN*/ ULONG  Length,
  2.1895 +  /*OUT*/ PULONG  ScatterGatherListSize,
  2.1896 +  /*OUT*/ PULONG  pNumberOfMapRegisters  /*OPTIONAL*/);
  2.1897 +
  2.1898 +typedef NTSTATUS DDKAPI
  2.1899 +(*PBUILD_SCATTER_GATHER_LIST)(
  2.1900 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1901 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.1902 +  /*IN*/ PMDL  Mdl,
  2.1903 +  /*IN*/ PVOID  CurrentVa,
  2.1904 +  /*IN*/ ULONG  Length,
  2.1905 +  /*IN*/ PDRIVER_LIST_CONTROL  ExecutionRoutine,
  2.1906 +  /*IN*/ PVOID  Context,
  2.1907 +  /*IN*/ BOOLEAN  WriteToDevice,
  2.1908 +  /*IN*/ PVOID  ScatterGatherBuffer,
  2.1909 +  /*IN*/ ULONG  ScatterGatherLength);
  2.1910 +
  2.1911 +typedef NTSTATUS DDKAPI
  2.1912 +(*PBUILD_MDL_FROM_SCATTER_GATHER_LIST)(
  2.1913 +  /*IN*/ PDMA_ADAPTER  DmaAdapter,
  2.1914 +  /*IN*/ PSCATTER_GATHER_LIST  ScatterGather,
  2.1915 +  /*IN*/ PMDL  OriginalMdl,
  2.1916 +  /*OUT*/ PMDL  *TargetMdl);
  2.1917 +
  2.1918 +typedef struct _DMA_OPERATIONS {
  2.1919 +  ULONG  Size;
  2.1920 +  PPUT_DMA_ADAPTER  PutDmaAdapter;
  2.1921 +  PALLOCATE_COMMON_BUFFER  AllocateCommonBuffer;
  2.1922 +  PFREE_COMMON_BUFFER  FreeCommonBuffer;
  2.1923 +  PALLOCATE_ADAPTER_CHANNEL  AllocateAdapterChannel;
  2.1924 +  PFLUSH_ADAPTER_BUFFERS  FlushAdapterBuffers;
  2.1925 +  PFREE_ADAPTER_CHANNEL  FreeAdapterChannel;
  2.1926 +  PFREE_MAP_REGISTERS  FreeMapRegisters;
  2.1927 +  PMAP_TRANSFER  MapTransfer;
  2.1928 +  PGET_DMA_ALIGNMENT  GetDmaAlignment;
  2.1929 +  PREAD_DMA_COUNTER  ReadDmaCounter;
  2.1930 +  PGET_SCATTER_GATHER_LIST  GetScatterGatherList;
  2.1931 +  PPUT_SCATTER_GATHER_LIST  PutScatterGatherList;
  2.1932 +  PCALCULATE_SCATTER_GATHER_LIST_SIZE  CalculateScatterGatherList;
  2.1933 +  PBUILD_SCATTER_GATHER_LIST  BuildScatterGatherList;
  2.1934 +  PBUILD_MDL_FROM_SCATTER_GATHER_LIST  BuildMdlFromScatterGatherList;
  2.1935 +} DMA_OPERATIONS, *PDMA_OPERATIONS;
  2.1936 +
  2.1937 +typedef struct _DMA_ADAPTER {
  2.1938 +  USHORT  Version;
  2.1939 +  USHORT  Size;
  2.1940 +  PDMA_OPERATIONS  DmaOperations;
  2.1941 +} DMA_ADAPTER;
  2.1942 +
  2.1943 +typedef enum _FILE_INFORMATION_CLASS {
  2.1944 +  FileDirectoryInformation = 1,
  2.1945 +  FileFullDirectoryInformation,
  2.1946 +  FileBothDirectoryInformation,
  2.1947 +  FileBasicInformation,
  2.1948 +  FileStandardInformation,
  2.1949 +  FileInternalInformation,
  2.1950 +  FileEaInformation,
  2.1951 +  FileAccessInformation,
  2.1952 +  FileNameInformation,
  2.1953 +  FileRenameInformation,
  2.1954 +  FileLinkInformation,
  2.1955 +  FileNamesInformation,
  2.1956 +  FileDispositionInformation,
  2.1957 +  FilePositionInformation,
  2.1958 +  FileFullEaInformation,
  2.1959 +  FileModeInformation,
  2.1960 +  FileAlignmentInformation,
  2.1961 +  FileAllInformation,
  2.1962 +  FileAllocationInformation,
  2.1963 +  FileEndOfFileInformation,
  2.1964 +  FileAlternateNameInformation,
  2.1965 +  FileStreamInformation,
  2.1966 +  FilePipeInformation,
  2.1967 +  FilePipeLocalInformation,
  2.1968 +  FilePipeRemoteInformation,
  2.1969 +  FileMailslotQueryInformation,
  2.1970 +  FileMailslotSetInformation,
  2.1971 +  FileCompressionInformation,
  2.1972 +  FileObjectIdInformation,
  2.1973 +  FileCompletionInformation,
  2.1974 +  FileMoveClusterInformation,
  2.1975 +  FileQuotaInformation,
  2.1976 +  FileReparsePointInformation,
  2.1977 +  FileNetworkOpenInformation,
  2.1978 +  FileAttributeTagInformation,
  2.1979 +  FileTrackingInformation,
  2.1980 +  FileIdBothDirectoryInformation,
  2.1981 +  FileIdFullDirectoryInformation,
  2.1982 +  FileValidDataLengthInformation,
  2.1983 +  FileShortNameInformation,
  2.1984 +  FileMaximumInformation
  2.1985 +} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
  2.1986 +
  2.1987 +typedef struct _FILE_POSITION_INFORMATION {                 
  2.1988 +  LARGE_INTEGER  CurrentByteOffset;                        
  2.1989 +} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION;   
  2.1990 +
  2.1991 +typedef struct _FILE_ALIGNMENT_INFORMATION {
  2.1992 +  ULONG  AlignmentRequirement;
  2.1993 +} FILE_ALIGNMENT_INFORMATION;
  2.1994 +
  2.1995 +typedef struct _FILE_NAME_INFORMATION {                     
  2.1996 +  ULONG  FileNameLength;                                   
  2.1997 +  WCHAR  FileName[1];                                      
  2.1998 +} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION;           
  2.1999 +
  2.2000 +typedef struct _FILE_BASIC_INFORMATION {
  2.2001 +  LARGE_INTEGER  CreationTime;
  2.2002 +  LARGE_INTEGER  LastAccessTime;
  2.2003 +  LARGE_INTEGER  LastWriteTime;
  2.2004 +  LARGE_INTEGER  ChangeTime;
  2.2005 +  ULONG  FileAttributes;
  2.2006 +} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION;
  2.2007 +
  2.2008 +typedef struct _FILE_STANDARD_INFORMATION {
  2.2009 +  LARGE_INTEGER  AllocationSize;
  2.2010 +  LARGE_INTEGER  EndOfFile;
  2.2011 +  ULONG  NumberOfLinks;
  2.2012 +  BOOLEAN  DeletePending;
  2.2013 +  BOOLEAN  Directory;
  2.2014 +} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
  2.2015 +
  2.2016 +typedef struct _FILE_NETWORK_OPEN_INFORMATION {                 
  2.2017 +  LARGE_INTEGER  CreationTime;                                 
  2.2018 +  LARGE_INTEGER  LastAccessTime;                               
  2.2019 +  LARGE_INTEGER  LastWriteTime;                                
  2.2020 +  LARGE_INTEGER  ChangeTime;                                   
  2.2021 +  LARGE_INTEGER  AllocationSize;                               
  2.2022 +  LARGE_INTEGER  EndOfFile;                                    
  2.2023 +  ULONG  FileAttributes;                                       
  2.2024 +} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;   
  2.2025 +
  2.2026 +typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION {               
  2.2027 +  ULONG  FileAttributes;                                       
  2.2028 +  ULONG  ReparseTag;                                           
  2.2029 +} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
  2.2030 +
  2.2031 +typedef struct _FILE_DISPOSITION_INFORMATION {                  
  2.2032 +  BOOLEAN  DoDeleteFile;                                         
  2.2033 +} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; 
  2.2034 +                                                                
  2.2035 +typedef struct _FILE_END_OF_FILE_INFORMATION {                  
  2.2036 +  LARGE_INTEGER  EndOfFile;                                    
  2.2037 +} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; 
  2.2038 +                                                                
  2.2039 +typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION {                                    
  2.2040 +  LARGE_INTEGER  ValidDataLength;                                                      
  2.2041 +} FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;             
  2.2042 +
  2.2043 +typedef enum _FSINFOCLASS {
  2.2044 +  FileFsVolumeInformation = 1,
  2.2045 +  FileFsLabelInformation,
  2.2046 +  FileFsSizeInformation,
  2.2047 +  FileFsDeviceInformation,
  2.2048 +  FileFsAttributeInformation,
  2.2049 +  FileFsControlInformation,
  2.2050 +  FileFsFullSizeInformation,
  2.2051 +  FileFsObjectIdInformation,
  2.2052 +  FileFsDriverPathInformation,
  2.2053 +  FileFsMaximumInformation
  2.2054 +} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
  2.2055 +
  2.2056 +typedef struct _FILE_FS_DEVICE_INFORMATION {
  2.2057 +  DEVICE_TYPE  DeviceType;
  2.2058 +  ULONG  Characteristics;
  2.2059 +} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION;
  2.2060 +
  2.2061 +typedef struct _FILE_FULL_EA_INFORMATION {
  2.2062 +  ULONG  NextEntryOffset;
  2.2063 +  UCHAR  Flags;
  2.2064 +  UCHAR  EaNameLength;
  2.2065 +  USHORT  EaValueLength;
  2.2066 +  CHAR  EaName[1];
  2.2067 +} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
  2.2068 +
  2.2069 +typedef ULONG_PTR ERESOURCE_THREAD;
  2.2070 +typedef ERESOURCE_THREAD *PERESOURCE_THREAD;
  2.2071 +
  2.2072 +typedef struct _OWNER_ENTRY {
  2.2073 +  ERESOURCE_THREAD  OwnerThread;
  2.2074 +  _ANONYMOUS_UNION union {
  2.2075 +      LONG  OwnerCount;
  2.2076 +      ULONG  TableSize;
  2.2077 +  } DUMMYUNIONNAME;
  2.2078 +} OWNER_ENTRY, *POWNER_ENTRY;
  2.2079 +
  2.2080 +/* ERESOURCE.Flag */
  2.2081 +
  2.2082 +#define ResourceNeverExclusive            0x0010
  2.2083 +#define ResourceReleaseByOtherThread      0x0020
  2.2084 +#define ResourceOwnedExclusive            0x0080
  2.2085 +
  2.2086 +#define RESOURCE_HASH_TABLE_SIZE          64
  2.2087 +
  2.2088 +typedef struct _ERESOURCE {
  2.2089 +  LIST_ENTRY  SystemResourcesList;
  2.2090 +  POWNER_ENTRY  OwnerTable;
  2.2091 +  SHORT  ActiveCount;
  2.2092 +  USHORT  Flag;
  2.2093 +  PKSEMAPHORE  SharedWaiters;
  2.2094 +  PKEVENT  ExclusiveWaiters;
  2.2095 +  OWNER_ENTRY  OwnerThreads[2];
  2.2096 +  ULONG  ContentionCount;
  2.2097 +  USHORT  NumberOfSharedWaiters;
  2.2098 +  USHORT  NumberOfExclusiveWaiters;
  2.2099 +  _ANONYMOUS_UNION union {
  2.2100 +    PVOID  Address;
  2.2101 +    ULONG_PTR  CreatorBackTraceIndex;
  2.2102 +  } DUMMYUNIONNAME;
  2.2103 +  KSPIN_LOCK  SpinLock;
  2.2104 +} ERESOURCE, *PERESOURCE;
  2.2105 +
  2.2106 +/* NOTE: PVOID for methods to avoid 'assignment from incompatible pointer type' warning */
  2.2107 +typedef struct _DRIVER_EXTENSION {
  2.2108 +  struct _DRIVER_OBJECT  *DriverObject;
  2.2109 +  PVOID  AddDevice;
  2.2110 +  ULONG  Count;
  2.2111 +  UNICODE_STRING  ServiceKeyName;
  2.2112 +} DRIVER_EXTENSION, *PDRIVER_EXTENSION;
  2.2113 +
  2.2114 +typedef BOOLEAN DDKAPI
  2.2115 +(*PFAST_IO_CHECK_IF_POSSIBLE)(
  2.2116 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2117 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2118 +  /*IN*/ ULONG  Length,
  2.2119 +  /*IN*/ BOOLEAN  Wait,
  2.2120 +  /*IN*/ ULONG  LockKey,
  2.2121 +  /*IN*/ BOOLEAN  CheckForReadOperation,
  2.2122 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2123 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2124 +
  2.2125 +typedef BOOLEAN DDKAPI
  2.2126 +(*PFAST_IO_READ)(
  2.2127 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2128 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2129 +  /*IN*/ ULONG  Length,
  2.2130 +  /*IN*/ BOOLEAN  Wait,
  2.2131 +  /*IN*/ ULONG  LockKey,
  2.2132 +  /*OUT*/ PVOID  Buffer,
  2.2133 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2134 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2135 +
  2.2136 +typedef BOOLEAN DDKAPI
  2.2137 +(*PFAST_IO_WRITE)(
  2.2138 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2139 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2140 +  /*IN*/ ULONG  Length,
  2.2141 +  /*IN*/ BOOLEAN  Wait,
  2.2142 +  /*IN*/ ULONG  LockKey,
  2.2143 +  /*IN*/ PVOID  Buffer,
  2.2144 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2145 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2146 +
  2.2147 +typedef BOOLEAN DDKAPI
  2.2148 +(*PFAST_IO_QUERY_BASIC_INFO)(
  2.2149 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2150 +  /*IN*/ BOOLEAN  Wait,
  2.2151 +  /*OUT*/ PFILE_BASIC_INFORMATION  Buffer,
  2.2152 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2153 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2154 +
  2.2155 +typedef BOOLEAN DDKAPI
  2.2156 +(*PFAST_IO_QUERY_STANDARD_INFO)(
  2.2157 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2158 +  /*IN*/ BOOLEAN  Wait,
  2.2159 +  /*OUT*/ PFILE_STANDARD_INFORMATION  Buffer,
  2.2160 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2161 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2162 +
  2.2163 +typedef BOOLEAN DDKAPI
  2.2164 +(*PFAST_IO_LOCK)(
  2.2165 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2166 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2167 +  /*IN*/ PLARGE_INTEGER  Length,
  2.2168 +  PEPROCESS  ProcessId,
  2.2169 +  ULONG  Key,
  2.2170 +  BOOLEAN  FailImmediately,
  2.2171 +  BOOLEAN  ExclusiveLock,
  2.2172 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2173 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2174 +
  2.2175 +typedef BOOLEAN DDKAPI
  2.2176 +(*PFAST_IO_UNLOCK_SINGLE)(
  2.2177 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2178 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2179 +  /*IN*/ PLARGE_INTEGER  Length,
  2.2180 +  PEPROCESS  ProcessId,
  2.2181 +  ULONG  Key,
  2.2182 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2183 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2184 +
  2.2185 +typedef BOOLEAN DDKAPI
  2.2186 +(*PFAST_IO_UNLOCK_ALL)(
  2.2187 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2188 +  PEPROCESS  ProcessId,
  2.2189 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2190 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2191 +
  2.2192 +typedef BOOLEAN DDKAPI
  2.2193 +(*PFAST_IO_UNLOCK_ALL_BY_KEY)(
  2.2194 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2195 +  PVOID  ProcessId,
  2.2196 +  ULONG  Key,
  2.2197 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2198 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2199 +
  2.2200 +typedef BOOLEAN DDKAPI
  2.2201 +(*PFAST_IO_DEVICE_CONTROL)(
  2.2202 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2203 +  /*IN*/ BOOLEAN  Wait,
  2.2204 +  /*IN*/ PVOID  InputBuffer  /*OPTIONAL*/,
  2.2205 +  /*IN*/ ULONG  InputBufferLength,
  2.2206 +  /*OUT*/ PVOID  OutputBuffer  /*OPTIONAL*/,
  2.2207 +  /*IN*/ ULONG  OutputBufferLength,
  2.2208 +  /*IN*/ ULONG  IoControlCode,
  2.2209 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2210 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2211 +
  2.2212 +typedef VOID DDKAPI
  2.2213 +(*PFAST_IO_ACQUIRE_FILE)(
  2.2214 +  /*IN*/ struct _FILE_OBJECT  *FileObject);
  2.2215 +
  2.2216 +typedef VOID DDKAPI
  2.2217 +(*PFAST_IO_RELEASE_FILE)(
  2.2218 +  /*IN*/ struct _FILE_OBJECT  *FileObject);
  2.2219 +
  2.2220 +typedef VOID DDKAPI
  2.2221 +(*PFAST_IO_DETACH_DEVICE)(
  2.2222 +  /*IN*/ struct _DEVICE_OBJECT  *SourceDevice,
  2.2223 +  /*IN*/ struct _DEVICE_OBJECT  *TargetDevice);
  2.2224 +
  2.2225 +typedef BOOLEAN DDKAPI
  2.2226 +(*PFAST_IO_QUERY_NETWORK_OPEN_INFO)(
  2.2227 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2228 +  /*IN*/ BOOLEAN  Wait,
  2.2229 +  /*OUT*/ struct _FILE_NETWORK_OPEN_INFORMATION  *Buffer,
  2.2230 +  /*OUT*/ struct _IO_STATUS_BLOCK  *IoStatus,
  2.2231 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2232 +
  2.2233 +typedef NTSTATUS DDKAPI
  2.2234 +(*PFAST_IO_ACQUIRE_FOR_MOD_WRITE)(
  2.2235 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2236 +  /*IN*/ PLARGE_INTEGER  EndingOffset,
  2.2237 +  /*OUT*/ struct _ERESOURCE  **ResourceToRelease,
  2.2238 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2239 +
  2.2240 +typedef BOOLEAN DDKAPI
  2.2241 +(*PFAST_IO_MDL_READ)(
  2.2242 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2243 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2244 +  /*IN*/ ULONG  Length,
  2.2245 +  /*IN*/ ULONG  LockKey,
  2.2246 +  /*OUT*/ PMDL  *MdlChain,
  2.2247 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2248 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2249 +
  2.2250 +typedef BOOLEAN DDKAPI
  2.2251 +(*PFAST_IO_MDL_READ_COMPLETE)(
  2.2252 +  /*IN*/ struct _FILE_OBJECT *FileObject,
  2.2253 +  /*IN*/ PMDL MdlChain,
  2.2254 +  /*IN*/ struct _DEVICE_OBJECT *DeviceObject);
  2.2255 +
  2.2256 +typedef BOOLEAN DDKAPI
  2.2257 +(*PFAST_IO_PREPARE_MDL_WRITE)(
  2.2258 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2259 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2260 +  /*IN*/ ULONG  Length,
  2.2261 +  /*IN*/ ULONG  LockKey,
  2.2262 +  /*OUT*/ PMDL  *MdlChain,
  2.2263 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2264 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2265 +
  2.2266 +typedef BOOLEAN DDKAPI
  2.2267 +(*PFAST_IO_MDL_WRITE_COMPLETE)(
  2.2268 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2269 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2270 +  /*IN*/ PMDL  MdlChain,
  2.2271 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2272 +
  2.2273 +typedef BOOLEAN DDKAPI
  2.2274 +(*PFAST_IO_READ_COMPRESSED)(
  2.2275 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2276 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2277 +  /*IN*/ ULONG  Length,
  2.2278 +  /*IN*/ ULONG  LockKey,
  2.2279 +  /*OUT*/ PVOID  Buffer,
  2.2280 +  /*OUT*/ PMDL  *MdlChain,
  2.2281 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2282 +  /*OUT*/ struct _COMPRESSED_DATA_INFO  *CompressedDataInfo,
  2.2283 +  /*IN*/ ULONG  CompressedDataInfoLength,
  2.2284 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2285 +
  2.2286 +typedef BOOLEAN DDKAPI
  2.2287 +(*PFAST_IO_WRITE_COMPRESSED)(
  2.2288 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2289 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2290 +  /*IN*/ ULONG  Length,
  2.2291 +  /*IN*/ ULONG  LockKey,
  2.2292 +  /*IN*/ PVOID  Buffer,
  2.2293 +  /*OUT*/ PMDL  *MdlChain,
  2.2294 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatus,
  2.2295 +  /*IN*/ struct _COMPRESSED_DATA_INFO  *CompressedDataInfo,
  2.2296 +  /*IN*/ ULONG  CompressedDataInfoLength,
  2.2297 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2298 +
  2.2299 +typedef BOOLEAN DDKAPI
  2.2300 +(*PFAST_IO_MDL_READ_COMPLETE_COMPRESSED)(
  2.2301 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2302 +  /*IN*/ PMDL  MdlChain,
  2.2303 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2304 +
  2.2305 +typedef BOOLEAN DDKAPI
  2.2306 +(*PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED)(
  2.2307 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2308 +  /*IN*/ PLARGE_INTEGER  FileOffset,
  2.2309 +  /*IN*/ PMDL  MdlChain,
  2.2310 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2311 +
  2.2312 +typedef BOOLEAN DDKAPI
  2.2313 +(*PFAST_IO_QUERY_OPEN)(
  2.2314 +  /*IN*/ struct _IRP  *Irp,
  2.2315 +  /*OUT*/ PFILE_NETWORK_OPEN_INFORMATION  NetworkInformation,
  2.2316 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2317 +
  2.2318 +typedef NTSTATUS DDKAPI
  2.2319 +(*PFAST_IO_RELEASE_FOR_MOD_WRITE)(
  2.2320 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2321 +  /*IN*/ struct _ERESOURCE  *ResourceToRelease,
  2.2322 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2323 +
  2.2324 +typedef NTSTATUS DDKAPI
  2.2325 +(*PFAST_IO_ACQUIRE_FOR_CCFLUSH)(
  2.2326 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2327 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2328 +
  2.2329 +typedef NTSTATUS DDKAPI
  2.2330 +(*PFAST_IO_RELEASE_FOR_CCFLUSH) (
  2.2331 +  /*IN*/ struct _FILE_OBJECT  *FileObject,
  2.2332 +  /*IN*/ struct _DEVICE_OBJECT  *DeviceObject);
  2.2333 +
  2.2334 +typedef struct _FAST_IO_DISPATCH {
  2.2335 +  ULONG  SizeOfFastIoDispatch;
  2.2336 +  PFAST_IO_CHECK_IF_POSSIBLE  FastIoCheckIfPossible;
  2.2337 +  PFAST_IO_READ  FastIoRead;
  2.2338 +  PFAST_IO_WRITE  FastIoWrite;
  2.2339 +  PFAST_IO_QUERY_BASIC_INFO  FastIoQueryBasicInfo;
  2.2340 +  PFAST_IO_QUERY_STANDARD_INFO  FastIoQueryStandardInfo;
  2.2341 +  PFAST_IO_LOCK  FastIoLock;
  2.2342 +  PFAST_IO_UNLOCK_SINGLE  FastIoUnlockSingle;
  2.2343 +  PFAST_IO_UNLOCK_ALL  FastIoUnlockAll;
  2.2344 +  PFAST_IO_UNLOCK_ALL_BY_KEY  FastIoUnlockAllByKey;
  2.2345 +  PFAST_IO_DEVICE_CONTROL  FastIoDeviceControl;
  2.2346 +  PFAST_IO_ACQUIRE_FILE  AcquireFileForNtCreateSection;
  2.2347 +  PFAST_IO_RELEASE_FILE  ReleaseFileForNtCreateSection;
  2.2348 +  PFAST_IO_DETACH_DEVICE  FastIoDetachDevice;
  2.2349 +  PFAST_IO_QUERY_NETWORK_OPEN_INFO  FastIoQueryNetworkOpenInfo;
  2.2350 +  PFAST_IO_ACQUIRE_FOR_MOD_WRITE  AcquireForModWrite;
  2.2351 +  PFAST_IO_MDL_READ  MdlRead;
  2.2352 +  PFAST_IO_MDL_READ_COMPLETE  MdlReadComplete;
  2.2353 +  PFAST_IO_PREPARE_MDL_WRITE  PrepareMdlWrite;
  2.2354 +  PFAST_IO_MDL_WRITE_COMPLETE  MdlWriteComplete;
  2.2355 +  PFAST_IO_READ_COMPRESSED  FastIoReadCompressed;
  2.2356 +  PFAST_IO_WRITE_COMPRESSED  FastIoWriteCompressed;
  2.2357 +  PFAST_IO_MDL_READ_COMPLETE_COMPRESSED  MdlReadCompleteCompressed;
  2.2358 +  PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED  MdlWriteCompleteCompressed;
  2.2359 +  PFAST_IO_QUERY_OPEN  FastIoQueryOpen;
  2.2360 +  PFAST_IO_RELEASE_FOR_MOD_WRITE  ReleaseForModWrite;
  2.2361 +  PFAST_IO_ACQUIRE_FOR_CCFLUSH  AcquireForCcFlush;
  2.2362 +  PFAST_IO_RELEASE_FOR_CCFLUSH  ReleaseForCcFlush;
  2.2363 +} FAST_IO_DISPATCH, *PFAST_IO_DISPATCH;
  2.2364 +
  2.2365 +typedef struct _DRIVER_OBJECT {
  2.2366 +  CSHORT  Type;
  2.2367 +  CSHORT  Size;
  2.2368 +  PDEVICE_OBJECT  DeviceObject;
  2.2369 +  ULONG  Flags;
  2.2370 +  PVOID  DriverStart;
  2.2371 +  ULONG  DriverSize;
  2.2372 +  PVOID  DriverSection;
  2.2373 +  PDRIVER_EXTENSION  DriverExtension;
  2.2374 +  UNICODE_STRING  DriverName;
  2.2375 +  PUNICODE_STRING  HardwareDatabase;
  2.2376 +  PFAST_IO_DISPATCH  FastIoDispatch;
  2.2377 +  PDRIVER_INITIALIZE  DriverInit;
  2.2378 +  PDRIVER_STARTIO  DriverStartIo;
  2.2379 +  PDRIVER_UNLOAD  DriverUnload;
  2.2380 +  PDRIVER_DISPATCH  MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1];
  2.2381 +} DRIVER_OBJECT;
  2.2382 +typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
  2.2383 +
  2.2384 +typedef struct _SECTION_OBJECT_POINTERS {
  2.2385 +  PVOID  DataSectionObject;
  2.2386 +  PVOID  SharedCacheMap;
  2.2387 +  PVOID  ImageSectionObject;
  2.2388 +} SECTION_OBJECT_POINTERS, *PSECTION_OBJECT_POINTERS;
  2.2389 +
  2.2390 +typedef struct _IO_COMPLETION_CONTEXT {
  2.2391 +  PVOID  Port;
  2.2392 +  PVOID  Key;
  2.2393 +} IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT;
  2.2394 +
  2.2395 +/* FILE_OBJECT.Flags */
  2.2396 +
  2.2397 +#define FO_FILE_OPEN                      0x00000001
  2.2398 +#define FO_SYNCHRONOUS_IO                 0x00000002
  2.2399 +#define FO_ALERTABLE_IO                   0x00000004
  2.2400 +#define FO_NO_INTERMEDIATE_BUFFERING      0x00000008
  2.2401 +#define FO_WRITE_THROUGH                  0x00000010
  2.2402 +#define FO_SEQUENTIAL_ONLY                0x00000020
  2.2403 +#define FO_CACHE_SUPPORTED                0x00000040
  2.2404 +#define FO_NAMED_PIPE                     0x00000080
  2.2405 +#define FO_STREAM_FILE                    0x00000100
  2.2406 +#define FO_MAILSLOT                       0x00000200
  2.2407 +#define FO_GENERATE_AUDIT_ON_CLOSE        0x00000400
  2.2408 +#define FO_DIRECT_DEVICE_OPEN             0x00000800
  2.2409 +#define FO_FILE_MODIFIED                  0x00001000
  2.2410 +#define FO_FILE_SIZE_CHANGED              0x00002000
  2.2411 +#define FO_CLEANUP_COMPLETE               0x00004000
  2.2412 +#define FO_TEMPORARY_FILE                 0x00008000
  2.2413 +#define FO_DELETE_ON_CLOSE                0x00010000
  2.2414 +#define FO_OPENED_CASE_SENSITIVE          0x00020000
  2.2415 +#define FO_HANDLE_CREATED                 0x00040000
  2.2416 +#define FO_FILE_FAST_IO_READ              0x00080000
  2.2417 +#define FO_RANDOM_ACCESS                  0x00100000
  2.2418 +#define FO_FILE_OPEN_CANCELLED            0x00200000
  2.2419 +#define FO_VOLUME_OPEN                    0x00400000
  2.2420 +#define FO_FILE_OBJECT_HAS_EXTENSION      0x00800000
  2.2421 +#define FO_REMOTE_ORIGIN                  0x01000000
  2.2422 +
  2.2423 +typedef struct _FILE_OBJECT {
  2.2424 +  CSHORT  Type;
  2.2425 +  CSHORT  Size;
  2.2426 +  PDEVICE_OBJECT  DeviceObject;
  2.2427 +  PVPB  Vpb;
  2.2428 +  PVOID  FsContext;
  2.2429 +  PVOID  FsContext2;
  2.2430 +  PSECTION_OBJECT_POINTERS  SectionObjectPointer;
  2.2431 +  PVOID  PrivateCacheMap;
  2.2432 +  NTSTATUS  FinalStatus;
  2.2433 +  struct _FILE_OBJECT  *RelatedFileObject;
  2.2434 +  BOOLEAN  LockOperation;
  2.2435 +  BOOLEAN  DeletePending;
  2.2436 +  BOOLEAN  ReadAccess;
  2.2437 +  BOOLEAN  WriteAccess;
  2.2438 +  BOOLEAN  DeleteAccess;
  2.2439 +  BOOLEAN  SharedRead;
  2.2440 +  BOOLEAN  SharedWrite;
  2.2441 +  BOOLEAN  SharedDelete;
  2.2442 +  ULONG  Flags;
  2.2443 +  UNICODE_STRING  FileName;
  2.2444 +  LARGE_INTEGER  CurrentByteOffset;
  2.2445 +  ULONG  Waiters;
  2.2446 +  ULONG  Busy;
  2.2447 +  PVOID  LastLock;
  2.2448 +  KEVENT  Lock;
  2.2449 +  KEVENT  Event;
  2.2450 +  PIO_COMPLETION_CONTEXT  CompletionContext;
  2.2451 +} FILE_OBJECT;
  2.2452 +typedef struct _FILE_OBJECT *PFILE_OBJECT;
  2.2453 +
  2.2454 +typedef enum _SECURITY_OPERATION_CODE {
  2.2455 +  SetSecurityDescriptor,
  2.2456 +  QuerySecurityDescriptor,
  2.2457 +  DeleteSecurityDescriptor,
  2.2458 +  AssignSecurityDescriptor
  2.2459 +} SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE;
  2.2460 +
  2.2461 +#define INITIAL_PRIVILEGE_COUNT           3
  2.2462 +
  2.2463 +typedef struct _INITIAL_PRIVILEGE_SET {
  2.2464 +  ULONG  PrivilegeCount;
  2.2465 +  ULONG  Control;
  2.2466 +  LUID_AND_ATTRIBUTES  Privilege[INITIAL_PRIVILEGE_COUNT];
  2.2467 +} INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET;
  2.2468 +
  2.2469 +typedef struct _SECURITY_SUBJECT_CONTEXT {
  2.2470 +  PACCESS_TOKEN  ClientToken;
  2.2471 +  SECURITY_IMPERSONATION_LEVEL  ImpersonationLevel;
  2.2472 +  PACCESS_TOKEN  PrimaryToken;
  2.2473 +  PVOID  ProcessAuditId;
  2.2474 +} SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT;
  2.2475 +
  2.2476 +#include <pshpack4.h>
  2.2477 +typedef struct _ACCESS_STATE {
  2.2478 +  LUID  OperationID;
  2.2479 +  BOOLEAN  SecurityEvaluated;
  2.2480 +  BOOLEAN  GenerateAudit;
  2.2481 +  BOOLEAN  GenerateOnClose;
  2.2482 +  BOOLEAN  PrivilegesAllocated;
  2.2483 +  ULONG  Flags;
  2.2484 +  ACCESS_MASK  RemainingDesiredAccess;
  2.2485 +  ACCESS_MASK  PreviouslyGrantedAccess;
  2.2486 +  ACCESS_MASK  OriginalDesiredAccess;
  2.2487 +  SECURITY_SUBJECT_CONTEXT  SubjectSecurityContext;
  2.2488 +  PSECURITY_DESCRIPTOR  SecurityDescriptor;
  2.2489 +  PVOID  AuxData;
  2.2490 +  union {
  2.2491 +    INITIAL_PRIVILEGE_SET  InitialPrivilegeSet;
  2.2492 +    PRIVILEGE_SET  PrivilegeSet;
  2.2493 +  } Privileges;
  2.2494 +
  2.2495 +  BOOLEAN  AuditPrivileges;
  2.2496 +  UNICODE_STRING  ObjectName;
  2.2497 +  UNICODE_STRING  ObjectTypeName;
  2.2498 +} ACCESS_STATE, *PACCESS_STATE;
  2.2499 +#include <poppack.h>
  2.2500 +
  2.2501 +typedef struct _IO_SECURITY_CONTEXT {
  2.2502 +  PSECURITY_QUALITY_OF_SERVICE  SecurityQos;
  2.2503 +  PACCESS_STATE  AccessState;
  2.2504 +  ACCESS_MASK  DesiredAccess;
  2.2505 +  ULONG  FullCreateOptions;
  2.2506 +} IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT;
  2.2507 +
  2.2508 +struct _IO_CSQ;
  2.2509 +
  2.2510 +typedef struct _IO_CSQ_IRP_CONTEXT {
  2.2511 +  ULONG  Type;
  2.2512 +  struct _IRP  *Irp;
  2.2513 +  struct _IO_CSQ  *Csq;
  2.2514 +} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT;
  2.2515 +
  2.2516 +typedef VOID DDKAPI
  2.2517 +(*PIO_CSQ_INSERT_IRP)(
  2.2518 +  /*IN*/ struct _IO_CSQ  *Csq,
  2.2519 +  /*IN*/ PIRP  Irp);
  2.2520 +
  2.2521 +typedef VOID DDKAPI
  2.2522 +(*PIO_CSQ_REMOVE_IRP)(
  2.2523 +  /*IN*/ struct _IO_CSQ  *Csq,
  2.2524 +  /*IN*/ PIRP  Irp);
  2.2525 +
  2.2526 +typedef PIRP DDKAPI
  2.2527 +(*PIO_CSQ_PEEK_NEXT_IRP)(
  2.2528 +  /*IN*/ struct _IO_CSQ  *Csq,
  2.2529 +  /*IN*/ PIRP  Irp,
  2.2530 +  /*IN*/ PVOID  PeekContext);
  2.2531 +
  2.2532 +typedef VOID DDKAPI
  2.2533 +(*PIO_CSQ_ACQUIRE_LOCK)(
  2.2534 +  /*IN*/ struct _IO_CSQ  *Csq,
  2.2535 +  /*OUT*/ PKIRQL  Irql);
  2.2536 +
  2.2537 +typedef VOID DDKAPI
  2.2538 +(*PIO_CSQ_RELEASE_LOCK)(
  2.2539 +  /*IN*/ struct _IO_CSQ  *Csq,
  2.2540 +  /*IN*/ KIRQL  Irql);
  2.2541 +
  2.2542 +typedef VOID DDKAPI
  2.2543 +(*PIO_CSQ_COMPLETE_CANCELED_IRP)(
  2.2544 +  /*IN*/ struct _IO_CSQ  *Csq,
  2.2545 +  /*IN*/ PIRP  Irp);
  2.2546 +
  2.2547 +typedef struct _IO_CSQ {
  2.2548 +  ULONG  Type;
  2.2549 +  PIO_CSQ_INSERT_IRP  CsqInsertIrp;
  2.2550 +  PIO_CSQ_REMOVE_IRP  CsqRemoveIrp;
  2.2551 +  PIO_CSQ_PEEK_NEXT_IRP  CsqPeekNextIrp;
  2.2552 +  PIO_CSQ_ACQUIRE_LOCK  CsqAcquireLock;
  2.2553 +  PIO_CSQ_RELEASE_LOCK  CsqReleaseLock;
  2.2554 +  PIO_CSQ_COMPLETE_CANCELED_IRP  CsqCompleteCanceledIrp;
  2.2555 +  PVOID  ReservePointer;
  2.2556 +} IO_CSQ, *PIO_CSQ;
  2.2557 +
  2.2558 +#include <pshpack4.h>
  2.2559 +typedef struct _IO_STACK_LOCATION {
  2.2560 +  UCHAR  MajorFunction;
  2.2561 +  UCHAR  MinorFunction;
  2.2562 +  UCHAR  Flags;
  2.2563 +  UCHAR  Control;
  2.2564 +  union {
  2.2565 +    struct {
  2.2566 +      PIO_SECURITY_CONTEXT  SecurityContext;
  2.2567 +      ULONG  Options;
  2.2568 +      USHORT POINTER_ALIGNMENT  FileAttributes;
  2.2569 +      USHORT  ShareAccess;
  2.2570 +      ULONG POINTER_ALIGNMENT  EaLength;
  2.2571 +    } Create;
  2.2572 +    struct {
  2.2573 +      ULONG  Length;
  2.2574 +      ULONG POINTER_ALIGNMENT  Key;
  2.2575 +      LARGE_INTEGER  ByteOffset;
  2.2576 +    } Read;
  2.2577 +    struct {
  2.2578 +      ULONG  Length;
  2.2579 +      ULONG POINTER_ALIGNMENT  Key;
  2.2580 +      LARGE_INTEGER  ByteOffset;
  2.2581 +    } Write;
  2.2582 +    struct {
  2.2583 +      ULONG  Length;
  2.2584 +      FILE_INFORMATION_CLASS POINTER_ALIGNMENT  FileInformationClass;
  2.2585 +    } QueryFile;
  2.2586 +    struct {
  2.2587 +      ULONG  Length;
  2.2588 +      FILE_INFORMATION_CLASS POINTER_ALIGNMENT  FileInformationClass;
  2.2589 +      PFILE_OBJECT  FileObject;
  2.2590 +      _ANONYMOUS_UNION union {
  2.2591 +        _ANONYMOUS_STRUCT struct {
  2.2592 +          BOOLEAN  ReplaceIfExists;
  2.2593 +          BOOLEAN  AdvanceOnly;
  2.2594 +        } DUMMYSTRUCTNAME;
  2.2595 +        ULONG  ClusterCount;
  2.2596 +        HANDLE  DeleteHandle;
  2.2597 +      } DUMMYUNIONNAME;
  2.2598 +    } SetFile;
  2.2599 +    struct {
  2.2600 +      ULONG  Length;
  2.2601 +      FS_INFORMATION_CLASS POINTER_ALIGNMENT  FsInformationClass;
  2.2602 +    } QueryVolume;
  2.2603 +    struct {
  2.2604 +      ULONG  OutputBufferLength;
  2.2605 +      ULONG POINTER_ALIGNMENT  InputBufferLength;
  2.2606 +      ULONG POINTER_ALIGNMENT  IoControlCode;
  2.2607 +      PVOID  Type3InputBuffer;
  2.2608 +    } DeviceIoControl;
  2.2609 +    struct {
  2.2610 +      SECURITY_INFORMATION  SecurityInformation;
  2.2611 +      ULONG POINTER_ALIGNMENT  Length;
  2.2612 +    } QuerySecurity;
  2.2613 +    struct {
  2.2614 +      SECURITY_INFORMATION  SecurityInformation;
  2.2615 +      PSECURITY_DESCRIPTOR  SecurityDescriptor;
  2.2616 +    } SetSecurity;
  2.2617 +    struct {
  2.2618 +      PVPB  Vpb;
  2.2619 +      PDEVICE_OBJECT  DeviceObject;
  2.2620 +    } MountVolume;
  2.2621 +    struct {
  2.2622 +      PVPB  Vpb;
  2.2623 +      PDEVICE_OBJECT  DeviceObject;
  2.2624 +    } VerifyVolume;
  2.2625 +    struct {
  2.2626 +      struct _SCSI_REQUEST_BLOCK  *Srb;
  2.2627 +    } Scsi;
  2.2628 +    struct {
  2.2629 +      DEVICE_RELATION_TYPE  Type;
  2.2630 +    } QueryDeviceRelations;
  2.2631 +    struct {
  2.2632 +      CONST GUID  *InterfaceType;
  2.2633 +      USHORT  Size;
  2.2634 +      USHORT  Version;
  2.2635 +      PINTERFACE  Interface;
  2.2636 +      PVOID  InterfaceSpecificData;
  2.2637 +    } QueryInterface;
  2.2638 +    struct {
  2.2639 +      PDEVICE_CAPABILITIES  Capabilities;
  2.2640 +    } DeviceCapabilities;
  2.2641 +    struct {
  2.2642 +      PIO_RESOURCE_REQUIREMENTS_LIST  IoResourceRequirementList;
  2.2643 +    } FilterResourceRequirements;
  2.2644 +    struct {
  2.2645 +      ULONG  WhichSpace;
  2.2646 +      PVOID  Buffer;
  2.2647 +      ULONG  Offset;
  2.2648 +      ULONG POINTER_ALIGNMENT  Length;
  2.2649 +    } ReadWriteConfig;
  2.2650 +    struct {
  2.2651 +      BOOLEAN  Lock;
  2.2652 +    } SetLock;
  2.2653 +    struct {
  2.2654 +      BUS_QUERY_ID_TYPE  IdType;
  2.2655 +    } QueryId;
  2.2656 +    struct {
  2.2657 +      DEVICE_TEXT_TYPE  DeviceTextType;
  2.2658 +      LCID POINTER_ALIGNMENT  LocaleId;
  2.2659 +    } QueryDeviceText;
  2.2660 +    struct {
  2.2661 +      BOOLEAN  InPath;
  2.2662 +      BOOLEAN  Reserved[3];
  2.2663 +      DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT  Type;
  2.2664 +    } UsageNotification;
  2.2665 +    struct {
  2.2666 +      SYSTEM_POWER_STATE  PowerState;
  2.2667 +    } WaitWake;
  2.2668 +    struct {
  2.2669 +      PPOWER_SEQUENCE  PowerSequence;
  2.2670 +    } PowerSequence;
  2.2671 +    struct {
  2.2672 +      ULONG  SystemContext;
  2.2673 +      POWER_STATE_TYPE POINTER_ALIGNMENT  Type;
  2.2674 +      POWER_STATE POINTER_ALIGNMENT  State;
  2.2675 +      POWER_ACTION POINTER_ALIGNMENT  ShutdownType;
  2.2676 +    } Power;
  2.2677 +    struct {
  2.2678 +      PCM_RESOURCE_LIST  AllocatedResources;
  2.2679 +      PCM_RESOURCE_LIST  AllocatedResourcesTranslated;
  2.2680 +    } StartDevice;
  2.2681 +    struct {
  2.2682 +      ULONG_PTR  ProviderId;
  2.2683 +      PVOID  DataPath;
  2.2684 +      ULONG  BufferSize;
  2.2685 +      PVOID  Buffer;
  2.2686 +    } WMI;
  2.2687 +    struct {
  2.2688 +      PVOID  Argument1;
  2.2689 +      PVOID  Argument2;
  2.2690 +      PVOID  Argument3;
  2.2691 +      PVOID  Argument4;
  2.2692 +    } Others;
  2.2693 +  } Parameters;
  2.2694 +  PDEVICE_OBJECT  DeviceObject;
  2.2695 +  PFILE_OBJECT  FileObject;
  2.2696 +  PIO_COMPLETION_ROUTINE  CompletionRoutine;
  2.2697 +  PVOID  Context;
  2.2698 +} IO_STACK_LOCATION, *PIO_STACK_LOCATION;
  2.2699 +#include <poppack.h>
  2.2700 +
  2.2701 +/* IO_STACK_LOCATION.Control */
  2.2702 +
  2.2703 +#define SL_PENDING_RETURNED               0x01
  2.2704 +#define SL_INVOKE_ON_CANCEL               0x20
  2.2705 +#define SL_INVOKE_ON_SUCCESS              0x40
  2.2706 +#define SL_INVOKE_ON_ERROR                0x80
  2.2707 +
  2.2708 +typedef enum _KEY_INFORMATION_CLASS {
  2.2709 +  KeyBasicInformation,
  2.2710 +  KeyNodeInformation,
  2.2711 +  KeyFullInformation,
  2.2712 +  KeyNameInformation,
  2.2713 +  KeyCachedInformation,
  2.2714 +  KeyFlagsInformation
  2.2715 +} KEY_INFORMATION_CLASS;
  2.2716 +
  2.2717 +typedef struct _KEY_BASIC_INFORMATION {
  2.2718 +  LARGE_INTEGER  LastWriteTime;
  2.2719 +  ULONG  TitleIndex;
  2.2720 +  ULONG  NameLength;
  2.2721 +  WCHAR  Name[1];
  2.2722 +} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
  2.2723 +
  2.2724 +typedef struct _KEY_FULL_INFORMATION {
  2.2725 +  LARGE_INTEGER  LastWriteTime;
  2.2726 +  ULONG  TitleIndex;
  2.2727 +  ULONG  ClassOffset;
  2.2728 +  ULONG  ClassLength;
  2.2729 +  ULONG  SubKeys;
  2.2730 +  ULONG  MaxNameLen;
  2.2731 +  ULONG  MaxClassLen;
  2.2732 +  ULONG  Values;
  2.2733 +  ULONG  MaxValueNameLen;
  2.2734 +  ULONG  MaxValueDataLen;
  2.2735 +  WCHAR  Class[1];
  2.2736 +} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
  2.2737 +
  2.2738 +typedef struct _KEY_NODE_INFORMATION {
  2.2739 +  LARGE_INTEGER  LastWriteTime;
  2.2740 +  ULONG  TitleIndex;
  2.2741 +  ULONG  ClassOffset;
  2.2742 +  ULONG  ClassLength;
  2.2743 +  ULONG  NameLength;
  2.2744 +  WCHAR  Name[1];
  2.2745 +} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
  2.2746 +
  2.2747 +typedef struct _KEY_VALUE_BASIC_INFORMATION {
  2.2748 +  ULONG  TitleIndex;
  2.2749 +  ULONG  Type;
  2.2750 +  ULONG  NameLength;
  2.2751 +  WCHAR  Name[1];
  2.2752 +} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
  2.2753 +
  2.2754 +typedef struct _KEY_VALUE_FULL_INFORMATION {
  2.2755 +  ULONG  TitleIndex;
  2.2756 +  ULONG  Type;
  2.2757 +  ULONG  DataOffset;
  2.2758 +  ULONG  DataLength;
  2.2759 +  ULONG  NameLength;
  2.2760 +  WCHAR  Name[1];
  2.2761 +} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
  2.2762 +
  2.2763 +typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
  2.2764 +  ULONG  TitleIndex;
  2.2765 +  ULONG  Type;
  2.2766 +  ULONG  DataLength;
  2.2767 +  UCHAR  Data[1];
  2.2768 +} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
  2.2769 +
  2.2770 +typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 {
  2.2771 +  ULONG  Type;
  2.2772 +  ULONG  DataLength;
  2.2773 +  UCHAR  Data[1];
  2.2774 +} KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64;
  2.2775 +
  2.2776 +typedef struct _KEY_VALUE_ENTRY {
  2.2777 +  PUNICODE_STRING  ValueName;
  2.2778 +  ULONG  DataLength;
  2.2779 +  ULONG  DataOffset;
  2.2780 +  ULONG  Type;
  2.2781 +} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
  2.2782 +
  2.2783 +typedef enum _KEY_VALUE_INFORMATION_CLASS {
  2.2784 +  KeyValueBasicInformation,
  2.2785 +  KeyValueFullInformation,
  2.2786 +  KeyValuePartialInformation,
  2.2787 +  KeyValueFullInformationAlign64,
  2.2788 +  KeyValuePartialInformationAlign64
  2.2789 +} KEY_VALUE_INFORMATION_CLASS;
  2.2790 +
  2.2791 +/* KEY_VALUE_Xxx.Type */
  2.2792 +
  2.2793 +#define REG_NONE                           0
  2.2794 +#define REG_SZ                             1
  2.2795 +#define REG_EXPAND_SZ                      2
  2.2796 +#define REG_BINARY                         3
  2.2797 +#define REG_DWORD                          4
  2.2798 +#define REG_DWORD_LITTLE_ENDIAN            4
  2.2799 +#define REG_DWORD_BIG_ENDIAN               5
  2.2800 +#define REG_LINK                           6
  2.2801 +#define REG_MULTI_SZ                       7
  2.2802 +#define REG_RESOURCE_LIST                  8
  2.2803 +#define REG_FULL_RESOURCE_DESCRIPTOR       9
  2.2804 +#define REG_RESOURCE_REQUIREMENTS_LIST    10
  2.2805 +#define REG_QWORD                         11
  2.2806 +#define REG_QWORD_LITTLE_ENDIAN           11
  2.2807 +
  2.2808 +#define PCI_TYPE0_ADDRESSES               6
  2.2809 +#define PCI_TYPE1_ADDRESSES               2
  2.2810 +#define PCI_TYPE2_ADDRESSES               5
  2.2811 +
  2.2812 +typedef struct _PCI_COMMON_CONFIG {
  2.2813 +  USHORT  VendorID;
  2.2814 +  USHORT  DeviceID;
  2.2815 +  USHORT  Command;
  2.2816 +  USHORT  Status;
  2.2817 +  UCHAR  RevisionID;
  2.2818 +  UCHAR  ProgIf;
  2.2819 +  UCHAR  SubClass;
  2.2820 +  UCHAR  BaseClass;
  2.2821 +  UCHAR  CacheLineSize;
  2.2822 +  UCHAR  LatencyTimer;
  2.2823 +  UCHAR  HeaderType;
  2.2824 +  UCHAR  BIST;
  2.2825 +  union {
  2.2826 +    struct _PCI_HEADER_TYPE_0 {
  2.2827 +      ULONG  BaseAddresses[PCI_TYPE0_ADDRESSES];
  2.2828 +      ULONG  CIS;
  2.2829 +      USHORT  SubVendorID;
  2.2830 +      USHORT  SubSystemID;
  2.2831 +      ULONG  ROMBaseAddress;
  2.2832 +      UCHAR  CapabilitiesPtr;
  2.2833 +      UCHAR  Reserved1[3];
  2.2834 +      ULONG  Reserved2;
  2.2835 +      UCHAR  InterruptLine;
  2.2836 +      UCHAR  InterruptPin;
  2.2837 +      UCHAR  MinimumGrant;
  2.2838 +      UCHAR  MaximumLatency;
  2.2839 +    } type0;
  2.2840 +      struct _PCI_HEADER_TYPE_1 {
  2.2841 +        ULONG  BaseAddresses[PCI_TYPE1_ADDRESSES];
  2.2842 +        UCHAR  PrimaryBus;
  2.2843 +        UCHAR  SecondaryBus;
  2.2844 +        UCHAR  SubordinateBus;
  2.2845 +        UCHAR  SecondaryLatency;
  2.2846 +        UCHAR  IOBase;
  2.2847 +        UCHAR  IOLimit;
  2.2848 +        USHORT  SecondaryStatus;
  2.2849 +        USHORT  MemoryBase;
  2.2850 +        USHORT  MemoryLimit;
  2.2851 +        USHORT  PrefetchBase;
  2.2852 +        USHORT  PrefetchLimit;
  2.2853 +        ULONG  PrefetchBaseUpper32;
  2.2854 +        ULONG  PrefetchLimitUpper32;
  2.2855 +        USHORT  IOBaseUpper16;
  2.2856 +        USHORT  IOLimitUpper16;
  2.2857 +        UCHAR  CapabilitiesPtr;
  2.2858 +        UCHAR  Reserved1[3];
  2.2859 +        ULONG  ROMBaseAddress;
  2.2860 +        UCHAR  InterruptLine;
  2.2861 +        UCHAR  InterruptPin;
  2.2862 +        USHORT  BridgeControl;
  2.2863 +      } type1;
  2.2864 +      struct _PCI_HEADER_TYPE_2 {
  2.2865 +        ULONG  SocketRegistersBaseAddress;
  2.2866 +        UCHAR  CapabilitiesPtr;
  2.2867 +        UCHAR  Reserved;
  2.2868 +        USHORT  SecondaryStatus;
  2.2869 +        UCHAR  PrimaryBus;
  2.2870 +        UCHAR  SecondaryBus;
  2.2871 +        UCHAR  SubordinateBus;
  2.2872 +        UCHAR  SecondaryLatency;
  2.2873 +        struct {
  2.2874 +          ULONG  Base;
  2.2875 +          ULONG  Limit;
  2.2876 +        } Range[PCI_TYPE2_ADDRESSES - 1];
  2.2877 +        UCHAR  InterruptLine;
  2.2878 +        UCHAR  InterruptPin;
  2.2879 +        USHORT  BridgeControl;
  2.2880 +      } type2;
  2.2881 +  } u;
  2.2882 +  UCHAR  DeviceSpecific[192];
  2.2883 +} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
  2.2884 +
  2.2885 +/* PCI_COMMON_CONFIG.Command */
  2.2886 +
  2.2887 +#define PCI_ENABLE_IO_SPACE               0x0001
  2.2888 +#define PCI_ENABLE_MEMORY_SPACE           0x0002
  2.2889 +#define PCI_ENABLE_BUS_MASTER             0x0004
  2.2890 +#define PCI_ENABLE_SPECIAL_CYCLES         0x0008
  2.2891 +#define PCI_ENABLE_WRITE_AND_INVALIDATE   0x0010
  2.2892 +#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020
  2.2893 +#define PCI_ENABLE_PARITY                 0x0040
  2.2894 +#define PCI_ENABLE_WAIT_CYCLE             0x0080
  2.2895 +#define PCI_ENABLE_SERR                   0x0100
  2.2896 +#define PCI_ENABLE_FAST_BACK_TO_BACK      0x0200
  2.2897 +
  2.2898 +/* PCI_COMMON_CONFIG.Status */
  2.2899 +
  2.2900 +#define PCI_STATUS_CAPABILITIES_LIST      0x0010
  2.2901 +#define PCI_STATUS_66MHZ_CAPABLE          0x0020
  2.2902 +#define PCI_STATUS_UDF_SUPPORTED          0x0040
  2.2903 +#define PCI_STATUS_FAST_BACK_TO_BACK      0x0080
  2.2904 +#define PCI_STATUS_DATA_PARITY_DETECTED   0x0100
  2.2905 +#define PCI_STATUS_DEVSEL                 0x0600
  2.2906 +#define PCI_STATUS_SIGNALED_TARGET_ABORT  0x0800
  2.2907 +#define PCI_STATUS_RECEIVED_TARGET_ABORT  0x1000
  2.2908 +#define PCI_STATUS_RECEIVED_MASTER_ABORT  0x2000
  2.2909 +#define PCI_STATUS_SIGNALED_SYSTEM_ERROR  0x4000
  2.2910 +#define PCI_STATUS_DETECTED_PARITY_ERROR  0x8000
  2.2911 +
  2.2912 +/* PCI_COMMON_CONFIG.HeaderType */
  2.2913 +
  2.2914 +#define PCI_MULTIFUNCTION                 0x80
  2.2915 +#define PCI_DEVICE_TYPE                   0x00
  2.2916 +#define PCI_BRIDGE_TYPE                   0x01
  2.2917 +#define PCI_CARDBUS_BRIDGE_TYPE           0x02
  2.2918 +
  2.2919 +#define PCI_CONFIGURATION_TYPE(PciData) \
  2.2920 +  (((PPCI_COMMON_CONFIG) (PciData))->HeaderType & ~PCI_MULTIFUNCTION)
  2.2921 +
  2.2922 +#define PCI_MULTIFUNCTION_DEVICE(PciData) \
  2.2923 +  ((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0)
  2.2924 +
  2.2925 +typedef struct _PCI_SLOT_NUMBER {
  2.2926 +  union {
  2.2927 +    struct {
  2.2928 +      ULONG  DeviceNumber : 5;
  2.2929 +      ULONG  FunctionNumber : 3;
  2.2930 +      ULONG  Reserved : 24;
  2.2931 +    } bits;
  2.2932 +    ULONG  AsULONG;
  2.2933 +  } u;
  2.2934 +} PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER;
  2.2935 +
  2.2936 +typedef enum _POOL_TYPE {
  2.2937 +  NonPagedPool,
  2.2938 +  PagedPool,
  2.2939 +  NonPagedPoolMustSucceed,
  2.2940 +  DontUseThisType,
  2.2941 +  NonPagedPoolCacheAligned,
  2.2942 +  PagedPoolCacheAligned,
  2.2943 +  NonPagedPoolCacheAlignedMustS,
  2.2944 +	MaxPoolType,
  2.2945 +	NonPagedPoolSession = 32,
  2.2946 +	PagedPoolSession,
  2.2947 +	NonPagedPoolMustSucceedSession,
  2.2948 +	DontUseThisTypeSession,
  2.2949 +	NonPagedPoolCacheAlignedSession,
  2.2950 +	PagedPoolCacheAlignedSession,
  2.2951 +	NonPagedPoolCacheAlignedMustSSession
  2.2952 +} POOL_TYPE;
  2.2953 +
  2.2954 +typedef enum _EX_POOL_PRIORITY {
  2.2955 +  LowPoolPriority,
  2.2956 +  LowPoolPrioritySpecialPoolOverrun = 8,
  2.2957 +  LowPoolPrioritySpecialPoolUnderrun = 9,
  2.2958 +  NormalPoolPriority = 16,
  2.2959 +  NormalPoolPrioritySpecialPoolOverrun = 24,
  2.2960 +  NormalPoolPrioritySpecialPoolUnderrun = 25,
  2.2961 +  HighPoolPriority = 32,
  2.2962 +  HighPoolPrioritySpecialPoolOverrun = 40,
  2.2963 +  HighPoolPrioritySpecialPoolUnderrun = 41
  2.2964 +} EX_POOL_PRIORITY;
  2.2965 +
  2.2966 +/* PRIVILEGE_SET.Control */
  2.2967 +
  2.2968 +#define PRIVILEGE_SET_ALL_NECESSARY       1
  2.2969 +
  2.2970 +typedef struct _RTL_OSVERSIONINFOW {
  2.2971 +  ULONG  dwOSVersionInfoSize;
  2.2972 +  ULONG  dwMajorVersion;
  2.2973 +  ULONG  dwMinorVersion;
  2.2974 +  ULONG  dwBuildNumber;
  2.2975 +  ULONG  dwPlatformId;
  2.2976 +  WCHAR  szCSDVersion[128];
  2.2977 +} RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
  2.2978 +
  2.2979 +typedef struct _RTL_OSVERSIONINFOEXW {
  2.2980 +  ULONG  dwOSVersionInfoSize;
  2.2981 +  ULONG  dwMajorVersion;
  2.2982 +  ULONG  dwMinorVersion;
  2.2983 +  ULONG  dwBuildNumber;
  2.2984 +  ULONG  dwPlatformId;
  2.2985 +  WCHAR  szCSDVersion[128];
  2.2986 +  USHORT  wServicePackMajor;
  2.2987 +  USHORT  wServicePackMinor;
  2.2988 +  USHORT  wSuiteMask;
  2.2989 +  UCHAR  wProductType;
  2.2990 +  UCHAR  wReserved;
  2.2991 +} RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
  2.2992 +
  2.2993 +NTOSAPI
  2.2994 +ULONGLONG
  2.2995 +DDKAPI
  2.2996 +VerSetConditionMask(
  2.2997 +  /*IN*/ ULONGLONG  ConditionMask,
  2.2998 +  /*IN*/ ULONG  TypeMask,
  2.2999 +  /*IN*/ UCHAR  Condition);
  2.3000 +
  2.3001 +#define VER_SET_CONDITION(ConditionMask, TypeBitMask, ComparisonType)  \
  2.3002 +        ((ConditionMask) = VerSetConditionMask((ConditionMask), \
  2.3003 +        (TypeBitMask), (ComparisonType)))
  2.3004 +
  2.3005 +/* RtlVerifyVersionInfo() TypeMask */
  2.3006 +
  2.3007 +#define VER_MINORVERSION                  0x0000001
  2.3008 +#define VER_MAJORVERSION                  0x0000002
  2.3009 +#define VER_BUILDNUMBER                   0x0000004
  2.3010 +#define VER_PLATFORMID                    0x0000008
  2.3011 +#define VER_SERVICEPACKMINOR              0x0000010
  2.3012 +#define VER_SERVICEPACKMAJOR              0x0000020
  2.3013 +#define VER_SUITENAME                     0x0000040
  2.3014 +#define VER_PRODUCT_TYPE                  0x0000080
  2.3015 +
  2.3016 +/* RtlVerifyVersionInfo() ComparisonType */
  2.3017 +
  2.3018 +#define VER_EQUAL                       1
  2.3019 +#define VER_GREATER                     2
  2.3020 +#define VER_GREATER_EQUAL               3
  2.3021 +#define VER_LESS                        4
  2.3022 +#define VER_LESS_EQUAL                  5
  2.3023 +#define VER_AND                         6
  2.3024 +#define VER_OR                          7
  2.3025 +
  2.3026 +#define VER_CONDITION_MASK              7
  2.3027 +#define VER_NUM_BITS_PER_CONDITION_MASK 3
  2.3028 +
  2.3029 +typedef struct _RTL_BITMAP {
  2.3030 +  ULONG  SizeOfBitMap;
  2.3031 +  PULONG  Buffer;
  2.3032 +} RTL_BITMAP, *PRTL_BITMAP;
  2.3033 +
  2.3034 +typedef struct _RTL_BITMAP_RUN {
  2.3035 +    ULONG  StartingIndex;
  2.3036 +    ULONG  NumberOfBits;
  2.3037 +} RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
  2.3038 +
  2.3039 +typedef NTSTATUS DDKAPI
  2.3040 +(*PRTL_QUERY_REGISTRY_ROUTINE)(
  2.3041 +  /*IN*/ PWSTR  ValueName,
  2.3042 +  /*IN*/ ULONG  ValueType,
  2.3043 +  /*IN*/ PVOID  ValueData,
  2.3044 +  /*IN*/ ULONG  ValueLength,
  2.3045 +  /*IN*/ PVOID  Context,
  2.3046 +  /*IN*/ PVOID  EntryContext);
  2.3047 +
  2.3048 +#define RTL_REGISTRY_ABSOLUTE             0
  2.3049 +#define RTL_REGISTRY_SERVICES             1
  2.3050 +#define RTL_REGISTRY_CONTROL              2
  2.3051 +#define RTL_REGISTRY_WINDOWS_NT           3
  2.3052 +#define RTL_REGISTRY_DEVICEMAP            4
  2.3053 +#define RTL_REGISTRY_USER                 5
  2.3054 +
  2.3055 +/* RTL_QUERY_REGISTRY_TABLE.Flags */
  2.3056 +#define RTL_QUERY_REGISTRY_SUBKEY         0x00000001
  2.3057 +#define RTL_QUERY_REGISTRY_TOPKEY         0x00000002
  2.3058 +#define RTL_QUERY_REGISTRY_REQUIRED       0x00000004
  2.3059 +#define RTL_QUERY_REGISTRY_NOVALUE        0x00000008
  2.3060 +#define RTL_QUERY_REGISTRY_NOEXPAND       0x00000010
  2.3061 +#define RTL_QUERY_REGISTRY_DIRECT         0x00000020
  2.3062 +#define RTL_QUERY_REGISTRY_DELETE         0x00000040
  2.3063 +
  2.3064 +typedef struct _RTL_QUERY_REGISTRY_TABLE {
  2.3065 +  PRTL_QUERY_REGISTRY_ROUTINE  QueryRoutine;
  2.3066 +  ULONG  Flags;
  2.3067 +  PWSTR  Name;
  2.3068 +  PVOID  EntryContext;
  2.3069 +  ULONG  DefaultType;
  2.3070 +  PVOID  DefaultData;
  2.3071 +  ULONG  DefaultLength;
  2.3072 +} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE;
  2.3073 +
  2.3074 +typedef struct _TIME_FIELDS {
  2.3075 +  CSHORT  Year;
  2.3076 +  CSHORT  Month;
  2.3077 +  CSHORT  Day;
  2.3078 +  CSHORT  Hour;
  2.3079 +  CSHORT  Minute;
  2.3080 +  CSHORT  Second;
  2.3081 +  CSHORT  Milliseconds;
  2.3082 +  CSHORT  Weekday;
  2.3083 +} TIME_FIELDS, *PTIME_FIELDS;
  2.3084 +
  2.3085 +typedef PVOID DDKAPI
  2.3086 +(*PALLOCATE_FUNCTION)(
  2.3087 +  /*IN*/ POOL_TYPE  PoolType,
  2.3088 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.3089 +  /*IN*/ ULONG  Tag);
  2.3090 +
  2.3091 +typedef VOID DDKAPI
  2.3092 +(*PFREE_FUNCTION)(
  2.3093 +  /*IN*/ PVOID  Buffer);
  2.3094 +
  2.3095 +#define GENERAL_LOOKASIDE_S \
  2.3096 +  SLIST_HEADER  ListHead; \
  2.3097 +  USHORT  Depth; \
  2.3098 +  USHORT  MaximumDepth; \
  2.3099 +  ULONG  TotalAllocates; \
  2.3100 +  _ANONYMOUS_UNION union { \
  2.3101 +    ULONG  AllocateMisses; \
  2.3102 +    ULONG  AllocateHits; \
  2.3103 +  } DUMMYUNIONNAME; \
  2.3104 +  ULONG  TotalFrees; \
  2.3105 +  _ANONYMOUS_UNION union { \
  2.3106 +    ULONG  FreeMisses; \
  2.3107 +    ULONG  FreeHits; \
  2.3108 +  } DUMMYUNIONNAME2; \
  2.3109 +  POOL_TYPE  Type; \
  2.3110 +  ULONG  Tag; \
  2.3111 +  ULONG  Size; \
  2.3112 +  PALLOCATE_FUNCTION  Allocate; \
  2.3113 +  PFREE_FUNCTION  Free; \
  2.3114 +  LIST_ENTRY  ListEntry; \
  2.3115 +  ULONG  LastTotalAllocates; \
  2.3116 +  _ANONYMOUS_UNION union { \
  2.3117 +    ULONG  LastAllocateMisses; \
  2.3118 +    ULONG  LastAllocateHits; \
  2.3119 +  } DUMMYUNIONNAME3; \
  2.3120 +  ULONG Future[2];
  2.3121 +
  2.3122 +typedef struct _GENERAL_LOOKASIDE {
  2.3123 +  GENERAL_LOOKASIDE_S
  2.3124 +} GENERAL_LOOKASIDE, *PGENERAL_LOOKASIDE;
  2.3125 +
  2.3126 +typedef struct _NPAGED_LOOKASIDE_LIST {
  2.3127 +  GENERAL_LOOKASIDE_S
  2.3128 +  KSPIN_LOCK  Obsoleted;
  2.3129 +} NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST;
  2.3130 +
  2.3131 +typedef struct _PAGED_LOOKASIDE_LIST {
  2.3132 +  GENERAL_LOOKASIDE_S
  2.3133 +  FAST_MUTEX  Obsoleted;
  2.3134 +} PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST;
  2.3135 +
  2.3136 +typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT;
  2.3137 +
  2.3138 +typedef VOID DDKAPI (*PCALLBACK_FUNCTION)(
  2.3139 +  /*IN*/ PVOID  CallbackContext,
  2.3140 +  /*IN*/ PVOID  Argument1,
  2.3141 +  /*IN*/ PVOID  Argument2);
  2.3142 +
  2.3143 +typedef enum _EVENT_TYPE {
  2.3144 +  NotificationEvent,
  2.3145 +  SynchronizationEvent
  2.3146 +} EVENT_TYPE;
  2.3147 +
  2.3148 +typedef enum _KWAIT_REASON {
  2.3149 +  Executive,
  2.3150 +  FreePage,
  2.3151 +  PageIn,
  2.3152 +  PoolAllocation,
  2.3153 +  DelayExecution,
  2.3154 +  Suspended,
  2.3155 +  UserRequest,
  2.3156 +  WrExecutive,
  2.3157 +  WrFreePage,
  2.3158 +  WrPageIn,
  2.3159 +  WrPoolAllocation,
  2.3160 +  WrDelayExecution,
  2.3161 +  WrSuspended,
  2.3162 +  WrUserRequest,
  2.3163 +  WrEventPair,
  2.3164 +  WrQueue,
  2.3165 +  WrLpcReceive,
  2.3166 +  WrLpcReply,
  2.3167 +  WrVirtualMemory,
  2.3168 +  WrPageOut,
  2.3169 +  WrRendezvous,
  2.3170 +  Spare2,
  2.3171 +  Spare3,
  2.3172 +  Spare4,
  2.3173 +  Spare5,
  2.3174 +  Spare6,
  2.3175 +  WrKernel,
  2.3176 +  MaximumWaitReason
  2.3177 +} KWAIT_REASON;
  2.3178 +
  2.3179 +typedef struct _KWAIT_BLOCK {
  2.3180 +  LIST_ENTRY  WaitListEntry;
  2.3181 +  struct _KTHREAD * RESTRICTED_POINTER  Thread;
  2.3182 +  PVOID  Object;
  2.3183 +  struct _KWAIT_BLOCK * RESTRICTED_POINTER  NextWaitBlock;
  2.3184 +  USHORT  WaitKey;
  2.3185 +  USHORT  WaitType;
  2.3186 +} KWAIT_BLOCK, *PKWAIT_BLOCK, *RESTRICTED_POINTER PRKWAIT_BLOCK;
  2.3187 +
  2.3188 +typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK;
  2.3189 +
  2.3190 +typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK {
  2.3191 +  BOOLEAN  Removed;
  2.3192 +  BOOLEAN  Reserved[3];
  2.3193 +  LONG  IoCount;
  2.3194 +  KEVENT  RemoveEvent;
  2.3195 +} IO_REMOVE_LOCK_COMMON_BLOCK;
  2.3196 +
  2.3197 +typedef struct _IO_REMOVE_LOCK_DBG_BLOCK {
  2.3198 +  LONG  Signature;
  2.3199 +  LONG  HighWatermark;
  2.3200 +  LONGLONG  MaxLockedTicks;
  2.3201 +  LONG  AllocateTag;
  2.3202 +  LIST_ENTRY  LockList;
  2.3203 +  KSPIN_LOCK  Spin;
  2.3204 +  LONG  LowMemoryCount;
  2.3205 +  ULONG  Reserved1[4];
  2.3206 +  PVOID  Reserved2;
  2.3207 +  PIO_REMOVE_LOCK_TRACKING_BLOCK  Blocks;
  2.3208 +} IO_REMOVE_LOCK_DBG_BLOCK;
  2.3209 +
  2.3210 +typedef struct _IO_REMOVE_LOCK {
  2.3211 +  IO_REMOVE_LOCK_COMMON_BLOCK  Common;
  2.3212 +#ifdef DBG
  2.3213 +  IO_REMOVE_LOCK_DBG_BLOCK  Dbg;
  2.3214 +#endif
  2.3215 +} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK;
  2.3216 +
  2.3217 +typedef struct _IO_WORKITEM *PIO_WORKITEM;
  2.3218 +
  2.3219 +typedef VOID DDKAPI
  2.3220 +(*PIO_WORKITEM_ROUTINE)(
  2.3221 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.3222 +  /*IN*/ PVOID  Context);
  2.3223 +
  2.3224 +typedef struct _SHARE_ACCESS {
  2.3225 +  ULONG  OpenCount;
  2.3226 +  ULONG  Readers;
  2.3227 +  ULONG  Writers;
  2.3228 +  ULONG  Deleters;
  2.3229 +  ULONG  SharedRead;
  2.3230 +  ULONG  SharedWrite;
  2.3231 +  ULONG  SharedDelete;
  2.3232 +} SHARE_ACCESS, *PSHARE_ACCESS;
  2.3233 +
  2.3234 +typedef enum _KINTERRUPT_MODE {
  2.3235 +  LevelSensitive,
  2.3236 +  Latched
  2.3237 +} KINTERRUPT_MODE;
  2.3238 +
  2.3239 +typedef VOID DDKAPI
  2.3240 +(*PKINTERRUPT_ROUTINE)(
  2.3241 +  VOID);
  2.3242 +
  2.3243 +typedef enum _KPROFILE_SOURCE {
  2.3244 +  ProfileTime,
  2.3245 +  ProfileAlignmentFixup,
  2.3246 +  ProfileTotalIssues,
  2.3247 +  ProfilePipelineDry,
  2.3248 +  ProfileLoadInstructions,
  2.3249 +  ProfilePipelineFrozen,
  2.3250 +  ProfileBranchInstructions,
  2.3251 +  ProfileTotalNonissues,
  2.3252 +  ProfileDcacheMisses,
  2.3253 +  ProfileIcacheMisses,
  2.3254 +  ProfileCacheMisses,
  2.3255 +  ProfileBranchMispredictions,
  2.3256 +  ProfileStoreInstructions,
  2.3257 +  ProfileFpInstructions,
  2.3258 +  ProfileIntegerInstructions,
  2.3259 +  Profile2Issue,
  2.3260 +  Profile3Issue,
  2.3261 +  Profile4Issue,
  2.3262 +  ProfileSpecialInstructions,
  2.3263 +  ProfileTotalCycles,
  2.3264 +  ProfileIcacheIssues,
  2.3265 +  ProfileDcacheAccesses,
  2.3266 +  ProfileMemoryBarrierCycles,
  2.3267 +  ProfileLoadLinkedIssues,
  2.3268 +  ProfileMaximum
  2.3269 +} KPROFILE_SOURCE;
  2.3270 +
  2.3271 +typedef enum _CREATE_FILE_TYPE {
  2.3272 +  CreateFileTypeNone,
  2.3273 +  CreateFileTypeNamedPipe,
  2.3274 +  CreateFileTypeMailslot
  2.3275 +} CREATE_FILE_TYPE;
  2.3276 +
  2.3277 +typedef struct _CONFIGURATION_INFORMATION {
  2.3278 +  ULONG  DiskCount;
  2.3279 +  ULONG  FloppyCount;
  2.3280 +  ULONG  CdRomCount;
  2.3281 +  ULONG  TapeCount;
  2.3282 +  ULONG  ScsiPortCount;
  2.3283 +  ULONG  SerialCount;
  2.3284 +  ULONG  ParallelCount;
  2.3285 +  BOOLEAN  AtDiskPrimaryAddressClaimed;
  2.3286 +  BOOLEAN  AtDiskSecondaryAddressClaimed;
  2.3287 +  ULONG  Version;
  2.3288 +  ULONG  MediumChangerCount;
  2.3289 +} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
  2.3290 +
  2.3291 +typedef enum _CONFIGURATION_TYPE {
  2.3292 +  ArcSystem,
  2.3293 +  CentralProcessor,
  2.3294 +  FloatingPointProcessor,
  2.3295 +  PrimaryIcache,
  2.3296 +  PrimaryDcache,
  2.3297 +  SecondaryIcache,
  2.3298 +  SecondaryDcache,
  2.3299 +  SecondaryCache,
  2.3300 +  EisaAdapter,
  2.3301 +  TcAdapter,
  2.3302 +  ScsiAdapter,
  2.3303 +  DtiAdapter,
  2.3304 +  MultiFunctionAdapter,
  2.3305 +  DiskController,
  2.3306 +  TapeController,
  2.3307 +  CdromController,
  2.3308 +  WormController,
  2.3309 +  SerialController,
  2.3310 +  NetworkController,
  2.3311 +  DisplayController,
  2.3312 +  ParallelController,
  2.3313 +  PointerController,
  2.3314 +  KeyboardController,
  2.3315 +  AudioController,
  2.3316 +  OtherController,
  2.3317 +  DiskPeripheral,
  2.3318 +  FloppyDiskPeripheral,
  2.3319 +  TapePeripheral,
  2.3320 +  ModemPeripheral,
  2.3321 +  MonitorPeripheral,
  2.3322 +  PrinterPeripheral,
  2.3323 +  PointerPeripheral,
  2.3324 +  KeyboardPeripheral,
  2.3325 +  TerminalPeripheral,
  2.3326 +  OtherPeripheral,
  2.3327 +  LinePeripheral,
  2.3328 +  NetworkPeripheral,
  2.3329 +  SystemMemory,
  2.3330 +  DockingInformation,
  2.3331 +  RealModeIrqRoutingTable,
  2.3332 +  MaximumType
  2.3333 +} CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
  2.3334 +
  2.3335 +typedef NTSTATUS (*PIO_QUERY_DEVICE_ROUTINE)(
  2.3336 +  /*IN*/ PVOID  Context,
  2.3337 +  /*IN*/ PUNICODE_STRING  PathName,
  2.3338 +  /*IN*/ INTERFACE_TYPE  BusType,
  2.3339 +  /*IN*/ ULONG  BusNumber,
  2.3340 +  /*IN*/ PKEY_VALUE_FULL_INFORMATION  *BusInformation,
  2.3341 +  /*IN*/ CONFIGURATION_TYPE  ControllerType,
  2.3342 +  /*IN*/ ULONG  ControllerNumber,
  2.3343 +  /*IN*/ PKEY_VALUE_FULL_INFORMATION  *ControllerInformation,
  2.3344 +  /*IN*/ CONFIGURATION_TYPE  PeripheralType,
  2.3345 +  /*IN*/ ULONG  PeripheralNumber,
  2.3346 +  /*IN*/ PKEY_VALUE_FULL_INFORMATION  *PeripheralInformation);
  2.3347 +
  2.3348 +typedef enum _WORK_QUEUE_TYPE {
  2.3349 +  CriticalWorkQueue,
  2.3350 +  DelayedWorkQueue,
  2.3351 +  HyperCriticalWorkQueue,
  2.3352 +  MaximumWorkQueue
  2.3353 +} WORK_QUEUE_TYPE;
  2.3354 +
  2.3355 +typedef VOID DDKAPI
  2.3356 +(*PWORKER_THREAD_ROUTINE)(
  2.3357 +  /*IN*/ PVOID Parameter);
  2.3358 +
  2.3359 +typedef struct _WORK_QUEUE_ITEM {
  2.3360 +  LIST_ENTRY  List;
  2.3361 +  PWORKER_THREAD_ROUTINE  WorkerRoutine;
  2.3362 +  PVOID  Parameter;
  2.3363 +} WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM;
  2.3364 +
  2.3365 +typedef enum _KBUGCHECK_BUFFER_DUMP_STATE {
  2.3366 +    BufferEmpty,
  2.3367 +    BufferInserted,
  2.3368 +    BufferStarted,
  2.3369 +    BufferFinished,
  2.3370 +    BufferIncomplete
  2.3371 +} KBUGCHECK_BUFFER_DUMP_STATE;
  2.3372 +
  2.3373 +typedef VOID DDKAPI
  2.3374 +(*PKBUGCHECK_CALLBACK_ROUTINE)(
  2.3375 +  /*IN*/ PVOID  Buffer,
  2.3376 +  /*IN*/ ULONG  Length);
  2.3377 +
  2.3378 +typedef struct _KBUGCHECK_CALLBACK_RECORD {
  2.3379 +  LIST_ENTRY  Entry;
  2.3380 +  PKBUGCHECK_CALLBACK_ROUTINE  CallbackRoutine;
  2.3381 +  PVOID  Buffer;
  2.3382 +  ULONG  Length;
  2.3383 +  PUCHAR  Component;
  2.3384 +  ULONG_PTR  Checksum;
  2.3385 +  UCHAR  State;
  2.3386 +} KBUGCHECK_CALLBACK_RECORD, *PKBUGCHECK_CALLBACK_RECORD;
  2.3387 +
  2.3388 +/*
  2.3389 + * VOID
  2.3390 + * KeInitializeCallbackRecord(
  2.3391 + * IN PKBUGCHECK_CALLBACK_RECORD  CallbackRecord)
  2.3392 + */
  2.3393 +#define KeInitializeCallbackRecord(CallbackRecord) \
  2.3394 +  CallbackRecord->State = BufferEmpty;
  2.3395 +
  2.3396 +typedef enum _KDPC_IMPORTANCE {
  2.3397 +  LowImportance,
  2.3398 +  MediumImportance,
  2.3399 +  HighImportance
  2.3400 +} KDPC_IMPORTANCE;
  2.3401 +
  2.3402 +typedef enum _MEMORY_CACHING_TYPE_ORIG {
  2.3403 +  MmFrameBufferCached = 2
  2.3404 +} MEMORY_CACHING_TYPE_ORIG;
  2.3405 +
  2.3406 +typedef enum _MEMORY_CACHING_TYPE {
  2.3407 +  MmNonCached = FALSE,
  2.3408 +  MmCached = TRUE,
  2.3409 +  MmWriteCombined = MmFrameBufferCached,
  2.3410 +  MmHardwareCoherentCached,
  2.3411 +  MmNonCachedUnordered,
  2.3412 +  MmUSWCCached,
  2.3413 +  MmMaximumCacheType
  2.3414 +} MEMORY_CACHING_TYPE;
  2.3415 +
  2.3416 +typedef enum _MM_PAGE_PRIORITY {
  2.3417 +  LowPagePriority,
  2.3418 +  NormalPagePriority = 16,
  2.3419 +  HighPagePriority = 32
  2.3420 +} MM_PAGE_PRIORITY;
  2.3421 +
  2.3422 +typedef enum _LOCK_OPERATION {
  2.3423 +  IoReadAccess,
  2.3424 +  IoWriteAccess,
  2.3425 +  IoModifyAccess
  2.3426 +} LOCK_OPERATION;
  2.3427 +
  2.3428 +typedef enum _MM_SYSTEM_SIZE {
  2.3429 +  MmSmallSystem,
  2.3430 +  MmMediumSystem,
  2.3431 +  MmLargeSystem
  2.3432 +} MM_SYSTEM_SIZE;
  2.3433 +
  2.3434 +typedef struct _OBJECT_HANDLE_INFORMATION {
  2.3435 +  ULONG HandleAttributes;
  2.3436 +  ACCESS_MASK GrantedAccess;
  2.3437 +} OBJECT_HANDLE_INFORMATION, *POBJECT_HANDLE_INFORMATION;
  2.3438 +
  2.3439 +typedef struct _CLIENT_ID {
  2.3440 +  HANDLE  UniqueProcess;
  2.3441 +  HANDLE  UniqueThread;
  2.3442 +} CLIENT_ID, *PCLIENT_ID;
  2.3443 +
  2.3444 +typedef VOID DDKAPI
  2.3445 +(*PKSTART_ROUTINE)(
  2.3446 +  /*IN*/ PVOID  StartContext);
  2.3447 +
  2.3448 +typedef VOID DDKAPI
  2.3449 +(*PCREATE_PROCESS_NOTIFY_ROUTINE)(
  2.3450 +  /*IN*/ HANDLE  ParentId,
  2.3451 +  /*IN*/ HANDLE  ProcessId,
  2.3452 +  /*IN*/ BOOLEAN  Create);
  2.3453 +
  2.3454 +typedef VOID DDKAPI
  2.3455 +(*PCREATE_THREAD_NOTIFY_ROUTINE)(
  2.3456 +  /*IN*/ HANDLE  ProcessId,
  2.3457 +  /*IN*/ HANDLE  ThreadId,
  2.3458 +  /*IN*/ BOOLEAN  Create);
  2.3459 +
  2.3460 +typedef struct _IMAGE_INFO {
  2.3461 +  _ANONYMOUS_UNION union {
  2.3462 +    ULONG  Properties;
  2.3463 +    _ANONYMOUS_STRUCT struct {
  2.3464 +      ULONG  ImageAddressingMode  : 8;
  2.3465 +      ULONG  SystemModeImage      : 1;
  2.3466 +      ULONG  ImageMappedToAllPids : 1;
  2.3467 +      ULONG  Reserved             : 22;
  2.3468 +    } DUMMYSTRUCTNAME;
  2.3469 +  } DUMMYUNIONNAME;
  2.3470 +  PVOID  ImageBase;
  2.3471 +  ULONG  ImageSelector;
  2.3472 +  SIZE_T  ImageSize;
  2.3473 +  ULONG  ImageSectionNumber;
  2.3474 +} IMAGE_INFO, *PIMAGE_INFO;
  2.3475 +
  2.3476 +#define IMAGE_ADDRESSING_MODE_32BIT       3
  2.3477 +
  2.3478 +typedef VOID DDKAPI
  2.3479 +(*PLOAD_IMAGE_NOTIFY_ROUTINE)(
  2.3480 +  /*IN*/ PUNICODE_STRING  FullImageName,
  2.3481 +  /*IN*/ HANDLE  ProcessId,
  2.3482 +  /*IN*/ PIMAGE_INFO  ImageInfo);
  2.3483 +
  2.3484 +typedef enum _PROCESSINFOCLASS {
  2.3485 +  ProcessBasicInformation,
  2.3486 +  ProcessQuotaLimits,
  2.3487 +  ProcessIoCounters,
  2.3488 +  ProcessVmCounters,
  2.3489 +  ProcessTimes,
  2.3490 +  ProcessBasePriority,
  2.3491 +  ProcessRaisePriority,
  2.3492 +  ProcessDebugPort,
  2.3493 +  ProcessExceptionPort,
  2.3494 +  ProcessAccessToken,
  2.3495 +  ProcessLdtInformation,
  2.3496 +  ProcessLdtSize,
  2.3497 +  ProcessDefaultHardErrorMode,
  2.3498 +  ProcessIoPortHandlers,
  2.3499 +  ProcessPooledUsageAndLimits,
  2.3500 +  ProcessWorkingSetWatch,
  2.3501 +  ProcessUserModeIOPL,
  2.3502 +  ProcessEnableAlignmentFaultFixup,
  2.3503 +  ProcessPriorityClass,
  2.3504 +  ProcessWx86Information,
  2.3505 +  ProcessHandleCount,
  2.3506 +  ProcessAffinityMask,
  2.3507 +  ProcessPriorityBoost,
  2.3508 +  ProcessDeviceMap,
  2.3509 +  ProcessSessionInformation,
  2.3510 +  ProcessForegroundInformation,
  2.3511 +  ProcessWow64Information,
  2.3512 +  ProcessImageFileName,
  2.3513 +  ProcessLUIDDeviceMapsEnabled,
  2.3514 +  ProcessBreakOnTermination,
  2.3515 +  ProcessDebugObjectHandle,
  2.3516 +  ProcessDebugFlags,
  2.3517 +  ProcessHandleTracing,
  2.3518 +  MaxProcessInfoClass
  2.3519 +} PROCESSINFOCLASS;
  2.3520 +
  2.3521 +typedef enum _THREADINFOCLASS {
  2.3522 +  ThreadBasicInformation,
  2.3523 +  ThreadTimes,
  2.3524 +  ThreadPriority,
  2.3525 +  ThreadBasePriority,
  2.3526 +  ThreadAffinityMask,
  2.3527 +  ThreadImpersonationToken,
  2.3528 +  ThreadDescriptorTableEntry,
  2.3529 +  ThreadEnableAlignmentFaultFixup,
  2.3530 +  ThreadEventPair_Reusable,
  2.3531 +  ThreadQuerySetWin32StartAddress,
  2.3532 +  ThreadZeroTlsCell,
  2.3533 +  ThreadPerformanceCount,
  2.3534 +  ThreadAmILastThread,
  2.3535 +  ThreadIdealProcessor,
  2.3536 +  ThreadPriorityBoost,
  2.3537 +  ThreadSetTlsArrayAddress,
  2.3538 +  ThreadIsIoPending,
  2.3539 +  ThreadHideFromDebugger,
  2.3540 +  ThreadBreakOnTermination,
  2.3541 +  MaxThreadInfoClass
  2.3542 +} THREADINFOCLASS;
  2.3543 +
  2.3544 +#define ES_SYSTEM_REQUIRED                0x00000001
  2.3545 +#define ES_DISPLAY_REQUIRED               0x00000002
  2.3546 +#define ES_USER_PRESENT                   0x00000004
  2.3547 +#define ES_CONTINUOUS                     0x80000000
  2.3548 +
  2.3549 +typedef ULONG EXECUTION_STATE;
  2.3550 +
  2.3551 +typedef VOID DDKAPI
  2.3552 +(*PREQUEST_POWER_COMPLETE)(
  2.3553 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.3554 +  /*IN*/ UCHAR  MinorFunction,
  2.3555 +  /*IN*/ POWER_STATE  PowerState,
  2.3556 +  /*IN*/ PVOID  Context,
  2.3557 +  /*IN*/ PIO_STATUS_BLOCK  IoStatus);
  2.3558 +
  2.3559 +typedef enum _TRACE_INFORMATION_CLASS {
  2.3560 +  TraceIdClass,
  2.3561 +  TraceHandleClass,
  2.3562 +  TraceEnableFlagsClass,
  2.3563 +  TraceEnableLevelClass,
  2.3564 +  GlobalLoggerHandleClass,
  2.3565 +  EventLoggerHandleClass,
  2.3566 +  AllLoggerHandlesClass,
  2.3567 +  TraceHandleByNameClass
  2.3568 +} TRACE_INFORMATION_CLASS;
  2.3569 +
  2.3570 +typedef NTSTATUS DDKAPI
  2.3571 +(*PEX_CALLBACK_FUNCTION)(
  2.3572 +  /*IN*/ PVOID  CallbackContext,
  2.3573 +  /*IN*/ PVOID  Argument1,
  2.3574 +  /*IN*/ PVOID  Argument2);
  2.3575 +
  2.3576 +
  2.3577 +
  2.3578 +/*
  2.3579 +** Storage structures
  2.3580 +*/
  2.3581 +typedef enum _PARTITION_STYLE {
  2.3582 +  PARTITION_STYLE_MBR,
  2.3583 +  PARTITION_STYLE_GPT
  2.3584 +} PARTITION_STYLE;
  2.3585 +
  2.3586 +typedef struct _CREATE_DISK_MBR {
  2.3587 +  ULONG  Signature;
  2.3588 +} CREATE_DISK_MBR, *PCREATE_DISK_MBR;
  2.3589 +
  2.3590 +typedef struct _CREATE_DISK_GPT {
  2.3591 +  GUID  DiskId;
  2.3592 +  ULONG  MaxPartitionCount;
  2.3593 +} CREATE_DISK_GPT, *PCREATE_DISK_GPT;
  2.3594 +
  2.3595 +typedef struct _CREATE_DISK {
  2.3596 +  PARTITION_STYLE  PartitionStyle;
  2.3597 +  _ANONYMOUS_UNION union {
  2.3598 +    CREATE_DISK_MBR  Mbr;
  2.3599 +    CREATE_DISK_GPT  Gpt;
  2.3600 +  } DUMMYUNIONNAME;
  2.3601 +} CREATE_DISK, *PCREATE_DISK;
  2.3602 +
  2.3603 +typedef struct _DISK_SIGNATURE {
  2.3604 +  ULONG  PartitionStyle;
  2.3605 +  _ANONYMOUS_UNION union {
  2.3606 +    struct {
  2.3607 +      ULONG  Signature;
  2.3608 +      ULONG  CheckSum;
  2.3609 +    } Mbr;
  2.3610 +    struct {
  2.3611 +      GUID  DiskId;
  2.3612 +    } Gpt;
  2.3613 +  } DUMMYUNIONNAME;
  2.3614 +} DISK_SIGNATURE, *PDISK_SIGNATURE;
  2.3615 +
  2.3616 +typedef VOID DDKFASTAPI
  2.3617 +(*PTIME_UPDATE_NOTIFY_ROUTINE)(
  2.3618 +  /*IN*/ HANDLE  ThreadId,
  2.3619 +  /*IN*/ KPROCESSOR_MODE  Mode);
  2.3620 +
  2.3621 +#define DBG_STATUS_CONTROL_C              1
  2.3622 +#define DBG_STATUS_SYSRQ                  2
  2.3623 +#define DBG_STATUS_BUGCHECK_FIRST         3
  2.3624 +#define DBG_STATUS_BUGCHECK_SECOND        4
  2.3625 +#define DBG_STATUS_FATAL                  5
  2.3626 +#define DBG_STATUS_DEBUG_CONTROL          6
  2.3627 +#define DBG_STATUS_WORKER                 7
  2.3628 +
  2.3629 +typedef struct _PHYSICAL_MEMORY_RANGE {
  2.3630 +  PHYSICAL_ADDRESS  BaseAddress;
  2.3631 +  LARGE_INTEGER  NumberOfBytes;
  2.3632 +} PHYSICAL_MEMORY_RANGE, *PPHYSICAL_MEMORY_RANGE;
  2.3633 +
  2.3634 +typedef ULONG_PTR
  2.3635 +(*PDRIVER_VERIFIER_THUNK_ROUTINE)(
  2.3636 +  /*IN*/ PVOID  Context);
  2.3637 +
  2.3638 +typedef struct _DRIVER_VERIFIER_THUNK_PAIRS {
  2.3639 +  PDRIVER_VERIFIER_THUNK_ROUTINE  PristineRoutine;
  2.3640 +  PDRIVER_VERIFIER_THUNK_ROUTINE  NewRoutine;
  2.3641 +} DRIVER_VERIFIER_THUNK_PAIRS, *PDRIVER_VERIFIER_THUNK_PAIRS;
  2.3642 +
  2.3643 +#define DRIVER_VERIFIER_SPECIAL_POOLING             0x0001
  2.3644 +#define DRIVER_VERIFIER_FORCE_IRQL_CHECKING         0x0002
  2.3645 +#define DRIVER_VERIFIER_INJECT_ALLOCATION_FAILURES  0x0004
  2.3646 +#define DRIVER_VERIFIER_TRACK_POOL_ALLOCATIONS      0x0008
  2.3647 +#define DRIVER_VERIFIER_IO_CHECKING                 0x0010
  2.3648 +
  2.3649 +#define RTL_RANGE_LIST_ADD_IF_CONFLICT    0x00000001
  2.3650 +#define RTL_RANGE_LIST_ADD_SHARED         0x00000002
  2.3651 +
  2.3652 +#define RTL_RANGE_LIST_SHARED_OK          0x00000001
  2.3653 +#define RTL_RANGE_LIST_NULL_CONFLICT_OK   0x00000002
  2.3654 +
  2.3655 +#define RTL_RANGE_LIST_SHARED_OK          0x00000001
  2.3656 +#define RTL_RANGE_LIST_NULL_CONFLICT_OK   0x00000002
  2.3657 +
  2.3658 +#define RTL_RANGE_LIST_MERGE_IF_CONFLICT  RTL_RANGE_LIST_ADD_IF_CONFLICT
  2.3659 +
  2.3660 +typedef struct _RTL_RANGE {
  2.3661 +  ULONGLONG  Start;
  2.3662 +  ULONGLONG  End;
  2.3663 +  PVOID  UserData;
  2.3664 +  PVOID  Owner;
  2.3665 +  UCHAR  Attributes;
  2.3666 +  UCHAR  Flags;
  2.3667 +} RTL_RANGE, *PRTL_RANGE;
  2.3668 +
  2.3669 +#define RTL_RANGE_SHARED                  0x01
  2.3670 +#define RTL_RANGE_CONFLICT                0x02
  2.3671 +
  2.3672 +typedef struct _RTL_RANGE_LIST {
  2.3673 +  LIST_ENTRY  ListHead;
  2.3674 +  ULONG  Flags;
  2.3675 +  ULONG  Count;
  2.3676 +  ULONG  Stamp;
  2.3677 +} RTL_RANGE_LIST, *PRTL_RANGE_LIST;
  2.3678 +
  2.3679 +typedef struct _RANGE_LIST_ITERATOR {
  2.3680 +  PLIST_ENTRY  RangeListHead;
  2.3681 +  PLIST_ENTRY  MergedHead;
  2.3682 +  PVOID  Current;
  2.3683 +  ULONG  Stamp;
  2.3684 +} RTL_RANGE_LIST_ITERATOR, *PRTL_RANGE_LIST_ITERATOR;
  2.3685 +
  2.3686 +typedef BOOLEAN
  2.3687 +(*PRTL_CONFLICT_RANGE_CALLBACK)(
  2.3688 +  /*IN*/ PVOID  Context,
  2.3689 +  /*IN*/ PRTL_RANGE  Range);
  2.3690 +
  2.3691 +#define HASH_STRING_ALGORITHM_DEFAULT     0
  2.3692 +#define HASH_STRING_ALGORITHM_X65599      1
  2.3693 +#define HASH_STRING_ALGORITHM_INVALID     0xffffffff
  2.3694 +
  2.3695 +typedef enum _SUITE_TYPE {
  2.3696 +  SmallBusiness,
  2.3697 +  Enterprise,
  2.3698 +  BackOffice,
  2.3699 +  CommunicationServer,
  2.3700 +  TerminalServer,
  2.3701 +  SmallBusinessRestricted,
  2.3702 +  EmbeddedNT,
  2.3703 +  DataCenter,
  2.3704 +  SingleUserTS,
  2.3705 +  Personal,
  2.3706 +  Blade,
  2.3707 +  MaxSuiteType
  2.3708 +} SUITE_TYPE;
  2.3709 +
  2.3710 +typedef VOID DDKAPI
  2.3711 +(*PTIMER_APC_ROUTINE)(
  2.3712 +  /*IN*/ PVOID  TimerContext,
  2.3713 +  /*IN*/ ULONG  TimerLowValue,
  2.3714 +  /*IN*/ LONG  TimerHighValue);
  2.3715 +
  2.3716 +
  2.3717 +
  2.3718 +/*
  2.3719 +** WMI structures
  2.3720 +*/
  2.3721 +
  2.3722 +typedef VOID DDKAPI
  2.3723 +(*WMI_NOTIFICATION_CALLBACK)(
  2.3724 +  PVOID  Wnode,
  2.3725 +  PVOID  Context);
  2.3726 +
  2.3727 +
  2.3728 +/*
  2.3729 +** Architecture specific structures
  2.3730 +*/
  2.3731 +
  2.3732 +#ifdef _X86_
  2.3733 +
  2.3734 +typedef ULONG PFN_NUMBER, *PPFN_NUMBER;
  2.3735 +
  2.3736 +#define PASSIVE_LEVEL                      0
  2.3737 +#define LOW_LEVEL                          0
  2.3738 +#define APC_LEVEL                          1
  2.3739 +#define DISPATCH_LEVEL                     2
  2.3740 +#define SYNCH_LEVEL                       27
  2.3741 +#define PROFILE_LEVEL                     27
  2.3742 +#define CLOCK1_LEVEL                      28
  2.3743 +#define CLOCK2_LEVEL                      28
  2.3744 +#define IPI_LEVEL                         29
  2.3745 +#define POWER_LEVEL                       30
  2.3746 +#define HIGH_LEVEL                        31
  2.3747 +
  2.3748 +typedef struct _KPCR_TIB {
  2.3749 +  PVOID  ExceptionList;         /* 00 */
  2.3750 +  PVOID  StackBase;             /* 04 */
  2.3751 +  PVOID  StackLimit;            /* 08 */
  2.3752 +  PVOID  SubSystemTib;          /* 0C */
  2.3753 +  _ANONYMOUS_UNION union {
  2.3754 +    PVOID  FiberData;           /* 10 */
  2.3755 +    DWORD  Version;             /* 10 */
  2.3756 +  } DUMMYUNIONNAME;
  2.3757 +  PVOID  ArbitraryUserPointer;  /* 14 */
  2.3758 +  struct _NT_TIB *Self;         /* 18 */
  2.3759 +} KPCR_TIB, *PKPCR_TIB;         /* 1C */
  2.3760 +
  2.3761 +#define PCR_MINOR_VERSION 1
  2.3762 +#define PCR_MAJOR_VERSION 1
  2.3763 +
  2.3764 +typedef struct _KPCR {
  2.3765 +  KPCR_TIB  Tib;                /* 00 */
  2.3766 +  struct _KPCR  *Self;          /* 1C */
  2.3767 +  struct _KPRCB  *PCRCB;        /* 20 */
  2.3768 +  KIRQL  Irql;                  /* 24 */
  2.3769 +  ULONG  IRR;                   /* 28 */
  2.3770 +  ULONG  IrrActive;             /* 2C */
  2.3771 +  ULONG  IDR;                   /* 30 */
  2.3772 +  PVOID  KdVersionBlock;        /* 34 */
  2.3773 +  PUSHORT  IDT;                 /* 38 */
  2.3774 +  PUSHORT  GDT;                 /* 3C */
  2.3775 +  struct _KTSS  *TSS;           /* 40 */
  2.3776 +  USHORT  MajorVersion;         /* 44 */
  2.3777 +  USHORT  MinorVersion;         /* 46 */
  2.3778 +  KAFFINITY  SetMember;         /* 48 */
  2.3779 +  ULONG  StallScaleFactor;      /* 4C */
  2.3780 +  UCHAR  SpareUnused;           /* 50 */
  2.3781 +  UCHAR  Number;                /* 51 */
  2.3782 +} KPCR, *PKPCR;                 /* 54 */
  2.3783 +
  2.3784 +typedef struct _KFLOATING_SAVE {
  2.3785 +  ULONG  ControlWord;
  2.3786 +  ULONG  StatusWord;
  2.3787 +  ULONG  ErrorOffset;
  2.3788 +  ULONG  ErrorSelector;
  2.3789 +  ULONG  DataOffset;
  2.3790 +  ULONG  DataSelector;
  2.3791 +  ULONG  Cr0NpxState;
  2.3792 +  ULONG  Spare1;
  2.3793 +} KFLOATING_SAVE, *PKFLOATING_SAVE;
  2.3794 +
  2.3795 +#define PAGE_SIZE                         0x1000
  2.3796 +#define PAGE_SHIFT                        12L
  2.3797 +
  2.3798 +extern NTOSAPI PVOID *MmHighestUserAddress;
  2.3799 +extern NTOSAPI PVOID *MmSystemRangeStart;
  2.3800 +extern NTOSAPI ULONG *MmUserProbeAddress;
  2.3801 +
  2.3802 +#define MM_HIGHEST_USER_ADDRESS           *MmHighestUserAddress
  2.3803 +#define MM_SYSTEM_RANGE_START             *MmSystemRangeStart
  2.3804 +#define MM_USER_PROBE_ADDRESS             *MmUserProbeAddress
  2.3805 +#define MM_LOWEST_USER_ADDRESS            (PVOID)0x10000
  2.3806 +#define MM_LOWEST_SYSTEM_ADDRESS          (PVOID)0xC0C00000
  2.3807 +
  2.3808 +#define KI_USER_SHARED_DATA               0xffdf0000
  2.3809 +#define SharedUserData                    ((KUSER_SHARED_DATA * CONST) KI_USER_SHARED_DATA)
  2.3810 +
  2.3811 +#define EFLAG_SIGN                        0x8000
  2.3812 +#define EFLAG_ZERO                        0x4000
  2.3813 +#define EFLAG_SELECT                      (EFLAG_SIGN | EFLAG_ZERO)
  2.3814 +
  2.3815 +#define RESULT_NEGATIVE                   ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT)
  2.3816 +#define RESULT_ZERO                       ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT)
  2.3817 +#define RESULT_POSITIVE                   ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT)
  2.3818 +
  2.3819 +typedef enum _INTERLOCKED_RESULT {
  2.3820 +  ResultNegative = RESULT_NEGATIVE,
  2.3821 +  ResultZero = RESULT_ZERO,
  2.3822 +  ResultPositive = RESULT_POSITIVE
  2.3823 +} INTERLOCKED_RESULT;
  2.3824 +
  2.3825 +NTOSAPI
  2.3826 +KIRQL
  2.3827 +DDKAPI
  2.3828 +KeGetCurrentIrql(
  2.3829 +  VOID);
  2.3830 +
  2.3831 +/*
  2.3832 + * ULONG
  2.3833 + * KeGetCurrentProcessorNumber(
  2.3834 + *   VOID)
  2.3835 + */
  2.3836 +#define KeGetCurrentProcessorNumber() \
  2.3837 +  ((ULONG)KeGetCurrentKPCR()->ProcessorNumber)
  2.3838 +
  2.3839 +
  2.3840 +#if  __USE_NTOSKRNL__
  2.3841 +/* CAREFUL: These are exported from ntoskrnl.exe as __fastcall functions,
  2.3842 +   but are also exported from kernel32.dll and declared in winbase.h as
  2.3843 +   __stdcall */
  2.3844 +#if !defined(__INTERLOCKED_DECLARED)
  2.3845 +#define __INTERLOCKED_DECLARED
  2.3846 +
  2.3847 +NTOSAPI
  2.3848 +LONG
  2.3849 +DDKFASTAPI
  2.3850 +InterlockedIncrement(
  2.3851 +  /*IN*/ long VOLATILE *Addend);
  2.3852 +
  2.3853 +NTOSAPI
  2.3854 +LONG
  2.3855 +DDKFASTAPI
  2.3856 +InterlockedDecrement(
  2.3857 +  /*IN*/ long VOLATILE *Addend);
  2.3858 +
  2.3859 +NTOSAPI
  2.3860 +LONG
  2.3861 +DDKFASTAPI
  2.3862 +InterlockedCompareExchange(
  2.3863 +  /*IN OUT*/ PLONG  VOLATILE  Destination,
  2.3864 +  /*IN*/ LONG  Exchange,
  2.3865 +  /*IN*/ LONG  Comparand);
  2.3866 +
  2.3867 +NTOSAPI
  2.3868 +LONG
  2.3869 +DDKFASTAPI
  2.3870 +InterlockedExchange(
  2.3871 +  /*IN OUT*/ PLONG  VOLATILE  Target,
  2.3872 +  /*IN*/ LONG Value);
  2.3873 +
  2.3874 +NTOSAPI
  2.3875 +LONG
  2.3876 +DDKFASTAPI
  2.3877 +InterlockedExchangeAdd(
  2.3878 +  /*IN OUT*/ PLONG VOLATILE  Addend,
  2.3879 +  /*IN*/ LONG  Value);
  2.3880 +
  2.3881 +/*
  2.3882 + * PVOID
  2.3883 + * InterlockedExchangePointer(
  2.3884 + * IN OUT PVOID VOLATILE  *Target,
  2.3885 + * IN PVOID  Value)
  2.3886 + */
  2.3887 +#define InterlockedExchangePointer(Target, Value) \
  2.3888 +  ((PVOID) InterlockedExchange((PLONG) Target, (LONG) Value))
  2.3889 +
  2.3890 +/*
  2.3891 + * PVOID
  2.3892 + * InterlockedCompareExchangePointer(
  2.3893 + * IN OUT PVOID  *Destination,
  2.3894 + * IN PVOID  Exchange,
  2.3895 + * IN PVOID  Comparand)
  2.3896 + */
  2.3897 +#define InterlockedCompareExchangePointer(Destination, Exchange, Comparand) \
  2.3898 +  ((PVOID) InterlockedCompareExchange((PLONG) Destination, (LONG) Exchange, (LONG) Comparand))
  2.3899 +
  2.3900 +#if  (_WIN32_WINNT >= 0x0501)
  2.3901 +PSLIST_ENTRY
  2.3902 +DDKFASTAPI
  2.3903 +InterlockedPopEntrySList(
  2.3904 +  /*IN*/ PSLIST_HEADER  ListHead);
  2.3905 +
  2.3906 +NTOSAPI
  2.3907 +PSLIST_ENTRY
  2.3908 +DDKFASTAPI
  2.3909 +InterlockedPushEntrySList(
  2.3910 +  /*IN*/ PSLIST_HEADER  ListHead,
  2.3911 +  /*IN*/ PSLIST_ENTRY  ListEntry);
  2.3912 +#endif /* _WIN32_WINNT >= 0x0501 */
  2.3913 +
  2.3914 +#endif /* !__INTERLOCKED_DECLARED */
  2.3915 +#endif /*  __USE_NTOSKRNL__ */
  2.3916 +
  2.3917 +NTOSAPI
  2.3918 +VOID
  2.3919 +DDKFASTAPI
  2.3920 +KefAcquireSpinLockAtDpcLevel(
  2.3921 +  /*IN*/ PKSPIN_LOCK  SpinLock);
  2.3922 +
  2.3923 +NTOSAPI
  2.3924 +VOID
  2.3925 +DDKFASTAPI
  2.3926 +KefReleaseSpinLockFromDpcLevel(
  2.3927 +  /*IN*/ PKSPIN_LOCK  SpinLock);
  2.3928 +
  2.3929 +#define KeAcquireSpinLockAtDpcLevel(SpinLock) KefAcquireSpinLockAtDpcLevel(SpinLock)
  2.3930 +#define KeReleaseSpinLockFromDpcLevel(SpinLock) KefReleaseSpinLockFromDpcLevel(SpinLock)
  2.3931 +
  2.3932 +#define RtlCopyMemoryNonTemporal RtlCopyMemory
  2.3933 +
  2.3934 +#define KeGetDcacheFillSize() 1L
  2.3935 +
  2.3936 +#endif /* _X86_ */
  2.3937 +
  2.3938 +
  2.3939 +
  2.3940 +/*
  2.3941 +** Utillity functions
  2.3942 +*/
  2.3943 +
  2.3944 +#define ARGUMENT_PRESENT(ArgumentPointer) \
  2.3945 +  ((BOOLEAN) ((PVOID)ArgumentPointer != (PVOID)NULL))
  2.3946 +
  2.3947 +/*
  2.3948 + * ULONG
  2.3949 + * BYTE_OFFSET(
  2.3950 + * IN PVOID  Va)
  2.3951 + */
  2.3952 +#define BYTE_OFFSET(Va) \
  2.3953 +  ((ULONG) ((ULONG_PTR) (Va) & (PAGE_SIZE - 1)))
  2.3954 +
  2.3955 +/*
  2.3956 + * ULONG
  2.3957 + * BYTES_TO_PAGES(
  2.3958 + * IN ULONG  Size)
  2.3959 + */
  2.3960 +#define BYTES_TO_PAGES(Size) \
  2.3961 +  ((ULONG) ((ULONG_PTR) (Size) >> PAGE_SHIFT) + (((ULONG) (Size) & (PAGE_SIZE - 1)) != 0))
  2.3962 +
  2.3963 +/*
  2.3964 + * PCHAR
  2.3965 + * CONTAINING_RECORD(
  2.3966 + * IN PCHAR  Address,
  2.3967 + * IN TYPE  Type,
  2.3968 + * IN PCHAR  Field);
  2.3969 + */
  2.3970 +#ifndef CONTAINING_RECORD
  2.3971 +#define CONTAINING_RECORD(Address, Type, Field) \
  2.3972 +  ((Type *) (((ULONG_PTR) Address) - FIELD_OFFSET(Type, Field)))
  2.3973 +#endif
  2.3974 +
  2.3975 +/* LONG
  2.3976 + * FIELD_OFFSET(
  2.3977 + * IN TYPE  Type,
  2.3978 + * IN PCHAR  Field);
  2.3979 + */
  2.3980 +#ifndef FIELD_OFFSET
  2.3981 +#define FIELD_OFFSET(Type, Field) \
  2.3982 +  ((LONG) (&(((Type *) 0)->Field)))
  2.3983 +#endif
  2.3984 +
  2.3985 +/*
  2.3986 + * PVOID
  2.3987 + * PAGE_ALIGN(
  2.3988 + * IN PVOID  Va)
  2.3989 + */
  2.3990 +#define PAGE_ALIGN(Va) \
  2.3991 +  ((PVOID) ((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1)))
  2.3992 +
  2.3993 +/*
  2.3994 + * ULONG_PTR
  2.3995 + * ROUND_TO_PAGES(
  2.3996 + * IN ULONG_PTR  Size)
  2.3997 + */
  2.3998 +#define ROUND_TO_PAGES(Size) \
  2.3999 +  ((ULONG_PTR) (((ULONG_PTR) Size + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)))
  2.4000 +
  2.4001 +NTOSAPI
  2.4002 +VOID
  2.4003 +DDKAPI
  2.4004 +RtlAssert(
  2.4005 +  /*IN*/ PVOID  FailedAssertion,
  2.4006 +  /*IN*/ PVOID  FileName,
  2.4007 +  /*IN*/ ULONG  LineNumber,
  2.4008 +  /*IN*/ PCHAR  Message);
  2.4009 +
  2.4010 +#ifdef DBG
  2.4011 +
  2.4012 +#define ASSERT(exp) \
  2.4013 +  ((!(exp)) ? \
  2.4014 +    (RtlAssert( #exp, __FILE__, __LINE__, NULL ), FALSE) : TRUE)
  2.4015 +
  2.4016 +#define ASSERTMSG(msg, exp) \
  2.4017 +  ((!(exp)) ? \
  2.4018 +    (RtlAssert( #exp, __FILE__, __LINE__, msg ), FALSE) : TRUE)
  2.4019 +
  2.4020 +#define RTL_SOFT_ASSERT(exp) \
  2.4021 +  ((!(_exp)) ? \
  2.4022 +    (DbgPrint("%s(%d): Soft assertion failed\n   Expression: %s\n", __FILE__, __LINE__, #exp), FALSE) : TRUE)
  2.4023 +
  2.4024 +#define RTL_SOFT_ASSERTMSG(msg, exp) \
  2.4025 +  ((!(exp)) ? \
  2.4026 +    (DbgPrint("%s(%d): Soft assertion failed\n   Expression: %s\n   Message: %s\n", __FILE__, __LINE__, #exp, (msg)), FALSE) : TRUE)
  2.4027 +
  2.4028 +#define RTL_VERIFY(exp) ASSERT(exp)
  2.4029 +#define RTL_VERIFYMSG(msg, exp) ASSERT(msg, exp)
  2.4030 +
  2.4031 +#define RTL_SOFT_VERIFY(exp) RTL_SOFT_ASSERT(exp)
  2.4032 +#define RTL_SOFT_VERIFYMSG(msg, exp) RTL_SOFT_ASSERTMSG(msg, exp)
  2.4033 +
  2.4034 +#else /* !DBG */
  2.4035 +
  2.4036 +#define ASSERT(exp) ((VOID) 0)
  2.4037 +#define ASSERTMSG(msg, exp) ((VOID) 0)
  2.4038 +
  2.4039 +#define RTL_SOFT_ASSERT(exp) ((VOID) 0)
  2.4040 +#define RTL_SOFT_ASSERTMSG(msg, exp) ((VOID) 0)
  2.4041 +
  2.4042 +#define RTL_VERIFY(exp) ((exp) ? TRUE : FALSE)
  2.4043 +#define RTL_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
  2.4044 +
  2.4045 +#define RTL_SOFT_VERIFY(exp) ((exp) ? TRUE : FALSE)
  2.4046 +#define RTL_SOFT_VERIFYMSG(msg, exp) ((exp) ? TRUE : FALSE)
  2.4047 +
  2.4048 +#endif /* DBG */
  2.4049 +
  2.4050 +
  2.4051 +/*
  2.4052 +** Driver support routines
  2.4053 +*/
  2.4054 +
  2.4055 +/** Runtime library routines **/
  2.4056 +
  2.4057 +/*
  2.4058 + * VOID
  2.4059 + * InitializeListHead(
  2.4060 + * IN PLIST_ENTRY  ListHead)
  2.4061 + */
  2.4062 +#define InitializeListHead(_ListHead) \
  2.4063 +{ \
  2.4064 +  (_ListHead)->Flink = (_ListHead); \
  2.4065 +  (_ListHead)->Blink = (_ListHead); \
  2.4066 +}
  2.4067 +
  2.4068 +/*
  2.4069 + * VOID
  2.4070 + * InsertHeadList(
  2.4071 + * IN PLIST_ENTRY  ListHead,
  2.4072 + * IN PLIST_ENTRY  Entry)
  2.4073 + */
  2.4074 +#define InsertHeadList(_ListHead, \
  2.4075 +                       _Entry) \
  2.4076 +{ \
  2.4077 +  PLIST_ENTRY _OldFlink; \
  2.4078 +  _OldFlink = (_ListHead)->Flink; \
  2.4079 +  (_Entry)->Flink = _OldFlink; \
  2.4080 +  (_Entry)->Blink = (_ListHead); \
  2.4081 +  _OldFlink->Blink = (_Entry); \
  2.4082 +  (_ListHead)->Flink = (_Entry); \
  2.4083 +}
  2.4084 +
  2.4085 +/*
  2.4086 + * VOID
  2.4087 + * InsertTailList(
  2.4088 + * IN PLIST_ENTRY  ListHead,
  2.4089 + * IN PLIST_ENTRY  Entry)
  2.4090 + */
  2.4091 +#define InsertTailList(_ListHead, \
  2.4092 +                       _Entry) \
  2.4093 +{ \
  2.4094 +	PLIST_ENTRY _OldBlink; \
  2.4095 +	_OldBlink = (_ListHead)->Blink; \
  2.4096 +	(_Entry)->Flink = (_ListHead); \
  2.4097 +	(_Entry)->Blink = _OldBlink; \
  2.4098 +	_OldBlink->Flink = (_Entry); \
  2.4099 +	(_ListHead)->Blink = (_Entry); \
  2.4100 +}
  2.4101 +
  2.4102 +/*
  2.4103 + * BOOLEAN
  2.4104 + * IsListEmpty(
  2.4105 + * IN PLIST_ENTRY  ListHead)
  2.4106 + */
  2.4107 +#define IsListEmpty(_ListHead) \
  2.4108 +  ((_ListHead)->Flink == (_ListHead))
  2.4109 +
  2.4110 +static __inline PSINGLE_LIST_ENTRY 
  2.4111 +PopEntryList(
  2.4112 +  /*IN*/ PSINGLE_LIST_ENTRY  ListHead)
  2.4113 +{
  2.4114 +	PSINGLE_LIST_ENTRY Entry;
  2.4115 +
  2.4116 +	Entry = ListHead->Next;
  2.4117 +	if (Entry != NULL)
  2.4118 +	{
  2.4119 +		ListHead->Next = Entry->Next;
  2.4120 +	}
  2.4121 +  return Entry;
  2.4122 +}
  2.4123 +
  2.4124 +/*
  2.4125 + * VOID
  2.4126 + * PushEntryList(
  2.4127 + * IN PSINGLE_LIST_ENTRY  ListHead,
  2.4128 + * IN PSINGLE_LIST_ENTRY  Entry)
  2.4129 + */
  2.4130 +#define PushEntryList(_ListHead, \
  2.4131 +                      _Entry) \
  2.4132 +{ \
  2.4133 +	(_Entry)->Next = (_ListHead)->Next; \
  2.4134 +	(_ListHead)->Next = (_Entry); \
  2.4135 +}
  2.4136 +
  2.4137 +/*
  2.4138 + * VOID
  2.4139 + * RemoveEntryList(
  2.4140 + * IN PLIST_ENTRY  Entry)
  2.4141 + */
  2.4142 +#define RemoveEntryList(_Entry) \
  2.4143 +{ \
  2.4144 +	PLIST_ENTRY _OldFlink; \
  2.4145 +	PLIST_ENTRY _OldBlink; \
  2.4146 +	_OldFlink = (_Entry)->Flink; \
  2.4147 +	_OldBlink = (_Entry)->Blink; \
  2.4148 +	_OldFlink->Blink = _OldBlink; \
  2.4149 +	_OldBlink->Flink = _OldFlink; \
  2.4150 +  (_Entry)->Flink = NULL; \
  2.4151 +  (_Entry)->Blink = NULL; \
  2.4152 +}
  2.4153 +
  2.4154 +static __inline PLIST_ENTRY 
  2.4155 +RemoveHeadList(
  2.4156 +  /*IN*/ PLIST_ENTRY  ListHead)
  2.4157 +{
  2.4158 +	PLIST_ENTRY OldFlink;
  2.4159 +	PLIST_ENTRY OldBlink;
  2.4160 +	PLIST_ENTRY Entry;
  2.4161 +
  2.4162 +	Entry = ListHead->Flink;
  2.4163 +	OldFlink = ListHead->Flink->Flink;
  2.4164 +	OldBlink = ListHead->Flink->Blink;
  2.4165 +	OldFlink->Blink = OldBlink;
  2.4166 +	OldBlink->Flink = OldFlink;
  2.4167 +
  2.4168 +  if (Entry != ListHead)
  2.4169 +  {
  2.4170 +    Entry->Flink = NULL;
  2.4171 +    Entry->Blink = NULL;
  2.4172 +  }
  2.4173 +
  2.4174 +	return Entry;
  2.4175 +}
  2.4176 +
  2.4177 +static __inline PLIST_ENTRY
  2.4178 +RemoveTailList(
  2.4179 +  /*IN*/ PLIST_ENTRY  ListHead)
  2.4180 +{
  2.4181 +	PLIST_ENTRY OldFlink;
  2.4182 +	PLIST_ENTRY OldBlink;
  2.4183 +	PLIST_ENTRY Entry;
  2.4184 +
  2.4185 +	Entry = ListHead->Blink;
  2.4186 +	OldFlink = ListHead->Blink->Flink;
  2.4187 +	OldBlink = ListHead->Blink->Blink;
  2.4188 +	OldFlink->Blink = OldBlink;
  2.4189 +	OldBlink->Flink = OldFlink;
  2.4190 +
  2.4191 +  if (Entry != ListHead)
  2.4192 +  {
  2.4193 +    Entry->Flink = NULL;
  2.4194 +    Entry->Blink = NULL;
  2.4195 +  }
  2.4196 +   
  2.4197 +  return Entry;
  2.4198 +}
  2.4199 +
  2.4200 +/*
  2.4201 + * USHORT
  2.4202 + * QueryDepthSList(
  2.4203 + * IN PSLIST_HEADER  SListHead)
  2.4204 + */
  2.4205 +#define QueryDepthSList(_SListHead) \
  2.4206 +  ((USHORT) ((_SListHead)->Alignment & 0xffff))
  2.4207 +
  2.4208 +#define InterlockedFlushSList(ListHead) ExInterlockedFlushSList(ListHead)
  2.4209 +
  2.4210 +NTOSAPI
  2.4211 +ULONG
  2.4212 +DDKAPI
  2.4213 +RtlAnsiStringToUnicodeSize(
  2.4214 +  /*IN*/ PANSI_STRING  AnsiString);
  2.4215 +
  2.4216 +NTOSAPI
  2.4217 +NTSTATUS
  2.4218 +DDKAPI
  2.4219 +RtlAddRange(
  2.4220 +  /*IN OUT*/ PRTL_RANGE_LIST  RangeList,
  2.4221 +  /*IN*/ ULONGLONG  Start,
  2.4222 +  /*IN*/ ULONGLONG  End,
  2.4223 +  /*IN*/ UCHAR  Attributes,
  2.4224 +  /*IN*/ ULONG  Flags,
  2.4225 +  /*IN*/ PVOID  UserData  /*OPTIONAL*/,
  2.4226 +  /*IN*/ PVOID  Owner  /*OPTIONAL*/);
  2.4227 +
  2.4228 +NTOSAPI
  2.4229 +NTSTATUS
  2.4230 +DDKAPI
  2.4231 +RtlAnsiStringToUnicodeString(
  2.4232 +  /*IN OUT*/ PUNICODE_STRING  DestinationString,
  2.4233 +  /*IN*/ PANSI_STRING  SourceString,
  2.4234 +  /*IN*/ BOOLEAN  AllocateDestinationString);
  2.4235 +
  2.4236 +NTOSAPI
  2.4237 +NTSTATUS
  2.4238 +DDKAPI
  2.4239 +RtlAppendUnicodeStringToString(
  2.4240 +  /*IN OUT*/ PUNICODE_STRING  Destination,
  2.4241 +  /*IN*/ PUNICODE_STRING  Source);
  2.4242 +
  2.4243 +NTOSAPI
  2.4244 +NTSTATUS
  2.4245 +DDKAPI
  2.4246 +RtlAppendUnicodeToString(
  2.4247 +  /*IN OUT*/ PUNICODE_STRING  Destination,
  2.4248 +  /*IN*/ PCWSTR  Source);
  2.4249 +
  2.4250 +NTOSAPI
  2.4251 +BOOLEAN
  2.4252 +DDKAPI
  2.4253 +RtlAreBitsClear(
  2.4254 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4255 +  /*IN*/ ULONG  StartingIndex,
  2.4256 +  /*IN*/ ULONG  Length); 
  2.4257 +
  2.4258 +NTOSAPI
  2.4259 +BOOLEAN
  2.4260 +DDKAPI
  2.4261 +RtlAreBitsSet(
  2.4262 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4263 +  /*IN*/ ULONG  StartingIndex,
  2.4264 +  /*IN*/ ULONG  Length); 
  2.4265 +
  2.4266 +NTOSAPI
  2.4267 +NTSTATUS
  2.4268 +DDKAPI
  2.4269 +RtlCharToInteger(
  2.4270 +  /*IN*/ PCSZ  String,
  2.4271 +  /*IN*/ ULONG  Base  /*OPTIONAL*/,
  2.4272 +  /*IN OUT*/ PULONG  Value);
  2.4273 +
  2.4274 +NTOSAPI
  2.4275 +ULONG
  2.4276 +DDKAPI
  2.4277 +RtlCheckBit(
  2.4278 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4279 +  /*IN*/ ULONG  BitPosition); 
  2.4280 +
  2.4281 +NTOSAPI
  2.4282 +NTSTATUS
  2.4283 +DDKAPI
  2.4284 +RtlCheckRegistryKey(
  2.4285 +  /*IN*/ ULONG  RelativeTo,
  2.4286 +  /*IN*/ PWSTR  Path);
  2.4287 +
  2.4288 +NTOSAPI
  2.4289 +VOID
  2.4290 +DDKAPI
  2.4291 +RtlClearAllBits(
  2.4292 +  /*IN*/ PRTL_BITMAP  BitMapHeader); 
  2.4293 +
  2.4294 +NTOSAPI
  2.4295 +VOID
  2.4296 +DDKAPI
  2.4297 +RtlClearBit(
  2.4298 +  PRTL_BITMAP  BitMapHeader,
  2.4299 +  ULONG  BitNumber);
  2.4300 +
  2.4301 +NTOSAPI
  2.4302 +VOID
  2.4303 +DDKAPI
  2.4304 +RtlClearBits(
  2.4305 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4306 +  /*IN*/ ULONG  StartingIndex,
  2.4307 +  /*IN*/ ULONG  NumberToClear); 
  2.4308 +
  2.4309 +NTOSAPI
  2.4310 +SIZE_T
  2.4311 +DDKAPI
  2.4312 +RtlCompareMemory(
  2.4313 +  /*IN*/ CONST VOID  *Source1,
  2.4314 +  /*IN*/ CONST VOID  *Source2,
  2.4315 +  /*IN*/ SIZE_T  Length);
  2.4316 +
  2.4317 +NTOSAPI
  2.4318 +LONG
  2.4319 +DDKAPI
  2.4320 +RtlCompareString(
  2.4321 +  /*IN*/ PSTRING  String1,
  2.4322 +  /*IN*/ PSTRING  String2,
  2.4323 +  BOOLEAN  CaseInSensitive);
  2.4324 +
  2.4325 +NTOSAPI
  2.4326 +LONG
  2.4327 +DDKAPI
  2.4328 +RtlCompareUnicodeString(
  2.4329 +  /*IN*/ PUNICODE_STRING  String1,
  2.4330 +  /*IN*/ PUNICODE_STRING  String2,
  2.4331 +  /*IN*/ BOOLEAN  CaseInSensitive);
  2.4332 +
  2.4333 +NTOSAPI
  2.4334 +LARGE_INTEGER
  2.4335 +DDKAPI
  2.4336 +RtlConvertLongToLargeInteger(
  2.4337 +  /*IN*/ LONG  SignedInteger);
  2.4338 +
  2.4339 +NTOSAPI
  2.4340 +LUID
  2.4341 +DDKAPI
  2.4342 +RtlConvertLongToLuid(
  2.4343 +  /*IN*/ LONG  Long);
  2.4344 +
  2.4345 +NTOSAPI
  2.4346 +LARGE_INTEGER
  2.4347 +DDKAPI
  2.4348 +RtlConvertUlongToLargeInteger(
  2.4349 +  /*IN*/ ULONG  UnsignedInteger);
  2.4350 +
  2.4351 +NTOSAPI
  2.4352 +LUID
  2.4353 +DDKAPI
  2.4354 +RtlConvertUlongToLuid(
  2.4355 +  ULONG  Ulong);
  2.4356 +
  2.4357 +/*
  2.4358 + * VOID
  2.4359 + * RtlCopyMemory(
  2.4360 + * IN VOID UNALIGNED  *Destination,
  2.4361 + * IN CONST VOID UNALIGNED  *Source,
  2.4362 + * IN SIZE_T  Length)
  2.4363 + */
  2.4364 +#ifndef RtlCopyMemory
  2.4365 +#define RtlCopyMemory(Destination, Source, Length) \
  2.4366 +  memcpy(Destination, Source, Length);
  2.4367 +#endif
  2.4368 +
  2.4369 +#ifndef RtlCopyBytes
  2.4370 +#define RtlCopyBytes RtlCopyMemory
  2.4371 +#endif
  2.4372 +
  2.4373 +NTOSAPI
  2.4374 +VOID
  2.4375 +DDKAPI
  2.4376 +RtlCopyMemory32(
  2.4377 +  /*IN*/ VOID UNALIGNED  *Destination,
  2.4378 +  /*IN*/ CONST VOID UNALIGNED  *Source,
  2.4379 +  /*IN*/ ULONG  Length);
  2.4380 +
  2.4381 +NTOSAPI
  2.4382 +NTSTATUS
  2.4383 +DDKAPI
  2.4384 +RtlCopyRangeList(
  2.4385 +  /*OUT*/ PRTL_RANGE_LIST  CopyRangeList,
  2.4386 +  /*IN*/ PRTL_RANGE_LIST  RangeList);
  2.4387 +
  2.4388 +NTOSAPI
  2.4389 +VOID
  2.4390 +DDKAPI
  2.4391 +RtlCopyString(
  2.4392 +  /*IN OUT*/ PSTRING  DestinationString,
  2.4393 +  /*IN*/ PSTRING  SourceString  /*OPTIONAL*/);
  2.4394 +
  2.4395 +NTOSAPI
  2.4396 +VOID
  2.4397 +DDKAPI
  2.4398 +RtlCopyUnicodeString(
  2.4399 +  /*IN OUT*/ PUNICODE_STRING  DestinationString,
  2.4400 +  /*IN*/ PUNICODE_STRING  SourceString);
  2.4401 +
  2.4402 +NTOSAPI
  2.4403 +NTSTATUS
  2.4404 +DDKAPI
  2.4405 +RtlCreateRegistryKey(
  2.4406 +  /*IN*/ ULONG  RelativeTo,
  2.4407 +  /*IN*/ PWSTR  Path);
  2.4408 +
  2.4409 +NTOSAPI
  2.4410 +NTSTATUS
  2.4411 +DDKAPI
  2.4412 +RtlCreateSecurityDescriptor(
  2.4413 +  /*IN OUT*/ PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.4414 +  /*IN*/ ULONG  Revision);
  2.4415 +
  2.4416 +NTOSAPI
  2.4417 +NTSTATUS
  2.4418 +DDKAPI
  2.4419 +RtlDeleteOwnersRanges(
  2.4420 +  /*IN OUT*/ PRTL_RANGE_LIST  RangeList,
  2.4421 +  /*IN*/ PVOID  Owner);
  2.4422 +
  2.4423 +NTOSAPI
  2.4424 +NTSTATUS
  2.4425 +DDKAPI
  2.4426 +RtlDeleteRange(
  2.4427 +  /*IN OUT*/ PRTL_RANGE_LIST  RangeList,
  2.4428 +  /*IN*/ ULONGLONG  Start,
  2.4429 +  /*IN*/ ULONGLONG  End,
  2.4430 +  /*IN*/ PVOID  Owner);
  2.4431 +
  2.4432 +NTOSAPI
  2.4433 +NTSTATUS
  2.4434 +DDKAPI
  2.4435 +RtlDeleteRegistryValue(
  2.4436 +  /*IN*/ ULONG  RelativeTo,
  2.4437 +  /*IN*/ PCWSTR  Path,
  2.4438 +  /*IN*/ PCWSTR  ValueName);
  2.4439 +
  2.4440 +NTOSAPI
  2.4441 +BOOL
  2.4442 +DDKAPI
  2.4443 +RtlDosPathNameToNtPathName_U(
  2.4444 +  /*IN*/ PCWSTR  DosPathName,
  2.4445 +  /*OUT*/ PUNICODE_STRING  NtPathName,
  2.4446 +  /*OUT*/ PCWSTR  *NtFileNamePart,
  2.4447 +  /*OUT*/ VOID  *DirectoryInfo);
  2.4448 +
  2.4449 +/*
  2.4450 + * BOOLEAN
  2.4451 + * RtlEqualLuid( 
  2.4452 + * IN LUID  Luid1,
  2.4453 + * IN LUID  Luid2)
  2.4454 + */
  2.4455 +#define RtlEqualLuid(_Luid1, \
  2.4456 +                     _Luid2) \
  2.4457 +  ((Luid1.LowPart == Luid2.LowPart) && (Luid1.HighPart == Luid2.HighPart))
  2.4458 +
  2.4459 +/*
  2.4460 + * ULONG
  2.4461 + * RtlEqualMemory(
  2.4462 + * IN VOID UNALIGNED  *Destination,
  2.4463 + * IN CONST VOID UNALIGNED  *Source,
  2.4464 + * IN SIZE_T  Length)
  2.4465 + */
  2.4466 +#define RtlEqualMemory(Destination, Source, Length) (!memcmp(Destination, Source, Length))
  2.4467 +
  2.4468 +NTOSAPI
  2.4469 +BOOLEAN
  2.4470 +DDKAPI
  2.4471 +RtlEqualString(
  2.4472 +  /*IN*/ PSTRING  String1,
  2.4473 +  /*IN*/ PSTRING  String2,
  2.4474 +  /*IN*/ BOOLEAN  CaseInSensitive);
  2.4475 +
  2.4476 +NTOSAPI
  2.4477 +BOOLEAN
  2.4478 +DDKAPI
  2.4479 +RtlEqualUnicodeString(
  2.4480 +  /*IN*/ CONST UNICODE_STRING  *String1,
  2.4481 +  /*IN*/ CONST UNICODE_STRING  *String2,
  2.4482 +  /*IN*/ BOOLEAN  CaseInSensitive);
  2.4483 +
  2.4484 +/*
  2.4485 + * VOID
  2.4486 + * RtlFillMemory(
  2.4487 + * IN VOID UNALIGNED  *Destination,
  2.4488 + * IN SIZE_T  Length,
  2.4489 + * IN UCHAR  Fill)
  2.4490 + */
  2.4491 +#ifndef RtlFillMemory
  2.4492 +#define RtlFillMemory(Destination, Length, Fill) \
  2.4493 +  memset(Destination, Fill, Length)
  2.4494 +#endif
  2.4495 +
  2.4496 +#ifndef RtlFillBytes
  2.4497 +#define RtlFillBytes RtlFillMemory
  2.4498 +#endif
  2.4499 +
  2.4500 +NTOSAPI
  2.4501 +ULONG
  2.4502 +DDKAPI
  2.4503 +RtlFindClearBits(
  2.4504 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4505 +  /*IN*/ ULONG  NumberToFind,
  2.4506 +  /*IN*/ ULONG  HintIndex); 
  2.4507 +
  2.4508 +NTOSAPI
  2.4509 +ULONG
  2.4510 +DDKAPI
  2.4511 +RtlFindClearBitsAndSet(
  2.4512 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4513 +  /*IN*/ ULONG  NumberToFind,
  2.4514 +  /*IN*/ ULONG  HintIndex); 
  2.4515 +
  2.4516 +NTOSAPI
  2.4517 +ULONG
  2.4518 +DDKAPI
  2.4519 +RtlFindClearRuns( 
  2.4520 +  /*IN*/ PRTL_BITMAP  BitMapHeader, 
  2.4521 +  /*OUT*/ PRTL_BITMAP_RUN  RunArray, 
  2.4522 +  /*IN*/ ULONG  SizeOfRunArray, 
  2.4523 +  /*IN*/ BOOLEAN  LocateLongestRuns);
  2.4524 +
  2.4525 +NTOSAPI
  2.4526 +ULONG
  2.4527 +DDKAPI
  2.4528 +RtlFindFirstRunClear(
  2.4529 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4530 +  /*OUT*/ PULONG  StartingIndex);
  2.4531 +
  2.4532 +NTOSAPI
  2.4533 +ULONG
  2.4534 +DDKAPI
  2.4535 +RtlFindLastBackwardRunClear(
  2.4536 +  /*IN*/ PRTL_BITMAP  BitMapHeader, 
  2.4537 +  /*IN*/ ULONG  FromIndex, 
  2.4538 +  /*OUT*/ PULONG  StartingRunIndex); 
  2.4539 +
  2.4540 +NTOSAPI
  2.4541 +CCHAR
  2.4542 +DDKAPI
  2.4543 +RtlFindLeastSignificantBit(
  2.4544 +  /*IN*/ ULONGLONG  Set);
  2.4545 +
  2.4546 +NTOSAPI
  2.4547 +ULONG
  2.4548 +DDKAPI
  2.4549 +RtlFindLongestRunClear(
  2.4550 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4551 +  /*OUT*/ PULONG  StartingIndex); 
  2.4552 +
  2.4553 +NTOSAPI
  2.4554 +CCHAR
  2.4555 +DDKAPI
  2.4556 +RtlFindMostSignificantBit(
  2.4557 +  /*IN*/ ULONGLONG  Set);
  2.4558 +
  2.4559 +NTOSAPI
  2.4560 +ULONG
  2.4561 +DDKAPI
  2.4562 +RtlFindNextForwardRunClear(
  2.4563 +  /*IN*/ PRTL_BITMAP  BitMapHeader, 
  2.4564 +  /*IN*/ ULONG  FromIndex, 
  2.4565 +  /*OUT*/ PULONG  StartingRunIndex);
  2.4566 +
  2.4567 +NTOSAPI
  2.4568 +NTSTATUS
  2.4569 +DDKAPI
  2.4570 +RtlFindRange(
  2.4571 +  /*IN*/ PRTL_RANGE_LIST  RangeList,
  2.4572 +  /*IN*/ ULONGLONG  Minimum,
  2.4573 +  /*IN*/ ULONGLONG  Maximum,
  2.4574 +  /*IN*/ ULONG  Length,
  2.4575 +  /*IN*/ ULONG  Alignment,
  2.4576 +  /*IN*/ ULONG  Flags,
  2.4577 +  /*IN*/ UCHAR  AttributeAvailableMask,
  2.4578 +  /*IN*/ PVOID  Context  /*OPTIONAL*/,
  2.4579 +  /*IN*/ PRTL_CONFLICT_RANGE_CALLBACK  Callback  /*OPTIONAL*/,
  2.4580 +  /*OUT*/ PULONGLONG  Start);
  2.4581 +
  2.4582 +NTOSAPI
  2.4583 +ULONG
  2.4584 +DDKAPI
  2.4585 +RtlFindSetBits(
  2.4586 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4587 +  /*IN*/ ULONG  NumberToFind,
  2.4588 +  /*IN*/ ULONG  HintIndex); 
  2.4589 +
  2.4590 +NTOSAPI
  2.4591 +ULONG
  2.4592 +DDKAPI
  2.4593 +RtlFindSetBitsAndClear(
  2.4594 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4595 +  /*IN*/ ULONG  NumberToFind,
  2.4596 +  /*IN*/ ULONG  HintIndex); 
  2.4597 +
  2.4598 +NTOSAPI
  2.4599 +VOID
  2.4600 +DDKAPI
  2.4601 +RtlFreeAnsiString(
  2.4602 +  /*IN*/ PANSI_STRING  AnsiString);
  2.4603 +
  2.4604 +NTOSAPI
  2.4605 +VOID
  2.4606 +DDKAPI
  2.4607 +RtlFreeRangeList(
  2.4608 +  /*IN*/ PRTL_RANGE_LIST  RangeList);
  2.4609 +
  2.4610 +NTOSAPI
  2.4611 +VOID
  2.4612 +DDKAPI
  2.4613 +RtlFreeUnicodeString(
  2.4614 +  /*IN*/ PUNICODE_STRING  UnicodeString);
  2.4615 +
  2.4616 +NTOSAPI
  2.4617 +VOID
  2.4618 +DDKAPI
  2.4619 +RtlGetCallersAddress(
  2.4620 +  /*OUT*/ PVOID  *CallersAddress,
  2.4621 +  /*OUT*/ PVOID  *CallersCaller);
  2.4622 +
  2.4623 +NTOSAPI
  2.4624 +NTSTATUS
  2.4625 +DDKAPI
  2.4626 +RtlGetVersion(
  2.4627 +  /*IN OUT*/ PRTL_OSVERSIONINFOW  lpVersionInformation);
  2.4628 +
  2.4629 +NTOSAPI
  2.4630 +NTSTATUS
  2.4631 +DDKAPI
  2.4632 +RtlGetFirstRange(
  2.4633 +  /*IN*/ PRTL_RANGE_LIST  RangeList,
  2.4634 +  /*OUT*/ PRTL_RANGE_LIST_ITERATOR  Iterator,
  2.4635 +  /*OUT*/ PRTL_RANGE  *Range);
  2.4636 +
  2.4637 +NTOSAPI
  2.4638 +NTSTATUS
  2.4639 +DDKAPI
  2.4640 +RtlGetNextRange(
  2.4641 +  /*IN OUT*/  PRTL_RANGE_LIST_ITERATOR  Iterator,
  2.4642 +  /*OUT*/ PRTL_RANGE  *Range,
  2.4643 +  /*IN*/ BOOLEAN  MoveForwards);
  2.4644 +
  2.4645 +#define FOR_ALL_RANGES(RangeList, Iterator, Current)          \
  2.4646 +  for (RtlGetFirstRange((RangeList), (Iterator), &(Current)); \
  2.4647 +    (Current) != NULL;                                        \
  2.4648 +    RtlGetNextRange((Iterator), &(Current), TRUE))
  2.4649 +
  2.4650 +#define FOR_ALL_RANGES_BACKWARDS(RangeList, Iterator, Current) \
  2.4651 +  for (RtlGetLastRange((RangeList), (Iterator), &(Current));   \
  2.4652 +    (Current) != NULL;                                         \
  2.4653 +    RtlGetNextRange((Iterator), &(Current), FALSE))
  2.4654 +
  2.4655 +NTOSAPI
  2.4656 +NTSTATUS
  2.4657 +DDKAPI
  2.4658 +RtlGUIDFromString( 
  2.4659 +  /*IN*/ PUNICODE_STRING  GuidString, 
  2.4660 +  /*OUT*/ GUID  *Guid);
  2.4661 +
  2.4662 +NTOSAPI
  2.4663 +NTSTATUS
  2.4664 +DDKAPI
  2.4665 +RtlHashUnicodeString(
  2.4666 +  /*IN*/ CONST UNICODE_STRING  *String,
  2.4667 +  /*IN*/ BOOLEAN  CaseInSensitive,
  2.4668 +  /*IN*/ ULONG  HashAlgorithm,
  2.4669 +  /*OUT*/ PULONG  HashValue);
  2.4670 +
  2.4671 +NTOSAPI
  2.4672 +VOID
  2.4673 +DDKAPI
  2.4674 +RtlInitAnsiString(
  2.4675 +  /*IN OUT*/ PANSI_STRING  DestinationString,
  2.4676 +  /*IN*/ PCSZ  SourceString);
  2.4677 +
  2.4678 +NTOSAPI
  2.4679 +VOID
  2.4680 +DDKAPI
  2.4681 +RtlInitializeBitMap(
  2.4682 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4683 +  /*IN*/ PULONG  BitMapBuffer,
  2.4684 +  /*IN*/ ULONG  SizeOfBitMap); 
  2.4685 +
  2.4686 +NTOSAPI
  2.4687 +VOID
  2.4688 +DDKAPI
  2.4689 +RtlInitializeRangeList(
  2.4690 +  /*IN OUT*/ PRTL_RANGE_LIST  RangeList);
  2.4691 +
  2.4692 +NTOSAPI
  2.4693 +VOID
  2.4694 +DDKAPI
  2.4695 +RtlInitString(
  2.4696 +  /*IN OUT*/ PSTRING  DestinationString,
  2.4697 +  /*IN*/ PCSZ  SourceString);
  2.4698 +
  2.4699 +NTOSAPI
  2.4700 +VOID
  2.4701 +DDKAPI
  2.4702 +RtlInitUnicodeString(
  2.4703 +  /*IN OUT*/ PUNICODE_STRING  DestinationString,
  2.4704 +  /*IN*/ PCWSTR  SourceString);
  2.4705 +
  2.4706 +NTOSAPI
  2.4707 +NTSTATUS
  2.4708 +DDKAPI
  2.4709 +RtlInt64ToUnicodeString(
  2.4710 +  /*IN*/ ULONGLONG  Value,
  2.4711 +  /*IN*/ ULONG  Base /*OPTIONAL*/,
  2.4712 +  /*IN OUT*/ PUNICODE_STRING  String);
  2.4713 +
  2.4714 +NTOSAPI
  2.4715 +NTSTATUS
  2.4716 +DDKAPI
  2.4717 +RtlIntegerToUnicodeString(
  2.4718 +  /*IN*/ ULONG  Value,
  2.4719 +  /*IN*/ ULONG  Base  /*OPTIONAL*/,
  2.4720 +  /*IN OUT*/ PUNICODE_STRING  String);
  2.4721 +
  2.4722 +NTOSAPI
  2.4723 +NTSTATUS
  2.4724 +DDKAPI
  2.4725 +RtlIntPtrToUnicodeString(
  2.4726 +  PLONG  Value,
  2.4727 +  ULONG  Base  /*OPTIONAL*/,
  2.4728 +  PUNICODE_STRING  String);
  2.4729 +
  2.4730 +NTOSAPI
  2.4731 +NTSTATUS
  2.4732 +DDKAPI
  2.4733 +RtlInvertRangeList(
  2.4734 +  /*OUT*/ PRTL_RANGE_LIST  InvertedRangeList,
  2.4735 +  /*IN*/ PRTL_RANGE_LIST  RangeList);
  2.4736 +
  2.4737 +NTOSAPI
  2.4738 +NTSTATUS
  2.4739 +DDKAPI
  2.4740 +RtlIsRangeAvailable(
  2.4741 +  /*IN*/ PRTL_RANGE_LIST  RangeList,
  2.4742 +  /*IN*/ ULONGLONG  Start,
  2.4743 +  /*IN*/ ULONGLONG  End,
  2.4744 +  /*IN*/ ULONG  Flags,
  2.4745 +  /*IN*/ UCHAR  AttributeAvailableMask,
  2.4746 +  /*IN*/ PVOID  Context  /*OPTIONAL*/,
  2.4747 +  /*IN*/ PRTL_CONFLICT_RANGE_CALLBACK  Callback  /*OPTIONAL*/,
  2.4748 +  /*OUT*/ PBOOLEAN  Available);
  2.4749 +
  2.4750 +/*
  2.4751 + * BOOLEAN
  2.4752 + * RtlIsZeroLuid(
  2.4753 + * IN PLUID  L1)
  2.4754 + */
  2.4755 +#define RtlIsZeroLuid(_L1) \
  2.4756 +  ((BOOLEAN) ((!(_L1)->LowPart) && (!(_L1)->HighPart)))
  2.4757 +
  2.4758 +NTOSAPI
  2.4759 +ULONG
  2.4760 +DDKAPI
  2.4761 +RtlLengthSecurityDescriptor(
  2.4762 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor);
  2.4763 +
  2.4764 +NTOSAPI
  2.4765 +VOID
  2.4766 +DDKAPI
  2.4767 +RtlMapGenericMask(
  2.4768 +  /*IN OUT*/ PACCESS_MASK  AccessMask,
  2.4769 +  /*IN*/ PGENERIC_MAPPING  GenericMapping);
  2.4770 +
  2.4771 +NTOSAPI
  2.4772 +NTSTATUS
  2.4773 +DDKAPI
  2.4774 +RtlMergeRangeLists(
  2.4775 +  /*OUT*/ PRTL_RANGE_LIST  MergedRangeList,
  2.4776 +  /*IN*/ PRTL_RANGE_LIST  RangeList1,
  2.4777 +  /*IN*/ PRTL_RANGE_LIST  RangeList2,
  2.4778 +  /*IN*/ ULONG  Flags);
  2.4779 +
  2.4780 +/*
  2.4781 + * VOID
  2.4782 + * RtlMoveMemory(
  2.4783 + * IN VOID UNALIGNED  *Destination,
  2.4784 + * IN CONST VOID UNALIGNED  *Source,
  2.4785 + * IN SIZE_T  Length)
  2.4786 + */
  2.4787 +#define RtlMoveMemory memmove
  2.4788 +
  2.4789 +NTOSAPI
  2.4790 +ULONG
  2.4791 +DDKAPI
  2.4792 +RtlNumberOfClearBits(
  2.4793 +  /*IN*/ PRTL_BITMAP  BitMapHeader);
  2.4794 +
  2.4795 +NTOSAPI
  2.4796 +ULONG
  2.4797 +DDKAPI
  2.4798 +RtlNumberOfSetBits(
  2.4799 +  /*IN*/ PRTL_BITMAP  BitMapHeader); 
  2.4800 +
  2.4801 +NTOSAPI
  2.4802 +VOID
  2.4803 +DDKFASTAPI
  2.4804 +RtlPrefetchMemoryNonTemporal(
  2.4805 +  /*IN*/ PVOID  Source,
  2.4806 +  /*IN*/ SIZE_T  Length);
  2.4807 +
  2.4808 +NTOSAPI
  2.4809 +BOOLEAN
  2.4810 +DDKAPI
  2.4811 +RtlPrefixUnicodeString( 
  2.4812 +  /*IN*/ PUNICODE_STRING  String1, 
  2.4813 +  /*IN*/ PUNICODE_STRING  String2, 
  2.4814 +  /*IN*/ BOOLEAN  CaseInSensitive);
  2.4815 +
  2.4816 +NTOSAPI
  2.4817 +NTSTATUS
  2.4818 +DDKAPI
  2.4819 +RtlQueryRegistryValues(
  2.4820 +  /*IN*/ ULONG  RelativeTo,
  2.4821 +  /*IN*/ PCWSTR  Path,
  2.4822 +  /*IN*/ PRTL_QUERY_REGISTRY_TABLE  QueryTable,
  2.4823 +  /*IN*/ PVOID  Context,
  2.4824 +  /*IN*/ PVOID  Environment  /*OPTIONAL*/);
  2.4825 +
  2.4826 +NTOSAPI
  2.4827 +VOID
  2.4828 +DDKAPI
  2.4829 +RtlRetrieveUlong(
  2.4830 +  /*IN OUT*/ PULONG  DestinationAddress,
  2.4831 +  /*IN*/ PULONG  SourceAddress);
  2.4832 +
  2.4833 +NTOSAPI
  2.4834 +VOID
  2.4835 +DDKAPI
  2.4836 +RtlRetrieveUshort(
  2.4837 +  /*IN OUT*/ PUSHORT  DestinationAddress,
  2.4838 +  /*IN*/ PUSHORT  SourceAddress);
  2.4839 +
  2.4840 +NTOSAPI
  2.4841 +VOID
  2.4842 +DDKAPI
  2.4843 +RtlSetAllBits(
  2.4844 +  /*IN*/ PRTL_BITMAP  BitMapHeader); 
  2.4845 +
  2.4846 +NTOSAPI
  2.4847 +VOID
  2.4848 +DDKAPI
  2.4849 +RtlSetBit(
  2.4850 +  PRTL_BITMAP  BitMapHeader,
  2.4851 +  ULONG  BitNumber);
  2.4852 +
  2.4853 +NTOSAPI
  2.4854 +VOID
  2.4855 +DDKAPI
  2.4856 +RtlSetBits(
  2.4857 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4858 +  /*IN*/ ULONG  StartingIndex,
  2.4859 +  /*IN*/ ULONG  NumberToSet); 
  2.4860 +
  2.4861 +NTOSAPI
  2.4862 +NTSTATUS
  2.4863 +DDKAPI
  2.4864 +RtlSetDaclSecurityDescriptor(
  2.4865 +  /*IN OUT*/ PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.4866 +  /*IN*/ BOOLEAN  DaclPresent,
  2.4867 +  /*IN*/ PACL  Dacl  /*OPTIONAL*/,
  2.4868 +  /*IN*/ BOOLEAN  DaclDefaulted  /*OPTIONAL*/);
  2.4869 +
  2.4870 +NTOSAPI
  2.4871 +VOID
  2.4872 +DDKAPI
  2.4873 +RtlStoreUlong(
  2.4874 +  /*IN*/ PULONG  Address,
  2.4875 +  /*IN*/ ULONG  Value);
  2.4876 +
  2.4877 +NTOSAPI
  2.4878 +VOID
  2.4879 +DDKAPI
  2.4880 +RtlStoreUlonglong(
  2.4881 +  /*IN OUT*/ PULONGLONG  Address,
  2.4882 +  ULONGLONG  Value);
  2.4883 +
  2.4884 +NTOSAPI
  2.4885 +VOID
  2.4886 +DDKAPI
  2.4887 +RtlStoreUlongPtr(
  2.4888 +  /*IN OUT*/ PULONG_PTR  Address,
  2.4889 +  /*IN*/ ULONG_PTR  Value);
  2.4890 +
  2.4891 +NTOSAPI
  2.4892 +VOID
  2.4893 +DDKAPI
  2.4894 +RtlStoreUshort(
  2.4895 +  /*IN*/ PUSHORT  Address,
  2.4896 +  /*IN*/ USHORT  Value);
  2.4897 +
  2.4898 +NTOSAPI
  2.4899 +NTSTATUS
  2.4900 +DDKAPI
  2.4901 +RtlStringFromGUID( 
  2.4902 +  /*IN*/ REFGUID  Guid, 
  2.4903 +  /*OUT*/ PUNICODE_STRING  GuidString);
  2.4904 +
  2.4905 +NTOSAPI
  2.4906 +BOOLEAN
  2.4907 +DDKAPI
  2.4908 +RtlTestBit(
  2.4909 +  /*IN*/ PRTL_BITMAP  BitMapHeader,
  2.4910 +  /*IN*/ ULONG  BitNumber);
  2.4911 +
  2.4912 +NTOSAPI
  2.4913 +BOOLEAN
  2.4914 +DDKAPI
  2.4915 +RtlTimeFieldsToTime(
  2.4916 +  /*IN*/ PTIME_FIELDS  TimeFields,
  2.4917 +  /*IN*/ PLARGE_INTEGER  Time);
  2.4918 +
  2.4919 +NTOSAPI
  2.4920 +VOID
  2.4921 +DDKAPI
  2.4922 +RtlTimeToTimeFields(
  2.4923 +  /*IN*/ PLARGE_INTEGER  Time,
  2.4924 +  /*IN*/ PTIME_FIELDS  TimeFields);
  2.4925 +
  2.4926 +NTOSAPI
  2.4927 +ULONG
  2.4928 +DDKFASTAPI
  2.4929 +RtlUlongByteSwap(
  2.4930 +  /*IN*/ ULONG  Source);
  2.4931 +
  2.4932 +NTOSAPI
  2.4933 +ULONGLONG
  2.4934 +DDKFASTAPI
  2.4935 +RtlUlonglongByteSwap(
  2.4936 +  /*IN*/ ULONGLONG  Source);
  2.4937 +
  2.4938 +NTOSAPI
  2.4939 +ULONG
  2.4940 +DDKAPI
  2.4941 +RtlUnicodeStringToAnsiSize(
  2.4942 +  /*IN*/ PUNICODE_STRING  UnicodeString);
  2.4943 +
  2.4944 +NTOSAPI
  2.4945 +NTSTATUS
  2.4946 +DDKAPI
  2.4947 +RtlUnicodeStringToAnsiString(
  2.4948 +  /*IN OUT*/ PANSI_STRING  DestinationString,
  2.4949 +  /*IN*/ PUNICODE_STRING  SourceString,
  2.4950 +  /*IN*/ BOOLEAN  AllocateDestinationString);
  2.4951 +
  2.4952 +NTOSAPI
  2.4953 +NTSTATUS
  2.4954 +DDKAPI
  2.4955 +RtlUnicodeStringToInteger(
  2.4956 +  /*IN*/ PUNICODE_STRING  String,
  2.4957 +  /*IN*/ ULONG  Base  /*OPTIONAL*/,
  2.4958 +  /*OUT*/ PULONG  Value);
  2.4959 +
  2.4960 +NTOSAPI
  2.4961 +WCHAR
  2.4962 +DDKAPI
  2.4963 +RtlUpcaseUnicodeChar( 
  2.4964 +  /*IN*/ WCHAR  SourceCharacter);
  2.4965 +
  2.4966 +NTOSAPI
  2.4967 +NTSTATUS
  2.4968 +DDKAPI
  2.4969 +RtlUpcaseUnicodeString(
  2.4970 +  /*IN OUT*/ PUNICODE_STRING  DestinationString  /*OPTIONAL*/,
  2.4971 +  /*IN*/ PCUNICODE_STRING  SourceString,
  2.4972 +  /*IN*/ BOOLEAN  AllocateDestinationString);
  2.4973 +
  2.4974 +NTOSAPI
  2.4975 +CHAR
  2.4976 +DDKAPI
  2.4977 +RtlUpperChar( 
  2.4978 +  /*IN*/ CHAR Character);
  2.4979 +
  2.4980 +NTOSAPI
  2.4981 +VOID
  2.4982 +DDKAPI
  2.4983 +RtlUpperString(
  2.4984 +  /*IN OUT*/ PSTRING  DestinationString,
  2.4985 +  /*IN*/ PSTRING  SourceString);
  2.4986 +
  2.4987 +NTOSAPI
  2.4988 +USHORT
  2.4989 +DDKFASTAPI
  2.4990 +RtlUshortByteSwap(
  2.4991 +  /*IN*/ USHORT  Source);
  2.4992 +
  2.4993 +NTOSAPI
  2.4994 +BOOLEAN
  2.4995 +DDKAPI
  2.4996 +RtlValidRelativeSecurityDescriptor(
  2.4997 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptorInput,
  2.4998 +  /*IN*/ ULONG  SecurityDescriptorLength,
  2.4999 +  /*IN*/ SECURITY_INFORMATION  RequiredInformation);
  2.5000 +
  2.5001 +NTOSAPI
  2.5002 +BOOLEAN
  2.5003 +DDKAPI
  2.5004 +RtlValidSecurityDescriptor(
  2.5005 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor);
  2.5006 +
  2.5007 +NTOSAPI
  2.5008 +NTSTATUS
  2.5009 +DDKAPI
  2.5010 +RtlVerifyVersionInfo(
  2.5011 +  /*IN*/ PRTL_OSVERSIONINFOEXW  VersionInfo,
  2.5012 +  /*IN*/ ULONG  TypeMask,
  2.5013 +  /*IN*/ ULONGLONG  ConditionMask);
  2.5014 +
  2.5015 +NTOSAPI
  2.5016 +NTSTATUS
  2.5017 +DDKAPI
  2.5018 +RtlVolumeDeviceToDosName(
  2.5019 +  /*IN*/ PVOID  VolumeDeviceObject,
  2.5020 +  /*OUT*/ PUNICODE_STRING  DosName);
  2.5021 +
  2.5022 +NTOSAPI
  2.5023 +ULONG
  2.5024 +DDKAPI
  2.5025 +RtlWalkFrameChain(
  2.5026 +  /*OUT*/ PVOID  *Callers,
  2.5027 +  /*IN*/ ULONG  Count,
  2.5028 +  /*IN*/ ULONG  Flags);
  2.5029 +
  2.5030 +NTOSAPI
  2.5031 +NTSTATUS
  2.5032 +DDKAPI
  2.5033 +RtlWriteRegistryValue(
  2.5034 +  /*IN*/ ULONG  RelativeTo,
  2.5035 +  /*IN*/ PCWSTR  Path,
  2.5036 +  /*IN*/ PCWSTR  ValueName,
  2.5037 +  /*IN*/ ULONG  ValueType,
  2.5038 +  /*IN*/ PVOID  ValueData,
  2.5039 +  /*IN*/ ULONG  ValueLength);
  2.5040 +
  2.5041 +NTOSAPI
  2.5042 +ULONG
  2.5043 +DDKAPI
  2.5044 +RtlxUnicodeStringToAnsiSize(
  2.5045 +  /*IN*/ PUNICODE_STRING  UnicodeString);
  2.5046 +
  2.5047 +/*
  2.5048 + * VOID
  2.5049 + * RtlZeroMemory(
  2.5050 + * IN VOID UNALIGNED  *Destination,
  2.5051 + * IN SIZE_T  Length)
  2.5052 + */
  2.5053 +#ifndef RtlZeroMemory
  2.5054 +#define RtlZeroMemory(Destination, Length) \
  2.5055 +  memset(Destination, 0, Length)
  2.5056 +#endif
  2.5057 +
  2.5058 +#ifndef RtlZeroBytes
  2.5059 +#define RtlZeroBytes RtlZeroMemory
  2.5060 +#endif
  2.5061 +
  2.5062 +
  2.5063 +/** Executive support routines **/
  2.5064 +
  2.5065 +NTOSAPI
  2.5066 +VOID
  2.5067 +DDKFASTAPI
  2.5068 +ExAcquireFastMutex(
  2.5069 +  /*IN*/ PFAST_MUTEX  FastMutex);
  2.5070 +
  2.5071 +NTOSAPI
  2.5072 +VOID
  2.5073 +DDKFASTAPI
  2.5074 +ExAcquireFastMutexUnsafe(
  2.5075 +  /*IN*/ PFAST_MUTEX  FastMutex);
  2.5076 +
  2.5077 +NTOSAPI
  2.5078 +BOOLEAN
  2.5079 +DDKAPI
  2.5080 +ExAcquireResourceExclusiveLite(
  2.5081 +  /*IN*/ PERESOURCE  Resource,
  2.5082 +  /*IN*/ BOOLEAN  Wait);
  2.5083 +
  2.5084 +NTOSAPI
  2.5085 +BOOLEAN
  2.5086 +DDKAPI
  2.5087 +ExAcquireResourceSharedLite(
  2.5088 +  /*IN*/ PERESOURCE  Resource,
  2.5089 +  /*IN*/ BOOLEAN  Wait);
  2.5090 +
  2.5091 +NTOSAPI
  2.5092 +BOOLEAN
  2.5093 +DDKAPI
  2.5094 +ExAcquireSharedStarveExclusive(
  2.5095 +  /*IN*/ PERESOURCE  Resource,
  2.5096 +  /*IN*/ BOOLEAN  Wait);
  2.5097 +
  2.5098 +NTOSAPI
  2.5099 +BOOLEAN
  2.5100 +DDKAPI
  2.5101 +ExAcquireSharedWaitForExclusive(
  2.5102 +  /*IN*/ PERESOURCE  Resource,
  2.5103 +  /*IN*/ BOOLEAN  Wait);
  2.5104 +
  2.5105 +
  2.5106 +NTOSAPI
  2.5107 +PSINGLE_LIST_ENTRY
  2.5108 +DDKFASTAPI
  2.5109 +ExInterlockedPopEntrySList(
  2.5110 +  /*IN*/ PSLIST_HEADER  ListHead,
  2.5111 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5112 +
  2.5113 +
  2.5114 +NTOSAPI
  2.5115 +PSINGLE_LIST_ENTRY
  2.5116 +DDKFASTAPI
  2.5117 +ExInterlockedPushEntrySList(
  2.5118 +  /*IN*/ PSLIST_HEADER  ListHead,
  2.5119 +  /*IN*/ PSINGLE_LIST_ENTRY  ListEntry,
  2.5120 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5121 +
  2.5122 +
  2.5123 +#if (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501)
  2.5124 +#define ExInterlockedPopEntrySList(_ListHead, \
  2.5125 +                                   _Lock) \
  2.5126 +  InterlockedPopEntrySList(_ListHead)
  2.5127 +
  2.5128 +#define ExInterlockedPushEntrySList(_ListHead, \
  2.5129 +                                    _ListEntry, \
  2.5130 +                                    _Lock) \
  2.5131 +  InterlockedPushEntrySList(_ListHead, _ListEntry)
  2.5132 +#endif /*  __USE_NTOSKRNL__ */
  2.5133 +
  2.5134 +#define ExQueryDepthSList(ListHead) QueryDepthSList(ListHead)
  2.5135 +
  2.5136 +static __inline PVOID
  2.5137 +ExAllocateFromNPagedLookasideList(
  2.5138 +  /*IN*/ PNPAGED_LOOKASIDE_LIST  Lookaside)
  2.5139 +{
  2.5140 +  PVOID Entry;
  2.5141 +
  2.5142 +  Lookaside->TotalAllocates++;
  2.5143 +  Entry = ExInterlockedPopEntrySList(&Lookaside->ListHead,
  2.5144 +				     &Lookaside->Obsoleted);
  2.5145 +  if (Entry == NULL) {
  2.5146 +    Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++;
  2.5147 +    Entry = (Lookaside->Allocate)(Lookaside->Type,
  2.5148 +				  Lookaside->Size,
  2.5149 +				  Lookaside->Tag);
  2.5150 +  }
  2.5151 +  return Entry;
  2.5152 +}
  2.5153 +
  2.5154 +static __inline VOID
  2.5155 +ExFreeToNPagedLookasideList(
  2.5156 +  /*IN*/ PNPAGED_LOOKASIDE_LIST  Lookaside,
  2.5157 +  /*IN*/ PVOID  Entry)
  2.5158 +{
  2.5159 +  Lookaside->TotalFrees++;
  2.5160 +  if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) {
  2.5161 +    Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++;
  2.5162 +    (Lookaside->Free)(Entry);
  2.5163 +  } else {
  2.5164 +    ExInterlockedPushEntrySList(&Lookaside->ListHead,
  2.5165 +				(PSLIST_ENTRY)Entry,
  2.5166 +				&Lookaside->Obsoleted);
  2.5167 +  }
  2.5168 +}
  2.5169 +
  2.5170 +#if (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501)
  2.5171 +
  2.5172 +static __inline PVOID
  2.5173 +ExAllocateFromPagedLookasideList(
  2.5174 +  /*IN*/ PPAGED_LOOKASIDE_LIST  Lookaside)
  2.5175 +{
  2.5176 +  PVOID Entry;
  2.5177 +
  2.5178 +  Lookaside->TotalAllocates++;
  2.5179 +  Entry = InterlockedPopEntrySList(&Lookaside->ListHead);
  2.5180 +  if (Entry == NULL) {
  2.5181 +    Lookaside->_DDK_DUMMYUNION_MEMBER(AllocateMisses)++;
  2.5182 +    Entry = (Lookaside->Allocate)(Lookaside->Type,
  2.5183 +				  Lookaside->Size,
  2.5184 +				  Lookaside->Tag);
  2.5185 +  }
  2.5186 +  return Entry;
  2.5187 +}
  2.5188 +
  2.5189 +static __inline VOID
  2.5190 +ExFreeToPagedLookasideList(
  2.5191 +  /*IN*/ PPAGED_LOOKASIDE_LIST  Lookaside,
  2.5192 +  /*IN*/ PVOID  Entry)
  2.5193 +{
  2.5194 +  Lookaside->TotalFrees++;
  2.5195 +  if (ExQueryDepthSList(&Lookaside->ListHead) >= Lookaside->Depth) {
  2.5196 +    Lookaside->_DDK_DUMMYUNION_N_MEMBER(2,FreeMisses)++;
  2.5197 +    (Lookaside->Free)(Entry);
  2.5198 +  } else {
  2.5199 +    InterlockedPushEntrySList(&Lookaside->ListHead,
  2.5200 +			      (PSLIST_ENTRY)Entry);
  2.5201 +  }
  2.5202 +}
  2.5203 +
  2.5204 +#else /* (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501) */
  2.5205 +
  2.5206 +NTOSAPI
  2.5207 +PVOID
  2.5208 +DDKAPI
  2.5209 +ExAllocateFromPagedLookasideList(
  2.5210 +  /*IN*/ PPAGED_LOOKASIDE_LIST  Lookaside);
  2.5211 +
  2.5212 +NTOSAPI
  2.5213 +VOID
  2.5214 +DDKAPI
  2.5215 +ExFreeToPagedLookasideList(
  2.5216 +  /*IN*/ PPAGED_LOOKASIDE_LIST  Lookaside,
  2.5217 +  /*IN*/ PVOID  Entry);
  2.5218 +
  2.5219 +#endif /* (__USE_NTOSKRNL__) && (_WIN32_WINNT >= 0x0501) */
  2.5220 +
  2.5221 +NTOSAPI
  2.5222 +PVOID
  2.5223 +DDKAPI
  2.5224 +ExAllocatePoolWithQuotaTag(
  2.5225 +  /*IN*/ POOL_TYPE  PoolType,
  2.5226 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.5227 +  /*IN*/ ULONG  Tag);
  2.5228 +
  2.5229 +NTOSAPI
  2.5230 +PVOID
  2.5231 +DDKAPI
  2.5232 +ExAllocatePoolWithTag(
  2.5233 +  /*IN*/ POOL_TYPE  PoolType,
  2.5234 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.5235 +  /*IN*/ ULONG  Tag);
  2.5236 +
  2.5237 +#ifdef POOL_TAGGING
  2.5238 +
  2.5239 +#define ExAllocatePoolWithQuota(p,n) ExAllocatePoolWithQuotaTag(p,n,' kdD')
  2.5240 +#define ExAllocatePool(p,n) ExAllocatePoolWithTag(p,n,' kdD')
  2.5241 +
  2.5242 +#else /* !POOL_TAGGING */
  2.5243 +
  2.5244 +NTOSAPI
  2.5245 +PVOID
  2.5246 +DDKAPI
  2.5247 +ExAllocatePool(
  2.5248 +  /*IN*/ POOL_TYPE  PoolType,
  2.5249 +  /*IN*/ SIZE_T  NumberOfBytes);
  2.5250 +
  2.5251 +NTOSAPI
  2.5252 +PVOID
  2.5253 +DDKAPI
  2.5254 +ExAllocatePoolWithQuota(
  2.5255 +  /*IN*/ POOL_TYPE  PoolType,
  2.5256 +  /*IN*/ SIZE_T  NumberOfBytes);
  2.5257 +
  2.5258 +#endif /* POOL_TAGGING */
  2.5259 +
  2.5260 +NTOSAPI
  2.5261 +PVOID
  2.5262 +DDKAPI
  2.5263 +ExAllocatePoolWithTagPriority(
  2.5264 +  /*IN*/ POOL_TYPE  PoolType,
  2.5265 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.5266 +  /*IN*/ ULONG  Tag,
  2.5267 +  /*IN*/ EX_POOL_PRIORITY  Priority);
  2.5268 +
  2.5269 +NTOSAPI
  2.5270 +VOID
  2.5271 +DDKAPI
  2.5272 +ExConvertExclusiveToSharedLite(
  2.5273 +  /*IN*/ PERESOURCE  Resource);
  2.5274 +
  2.5275 +NTOSAPI
  2.5276 +NTSTATUS
  2.5277 +DDKAPI
  2.5278 +ExCreateCallback(
  2.5279 +  /*OUT*/ PCALLBACK_OBJECT  *CallbackObject,
  2.5280 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.5281 +  /*IN*/ BOOLEAN  Create,
  2.5282 +  /*IN*/ BOOLEAN  AllowMultipleCallbacks);
  2.5283 +
  2.5284 +NTOSAPI
  2.5285 +VOID
  2.5286 +DDKAPI
  2.5287 +ExDeleteNPagedLookasideList(
  2.5288 +  /*IN*/ PNPAGED_LOOKASIDE_LIST  Lookaside);
  2.5289 +
  2.5290 +NTOSAPI
  2.5291 +VOID
  2.5292 +DDKAPI
  2.5293 +ExDeletePagedLookasideList(
  2.5294 +  /*IN*/ PPAGED_LOOKASIDE_LIST  Lookaside);
  2.5295 +
  2.5296 +NTOSAPI
  2.5297 +NTSTATUS
  2.5298 +DDKAPI
  2.5299 +ExDeleteResourceLite(
  2.5300 +  /*IN*/ PERESOURCE  Resource);
  2.5301 +
  2.5302 +NTOSAPI
  2.5303 +VOID
  2.5304 +DDKAPI
  2.5305 +ExFreePool(
  2.5306 +  /*IN*/ PVOID  P);
  2.5307 +
  2.5308 +#define PROTECTED_POOL                    0x80000000
  2.5309 +
  2.5310 +#ifdef POOL_TAGGING
  2.5311 +#define ExFreePool(P) ExFreePoolWithTag(P, 0)
  2.5312 +#endif
  2.5313 +
  2.5314 +NTOSAPI
  2.5315 +VOID
  2.5316 +DDKAPI
  2.5317 +ExFreePoolWithTag(
  2.5318 +  /*IN*/ PVOID  P,
  2.5319 +  /*IN*/ ULONG  Tag);
  2.5320 +
  2.5321 +/*
  2.5322 + * ERESOURCE_THREAD
  2.5323 + * ExGetCurrentResourceThread(
  2.5324 + *   VOID);
  2.5325 + */
  2.5326 +#define ExGetCurrentResourceThread() ((ERESOURCE_THREAD) PsGetCurrentThread())
  2.5327 +
  2.5328 +NTOSAPI
  2.5329 +ULONG
  2.5330 +DDKAPI
  2.5331 +ExGetExclusiveWaiterCount(
  2.5332 +  /*IN*/ PERESOURCE  Resource);
  2.5333 +
  2.5334 +NTOSAPI
  2.5335 +KPROCESSOR_MODE
  2.5336 +DDKAPI
  2.5337 +ExGetPreviousMode( 
  2.5338 +  VOID);
  2.5339 +
  2.5340 +NTOSAPI
  2.5341 +ULONG
  2.5342 +DDKAPI
  2.5343 +ExGetSharedWaiterCount(
  2.5344 +  /*IN*/ PERESOURCE  Resource);
  2.5345 +
  2.5346 +NTOSAPI
  2.5347 +VOID
  2.5348 +DDKAPI
  2.5349 +KeInitializeEvent(
  2.5350 +  /*IN*/ PRKEVENT  Event,
  2.5351 +  /*IN*/ EVENT_TYPE  Type,
  2.5352 +  /*IN*/ BOOLEAN  State);
  2.5353 +
  2.5354 +/*
  2.5355 + * VOID DDKAPI
  2.5356 + * ExInitializeFastMutex(
  2.5357 + * IN PFAST_MUTEX  FastMutex)
  2.5358 + */
  2.5359 +#define ExInitializeFastMutex(_FastMutex) \
  2.5360 +{ \
  2.5361 +  (_FastMutex)->Count = 1; \
  2.5362 +  (_FastMutex)->Owner = NULL; \
  2.5363 +  (_FastMutex)->Contention = 0; \
  2.5364 +  KeInitializeEvent(&(_FastMutex)->Event, SynchronizationEvent, FALSE); \
  2.5365 +}
  2.5366 +
  2.5367 +NTOSAPI
  2.5368 +VOID
  2.5369 +DDKAPI
  2.5370 +ExInitializeNPagedLookasideList(
  2.5371 +  /*IN*/ PNPAGED_LOOKASIDE_LIST  Lookaside,
  2.5372 +  /*IN*/ PALLOCATE_FUNCTION  Allocate  /*OPTIONAL*/,
  2.5373 +  /*IN*/ PFREE_FUNCTION  Free  /*OPTIONAL*/,
  2.5374 +  /*IN*/ ULONG  Flags,
  2.5375 +  /*IN*/ SIZE_T  Size,
  2.5376 +  /*IN*/ ULONG  Tag,
  2.5377 +  /*IN*/ USHORT  Depth);
  2.5378 +
  2.5379 +NTOSAPI
  2.5380 +VOID
  2.5381 +DDKAPI
  2.5382 +ExInitializePagedLookasideList(
  2.5383 +  /*IN*/ PPAGED_LOOKASIDE_LIST  Lookaside,
  2.5384 +  /*IN*/ PALLOCATE_FUNCTION  Allocate  /*OPTIONAL*/,
  2.5385 +  /*IN*/ PFREE_FUNCTION  Free  /*OPTIONAL*/,
  2.5386 +  /*IN*/ ULONG  Flags,
  2.5387 +  /*IN*/ SIZE_T  Size,
  2.5388 +  /*IN*/ ULONG  Tag,
  2.5389 +  /*IN*/ USHORT  Depth);
  2.5390 +
  2.5391 +NTOSAPI
  2.5392 +NTSTATUS
  2.5393 +DDKAPI
  2.5394 +ExInitializeResourceLite(
  2.5395 +  /*IN*/ PERESOURCE  Resource);
  2.5396 +
  2.5397 +/*
  2.5398 + * VOID
  2.5399 + * InitializeSListHead(
  2.5400 + * IN PSLIST_HEADER  SListHead)
  2.5401 + */
  2.5402 +#define InitializeSListHead(_SListHead) \
  2.5403 +	(_SListHead)->Alignment = 0
  2.5404 +
  2.5405 +#define ExInitializeSListHead InitializeSListHead
  2.5406 +
  2.5407 +NTOSAPI
  2.5408 +LARGE_INTEGER
  2.5409 +DDKAPI
  2.5410 +ExInterlockedAddLargeInteger(
  2.5411 +  /*IN*/ PLARGE_INTEGER  Addend,
  2.5412 +  /*IN*/ LARGE_INTEGER  Increment,
  2.5413 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5414 +
  2.5415 +NTOSAPI
  2.5416 +VOID
  2.5417 +DDKFASTAPI
  2.5418 +ExInterlockedAddLargeStatistic(
  2.5419 +  /*IN*/ PLARGE_INTEGER  Addend,
  2.5420 +  /*IN*/ ULONG  Increment);
  2.5421 +
  2.5422 +NTOSAPI
  2.5423 +ULONG
  2.5424 +DDKAPI
  2.5425 +ExInterlockedAddUlong(
  2.5426 +  /*IN*/ PULONG  Addend,
  2.5427 +  /*IN*/ ULONG  Increment,
  2.5428 +  PKSPIN_LOCK  Lock);
  2.5429 +
  2.5430 +NTOSAPI
  2.5431 +ULONG
  2.5432 +DDKFASTAPI
  2.5433 +ExfInterlockedAddUlong(
  2.5434 +  /*IN*/ PULONG  Addend,
  2.5435 +  /*IN*/ ULONG  Increment,
  2.5436 +  PKSPIN_LOCK  Lock);
  2.5437 +
  2.5438 +
  2.5439 +NTOSAPI
  2.5440 +LONGLONG
  2.5441 +DDKFASTAPI
  2.5442 +ExInterlockedCompareExchange64(
  2.5443 +  /*IN OUT*/ PLONGLONG  Destination,
  2.5444 +  /*IN*/ PLONGLONG  Exchange,
  2.5445 +  /*IN*/ PLONGLONG  Comparand,
  2.5446 +  /*IN*/ PKSPIN_LOCK  Lock); 
  2.5447 +
  2.5448 +NTOSAPI
  2.5449 +PSINGLE_LIST_ENTRY
  2.5450 +DDKFASTAPI
  2.5451 +ExInterlockedFlushSList(
  2.5452 +  /*IN*/ PSLIST_HEADER  ListHead);
  2.5453 +
  2.5454 +NTOSAPI
  2.5455 +PLIST_ENTRY
  2.5456 +DDKAPI
  2.5457 +ExInterlockedInsertHeadList(
  2.5458 +  /*IN*/ PLIST_ENTRY  ListHead,
  2.5459 +  /*IN*/ PLIST_ENTRY  ListEntry,
  2.5460 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5461 +
  2.5462 +NTOSAPI
  2.5463 +PLIST_ENTRY
  2.5464 +DDKFASTAPI
  2.5465 +ExfInterlockedInsertHeadList(
  2.5466 +  /*IN*/ PLIST_ENTRY  ListHead,
  2.5467 +  /*IN*/ PLIST_ENTRY  ListEntry,
  2.5468 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5469 +
  2.5470 +NTOSAPI
  2.5471 +PLIST_ENTRY
  2.5472 +DDKAPI
  2.5473 +ExInterlockedInsertTailList(
  2.5474 +  /*IN*/ PLIST_ENTRY  ListHead,
  2.5475 +  /*IN*/ PLIST_ENTRY  ListEntry,
  2.5476 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5477 +
  2.5478 +NTOSAPI
  2.5479 +PLIST_ENTRY
  2.5480 +DDKFASTAPI
  2.5481 +ExfInterlockedInsertTailList(
  2.5482 +  /*IN*/ PLIST_ENTRY  ListHead,
  2.5483 +  /*IN*/ PLIST_ENTRY  ListEntry,
  2.5484 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5485 +
  2.5486 +NTOSAPI
  2.5487 +PSINGLE_LIST_ENTRY
  2.5488 +DDKAPI
  2.5489 +ExInterlockedPopEntryList(
  2.5490 +  /*IN*/ PSINGLE_LIST_ENTRY  ListHead,
  2.5491 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5492 +
  2.5493 +NTOSAPI
  2.5494 +PSINGLE_LIST_ENTRY
  2.5495 +DDKFASTAPI
  2.5496 +ExfInterlockedPopEntryList(
  2.5497 +  /*IN*/ PSINGLE_LIST_ENTRY  ListHead,
  2.5498 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5499 +
  2.5500 +
  2.5501 +NTOSAPI
  2.5502 +PSINGLE_LIST_ENTRY
  2.5503 +DDKAPI
  2.5504 +ExInterlockedPushEntryList(
  2.5505 +  /*IN*/ PSINGLE_LIST_ENTRY  ListHead,
  2.5506 +  /*IN*/ PSINGLE_LIST_ENTRY  ListEntry,
  2.5507 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5508 +
  2.5509 +NTOSAPI
  2.5510 +PSINGLE_LIST_ENTRY
  2.5511 +DDKFASTAPI
  2.5512 +ExfInterlockedPushEntryList(
  2.5513 +  /*IN*/ PSINGLE_LIST_ENTRY  ListHead,
  2.5514 +  /*IN*/ PSINGLE_LIST_ENTRY  ListEntry,
  2.5515 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5516 +
  2.5517 +
  2.5518 +NTOSAPI
  2.5519 +PLIST_ENTRY
  2.5520 +DDKAPI
  2.5521 +ExInterlockedRemoveHeadList(
  2.5522 +  /*IN*/ PLIST_ENTRY  ListHead,
  2.5523 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5524 +
  2.5525 +NTOSAPI
  2.5526 +PLIST_ENTRY
  2.5527 +DDKFASTAPI
  2.5528 +ExfInterlockedRemoveHeadList(
  2.5529 +  /*IN*/ PLIST_ENTRY  ListHead,
  2.5530 +  /*IN*/ PKSPIN_LOCK  Lock);
  2.5531 +
  2.5532 +
  2.5533 +NTOSAPI
  2.5534 +BOOLEAN
  2.5535 +DDKAPI
  2.5536 +ExIsProcessorFeaturePresent(
  2.5537 +  /*IN*/ ULONG  ProcessorFeature);
  2.5538 +
  2.5539 +NTOSAPI
  2.5540 +BOOLEAN
  2.5541 +DDKAPI
  2.5542 +ExIsResourceAcquiredExclusiveLite(
  2.5543 +  /*IN*/ PERESOURCE  Resource);
  2.5544 +
  2.5545 +NTOSAPI
  2.5546 +USHORT
  2.5547 +DDKAPI
  2.5548 +ExIsResourceAcquiredLite(
  2.5549 +  /*IN*/ PERESOURCE  Resource);
  2.5550 +
  2.5551 +NTOSAPI
  2.5552 +USHORT
  2.5553 +DDKAPI
  2.5554 +ExIsResourceAcquiredSharedLite(
  2.5555 +  /*IN*/ PERESOURCE  Resource);
  2.5556 +
  2.5557 +NTOSAPI
  2.5558 +VOID
  2.5559 +DDKAPI
  2.5560 +ExLocalTimeToSystemTime(
  2.5561 +  /*IN*/ PLARGE_INTEGER  LocalTime,
  2.5562 +  /*OUT*/ PLARGE_INTEGER  SystemTime);
  2.5563 +
  2.5564 +NTOSAPI
  2.5565 +VOID
  2.5566 +DDKAPI
  2.5567 +ExNotifyCallback(
  2.5568 +  /*IN*/ PCALLBACK_OBJECT  CallbackObject,
  2.5569 +  /*IN*/ PVOID  Argument1,
  2.5570 +  /*IN*/ PVOID  Argument2);
  2.5571 +
  2.5572 +NTOSAPI
  2.5573 +VOID
  2.5574 +DDKAPI
  2.5575 +ExRaiseAccessViolation(
  2.5576 +  VOID);
  2.5577 +
  2.5578 +NTOSAPI
  2.5579 +VOID
  2.5580 +DDKAPI
  2.5581 +ExRaiseDatatypeMisalignment(
  2.5582 +  VOID);
  2.5583 +
  2.5584 +NTOSAPI
  2.5585 +VOID
  2.5586 +DDKAPI
  2.5587 +ExRaiseStatus(
  2.5588 +  /*IN*/ NTSTATUS  Status);
  2.5589 +
  2.5590 +NTOSAPI
  2.5591 +PVOID
  2.5592 +DDKAPI
  2.5593 +ExRegisterCallback(
  2.5594 +  /*IN*/ PCALLBACK_OBJECT  CallbackObject,
  2.5595 +  /*IN*/ PCALLBACK_FUNCTION  CallbackFunction,
  2.5596 +  /*IN*/ PVOID  CallbackContext);
  2.5597 +
  2.5598 +NTOSAPI
  2.5599 +VOID
  2.5600 +DDKAPI
  2.5601 +ExReinitializeResourceLite(
  2.5602 +  /*IN*/ PERESOURCE  Resource);
  2.5603 +
  2.5604 +NTOSAPI
  2.5605 +VOID
  2.5606 +DDKFASTAPI
  2.5607 +ExReleaseFastMutex(
  2.5608 +  /*IN*/ PFAST_MUTEX  FastMutex);
  2.5609 +
  2.5610 +NTOSAPI
  2.5611 +VOID
  2.5612 +DDKFASTAPI
  2.5613 +ExReleaseFastMutexUnsafe(
  2.5614 +  /*IN*/ PFAST_MUTEX  FastMutex);
  2.5615 +
  2.5616 +NTOSAPI
  2.5617 +VOID
  2.5618 +DDKAPI
  2.5619 +ExReleaseResourceForThreadLite(
  2.5620 +  /*IN*/ PERESOURCE  Resource,
  2.5621 +  /*IN*/ ERESOURCE_THREAD  ResourceThreadId);
  2.5622 +
  2.5623 +NTOSAPI
  2.5624 +VOID
  2.5625 +DDKFASTAPI
  2.5626 +ExReleaseResourceLite(
  2.5627 +  /*IN*/ PERESOURCE  Resource);
  2.5628 +
  2.5629 +NTOSAPI
  2.5630 +VOID
  2.5631 +DDKAPI
  2.5632 +ExSetResourceOwnerPointer( 
  2.5633 +  /*IN*/ PERESOURCE  Resource,
  2.5634 +  /*IN*/ PVOID  OwnerPointer);
  2.5635 +
  2.5636 +NTOSAPI
  2.5637 +ULONG
  2.5638 +DDKAPI
  2.5639 +ExSetTimerResolution(
  2.5640 +  /*IN*/ ULONG  DesiredTime,
  2.5641 +  /*IN*/ BOOLEAN  SetResolution);
  2.5642 +
  2.5643 +NTOSAPI
  2.5644 +VOID
  2.5645 +DDKAPI
  2.5646 +ExSystemTimeToLocalTime(
  2.5647 +  /*IN*/ PLARGE_INTEGER  SystemTime,
  2.5648 +  /*OUT*/ PLARGE_INTEGER  LocalTime);
  2.5649 +
  2.5650 +NTOSAPI
  2.5651 +BOOLEAN
  2.5652 +DDKFASTAPI
  2.5653 +ExTryToAcquireFastMutex(
  2.5654 +  /*IN*/ PFAST_MUTEX  FastMutex);
  2.5655 +
  2.5656 +NTOSAPI
  2.5657 +BOOLEAN
  2.5658 +DDKAPI
  2.5659 +ExTryToAcquireResourceExclusiveLite(
  2.5660 +  /*IN*/ PERESOURCE  Resource);
  2.5661 +
  2.5662 +NTOSAPI
  2.5663 +VOID
  2.5664 +DDKAPI
  2.5665 +ExUnregisterCallback(
  2.5666 +  /*IN*/ PVOID  CbRegistration);
  2.5667 +
  2.5668 +NTOSAPI
  2.5669 +NTSTATUS
  2.5670 +DDKAPI
  2.5671 +ExUuidCreate(
  2.5672 +  /*OUT*/ UUID  *Uuid);
  2.5673 +
  2.5674 +NTOSAPI
  2.5675 +BOOLEAN
  2.5676 +DDKAPI
  2.5677 +ExVerifySuite(
  2.5678 +  /*IN*/ SUITE_TYPE  SuiteType);
  2.5679 +
  2.5680 +#ifdef DBG
  2.5681 +
  2.5682 +#define PAGED_CODE() { \
  2.5683 +  if (KeGetCurrentIrql() > APC_LEVEL) { \
  2.5684 +    KdPrint( ("NTDDK: Pageable code called at IRQL > APC_LEVEL (%d)\n", KeGetCurrentIrql() )); \
  2.5685 +    ASSERT(FALSE); \
  2.5686 +  } \
  2.5687 +}
  2.5688 +
  2.5689 +#else
  2.5690 +
  2.5691 +#define PAGED_CODE()
  2.5692 +
  2.5693 +#endif
  2.5694 +
  2.5695 +NTOSAPI
  2.5696 +VOID
  2.5697 +DDKAPI
  2.5698 +ProbeForRead(
  2.5699 +  /*IN*/ CONST VOID  *Address,
  2.5700 +  /*IN*/ ULONG  Length,
  2.5701 +  /*IN*/ ULONG  Alignment);
  2.5702 +
  2.5703 +NTOSAPI
  2.5704 +VOID
  2.5705 +DDKAPI
  2.5706 +ProbeForWrite(
  2.5707 +  /*IN*/ CONST VOID  *Address,
  2.5708 +  /*IN*/ ULONG  Length,
  2.5709 +  /*IN*/ ULONG  Alignment);
  2.5710 +
  2.5711 +
  2.5712 +
  2.5713 +/** Configuration manager routines **/
  2.5714 +
  2.5715 +NTOSAPI
  2.5716 +NTSTATUS
  2.5717 +DDKAPI
  2.5718 +CmRegisterCallback(
  2.5719 +  /*IN*/ PEX_CALLBACK_FUNCTION  Function,
  2.5720 +  /*IN*/ PVOID  Context,
  2.5721 +  /*IN OUT*/ PLARGE_INTEGER  Cookie);
  2.5722 +
  2.5723 +NTOSAPI
  2.5724 +NTSTATUS
  2.5725 +DDKAPI
  2.5726 +CmUnRegisterCallback(
  2.5727 +  /*IN*/ LARGE_INTEGER  Cookie);
  2.5728 +
  2.5729 +
  2.5730 +
  2.5731 +/** Filesystem runtime library routines **/
  2.5732 +
  2.5733 +NTOSAPI
  2.5734 +BOOLEAN
  2.5735 +DDKAPI
  2.5736 +FsRtlIsTotalDeviceFailure(
  2.5737 +  /*IN*/ NTSTATUS  Status);
  2.5738 +
  2.5739 +
  2.5740 +
  2.5741 +/** Hardware abstraction layer routines **/
  2.5742 +
  2.5743 +NTOSAPI
  2.5744 +VOID
  2.5745 +DDKFASTAPI
  2.5746 +HalExamineMBR(
  2.5747 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.5748 +  /*IN*/ ULONG  SectorSize,
  2.5749 +  /*IN*/ ULONG  MBRTypeIdentifier,
  2.5750 +  /*OUT*/ PVOID  Buffer);
  2.5751 +
  2.5752 +NTOSAPI
  2.5753 +VOID
  2.5754 +DDKAPI
  2.5755 +READ_PORT_BUFFER_UCHAR(
  2.5756 +  /*IN*/ PUCHAR  Port,
  2.5757 +  /*IN*/ PUCHAR  Buffer,
  2.5758 +  /*IN*/ ULONG  Count);
  2.5759 +
  2.5760 +NTOSAPI
  2.5761 +VOID
  2.5762 +DDKAPI
  2.5763 +READ_PORT_BUFFER_ULONG(
  2.5764 +  /*IN*/ PULONG  Port,
  2.5765 +  /*IN*/ PULONG  Buffer,
  2.5766 +  /*IN*/ ULONG  Count);
  2.5767 +
  2.5768 +NTOSAPI
  2.5769 +VOID
  2.5770 +DDKAPI
  2.5771 +READ_PORT_BUFFER_USHORT(
  2.5772 +  /*IN*/ PUSHORT  Port,
  2.5773 +  /*IN*/ PUSHORT  Buffer,
  2.5774 +  /*IN*/ ULONG  Count);
  2.5775 +
  2.5776 +NTOSAPI
  2.5777 +UCHAR
  2.5778 +DDKAPI
  2.5779 +READ_PORT_UCHAR(
  2.5780 +  /*IN*/ PUCHAR  Port);
  2.5781 +
  2.5782 +NTOSAPI
  2.5783 +ULONG
  2.5784 +DDKAPI
  2.5785 +READ_PORT_ULONG(
  2.5786 +  /*IN*/ PULONG  Port);
  2.5787 +
  2.5788 +NTOSAPI
  2.5789 +USHORT
  2.5790 +DDKAPI
  2.5791 +READ_PORT_USHORT(
  2.5792 +  /*IN*/ PUSHORT  Port);
  2.5793 +
  2.5794 +NTOSAPI
  2.5795 +VOID
  2.5796 +DDKAPI
  2.5797 +READ_REGISTER_BUFFER_UCHAR(
  2.5798 +  /*IN*/ PUCHAR  Register,
  2.5799 +  /*IN*/ PUCHAR  Buffer,
  2.5800 +  /*IN*/ ULONG  Count);
  2.5801 +
  2.5802 +NTOSAPI
  2.5803 +VOID
  2.5804 +DDKAPI
  2.5805 +READ_REGISTER_BUFFER_ULONG(
  2.5806 +  /*IN*/ PULONG  Register,
  2.5807 +  /*IN*/ PULONG  Buffer,
  2.5808 +  /*IN*/ ULONG  Count);
  2.5809 +
  2.5810 +NTOSAPI
  2.5811 +VOID
  2.5812 +DDKAPI
  2.5813 +READ_REGISTER_BUFFER_USHORT(
  2.5814 +  /*IN*/ PUSHORT  Register,
  2.5815 +  /*IN*/ PUSHORT  Buffer,
  2.5816 +  /*IN*/ ULONG  Count);
  2.5817 +
  2.5818 +NTOSAPI
  2.5819 +UCHAR
  2.5820 +DDKAPI
  2.5821 +READ_REGISTER_UCHAR(
  2.5822 +  /*IN*/ PUCHAR  Register);
  2.5823 +
  2.5824 +NTOSAPI
  2.5825 +ULONG
  2.5826 +DDKAPI
  2.5827 +READ_REGISTER_ULONG(
  2.5828 +  /*IN*/ PULONG  Register);
  2.5829 +
  2.5830 +NTOSAPI
  2.5831 +USHORT
  2.5832 +DDKAPI
  2.5833 +READ_REGISTER_USHORT(
  2.5834 +  /*IN*/ PUSHORT  Register);
  2.5835 +
  2.5836 +NTOSAPI
  2.5837 +VOID
  2.5838 +DDKAPI
  2.5839 +WRITE_PORT_BUFFER_UCHAR(
  2.5840 +  /*IN*/ PUCHAR  Port,
  2.5841 +  /*IN*/ PUCHAR  Buffer,
  2.5842 +  /*IN*/ ULONG  Count);
  2.5843 +
  2.5844 +NTOSAPI
  2.5845 +VOID
  2.5846 +DDKAPI
  2.5847 +WRITE_PORT_BUFFER_ULONG(
  2.5848 +  /*IN*/ PULONG  Port,
  2.5849 +  /*IN*/ PULONG  Buffer,
  2.5850 +  /*IN*/ ULONG  Count);
  2.5851 +
  2.5852 +NTOSAPI
  2.5853 +VOID
  2.5854 +DDKAPI
  2.5855 +WRITE_PORT_BUFFER_USHORT(
  2.5856 +  /*IN*/ PUSHORT  Port,
  2.5857 +  /*IN*/ PUSHORT  Buffer,
  2.5858 +  /*IN*/ ULONG  Count);
  2.5859 +
  2.5860 +NTOSAPI
  2.5861 +VOID
  2.5862 +DDKAPI
  2.5863 +WRITE_PORT_UCHAR(
  2.5864 +  /*IN*/ PUCHAR  Port,
  2.5865 +  /*IN*/ UCHAR  Value);
  2.5866 +
  2.5867 +NTOSAPI
  2.5868 +VOID
  2.5869 +DDKAPI
  2.5870 +WRITE_PORT_ULONG(
  2.5871 +  /*IN*/ PULONG  Port,
  2.5872 +  /*IN*/ ULONG  Value);
  2.5873 +
  2.5874 +NTOSAPI
  2.5875 +VOID
  2.5876 +DDKAPI
  2.5877 +WRITE_PORT_USHORT(
  2.5878 +  /*IN*/ PUSHORT  Port,
  2.5879 +  /*IN*/ USHORT  Value);
  2.5880 +
  2.5881 +NTOSAPI
  2.5882 +VOID
  2.5883 +DDKAPI
  2.5884 +WRITE_REGISTER_BUFFER_UCHAR(
  2.5885 +  /*IN*/ PUCHAR  Register,
  2.5886 +  /*IN*/ PUCHAR  Buffer,
  2.5887 +  /*IN*/ ULONG  Count);
  2.5888 +
  2.5889 +NTOSAPI
  2.5890 +VOID
  2.5891 +DDKAPI
  2.5892 +WRITE_REGISTER_BUFFER_ULONG(
  2.5893 +  /*IN*/ PULONG  Register,
  2.5894 +  /*IN*/ PULONG  Buffer,
  2.5895 +  /*IN*/ ULONG  Count);
  2.5896 +
  2.5897 +NTOSAPI
  2.5898 +VOID
  2.5899 +DDKAPI
  2.5900 +WRITE_REGISTER_BUFFER_USHORT(
  2.5901 +  /*IN*/ PUSHORT  Register,
  2.5902 +  /*IN*/ PUSHORT  Buffer,
  2.5903 +  /*IN*/ ULONG  Count);
  2.5904 +
  2.5905 +NTOSAPI
  2.5906 +VOID
  2.5907 +DDKAPI
  2.5908 +WRITE_REGISTER_UCHAR(
  2.5909 +  /*IN*/ PUCHAR  Register,
  2.5910 +  /*IN*/ UCHAR  Value);
  2.5911 +
  2.5912 +NTOSAPI
  2.5913 +VOID
  2.5914 +DDKAPI
  2.5915 +WRITE_REGISTER_ULONG(
  2.5916 +  /*IN*/ PULONG  Register,
  2.5917 +  /*IN*/ ULONG  Value);
  2.5918 +
  2.5919 +NTOSAPI
  2.5920 +VOID
  2.5921 +DDKAPI
  2.5922 +WRITE_REGISTER_USHORT(
  2.5923 +  /*IN*/ PUSHORT  Register,
  2.5924 +  /*IN*/ USHORT  Value);
  2.5925 +
  2.5926 +/** I/O manager routines **/
  2.5927 +
  2.5928 +NTOSAPI
  2.5929 +VOID
  2.5930 +DDKAPI
  2.5931 +IoAcquireCancelSpinLock(
  2.5932 +  /*OUT*/ PKIRQL  Irql);
  2.5933 +
  2.5934 +NTOSAPI
  2.5935 +NTSTATUS
  2.5936 +DDKAPI
  2.5937 +IoAcquireRemoveLockEx(
  2.5938 +  /*IN*/ PIO_REMOVE_LOCK  RemoveLock,
  2.5939 +  /*IN*/ PVOID  Tag  /*OPTIONAL*/,
  2.5940 +  /*IN*/ PCSTR  File,
  2.5941 +  /*IN*/ ULONG  Line,
  2.5942 +  /*IN*/ ULONG  RemlockSize);
  2.5943 +
  2.5944 +/*
  2.5945 + * NTSTATUS
  2.5946 + * IoAcquireRemoveLock(
  2.5947 + * IN PIO_REMOVE_LOCK  RemoveLock,
  2.5948 + * IN PVOID  Tag OPTIONAL)
  2.5949 + */
  2.5950 +#define IoAcquireRemoveLock(_RemoveLock, \
  2.5951 +                            _Tag) \
  2.5952 +  IoAcquireRemoveLockEx(_RemoveLock, _Tag, __FILE__, __LINE__, sizeof(IO_REMOVE_LOCK))
  2.5953 +
  2.5954 +/*
  2.5955 + * VOID
  2.5956 + * IoAdjustPagingPathCount(
  2.5957 + * IN PLONG  Count,
  2.5958 + * IN BOOLEAN  Increment)
  2.5959 + */
  2.5960 +#define IoAdjustPagingPathCount(_Count, \
  2.5961 +                                _Increment) \
  2.5962 +{ \
  2.5963 +  if (_Increment) \
  2.5964 +    { \
  2.5965 +      InterlockedIncrement(_Count); \
  2.5966 +    } \
  2.5967 +  else \
  2.5968 +    { \
  2.5969 +      InterlockedDecrement(_Count); \
  2.5970 +    } \
  2.5971 +}
  2.5972 +
  2.5973 +NTOSAPI
  2.5974 +VOID
  2.5975 +DDKAPI
  2.5976 +IoAllocateController(
  2.5977 +  /*IN*/ PCONTROLLER_OBJECT  ControllerObject,
  2.5978 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.5979 +  /*IN*/ PDRIVER_CONTROL  ExecutionRoutine,
  2.5980 +  /*IN*/ PVOID  Context);
  2.5981 +
  2.5982 +NTOSAPI
  2.5983 +NTSTATUS
  2.5984 +DDKAPI
  2.5985 +IoAllocateDriverObjectExtension(
  2.5986 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.5987 +  /*IN*/ PVOID  ClientIdentificationAddress,
  2.5988 +  /*IN*/ ULONG  DriverObjectExtensionSize,
  2.5989 +  /*OUT*/ PVOID  *DriverObjectExtension);
  2.5990 +
  2.5991 +typedef struct _IO_ERROR_LOG_PACKET { 
  2.5992 +	UCHAR  MajorFunctionCode; 
  2.5993 +	UCHAR  RetryCount; 
  2.5994 +	USHORT  DumpDataSize; 
  2.5995 +	USHORT  NumberOfStrings; 
  2.5996 +	USHORT  StringOffset; 
  2.5997 +	USHORT  EventCategory; 
  2.5998 +	NTSTATUS  ErrorCode; 
  2.5999 +	ULONG  UniqueErrorValue; 
  2.6000 +	NTSTATUS  FinalStatus; 
  2.6001 +	ULONG  SequenceNumber; 
  2.6002 +	ULONG  IoControlCode; 
  2.6003 +	LARGE_INTEGER  DeviceOffset; 
  2.6004 +	ULONG  DumpData[1]; 
  2.6005 +} IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET; 
  2.6006 +
  2.6007 +NTOSAPI
  2.6008 +PVOID
  2.6009 +DDKAPI
  2.6010 +IoAllocateErrorLogEntry(
  2.6011 +  /*IN*/ PVOID  IoObject,
  2.6012 +  /*IN*/ UCHAR  EntrySize);
  2.6013 +
  2.6014 +NTOSAPI
  2.6015 +PIRP
  2.6016 +DDKAPI
  2.6017 +IoAllocateIrp(
  2.6018 +  /*IN*/ CCHAR  StackSize,
  2.6019 +  /*IN*/ BOOLEAN  ChargeQuota);
  2.6020 +
  2.6021 +NTOSAPI
  2.6022 +PMDL
  2.6023 +DDKAPI
  2.6024 +IoAllocateMdl(
  2.6025 +  /*IN*/ PVOID  VirtualAddress,
  2.6026 +  /*IN*/ ULONG  Length,
  2.6027 +  /*IN*/ BOOLEAN  SecondaryBuffer,
  2.6028 +  /*IN*/ BOOLEAN  ChargeQuota,
  2.6029 +  /*IN OUT*/ PIRP  Irp  /*OPTIONAL*/);
  2.6030 +
  2.6031 +NTOSAPI
  2.6032 +PIO_WORKITEM
  2.6033 +DDKAPI
  2.6034 +IoAllocateWorkItem(
  2.6035 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.6036 +
  2.6037 +/*
  2.6038 + * VOID IoAssignArcName(
  2.6039 + * IN PUNICODE_STRING  ArcName,
  2.6040 + * IN PUNICODE_STRING  DeviceName);
  2.6041 + */
  2.6042 +#define IoAssignArcName(_ArcName, _DeviceName) ( \
  2.6043 +  IoCreateSymbolicLink((_ArcName), (_DeviceName)))
  2.6044 +
  2.6045 +NTOSAPI
  2.6046 +NTSTATUS
  2.6047 +DDKAPI
  2.6048 +IoAttachDevice(
  2.6049 +  /*IN*/ PDEVICE_OBJECT  SourceDevice,
  2.6050 +  /*IN*/ PUNICODE_STRING  TargetDevice,
  2.6051 +  /*OUT*/ PDEVICE_OBJECT  *AttachedDevice);
  2.6052 +
  2.6053 +NTOSAPI
  2.6054 +PDEVICE_OBJECT
  2.6055 +DDKAPI
  2.6056 +IoAttachDeviceToDeviceStack(
  2.6057 +  /*IN*/ PDEVICE_OBJECT  SourceDevice,
  2.6058 +  /*IN*/ PDEVICE_OBJECT  TargetDevice);
  2.6059 +
  2.6060 +NTOSAPI
  2.6061 +PIRP
  2.6062 +DDKAPI
  2.6063 +IoBuildAsynchronousFsdRequest(
  2.6064 +  /*IN*/ ULONG  MajorFunction,
  2.6065 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6066 +  /*IN OUT*/ PVOID  Buffer  /*OPTIONAL*/,
  2.6067 +  /*IN*/ ULONG  Length  /*OPTIONAL*/,
  2.6068 +  /*IN*/ PLARGE_INTEGER  StartingOffset  /*OPTIONAL*/,
  2.6069 +  /*IN*/ PIO_STATUS_BLOCK  IoStatusBlock  /*OPTIONAL*/);
  2.6070 +
  2.6071 +NTOSAPI
  2.6072 +PIRP
  2.6073 +DDKAPI
  2.6074 +IoBuildDeviceIoControlRequest(
  2.6075 +  /*IN*/ ULONG  IoControlCode,
  2.6076 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6077 +  /*IN*/ PVOID  InputBuffer  /*OPTIONAL*/,
  2.6078 +  /*IN*/ ULONG  InputBufferLength,
  2.6079 +  /*OUT*/ PVOID  OutputBuffer  /*OPTIONAL*/,
  2.6080 +  /*IN*/ ULONG  OutputBufferLength,
  2.6081 +  /*IN*/ BOOLEAN  InternalDeviceIoControl,
  2.6082 +  /*IN*/ PKEVENT  Event,
  2.6083 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock);
  2.6084 +
  2.6085 +NTOSAPI
  2.6086 +VOID
  2.6087 +DDKAPI
  2.6088 +IoBuildPartialMdl(
  2.6089 +  /*IN*/ PMDL  SourceMdl,
  2.6090 +  /*IN OUT*/ PMDL  TargetMdl,
  2.6091 +  /*IN*/ PVOID  VirtualAddress,
  2.6092 +  /*IN*/ ULONG  Length);
  2.6093 +
  2.6094 +NTOSAPI
  2.6095 +PIRP
  2.6096 +DDKAPI
  2.6097 +IoBuildSynchronousFsdRequest(
  2.6098 +  /*IN*/ ULONG  MajorFunction,
  2.6099 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6100 +  /*IN OUT*/ PVOID  Buffer  /*OPTIONAL*/,
  2.6101 +  /*IN*/ ULONG  Length  /*OPTIONAL*/,
  2.6102 +  /*IN*/ PLARGE_INTEGER  StartingOffset  /*OPTIONAL*/,
  2.6103 +  /*IN*/ PKEVENT  Event,
  2.6104 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock);
  2.6105 +
  2.6106 +NTOSAPI
  2.6107 +NTSTATUS
  2.6108 +DDKFASTAPI
  2.6109 +IofCallDriver(
  2.6110 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6111 +  /*IN OUT*/ PIRP  Irp);
  2.6112 +
  2.6113 +/*
  2.6114 + * NTSTATUS
  2.6115 + * IoCallDriver(
  2.6116 + * IN PDEVICE_OBJECT  DeviceObject,
  2.6117 + * IN OUT PIRP  Irp)
  2.6118 + */
  2.6119 +#define IoCallDriver IofCallDriver
  2.6120 +
  2.6121 +NTOSAPI
  2.6122 +VOID
  2.6123 +DDKAPI
  2.6124 +IoCancelFileOpen(
  2.6125 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6126 +  /*IN*/ PFILE_OBJECT  FileObject);
  2.6127 +
  2.6128 +NTOSAPI
  2.6129 +BOOLEAN
  2.6130 +DDKAPI
  2.6131 +IoCancelIrp(
  2.6132 +  /*IN*/ PIRP  Irp);
  2.6133 +
  2.6134 +NTOSAPI
  2.6135 +NTSTATUS
  2.6136 +DDKAPI
  2.6137 +IoCheckShareAccess(
  2.6138 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.6139 +  /*IN*/ ULONG  DesiredShareAccess,
  2.6140 +  /*IN OUT*/ PFILE_OBJECT  FileObject,
  2.6141 +  /*IN OUT*/ PSHARE_ACCESS  ShareAccess,
  2.6142 +  /*IN*/ BOOLEAN  Update);
  2.6143 +
  2.6144 +NTOSAPI
  2.6145 +VOID
  2.6146 +DDKFASTAPI
  2.6147 +IofCompleteRequest(
  2.6148 +  /*IN*/ PIRP  Irp,
  2.6149 +  /*IN*/ CCHAR  PriorityBoost);
  2.6150 +
  2.6151 +/*
  2.6152 + * VOID
  2.6153 + * IoCompleteRequest(
  2.6154 + * IN PIRP  Irp,
  2.6155 + * IN CCHAR  PriorityBoost)
  2.6156 + */
  2.6157 +#define IoCompleteRequest IofCompleteRequest
  2.6158 +
  2.6159 +NTOSAPI
  2.6160 +NTSTATUS
  2.6161 +DDKAPI
  2.6162 +IoConnectInterrupt(
  2.6163 +  /*OUT*/ PKINTERRUPT  *InterruptObject,
  2.6164 +  /*IN*/ PKSERVICE_ROUTINE  ServiceRoutine,
  2.6165 +  /*IN*/ PVOID  ServiceContext,
  2.6166 +  /*IN*/ PKSPIN_LOCK  SpinLock  /*OPTIONAL*/,
  2.6167 +  /*IN*/ ULONG  Vector,
  2.6168 +  /*IN*/ KIRQL  Irql,
  2.6169 +  /*IN*/ KIRQL  SynchronizeIrql,
  2.6170 +  /*IN*/ KINTERRUPT_MODE    InterruptMode,
  2.6171 +  /*IN*/ BOOLEAN  ShareVector,
  2.6172 +  /*IN*/ KAFFINITY  ProcessorEnableMask,
  2.6173 +  /*IN*/ BOOLEAN  FloatingSave);
  2.6174 +
  2.6175 +/*
  2.6176 + * PIO_STACK_LOCATION
  2.6177 + * IoGetCurrentIrpStackLocation(
  2.6178 + * IN PIRP  Irp)
  2.6179 + */
  2.6180 +#define IoGetCurrentIrpStackLocation(_Irp) \
  2.6181 +  ((_Irp)->Tail.Overlay.CurrentStackLocation)
  2.6182 +
  2.6183 +/*
  2.6184 + * PIO_STACK_LOCATION
  2.6185 + * IoGetNextIrpStackLocation(
  2.6186 + * IN PIRP  Irp)
  2.6187 + */
  2.6188 +#define IoGetNextIrpStackLocation(_Irp) \
  2.6189 +  ((_Irp)->Tail.Overlay.CurrentStackLocation - 1)
  2.6190 +
  2.6191 +/*
  2.6192 + * VOID
  2.6193 + * IoCopyCurrentIrpStackLocationToNext(
  2.6194 + * IN PIRP  Irp)
  2.6195 + */
  2.6196 +#define IoCopyCurrentIrpStackLocationToNext(_Irp) \
  2.6197 +{ \
  2.6198 +  PIO_STACK_LOCATION _IrpSp; \
  2.6199 +  PIO_STACK_LOCATION _NextIrpSp; \
  2.6200 +  _IrpSp = IoGetCurrentIrpStackLocation(_Irp); \
  2.6201 +  _NextIrpSp = IoGetNextIrpStackLocation(_Irp); \
  2.6202 +  RtlCopyMemory(_NextIrpSp, _IrpSp, \
  2.6203 +    FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); \
  2.6204 +  _NextIrpSp->Control = 0; \
  2.6205 +}
  2.6206 +
  2.6207 +NTOSAPI
  2.6208 +PCONTROLLER_OBJECT
  2.6209 +DDKAPI
  2.6210 +IoCreateController(
  2.6211 +  /*IN*/ ULONG  Size);
  2.6212 +
  2.6213 +NTOSAPI
  2.6214 +NTSTATUS
  2.6215 +DDKAPI
  2.6216 +IoCreateDevice(
  2.6217 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6218 +  /*IN*/ ULONG  DeviceExtensionSize,
  2.6219 +  /*IN*/ PUNICODE_STRING  DeviceName  /*OPTIONAL*/,
  2.6220 +  /*IN*/ DEVICE_TYPE  DeviceType,
  2.6221 +  /*IN*/ ULONG  DeviceCharacteristics,
  2.6222 +  /*IN*/ BOOLEAN  Exclusive,
  2.6223 +  /*OUT*/ PDEVICE_OBJECT  *DeviceObject);
  2.6224 +
  2.6225 +NTOSAPI
  2.6226 +NTSTATUS
  2.6227 +DDKAPI
  2.6228 +IoCreateDisk(
  2.6229 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6230 +  /*IN*/ PCREATE_DISK  Disk);
  2.6231 +
  2.6232 +NTOSAPI
  2.6233 +NTSTATUS
  2.6234 +DDKAPI
  2.6235 +IoCreateFile(
  2.6236 +  /*OUT*/ PHANDLE FileHandle,
  2.6237 +  /*IN*/ ACCESS_MASK DesiredAccess,
  2.6238 +  /*IN*/ POBJECT_ATTRIBUTES ObjectAttributes,
  2.6239 +  /*OUT*/ PIO_STATUS_BLOCK IoStatusBlock,
  2.6240 +  /*IN*/ PLARGE_INTEGER AllocationSize /*OPTIONAL*/,
  2.6241 +  /*IN*/ ULONG FileAttributes,
  2.6242 +  /*IN*/ ULONG ShareAccess,
  2.6243 +  /*IN*/ ULONG Disposition,
  2.6244 +  /*IN*/ ULONG CreateOptions,
  2.6245 +  /*IN*/ PVOID EaBuffer /*OPTIONAL*/,
  2.6246 +  /*IN*/ ULONG EaLength,
  2.6247 +  /*IN*/ CREATE_FILE_TYPE CreateFileType,
  2.6248 +  /*IN*/ PVOID ExtraCreateParameters /*OPTIONAL*/,
  2.6249 +  /*IN*/ ULONG Options);
  2.6250 +
  2.6251 +NTOSAPI
  2.6252 +PKEVENT
  2.6253 +DDKAPI
  2.6254 +IoCreateNotificationEvent(
  2.6255 +  /*IN*/ PUNICODE_STRING  EventName,
  2.6256 +  /*OUT*/ PHANDLE  EventHandle);
  2.6257 +
  2.6258 +NTOSAPI
  2.6259 +NTSTATUS
  2.6260 +DDKAPI
  2.6261 +IoCreateSymbolicLink(
  2.6262 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName,
  2.6263 +  /*IN*/ PUNICODE_STRING  DeviceName);
  2.6264 +
  2.6265 +NTOSAPI
  2.6266 +PKEVENT
  2.6267 +DDKAPI
  2.6268 +IoCreateSynchronizationEvent(
  2.6269 +  /*IN*/ PUNICODE_STRING  EventName,
  2.6270 +  /*OUT*/ PHANDLE  EventHandle);
  2.6271 +
  2.6272 +NTOSAPI
  2.6273 +NTSTATUS
  2.6274 +DDKAPI
  2.6275 +IoCreateUnprotectedSymbolicLink(
  2.6276 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName,
  2.6277 +  /*IN*/ PUNICODE_STRING  DeviceName);
  2.6278 +
  2.6279 +NTOSAPI
  2.6280 +VOID
  2.6281 +DDKAPI
  2.6282 +IoCsqInitialize(
  2.6283 +  PIO_CSQ  Csq,
  2.6284 +  /*IN*/ PIO_CSQ_INSERT_IRP  CsqInsertIrp,
  2.6285 +  /*IN*/ PIO_CSQ_REMOVE_IRP  CsqRemoveIrp,
  2.6286 +  /*IN*/ PIO_CSQ_PEEK_NEXT_IRP  CsqPeekNextIrp,
  2.6287 +  /*IN*/ PIO_CSQ_ACQUIRE_LOCK  CsqAcquireLock,
  2.6288 +  /*IN*/ PIO_CSQ_RELEASE_LOCK  CsqReleaseLock,
  2.6289 +  /*IN*/ PIO_CSQ_COMPLETE_CANCELED_IRP  CsqCompleteCanceledIrp);
  2.6290 +
  2.6291 +NTOSAPI
  2.6292 +VOID
  2.6293 +DDKAPI
  2.6294 +IoCsqInsertIrp(
  2.6295 +  /*IN*/ PIO_CSQ  Csq,
  2.6296 +  /*IN*/ PIRP  Irp,
  2.6297 +  /*IN*/ PIO_CSQ_IRP_CONTEXT  Context);
  2.6298 +
  2.6299 +NTOSAPI
  2.6300 +PIRP
  2.6301 +DDKAPI
  2.6302 +IoCsqRemoveIrp(
  2.6303 +  /*IN*/ PIO_CSQ  Csq,
  2.6304 +  /*IN*/ PIO_CSQ_IRP_CONTEXT  Context);
  2.6305 +
  2.6306 +NTOSAPI
  2.6307 +PIRP
  2.6308 +DDKAPI
  2.6309 +IoCsqRemoveNextIrp(
  2.6310 +  /*IN*/ PIO_CSQ  Csq,
  2.6311 +  /*IN*/ PVOID  PeekContext);
  2.6312 +
  2.6313 +NTOSAPI
  2.6314 +VOID
  2.6315 +DDKAPI
  2.6316 +IoDeleteController(
  2.6317 +  /*IN*/ PCONTROLLER_OBJECT  ControllerObject);
  2.6318 +
  2.6319 +NTOSAPI
  2.6320 +VOID
  2.6321 +DDKAPI
  2.6322 +IoDeleteDevice(
  2.6323 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.6324 +
  2.6325 +NTOSAPI
  2.6326 +NTSTATUS
  2.6327 +DDKAPI
  2.6328 +IoDeleteSymbolicLink(
  2.6329 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName);
  2.6330 +
  2.6331 +/*
  2.6332 + * VOID
  2.6333 + * IoDeassignArcName(
  2.6334 + * IN PUNICODE_STRING  ArcName)
  2.6335 + */
  2.6336 +#define IoDeassignArcName IoDeleteSymbolicLink
  2.6337 +
  2.6338 +NTOSAPI
  2.6339 +VOID
  2.6340 +DDKAPI
  2.6341 +IoDetachDevice(
  2.6342 +  /*IN OUT*/ PDEVICE_OBJECT  TargetDevice);
  2.6343 +
  2.6344 +NTOSAPI
  2.6345 +VOID
  2.6346 +DDKAPI
  2.6347 +IoDisconnectInterrupt(
  2.6348 +  /*IN*/ PKINTERRUPT  InterruptObject);
  2.6349 +
  2.6350 +NTOSAPI
  2.6351 +BOOLEAN
  2.6352 +DDKAPI
  2.6353 +IoForwardIrpSynchronously(
  2.6354 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6355 +  /*IN*/ PIRP  Irp);
  2.6356 +
  2.6357 +#define IoForwardAndCatchIrp IoForwardIrpSynchronously
  2.6358 +
  2.6359 +NTOSAPI
  2.6360 +VOID
  2.6361 +DDKAPI
  2.6362 +IoFreeController(
  2.6363 +  /*IN*/ PCONTROLLER_OBJECT  ControllerObject);
  2.6364 +
  2.6365 +NTOSAPI
  2.6366 +VOID
  2.6367 +DDKAPI
  2.6368 +IoFreeErrorLogEntry(
  2.6369 +  PVOID  ElEntry);
  2.6370 +
  2.6371 +NTOSAPI
  2.6372 +VOID
  2.6373 +DDKAPI
  2.6374 +IoFreeIrp(
  2.6375 +  /*IN*/ PIRP  Irp);
  2.6376 +
  2.6377 +NTOSAPI
  2.6378 +VOID
  2.6379 +DDKAPI
  2.6380 +IoFreeMdl(
  2.6381 +  /*IN*/ PMDL  Mdl);
  2.6382 +
  2.6383 +NTOSAPI
  2.6384 +VOID
  2.6385 +DDKAPI
  2.6386 +IoFreeWorkItem(
  2.6387 +  /*IN*/ PIO_WORKITEM  pIOWorkItem);
  2.6388 +
  2.6389 +NTOSAPI
  2.6390 +PDEVICE_OBJECT
  2.6391 +DDKAPI
  2.6392 +IoGetAttachedDevice(
  2.6393 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.6394 +
  2.6395 +NTOSAPI
  2.6396 +PDEVICE_OBJECT
  2.6397 +DDKAPI
  2.6398 +IoGetAttachedDeviceReference(
  2.6399 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.6400 +
  2.6401 +NTOSAPI
  2.6402 +NTSTATUS
  2.6403 +DDKAPI
  2.6404 +IoGetBootDiskInformation(
  2.6405 +  /*IN OUT*/ PBOOTDISK_INFORMATION  BootDiskInformation,
  2.6406 +  /*IN*/ ULONG  Size);
  2.6407 +
  2.6408 +NTOSAPI
  2.6409 +PCONFIGURATION_INFORMATION
  2.6410 +DDKAPI
  2.6411 +IoGetConfigurationInformation( 
  2.6412 +  VOID);
  2.6413 +
  2.6414 +NTOSAPI
  2.6415 +PEPROCESS
  2.6416 +DDKAPI
  2.6417 +IoGetCurrentProcess(
  2.6418 +  VOID);
  2.6419 +
  2.6420 +NTOSAPI
  2.6421 +NTSTATUS
  2.6422 +DDKAPI
  2.6423 +IoGetDeviceInterfaceAlias(
  2.6424 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName,
  2.6425 +  /*IN*/ CONST GUID  *AliasInterfaceClassGuid,
  2.6426 +  /*OUT*/ PUNICODE_STRING  AliasSymbolicLinkName);
  2.6427 +
  2.6428 +NTOSAPI
  2.6429 +NTSTATUS
  2.6430 +DDKAPI
  2.6431 +IoGetDeviceInterfaces(
  2.6432 +  /*IN*/ CONST GUID  *InterfaceClassGuid,
  2.6433 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject  /*OPTIONAL*/,
  2.6434 +  /*IN*/ ULONG  Flags,
  2.6435 +  /*OUT*/ PWSTR  *SymbolicLinkList);
  2.6436 +
  2.6437 +NTOSAPI
  2.6438 +NTSTATUS
  2.6439 +DDKAPI
  2.6440 +IoGetDeviceObjectPointer(
  2.6441 +  /*IN*/ PUNICODE_STRING  ObjectName,
  2.6442 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.6443 +  /*OUT*/ PFILE_OBJECT  *FileObject,
  2.6444 +  /*OUT*/ PDEVICE_OBJECT  *DeviceObject);
  2.6445 +
  2.6446 +NTOSAPI
  2.6447 +NTSTATUS
  2.6448 +DDKAPI
  2.6449 +IoGetDeviceProperty(
  2.6450 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6451 +  /*IN*/ DEVICE_REGISTRY_PROPERTY  DeviceProperty,
  2.6452 +  /*IN*/ ULONG  BufferLength,
  2.6453 +  /*OUT*/ PVOID  PropertyBuffer,
  2.6454 +  /*OUT*/ PULONG  ResultLength);
  2.6455 +
  2.6456 +NTOSAPI
  2.6457 +PDEVICE_OBJECT
  2.6458 +DDKAPI
  2.6459 +IoGetDeviceToVerify(
  2.6460 +  /*IN*/ PETHREAD  Thread);
  2.6461 +
  2.6462 +NTOSAPI
  2.6463 +PDMA_ADAPTER
  2.6464 +DDKAPI
  2.6465 +IoGetDmaAdapter(
  2.6466 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject,
  2.6467 +  /*IN*/ PDEVICE_DESCRIPTION  DeviceDescription,
  2.6468 +  /*IN OUT*/ PULONG  NumberOfMapRegisters);
  2.6469 +
  2.6470 +NTOSAPI
  2.6471 +PVOID
  2.6472 +DDKAPI
  2.6473 +IoGetDriverObjectExtension(
  2.6474 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6475 +  /*IN*/ PVOID  ClientIdentificationAddress);
  2.6476 +
  2.6477 +NTOSAPI
  2.6478 +PGENERIC_MAPPING
  2.6479 +DDKAPI
  2.6480 +IoGetFileObjectGenericMapping(
  2.6481 +  VOID);
  2.6482 +
  2.6483 +/*
  2.6484 + * ULONG
  2.6485 + * IoGetFunctionCodeFromCtlCode(
  2.6486 + * IN ULONG  ControlCode)
  2.6487 + */
  2.6488 +#define IoGetFunctionCodeFromCtlCode(_ControlCode) \
  2.6489 +  (((_ControlCode) >> 2) & 0x00000FFF)
  2.6490 +
  2.6491 +NTOSAPI
  2.6492 +PVOID
  2.6493 +DDKAPI
  2.6494 +IoGetInitialStack(
  2.6495 +  VOID);
  2.6496 +
  2.6497 +NTOSAPI
  2.6498 +PDEVICE_OBJECT
  2.6499 +DDKAPI
  2.6500 +IoGetRelatedDeviceObject(
  2.6501 +  /*IN*/ PFILE_OBJECT  FileObject);
  2.6502 +
  2.6503 +NTOSAPI
  2.6504 +ULONG
  2.6505 +DDKAPI
  2.6506 +IoGetRemainingStackSize(
  2.6507 +  VOID);
  2.6508 +
  2.6509 +NTOSAPI
  2.6510 +VOID
  2.6511 +DDKAPI
  2.6512 +IoGetStackLimits(
  2.6513 +  /*OUT*/ PULONG_PTR  LowLimit,
  2.6514 +  /*OUT*/ PULONG_PTR  HighLimit);
  2.6515 +
  2.6516 +NTOSAPI
  2.6517 +VOID
  2.6518 +DDKAPI
  2.6519 +KeInitializeDpc(
  2.6520 +  /*IN*/ PRKDPC  Dpc,
  2.6521 +  /*IN*/ PKDEFERRED_ROUTINE  DeferredRoutine,
  2.6522 +  /*IN*/ PVOID  DeferredContext);
  2.6523 +
  2.6524 +/*
  2.6525 + * VOID
  2.6526 + * IoInitializeDpcRequest(
  2.6527 + * IN PDEVICE_OBJECT DeviceObject,
  2.6528 + * IN PIO_DPC_ROUTINE DpcRoutine)
  2.6529 + */
  2.6530 +#define IoInitializeDpcRequest(_DeviceObject, \
  2.6531 +                               _DpcRoutine) \
  2.6532 +  KeInitializeDpc(&(_DeviceObject)->Dpc, \
  2.6533 +    (PKDEFERRED_ROUTINE) (_DpcRoutine), \
  2.6534 +    _DeviceObject)
  2.6535 +
  2.6536 +NTOSAPI
  2.6537 +VOID
  2.6538 +DDKAPI
  2.6539 +IoInitializeIrp(
  2.6540 +  /*IN OUT*/ PIRP  Irp,
  2.6541 +  /*IN*/ USHORT  PacketSize,
  2.6542 +  /*IN*/ CCHAR  StackSize);
  2.6543 +
  2.6544 +NTOSAPI
  2.6545 +VOID
  2.6546 +DDKAPI
  2.6547 +IoInitializeRemoveLockEx(
  2.6548 +  /*IN*/ PIO_REMOVE_LOCK Lock,
  2.6549 +  /*IN*/ ULONG   AllocateTag,
  2.6550 +  /*IN*/ ULONG   MaxLockedMinutes,
  2.6551 +  /*IN*/ ULONG   HighWatermark,
  2.6552 +  /*IN*/ ULONG   RemlockSize);
  2.6553 +
  2.6554 +/* VOID
  2.6555 + * IoInitializeRemoveLock(
  2.6556 + * IN PIO_REMOVE_LOCK  Lock,
  2.6557 + * IN ULONG  AllocateTag,
  2.6558 + * IN ULONG  MaxLockedMinutes,
  2.6559 + * IN ULONG  HighWatermark)
  2.6560 + */
  2.6561 +#define IoInitializeRemoveLock( \
  2.6562 +  Lock, AllocateTag, MaxLockedMinutes, HighWatermark) \
  2.6563 +  IoInitializeRemoveLockEx(Lock, AllocateTag, MaxLockedMinutes, \
  2.6564 +    HighWatermark, sizeof(IO_REMOVE_LOCK))
  2.6565 +
  2.6566 +NTOSAPI
  2.6567 +NTSTATUS
  2.6568 +DDKAPI
  2.6569 +IoInitializeTimer(
  2.6570 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6571 +  /*IN*/ PIO_TIMER_ROUTINE  TimerRoutine,
  2.6572 +  /*IN*/ PVOID  Context);
  2.6573 +
  2.6574 +NTOSAPI
  2.6575 +VOID
  2.6576 +DDKAPI
  2.6577 +IoInvalidateDeviceRelations(
  2.6578 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6579 +  /*IN*/ DEVICE_RELATION_TYPE  Type);
  2.6580 +
  2.6581 +NTOSAPI
  2.6582 +VOID
  2.6583 +DDKAPI
  2.6584 +IoInvalidateDeviceState(
  2.6585 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject);
  2.6586 +
  2.6587 +NTOSAPI
  2.6588 +BOOLEAN
  2.6589 +DDKAPI
  2.6590 +IoIs32bitProcess(
  2.6591 +  /*IN*/ PIRP  Irp  /*OPTIONAL*/);
  2.6592 +
  2.6593 +/*
  2.6594 + * BOOLEAN
  2.6595 + * IoIsErrorUserInduced(
  2.6596 + * IN NTSTATUS  Status);
  2.6597 + */
  2.6598 +#define IoIsErrorUserInduced(Status) \
  2.6599 +	((BOOLEAN)(((Status) == STATUS_DEVICE_NOT_READY) || \
  2.6600 +   ((Status) == STATUS_IO_TIMEOUT) || \
  2.6601 +   ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \
  2.6602 +   ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \
  2.6603 +   ((Status) == STATUS_VERIFY_REQUIRED) || \
  2.6604 +   ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \
  2.6605 +   ((Status) == STATUS_WRONG_VOLUME)))
  2.6606 +
  2.6607 +NTOSAPI
  2.6608 +BOOLEAN
  2.6609 +DDKAPI
  2.6610 +IoIsWdmVersionAvailable(
  2.6611 +  /*IN*/ UCHAR  MajorVersion,
  2.6612 +  /*IN*/ UCHAR  MinorVersion);
  2.6613 +
  2.6614 +NTOSAPI
  2.6615 +PIRP
  2.6616 +DDKAPI
  2.6617 +IoMakeAssociatedIrp(
  2.6618 +  /*IN*/ PIRP  Irp,
  2.6619 +  /*IN*/ CCHAR  StackSize);
  2.6620 +
  2.6621 +/*
  2.6622 + * VOID
  2.6623 + * IoMarkIrpPending(
  2.6624 + * IN OUT PIRP  Irp)
  2.6625 + */
  2.6626 +#define IoMarkIrpPending(_Irp) \
  2.6627 +  (IoGetCurrentIrpStackLocation(_Irp)->Control |= SL_PENDING_RETURNED)
  2.6628 +
  2.6629 +NTOSAPI
  2.6630 +NTSTATUS
  2.6631 +DDKAPI
  2.6632 +IoOpenDeviceInterfaceRegistryKey(
  2.6633 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName,
  2.6634 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.6635 +  /*OUT*/ PHANDLE  DeviceInterfaceKey);
  2.6636 +
  2.6637 +NTOSAPI
  2.6638 +NTSTATUS
  2.6639 +DDKAPI
  2.6640 +IoOpenDeviceRegistryKey(
  2.6641 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6642 +  /*IN*/ ULONG  DevInstKeyType,
  2.6643 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.6644 +  /*OUT*/ PHANDLE  DevInstRegKey);
  2.6645 +
  2.6646 +NTOSAPI
  2.6647 +NTSTATUS
  2.6648 +DDKAPI
  2.6649 +IoQueryDeviceDescription(
  2.6650 +  /*IN*/ PINTERFACE_TYPE  BusType  /*OPTIONAL*/,
  2.6651 +  /*IN*/ PULONG  BusNumber  /*OPTIONAL*/,
  2.6652 +  /*IN*/ PCONFIGURATION_TYPE  ControllerType  /*OPTIONAL*/,
  2.6653 +  /*IN*/ PULONG  ControllerNumber  /*OPTIONAL*/,
  2.6654 +  /*IN*/ PCONFIGURATION_TYPE  PeripheralType  /*OPTIONAL*/,
  2.6655 +  /*IN*/ PULONG  PeripheralNumber  /*OPTIONAL*/,
  2.6656 +  /*IN*/ PIO_QUERY_DEVICE_ROUTINE  CalloutRoutine,
  2.6657 +  /*IN*/ PVOID  Context);
  2.6658 +
  2.6659 +NTOSAPI
  2.6660 +VOID
  2.6661 +DDKAPI
  2.6662 +IoQueueWorkItem(
  2.6663 +  /*IN*/ PIO_WORKITEM  pIOWorkItem,
  2.6664 +  /*IN*/ PIO_WORKITEM_ROUTINE  Routine,
  2.6665 +  /*IN*/ WORK_QUEUE_TYPE  QueueType,
  2.6666 +  /*IN*/ PVOID  Context);
  2.6667 +
  2.6668 +NTOSAPI
  2.6669 +VOID
  2.6670 +DDKAPI
  2.6671 +IoRaiseHardError(
  2.6672 +  /*IN*/ PIRP  Irp,
  2.6673 +  /*IN*/ PVPB  Vpb  /*OPTIONAL*/,
  2.6674 +  /*IN*/ PDEVICE_OBJECT  RealDeviceObject);
  2.6675 +
  2.6676 +NTOSAPI
  2.6677 +BOOLEAN
  2.6678 +DDKAPI
  2.6679 +IoRaiseInformationalHardError(
  2.6680 +  /*IN*/ NTSTATUS  ErrorStatus,
  2.6681 +  /*IN*/ PUNICODE_STRING  String  /*OPTIONAL*/,
  2.6682 +  /*IN*/ PKTHREAD  Thread  /*OPTIONAL*/);
  2.6683 +
  2.6684 +NTOSAPI
  2.6685 +NTSTATUS
  2.6686 +DDKAPI
  2.6687 +IoReadDiskSignature(
  2.6688 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6689 +  /*IN*/ ULONG  BytesPerSector,
  2.6690 +  /*OUT*/ PDISK_SIGNATURE  Signature);
  2.6691 +
  2.6692 +NTOSAPI
  2.6693 +NTSTATUS
  2.6694 +DDKAPI
  2.6695 +IoReadPartitionTableEx(
  2.6696 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6697 +  /*IN*/ struct _DRIVE_LAYOUT_INFORMATION_EX  **PartitionBuffer);
  2.6698 +
  2.6699 +NTOSAPI
  2.6700 +VOID
  2.6701 +DDKAPI
  2.6702 +IoRegisterBootDriverReinitialization(
  2.6703 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6704 +  /*IN*/ PDRIVER_REINITIALIZE  DriverReinitializationRoutine,
  2.6705 +  /*IN*/ PVOID  Context);
  2.6706 +
  2.6707 +NTOSAPI
  2.6708 +VOID
  2.6709 +DDKAPI
  2.6710 +IoRegisterBootDriverReinitialization(
  2.6711 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6712 +  /*IN*/ PDRIVER_REINITIALIZE  DriverReinitializationRoutine,
  2.6713 +  /*IN*/ PVOID  Context);
  2.6714 +
  2.6715 +NTOSAPI
  2.6716 +NTSTATUS
  2.6717 +DDKAPI
  2.6718 +IoRegisterDeviceInterface(
  2.6719 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject,
  2.6720 +  /*IN*/ CONST GUID  *InterfaceClassGuid,
  2.6721 +  /*IN*/ PUNICODE_STRING  ReferenceString  /*OPTIONAL*/,
  2.6722 +  /*OUT*/ PUNICODE_STRING  SymbolicLinkName);
  2.6723 +
  2.6724 +NTOSAPI
  2.6725 +VOID
  2.6726 +DDKAPI
  2.6727 +IoRegisterDriverReinitialization(
  2.6728 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6729 +  /*IN*/ PDRIVER_REINITIALIZE  DriverReinitializationRoutine,
  2.6730 +  /*IN*/ PVOID  Context);
  2.6731 +
  2.6732 +NTOSAPI
  2.6733 +NTSTATUS
  2.6734 +DDKAPI
  2.6735 +IoRegisterPlugPlayNotification(
  2.6736 +  /*IN*/ IO_NOTIFICATION_EVENT_CATEGORY  EventCategory,
  2.6737 +  /*IN*/ ULONG  EventCategoryFlags,
  2.6738 +  /*IN*/ PVOID  EventCategoryData  /*OPTIONAL*/,
  2.6739 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6740 +  /*IN*/ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE  CallbackRoutine,
  2.6741 +  /*IN*/ PVOID  Context,
  2.6742 +  /*OUT*/ PVOID  *NotificationEntry);
  2.6743 +
  2.6744 +NTOSAPI
  2.6745 +NTSTATUS
  2.6746 +DDKAPI
  2.6747 +IoRegisterShutdownNotification(
  2.6748 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.6749 +
  2.6750 +NTOSAPI
  2.6751 +VOID
  2.6752 +DDKAPI
  2.6753 +IoReleaseCancelSpinLock(
  2.6754 +  /*IN*/ KIRQL  Irql);
  2.6755 +
  2.6756 +NTOSAPI
  2.6757 +VOID
  2.6758 +DDKAPI
  2.6759 +IoReleaseRemoveLockAndWaitEx(
  2.6760 +  /*IN*/ PIO_REMOVE_LOCK  RemoveLock,
  2.6761 +  /*IN*/ PVOID  Tag,
  2.6762 +  /*IN*/ ULONG  RemlockSize);
  2.6763 +
  2.6764 +/*
  2.6765 + * VOID
  2.6766 + * IoReleaseRemoveLockAndWait(
  2.6767 + * IN PIO_REMOVE_LOCK  RemoveLock,
  2.6768 + * IN PVOID  Tag)
  2.6769 + */
  2.6770 +#define IoReleaseRemoveLockAndWait(_RemoveLock, \
  2.6771 +                                   _Tag) \
  2.6772 +  IoReleaseRemoveLockAndWaitEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
  2.6773 +
  2.6774 +NTOSAPI
  2.6775 +VOID
  2.6776 +DDKAPI
  2.6777 +IoReleaseRemoveLockEx(
  2.6778 +  /*IN*/ PIO_REMOVE_LOCK  RemoveLock,
  2.6779 +  /*IN*/ PVOID  Tag,
  2.6780 +  /*IN*/ ULONG  RemlockSize);
  2.6781 +
  2.6782 +/*
  2.6783 + * VOID
  2.6784 + * IoReleaseRemoveLock(
  2.6785 + * IN PIO_REMOVE_LOCK  RemoveLock,
  2.6786 + * IN PVOID  Tag)
  2.6787 + */
  2.6788 +#define IoReleaseRemoveLock(_RemoveLock, \
  2.6789 +                                   _Tag) \
  2.6790 +  IoReleaseRemoveLockEx(_RemoveLock, _Tag, sizeof(IO_REMOVE_LOCK))
  2.6791 +
  2.6792 +NTOSAPI
  2.6793 +VOID
  2.6794 +DDKAPI
  2.6795 +IoRemoveShareAccess(
  2.6796 +  /*IN*/ PFILE_OBJECT  FileObject,
  2.6797 +  /*IN OUT*/ PSHARE_ACCESS  ShareAccess);
  2.6798 +
  2.6799 +NTOSAPI
  2.6800 +NTSTATUS
  2.6801 +DDKAPI
  2.6802 +IoReportDetectedDevice(
  2.6803 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6804 +  /*IN*/ INTERFACE_TYPE  LegacyBusType,
  2.6805 +  /*IN*/ ULONG  BusNumber,
  2.6806 +  /*IN*/ ULONG  SlotNumber,
  2.6807 +  /*IN*/ PCM_RESOURCE_LIST  ResourceList,
  2.6808 +  /*IN*/ PIO_RESOURCE_REQUIREMENTS_LIST  ResourceRequirements  /*OPTIONAL*/,
  2.6809 +  /*IN*/ BOOLEAN  ResourceAssigned,
  2.6810 +  /*IN OUT*/ PDEVICE_OBJECT  *DeviceObject);
  2.6811 +
  2.6812 +NTOSAPI
  2.6813 +NTSTATUS
  2.6814 +DDKAPI
  2.6815 +IoReportResourceForDetection(
  2.6816 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6817 +  /*IN*/ PCM_RESOURCE_LIST  DriverList  /*OPTIONAL*/,
  2.6818 +  /*IN*/ ULONG  DriverListSize  /*OPTIONAL*/,
  2.6819 +  /*IN*/ PDEVICE_OBJECT  DeviceObject  /*OPTIONAL*/,
  2.6820 +  /*IN*/ PCM_RESOURCE_LIST  DeviceList  /*OPTIONAL*/,
  2.6821 +  /*IN*/ ULONG  DeviceListSize  /*OPTIONAL*/,
  2.6822 +  /*OUT*/ PBOOLEAN  ConflictDetected);
  2.6823 +
  2.6824 +NTOSAPI
  2.6825 +NTSTATUS
  2.6826 +DDKAPI
  2.6827 +IoReportResourceUsage(
  2.6828 +  /*IN*/ PUNICODE_STRING  DriverClassName  /*OPTIONAL*/,
  2.6829 +  /*IN*/ PDRIVER_OBJECT  DriverObject,
  2.6830 +  /*IN*/ PCM_RESOURCE_LIST  DriverList  /*OPTIONAL*/,
  2.6831 +  /*IN*/ ULONG  DriverListSize  /*OPTIONAL*/,
  2.6832 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6833 +  /*IN*/ PCM_RESOURCE_LIST  DeviceList  /*OPTIONAL*/,
  2.6834 +  /*IN*/ ULONG  DeviceListSize  /*OPTIONAL*/,
  2.6835 +  /*IN*/ BOOLEAN  OverrideConflict,
  2.6836 +  /*OUT*/ PBOOLEAN  ConflictDetected);
  2.6837 +
  2.6838 +NTOSAPI
  2.6839 +NTSTATUS
  2.6840 +DDKAPI
  2.6841 +IoReportTargetDeviceChange(
  2.6842 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject,
  2.6843 +  /*IN*/ PVOID  NotificationStructure);
  2.6844 +
  2.6845 +NTOSAPI
  2.6846 +NTSTATUS
  2.6847 +DDKAPI
  2.6848 +IoReportTargetDeviceChangeAsynchronous(
  2.6849 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject,
  2.6850 +  /*IN*/ PVOID  NotificationStructure,
  2.6851 +  /*IN*/ PDEVICE_CHANGE_COMPLETE_CALLBACK  Callback  /*OPTIONAL*/,
  2.6852 +  /*IN*/ PVOID  Context  /*OPTIONAL*/);
  2.6853 +
  2.6854 +NTOSAPI
  2.6855 +VOID
  2.6856 +DDKAPI
  2.6857 +IoRequestDeviceEject(
  2.6858 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject);
  2.6859 +
  2.6860 +/*
  2.6861 + * VOID
  2.6862 + * IoRequestDpc(
  2.6863 + * IN PDEVICE_OBJECT  DeviceObject,
  2.6864 + * IN PIRP  Irp,
  2.6865 + * IN PVOID  Context);
  2.6866 + */
  2.6867 +#define IoRequestDpc(DeviceObject, Irp, Context)( \
  2.6868 +  KeInsertQueueDpc(&(DeviceObject)->Dpc, (Irp), (Context)))
  2.6869 +
  2.6870 +NTOSAPI
  2.6871 +VOID
  2.6872 +DDKAPI
  2.6873 +IoReuseIrp(
  2.6874 +  /*IN OUT*/ PIRP  Irp,
  2.6875 +  /*IN*/ NTSTATUS  Status);
  2.6876 +
  2.6877 +/*
  2.6878 + * PDRIVER_CANCEL
  2.6879 + * IoSetCancelRoutine(
  2.6880 + * IN PIRP  Irp,
  2.6881 + * IN PDRIVER_CANCEL  CancelRoutine)
  2.6882 + */
  2.6883 +#define IoSetCancelRoutine(_Irp, \
  2.6884 +                           _CancelRoutine) \
  2.6885 +  ((PDRIVER_CANCEL) InterlockedExchangePointer( \
  2.6886 +    (PVOID *) &(_Irp)->CancelRoutine, (PVOID) (_CancelRoutine)))
  2.6887 +
  2.6888 +/*
  2.6889 + * VOID
  2.6890 + * IoSetCompletionRoutine(
  2.6891 + * IN PIRP  Irp,
  2.6892 + * IN PIO_COMPLETION_ROUTINE  CompletionRoutine,
  2.6893 + * IN PVOID  Context,
  2.6894 + * IN BOOLEAN  InvokeOnSuccess,
  2.6895 + * IN BOOLEAN  InvokeOnError,
  2.6896 + * IN BOOLEAN  InvokeOnCancel)
  2.6897 + */
  2.6898 +#define IoSetCompletionRoutine(_Irp, \
  2.6899 +                               _CompletionRoutine, \
  2.6900 +                               _Context, \
  2.6901 +                               _InvokeOnSuccess, \
  2.6902 +                               _InvokeOnError, \
  2.6903 +                               _InvokeOnCancel) \
  2.6904 +{ \
  2.6905 +  PIO_STACK_LOCATION _IrpSp; \
  2.6906 +  ASSERT(_InvokeOnSuccess || _InvokeOnError || _InvokeOnCancel ? \
  2.6907 +    _CompletionRoutine != NULL : TRUE); \
  2.6908 +  _IrpSp = IoGetNextIrpStackLocation(_Irp); \
  2.6909 +  _IrpSp->CompletionRoutine = (PIO_COMPLETION_ROUTINE)(_CompletionRoutine); \
  2.6910 +	_IrpSp->Context = (_Context); \
  2.6911 +  _IrpSp->Control = 0; \
  2.6912 +  if (_InvokeOnSuccess) _IrpSp->Control = SL_INVOKE_ON_SUCCESS; \
  2.6913 +  if (_InvokeOnError) _IrpSp->Control |= SL_INVOKE_ON_ERROR; \
  2.6914 +  if (_InvokeOnCancel) _IrpSp->Control |= SL_INVOKE_ON_CANCEL; \
  2.6915 +}
  2.6916 +
  2.6917 +NTOSAPI
  2.6918 +VOID
  2.6919 +DDKAPI
  2.6920 +IoSetCompletionRoutineEx(
  2.6921 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6922 +  /*IN*/ PIRP  Irp,
  2.6923 +  /*IN*/ PIO_COMPLETION_ROUTINE  CompletionRoutine,
  2.6924 +  /*IN*/ PVOID  Context,
  2.6925 +  /*IN*/ BOOLEAN    InvokeOnSuccess,
  2.6926 +  /*IN*/ BOOLEAN  InvokeOnError,
  2.6927 +  /*IN*/ BOOLEAN  InvokeOnCancel);
  2.6928 +
  2.6929 +NTOSAPI
  2.6930 +NTSTATUS
  2.6931 +DDKAPI
  2.6932 +IoSetDeviceInterfaceState(
  2.6933 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName,
  2.6934 +  /*IN*/ BOOLEAN  Enable);
  2.6935 +
  2.6936 +NTOSAPI
  2.6937 +VOID
  2.6938 +DDKAPI
  2.6939 +IoSetHardErrorOrVerifyDevice(
  2.6940 +  /*IN*/ PIRP  Irp,
  2.6941 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.6942 +
  2.6943 +/*
  2.6944 + * VOID
  2.6945 + * IoSetNextIrpStackLocation(
  2.6946 + * IN OUT PIRP  Irp)
  2.6947 + */
  2.6948 +#define IoSetNextIrpStackLocation(_Irp) \
  2.6949 +{ \
  2.6950 +  (_Irp)->CurrentLocation--; \
  2.6951 +  (_Irp)->Tail.Overlay.CurrentStackLocation--; \
  2.6952 +}
  2.6953 +
  2.6954 +NTOSAPI
  2.6955 +NTSTATUS
  2.6956 +DDKAPI
  2.6957 +IoSetPartitionInformationEx(
  2.6958 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.6959 +  /*IN*/ ULONG  PartitionNumber,
  2.6960 +  /*IN*/ struct _SET_PARTITION_INFORMATION_EX  *PartitionInfo);
  2.6961 +
  2.6962 +NTOSAPI
  2.6963 +VOID
  2.6964 +DDKAPI
  2.6965 +IoSetShareAccess(
  2.6966 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.6967 +  /*IN*/ ULONG  DesiredShareAccess,
  2.6968 +  /*IN OUT*/ PFILE_OBJECT  FileObject,
  2.6969 +  /*OUT*/ PSHARE_ACCESS  ShareAccess);
  2.6970 +
  2.6971 +NTOSAPI
  2.6972 +VOID
  2.6973 +DDKAPI
  2.6974 +IoSetStartIoAttributes(
  2.6975 +  /*IN*/ PDEVICE_OBJECT  DeviceObject, 
  2.6976 +  /*IN*/ BOOLEAN  DeferredStartIo, 
  2.6977 +  /*IN*/ BOOLEAN  NonCancelable); 
  2.6978 +
  2.6979 +NTOSAPI
  2.6980 +NTSTATUS
  2.6981 +DDKAPI
  2.6982 +IoSetSystemPartition(
  2.6983 +  /*IN*/ PUNICODE_STRING  VolumeNameString);
  2.6984 +
  2.6985 +NTOSAPI
  2.6986 +BOOLEAN
  2.6987 +DDKAPI
  2.6988 +IoSetThreadHardErrorMode(
  2.6989 +  /*IN*/ BOOLEAN  EnableHardErrors);
  2.6990 +
  2.6991 +/*
  2.6992 + * USHORT
  2.6993 + * IoSizeOfIrp(
  2.6994 + * IN CCHAR  StackSize)
  2.6995 + */
  2.6996 +#define IoSizeOfIrp(_StackSize) \
  2.6997 +  ((USHORT) (sizeof(IRP) + ((_StackSize) * (sizeof(IO_STACK_LOCATION)))))
  2.6998 +
  2.6999 +/*
  2.7000 + * VOID
  2.7001 + * IoSkipCurrentIrpStackLocation(
  2.7002 + * IN PIRP  Irp)
  2.7003 + */
  2.7004 +#define IoSkipCurrentIrpStackLocation(_Irp) \
  2.7005 +{ \
  2.7006 +  (_Irp)->CurrentLocation++; \
  2.7007 +  (_Irp)->Tail.Overlay.CurrentStackLocation++; \
  2.7008 +}
  2.7009 +
  2.7010 +NTOSAPI
  2.7011 +VOID
  2.7012 +DDKAPI
  2.7013 +IoStartNextPacket(
  2.7014 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7015 +  /*IN*/ BOOLEAN  Cancelable);
  2.7016 +
  2.7017 +NTOSAPI
  2.7018 +VOID
  2.7019 +DDKAPI
  2.7020 +IoStartNextPacketByKey(
  2.7021 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7022 +  /*IN*/ BOOLEAN  Cancelable,
  2.7023 +  /*IN*/ ULONG  Key);
  2.7024 +
  2.7025 +NTOSAPI
  2.7026 +VOID
  2.7027 +DDKAPI
  2.7028 +IoStartPacket(
  2.7029 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7030 +  /*IN*/ PIRP  Irp,
  2.7031 +  /*IN*/ PULONG  Key  /*OPTIONAL*/,
  2.7032 +  /*IN*/ PDRIVER_CANCEL  CancelFunction  /*OPTIONAL*/);
  2.7033 +
  2.7034 +NTOSAPI
  2.7035 +VOID
  2.7036 +DDKAPI
  2.7037 +IoStartTimer(
  2.7038 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.7039 +
  2.7040 +NTOSAPI
  2.7041 +VOID
  2.7042 +DDKAPI
  2.7043 +IoStopTimer(
  2.7044 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.7045 +
  2.7046 +NTOSAPI
  2.7047 +NTSTATUS
  2.7048 +DDKAPI
  2.7049 +IoUnregisterPlugPlayNotification(
  2.7050 +  /*IN*/ PVOID  NotificationEntry);
  2.7051 +
  2.7052 +NTOSAPI
  2.7053 +VOID
  2.7054 +DDKAPI
  2.7055 +IoUnregisterShutdownNotification(
  2.7056 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.7057 +
  2.7058 +NTOSAPI
  2.7059 +VOID
  2.7060 +DDKAPI
  2.7061 +IoUpdateShareAccess(
  2.7062 +  /*IN*/ PFILE_OBJECT  FileObject,
  2.7063 +  /*IN OUT*/ PSHARE_ACCESS  ShareAccess);
  2.7064 +
  2.7065 +NTOSAPI
  2.7066 +NTSTATUS
  2.7067 +DDKAPI
  2.7068 +IoVerifyPartitionTable(
  2.7069 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7070 +  /*IN*/ BOOLEAN  FixErrors);
  2.7071 +
  2.7072 +NTOSAPI
  2.7073 +NTSTATUS
  2.7074 +DDKAPI
  2.7075 +IoVolumeDeviceToDosName(
  2.7076 +  /*IN*/ PVOID  VolumeDeviceObject,
  2.7077 +  /*OUT*/ PUNICODE_STRING  DosName);
  2.7078 +
  2.7079 +NTOSAPI
  2.7080 +NTSTATUS
  2.7081 +DDKAPI
  2.7082 +IoWMIAllocateInstanceIds(
  2.7083 +  /*IN*/ GUID  *Guid,
  2.7084 +  /*IN*/ ULONG  InstanceCount,
  2.7085 +  /*OUT*/ ULONG  *FirstInstanceId);
  2.7086 +
  2.7087 +NTOSAPI
  2.7088 +ULONG
  2.7089 +DDKAPI
  2.7090 +IoWMIDeviceObjectToProviderId(
  2.7091 +  /*IN*/ PDEVICE_OBJECT  DeviceObject);
  2.7092 +
  2.7093 +NTOSAPI
  2.7094 +NTSTATUS
  2.7095 +DDKAPI
  2.7096 +IoWMIDeviceObjectToInstanceName(
  2.7097 +  /*IN*/ PVOID  DataBlockObject,
  2.7098 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7099 +  /*OUT*/ PUNICODE_STRING  InstanceName);
  2.7100 +
  2.7101 +NTOSAPI
  2.7102 +NTSTATUS
  2.7103 +DDKAPI
  2.7104 +IoWMIExecuteMethod(
  2.7105 +  /*IN*/ PVOID  DataBlockObject,
  2.7106 +  /*IN*/ PUNICODE_STRING  InstanceName,
  2.7107 +  /*IN*/ ULONG  MethodId,
  2.7108 +  /*IN*/ ULONG  InBufferSize,
  2.7109 +  /*IN OUT*/ PULONG  OutBufferSize,
  2.7110 +  /*IN OUT*/  PUCHAR  InOutBuffer);
  2.7111 +
  2.7112 +NTOSAPI
  2.7113 +NTSTATUS
  2.7114 +DDKAPI
  2.7115 +IoWMIHandleToInstanceName(
  2.7116 +  /*IN*/ PVOID  DataBlockObject,
  2.7117 +  /*IN*/ HANDLE  FileHandle,
  2.7118 +  /*OUT*/ PUNICODE_STRING  InstanceName);
  2.7119 +
  2.7120 +NTOSAPI
  2.7121 +NTSTATUS
  2.7122 +DDKAPI
  2.7123 +IoWMIOpenBlock(
  2.7124 +  /*IN*/ GUID  *DataBlockGuid,
  2.7125 +  /*IN*/ ULONG  DesiredAccess,
  2.7126 +  /*OUT*/ PVOID  *DataBlockObject);
  2.7127 +
  2.7128 +NTOSAPI
  2.7129 +NTSTATUS
  2.7130 +DDKAPI
  2.7131 +IoWMIQueryAllData(
  2.7132 +  /*IN*/ PVOID  DataBlockObject,
  2.7133 +  /*IN OUT*/ ULONG  *InOutBufferSize,
  2.7134 +  /*OUT*/ PVOID  OutBuffer);
  2.7135 +
  2.7136 +NTOSAPI
  2.7137 +NTSTATUS
  2.7138 +DDKAPI
  2.7139 +IoWMIQueryAllDataMultiple(
  2.7140 +  /*IN*/ PVOID  *DataBlockObjectList,
  2.7141 +  /*IN*/ ULONG  ObjectCount,
  2.7142 +  /*IN OUT*/ ULONG  *InOutBufferSize,
  2.7143 +  /*OUT*/ PVOID  OutBuffer);
  2.7144 +
  2.7145 +NTOSAPI
  2.7146 +NTSTATUS
  2.7147 +DDKAPI
  2.7148 +IoWMIQuerySingleInstance(
  2.7149 +  /*IN*/ PVOID  DataBlockObject,
  2.7150 +  /*IN*/ PUNICODE_STRING  InstanceName,
  2.7151 +  /*IN OUT*/ ULONG  *InOutBufferSize,
  2.7152 +  /*OUT*/ PVOID OutBuffer);
  2.7153 +
  2.7154 +NTOSAPI
  2.7155 +NTSTATUS
  2.7156 +DDKAPI
  2.7157 +IoWMIQuerySingleInstanceMultiple(
  2.7158 +  /*IN*/ PVOID  *DataBlockObjectList,
  2.7159 +  /*IN*/ PUNICODE_STRING  InstanceNames,
  2.7160 +  /*IN*/ ULONG  ObjectCount,
  2.7161 +  /*IN OUT*/ ULONG  *InOutBufferSize,
  2.7162 +  /*OUT*/ PVOID  OutBuffer);
  2.7163 +
  2.7164 +NTOSAPI
  2.7165 +NTSTATUS
  2.7166 +DDKAPI
  2.7167 +IoWMIRegistrationControl(
  2.7168 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7169 +  /*IN*/ ULONG  Action);
  2.7170 +
  2.7171 +NTOSAPI
  2.7172 +NTSTATUS
  2.7173 +DDKAPI
  2.7174 +IoWMISetNotificationCallback(
  2.7175 +  /*IN*/ PVOID  Object,
  2.7176 +  /*IN*/ WMI_NOTIFICATION_CALLBACK  Callback,
  2.7177 +  /*IN*/ PVOID  Context);
  2.7178 +
  2.7179 +NTOSAPI
  2.7180 +NTSTATUS
  2.7181 +DDKAPI
  2.7182 +IoWMISetSingleInstance(
  2.7183 +  /*IN*/ PVOID  DataBlockObject,
  2.7184 +  /*IN*/ PUNICODE_STRING  InstanceName,
  2.7185 +  /*IN*/ ULONG  Version,
  2.7186 +  /*IN*/ ULONG  ValueBufferSize,
  2.7187 +  /*IN*/ PVOID  ValueBuffer);
  2.7188 +
  2.7189 +NTOSAPI
  2.7190 +NTSTATUS
  2.7191 +DDKAPI
  2.7192 +IoWMISetSingleItem(
  2.7193 +  /*IN*/ PVOID  DataBlockObject,
  2.7194 +  /*IN*/ PUNICODE_STRING  InstanceName,
  2.7195 +  /*IN*/ ULONG  DataItemId,
  2.7196 +  /*IN*/ ULONG  Version,
  2.7197 +  /*IN*/ ULONG  ValueBufferSize,
  2.7198 +  /*IN*/ PVOID  ValueBuffer);
  2.7199 +
  2.7200 +NTOSAPI
  2.7201 +NTSTATUS
  2.7202 +DDKAPI
  2.7203 +IoWMISuggestInstanceName(
  2.7204 +  /*IN*/ PDEVICE_OBJECT  PhysicalDeviceObject /*OPTIONAL*/,
  2.7205 +  /*IN*/ PUNICODE_STRING  SymbolicLinkName /*OPTIONAL*/,
  2.7206 +  /*IN*/ BOOLEAN  CombineNames,
  2.7207 +  /*OUT*/ PUNICODE_STRING  SuggestedInstanceName);
  2.7208 +
  2.7209 +NTOSAPI
  2.7210 +NTSTATUS
  2.7211 +DDKAPI
  2.7212 +IoWMIWriteEvent(
  2.7213 +  /*IN*/ PVOID  WnodeEventItem);
  2.7214 +
  2.7215 +NTOSAPI
  2.7216 +VOID
  2.7217 +DDKAPI
  2.7218 +IoWriteErrorLogEntry(
  2.7219 +  /*IN*/ PVOID  ElEntry);
  2.7220 +
  2.7221 +NTOSAPI
  2.7222 +NTSTATUS
  2.7223 +DDKAPI
  2.7224 +IoWritePartitionTableEx(
  2.7225 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.7226 +  /*IN*/ struct _DRIVE_LAYOUT_INFORMATION_EX  *PartitionBuffer);
  2.7227 +
  2.7228 +
  2.7229 +
  2.7230 +/** Kernel routines **/
  2.7231 +
  2.7232 +NTOSAPI
  2.7233 +VOID
  2.7234 +DDKFASTAPI
  2.7235 +KeAcquireInStackQueuedSpinLock(
  2.7236 +  /*IN*/ PKSPIN_LOCK  SpinLock,
  2.7237 +  /*IN*/ PKLOCK_QUEUE_HANDLE  LockHandle);
  2.7238 +
  2.7239 +NTOSAPI
  2.7240 +VOID
  2.7241 +DDKFASTAPI
  2.7242 +KeAcquireInStackQueuedSpinLockAtDpcLevel(
  2.7243 +  /*IN*/ PKSPIN_LOCK  SpinLock,
  2.7244 +  /*IN*/ PKLOCK_QUEUE_HANDLE  LockHandle);
  2.7245 +
  2.7246 +NTOSAPI
  2.7247 +KIRQL
  2.7248 +DDKAPI
  2.7249 +KeAcquireInterruptSpinLock(
  2.7250 +  /*IN*/ PKINTERRUPT  Interrupt);
  2.7251 +
  2.7252 +NTOSAPI
  2.7253 +VOID
  2.7254 +DDKAPI
  2.7255 +KeAcquireSpinLock(
  2.7256 +  /*IN*/ PKSPIN_LOCK  SpinLock,
  2.7257 +  /*OUT*/ PKIRQL  OldIrql);
  2.7258 +
  2.7259 +/* System Service Dispatch Table */
  2.7260 +typedef PVOID (NTAPI * SSDT)(VOID);
  2.7261 +typedef SSDT * PSSDT;
  2.7262 +
  2.7263 +/* System Service Parameters Table */
  2.7264 +typedef UCHAR SSPT, * PSSPT;
  2.7265 +
  2.7266 +typedef struct _SSDT_ENTRY {
  2.7267 +	PSSDT  SSDT;
  2.7268 +	PULONG  ServiceCounterTable;
  2.7269 +	ULONG  NumberOfServices;
  2.7270 +	PSSPT  SSPT;
  2.7271 +} SSDT_ENTRY, *PSSDT_ENTRY;
  2.7272 +
  2.7273 +NTOSAPI
  2.7274 +BOOLEAN
  2.7275 +DDKAPI
  2.7276 +KeAddSystemServiceTable(
  2.7277 +  /*IN*/ PSSDT  SSDT,
  2.7278 +  /*IN*/ PULONG  ServiceCounterTable,
  2.7279 +  /*IN*/ ULONG  NumberOfServices,
  2.7280 +  /*IN*/ PSSPT  SSPT,
  2.7281 +  /*IN*/ ULONG  TableIndex);
  2.7282 +
  2.7283 +NTOSAPI
  2.7284 +BOOLEAN
  2.7285 +DDKAPI
  2.7286 +KeAreApcsDisabled(
  2.7287 +  VOID);
  2.7288 +
  2.7289 +NTOSAPI
  2.7290 +VOID
  2.7291 +DDKAPI
  2.7292 +KeAttachProcess(
  2.7293 +  /*IN*/ PEPROCESS  Process);
  2.7294 +
  2.7295 +NTOSAPI
  2.7296 +VOID
  2.7297 +DDKAPI
  2.7298 +KeBugCheck(
  2.7299 +  /*IN*/ ULONG  BugCheckCode);
  2.7300 +
  2.7301 +NTOSAPI
  2.7302 +VOID
  2.7303 +DDKAPI
  2.7304 +KeBugCheckEx(
  2.7305 +  /*IN*/ ULONG  BugCheckCode,
  2.7306 +  /*IN*/ ULONG_PTR  BugCheckParameter1,
  2.7307 +  /*IN*/ ULONG_PTR  BugCheckParameter2,
  2.7308 +  /*IN*/ ULONG_PTR  BugCheckParameter3,
  2.7309 +  /*IN*/ ULONG_PTR  BugCheckParameter4);
  2.7310 +
  2.7311 +NTOSAPI
  2.7312 +BOOLEAN
  2.7313 +DDKAPI
  2.7314 +KeCancelTimer(
  2.7315 +  /*IN*/ PKTIMER  Timer);
  2.7316 +
  2.7317 +NTOSAPI
  2.7318 +VOID
  2.7319 +DDKAPI
  2.7320 +KeClearEvent(
  2.7321 +  /*IN*/ PRKEVENT  Event);
  2.7322 +
  2.7323 +NTOSAPI
  2.7324 +NTSTATUS
  2.7325 +DDKAPI
  2.7326 +KeDelayExecutionThread(
  2.7327 +  /*IN*/ KPROCESSOR_MODE  WaitMode,
  2.7328 +  /*IN*/ BOOLEAN  Alertable,
  2.7329 +  /*IN*/ PLARGE_INTEGER  Interval);
  2.7330 +
  2.7331 +NTOSAPI
  2.7332 +BOOLEAN
  2.7333 +DDKAPI
  2.7334 +KeDeregisterBugCheckCallback(
  2.7335 +  /*IN*/ PKBUGCHECK_CALLBACK_RECORD  CallbackRecord);
  2.7336 +
  2.7337 +NTOSAPI
  2.7338 +VOID
  2.7339 +DDKAPI
  2.7340 +KeDetachProcess(
  2.7341 +  VOID);
  2.7342 +
  2.7343 +NTOSAPI
  2.7344 +VOID
  2.7345 +DDKAPI
  2.7346 +KeEnterCriticalRegion(
  2.7347 +  VOID);
  2.7348 +
  2.7349 +/*
  2.7350 + * VOID
  2.7351 + * KeFlushIoBuffers(
  2.7352 + * IN PMDL  Mdl,
  2.7353 + * IN BOOLEAN  ReadOperation,
  2.7354 + * IN BOOLEAN  DmaOperation)
  2.7355 + */
  2.7356 +#define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation)
  2.7357 +
  2.7358 +NTOSAPI
  2.7359 +PRKTHREAD
  2.7360 +DDKAPI
  2.7361 +KeGetCurrentThread(
  2.7362 +  VOID);
  2.7363 +
  2.7364 +NTOSAPI
  2.7365 +KPROCESSOR_MODE
  2.7366 +DDKAPI
  2.7367 +KeGetPreviousMode(
  2.7368 +  VOID);
  2.7369 +
  2.7370 +NTOSAPI
  2.7371 +ULONG
  2.7372 +DDKAPI
  2.7373 +KeGetRecommendedSharedDataAlignment(
  2.7374 +  VOID);
  2.7375 +
  2.7376 +NTOSAPI
  2.7377 +VOID
  2.7378 +DDKAPI
  2.7379 +KeInitializeApc(
  2.7380 +  /*IN*/ PKAPC  Apc,
  2.7381 +  /*IN*/ PKTHREAD  Thread,
  2.7382 +  /*IN*/ UCHAR  StateIndex,
  2.7383 +  /*IN*/ PKKERNEL_ROUTINE  KernelRoutine,
  2.7384 +  /*IN*/ PKRUNDOWN_ROUTINE  RundownRoutine,
  2.7385 +  /*IN*/ PKNORMAL_ROUTINE  NormalRoutine,
  2.7386 +  /*IN*/ UCHAR  Mode,
  2.7387 +  /*IN*/ PVOID  Context);
  2.7388 +
  2.7389 +NTOSAPI
  2.7390 +VOID
  2.7391 +DDKAPI
  2.7392 +KeInitializeDeviceQueue(
  2.7393 +  /*IN*/ PKDEVICE_QUEUE  DeviceQueue);
  2.7394 +
  2.7395 +NTOSAPI
  2.7396 +VOID
  2.7397 +DDKAPI
  2.7398 +KeInitializeMutex(
  2.7399 +  /*IN*/ PRKMUTEX  Mutex,
  2.7400 +  /*IN*/ ULONG  Level);
  2.7401 +
  2.7402 +NTOSAPI
  2.7403 +VOID
  2.7404 +DDKAPI
  2.7405 +KeInitializeSemaphore(
  2.7406 +  /*IN*/ PRKSEMAPHORE  Semaphore,
  2.7407 +  /*IN*/ LONG  Count,
  2.7408 +  /*IN*/ LONG  Limit);
  2.7409 +
  2.7410 +NTOSAPI
  2.7411 +VOID
  2.7412 +DDKAPI
  2.7413 +KeInitializeSpinLock(
  2.7414 +  /*IN*/ PKSPIN_LOCK  SpinLock);
  2.7415 +
  2.7416 +NTOSAPI
  2.7417 +VOID
  2.7418 +DDKAPI
  2.7419 +KeInitializeTimer(
  2.7420 +  /*IN*/ PKTIMER  Timer);
  2.7421 +
  2.7422 +NTOSAPI
  2.7423 +VOID
  2.7424 +DDKAPI
  2.7425 +KeInitializeTimerEx(
  2.7426 +  /*IN*/ PKTIMER  Timer,
  2.7427 +  /*IN*/ TIMER_TYPE  Type);
  2.7428 +
  2.7429 +NTOSAPI
  2.7430 +BOOLEAN
  2.7431 +DDKAPI
  2.7432 +KeInsertByKeyDeviceQueue(
  2.7433 +  /*IN*/ PKDEVICE_QUEUE  DeviceQueue,
  2.7434 +  /*IN*/ PKDEVICE_QUEUE_ENTRY  DeviceQueueEntry,
  2.7435 +  /*IN*/ ULONG  SortKey);
  2.7436 +
  2.7437 +NTOSAPI
  2.7438 +BOOLEAN
  2.7439 +DDKAPI
  2.7440 +KeInsertDeviceQueue(
  2.7441 +  /*IN*/ PKDEVICE_QUEUE  DeviceQueue,
  2.7442 +  /*IN*/ PKDEVICE_QUEUE_ENTRY  DeviceQueueEntry);
  2.7443 +
  2.7444 +NTOSAPI
  2.7445 +BOOLEAN
  2.7446 +DDKAPI
  2.7447 +KeInsertQueueDpc(
  2.7448 +  /*IN*/ PRKDPC  Dpc,
  2.7449 +  /*IN*/ PVOID  SystemArgument1,
  2.7450 +  /*IN*/ PVOID  SystemArgument2);
  2.7451 +
  2.7452 +NTOSAPI
  2.7453 +VOID
  2.7454 +DDKAPI
  2.7455 +KeLeaveCriticalRegion(
  2.7456 +  VOID);
  2.7457 +
  2.7458 +NTOSAPI
  2.7459 +NTSTATUS
  2.7460 +DDKAPI
  2.7461 +KePulseEvent(
  2.7462 +  /*IN*/ PRKEVENT  Event,
  2.7463 +  /*IN*/ KPRIORITY  Increment,
  2.7464 +  /*IN*/ BOOLEAN  Wait);
  2.7465 +
  2.7466 +NTOSAPI
  2.7467 +ULONGLONG
  2.7468 +DDKAPI
  2.7469 +KeQueryInterruptTime(
  2.7470 +  VOID);
  2.7471 +
  2.7472 +NTOSAPI
  2.7473 +LARGE_INTEGER
  2.7474 +DDKAPI
  2.7475 +KeQueryPerformanceCounter(
  2.7476 +  /*OUT*/ PLARGE_INTEGER  PerformanceFrequency  /*OPTIONAL*/);
  2.7477 +
  2.7478 +NTOSAPI
  2.7479 +KPRIORITY
  2.7480 +DDKAPI
  2.7481 +KeQueryPriorityThread(
  2.7482 +  /*IN*/ PRKTHREAD  Thread);
  2.7483 +
  2.7484 +NTOSAPI
  2.7485 +VOID
  2.7486 +DDKAPI
  2.7487 +KeQuerySystemTime(
  2.7488 +  /*OUT*/ PLARGE_INTEGER  CurrentTime);
  2.7489 +
  2.7490 +NTOSAPI
  2.7491 +VOID
  2.7492 +DDKAPI
  2.7493 +KeQueryTickCount(
  2.7494 +  /*OUT*/ PLARGE_INTEGER  TickCount);
  2.7495 +
  2.7496 +NTOSAPI
  2.7497 +ULONG
  2.7498 +DDKAPI
  2.7499 +KeQueryTimeIncrement(
  2.7500 +  VOID);
  2.7501 +
  2.7502 +NTOSAPI
  2.7503 +LONG
  2.7504 +DDKAPI
  2.7505 +KeReadStateEvent(
  2.7506 +  /*IN*/ PRKEVENT  Event);
  2.7507 +
  2.7508 +NTOSAPI
  2.7509 +LONG
  2.7510 +DDKAPI
  2.7511 +KeReadStateMutex(
  2.7512 +  /*IN*/ PRKMUTEX  Mutex);
  2.7513 +
  2.7514 +NTOSAPI
  2.7515 +LONG
  2.7516 +DDKAPI
  2.7517 +KeReadStateSemaphore(
  2.7518 +  /*IN*/ PRKSEMAPHORE  Semaphore);
  2.7519 +
  2.7520 +NTOSAPI
  2.7521 +BOOLEAN
  2.7522 +DDKAPI
  2.7523 +KeReadStateTimer(
  2.7524 +  /*IN*/ PKTIMER  Timer);
  2.7525 +
  2.7526 +NTOSAPI
  2.7527 +BOOLEAN
  2.7528 +DDKAPI
  2.7529 +KeRegisterBugCheckCallback(
  2.7530 +  /*IN*/ PKBUGCHECK_CALLBACK_RECORD  CallbackRecord,
  2.7531 +  /*IN*/ PKBUGCHECK_CALLBACK_ROUTINE  CallbackRoutine,
  2.7532 +  /*IN*/ PVOID  Buffer,
  2.7533 +  /*IN*/ ULONG  Length,
  2.7534 +  /*IN*/ PUCHAR  Component);
  2.7535 +
  2.7536 +NTOSAPI
  2.7537 +VOID
  2.7538 +DDKFASTAPI
  2.7539 +KeReleaseInStackQueuedSpinLock(
  2.7540 +  /*IN*/ PKLOCK_QUEUE_HANDLE  LockHandle);
  2.7541 +
  2.7542 +NTOSAPI
  2.7543 +VOID
  2.7544 +DDKFASTAPI
  2.7545 +KeReleaseInStackQueuedSpinLockFromDpcLevel(
  2.7546 +  /*IN*/ PKLOCK_QUEUE_HANDLE  LockHandle);
  2.7547 +
  2.7548 +NTOSAPI
  2.7549 +VOID
  2.7550 +DDKAPI
  2.7551 +KeReleaseInterruptSpinLock(
  2.7552 +  /*IN*/ PKINTERRUPT  Interrupt,
  2.7553 +  /*IN*/ KIRQL  OldIrql);
  2.7554 +
  2.7555 +NTOSAPI
  2.7556 +LONG
  2.7557 +DDKAPI
  2.7558 +KeReleaseMutex(
  2.7559 +  /*IN*/ PRKMUTEX  Mutex,
  2.7560 +  /*IN*/ BOOLEAN  Wait);
  2.7561 +
  2.7562 +NTOSAPI
  2.7563 +LONG
  2.7564 +DDKAPI
  2.7565 +KeReleaseSemaphore(
  2.7566 +  /*IN*/ PRKSEMAPHORE  Semaphore,
  2.7567 +  /*IN*/ KPRIORITY  Increment,
  2.7568 +  /*IN*/ LONG  Adjustment,
  2.7569 +  /*IN*/ BOOLEAN  Wait);
  2.7570 +
  2.7571 +NTOSAPI
  2.7572 +VOID
  2.7573 +DDKAPI
  2.7574 +KeReleaseSpinLock(
  2.7575 +  /*IN*/ PKSPIN_LOCK  SpinLock,
  2.7576 +  /*IN*/ KIRQL  NewIrql);
  2.7577 +
  2.7578 +NTOSAPI
  2.7579 +PKDEVICE_QUEUE_ENTRY
  2.7580 +DDKAPI 
  2.7581 +KeRemoveByKeyDeviceQueue(
  2.7582 +  /*IN*/ PKDEVICE_QUEUE  DeviceQueue,
  2.7583 +  /*IN*/ ULONG  SortKey);
  2.7584 +
  2.7585 +NTOSAPI
  2.7586 +PKDEVICE_QUEUE_ENTRY
  2.7587 +DDKAPI
  2.7588 +KeRemoveDeviceQueue(
  2.7589 +  /*IN*/ PKDEVICE_QUEUE  DeviceQueue);
  2.7590 +
  2.7591 +NTOSAPI
  2.7592 +BOOLEAN
  2.7593 +DDKAPI
  2.7594 +KeRemoveEntryDeviceQueue(
  2.7595 +  /*IN*/ PKDEVICE_QUEUE  DeviceQueue,
  2.7596 +  /*IN*/ PKDEVICE_QUEUE_ENTRY  DeviceQueueEntry);
  2.7597 +
  2.7598 +NTOSAPI
  2.7599 +BOOLEAN
  2.7600 +DDKAPI
  2.7601 +KeRemoveQueueDpc(
  2.7602 +  /*IN*/ PRKDPC  Dpc);
  2.7603 +
  2.7604 +NTOSAPI
  2.7605 +LONG
  2.7606 +DDKAPI
  2.7607 +KeResetEvent(
  2.7608 +  /*IN*/ PRKEVENT  Event);
  2.7609 +
  2.7610 +NTOSAPI
  2.7611 +NTSTATUS
  2.7612 +DDKAPI
  2.7613 +KeRestoreFloatingPointState(
  2.7614 +  /*IN*/ PKFLOATING_SAVE  FloatSave);
  2.7615 +
  2.7616 +NTOSAPI
  2.7617 +NTSTATUS
  2.7618 +DDKAPI
  2.7619 +KeSaveFloatingPointState(
  2.7620 +  /*OUT*/ PKFLOATING_SAVE  FloatSave);
  2.7621 +
  2.7622 +NTOSAPI
  2.7623 +LONG
  2.7624 +DDKAPI
  2.7625 +KeSetBasePriorityThread(
  2.7626 +  /*IN*/ PRKTHREAD  Thread,
  2.7627 +  /*IN*/ LONG  Increment);
  2.7628 +
  2.7629 +NTOSAPI
  2.7630 +LONG
  2.7631 +DDKAPI
  2.7632 +KeSetEvent(
  2.7633 +  /*IN*/ PRKEVENT  Event,
  2.7634 +  /*IN*/ KPRIORITY  Increment,
  2.7635 +  /*IN*/ BOOLEAN  Wait);
  2.7636 +
  2.7637 +NTOSAPI
  2.7638 +VOID
  2.7639 +DDKAPI
  2.7640 +KeSetImportanceDpc(
  2.7641 +  /*IN*/ PRKDPC  Dpc,
  2.7642 +  /*IN*/ KDPC_IMPORTANCE  Importance);
  2.7643 +
  2.7644 +NTOSAPI
  2.7645 +KPRIORITY
  2.7646 +DDKAPI
  2.7647 +KeSetPriorityThread(
  2.7648 +  /*IN*/ PKTHREAD  Thread,
  2.7649 +  /*IN*/ KPRIORITY  Priority);
  2.7650 +
  2.7651 +NTOSAPI
  2.7652 +VOID
  2.7653 +DDKAPI
  2.7654 +KeSetTargetProcessorDpc(
  2.7655 +  /*IN*/ PRKDPC  Dpc,
  2.7656 +  /*IN*/ CCHAR  Number);
  2.7657 +
  2.7658 +NTOSAPI
  2.7659 +BOOLEAN
  2.7660 +DDKAPI
  2.7661 +KeSetTimer(
  2.7662 +  /*IN*/ PKTIMER  Timer,
  2.7663 +  /*IN*/ LARGE_INTEGER  DueTime,
  2.7664 +  /*IN*/ PKDPC  Dpc  /*OPTIONAL*/);
  2.7665 +
  2.7666 +NTOSAPI
  2.7667 +BOOLEAN
  2.7668 +DDKAPI
  2.7669 +KeSetTimerEx(
  2.7670 +  /*IN*/ PKTIMER  Timer,
  2.7671 +  /*IN*/ LARGE_INTEGER  DueTime,
  2.7672 +  /*IN*/ LONG  Period  /*OPTIONAL*/,
  2.7673 +  /*IN*/ PKDPC  Dpc  /*OPTIONAL*/);
  2.7674 +
  2.7675 +NTOSAPI
  2.7676 +VOID
  2.7677 +DDKFASTAPI
  2.7678 +KeSetTimeUpdateNotifyRoutine(
  2.7679 +  /*IN*/ PTIME_UPDATE_NOTIFY_ROUTINE  NotifyRoutine);
  2.7680 +
  2.7681 +NTOSAPI
  2.7682 +VOID
  2.7683 +DDKAPI
  2.7684 +KeStallExecutionProcessor(
  2.7685 +  /*IN*/ ULONG  MicroSeconds);
  2.7686 +
  2.7687 +NTOSAPI
  2.7688 +BOOLEAN
  2.7689 +DDKAPI
  2.7690 +KeSynchronizeExecution(
  2.7691 +  /*IN*/ PKINTERRUPT    Interrupt,
  2.7692 +  /*IN*/ PKSYNCHRONIZE_ROUTINE  SynchronizeRoutine,
  2.7693 +  /*IN*/ PVOID  SynchronizeContext);
  2.7694 +
  2.7695 +NTOSAPI
  2.7696 +NTSTATUS
  2.7697 +DDKAPI
  2.7698 +KeWaitForMultipleObjects(
  2.7699 +  /*IN*/ ULONG  Count,
  2.7700 +  /*IN*/ PVOID  Object[],
  2.7701 +  /*IN*/ WAIT_TYPE  WaitType,
  2.7702 +  /*IN*/ KWAIT_REASON  WaitReason,
  2.7703 +  /*IN*/ KPROCESSOR_MODE  WaitMode,
  2.7704 +  /*IN*/ BOOLEAN  Alertable,
  2.7705 +  /*IN*/ PLARGE_INTEGER  Timeout  /*OPTIONAL */,
  2.7706 +  /*IN*/ PKWAIT_BLOCK  WaitBlockArray  /*OPTIONAL*/);
  2.7707 +
  2.7708 +NTOSAPI
  2.7709 +NTSTATUS
  2.7710 +DDKAPI
  2.7711 +KeWaitForMutexObject(
  2.7712 +  /*IN*/ PRKMUTEX  Mutex,
  2.7713 +  /*IN*/ KWAIT_REASON  WaitReason,
  2.7714 +  /*IN*/ KPROCESSOR_MODE  WaitMode,
  2.7715 +  /*IN*/ BOOLEAN  Alertable,
  2.7716 +  /*IN*/ PLARGE_INTEGER  Timeout  /*OPTIONAL*/);
  2.7717 +
  2.7718 +NTOSAPI
  2.7719 +NTSTATUS
  2.7720 +DDKAPI
  2.7721 +KeWaitForSingleObject(
  2.7722 +  /*IN*/ PVOID  Object,
  2.7723 +  /*IN*/ KWAIT_REASON  WaitReason,
  2.7724 +  /*IN*/ KPROCESSOR_MODE  WaitMode,
  2.7725 +  /*IN*/ BOOLEAN  Alertable,
  2.7726 +  /*IN*/ PLARGE_INTEGER  Timeout  /*OPTIONAL*/);
  2.7727 +
  2.7728 +#if defined(_X86_)
  2.7729 +
  2.7730 +NTOSAPI
  2.7731 +VOID
  2.7732 +FASTCALL
  2.7733 +KfLowerIrql(
  2.7734 +  /*IN*/ KIRQL  NewIrql);
  2.7735 +
  2.7736 +NTOSAPI
  2.7737 +KIRQL
  2.7738 +FASTCALL
  2.7739 +KfRaiseIrql(
  2.7740 +  /*IN*/ KIRQL  NewIrql);
  2.7741 +
  2.7742 +#define KeLowerIrql(a) KfLowerIrql(a)
  2.7743 +#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
  2.7744 +
  2.7745 +#else
  2.7746 +
  2.7747 +NTOSAPI
  2.7748 +VOID
  2.7749 +DDKAPI
  2.7750 +KeLowerIrql(
  2.7751 +  /*IN*/ KIRQL  NewIrql);
  2.7752 +
  2.7753 +NTOSAPI
  2.7754 +KIRQL
  2.7755 +DDKAPI
  2.7756 +KeRaiseIrql(
  2.7757 +  /*IN*/ KIRQL  NewIrql);
  2.7758 +
  2.7759 +#endif
  2.7760 +
  2.7761 +NTOSAPI
  2.7762 +KIRQL
  2.7763 +DDKAPI
  2.7764 +KeRaiseIrqlToDpcLevel(
  2.7765 +  VOID);
  2.7766 +
  2.7767 +/** Memory manager routines **/
  2.7768 +
  2.7769 +NTOSAPI
  2.7770 +NTSTATUS
  2.7771 +DDKAPI
  2.7772 +MmAdvanceMdl(
  2.7773 +  /*IN*/ PMDL  Mdl,
  2.7774 +  /*IN*/ ULONG  NumberOfBytes);
  2.7775 +
  2.7776 +NTOSAPI
  2.7777 +PVOID
  2.7778 +DDKAPI
  2.7779 +MmAllocateContiguousMemory(
  2.7780 +  /*IN*/ ULONG  NumberOfBytes,
  2.7781 +  /*IN*/ PHYSICAL_ADDRESS  HighestAcceptableAddress);
  2.7782 +
  2.7783 +NTOSAPI
  2.7784 +PVOID
  2.7785 +DDKAPI
  2.7786 +MmAllocateContiguousMemorySpecifyCache(
  2.7787 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.7788 +  /*IN*/ PHYSICAL_ADDRESS  LowestAcceptableAddress,
  2.7789 +  /*IN*/ PHYSICAL_ADDRESS  HighestAcceptableAddress,
  2.7790 +  /*IN*/ PHYSICAL_ADDRESS  BoundaryAddressMultiple  /*OPTIONAL*/,
  2.7791 +  /*IN*/ MEMORY_CACHING_TYPE  CacheType);
  2.7792 +
  2.7793 +NTOSAPI
  2.7794 +PVOID
  2.7795 +DDKAPI
  2.7796 +MmAllocateMappingAddress(
  2.7797 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.7798 +  /*IN*/ ULONG  PoolTag);
  2.7799 +
  2.7800 +NTOSAPI
  2.7801 +PVOID
  2.7802 +DDKAPI
  2.7803 +MmAllocateNonCachedMemory(
  2.7804 +  /*IN*/ ULONG  NumberOfBytes);
  2.7805 +
  2.7806 +NTOSAPI
  2.7807 +PMDL
  2.7808 +DDKAPI
  2.7809 +MmAllocatePagesForMdl(
  2.7810 +  /*IN*/ PHYSICAL_ADDRESS  LowAddress,
  2.7811 +  /*IN*/ PHYSICAL_ADDRESS  HighAddress,
  2.7812 +  /*IN*/ PHYSICAL_ADDRESS  SkipBytes,
  2.7813 +  /*IN*/ SIZE_T  TotalBytes);
  2.7814 +
  2.7815 +NTOSAPI
  2.7816 +VOID
  2.7817 +DDKAPI
  2.7818 +MmBuildMdlForNonPagedPool(
  2.7819 +  /*IN OUT*/ PMDL  MemoryDescriptorList);
  2.7820 +
  2.7821 +NTOSAPI
  2.7822 +NTSTATUS
  2.7823 +DDKAPI
  2.7824 +MmCreateSection(
  2.7825 +  /*OUT*/ PSECTION_OBJECT  *SectionObject,
  2.7826 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.7827 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes  /*OPTIONAL*/,
  2.7828 +  /*IN*/ PLARGE_INTEGER  MaximumSize,
  2.7829 +  /*IN*/ ULONG  SectionPageProtection,
  2.7830 +  /*IN*/ ULONG  AllocationAttributes,
  2.7831 +  /*IN*/ HANDLE  FileHandle  /*OPTIONAL*/,
  2.7832 +  /*IN*/ PFILE_OBJECT  File  /*OPTIONAL*/);
  2.7833 +
  2.7834 +typedef enum _MMFLUSH_TYPE {
  2.7835 +  MmFlushForDelete,
  2.7836 +  MmFlushForWrite
  2.7837 +} MMFLUSH_TYPE;
  2.7838 +
  2.7839 +NTOSAPI
  2.7840 +BOOLEAN
  2.7841 +DDKAPI
  2.7842 +MmFlushImageSection(
  2.7843 +  /*IN*/ PSECTION_OBJECT_POINTERS  SectionObjectPointer,
  2.7844 +  /*IN*/ MMFLUSH_TYPE  FlushType);
  2.7845 +
  2.7846 +NTOSAPI
  2.7847 +VOID
  2.7848 +DDKAPI
  2.7849 +MmFreeContiguousMemory(
  2.7850 +  /*IN*/ PVOID  BaseAddress);
  2.7851 +
  2.7852 +NTOSAPI
  2.7853 +VOID
  2.7854 +DDKAPI
  2.7855 +MmFreeContiguousMemorySpecifyCache(
  2.7856 +  /*IN*/ PVOID  BaseAddress,
  2.7857 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.7858 +  /*IN*/ MEMORY_CACHING_TYPE  CacheType);
  2.7859 +
  2.7860 +NTOSAPI
  2.7861 +VOID
  2.7862 +DDKAPI
  2.7863 +MmFreeMappingAddress(
  2.7864 +  /*IN*/ PVOID  BaseAddress,
  2.7865 +  /*IN*/ ULONG  PoolTag);
  2.7866 +
  2.7867 +NTOSAPI
  2.7868 +VOID
  2.7869 +DDKAPI
  2.7870 +MmFreeNonCachedMemory(
  2.7871 +  /*IN*/ PVOID  BaseAddress,
  2.7872 +  /*IN*/ SIZE_T  NumberOfBytes);
  2.7873 +
  2.7874 +NTOSAPI
  2.7875 +VOID
  2.7876 +DDKAPI
  2.7877 +MmFreePagesFromMdl(
  2.7878 +  /*IN*/ PMDL  MemoryDescriptorList);
  2.7879 +
  2.7880 +/*
  2.7881 + * ULONG
  2.7882 + * MmGetMdlByteCount(
  2.7883 + * IN PMDL  Mdl)
  2.7884 + */
  2.7885 +#define MmGetMdlByteCount(_Mdl) \
  2.7886 +  ((_Mdl)->ByteCount)
  2.7887 +
  2.7888 +/*
  2.7889 + * ULONG
  2.7890 + * MmGetMdlByteOffset(
  2.7891 + * IN PMDL  Mdl)
  2.7892 + */
  2.7893 +#define MmGetMdlByteOffset(_Mdl) \
  2.7894 +  ((_Mdl)->ByteOffset)
  2.7895 +
  2.7896 +/*
  2.7897 + * PPFN_NUMBER
  2.7898 + * MmGetMdlPfnArray(
  2.7899 + * IN PMDL  Mdl)
  2.7900 + */
  2.7901 +#define MmGetMdlPfnArray(_Mdl) \
  2.7902 +  ((PPFN_NUMBER) ((_Mdl) + 1))
  2.7903 +
  2.7904 +/*
  2.7905 + * PVOID
  2.7906 + * MmGetMdlVirtualAddress(
  2.7907 + * IN PMDL  Mdl)
  2.7908 + */
  2.7909 +#define MmGetMdlVirtualAddress(_Mdl) \
  2.7910 +  ((PVOID) ((PCHAR) ((_Mdl)->StartVa) + (_Mdl)->ByteOffset))
  2.7911 +
  2.7912 +NTOSAPI
  2.7913 +PHYSICAL_ADDRESS
  2.7914 +DDKAPI
  2.7915 +MmGetPhysicalAddress(
  2.7916 +  /*IN*/ PVOID  BaseAddress);
  2.7917 +
  2.7918 +NTOSAPI
  2.7919 +PPHYSICAL_MEMORY_RANGE
  2.7920 +DDKAPI
  2.7921 +MmGetPhysicalMemoryRanges(
  2.7922 +  VOID);
  2.7923 +
  2.7924 +NTOSAPI
  2.7925 +PVOID
  2.7926 +DDKAPI
  2.7927 +MmGetVirtualForPhysical(
  2.7928 +  /*IN*/ PHYSICAL_ADDRESS  PhysicalAddress);
  2.7929 +
  2.7930 +NTOSAPI
  2.7931 +PVOID
  2.7932 +DDKAPI
  2.7933 +MmMapLockedPagesSpecifyCache(
  2.7934 +  /*IN*/ PMDL  MemoryDescriptorList,
  2.7935 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.7936 +  /*IN*/ MEMORY_CACHING_TYPE  CacheType,
  2.7937 +  /*IN*/ PVOID  BaseAddress,
  2.7938 +  /*IN*/ ULONG  BugCheckOnFailure,
  2.7939 +  /*IN*/ MM_PAGE_PRIORITY  Priority);
  2.7940 +
  2.7941 +NTOSAPI
  2.7942 +PVOID
  2.7943 +DDKAPI
  2.7944 +MmMapLockedPagesWithReservedMapping(
  2.7945 +  /*IN*/ PVOID  MappingAddress,
  2.7946 +  /*IN*/ ULONG  PoolTag,
  2.7947 +  /*IN*/ PMDL  MemoryDescriptorList,
  2.7948 +  /*IN*/ MEMORY_CACHING_TYPE  CacheType);
  2.7949 +
  2.7950 +NTOSAPI
  2.7951 +NTSTATUS
  2.7952 +DDKAPI
  2.7953 +MmMapUserAddressesToPage(
  2.7954 +  /*IN*/ PVOID  BaseAddress,
  2.7955 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.7956 +  /*IN*/ PVOID  PageAddress);
  2.7957 +
  2.7958 +NTOSAPI
  2.7959 +PVOID
  2.7960 +DDKAPI
  2.7961 +MmMapVideoDisplay(
  2.7962 +  /*IN*/ PHYSICAL_ADDRESS  PhysicalAddress,
  2.7963 +  /*IN*/ SIZE_T  NumberOfBytes,
  2.7964 +  /*IN*/ MEMORY_CACHING_TYPE  CacheType);
  2.7965 +
  2.7966 +NTOSAPI
  2.7967 +NTSTATUS
  2.7968 +DDKAPI
  2.7969 +MmMapViewInSessionSpace(
  2.7970 +  /*IN*/ PVOID  Section,
  2.7971 +  /*OUT*/ PVOID  *MappedBase,
  2.7972 +  /*IN OUT*/ PSIZE_T  ViewSize);
  2.7973 +
  2.7974 +NTOSAPI
  2.7975 +NTSTATUS
  2.7976 +DDKAPI
  2.7977 +MmMapViewInSystemSpace(
  2.7978 +  /*IN*/ PVOID  Section,
  2.7979 +  /*OUT*/ PVOID  *MappedBase,
  2.7980 +  /*IN*/ PSIZE_T  ViewSize);
  2.7981 +
  2.7982 +NTOSAPI
  2.7983 +NTSTATUS
  2.7984 +DDKAPI
  2.7985 +MmMarkPhysicalMemoryAsBad(
  2.7986 +  /*IN*/ PPHYSICAL_ADDRESS  StartAddress,
  2.7987 +  /*IN OUT*/ PLARGE_INTEGER  NumberOfBytes);
  2.7988 +
  2.7989 +NTOSAPI
  2.7990 +NTSTATUS
  2.7991 +DDKAPI
  2.7992 +MmMarkPhysicalMemoryAsGood(
  2.7993 +  /*IN*/ PPHYSICAL_ADDRESS  StartAddress,
  2.7994 +  /*IN OUT*/ PLARGE_INTEGER  NumberOfBytes);
  2.7995 +
  2.7996 +/*
  2.7997 + * PVOID
  2.7998 + * MmGetSystemAddressForMdlSafe(
  2.7999 + * IN PMDL  Mdl,
  2.8000 + * IN MM_PAGE_PRIORITY  Priority)
  2.8001 + */
  2.8002 +#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority) \
  2.8003 +  ((_Mdl)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA \
  2.8004 +    | MDL_SOURCE_IS_NONPAGED_POOL)) ? \
  2.8005 +    (_Mdl)->MappedSystemVa : \
  2.8006 +    (PVOID) MmMapLockedPagesSpecifyCache((_Mdl), \
  2.8007 +      KernelMode, MmCached, NULL, FALSE, _Priority)
  2.8008 +
  2.8009 +NTOSAPI
  2.8010 +PVOID
  2.8011 +DDKAPI
  2.8012 +MmGetSystemRoutineAddress(
  2.8013 +  /*IN*/ PUNICODE_STRING  SystemRoutineName);
  2.8014 +
  2.8015 +/*
  2.8016 + * ULONG
  2.8017 + * ADDRESS_AND_SIZE_TO_SPAN_PAGES(
  2.8018 + * IN PVOID  Va,
  2.8019 + * IN ULONG  Size)
  2.8020 + */
  2.8021 +#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, \
  2.8022 +                                       _Size) \
  2.8023 +  ((ULONG) ((((ULONG_PTR) (_Va) & (PAGE_SIZE - 1)) \
  2.8024 +    + (_Size) + (PAGE_SIZE - 1)) >> PAGE_SHIFT))
  2.8025 +
  2.8026 +/*
  2.8027 + * VOID
  2.8028 + * MmInitializeMdl(
  2.8029 + * IN PMDL  MemoryDescriptorList,
  2.8030 + * IN PVOID  BaseVa,
  2.8031 + * IN SIZE_T  Length)
  2.8032 + */
  2.8033 +#define MmInitializeMdl(_MemoryDescriptorList, \
  2.8034 +                        _BaseVa, \
  2.8035 +                        _Length) \
  2.8036 +{ \
  2.8037 +  (_MemoryDescriptorList)->Next = (PMDL) NULL; \
  2.8038 +  (_MemoryDescriptorList)->Size = (CSHORT) (sizeof(MDL) + \
  2.8039 +    (sizeof(PFN_NUMBER) * ADDRESS_AND_SIZE_TO_SPAN_PAGES(_BaseVa, _Length))); \
  2.8040 +  (_MemoryDescriptorList)->MdlFlags = 0; \
  2.8041 +  (_MemoryDescriptorList)->StartVa = (PVOID) PAGE_ALIGN(_BaseVa); \
  2.8042 +  (_MemoryDescriptorList)->ByteOffset = BYTE_OFFSET(_BaseVa); \
  2.8043 +  (_MemoryDescriptorList)->ByteCount = (ULONG) _Length; \
  2.8044 +}
  2.8045 +
  2.8046 +NTOSAPI
  2.8047 +BOOLEAN
  2.8048 +DDKAPI
  2.8049 +MmIsAddressValid(
  2.8050 +  /*IN*/ PVOID  VirtualAddress);
  2.8051 +
  2.8052 +NTOSAPI
  2.8053 +LOGICAL
  2.8054 +DDKAPI
  2.8055 +MmIsDriverVerifying(
  2.8056 +  /*IN*/ PDRIVER_OBJECT  DriverObject);
  2.8057 +
  2.8058 +NTOSAPI
  2.8059 +BOOLEAN
  2.8060 +DDKAPI
  2.8061 +MmIsThisAnNtAsSystem(
  2.8062 +  VOID);
  2.8063 +
  2.8064 +NTOSAPI
  2.8065 +NTSTATUS
  2.8066 +DDKAPI
  2.8067 +MmIsVerifierEnabled(
  2.8068 +  /*OUT*/ PULONG  VerifierFlags);
  2.8069 +
  2.8070 +NTOSAPI
  2.8071 +PVOID
  2.8072 +DDKAPI
  2.8073 +MmLockPagableDataSection(
  2.8074 +  /*IN*/ PVOID  AddressWithinSection);
  2.8075 +
  2.8076 +NTOSAPI
  2.8077 +PVOID
  2.8078 +DDKAPI
  2.8079 +MmLockPagableImageSection(
  2.8080 +  /*IN*/ PVOID  AddressWithinSection);
  2.8081 +
  2.8082 +/*
  2.8083 + * PVOID
  2.8084 + * MmLockPagableCodeSection(
  2.8085 + * IN PVOID  AddressWithinSection)
  2.8086 + */
  2.8087 +#define MmLockPagableCodeSection MmLockPagableDataSection
  2.8088 +
  2.8089 +NTOSAPI
  2.8090 +VOID
  2.8091 +DDKAPI
  2.8092 +MmLockPagableSectionByHandle(
  2.8093 +  /*IN*/ PVOID  ImageSectionHandle);
  2.8094 +
  2.8095 +NTOSAPI
  2.8096 +PVOID
  2.8097 +DDKAPI
  2.8098 +MmMapIoSpace(
  2.8099 +  /*IN*/ PHYSICAL_ADDRESS  PhysicalAddress,
  2.8100 +  /*IN*/ ULONG  NumberOfBytes,
  2.8101 +  /*IN*/ MEMORY_CACHING_TYPE  CacheEnable);
  2.8102 +
  2.8103 +NTOSAPI
  2.8104 +PVOID
  2.8105 +DDKAPI
  2.8106 +MmMapLockedPages(
  2.8107 +  /*IN*/ PMDL  MemoryDescriptorList,
  2.8108 +  /*IN*/ KPROCESSOR_MODE  AccessMode);
  2.8109 +
  2.8110 +NTOSAPI
  2.8111 +VOID
  2.8112 +DDKAPI
  2.8113 +MmPageEntireDriver(
  2.8114 +  /*IN*/ PVOID  AddressWithinSection);
  2.8115 +
  2.8116 +NTOSAPI
  2.8117 +VOID
  2.8118 +DDKAPI
  2.8119 +MmProbeAndLockProcessPages(
  2.8120 +  /*IN OUT*/ PMDL  MemoryDescriptorList,
  2.8121 +  /*IN*/ PEPROCESS  Process,
  2.8122 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8123 +  /*IN*/ LOCK_OPERATION  Operation);
  2.8124 +
  2.8125 +NTOSAPI
  2.8126 +NTSTATUS
  2.8127 +DDKAPI
  2.8128 +MmProtectMdlSystemAddress(
  2.8129 +  /*IN*/ PMDL  MemoryDescriptorList,
  2.8130 +  /*IN*/ ULONG  NewProtect);
  2.8131 +
  2.8132 +NTOSAPI
  2.8133 +VOID
  2.8134 +DDKAPI
  2.8135 +MmUnmapLockedPages(
  2.8136 +  /*IN*/ PVOID  BaseAddress,
  2.8137 +  /*IN*/ PMDL  MemoryDescriptorList);
  2.8138 +
  2.8139 +NTOSAPI
  2.8140 +NTSTATUS
  2.8141 +DDKAPI
  2.8142 +MmUnmapViewInSessionSpace(
  2.8143 +  /*IN*/ PVOID  MappedBase);
  2.8144 +
  2.8145 +NTOSAPI
  2.8146 +NTSTATUS
  2.8147 +DDKAPI
  2.8148 +MmUnmapViewInSystemSpace(
  2.8149 +  /*IN*/ PVOID MappedBase);
  2.8150 +
  2.8151 +NTOSAPI
  2.8152 +VOID
  2.8153 +DDKAPI
  2.8154 +MmUnsecureVirtualMemory(
  2.8155 +  /*IN*/ HANDLE  SecureHandle);
  2.8156 +
  2.8157 +/*
  2.8158 + * VOID
  2.8159 + * MmPrepareMdlForReuse(
  2.8160 + * IN PMDL  Mdl)
  2.8161 + */
  2.8162 +#define MmPrepareMdlForReuse(_Mdl) \
  2.8163 +{ \
  2.8164 +  if (((_Mdl)->MdlFlags & MDL_PARTIAL_HAS_BEEN_MAPPED) != 0) { \
  2.8165 +    ASSERT(((_Mdl)->MdlFlags & MDL_PARTIAL) != 0); \
  2.8166 +    MmUnmapLockedPages((_Mdl)->MappedSystemVa, (_Mdl)); \
  2.8167 +  } else if (((_Mdl)->MdlFlags & MDL_PARTIAL) == 0) { \
  2.8168 +    ASSERT(((_Mdl)->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA) == 0); \
  2.8169 +  } \
  2.8170 +}
  2.8171 +
  2.8172 +NTOSAPI
  2.8173 +VOID
  2.8174 +DDKAPI
  2.8175 +MmProbeAndLockPages(
  2.8176 +  /*IN OUT*/ PMDL  MemoryDescriptorList,
  2.8177 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8178 +  /*IN*/ LOCK_OPERATION  Operation);
  2.8179 +
  2.8180 +NTOSAPI
  2.8181 +MM_SYSTEM_SIZE
  2.8182 +DDKAPI
  2.8183 +MmQuerySystemSize(
  2.8184 +  VOID);
  2.8185 +
  2.8186 +NTOSAPI
  2.8187 +NTSTATUS
  2.8188 +DDKAPI
  2.8189 +MmRemovePhysicalMemory(
  2.8190 +  /*IN*/ PPHYSICAL_ADDRESS  StartAddress,
  2.8191 +  /*IN OUT*/ PLARGE_INTEGER  NumberOfBytes);
  2.8192 +
  2.8193 +NTOSAPI
  2.8194 +VOID
  2.8195 +DDKAPI
  2.8196 +MmResetDriverPaging(
  2.8197 +  /*IN*/ PVOID  AddressWithinSection);
  2.8198 +
  2.8199 +NTOSAPI
  2.8200 +HANDLE
  2.8201 +DDKAPI
  2.8202 +MmSecureVirtualMemory(
  2.8203 +  /*IN*/ PVOID  Address,
  2.8204 +  /*IN*/ SIZE_T  Size,
  2.8205 +  /*IN*/ ULONG  ProbeMode);
  2.8206 +
  2.8207 +NTOSAPI
  2.8208 +ULONG
  2.8209 +DDKAPI
  2.8210 +MmSizeOfMdl(
  2.8211 +  /*IN*/ PVOID  Base,
  2.8212 +  /*IN*/ SIZE_T  Length);
  2.8213 +
  2.8214 +NTOSAPI
  2.8215 +VOID
  2.8216 +DDKAPI
  2.8217 +MmUnlockPagableImageSection(
  2.8218 +  /*IN*/ PVOID  ImageSectionHandle);
  2.8219 +
  2.8220 +NTOSAPI
  2.8221 +VOID
  2.8222 +DDKAPI
  2.8223 +MmUnlockPages(
  2.8224 +  /*IN*/ PMDL  MemoryDescriptorList);
  2.8225 +
  2.8226 +NTOSAPI
  2.8227 +VOID
  2.8228 +DDKAPI
  2.8229 +MmUnmapIoSpace(
  2.8230 +  /*IN*/ PVOID  BaseAddress,
  2.8231 +  /*IN*/ SIZE_T  NumberOfBytes);
  2.8232 +
  2.8233 +NTOSAPI
  2.8234 +VOID
  2.8235 +DDKAPI
  2.8236 +MmUnmapReservedMapping(
  2.8237 +  /*IN*/ PVOID  BaseAddress,
  2.8238 +  /*IN*/ ULONG  PoolTag,
  2.8239 +  /*IN*/ PMDL  MemoryDescriptorList);
  2.8240 +
  2.8241 +NTOSAPI
  2.8242 +VOID
  2.8243 +DDKAPI
  2.8244 +MmUnmapVideoDisplay(
  2.8245 +  /*IN*/ PVOID  BaseAddress,
  2.8246 +  /*IN*/ SIZE_T  NumberOfBytes);
  2.8247 +
  2.8248 +
  2.8249 +
  2.8250 +/** Object manager routines **/
  2.8251 +
  2.8252 +NTOSAPI
  2.8253 +NTSTATUS
  2.8254 +DDKAPI
  2.8255 +ObAssignSecurity(
  2.8256 +  /*IN*/ PACCESS_STATE  AccessState,
  2.8257 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.8258 +  /*IN*/ PVOID  Object,
  2.8259 +  /*IN*/ POBJECT_TYPE  Type);
  2.8260 +
  2.8261 +NTOSAPI
  2.8262 +VOID
  2.8263 +DDKAPI
  2.8264 +ObDereferenceSecurityDescriptor(
  2.8265 +  PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.8266 +  ULONG  Count);
  2.8267 +
  2.8268 +NTOSAPI
  2.8269 +VOID
  2.8270 +DDKFASTAPI
  2.8271 +ObfDereferenceObject(
  2.8272 +  /*IN*/ PVOID  Object);
  2.8273 +
  2.8274 +/*
  2.8275 + * VOID
  2.8276 + * ObDereferenceObject(
  2.8277 + * IN PVOID  Object)
  2.8278 + */
  2.8279 +#define ObDereferenceObject ObfDereferenceObject
  2.8280 +
  2.8281 +NTOSAPI
  2.8282 +NTSTATUS
  2.8283 +DDKAPI
  2.8284 +ObGetObjectSecurity(
  2.8285 +  /*IN*/ PVOID  Object,
  2.8286 +  /*OUT*/ PSECURITY_DESCRIPTOR  *SecurityDescriptor,
  2.8287 +  /*OUT*/ PBOOLEAN  MemoryAllocated); 
  2.8288 +
  2.8289 +NTOSAPI
  2.8290 +NTSTATUS
  2.8291 +DDKAPI
  2.8292 +ObInsertObject(
  2.8293 +  /*IN*/ PVOID  Object,
  2.8294 +  /*IN*/ PACCESS_STATE  PassedAccessState  /*OPTIONAL*/,
  2.8295 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8296 +  /*IN*/ ULONG  AdditionalReferences,
  2.8297 +  /*OUT*/ PVOID*  ReferencedObject  /*OPTIONAL*/,
  2.8298 +  /*OUT*/ PHANDLE  Handle);
  2.8299 +
  2.8300 +NTOSAPI
  2.8301 +VOID
  2.8302 +DDKFASTAPI
  2.8303 +ObfReferenceObject(
  2.8304 +  /*IN*/ PVOID  Object);
  2.8305 +
  2.8306 +NTOSAPI
  2.8307 +NTSTATUS
  2.8308 +DDKAPI
  2.8309 +ObLogSecurityDescriptor(
  2.8310 +  /*IN*/ PSECURITY_DESCRIPTOR  InputSecurityDescriptor,
  2.8311 +  /*OUT*/ PSECURITY_DESCRIPTOR  *OutputSecurityDescriptor,
  2.8312 +  /*IN*/ ULONG RefBias);
  2.8313 +/*
  2.8314 + * VOID
  2.8315 + * ObReferenceObject(
  2.8316 + * IN PVOID  Object)
  2.8317 + */
  2.8318 +#define ObReferenceObject ObfReferenceObject
  2.8319 +
  2.8320 +NTOSAPI
  2.8321 +VOID
  2.8322 +DDKAPI
  2.8323 +ObMakeTemporaryObject(
  2.8324 +  /*IN*/ PVOID  Object);
  2.8325 +
  2.8326 +NTOSAPI
  2.8327 +NTSTATUS
  2.8328 +DDKAPI
  2.8329 +ObOpenObjectByName(
  2.8330 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8331 +  /*IN*/ POBJECT_TYPE  ObjectType,
  2.8332 +  /*IN OUT*/ PVOID  ParseContext  /*OPTIONAL*/,
  2.8333 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8334 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8335 +  /*IN*/ PACCESS_STATE  PassedAccessState,
  2.8336 +  /*OUT*/ PHANDLE  Handle);
  2.8337 +
  2.8338 +NTOSAPI
  2.8339 +NTSTATUS
  2.8340 +DDKAPI
  2.8341 +ObOpenObjectByPointer(
  2.8342 +  /*IN*/ PVOID  Object,
  2.8343 +  /*IN*/ ULONG  HandleAttributes,
  2.8344 +  /*IN*/ PACCESS_STATE  PassedAccessState  /*OPTIONAL*/,
  2.8345 +  /*IN*/ ACCESS_MASK  DesiredAccess  /*OPTIONAL*/,
  2.8346 +  /*IN*/ POBJECT_TYPE  ObjectType  /*OPTIONAL*/,
  2.8347 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8348 +  /*OUT*/ PHANDLE  Handle);
  2.8349 +
  2.8350 +NTOSAPI
  2.8351 +NTSTATUS
  2.8352 +DDKAPI
  2.8353 +ObQueryObjectAuditingByHandle(
  2.8354 +  /*IN*/ HANDLE  Handle,
  2.8355 +  /*OUT*/ PBOOLEAN  GenerateOnClose);
  2.8356 +
  2.8357 +NTOSAPI
  2.8358 +NTSTATUS
  2.8359 +DDKAPI
  2.8360 +ObReferenceObjectByHandle(
  2.8361 +  /*IN*/ HANDLE  Handle,
  2.8362 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8363 +  /*IN*/ POBJECT_TYPE  ObjectType  /*OPTIONAL*/,
  2.8364 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8365 +  /*OUT*/ PVOID  *Object,
  2.8366 +  /*OUT*/ POBJECT_HANDLE_INFORMATION  HandleInformation  /*OPTIONAL*/);
  2.8367 +
  2.8368 +NTOSAPI
  2.8369 +NTSTATUS
  2.8370 +DDKAPI
  2.8371 +ObReferenceObjectByName(
  2.8372 +  /*IN*/ PUNICODE_STRING  ObjectPath,
  2.8373 +  /*IN*/ ULONG  Attributes,
  2.8374 +  /*IN*/ PACCESS_STATE  PassedAccessState  /*OPTIONAL*/,
  2.8375 +  /*IN*/ ACCESS_MASK  DesiredAccess  /*OPTIONAL*/,
  2.8376 +  /*IN*/ POBJECT_TYPE  ObjectType,
  2.8377 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8378 +  /*IN OUT*/ PVOID  ParseContext  /*OPTIONAL*/,
  2.8379 +  /*OUT*/ PVOID  *Object);
  2.8380 +
  2.8381 +NTOSAPI
  2.8382 +NTSTATUS
  2.8383 +DDKAPI
  2.8384 +ObReferenceObjectByPointer(
  2.8385 +  /*IN*/ PVOID  Object,
  2.8386 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8387 +  /*IN*/ POBJECT_TYPE  ObjectType,
  2.8388 +  /*IN*/ KPROCESSOR_MODE  AccessMode);
  2.8389 +
  2.8390 +NTOSAPI
  2.8391 +VOID
  2.8392 +DDKAPI
  2.8393 +ObReferenceSecurityDescriptor(
  2.8394 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.8395 +  /*IN*/ ULONG  Count);
  2.8396 +
  2.8397 +NTOSAPI
  2.8398 +VOID
  2.8399 +DDKAPI
  2.8400 +ObReleaseObjectSecurity(
  2.8401 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.8402 +  /*IN*/ BOOLEAN  MemoryAllocated);
  2.8403 +
  2.8404 +
  2.8405 +
  2.8406 +/** Process manager routines **/
  2.8407 +
  2.8408 +NTOSAPI
  2.8409 +NTSTATUS
  2.8410 +DDKAPI
  2.8411 +PsCreateSystemProcess(
  2.8412 +  /*IN*/ PHANDLE  ProcessHandle,
  2.8413 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8414 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes);
  2.8415 +
  2.8416 +NTOSAPI
  2.8417 +NTSTATUS
  2.8418 +DDKAPI
  2.8419 +PsCreateSystemThread(
  2.8420 +  /*OUT*/ PHANDLE  ThreadHandle,
  2.8421 +  /*IN*/ ULONG  DesiredAccess,
  2.8422 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes  /*OPTIONAL*/,
  2.8423 +  /*IN*/ HANDLE  ProcessHandle  /*OPTIONAL*/,
  2.8424 +  /*OUT*/ PCLIENT_ID  ClientId  /*OPTIONAL*/,
  2.8425 +  /*IN*/ PKSTART_ROUTINE  StartRoutine,
  2.8426 +  /*IN*/ PVOID  StartContext);
  2.8427 +
  2.8428 +/*
  2.8429 + * PEPROCESS
  2.8430 + * PsGetCurrentProcess(VOID)
  2.8431 + */
  2.8432 +#define PsGetCurrentProcess IoGetCurrentProcess
  2.8433 +
  2.8434 +NTOSAPI
  2.8435 +HANDLE
  2.8436 +DDKAPI
  2.8437 +PsGetCurrentProcessId(
  2.8438 +  VOID);
  2.8439 +
  2.8440 +/*
  2.8441 + * PETHREAD
  2.8442 + * PsGetCurrentThread(VOID)
  2.8443 + */
  2.8444 +#define PsGetCurrentThread() \
  2.8445 +  ((PETHREAD) KeGetCurrentThread())
  2.8446 +
  2.8447 +NTOSAPI
  2.8448 +HANDLE
  2.8449 +DDKAPI
  2.8450 +PsGetCurrentThreadId(
  2.8451 +  VOID);
  2.8452 +
  2.8453 +NTOSAPI
  2.8454 +BOOLEAN
  2.8455 +DDKAPI
  2.8456 +PsGetVersion(
  2.8457 +  PULONG  MajorVersion  /*OPTIONAL*/,
  2.8458 +  PULONG  MinorVersion  /*OPTIONAL*/,
  2.8459 +  PULONG  BuildNumber  /*OPTIONAL*/,
  2.8460 +  PUNICODE_STRING  CSDVersion  /*OPTIONAL*/);
  2.8461 +
  2.8462 +NTOSAPI
  2.8463 +NTSTATUS
  2.8464 +DDKAPI
  2.8465 +PsRemoveCreateThreadNotifyRoutine(
  2.8466 +  /*IN*/ PCREATE_THREAD_NOTIFY_ROUTINE  NotifyRoutine);
  2.8467 +
  2.8468 +NTOSAPI
  2.8469 +NTSTATUS
  2.8470 +DDKAPI
  2.8471 +PsRemoveLoadImageNotifyRoutine(
  2.8472 +  /*IN*/ PLOAD_IMAGE_NOTIFY_ROUTINE  NotifyRoutine);
  2.8473 +
  2.8474 +NTOSAPI
  2.8475 +NTSTATUS
  2.8476 +DDKAPI
  2.8477 +PsSetCreateProcessNotifyRoutine(
  2.8478 +  /*IN*/ PCREATE_PROCESS_NOTIFY_ROUTINE  NotifyRoutine,
  2.8479 +  /*IN*/ BOOLEAN  Remove);
  2.8480 +
  2.8481 +NTOSAPI
  2.8482 +NTSTATUS
  2.8483 +DDKAPI
  2.8484 +PsSetCreateThreadNotifyRoutine(
  2.8485 +  /*IN*/ PCREATE_THREAD_NOTIFY_ROUTINE  NotifyRoutine);
  2.8486 +
  2.8487 +NTOSAPI
  2.8488 +NTSTATUS
  2.8489 +DDKAPI
  2.8490 +PsSetLoadImageNotifyRoutine(
  2.8491 +  /*IN*/ PLOAD_IMAGE_NOTIFY_ROUTINE  NotifyRoutine);
  2.8492 +
  2.8493 +NTOSAPI
  2.8494 +NTSTATUS
  2.8495 +DDKAPI
  2.8496 +PsTerminateSystemThread(
  2.8497 +  /*IN*/ NTSTATUS  ExitStatus);
  2.8498 +
  2.8499 +
  2.8500 +
  2.8501 +/** Security reference monitor routines **/
  2.8502 +
  2.8503 +NTOSAPI
  2.8504 +BOOLEAN
  2.8505 +DDKAPI
  2.8506 +SeAccessCheck(
  2.8507 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor,
  2.8508 +  /*IN*/ PSECURITY_SUBJECT_CONTEXT  SubjectSecurityContext,
  2.8509 +  /*IN*/ BOOLEAN  SubjectContextLocked,
  2.8510 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8511 +  /*IN*/ ACCESS_MASK  PreviouslyGrantedAccess,
  2.8512 +  /*OUT*/ PPRIVILEGE_SET  *Privileges  /*OPTIONAL*/,
  2.8513 +  /*IN*/ PGENERIC_MAPPING  GenericMapping,
  2.8514 +  /*IN*/ KPROCESSOR_MODE  AccessMode,
  2.8515 +  /*OUT*/ PACCESS_MASK  GrantedAccess,
  2.8516 +  /*OUT*/ PNTSTATUS  AccessStatus);
  2.8517 +
  2.8518 +NTOSAPI
  2.8519 +NTSTATUS
  2.8520 +DDKAPI
  2.8521 +SeAssignSecurity(
  2.8522 +  /*IN*/ PSECURITY_DESCRIPTOR  ParentDescriptor  /*OPTIONAL*/,
  2.8523 +  /*IN*/ PSECURITY_DESCRIPTOR  ExplicitDescriptor  /*OPTIONAL*/,
  2.8524 +  /*OUT*/ PSECURITY_DESCRIPTOR  *NewDescriptor,
  2.8525 +  /*IN*/ BOOLEAN  IsDirectoryObject,
  2.8526 +  /*IN*/ PSECURITY_SUBJECT_CONTEXT  SubjectContext,
  2.8527 +  /*IN*/ PGENERIC_MAPPING  GenericMapping,
  2.8528 +  /*IN*/ POOL_TYPE  PoolType);
  2.8529 +
  2.8530 +NTOSAPI
  2.8531 +NTSTATUS
  2.8532 +DDKAPI
  2.8533 +SeAssignSecurityEx(
  2.8534 +  /*IN*/ PSECURITY_DESCRIPTOR  ParentDescriptor  /*OPTIONAL*/,
  2.8535 +  /*IN*/ PSECURITY_DESCRIPTOR  ExplicitDescriptor  /*OPTIONAL*/,
  2.8536 +  /*OUT*/ PSECURITY_DESCRIPTOR  *NewDescriptor,
  2.8537 +  /*IN*/ GUID  *ObjectType  /*OPTIONAL*/,
  2.8538 +  /*IN*/ BOOLEAN  IsDirectoryObject,
  2.8539 +  /*IN*/ ULONG  AutoInheritFlags,
  2.8540 +  /*IN*/ PSECURITY_SUBJECT_CONTEXT  SubjectContext,
  2.8541 +  /*IN*/ PGENERIC_MAPPING  GenericMapping,
  2.8542 +  /*IN*/ POOL_TYPE  PoolType);
  2.8543 +
  2.8544 +NTOSAPI
  2.8545 +NTSTATUS
  2.8546 +DDKAPI
  2.8547 +SeDeassignSecurity(
  2.8548 +  /*IN OUT*/ PSECURITY_DESCRIPTOR  *SecurityDescriptor);
  2.8549 +
  2.8550 +NTOSAPI
  2.8551 +BOOLEAN
  2.8552 +DDKAPI
  2.8553 +SeSinglePrivilegeCheck(
  2.8554 +  LUID  PrivilegeValue,
  2.8555 +  KPROCESSOR_MODE  PreviousMode);
  2.8556 +
  2.8557 +NTOSAPI
  2.8558 +BOOLEAN
  2.8559 +DDKAPI
  2.8560 +SeValidSecurityDescriptor(
  2.8561 +  /*IN*/ ULONG  Length,
  2.8562 +  /*IN*/ PSECURITY_DESCRIPTOR  SecurityDescriptor);
  2.8563 +
  2.8564 +
  2.8565 +
  2.8566 +/** NtXxx routines **/
  2.8567 +
  2.8568 +NTOSAPI
  2.8569 +NTSTATUS
  2.8570 +DDKAPI
  2.8571 +NtOpenProcess(
  2.8572 +  /*OUT*/ PHANDLE  ProcessHandle,
  2.8573 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8574 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8575 +  /*IN*/ PCLIENT_ID  ClientId  /*OPTIONAL*/);
  2.8576 +
  2.8577 +NTOSAPI
  2.8578 +NTSTATUS
  2.8579 +DDKAPI
  2.8580 +NtQueryInformationProcess(
  2.8581 +  /*IN*/ HANDLE  ProcessHandle,
  2.8582 +  /*IN*/ PROCESSINFOCLASS  ProcessInformationClass,
  2.8583 +  /*OUT*/ PVOID  ProcessInformation,
  2.8584 +  /*IN*/ ULONG  ProcessInformationLength,
  2.8585 +  /*OUT*/ PULONG  ReturnLength /*OPTIONAL*/);
  2.8586 +
  2.8587 +
  2.8588 +
  2.8589 +/** NtXxx and ZwXxx routines **/
  2.8590 +
  2.8591 +NTOSAPI
  2.8592 +NTSTATUS
  2.8593 +DDKAPI
  2.8594 +ZwCancelTimer(
  2.8595 +  /*IN*/ HANDLE  TimerHandle,
  2.8596 +  /*OUT*/ PBOOLEAN  CurrentState  /*OPTIONAL*/);
  2.8597 +
  2.8598 +NTOSAPI
  2.8599 +NTSTATUS
  2.8600 +DDKAPI
  2.8601 +NtClose(
  2.8602 +  /*IN*/ HANDLE  Handle);
  2.8603 +
  2.8604 +NTOSAPI
  2.8605 +NTSTATUS
  2.8606 +DDKAPI
  2.8607 +ZwClose(
  2.8608 +  /*IN*/ HANDLE  Handle);
  2.8609 +
  2.8610 +NTOSAPI
  2.8611 +NTSTATUS
  2.8612 +DDKAPI
  2.8613 +ZwCreateDirectoryObject(
  2.8614 +  /*OUT*/ PHANDLE  DirectoryHandle,
  2.8615 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8616 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes);
  2.8617 +
  2.8618 +NTOSAPI
  2.8619 +NTSTATUS
  2.8620 +DDKAPI
  2.8621 +NtCreateEvent(
  2.8622 +  /*OUT*/ PHANDLE  EventHandle,
  2.8623 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8624 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8625 +  /*IN*/ BOOLEAN  ManualReset,
  2.8626 +  /*IN*/ BOOLEAN  InitialState);
  2.8627 +
  2.8628 +NTOSAPI
  2.8629 +NTSTATUS
  2.8630 +DDKAPI
  2.8631 +ZwCreateEvent(
  2.8632 +  /*OUT*/ PHANDLE  EventHandle,
  2.8633 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8634 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8635 +  /*IN*/ BOOLEAN  ManualReset,
  2.8636 +  /*IN*/ BOOLEAN  InitialState);
  2.8637 +
  2.8638 +NTOSAPI
  2.8639 +NTSTATUS
  2.8640 +DDKAPI
  2.8641 +ZwCreateFile(
  2.8642 +  /*OUT*/ PHANDLE  FileHandle,
  2.8643 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8644 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8645 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8646 +  /*IN*/ PLARGE_INTEGER  AllocationSize  /*OPTIONAL*/,
  2.8647 +  /*IN*/ ULONG  FileAttributes,
  2.8648 +  /*IN*/ ULONG  ShareAccess,
  2.8649 +  /*IN*/ ULONG  CreateDisposition,
  2.8650 +  /*IN*/ ULONG  CreateOptions,
  2.8651 +  /*IN*/ PVOID  EaBuffer  /*OPTIONAL*/,
  2.8652 +  /*IN*/ ULONG  EaLength);
  2.8653 +
  2.8654 +NTOSAPI
  2.8655 +NTSTATUS
  2.8656 +DDKAPI
  2.8657 +ZwCreateKey(
  2.8658 +  /*OUT*/ PHANDLE  KeyHandle,
  2.8659 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8660 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8661 +  /*IN*/ ULONG  TitleIndex,
  2.8662 +  /*IN*/ PUNICODE_STRING  Class  /*OPTIONAL*/,
  2.8663 +  /*IN*/ ULONG  CreateOptions,
  2.8664 +  /*OUT*/ PULONG  Disposition  /*OPTIONAL*/);
  2.8665 +
  2.8666 +NTOSAPI
  2.8667 +NTSTATUS
  2.8668 +DDKAPI
  2.8669 +ZwCreateTimer(
  2.8670 +  /*OUT*/ PHANDLE  TimerHandle,
  2.8671 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8672 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes  /*OPTIONAL*/,
  2.8673 +  /*IN*/ TIMER_TYPE  TimerType);
  2.8674 +
  2.8675 +NTOSAPI
  2.8676 +NTSTATUS
  2.8677 +DDKAPI
  2.8678 +ZwDeleteKey(
  2.8679 +  /*IN*/ HANDLE  KeyHandle);
  2.8680 +
  2.8681 +NTOSAPI
  2.8682 +NTSTATUS
  2.8683 +DDKAPI
  2.8684 +ZwDeleteValueKey(
  2.8685 +  /*IN*/ HANDLE  KeyHandle,
  2.8686 +  /*IN*/ PUNICODE_STRING  ValueName);
  2.8687 +
  2.8688 +NTOSAPI
  2.8689 +NTSTATUS
  2.8690 +DDKAPI
  2.8691 +NtDeviceIoControlFile(
  2.8692 +  /*IN*/ HANDLE  DeviceHandle,
  2.8693 +  /*IN*/ HANDLE  Event  /*OPTIONAL*/, 
  2.8694 +  /*IN*/ PIO_APC_ROUTINE  UserApcRoutine  /*OPTIONAL*/, 
  2.8695 +  /*IN*/ PVOID  UserApcContext  /*OPTIONAL*/, 
  2.8696 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock, 
  2.8697 +  /*IN*/ ULONG  IoControlCode,
  2.8698 +  /*IN*/ PVOID  InputBuffer, 
  2.8699 +  /*IN*/ ULONG  InputBufferSize,
  2.8700 +  /*OUT*/ PVOID  OutputBuffer,
  2.8701 +  /*IN*/ ULONG  OutputBufferSize);
  2.8702 +
  2.8703 +NTOSAPI
  2.8704 +NTSTATUS
  2.8705 +DDKAPI
  2.8706 +ZwDeviceIoControlFile(
  2.8707 +  /*IN*/ HANDLE  DeviceHandle,
  2.8708 +  /*IN*/ HANDLE  Event  /*OPTIONAL*/, 
  2.8709 +  /*IN*/ PIO_APC_ROUTINE  UserApcRoutine  /*OPTIONAL*/, 
  2.8710 +  /*IN*/ PVOID  UserApcContext  /*OPTIONAL*/, 
  2.8711 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock, 
  2.8712 +  /*IN*/ ULONG  IoControlCode,
  2.8713 +  /*IN*/ PVOID  InputBuffer, 
  2.8714 +  /*IN*/ ULONG  InputBufferSize,
  2.8715 +  /*OUT*/ PVOID  OutputBuffer,
  2.8716 +  /*IN*/ ULONG  OutputBufferSize);
  2.8717 +
  2.8718 +NTOSAPI
  2.8719 +NTSTATUS
  2.8720 +DDKAPI
  2.8721 +ZwEnumerateKey(
  2.8722 +  /*IN*/ HANDLE  KeyHandle,
  2.8723 +  /*IN*/ ULONG  Index,
  2.8724 +  /*IN*/ KEY_INFORMATION_CLASS  KeyInformationClass,
  2.8725 +  /*OUT*/ PVOID  KeyInformation,
  2.8726 +  /*IN*/ ULONG  Length,
  2.8727 +  /*OUT*/ PULONG  ResultLength);
  2.8728 +
  2.8729 +NTOSAPI
  2.8730 +NTSTATUS
  2.8731 +DDKAPI
  2.8732 +ZwEnumerateValueKey(
  2.8733 +  /*IN*/ HANDLE  KeyHandle,
  2.8734 +  /*IN*/ ULONG  Index,
  2.8735 +  /*IN*/ KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
  2.8736 +  /*OUT*/ PVOID  KeyValueInformation,
  2.8737 +  /*IN*/ ULONG  Length,
  2.8738 +  /*OUT*/ PULONG  ResultLength);
  2.8739 +
  2.8740 +NTOSAPI
  2.8741 +NTSTATUS
  2.8742 +DDKAPI
  2.8743 +ZwFlushKey(
  2.8744 +  /*IN*/ HANDLE  KeyHandle);
  2.8745 +
  2.8746 +NTOSAPI
  2.8747 +NTSTATUS
  2.8748 +DDKAPI
  2.8749 +ZwMakeTemporaryObject(
  2.8750 +  /*IN*/ HANDLE  Handle);
  2.8751 +
  2.8752 +NTOSAPI
  2.8753 +NTSTATUS
  2.8754 +DDKAPI
  2.8755 +NtMapViewOfSection(
  2.8756 +  /*IN*/ HANDLE  SectionHandle,
  2.8757 +  /*IN*/ HANDLE  ProcessHandle,
  2.8758 +  /*IN OUT*/ PVOID  *BaseAddress,
  2.8759 +  /*IN*/ ULONG  ZeroBits,
  2.8760 +  /*IN*/ ULONG  CommitSize,
  2.8761 +  /*IN OUT*/ PLARGE_INTEGER  SectionOffset  /*OPTIONAL*/,
  2.8762 +  /*IN OUT*/ PSIZE_T  ViewSize,
  2.8763 +  /*IN*/ SECTION_INHERIT  InheritDisposition,
  2.8764 +  /*IN*/ ULONG  AllocationType,
  2.8765 +  /*IN*/ ULONG  Protect);
  2.8766 +
  2.8767 +NTOSAPI
  2.8768 +NTSTATUS
  2.8769 +DDKAPI
  2.8770 +ZwMapViewOfSection(
  2.8771 +  /*IN*/ HANDLE  SectionHandle,
  2.8772 +  /*IN*/ HANDLE  ProcessHandle,
  2.8773 +  /*IN OUT*/ PVOID  *BaseAddress,
  2.8774 +  /*IN*/ ULONG  ZeroBits,
  2.8775 +  /*IN*/ ULONG  CommitSize,
  2.8776 +  /*IN OUT*/ PLARGE_INTEGER  SectionOffset  /*OPTIONAL*/,
  2.8777 +  /*IN OUT*/ PSIZE_T  ViewSize,
  2.8778 +  /*IN*/ SECTION_INHERIT  InheritDisposition,
  2.8779 +  /*IN*/ ULONG  AllocationType,
  2.8780 +  /*IN*/ ULONG  Protect);
  2.8781 +
  2.8782 +NTOSAPI
  2.8783 +NTSTATUS
  2.8784 +DDKAPI
  2.8785 +NtOpenFile(
  2.8786 +  /*OUT*/ PHANDLE  FileHandle,
  2.8787 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8788 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8789 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8790 +  /*IN*/ ULONG  ShareAccess,
  2.8791 +  /*IN*/ ULONG  OpenOptions);
  2.8792 +
  2.8793 +NTOSAPI
  2.8794 +NTSTATUS
  2.8795 +DDKAPI
  2.8796 +ZwOpenFile(
  2.8797 +  /*OUT*/ PHANDLE  FileHandle,
  2.8798 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8799 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes,
  2.8800 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8801 +  /*IN*/ ULONG  ShareAccess,
  2.8802 +  /*IN*/ ULONG  OpenOptions);
  2.8803 +
  2.8804 +NTOSAPI
  2.8805 +NTSTATUS
  2.8806 +DDKAPI
  2.8807 +ZwOpenKey(
  2.8808 +  /*OUT*/ PHANDLE  KeyHandle,
  2.8809 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8810 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes);
  2.8811 +
  2.8812 +NTOSAPI
  2.8813 +NTSTATUS
  2.8814 +DDKAPI
  2.8815 +ZwOpenSection(
  2.8816 +  /*OUT*/ PHANDLE  SectionHandle,
  2.8817 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8818 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes);
  2.8819 +
  2.8820 +NTOSAPI
  2.8821 +NTSTATUS
  2.8822 +DDKAPI
  2.8823 +ZwOpenSymbolicLinkObject(
  2.8824 +  /*OUT*/ PHANDLE  LinkHandle,
  2.8825 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8826 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes);
  2.8827 +
  2.8828 +NTOSAPI
  2.8829 +NTSTATUS
  2.8830 +DDKAPI
  2.8831 +ZwOpenTimer(
  2.8832 +  /*OUT*/ PHANDLE  TimerHandle,
  2.8833 +  /*IN*/ ACCESS_MASK  DesiredAccess,
  2.8834 +  /*IN*/ POBJECT_ATTRIBUTES  ObjectAttributes);
  2.8835 +
  2.8836 +NTOSAPI
  2.8837 +NTSTATUS
  2.8838 +DDKAPI
  2.8839 +ZwQueryInformationFile(
  2.8840 +  /*IN*/ HANDLE  FileHandle,
  2.8841 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8842 +  /*OUT*/ PVOID  FileInformation,
  2.8843 +  /*IN*/ ULONG  Length,
  2.8844 +  /*IN*/ FILE_INFORMATION_CLASS  FileInformationClass);
  2.8845 +
  2.8846 +NTOSAPI
  2.8847 +NTSTATUS
  2.8848 +DDKAPI
  2.8849 +ZwQueryKey(
  2.8850 +  /*IN*/ HANDLE  KeyHandle,
  2.8851 +  /*IN*/ KEY_INFORMATION_CLASS  KeyInformationClass,
  2.8852 +  /*OUT*/ PVOID  KeyInformation,
  2.8853 +  /*IN*/ ULONG  Length,
  2.8854 +  /*OUT*/ PULONG  ResultLength);
  2.8855 +
  2.8856 +NTOSAPI
  2.8857 +NTSTATUS
  2.8858 +DDKAPI
  2.8859 +ZwQuerySymbolicLinkObject(
  2.8860 +  /*IN*/ HANDLE  LinkHandle,
  2.8861 +  /*IN OUT*/ PUNICODE_STRING  LinkTarget,
  2.8862 +  /*OUT*/ PULONG  ReturnedLength  /*OPTIONAL*/);
  2.8863 +
  2.8864 +NTOSAPI
  2.8865 +NTSTATUS
  2.8866 +DDKAPI
  2.8867 +ZwQueryValueKey(
  2.8868 +  /*IN*/ HANDLE  KeyHandle,
  2.8869 +  /*IN*/ PUNICODE_STRING  ValueName,
  2.8870 +  /*IN*/ KEY_VALUE_INFORMATION_CLASS  KeyValueInformationClass,
  2.8871 +  /*OUT*/ PVOID  KeyValueInformation,
  2.8872 +  /*IN*/ ULONG  Length,
  2.8873 +  /*OUT*/ PULONG  ResultLength);
  2.8874 +
  2.8875 +NTOSAPI
  2.8876 +NTSTATUS
  2.8877 +DDKAPI
  2.8878 +NtReadFile(
  2.8879 +  /*IN*/ HANDLE  FileHandle,
  2.8880 +  /*IN*/ HANDLE  Event  /*OPTIONAL*/,
  2.8881 +  /*IN*/ PIO_APC_ROUTINE  ApcRoutine  /*OPTIONAL*/,
  2.8882 +  /*IN*/ PVOID  ApcContext  /*OPTIONAL*/,
  2.8883 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8884 +  /*OUT*/ PVOID  Buffer,
  2.8885 +  /*IN*/ ULONG  Length,
  2.8886 +  /*IN*/ PLARGE_INTEGER  ByteOffset  /*OPTIONAL*/,
  2.8887 +  /*IN*/ PULONG  Key  /*OPTIONAL*/);
  2.8888 +
  2.8889 +NTOSAPI
  2.8890 +NTSTATUS
  2.8891 +DDKAPI
  2.8892 +ZwReadFile(
  2.8893 +  /*IN*/ HANDLE  FileHandle,
  2.8894 +  /*IN*/ HANDLE  Event  /*OPTIONAL*/,
  2.8895 +  /*IN*/ PIO_APC_ROUTINE  ApcRoutine  /*OPTIONAL*/,
  2.8896 +  /*IN*/ PVOID  ApcContext  /*OPTIONAL*/,
  2.8897 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8898 +  /*OUT*/ PVOID  Buffer,
  2.8899 +  /*IN*/ ULONG  Length,
  2.8900 +  /*IN*/ PLARGE_INTEGER  ByteOffset  /*OPTIONAL*/,
  2.8901 +  /*IN*/ PULONG  Key  /*OPTIONAL*/);
  2.8902 +
  2.8903 +NTOSAPI
  2.8904 +NTSTATUS
  2.8905 +DDKAPI
  2.8906 +NtSetEvent(
  2.8907 +  /*IN*/ HANDLE  EventHandle,
  2.8908 +  /*IN*/ PULONG  NumberOfThreadsReleased);
  2.8909 +
  2.8910 +NTOSAPI
  2.8911 +NTSTATUS
  2.8912 +DDKAPI
  2.8913 +ZwSetEvent(
  2.8914 +  /*IN*/ HANDLE  EventHandle,
  2.8915 +  /*IN*/ PULONG  NumberOfThreadsReleased);
  2.8916 +
  2.8917 +NTOSAPI
  2.8918 +NTSTATUS
  2.8919 +DDKAPI
  2.8920 +ZwSetInformationFile(
  2.8921 +  /*IN*/ HANDLE  FileHandle,
  2.8922 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.8923 +  /*IN*/ PVOID  FileInformation,
  2.8924 +  /*IN*/ ULONG  Length,
  2.8925 +  /*IN*/ FILE_INFORMATION_CLASS  FileInformationClass);
  2.8926 +
  2.8927 +NTOSAPI
  2.8928 +NTSTATUS
  2.8929 +DDKAPI
  2.8930 +ZwSetInformationThread(
  2.8931 +  /*IN*/ HANDLE  ThreadHandle,
  2.8932 +  /*IN*/ THREADINFOCLASS  ThreadInformationClass,
  2.8933 +  /*IN*/ PVOID  ThreadInformation,
  2.8934 +  /*IN*/ ULONG  ThreadInformationLength);
  2.8935 +
  2.8936 +NTOSAPI
  2.8937 +NTSTATUS
  2.8938 +DDKAPI
  2.8939 +ZwSetTimer(
  2.8940 +  /*IN*/ HANDLE  TimerHandle,
  2.8941 +  /*IN*/ PLARGE_INTEGER  DueTime,
  2.8942 +  /*IN*/ PTIMER_APC_ROUTINE  TimerApcRoutine  /*OPTIONAL*/,
  2.8943 +  /*IN*/ PVOID  TimerContext  /*OPTIONAL*/,
  2.8944 +  /*IN*/ BOOLEAN  WakeTimer,
  2.8945 +  /*IN*/ LONG  Period  /*OPTIONAL*/,
  2.8946 +  /*OUT*/ PBOOLEAN  PreviousState  /*OPTIONAL*/);
  2.8947 +
  2.8948 +NTOSAPI
  2.8949 +NTSTATUS
  2.8950 +DDKAPI
  2.8951 +ZwSetValueKey(
  2.8952 +  /*IN*/ HANDLE  KeyHandle,
  2.8953 +  /*IN*/ PUNICODE_STRING  ValueName,
  2.8954 +  /*IN*/ ULONG  TitleIndex  /*OPTIONAL*/,
  2.8955 +  /*IN*/ ULONG  Type,
  2.8956 +  /*IN*/ PVOID  Data,
  2.8957 +  /*IN*/ ULONG  DataSize);
  2.8958 +
  2.8959 +/* [Nt|Zw]MapViewOfSection.InheritDisposition constants */
  2.8960 +#define AT_EXTENDABLE_FILE                0x00002000
  2.8961 +#define SEC_NO_CHANGE                     0x00400000
  2.8962 +#define AT_RESERVED                       0x20000000
  2.8963 +#define AT_ROUND_TO_PAGE                  0x40000000
  2.8964 +
  2.8965 +NTOSAPI
  2.8966 +NTSTATUS
  2.8967 +DDKAPI
  2.8968 +NtUnmapViewOfSection(
  2.8969 +  /*IN*/ HANDLE  ProcessHandle,
  2.8970 +  /*IN*/ PVOID  BaseAddress);
  2.8971 +
  2.8972 +NTOSAPI
  2.8973 +NTSTATUS
  2.8974 +DDKAPI
  2.8975 +ZwUnmapViewOfSection(
  2.8976 +  /*IN*/ HANDLE  ProcessHandle,
  2.8977 +  /*IN*/ PVOID  BaseAddress);
  2.8978 +
  2.8979 +NTOSAPI
  2.8980 +NTSTATUS
  2.8981 +DDKAPI
  2.8982 +NtWaitForSingleObject(
  2.8983 +  /*IN*/ HANDLE  Object,
  2.8984 +  /*IN*/ BOOLEAN  Alertable,
  2.8985 +  /*IN*/ PLARGE_INTEGER  Time);
  2.8986 +
  2.8987 +NTOSAPI
  2.8988 +NTSTATUS
  2.8989 +DDKAPI
  2.8990 +ZwWaitForSingleObject(
  2.8991 +  /*IN*/ HANDLE  Object,
  2.8992 +  /*IN*/ BOOLEAN  Alertable,
  2.8993 +  /*IN*/ PLARGE_INTEGER  Time);
  2.8994 +
  2.8995 +NTOSAPI
  2.8996 +NTSTATUS
  2.8997 +DDKAPI
  2.8998 +NtWriteFile(
  2.8999 +  /*IN*/ HANDLE  FileHandle,
  2.9000 +  /*IN*/ HANDLE  Event  /*OPTIONAL*/,
  2.9001 +  /*IN*/ PIO_APC_ROUTINE  ApcRoutine  /*OPTIONAL*/,
  2.9002 +  /*IN*/ PVOID  ApcContext  /*OPTIONAL*/,
  2.9003 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.9004 +  /*IN*/ PVOID  Buffer,
  2.9005 +  /*IN*/ ULONG  Length,
  2.9006 +  /*IN*/ PLARGE_INTEGER  ByteOffset  /*OPTIONAL*/,
  2.9007 +  /*IN*/ PULONG  Key  /*OPTIONAL*/);
  2.9008 +
  2.9009 +NTOSAPI
  2.9010 +NTSTATUS
  2.9011 +DDKAPI
  2.9012 +ZwWriteFile(
  2.9013 +  /*IN*/ HANDLE  FileHandle,
  2.9014 +  /*IN*/ HANDLE  Event  /*OPTIONAL*/,
  2.9015 +  /*IN*/ PIO_APC_ROUTINE  ApcRoutine  /*OPTIONAL*/,
  2.9016 +  /*IN*/ PVOID  ApcContext  /*OPTIONAL*/,
  2.9017 +  /*OUT*/ PIO_STATUS_BLOCK  IoStatusBlock,
  2.9018 +  /*IN*/ PVOID  Buffer,
  2.9019 +  /*IN*/ ULONG  Length,
  2.9020 +  /*IN*/ PLARGE_INTEGER  ByteOffset  /*OPTIONAL*/,
  2.9021 +  /*IN*/ PULONG  Key  /*OPTIONAL*/);
  2.9022 +
  2.9023 +
  2.9024 +
  2.9025 +/** Power management support routines **/
  2.9026 +
  2.9027 +NTOSAPI
  2.9028 +NTSTATUS
  2.9029 +DDKAPI
  2.9030 +PoCallDriver(
  2.9031 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9032 +  /*IN OUT*/ PIRP  Irp);
  2.9033 +
  2.9034 +NTOSAPI
  2.9035 +PULONG
  2.9036 +DDKAPI
  2.9037 +PoRegisterDeviceForIdleDetection(
  2.9038 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9039 +  /*IN*/ ULONG  ConservationIdleTime,
  2.9040 +  /*IN*/ ULONG  PerformanceIdleTime,
  2.9041 +  /*IN*/ DEVICE_POWER_STATE  State);
  2.9042 +
  2.9043 +NTOSAPI
  2.9044 +PVOID
  2.9045 +DDKAPI
  2.9046 +PoRegisterSystemState(
  2.9047 +  /*IN*/ PVOID  StateHandle,
  2.9048 +  /*IN*/ EXECUTION_STATE  Flags);
  2.9049 +
  2.9050 +NTOSAPI
  2.9051 +NTSTATUS
  2.9052 +DDKAPI
  2.9053 +PoRequestPowerIrp(
  2.9054 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9055 +  /*IN*/ UCHAR  MinorFunction,  
  2.9056 +  /*IN*/ POWER_STATE  PowerState,
  2.9057 +  /*IN*/ PREQUEST_POWER_COMPLETE  CompletionFunction,
  2.9058 +  /*IN*/ PVOID  Context,
  2.9059 +  /*OUT*/ PIRP  *Irp /*OPTIONAL*/);
  2.9060 +
  2.9061 +NTOSAPI
  2.9062 +NTSTATUS
  2.9063 +DDKAPI
  2.9064 +PoRequestShutdownEvent(
  2.9065 +  /*OUT*/ PVOID  *Event);
  2.9066 +
  2.9067 +NTOSAPI
  2.9068 +VOID
  2.9069 +DDKAPI
  2.9070 +PoSetDeviceBusy(
  2.9071 +  PULONG  IdlePointer); 
  2.9072 +
  2.9073 +NTOSAPI
  2.9074 +POWER_STATE
  2.9075 +DDKAPI
  2.9076 +PoSetPowerState(
  2.9077 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9078 +  /*IN*/ POWER_STATE_TYPE  Type,
  2.9079 +  /*IN*/ POWER_STATE  State);
  2.9080 +
  2.9081 +NTOSAPI
  2.9082 +VOID
  2.9083 +DDKAPI
  2.9084 +PoSetSystemState(
  2.9085 +  /*IN*/ EXECUTION_STATE  Flags);
  2.9086 +
  2.9087 +NTOSAPI
  2.9088 +VOID
  2.9089 +DDKAPI
  2.9090 +PoStartNextPowerIrp(
  2.9091 +  /*IN*/ PIRP  Irp);
  2.9092 +
  2.9093 +NTOSAPI
  2.9094 +VOID
  2.9095 +DDKAPI
  2.9096 +PoUnregisterSystemState(
  2.9097 +  /*IN*/ PVOID  StateHandle);
  2.9098 +
  2.9099 +
  2.9100 +
  2.9101 +/** WMI library support routines **/
  2.9102 +
  2.9103 +NTOSAPI
  2.9104 +NTSTATUS
  2.9105 +DDKAPI
  2.9106 +WmiCompleteRequest(
  2.9107 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9108 +  /*IN*/ PIRP  Irp,
  2.9109 +  /*IN*/ NTSTATUS  Status,
  2.9110 +  /*IN*/ ULONG  BufferUsed,
  2.9111 +  /*IN*/ CCHAR  PriorityBoost);
  2.9112 +
  2.9113 +NTOSAPI
  2.9114 +NTSTATUS
  2.9115 +DDKAPI
  2.9116 +WmiFireEvent(
  2.9117 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9118 +  /*IN*/ LPGUID  Guid, 
  2.9119 +  /*IN*/ ULONG  InstanceIndex,
  2.9120 +  /*IN*/ ULONG  EventDataSize,
  2.9121 +  /*IN*/ PVOID  EventData); 
  2.9122 +
  2.9123 +NTOSAPI
  2.9124 +NTSTATUS
  2.9125 +DDKAPI
  2.9126 +WmiQueryTraceInformation(
  2.9127 +  /*IN*/ TRACE_INFORMATION_CLASS  TraceInformationClass,
  2.9128 +  /*OUT*/ PVOID  TraceInformation,
  2.9129 +  /*IN*/ ULONG  TraceInformationLength,
  2.9130 +  /*OUT*/ PULONG  RequiredLength /*OPTIONAL*/,
  2.9131 +  /*IN*/ PVOID  Buffer /*OPTIONAL*/);
  2.9132 +
  2.9133 +NTOSAPI
  2.9134 +NTSTATUS
  2.9135 +DDKAPI
  2.9136 +WmiSystemControl(
  2.9137 +  /*IN*/ PWMILIB_CONTEXT  WmiLibInfo,
  2.9138 +  /*IN*/ PDEVICE_OBJECT  DeviceObject,
  2.9139 +  /*IN*/ PIRP  Irp,
  2.9140 +  /*OUT*/ PSYSCTL_IRP_DISPOSITION  IrpDisposition);
  2.9141 +
  2.9142 +NTOSAPI
  2.9143 +NTSTATUS
  2.9144 +DDKCDECLAPI
  2.9145 +WmiTraceMessage(
  2.9146 +  /*IN*/ TRACEHANDLE  LoggerHandle,
  2.9147 +  /*IN*/ ULONG  MessageFlags,
  2.9148 +  /*IN*/ LPGUID  MessageGuid,
  2.9149 +  /*IN*/ USHORT  MessageNumber,
  2.9150 +  /*IN*/ ...);
  2.9151 +
  2.9152 +#if 0
  2.9153 +/* FIXME: Get va_list from where? */
  2.9154 +NTOSAPI
  2.9155 +NTSTATUS
  2.9156 +DDKCDECLAPI
  2.9157 +WmiTraceMessageVa(
  2.9158 +  /*IN*/ TRACEHANDLE  LoggerHandle,
  2.9159 +  /*IN*/ ULONG  MessageFlags,
  2.9160 +  /*IN*/ LPGUID  MessageGuid,
  2.9161 +  /*IN*/ USHORT  MessageNumber,
  2.9162 +  /*IN*/ va_list  MessageArgList);
  2.9163 +#endif
  2.9164 +
  2.9165 +
  2.9166 +/** Kernel debugger routines **/
  2.9167 +
  2.9168 +NTOSAPI
  2.9169 +VOID
  2.9170 +DDKAPI
  2.9171 +KdDisableDebugger(
  2.9172 +  VOID);
  2.9173 +
  2.9174 +NTOSAPI
  2.9175 +VOID
  2.9176 +DDKAPI
  2.9177 +KdEnableDebugger(
  2.9178 +  VOID);
  2.9179 +
  2.9180 +NTOSAPI
  2.9181 +VOID
  2.9182 +DDKAPI
  2.9183 +DbgBreakPoint(
  2.9184 +  VOID);
  2.9185 +
  2.9186 +NTOSAPI
  2.9187 +VOID
  2.9188 +DDKAPI
  2.9189 +DbgBreakPointWithStatus(
  2.9190 +  /*IN*/ ULONG  Status);
  2.9191 +
  2.9192 +NTOSAPI
  2.9193 +ULONG
  2.9194 +DDKCDECLAPI
  2.9195 +DbgPrint(
  2.9196 +  /*IN*/ PCH  Format,
  2.9197 +  /*IN*/ ...);
  2.9198 +
  2.9199 +NTOSAPI
  2.9200 +ULONG
  2.9201 +DDKCDECLAPI
  2.9202 +DbgPrintEx(
  2.9203 +  /*IN*/ ULONG  ComponentId,
  2.9204 +  /*IN*/ ULONG  Level,
  2.9205 +  /*IN*/ PCH  Format,
  2.9206 +  /*IN*/ ...);
  2.9207 +
  2.9208 +NTOSAPI
  2.9209 +ULONG
  2.9210 +DDKCDECLAPI
  2.9211 +DbgPrintReturnControlC(
  2.9212 +  /*IN*/ PCH  Format,
  2.9213 +  /*IN*/ ...);
  2.9214 +
  2.9215 +NTOSAPI
  2.9216 +NTSTATUS
  2.9217 +DDKAPI
  2.9218 +DbgQueryDebugFilterState(
  2.9219 +  /*IN*/ ULONG  ComponentId,
  2.9220 +  /*IN*/ ULONG  Level);
  2.9221 +
  2.9222 +NTOSAPI
  2.9223 +NTSTATUS
  2.9224 +DDKAPI
  2.9225 +DbgSetDebugFilterState(
  2.9226 +  /*IN*/ ULONG  ComponentId,
  2.9227 +  /*IN*/ ULONG  Level,
  2.9228 +  /*IN*/ BOOLEAN  State);
  2.9229 +
  2.9230 +#ifdef DBG
  2.9231 +
  2.9232 +#define KdPrint(_x_) DbgPrint _x_
  2.9233 +#define KdPrintEx(_x_) DbgPrintEx _x_
  2.9234 +#define KdBreakPoint() DbgBreakPoint()
  2.9235 +#define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s)
  2.9236 +
  2.9237 +#else /* !DBG */
  2.9238 +
  2.9239 +#define KdPrint(_x_)
  2.9240 +#define KdPrintEx(_x_)
  2.9241 +#define KdBreakPoint()
  2.9242 +#define KdBreakPointWithStatus(s)
  2.9243 +
  2.9244 +#endif /* !DBG */
  2.9245 +
  2.9246 +extern NTOSAPI PBOOLEAN KdDebuggerNotPresent;
  2.9247 +extern NTOSAPI PBOOLEAN KdDebuggerEnabled;
  2.9248 +#define KD_DEBUGGER_ENABLED     *KdDebuggerEnabled
  2.9249 +#define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent
  2.9250 +
  2.9251 +#ifdef __cplusplus
  2.9252 +}
  2.9253 +#endif
  2.9254 +
  2.9255 +#endif /* __WINDDK_H */