Showing error 28

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: ntdrivers/diskperf.i.cil.c
Line in file: 1982
Project: SV-COMP 2012
Tools: Manual Work
Entered: 2012-11-19 13:47:39 UTC


Source:

   1/* Generated by CIL v. 1.3.6 */
   2/* print_CIL_Input is true */
   3
   4#pragma pack(push,8)
   5#pragma pack(pop)
   6typedef unsigned short wchar_t;
   7typedef unsigned long ULONG_PTR;
   8typedef unsigned long *PULONG_PTR;
   9typedef ULONG_PTR SIZE_T;
  10typedef void *PVOID;
  11typedef char CHAR;
  12typedef short SHORT;
  13typedef long LONG;
  14typedef wchar_t WCHAR;
  15typedef WCHAR *PWCHAR;
  16typedef WCHAR *PWSTR;
  17typedef WCHAR const   *PCWSTR;
  18typedef CHAR *PCHAR;
  19typedef LONG *PLONG;
  20typedef unsigned char UCHAR;
  21typedef unsigned short USHORT;
  22typedef unsigned long ULONG;
  23typedef UCHAR *PUCHAR;
  24typedef ULONG *PULONG;
  25typedef void *HANDLE;
  26typedef HANDLE *PHANDLE;
  27typedef char CCHAR;
  28typedef short CSHORT;
  29typedef CCHAR *PCCHAR;
  30typedef ULONG LCID;
  31typedef LONG NTSTATUS;
  32typedef long long LONGLONG;
  33struct __anonstruct____missing_field_name_1 {
  34   ULONG LowPart ;
  35   LONG HighPart ;
  36};
  37struct __anonstruct_u_2 {
  38   ULONG LowPart ;
  39   LONG HighPart ;
  40};
  41union _LARGE_INTEGER {
  42   struct __anonstruct____missing_field_name_1 __annonCompField1 ;
  43   struct __anonstruct_u_2 u ;
  44   LONGLONG QuadPart ;
  45};
  46typedef union _LARGE_INTEGER LARGE_INTEGER;
  47typedef LARGE_INTEGER *PLARGE_INTEGER;
  48struct _LUID {
  49   ULONG LowPart ;
  50   LONG HighPart ;
  51};
  52typedef struct _LUID LUID;
  53typedef LARGE_INTEGER PHYSICAL_ADDRESS;
  54enum _EVENT_TYPE {
  55    NotificationEvent = 0,
  56    SynchronizationEvent = 1
  57} ;
  58typedef enum _EVENT_TYPE EVENT_TYPE;
  59typedef char const   *PCSZ;
  60struct _STRING {
  61   USHORT Length ;
  62   USHORT MaximumLength ;
  63   PCHAR Buffer ;
  64};
  65typedef struct _STRING STRING;
  66typedef STRING *PSTRING;
  67typedef PSTRING PANSI_STRING;
  68struct _UNICODE_STRING {
  69   USHORT Length ;
  70   USHORT MaximumLength ;
  71   PWSTR Buffer ;
  72};
  73typedef struct _UNICODE_STRING UNICODE_STRING;
  74typedef UNICODE_STRING *PUNICODE_STRING;
  75typedef UCHAR BOOLEAN;
  76struct _LIST_ENTRY {
  77   struct _LIST_ENTRY *Flink ;
  78   struct _LIST_ENTRY *Blink ;
  79};
  80typedef struct _LIST_ENTRY LIST_ENTRY;
  81typedef struct _LIST_ENTRY *PLIST_ENTRY;
  82struct _OBJECT_ATTRIBUTES {
  83   ULONG Length ;
  84   HANDLE RootDirectory ;
  85   PUNICODE_STRING ObjectName ;
  86   ULONG Attributes ;
  87   PVOID SecurityDescriptor ;
  88   PVOID SecurityQualityOfService ;
  89};
  90typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES;
  91typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
  92struct _GUID {
  93   unsigned long Data1 ;
  94   unsigned short Data2 ;
  95   unsigned short Data3 ;
  96   unsigned char Data4[8] ;
  97};
  98typedef struct _GUID GUID;
  99typedef GUID const   *LPCGUID;
 100typedef unsigned int size_t;
 101typedef UCHAR KIRQL;
 102struct _KTHREAD;
 103typedef struct _KTHREAD *PKTHREAD;
 104struct _ETHREAD;
 105typedef struct _ETHREAD *PETHREAD;
 106struct _EPROCESS;
 107typedef struct _EPROCESS *PEPROCESS;
 108struct _IO_TIMER;
 109typedef struct _IO_TIMER *PIO_TIMER;
 110struct _OBJECT_TYPE;
 111typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 112typedef CCHAR KPROCESSOR_MODE;
 113struct _KAPC;
 114struct _KAPC;
 115typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 );
 116struct _KAPC {
 117   CSHORT Type ;
 118   CSHORT Size ;
 119   ULONG Spare0 ;
 120   struct _KTHREAD *Thread ;
 121   LIST_ENTRY ApcListEntry ;
 122   void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext ,
 123                         PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ;
 124   void (*RundownRoutine)(struct _KAPC *Apc ) ;
 125   void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ;
 126   PVOID NormalContext ;
 127   PVOID SystemArgument1 ;
 128   PVOID SystemArgument2 ;
 129   CCHAR ApcStateIndex ;
 130   KPROCESSOR_MODE ApcMode ;
 131   BOOLEAN Inserted ;
 132};
 133typedef struct _KAPC KAPC;
 134struct _KDPC;
 135struct _KDPC;
 136struct _KDPC {
 137   CSHORT Type ;
 138   UCHAR Number ;
 139   UCHAR Importance ;
 140   LIST_ENTRY DpcListEntry ;
 141   void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 ,
 142                           PVOID SystemArgument2 ) ;
 143   PVOID DeferredContext ;
 144   PVOID SystemArgument1 ;
 145   PVOID SystemArgument2 ;
 146   PULONG_PTR Lock ;
 147};
 148typedef struct _KDPC KDPC;
 149typedef struct _KDPC *PKDPC;
 150struct _MDL {
 151   struct _MDL *Next ;
 152   CSHORT Size ;
 153   CSHORT MdlFlags ;
 154   struct _EPROCESS *Process ;
 155   PVOID MappedSystemVa ;
 156   PVOID StartVa ;
 157   ULONG ByteCount ;
 158   ULONG ByteOffset ;
 159};
 160typedef struct _MDL MDL;
 161typedef struct _MDL *PMDL;
 162typedef PVOID PACCESS_TOKEN;
 163typedef PVOID PSECURITY_DESCRIPTOR;
 164typedef ULONG ACCESS_MASK;
 165#pragma pack(push,4)
 166struct _LUID_AND_ATTRIBUTES {
 167   LUID Luid ;
 168   ULONG Attributes ;
 169};
 170typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES;
 171#pragma pack(pop)
 172struct _PRIVILEGE_SET {
 173   ULONG PrivilegeCount ;
 174   ULONG Control ;
 175   LUID_AND_ATTRIBUTES Privilege[1] ;
 176};
 177typedef struct _PRIVILEGE_SET PRIVILEGE_SET;
 178enum _SECURITY_IMPERSONATION_LEVEL {
 179    SecurityAnonymous = 0,
 180    SecurityIdentification = 1,
 181    SecurityImpersonation = 2,
 182    SecurityDelegation = 3
 183} ;
 184typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL;
 185typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE;
 186struct _SECURITY_QUALITY_OF_SERVICE {
 187   ULONG Length ;
 188   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 189   SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ;
 190   BOOLEAN EffectiveOnly ;
 191};
 192typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE;
 193typedef ULONG SECURITY_INFORMATION;
 194typedef LONG KPRIORITY;
 195typedef ULONG_PTR KSPIN_LOCK;
 196typedef KSPIN_LOCK *PKSPIN_LOCK;
 197struct _RTL_QUERY_REGISTRY_TABLE {
 198   NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType ,
 199                                                            PVOID ValueData , ULONG ValueLength ,
 200                                                            PVOID Context , PVOID EntryContext ) ;
 201   ULONG Flags ;
 202   PWSTR Name ;
 203   PVOID EntryContext ;
 204   ULONG DefaultType ;
 205   PVOID DefaultData ;
 206   ULONG DefaultLength ;
 207};
 208typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE;
 209union __anonunion____missing_field_name_6 {
 210   NTSTATUS Status ;
 211   PVOID Pointer ;
 212};
 213struct _IO_STATUS_BLOCK {
 214   union __anonunion____missing_field_name_6 __annonCompField4 ;
 215   ULONG_PTR Information ;
 216};
 217typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK;
 218typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK;
 219enum _FILE_INFORMATION_CLASS {
 220    FileDirectoryInformation = 1,
 221    FileFullDirectoryInformation = 2,
 222    FileBothDirectoryInformation = 3,
 223    FileBasicInformation = 4,
 224    FileStandardInformation = 5,
 225    FileInternalInformation = 6,
 226    FileEaInformation = 7,
 227    FileAccessInformation = 8,
 228    FileNameInformation = 9,
 229    FileRenameInformation = 10,
 230    FileLinkInformation = 11,
 231    FileNamesInformation = 12,
 232    FileDispositionInformation = 13,
 233    FilePositionInformation = 14,
 234    FileFullEaInformation = 15,
 235    FileModeInformation = 16,
 236    FileAlignmentInformation = 17,
 237    FileAllInformation = 18,
 238    FileAllocationInformation = 19,
 239    FileEndOfFileInformation = 20,
 240    FileAlternateNameInformation = 21,
 241    FileStreamInformation = 22,
 242    FilePipeInformation = 23,
 243    FilePipeLocalInformation = 24,
 244    FilePipeRemoteInformation = 25,
 245    FileMailslotQueryInformation = 26,
 246    FileMailslotSetInformation = 27,
 247    FileCompressionInformation = 28,
 248    FileObjectIdInformation = 29,
 249    FileCompletionInformation = 30,
 250    FileMoveClusterInformation = 31,
 251    FileQuotaInformation = 32,
 252    FileReparsePointInformation = 33,
 253    FileNetworkOpenInformation = 34,
 254    FileAttributeTagInformation = 35,
 255    FileTrackingInformation = 36,
 256    FileMaximumInformation = 37
 257} ;
 258typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS;
 259struct _FILE_BASIC_INFORMATION {
 260   LARGE_INTEGER CreationTime ;
 261   LARGE_INTEGER LastAccessTime ;
 262   LARGE_INTEGER LastWriteTime ;
 263   LARGE_INTEGER ChangeTime ;
 264   ULONG FileAttributes ;
 265};
 266typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION;
 267struct _FILE_STANDARD_INFORMATION {
 268   LARGE_INTEGER AllocationSize ;
 269   LARGE_INTEGER EndOfFile ;
 270   ULONG NumberOfLinks ;
 271   BOOLEAN DeletePending ;
 272   BOOLEAN Directory ;
 273};
 274typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
 275struct _FILE_NETWORK_OPEN_INFORMATION {
 276   LARGE_INTEGER CreationTime ;
 277   LARGE_INTEGER LastAccessTime ;
 278   LARGE_INTEGER LastWriteTime ;
 279   LARGE_INTEGER ChangeTime ;
 280   LARGE_INTEGER AllocationSize ;
 281   LARGE_INTEGER EndOfFile ;
 282   ULONG FileAttributes ;
 283};
 284typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION;
 285enum _FSINFOCLASS {
 286    FileFsVolumeInformation = 1,
 287    FileFsLabelInformation = 2,
 288    FileFsSizeInformation = 3,
 289    FileFsDeviceInformation = 4,
 290    FileFsAttributeInformation = 5,
 291    FileFsControlInformation = 6,
 292    FileFsFullSizeInformation = 7,
 293    FileFsObjectIdInformation = 8,
 294    FileFsMaximumInformation = 9
 295} ;
 296typedef enum _FSINFOCLASS FS_INFORMATION_CLASS;
 297enum _INTERFACE_TYPE {
 298    InterfaceTypeUndefined = -1,
 299    Internal = 0,
 300    Isa = 1,
 301    Eisa = 2,
 302    MicroChannel = 3,
 303    TurboChannel = 4,
 304    PCIBus = 5,
 305    VMEBus = 6,
 306    NuBus = 7,
 307    PCMCIABus = 8,
 308    CBus = 9,
 309    MPIBus = 10,
 310    MPSABus = 11,
 311    ProcessorInternal = 12,
 312    InternalPowerBus = 13,
 313    PNPISABus = 14,
 314    PNPBus = 15,
 315    MaximumInterfaceType = 16
 316} ;
 317typedef enum _INTERFACE_TYPE INTERFACE_TYPE;
 318typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE;
 319struct _IO_ERROR_LOG_PACKET {
 320   UCHAR MajorFunctionCode ;
 321   UCHAR RetryCount ;
 322   USHORT DumpDataSize ;
 323   USHORT NumberOfStrings ;
 324   USHORT StringOffset ;
 325   USHORT EventCategory ;
 326   NTSTATUS ErrorCode ;
 327   ULONG UniqueErrorValue ;
 328   NTSTATUS FinalStatus ;
 329   ULONG SequenceNumber ;
 330   ULONG IoControlCode ;
 331   LARGE_INTEGER DeviceOffset ;
 332   ULONG DumpData[1] ;
 333};
 334typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET;
 335typedef struct _IO_ERROR_LOG_PACKET *PIO_ERROR_LOG_PACKET;
 336struct _KEY_VALUE_FULL_INFORMATION {
 337   ULONG TitleIndex ;
 338   ULONG Type ;
 339   ULONG DataOffset ;
 340   ULONG DataLength ;
 341   ULONG NameLength ;
 342   WCHAR Name[1] ;
 343};
 344typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION;
 345struct _CLIENT_ID {
 346   HANDLE UniqueProcess ;
 347   HANDLE UniqueThread ;
 348};
 349typedef struct _CLIENT_ID CLIENT_ID;
 350typedef CLIENT_ID *PCLIENT_ID;
 351enum _SYSTEM_POWER_STATE {
 352    PowerSystemUnspecified = 0,
 353    PowerSystemWorking = 1,
 354    PowerSystemSleeping1 = 2,
 355    PowerSystemSleeping2 = 3,
 356    PowerSystemSleeping3 = 4,
 357    PowerSystemHibernate = 5,
 358    PowerSystemShutdown = 6,
 359    PowerSystemMaximum = 7
 360} ;
 361typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE;
 362enum __anonenum_POWER_ACTION_11 {
 363    PowerActionNone = 0,
 364    PowerActionReserved = 1,
 365    PowerActionSleep = 2,
 366    PowerActionHibernate = 3,
 367    PowerActionShutdown = 4,
 368    PowerActionShutdownReset = 5,
 369    PowerActionShutdownOff = 6,
 370    PowerActionWarmEject = 7
 371} ;
 372typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION;
 373enum _DEVICE_POWER_STATE {
 374    PowerDeviceUnspecified = 0,
 375    PowerDeviceD0 = 1,
 376    PowerDeviceD1 = 2,
 377    PowerDeviceD2 = 3,
 378    PowerDeviceD3 = 4,
 379    PowerDeviceMaximum = 5
 380} ;
 381typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE;
 382union _POWER_STATE {
 383   SYSTEM_POWER_STATE SystemState ;
 384   DEVICE_POWER_STATE DeviceState ;
 385};
 386typedef union _POWER_STATE POWER_STATE;
 387enum _POWER_STATE_TYPE {
 388    SystemPowerState = 0,
 389    DevicePowerState = 1
 390} ;
 391typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE;
 392typedef PVOID PASSIGNED_RESOURCE;
 393#pragma pack(push,4)
 394struct __anonstruct_Generic_16 {
 395   PHYSICAL_ADDRESS Start ;
 396   ULONG Length ;
 397};
 398struct __anonstruct_Port_17 {
 399   PHYSICAL_ADDRESS Start ;
 400   ULONG Length ;
 401};
 402struct __anonstruct_Interrupt_18 {
 403   ULONG Level ;
 404   ULONG Vector ;
 405   ULONG Affinity ;
 406};
 407struct __anonstruct_Memory_19 {
 408   PHYSICAL_ADDRESS Start ;
 409   ULONG Length ;
 410};
 411struct __anonstruct_Dma_20 {
 412   ULONG Channel ;
 413   ULONG Port ;
 414   ULONG Reserved1 ;
 415};
 416struct __anonstruct_DevicePrivate_21 {
 417   ULONG Data[3] ;
 418};
 419struct __anonstruct_BusNumber_22 {
 420   ULONG Start ;
 421   ULONG Length ;
 422   ULONG Reserved ;
 423};
 424struct __anonstruct_DeviceSpecificData_23 {
 425   ULONG DataSize ;
 426   ULONG Reserved1 ;
 427   ULONG Reserved2 ;
 428};
 429union __anonunion_u_15 {
 430   struct __anonstruct_Generic_16 Generic ;
 431   struct __anonstruct_Port_17 Port ;
 432   struct __anonstruct_Interrupt_18 Interrupt ;
 433   struct __anonstruct_Memory_19 Memory ;
 434   struct __anonstruct_Dma_20 Dma ;
 435   struct __anonstruct_DevicePrivate_21 DevicePrivate ;
 436   struct __anonstruct_BusNumber_22 BusNumber ;
 437   struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ;
 438};
 439struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
 440   UCHAR Type ;
 441   UCHAR ShareDisposition ;
 442   USHORT Flags ;
 443   union __anonunion_u_15 u ;
 444};
 445typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR;
 446#pragma pack(pop)
 447struct _CM_PARTIAL_RESOURCE_LIST {
 448   USHORT Version ;
 449   USHORT Revision ;
 450   ULONG Count ;
 451   CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ;
 452};
 453typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST;
 454struct _CM_FULL_RESOURCE_DESCRIPTOR {
 455   INTERFACE_TYPE InterfaceType ;
 456   ULONG BusNumber ;
 457   CM_PARTIAL_RESOURCE_LIST PartialResourceList ;
 458};
 459typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR;
 460struct _CM_RESOURCE_LIST {
 461   ULONG Count ;
 462   CM_FULL_RESOURCE_DESCRIPTOR List[1] ;
 463};
 464typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST;
 465#pragma pack(push,1)
 466#pragma pack(pop)
 467struct __anonstruct_Port_25 {
 468   ULONG Length ;
 469   ULONG Alignment ;
 470   PHYSICAL_ADDRESS MinimumAddress ;
 471   PHYSICAL_ADDRESS MaximumAddress ;
 472};
 473struct __anonstruct_Memory_26 {
 474   ULONG Length ;
 475   ULONG Alignment ;
 476   PHYSICAL_ADDRESS MinimumAddress ;
 477   PHYSICAL_ADDRESS MaximumAddress ;
 478};
 479struct __anonstruct_Interrupt_27 {
 480   ULONG MinimumVector ;
 481   ULONG MaximumVector ;
 482};
 483struct __anonstruct_Dma_28 {
 484   ULONG MinimumChannel ;
 485   ULONG MaximumChannel ;
 486};
 487struct __anonstruct_Generic_29 {
 488   ULONG Length ;
 489   ULONG Alignment ;
 490   PHYSICAL_ADDRESS MinimumAddress ;
 491   PHYSICAL_ADDRESS MaximumAddress ;
 492};
 493struct __anonstruct_DevicePrivate_30 {
 494   ULONG Data[3] ;
 495};
 496struct __anonstruct_BusNumber_31 {
 497   ULONG Length ;
 498   ULONG MinBusNumber ;
 499   ULONG MaxBusNumber ;
 500   ULONG Reserved ;
 501};
 502struct __anonstruct_AssignedResource_32 {
 503   PASSIGNED_RESOURCE AssignedResource ;
 504};
 505struct __anonstruct_SubAllocateFrom_33 {
 506   UCHAR Type ;
 507   UCHAR Reserved[3] ;
 508   PASSIGNED_RESOURCE AssignedResource ;
 509   PHYSICAL_ADDRESS Transformation ;
 510};
 511struct __anonstruct_ConfigData_34 {
 512   ULONG Priority ;
 513   ULONG Reserved1 ;
 514   ULONG Reserved2 ;
 515};
 516union __anonunion_u_24 {
 517   struct __anonstruct_Port_25 Port ;
 518   struct __anonstruct_Memory_26 Memory ;
 519   struct __anonstruct_Interrupt_27 Interrupt ;
 520   struct __anonstruct_Dma_28 Dma ;
 521   struct __anonstruct_Generic_29 Generic ;
 522   struct __anonstruct_DevicePrivate_30 DevicePrivate ;
 523   struct __anonstruct_BusNumber_31 BusNumber ;
 524   struct __anonstruct_AssignedResource_32 AssignedResource ;
 525   struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ;
 526   struct __anonstruct_ConfigData_34 ConfigData ;
 527};
 528struct _IO_RESOURCE_DESCRIPTOR {
 529   UCHAR Option ;
 530   UCHAR Type ;
 531   UCHAR ShareDisposition ;
 532   UCHAR Spare1 ;
 533   USHORT Flags ;
 534   USHORT Spare2 ;
 535   union __anonunion_u_24 u ;
 536};
 537typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR;
 538struct _IO_RESOURCE_LIST {
 539   USHORT Version ;
 540   USHORT Revision ;
 541   ULONG Count ;
 542   IO_RESOURCE_DESCRIPTOR Descriptors[1] ;
 543};
 544typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST;
 545struct _IO_RESOURCE_REQUIREMENTS_LIST {
 546   ULONG ListSize ;
 547   INTERFACE_TYPE InterfaceType ;
 548   ULONG BusNumber ;
 549   ULONG SlotNumber ;
 550   ULONG Reserved[3] ;
 551   ULONG AlternativeLists ;
 552   IO_RESOURCE_LIST List[1] ;
 553};
 554typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST;
 555enum _CONFIGURATION_TYPE {
 556    ArcSystem = 0,
 557    CentralProcessor = 1,
 558    FloatingPointProcessor = 2,
 559    PrimaryIcache = 3,
 560    PrimaryDcache = 4,
 561    SecondaryIcache = 5,
 562    SecondaryDcache = 6,
 563    SecondaryCache = 7,
 564    EisaAdapter = 8,
 565    TcAdapter = 9,
 566    ScsiAdapter = 10,
 567    DtiAdapter = 11,
 568    MultiFunctionAdapter = 12,
 569    DiskController = 13,
 570    TapeController = 14,
 571    CdromController = 15,
 572    WormController = 16,
 573    SerialController = 17,
 574    NetworkController = 18,
 575    DisplayController = 19,
 576    ParallelController = 20,
 577    PointerController = 21,
 578    KeyboardController = 22,
 579    AudioController = 23,
 580    OtherController = 24,
 581    DiskPeripheral = 25,
 582    FloppyDiskPeripheral = 26,
 583    TapePeripheral = 27,
 584    ModemPeripheral = 28,
 585    MonitorPeripheral = 29,
 586    PrinterPeripheral = 30,
 587    PointerPeripheral = 31,
 588    KeyboardPeripheral = 32,
 589    TerminalPeripheral = 33,
 590    OtherPeripheral = 34,
 591    LinePeripheral = 35,
 592    NetworkPeripheral = 36,
 593    SystemMemory = 37,
 594    DockingInformation = 38,
 595    RealModeIrqRoutingTable = 39,
 596    MaximumType = 40
 597} ;
 598typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE;
 599typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE;
 600enum _KWAIT_REASON {
 601    Executive = 0,
 602    FreePage = 1,
 603    PageIn = 2,
 604    PoolAllocation = 3,
 605    DelayExecution = 4,
 606    Suspended = 5,
 607    UserRequest = 6,
 608    WrExecutive = 7,
 609    WrFreePage = 8,
 610    WrPageIn = 9,
 611    WrPoolAllocation = 10,
 612    WrDelayExecution = 11,
 613    WrSuspended = 12,
 614    WrUserRequest = 13,
 615    WrEventPair = 14,
 616    WrQueue = 15,
 617    WrLpcReceive = 16,
 618    WrLpcReply = 17,
 619    WrVirtualMemory = 18,
 620    WrPageOut = 19,
 621    WrRendezvous = 20,
 622    Spare2 = 21,
 623    Spare3 = 22,
 624    Spare4 = 23,
 625    Spare5 = 24,
 626    Spare6 = 25,
 627    WrKernel = 26,
 628    MaximumWaitReason = 27
 629} ;
 630typedef enum _KWAIT_REASON KWAIT_REASON;
 631struct _DISPATCHER_HEADER {
 632   UCHAR Type ;
 633   UCHAR Absolute ;
 634   UCHAR Size ;
 635   UCHAR Inserted ;
 636   LONG SignalState ;
 637   LIST_ENTRY WaitListHead ;
 638};
 639typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER;
 640struct _KDEVICE_QUEUE {
 641   CSHORT Type ;
 642   CSHORT Size ;
 643   LIST_ENTRY DeviceListHead ;
 644   KSPIN_LOCK Lock ;
 645   BOOLEAN Busy ;
 646};
 647typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE;
 648struct _KDEVICE_QUEUE_ENTRY {
 649   LIST_ENTRY DeviceListEntry ;
 650   ULONG SortKey ;
 651   BOOLEAN Inserted ;
 652};
 653typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY;
 654struct _KEVENT {
 655   DISPATCHER_HEADER Header ;
 656};
 657typedef struct _KEVENT KEVENT;
 658typedef struct _KEVENT *PKEVENT;
 659typedef struct _KEVENT *PRKEVENT;
 660struct _KSEMAPHORE {
 661   DISPATCHER_HEADER Header ;
 662   LONG Limit ;
 663};
 664typedef struct _KSEMAPHORE *PKSEMAPHORE;
 665typedef struct _KSEMAPHORE *PRKSEMAPHORE;
 666enum _MEMORY_CACHING_TYPE {
 667    MmNonCached = 0,
 668    MmCached = 1,
 669    MmWriteCombined = 2,
 670    MmHardwareCoherentCached = 3,
 671    MmNonCachedUnordered = 4,
 672    MmUSWCCached = 5,
 673    MmMaximumCacheType = 6
 674} ;
 675typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE;
 676enum _POOL_TYPE {
 677    NonPagedPool = 0,
 678    PagedPool = 1,
 679    NonPagedPoolMustSucceed = 2,
 680    DontUseThisType = 3,
 681    NonPagedPoolCacheAligned = 4,
 682    PagedPoolCacheAligned = 5,
 683    NonPagedPoolCacheAlignedMustS = 6,
 684    MaxPoolType = 7,
 685    NonPagedPoolSession = 32,
 686    PagedPoolSession = 33,
 687    NonPagedPoolMustSucceedSession = 34,
 688    DontUseThisTypeSession = 35,
 689    NonPagedPoolCacheAlignedSession = 36,
 690    PagedPoolCacheAlignedSession = 37,
 691    NonPagedPoolCacheAlignedMustSSession = 38
 692} ;
 693typedef enum _POOL_TYPE POOL_TYPE;
 694struct _FAST_MUTEX {
 695   LONG Count ;
 696   PKTHREAD Owner ;
 697   ULONG Contention ;
 698   KEVENT Event ;
 699   ULONG OldIrql ;
 700};
 701typedef struct _FAST_MUTEX *PFAST_MUTEX;
 702typedef ULONG_PTR ERESOURCE_THREAD;
 703union __anonunion____missing_field_name_38 {
 704   LONG OwnerCount ;
 705   ULONG TableSize ;
 706};
 707struct _OWNER_ENTRY {
 708   ERESOURCE_THREAD OwnerThread ;
 709   union __anonunion____missing_field_name_38 __annonCompField10 ;
 710};
 711typedef struct _OWNER_ENTRY OWNER_ENTRY;
 712typedef struct _OWNER_ENTRY *POWNER_ENTRY;
 713union __anonunion____missing_field_name_39 {
 714   PVOID Address ;
 715   ULONG_PTR CreatorBackTraceIndex ;
 716};
 717struct _ERESOURCE {
 718   LIST_ENTRY SystemResourcesList ;
 719   POWNER_ENTRY OwnerTable ;
 720   SHORT ActiveCount ;
 721   USHORT Flag ;
 722   PKSEMAPHORE SharedWaiters ;
 723   PKEVENT ExclusiveWaiters ;
 724   OWNER_ENTRY OwnerThreads[2] ;
 725   ULONG ContentionCount ;
 726   USHORT NumberOfSharedWaiters ;
 727   USHORT NumberOfExclusiveWaiters ;
 728   union __anonunion____missing_field_name_39 __annonCompField11 ;
 729   KSPIN_LOCK SpinLock ;
 730};
 731enum _MM_PAGE_PRIORITY {
 732    LowPagePriority = 0,
 733    NormalPagePriority = 16,
 734    HighPagePriority = 32
 735} ;
 736typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY;
 737struct _DRIVER_OBJECT;
 738struct _DRIVER_OBJECT;
 739struct _SECURITY_SUBJECT_CONTEXT {
 740   PACCESS_TOKEN ClientToken ;
 741   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 742   PACCESS_TOKEN PrimaryToken ;
 743   PVOID ProcessAuditId ;
 744};
 745typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT;
 746struct _INITIAL_PRIVILEGE_SET {
 747   ULONG PrivilegeCount ;
 748   ULONG Control ;
 749   LUID_AND_ATTRIBUTES Privilege[3] ;
 750};
 751typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET;
 752union __anonunion_Privileges_40 {
 753   INITIAL_PRIVILEGE_SET InitialPrivilegeSet ;
 754   PRIVILEGE_SET PrivilegeSet ;
 755};
 756struct _ACCESS_STATE {
 757   LUID OperationID ;
 758   BOOLEAN SecurityEvaluated ;
 759   BOOLEAN GenerateAudit ;
 760   BOOLEAN GenerateOnClose ;
 761   BOOLEAN PrivilegesAllocated ;
 762   ULONG Flags ;
 763   ACCESS_MASK RemainingDesiredAccess ;
 764   ACCESS_MASK PreviouslyGrantedAccess ;
 765   ACCESS_MASK OriginalDesiredAccess ;
 766   SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ;
 767   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 768   PVOID AuxData ;
 769   union __anonunion_Privileges_40 Privileges ;
 770   BOOLEAN AuditPrivileges ;
 771   UNICODE_STRING ObjectName ;
 772   UNICODE_STRING ObjectTypeName ;
 773};
 774typedef struct _ACCESS_STATE *PACCESS_STATE;
 775struct _DEVICE_OBJECT;
 776struct _DEVICE_OBJECT;
 777struct _DRIVER_OBJECT;
 778struct _FILE_OBJECT;
 779struct _FILE_OBJECT;
 780struct _IRP;
 781struct _IRP;
 782struct _SCSI_REQUEST_BLOCK;
 783struct _SCSI_REQUEST_BLOCK;
 784typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp );
 785struct _COMPRESSED_DATA_INFO;
 786struct _FAST_IO_DISPATCH {
 787   ULONG SizeOfFastIoDispatch ;
 788   BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 789                                    ULONG Length , BOOLEAN Wait , ULONG LockKey ,
 790                                    BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus ,
 791                                    struct _DEVICE_OBJECT *DeviceObject ) ;
 792   BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 793                         ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 794                         PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 795   BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 796                          ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 797                          PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 798   BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 799                                   PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 800                                   struct _DEVICE_OBJECT *DeviceObject ) ;
 801   BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 802                                      PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 803                                      struct _DEVICE_OBJECT *DeviceObject ) ;
 804   BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 805                         PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 806                         BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus ,
 807                         struct _DEVICE_OBJECT *DeviceObject ) ;
 808   BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 809                                 PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 810                                 PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 811   BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId ,
 812                              PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 813   BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId ,
 814                                   ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 815   BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 816                                  PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
 817                                  ULONG OutputBufferLength , ULONG IoControlCode ,
 818                                  PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 819   void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 820   void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 821   void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ;
 822   BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 823                                         struct _FILE_NETWORK_OPEN_INFORMATION *Buffer ,
 824                                         struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 825   NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset ,
 826                                  struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ;
 827   BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 828                      ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 829                      struct _DEVICE_OBJECT *DeviceObject ) ;
 830   BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 831   BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 832                              ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 833                              struct _DEVICE_OBJECT *DeviceObject ) ;
 834   BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 835                               PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 836   BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 837                                   ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain ,
 838                                   PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 839                                   ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 840   BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 841                                    ULONG Length , ULONG LockKey , PVOID Buffer ,
 842                                    PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 843                                    ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 844   BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain ,
 845                                        struct _DEVICE_OBJECT *DeviceObject ) ;
 846   BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 847                                         PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 848   BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation ,
 849                              struct _DEVICE_OBJECT *DeviceObject ) ;
 850   NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease ,
 851                                  struct _DEVICE_OBJECT *DeviceObject ) ;
 852   NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 853   NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 854};
 855typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH;
 856enum _IO_ALLOCATION_ACTION {
 857    KeepObject = 1,
 858    DeallocateObject = 2,
 859    DeallocateObjectKeepRegisters = 3
 860} ;
 861typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION;
 862struct _IO_SECURITY_CONTEXT {
 863   PSECURITY_QUALITY_OF_SERVICE SecurityQos ;
 864   PACCESS_STATE AccessState ;
 865   ACCESS_MASK DesiredAccess ;
 866   ULONG FullCreateOptions ;
 867};
 868typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT;
 869struct _VPB {
 870   CSHORT Type ;
 871   CSHORT Size ;
 872   USHORT Flags ;
 873   USHORT VolumeLabelLength ;
 874   struct _DEVICE_OBJECT *DeviceObject ;
 875   struct _DEVICE_OBJECT *RealDevice ;
 876   ULONG SerialNumber ;
 877   ULONG ReferenceCount ;
 878   WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ;
 879};
 880typedef struct _VPB *PVPB;
 881struct _WAIT_CONTEXT_BLOCK {
 882   KDEVICE_QUEUE_ENTRY WaitQueueEntry ;
 883   IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ,
 884                                         PVOID MapRegisterBase , PVOID Context ) ;
 885   PVOID DeviceContext ;
 886   ULONG NumberOfMapRegisters ;
 887   PVOID DeviceObject ;
 888   PVOID CurrentIrp ;
 889   PKDPC BufferChainingDpc ;
 890};
 891typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK;
 892union __anonunion_Queue_43 {
 893   LIST_ENTRY ListEntry ;
 894   WAIT_CONTEXT_BLOCK Wcb ;
 895};
 896struct _DEVOBJ_EXTENSION;
 897struct _DEVICE_OBJECT {
 898   CSHORT Type ;
 899   USHORT Size ;
 900   LONG ReferenceCount ;
 901   struct _DRIVER_OBJECT *DriverObject ;
 902   struct _DEVICE_OBJECT *NextDevice ;
 903   struct _DEVICE_OBJECT *AttachedDevice ;
 904   struct _IRP *CurrentIrp ;
 905   PIO_TIMER Timer ;
 906   ULONG Flags ;
 907   ULONG Characteristics ;
 908   PVPB Vpb ;
 909   PVOID DeviceExtension ;
 910   ULONG DeviceType ;
 911   CCHAR StackSize ;
 912   union __anonunion_Queue_43 Queue ;
 913   ULONG AlignmentRequirement ;
 914   KDEVICE_QUEUE DeviceQueue ;
 915   KDPC Dpc ;
 916   ULONG ActiveThreadCount ;
 917   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 918   KEVENT DeviceLock ;
 919   USHORT SectorSize ;
 920   USHORT Spare1 ;
 921   struct _DEVOBJ_EXTENSION *DeviceObjectExtension ;
 922   PVOID Reserved ;
 923};
 924typedef struct _DEVICE_OBJECT DEVICE_OBJECT;
 925typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
 926struct _DEVOBJ_EXTENSION {
 927   CSHORT Type ;
 928   USHORT Size ;
 929   PDEVICE_OBJECT DeviceObject ;
 930};
 931struct _DRIVER_EXTENSION {
 932   struct _DRIVER_OBJECT *DriverObject ;
 933   NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ;
 934   ULONG Count ;
 935   UNICODE_STRING ServiceKeyName ;
 936};
 937typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION;
 938struct _DRIVER_OBJECT {
 939   CSHORT Type ;
 940   CSHORT Size ;
 941   PDEVICE_OBJECT DeviceObject ;
 942   ULONG Flags ;
 943   PVOID DriverStart ;
 944   ULONG DriverSize ;
 945   PVOID DriverSection ;
 946   PDRIVER_EXTENSION DriverExtension ;
 947   UNICODE_STRING DriverName ;
 948   PUNICODE_STRING HardwareDatabase ;
 949   PFAST_IO_DISPATCH FastIoDispatch ;
 950   NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ;
 951   void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
 952   void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ;
 953   PDRIVER_DISPATCH MajorFunction[28] ;
 954};
 955typedef struct _DRIVER_OBJECT DRIVER_OBJECT;
 956typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
 957struct _SECTION_OBJECT_POINTERS {
 958   PVOID DataSectionObject ;
 959   PVOID SharedCacheMap ;
 960   PVOID ImageSectionObject ;
 961};
 962typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS;
 963typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS;
 964struct _IO_COMPLETION_CONTEXT {
 965   PVOID Port ;
 966   PVOID Key ;
 967};
 968typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT;
 969struct _FILE_OBJECT {
 970   CSHORT Type ;
 971   CSHORT Size ;
 972   PDEVICE_OBJECT DeviceObject ;
 973   PVPB Vpb ;
 974   PVOID FsContext ;
 975   PVOID FsContext2 ;
 976   PSECTION_OBJECT_POINTERS SectionObjectPointer ;
 977   PVOID PrivateCacheMap ;
 978   NTSTATUS FinalStatus ;
 979   struct _FILE_OBJECT *RelatedFileObject ;
 980   BOOLEAN LockOperation ;
 981   BOOLEAN DeletePending ;
 982   BOOLEAN ReadAccess ;
 983   BOOLEAN WriteAccess ;
 984   BOOLEAN DeleteAccess ;
 985   BOOLEAN SharedRead ;
 986   BOOLEAN SharedWrite ;
 987   BOOLEAN SharedDelete ;
 988   ULONG Flags ;
 989   UNICODE_STRING FileName ;
 990   LARGE_INTEGER CurrentByteOffset ;
 991   ULONG Waiters ;
 992   ULONG Busy ;
 993   PVOID LastLock ;
 994   KEVENT Lock ;
 995   KEVENT Event ;
 996   PIO_COMPLETION_CONTEXT CompletionContext ;
 997};
 998typedef struct _FILE_OBJECT *PFILE_OBJECT;
 999union __anonunion_AssociatedIrp_44 {
1000   struct _IRP *MasterIrp ;
1001   LONG IrpCount ;
1002   PVOID SystemBuffer ;
1003};
1004struct __anonstruct_AsynchronousParameters_46 {
1005   void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock ,
1006                                                          ULONG Reserved ) ;
1007   PVOID UserApcContext ;
1008};
1009union __anonunion_Overlay_45 {
1010   struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ;
1011   LARGE_INTEGER AllocationSize ;
1012};
1013struct __anonstruct____missing_field_name_50 {
1014   PVOID DriverContext[4] ;
1015};
1016union __anonunion____missing_field_name_49 {
1017   KDEVICE_QUEUE_ENTRY DeviceQueueEntry ;
1018   struct __anonstruct____missing_field_name_50 __annonCompField14 ;
1019};
1020struct _IO_STACK_LOCATION;
1021union __anonunion____missing_field_name_52 {
1022   struct _IO_STACK_LOCATION *CurrentStackLocation ;
1023   ULONG PacketType ;
1024};
1025struct __anonstruct____missing_field_name_51 {
1026   LIST_ENTRY ListEntry ;
1027   union __anonunion____missing_field_name_52 __annonCompField16 ;
1028};
1029struct __anonstruct_Overlay_48 {
1030   union __anonunion____missing_field_name_49 __annonCompField15 ;
1031   PETHREAD Thread ;
1032   PCHAR AuxiliaryBuffer ;
1033   struct __anonstruct____missing_field_name_51 __annonCompField17 ;
1034   PFILE_OBJECT OriginalFileObject ;
1035};
1036union __anonunion_Tail_47 {
1037   struct __anonstruct_Overlay_48 Overlay ;
1038   KAPC Apc ;
1039   PVOID CompletionKey ;
1040};
1041struct _IRP {
1042   CSHORT Type ;
1043   USHORT Size ;
1044   PMDL MdlAddress ;
1045   ULONG Flags ;
1046   union __anonunion_AssociatedIrp_44 AssociatedIrp ;
1047   LIST_ENTRY ThreadListEntry ;
1048   IO_STATUS_BLOCK IoStatus ;
1049   KPROCESSOR_MODE RequestorMode ;
1050   BOOLEAN PendingReturned ;
1051   CHAR StackCount ;
1052   CHAR CurrentLocation ;
1053   BOOLEAN Cancel ;
1054   KIRQL CancelIrql ;
1055   CCHAR ApcEnvironment ;
1056   UCHAR AllocationFlags ;
1057   PIO_STATUS_BLOCK UserIosb ;
1058   PKEVENT UserEvent ;
1059   union __anonunion_Overlay_45 Overlay ;
1060   void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
1061   PVOID UserBuffer ;
1062   union __anonunion_Tail_47 Tail ;
1063};
1064typedef struct _IRP IRP;
1065typedef struct _IRP *PIRP;
1066enum _DEVICE_RELATION_TYPE {
1067    BusRelations = 0,
1068    EjectionRelations = 1,
1069    PowerRelations = 2,
1070    RemovalRelations = 3,
1071    TargetDeviceRelation = 4
1072} ;
1073typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE;
1074enum _DEVICE_USAGE_NOTIFICATION_TYPE {
1075    DeviceUsageTypeUndefined = 0,
1076    DeviceUsageTypePaging = 1,
1077    DeviceUsageTypeHibernation = 2,
1078    DeviceUsageTypeDumpFile = 3
1079} ;
1080typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE;
1081struct _INTERFACE {
1082   USHORT Size ;
1083   USHORT Version ;
1084   PVOID Context ;
1085   void (*InterfaceReference)(PVOID Context ) ;
1086   void (*InterfaceDereference)(PVOID Context ) ;
1087};
1088typedef struct _INTERFACE *PINTERFACE;
1089struct _DEVICE_CAPABILITIES {
1090   USHORT Size ;
1091   USHORT Version ;
1092   ULONG DeviceD1 : 1 ;
1093   ULONG DeviceD2 : 1 ;
1094   ULONG LockSupported : 1 ;
1095   ULONG EjectSupported : 1 ;
1096   ULONG Removable : 1 ;
1097   ULONG DockDevice : 1 ;
1098   ULONG UniqueID : 1 ;
1099   ULONG SilentInstall : 1 ;
1100   ULONG RawDeviceOK : 1 ;
1101   ULONG SurpriseRemovalOK : 1 ;
1102   ULONG WakeFromD0 : 1 ;
1103   ULONG WakeFromD1 : 1 ;
1104   ULONG WakeFromD2 : 1 ;
1105   ULONG WakeFromD3 : 1 ;
1106   ULONG HardwareDisabled : 1 ;
1107   ULONG NonDynamic : 1 ;
1108   ULONG WarmEjectSupported : 1 ;
1109   ULONG Reserved : 15 ;
1110   ULONG Address ;
1111   ULONG UINumber ;
1112   DEVICE_POWER_STATE DeviceState[7] ;
1113   SYSTEM_POWER_STATE SystemWake ;
1114   DEVICE_POWER_STATE DeviceWake ;
1115   ULONG D1Latency ;
1116   ULONG D2Latency ;
1117   ULONG D3Latency ;
1118};
1119typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES;
1120struct _POWER_SEQUENCE {
1121   ULONG SequenceD1 ;
1122   ULONG SequenceD2 ;
1123   ULONG SequenceD3 ;
1124};
1125typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE;
1126enum __anonenum_BUS_QUERY_ID_TYPE_53 {
1127    BusQueryDeviceID = 0,
1128    BusQueryHardwareIDs = 1,
1129    BusQueryCompatibleIDs = 2,
1130    BusQueryInstanceID = 3,
1131    BusQueryDeviceSerialNumber = 4
1132} ;
1133typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE;
1134enum __anonenum_DEVICE_TEXT_TYPE_54 {
1135    DeviceTextDescription = 0,
1136    DeviceTextLocationInformation = 1
1137} ;
1138typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE;
1139#pragma pack(push,4)
1140struct __anonstruct_Create_56 {
1141   PIO_SECURITY_CONTEXT SecurityContext ;
1142   ULONG Options ;
1143   USHORT FileAttributes ;
1144   USHORT ShareAccess ;
1145   ULONG EaLength ;
1146};
1147struct __anonstruct_Read_57 {
1148   ULONG Length ;
1149   ULONG Key ;
1150   LARGE_INTEGER ByteOffset ;
1151};
1152struct __anonstruct_Write_58 {
1153   ULONG Length ;
1154   ULONG Key ;
1155   LARGE_INTEGER ByteOffset ;
1156};
1157struct __anonstruct_QueryFile_59 {
1158   ULONG Length ;
1159   FILE_INFORMATION_CLASS FileInformationClass ;
1160};
1161struct __anonstruct____missing_field_name_62 {
1162   BOOLEAN ReplaceIfExists ;
1163   BOOLEAN AdvanceOnly ;
1164};
1165union __anonunion____missing_field_name_61 {
1166   struct __anonstruct____missing_field_name_62 __annonCompField18 ;
1167   ULONG ClusterCount ;
1168   HANDLE DeleteHandle ;
1169};
1170struct __anonstruct_SetFile_60 {
1171   ULONG Length ;
1172   FILE_INFORMATION_CLASS FileInformationClass ;
1173   PFILE_OBJECT FileObject ;
1174   union __anonunion____missing_field_name_61 __annonCompField19 ;
1175};
1176struct __anonstruct_QueryVolume_63 {
1177   ULONG Length ;
1178   FS_INFORMATION_CLASS FsInformationClass ;
1179};
1180struct __anonstruct_DeviceIoControl_64 {
1181   ULONG OutputBufferLength ;
1182   ULONG InputBufferLength ;
1183   ULONG IoControlCode ;
1184   PVOID Type3InputBuffer ;
1185};
1186struct __anonstruct_QuerySecurity_65 {
1187   SECURITY_INFORMATION SecurityInformation ;
1188   ULONG Length ;
1189};
1190struct __anonstruct_SetSecurity_66 {
1191   SECURITY_INFORMATION SecurityInformation ;
1192   PSECURITY_DESCRIPTOR SecurityDescriptor ;
1193};
1194struct __anonstruct_MountVolume_67 {
1195   PVPB Vpb ;
1196   PDEVICE_OBJECT DeviceObject ;
1197};
1198struct __anonstruct_VerifyVolume_68 {
1199   PVPB Vpb ;
1200   PDEVICE_OBJECT DeviceObject ;
1201};
1202struct __anonstruct_Scsi_69 {
1203   struct _SCSI_REQUEST_BLOCK *Srb ;
1204};
1205struct __anonstruct_QueryDeviceRelations_70 {
1206   DEVICE_RELATION_TYPE Type ;
1207};
1208struct __anonstruct_QueryInterface_71 {
1209   GUID const   *InterfaceType ;
1210   USHORT Size ;
1211   USHORT Version ;
1212   PINTERFACE Interface ;
1213   PVOID InterfaceSpecificData ;
1214};
1215struct __anonstruct_DeviceCapabilities_72 {
1216   PDEVICE_CAPABILITIES Capabilities ;
1217};
1218struct __anonstruct_FilterResourceRequirements_73 {
1219   PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ;
1220};
1221struct __anonstruct_ReadWriteConfig_74 {
1222   ULONG WhichSpace ;
1223   PVOID Buffer ;
1224   ULONG Offset ;
1225   ULONG Length ;
1226};
1227struct __anonstruct_SetLock_75 {
1228   BOOLEAN Lock ;
1229};
1230struct __anonstruct_QueryId_76 {
1231   BUS_QUERY_ID_TYPE IdType ;
1232};
1233struct __anonstruct_QueryDeviceText_77 {
1234   DEVICE_TEXT_TYPE DeviceTextType ;
1235   LCID LocaleId ;
1236};
1237struct __anonstruct_UsageNotification_78 {
1238   BOOLEAN InPath ;
1239   BOOLEAN Reserved[3] ;
1240   DEVICE_USAGE_NOTIFICATION_TYPE Type ;
1241};
1242struct __anonstruct_WaitWake_79 {
1243   SYSTEM_POWER_STATE PowerState ;
1244};
1245struct __anonstruct_PowerSequence_80 {
1246   PPOWER_SEQUENCE PowerSequence ;
1247};
1248struct __anonstruct_Power_81 {
1249   ULONG SystemContext ;
1250   POWER_STATE_TYPE Type ;
1251   POWER_STATE State ;
1252   POWER_ACTION ShutdownType ;
1253};
1254struct __anonstruct_StartDevice_82 {
1255   PCM_RESOURCE_LIST AllocatedResources ;
1256   PCM_RESOURCE_LIST AllocatedResourcesTranslated ;
1257};
1258struct __anonstruct_WMI_83 {
1259   ULONG_PTR ProviderId ;
1260   PVOID DataPath ;
1261   ULONG BufferSize ;
1262   PVOID Buffer ;
1263};
1264struct __anonstruct_Others_84 {
1265   PVOID Argument1 ;
1266   PVOID Argument2 ;
1267   PVOID Argument3 ;
1268   PVOID Argument4 ;
1269};
1270union __anonunion_Parameters_55 {
1271   struct __anonstruct_Create_56 Create ;
1272   struct __anonstruct_Read_57 Read ;
1273   struct __anonstruct_Write_58 Write ;
1274   struct __anonstruct_QueryFile_59 QueryFile ;
1275   struct __anonstruct_SetFile_60 SetFile ;
1276   struct __anonstruct_QueryVolume_63 QueryVolume ;
1277   struct __anonstruct_DeviceIoControl_64 DeviceIoControl ;
1278   struct __anonstruct_QuerySecurity_65 QuerySecurity ;
1279   struct __anonstruct_SetSecurity_66 SetSecurity ;
1280   struct __anonstruct_MountVolume_67 MountVolume ;
1281   struct __anonstruct_VerifyVolume_68 VerifyVolume ;
1282   struct __anonstruct_Scsi_69 Scsi ;
1283   struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ;
1284   struct __anonstruct_QueryInterface_71 QueryInterface ;
1285   struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ;
1286   struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ;
1287   struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ;
1288   struct __anonstruct_SetLock_75 SetLock ;
1289   struct __anonstruct_QueryId_76 QueryId ;
1290   struct __anonstruct_QueryDeviceText_77 QueryDeviceText ;
1291   struct __anonstruct_UsageNotification_78 UsageNotification ;
1292   struct __anonstruct_WaitWake_79 WaitWake ;
1293   struct __anonstruct_PowerSequence_80 PowerSequence ;
1294   struct __anonstruct_Power_81 Power ;
1295   struct __anonstruct_StartDevice_82 StartDevice ;
1296   struct __anonstruct_WMI_83 WMI ;
1297   struct __anonstruct_Others_84 Others ;
1298};
1299struct _IO_STACK_LOCATION {
1300   UCHAR MajorFunction ;
1301   UCHAR MinorFunction ;
1302   UCHAR Flags ;
1303   UCHAR Control ;
1304   union __anonunion_Parameters_55 Parameters ;
1305   PDEVICE_OBJECT DeviceObject ;
1306   PFILE_OBJECT FileObject ;
1307   NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
1308   PVOID Context ;
1309};
1310typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION;
1311typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION;
1312#pragma pack(pop)
1313struct _CONFIGURATION_INFORMATION {
1314   ULONG DiskCount ;
1315   ULONG FloppyCount ;
1316   ULONG CdRomCount ;
1317   ULONG TapeCount ;
1318   ULONG ScsiPortCount ;
1319   ULONG SerialCount ;
1320   ULONG ParallelCount ;
1321   BOOLEAN AtDiskPrimaryAddressClaimed ;
1322   BOOLEAN AtDiskSecondaryAddressClaimed ;
1323   ULONG Version ;
1324   ULONG MediumChangerCount ;
1325};
1326typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION;
1327typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION;
1328struct _OBJECT_HANDLE_INFORMATION {
1329   ULONG HandleAttributes ;
1330   ACCESS_MASK GrantedAccess ;
1331};
1332typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
1333struct _STORAGE_DEVICE_NUMBER {
1334   ULONG DeviceType ;
1335   ULONG DeviceNumber ;
1336   ULONG PartitionNumber ;
1337};
1338typedef struct _STORAGE_DEVICE_NUMBER STORAGE_DEVICE_NUMBER;
1339struct _DISK_PERFORMANCE {
1340   LARGE_INTEGER BytesRead ;
1341   LARGE_INTEGER BytesWritten ;
1342   LARGE_INTEGER ReadTime ;
1343   LARGE_INTEGER WriteTime ;
1344   LARGE_INTEGER IdleTime ;
1345   ULONG ReadCount ;
1346   ULONG WriteCount ;
1347   ULONG QueueDepth ;
1348   ULONG SplitCount ;
1349   LARGE_INTEGER QueryTime ;
1350   ULONG StorageDeviceNumber ;
1351   WCHAR StorageManagerName[8] ;
1352};
1353typedef struct _DISK_PERFORMANCE DISK_PERFORMANCE;
1354typedef struct _DISK_PERFORMANCE *PDISK_PERFORMANCE;
1355#pragma pack(push,1)
1356#pragma pack(pop)
1357#pragma pack(push,1)
1358#pragma pack(pop)
1359#pragma pack(push,1)
1360#pragma pack(pop)
1361#pragma pack(push,1)
1362#pragma pack(pop)
1363#pragma pack(push,1)
1364#pragma pack(pop)
1365#pragma pack(push,8)
1366#pragma pack(pop)
1367#pragma pack(push,8)
1368#pragma pack(pop)
1369struct _VOLUME_NUMBER {
1370   ULONG VolumeNumber ;
1371   WCHAR VolumeManagerName[8] ;
1372};
1373typedef struct _VOLUME_NUMBER VOLUME_NUMBER;
1374struct _MOUNTDEV_NAME {
1375   USHORT NameLength ;
1376   WCHAR Name[1] ;
1377};
1378typedef struct _MOUNTDEV_NAME MOUNTDEV_NAME;
1379typedef struct _MOUNTDEV_NAME *PMOUNTDEV_NAME;
1380struct _WMI_DISK_PERFORMANCE {
1381   LONGLONG BytesRead ;
1382   LONGLONG BytesWritten ;
1383   LONGLONG ReadTime ;
1384   LONGLONG WriteTime ;
1385   LONGLONG IdleTime ;
1386   ULONG ReadCount ;
1387   ULONG WriteCount ;
1388   ULONG QueueDepth ;
1389   ULONG SplitCount ;
1390   LONGLONG QueryTime ;
1391   ULONG StorageDeviceNumber ;
1392   USHORT StorageManagerName[8] ;
1393};
1394typedef struct _WMI_DISK_PERFORMANCE WMI_DISK_PERFORMANCE;
1395typedef struct _WMI_DISK_PERFORMANCE *PWMI_DISK_PERFORMANCE;
1396struct __anonstruct_WMIGUIDREGINFO_130 {
1397   LPCGUID Guid ;
1398   ULONG InstanceCount ;
1399   ULONG Flags ;
1400};
1401typedef struct __anonstruct_WMIGUIDREGINFO_130 WMIGUIDREGINFO;
1402typedef struct __anonstruct_WMIGUIDREGINFO_130 *PWMIGUIDREGINFO;
1403enum __anonenum_WMIENABLEDISABLECONTROL_131 {
1404    WmiEventControl = 0,
1405    WmiDataBlockControl = 1
1406} ;
1407typedef enum __anonenum_WMIENABLEDISABLECONTROL_131 WMIENABLEDISABLECONTROL;
1408struct _WMILIB_CONTEXT {
1409   ULONG GuidCount ;
1410   PWMIGUIDREGINFO GuidList ;
1411   NTSTATUS (*QueryWmiRegInfo)(PDEVICE_OBJECT DeviceObject , PULONG RegFlags , PUNICODE_STRING InstanceName ,
1412                               PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName ,
1413                               PDEVICE_OBJECT *Pdo ) ;
1414   NTSTATUS (*QueryWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
1415                                 ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray ,
1416                                 ULONG BufferAvail , PUCHAR Buffer ) ;
1417   NTSTATUS (*SetWmiDataBlock)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
1418                               ULONG InstanceIndex , ULONG BufferSize , PUCHAR Buffer ) ;
1419   NTSTATUS (*SetWmiDataItem)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
1420                              ULONG InstanceIndex , ULONG DataItemId , ULONG BufferSize ,
1421                              PUCHAR Buffer ) ;
1422   NTSTATUS (*ExecuteWmiMethod)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
1423                                ULONG InstanceIndex , ULONG MethodId , ULONG InBufferSize ,
1424                                ULONG OutBufferSize , PUCHAR Buffer ) ;
1425   NTSTATUS (*WmiFunctionControl)(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
1426                                  WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ;
1427};
1428typedef struct _WMILIB_CONTEXT WMILIB_CONTEXT;
1429typedef struct _WMILIB_CONTEXT *PWMILIB_CONTEXT;
1430enum __anonenum_SYSCTL_IRP_DISPOSITION_132 {
1431    IrpProcessed = 0,
1432    IrpNotCompleted = 1,
1433    IrpNotWmi = 2,
1434    IrpForward = 3
1435} ;
1436typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_132 SYSCTL_IRP_DISPOSITION;
1437typedef enum __anonenum_SYSCTL_IRP_DISPOSITION_132 *PSYSCTL_IRP_DISPOSITION;
1438struct _DEVICE_EXTENSION {
1439   PDEVICE_OBJECT DeviceObject ;
1440   PDEVICE_OBJECT TargetDeviceObject ;
1441   PDEVICE_OBJECT PhysicalDeviceObject ;
1442   ULONG DiskNumber ;
1443   WCHAR StorageManagerName[8] ;
1444   ULONG Processors ;
1445   PDISK_PERFORMANCE DiskCounters ;
1446   LARGE_INTEGER LastIdleClock ;
1447   LONG QueueDepth ;
1448   LONG CountersEnabled ;
1449   KEVENT PagingPathCountEvent ;
1450   ULONG PagingPathCount ;
1451   UNICODE_STRING PhysicalDeviceName ;
1452   WCHAR PhysicalDeviceNameBuffer[64] ;
1453   WMILIB_CONTEXT WmilibContext ;
1454};
1455typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION;
1456typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION;
1457#pragma pack(push,8)
1458#pragma pack(pop)
1459struct _KAPC;
1460struct _KDPC;
1461#pragma pack(push,4)
1462#pragma pack(pop)
1463#pragma pack(push,4)
1464#pragma pack(pop)
1465#pragma pack(push,1)
1466#pragma pack(pop)
1467struct _DRIVER_OBJECT;
1468struct _DEVICE_OBJECT;
1469struct _DRIVER_OBJECT;
1470struct _FILE_OBJECT;
1471struct _IRP;
1472struct _SCSI_REQUEST_BLOCK;
1473#pragma pack(push,4)
1474#pragma pack(pop)
1475#pragma once
1476#pragma once
1477#pragma once
1478#pragma once
1479#pragma warning(push)
1480#pragma warning(disable:4035)
1481#pragma warning(pop)
1482#pragma once
1483extern void *memcpy(void * , void const   * , size_t  ) ;
1484extern void *memset(void * , int  , size_t  ) ;
1485extern PCCHAR KeNumberProcessors ;
1486#pragma warning(disable:4103)
1487#pragma warning(disable:4103)
1488  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
1489                                                                                                PCWSTR Path ,
1490                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
1491                                                                                                PVOID Context ,
1492                                                                                                PVOID Environment ) ;
1493  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
1494                                                                                                PCWSTR Path ,
1495                                                                                                PCWSTR ValueName ) ;
1496  void RtlInitString(PSTRING DestinationString ,
1497                                                                                   PCSZ SourceString ) ;
1498  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
1499                                                                                          PCWSTR SourceString ) ;
1500  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
1501                                                                                                      PANSI_STRING SourceString ,
1502                                                                                                      BOOLEAN AllocateDestinationString ) ;
1503  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
1504                                                                                          PUNICODE_STRING SourceString ) ;
1505  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
1506  SIZE_T RtlCompareMemory(void const   *Source1 ,
1507                                                                                        void const   *Source2 ,
1508                                                                                        SIZE_T Length ) ;
1509#pragma warning(push)
1510#pragma warning(disable:4035)
1511#pragma warning(pop)
1512extern   LONG InterlockedIncrement(PLONG Addend ) ;
1513extern   LONG InterlockedDecrement(PLONG Addend ) ;
1514extern   LONG InterlockedExchange(PLONG Target ,
1515                                                                                                 LONG Value ) ;
1516#pragma warning(disable:4035)
1517 ULONG KeGetCurrentProcessorNumber(void) 
1518{ 
1519
1520  {
1521  return (0UL);
1522}
1523}
1524#pragma warning(push)
1525#pragma warning(disable:4164)
1526#pragma function(_enable)
1527#pragma function(_disable)
1528#pragma warning(pop)
1529#pragma warning(disable:4103)
1530#pragma warning(disable:4103)
1531#pragma warning(disable:4103)
1532#pragma warning(disable:4103)
1533  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
1534                                                       BOOLEAN State ) ;
1535  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
1536                                                BOOLEAN Wait ) ;
1537  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
1538                                                           LONG Count , LONG Limit ) ;
1539  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
1540                                                        LONG Adjustment , BOOLEAN Wait ) ;
1541  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
1542                                                                BOOLEAN Alertable ,
1543                                                                PLARGE_INTEGER Interval ) ;
1544  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
1545                                                               KPROCESSOR_MODE WaitMode ,
1546                                                               BOOLEAN Alertable ,
1547                                                               PLARGE_INTEGER Timeout ) ;
1548  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
1549  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
1550                                                                                        KIRQL NewIrql ) ;
1551extern   void KeQuerySystemTime(PLARGE_INTEGER CurrentTime ) ;
1552  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
1553                                                                                            SIZE_T NumberOfBytes ,
1554                                                                                            ULONG Tag ) ;
1555  void ExFreePool(PVOID P ) ;
1556  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
1557  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
1558  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
1559                                                                                                          PLIST_ENTRY ListEntry ,
1560                                                                                                          PKSPIN_LOCK Lock ) ;
1561  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
1562                                                                                                          PLIST_ENTRY ListEntry ,
1563                                                                                                          PKSPIN_LOCK Lock ) ;
1564  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
1565                                                                                                          PKSPIN_LOCK Lock ) ;
1566  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
1567  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
1568                                                                   KPROCESSOR_MODE AccessMode ,
1569                                                                   MEMORY_CACHING_TYPE CacheType ,
1570                                                                   PVOID BaseAddress ,
1571                                                                   ULONG BugCheckOnFailure ,
1572                                                                   MM_PAGE_PRIORITY Priority ) ;
1573  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
1574                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
1575  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
1576  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
1577  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
1578  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
1579                                                              ULONG DesiredAccess ,
1580                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
1581                                                              HANDLE ProcessHandle ,
1582                                                              PCLIENT_ID ClientId ,
1583                                                              void (*StartRoutine)(PVOID StartContext ) ,
1584                                                              PVOID StartContext ) ;
1585  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
1586#pragma warning(disable:4103)
1587#pragma warning(disable:4103)
1588extern   PVOID IoAllocateErrorLogEntry(PVOID IoObject ,
1589                                                                     UCHAR EntrySize ) ;
1590  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
1591                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
1592                                                   PIRP Irp ) ;
1593  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
1594                                                                           PDEVICE_OBJECT TargetDevice ) ;
1595  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
1596                                                                   PDEVICE_OBJECT DeviceObject ,
1597                                                                   PVOID Buffer ,
1598                                                                   ULONG Length ,
1599                                                                   PLARGE_INTEGER StartingOffset ,
1600                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
1601  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
1602                                                                   PDEVICE_OBJECT DeviceObject ,
1603                                                                   PVOID InputBuffer ,
1604                                                                   ULONG InputBufferLength ,
1605                                                                   PVOID OutputBuffer ,
1606                                                                   ULONG OutputBufferLength ,
1607                                                                   BOOLEAN InternalDeviceIoControl ,
1608                                                                   PKEVENT Event ,
1609                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
1610  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
1611                                                                                        PIRP Irp ) ;
1612  void IofCompleteRequest(PIRP Irp ,
1613                                                                                         CCHAR PriorityBoost ) ;
1614  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
1615                                                        ULONG DeviceExtensionSize ,
1616                                                        PUNICODE_STRING DeviceName ,
1617                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
1618                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
1619  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
1620                                                              PUNICODE_STRING DeviceName ) ;
1621  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
1622  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
1623  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
1624  void IoFreeIrp(PIRP Irp ) ;
1625  void IoFreeMdl(PMDL Mdl ) ;
1626  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
1627  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
1628                                                                  PULONG BusNumber ,
1629                                                                  PCONFIGURATION_TYPE ControllerType ,
1630                                                                  PULONG ControllerNumber ,
1631                                                                  PCONFIGURATION_TYPE PeripheralType ,
1632                                                                  PULONG PeripheralNumber ,
1633                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
1634                                                                                             PUNICODE_STRING PathName ,
1635                                                                                             INTERFACE_TYPE BusType ,
1636                                                                                             ULONG BusNumber ,
1637                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
1638                                                                                             CONFIGURATION_TYPE ControllerType ,
1639                                                                                             ULONG ControllerNumber ,
1640                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
1641                                                                                             CONFIGURATION_TYPE PeripheralType ,
1642                                                                                             ULONG PeripheralNumber ,
1643                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
1644                                                                  PVOID Context ) ;
1645  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
1646  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
1647extern   void IoWriteErrorLogEntry(PVOID ElEntry ) ;
1648extern   NTSTATUS IoWMIRegistrationControl(PDEVICE_OBJECT DeviceObject ,
1649                                                                         ULONG Action ) ;
1650  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
1651                                                                                                   GUID const   *InterfaceClassGuid ,
1652                                                                                                   PUNICODE_STRING ReferenceString ,
1653                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
1654  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
1655                                                                   BOOLEAN Enable ) ;
1656extern   LARGE_INTEGER KeQueryPerformanceCounter(PLARGE_INTEGER PerformanceFrequency ) ;
1657#pragma warning(disable:4200)
1658#pragma warning(default:4200)
1659  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
1660                                                      PIRP Irp ) ;
1661  void PoStartNextPowerIrp(PIRP Irp ) ;
1662  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
1663                                                                   ACCESS_MASK DesiredAccess ,
1664                                                                   POBJECT_TYPE ObjectType ,
1665                                                                   KPROCESSOR_MODE AccessMode ,
1666                                                                   PVOID *Object ,
1667                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
1668  void ObfDereferenceObject(PVOID Object ) ;
1669  NTSTATUS ZwClose(HANDLE Handle ) ;
1670#pragma once
1671  struct _GUID  const  DiskClassGuid  =    {1408590599L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1672  struct _GUID  const  CdRomClassGuid  =    {1408590600L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1673  struct _GUID  const  PartitionClassGuid  =    {1408590602L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1674  struct _GUID  const  TapeClassGuid  =    {1408590603L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1675  struct _GUID  const  WriteOnceDiskClassGuid  =    {1408590604L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1676  struct _GUID  const  VolumeClassGuid  =    {1408590605L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1677  struct _GUID  const  MediumChangerClassGuid  =    {1408590608L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1678  struct _GUID  const  FloppyClassGuid  =    {1408590609L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1679  struct _GUID  const  CdChangerClassGuid  =    {1408590610L, 46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1680  struct _GUID  const  StoragePortClassGuid  =    {718077536L, 49456, 4562, {176, 130, 0, 160, 201, 30, 251, 139}};
1681#pragma warning(disable:4103)
1682#pragma warning(disable:4103)
1683#pragma warning(disable:4103)
1684#pragma warning(disable:4103)
1685#pragma warning(disable:4103)
1686#pragma warning(disable:4103)
1687#pragma warning(disable:4103)
1688#pragma warning(disable:4103)
1689#pragma warning(disable:4103)
1690#pragma warning(disable:4103)
1691#pragma once
1692#pragma once
1693extern int swprintf(wchar_t * , wchar_t const   *  , ...) ;
1694#pragma once
1695#pragma once
1696  struct _GUID  const  MOUNTDEV_MOUNTED_DEVICE_GUID  =    {1408590605,
1697    46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1698#pragma warning(disable:4200)
1699  struct _GUID  const  MSWmi_MofData_GUID  =    {93327905, 54630, 4561, {178, 240, 0, 160, 201, 6, 41, 16}};
1700  struct _GUID  const  MSWmi_ProviderInfo_GUID  =    {3351197136U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}};
1701  struct _GUID  const  MSWmi_PnPDeviceId_GUID  =    {3351197138U, 43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}};
1702  struct _GUID  const  MSWmi_PnPInstanceNames_GUID  =    {3351197139U,
1703    43739, 4561, {191, 74, 0, 160, 201, 6, 41, 16}};
1704  struct _GUID  const  MSSmBios_RawSMBiosTables_GUID  =    {2405959760U,
1705    42372, 4561, {191, 56, 0, 160, 201, 6, 41, 16}};
1706  struct _GUID  const  MSPower_DeviceEnable_GUID  =    {2189167215U,
1707    65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}};
1708  struct _GUID  const  MSPower_DeviceWakeEnable_GUID  =    {2840881794U,
1709    65200, 4560, {189, 38, 0, 170, 0, 183, 179, 42}};
1710  struct _GUID  const  MSNdis_NetworkAddress_GUID  =    {3049101495U,
1711    513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}};
1712  struct _GUID  const  MSNdis_NetworkShortAddress_GUID  =    {3049101496U,
1713    513, 4561, {165, 14, 0, 160, 201, 6, 41, 16}};
1714  struct _GUID  const  MSNdis_NetworkLinkSpeed_GUID  =    {1627155287,
1715    3942, 4561, {150, 167, 0, 192, 79, 195, 53, 140}};
1716  struct _GUID  const  MSNdis_EnumerateAdapter_GUID  =    {2552180095U,
1717    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1718  struct _GUID  const  MSNdis_NotifyAdapterRemoval_GUID  =    {2552180096U,
1719    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1720  struct _GUID  const  MSNdis_NotifyAdapterArrival_GUID  =    {2552180097U,
1721    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1722  struct _GUID  const  MSNdis_NdisEnumerateVc_GUID  =    {2552180098U,
1723    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1724  struct _GUID  const  MSNdis_NotifyVcRemoval_GUID  =    {2552180089U,
1725    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1726  struct _GUID  const  MSNdis_NotifyVcArrival_GUID  =    {405773836,
1727    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1728  struct _GUID  const  MSNdis_HardwareStatus_GUID  =    {1589707604,
1729    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1730  struct _GUID  const  MSNdis_MediaSupported_GUID  =    {1589707605,
1731    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1732  struct _GUID  const  MSNdis_MediaInUse_GUID  =    {1589707606, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1733  struct _GUID  const  MSNdis_MaximumLookahead_GUID  =    {1589707607,
1734    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1735  struct _GUID  const  MSNdis_MaximumFrameSize_GUID  =    {1589707608,
1736    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1737  struct _GUID  const  MSNdis_LinkSpeed_GUID  =    {1589707609, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1738  struct _GUID  const  MSNdis_TransmitBufferSpace_GUID  =    {1589707610,
1739    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1740  struct _GUID  const  MSNdis_ReceiveBufferSpace_GUID  =    {1589707611,
1741    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1742  struct _GUID  const  MSNdis_TransmitBlockSize_GUID  =    {1589707612,
1743    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1744  struct _GUID  const  MSNdis_ReceiveBlockSize_GUID  =    {1589707613,
1745    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1746  struct _GUID  const  MSNdis_VendorID_GUID  =    {1589707614, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1747  struct _GUID  const  MSNdis_VendorDescription_GUID  =    {1589707615,
1748    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1749  struct _GUID  const  MSNdis_CurrentPacketFilter_GUID  =    {1589707616,
1750    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1751  struct _GUID  const  MSNdis_CurrentLookahead_GUID  =    {1589707617,
1752    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1753  struct _GUID  const  MSNdis_DriverVersion_GUID  =    {1589707618,
1754    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1755  struct _GUID  const  MSNdis_MaximumTotalSize_GUID  =    {1589707619,
1756    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1757  struct _GUID  const  MSNdis_MacOptions_GUID  =    {1589707621, 42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1758  struct _GUID  const  MSNdis_MediaConnectStatus_GUID  =    {1589707622,
1759    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1760  struct _GUID  const  MSNdis_MaximumSendPackets_GUID  =    {1589707623,
1761    42522, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1762  struct _GUID  const  MSNdis_VendorDriverVersion_GUID  =    {1148802809,
1763    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1764  struct _GUID  const  MSNdis_TransmitsOk_GUID  =    {1148802810, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1765  struct _GUID  const  MSNdis_ReceivesOk_GUID  =    {1148802811, 42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1766  struct _GUID  const  MSNdis_TransmitsError_GUID  =    {1148802812,
1767    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1768  struct _GUID  const  MSNdis_ReceiveError_GUID  =    {1148802813,
1769    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1770  struct _GUID  const  MSNdis_ReceiveNoBuffer_GUID  =    {1148802814,
1771    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1772  struct _GUID  const  MSNdis_CoHardwareStatus_GUID  =    {2031800722,
1773    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1774  struct _GUID  const  MSNdis_CoMediaSupported_GUID  =    {2031800723,
1775    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1776  struct _GUID  const  MSNdis_CoMediaInUse_GUID  =    {2031800724,
1777    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1778  struct _GUID  const  MSNdis_CoLinkSpeed_GUID  =    {2031800725, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1779  struct _GUID  const  MSNdis_CoVendorId_GUID  =    {2031800726, 58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1780  struct _GUID  const  MSNdis_CoVendorDescription_GUID  =    {2031800727,
1781    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1782  struct _GUID  const  MSNdis_CoDriverVersion_GUID  =    {2031800728,
1783    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1784  struct _GUID  const  MSNdis_CoMacOptions_GUID  =    {2031800730,
1785    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1786  struct _GUID  const  MSNdis_CoMediaConnectStatus_GUID  =    {2031800731,
1787    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1788  struct _GUID  const  MSNdis_CoVendorDriverVersion_GUID  =    {2031800732,
1789    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1790  struct _GUID  const  MSNdis_CoMinimumLinkSpeed_GUID  =    {2031800733,
1791    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1792  struct _GUID  const  MSNdis_CoTransmitPdusOk_GUID  =    {169953285,
1793    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1794  struct _GUID  const  MSNdis_CoReceivePdusOk_GUID  =    {169953286,
1795    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1796  struct _GUID  const  MSNdis_CoTransmitPduErrors_GUID  =    {169953287,
1797    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1798  struct _GUID  const  MSNdis_CoReceivePduErrors_GUID  =    {169953288,
1799    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1800  struct _GUID  const  MSNdis_CoReceivePdusNoBuffer_GUID  =    {169953289,
1801    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1802  struct _GUID  const  MSNdis_AtmSupportedVcRates_GUID  =    {2031800734,
1803    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1804  struct _GUID  const  MSNdis_AtmSupportedServiceCategory_GUID  =    {2031800735,
1805    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1806  struct _GUID  const  MSNdis_AtmSupportedAalTypes_GUID  =    {2031800736,
1807    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1808  struct _GUID  const  MSNdis_AtmHardwareCurrentAddress_GUID  =    {2031800737,
1809    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1810  struct _GUID  const  MSNdis_AtmMaxActiveVcs_GUID  =    {2031800738,
1811    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1812  struct _GUID  const  MSNdis_AtmMaxActiveVciBits_GUID  =    {2031800739,
1813    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1814  struct _GUID  const  MSNdis_AtmMaxActiveVpiBits_GUID  =    {2031800740,
1815    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1816  struct _GUID  const  MSNdis_AtmMaxAal0PacketSize_GUID  =    {2031800741,
1817    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1818  struct _GUID  const  MSNdis_AtmMaxAal1PacketSize_GUID  =    {2031800742,
1819    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1820  struct _GUID  const  MSNdis_AtmMaxAal34PacketSize_GUID  =    {2031800743,
1821    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1822  struct _GUID  const  MSNdis_AtmMaxAal5PacketSize_GUID  =    {2031800721,
1823    58204, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1824  struct _GUID  const  MSNdis_AtmReceiveCellsOk_GUID  =    {169953290,
1825    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1826  struct _GUID  const  MSNdis_AtmTransmitCellsOk_GUID  =    {169953291,
1827    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1828  struct _GUID  const  MSNdis_AtmReceiveCellsDropped_GUID  =    {169953292,
1829    58207, 4560, {150, 146, 0, 192, 79, 195, 53, 140}};
1830  struct _GUID  const  MSNdis_EthernetPermanentAddress_GUID  =    {1148802815,
1831    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1832  struct _GUID  const  MSNdis_EthernetCurrentAddress_GUID  =    {1148802816,
1833    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1834  struct _GUID  const  MSNdis_EthernetMulticastList_GUID  =    {1148802817,
1835    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1836  struct _GUID  const  MSNdis_EthernetMaximumMulticastListSize_GUID  =    {1148802818,
1837    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1838  struct _GUID  const  MSNdis_EthernetMacOptions_GUID  =    {1148802819,
1839    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1840  struct _GUID  const  MSNdis_EthernetReceiveErrorAlignment_GUID  =    {1148802820,
1841    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1842  struct _GUID  const  MSNdis_EthernetOneTransmitCollision_GUID  =    {1148802821,
1843    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1844  struct _GUID  const  MSNdis_EthernetMoreTransmitCollisions_GUID  =    {1148802822,
1845    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1846  struct _GUID  const  MSNdis_TokenRingPermanentAddress_GUID  =    {1148802823,
1847    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1848  struct _GUID  const  MSNdis_TokenRingCurrentAddress_GUID  =    {1148802824,
1849    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1850  struct _GUID  const  MSNdis_TokenRingCurrentFunctional_GUID  =    {1148802825,
1851    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1852  struct _GUID  const  MSNdis_TokenRingCurrentGroup_GUID  =    {1148802826,
1853    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1854  struct _GUID  const  MSNdis_TokenRingLastOpenStatus_GUID  =    {1148802827,
1855    42523, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1856  struct _GUID  const  MSNdis_TokenRingCurrentRingStatus_GUID  =    {2299148012U,
1857    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1858  struct _GUID  const  MSNdis_TokenRingCurrentRingState_GUID  =    {2901491762U,
1859    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1860  struct _GUID  const  MSNdis_TokenRingLineErrors_GUID  =    {2901491763U,
1861    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1862  struct _GUID  const  MSNdis_TokenRingLostFrames_GUID  =    {2901491764U,
1863    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1864  struct _GUID  const  MSNdis_FddiLongPermanentAddress_GUID  =    {2901491765U,
1865    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1866  struct _GUID  const  MSNdis_FddiLongCurrentAddress_GUID  =    {2901491766U,
1867    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1868  struct _GUID  const  MSNdis_FddiLongMulticastList_GUID  =    {2901491767U,
1869    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1870  struct _GUID  const  MSNdis_FddiLongMaximumListSize_GUID  =    {2901491768U,
1871    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1872  struct _GUID  const  MSNdis_FddiShortPermanentAddress_GUID  =    {2901491769U,
1873    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1874  struct _GUID  const  MSNdis_FddiShortCurrentAddress_GUID  =    {2901491770U,
1875    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1876  struct _GUID  const  MSNdis_FddiShortMulticastList_GUID  =    {2901491771U,
1877    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1878  struct _GUID  const  MSNdis_FddiShortMaximumListSize_GUID  =    {2901491772U,
1879    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1880  struct _GUID  const  MSNdis_FddiAttachmentType_GUID  =    {2901491773U,
1881    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1882  struct _GUID  const  MSNdis_FddiUpstreamNodeLong_GUID  =    {2901491774U,
1883    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1884  struct _GUID  const  MSNdis_FddiDownstreamNodeLong_GUID  =    {2901491775U,
1885    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1886  struct _GUID  const  MSNdis_FddiFrameErrors_GUID  =    {2901491776U,
1887    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1888  struct _GUID  const  MSNdis_FddiFramesLost_GUID  =    {2901491777U,
1889    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1890  struct _GUID  const  MSNdis_FddiRingManagmentState_GUID  =    {2901491778U,
1891    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1892  struct _GUID  const  MSNdis_FddiLctFailures_GUID  =    {2901491779U,
1893    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1894  struct _GUID  const  MSNdis_FddiLemRejects_GUID  =    {2901491780U,
1895    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1896  struct _GUID  const  MSNdis_FddiLConnectionState_GUID  =    {2901491781U,
1897    42524, 4560, {141, 212, 0, 192, 79, 195, 53, 140}};
1898  struct _GUID  const  MSNdis_StatusResetStart_GUID  =    {2552180086U,
1899    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1900  struct _GUID  const  MSNdis_StatusResetEnd_GUID  =    {2552180087U,
1901    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1902  struct _GUID  const  MSNdis_StatusMediaConnect_GUID  =    {2552180093U,
1903    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1904  struct _GUID  const  MSNdis_StatusMediaDisconnect_GUID  =    {2552180094U,
1905    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1906  struct _GUID  const  MSNdis_StatusMediaSpecificIndication_GUID  =    {2552180100U,
1907    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1908  struct _GUID  const  MSNdis_StatusLinkSpeedChange_GUID  =    {2552180101U,
1909    45555, 4560, {141, 215, 0, 192, 79, 195, 53, 140}};
1910  struct _GUID  const  MSNdis_StatusProtocolBind_GUID  =    {1410552604,
1911    45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}};
1912  struct _GUID  const  MSNdis_StatusProtocolUnbind_GUID  =    {1849483756,
1913    45555, 4560, {215, 141, 0, 192, 79, 195, 53, 140}};
1914  struct _GUID  const  MSKeyboard_PortInformation_GUID  =    {1194457242,
1915    29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}};
1916  struct _GUID  const  MSMouse_PortInformation_GUID  =    {1194457244,
1917    29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}};
1918  struct _GUID  const  MSMouse_ClassInformation_GUID  =    {1194457243,
1919    29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}};
1920  struct _GUID  const  MSKeyboard_ClassInformation_GUID  =    {1194457241,
1921    29131, 4561, {165, 44, 0, 160, 201, 6, 41, 16}};
1922  struct _GUID  const  MSAcpi_ThermalZoneTemperature_GUID  =    {2713458880U,
1923    42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}};
1924  struct _GUID  const  MSDiskDriver_Geometry_GUID  =    {620789585,
1925    22466, 4561, {165, 40, 0, 160, 201, 6, 41, 16}};
1926  struct _GUID  const  MSDiskDriver_PerformanceData_GUID  =    {3185075666U,
1927    55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}};
1928  struct _GUID  const  MSDiskDriver_Performance_GUID  =    {3185075665U,
1929    55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}};
1930  struct _GUID  const  MSStorageDriver_FailurePredictStatus_GUID  =    {2028716290,
1931    19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}};
1932  struct _GUID  const  MSStorageDriver_FailurePredictData_GUID  =    {2028716291,
1933    19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}};
1934  struct _GUID  const  MSStorageDriver_FailurePredictEvent_GUID  =    {2028716292,
1935    19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}};
1936  struct _GUID  const  MSStorageDriver_FailurePredictFunction_GUID  =    {2028716293,
1937    19705, 4562, {186, 74, 0, 160, 201, 6, 41, 16}};
1938  struct _GUID  const  MSIde_PortDeviceInfo_GUID  =    {1408590607,
1939    46783, 4560, {148, 242, 0, 160, 201, 30, 251, 139}};
1940  struct _GUID  const  MSSerial_PortName_GUID  =    {2699825576U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}};
1941  struct _GUID  const  MSSerial_CommInfo_GUID  =    {3987827298U, 45420, 4561, {189, 152, 0, 160, 201, 6, 190, 45}};
1942  struct _GUID  const  MSSerial_HardwareConfiguration_GUID  =    {655072134,
1943    45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}};
1944  struct _GUID  const  MSSerial_PerformanceInformation_GUID  =    {1447123660,
1945    45421, 4561, {189, 152, 0, 160, 201, 6, 190, 45}};
1946  struct _GUID  const  MSSerial_CommProperties_GUID  =    {2181688362U,
1947    11627, 4562, {186, 73, 0, 160, 201, 6, 41, 16}};
1948  struct _GUID  const  MSParallel_AllocFreeCounts_GUID  =    {1270573546,
1949    26707, 4562, {142, 206, 0, 192, 79, 142, 244, 129}};
1950  struct _GUID  const  MSParallel_DeviceBytesTransferred_GUID  =    {2315186902U,
1951    25931, 4562, {158, 21, 0, 192, 79, 142, 244, 129}};
1952  struct _GUID  const  MSRedbook_DriverInformationGuid  =    {3104133351U,
1953    44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}};
1954  struct _GUID  const  MSRedbook_PerformanceGuid  =    {3104133352U,
1955    44554, 4561, {165, 113, 0, 192, 79, 163, 71, 48}};
1956  struct _GUID  const  RegisteredGuids_GUID  =    {3823105981U, 14613, 4562, {145, 3, 0, 192, 79, 185, 152, 162}};
1957  struct _GUID  const  DiskPerfGuid  =    {3185075665U, 55233, 4560, {165, 1, 0, 160, 201, 6, 41, 16}};
1958  struct _GUID  const  THERMAL_ZONE_GUID  =    {2713458880U, 42952, 4561, {191, 60, 0, 160, 201, 6, 41, 16}};
1959  struct _GUID  const  GlobalLoggerGuid  =    {3901786812U, 43652, 4562, {154, 147, 0, 128, 95, 133, 215, 198}};
1960  struct _GUID  const  GenericMessageGuid  =    {2369794079U, 43850, 4562, {154, 147, 0, 128, 95, 133, 215, 198}};
1961  struct _GUID  const  ProcessGuid  =    {1030727888, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}};
1962  struct _GUID  const  ThreadGuid  =    {1030727889, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}};
1963  struct _GUID  const  HardFaultGuid  =    {1030727890, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}};
1964  struct _GUID  const  PageFaultGuid  =    {1030727891, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}};
1965  struct _GUID  const  DiskIoGuid  =    {1030727892, 65029, 4560, {157, 218, 0, 192, 79, 215, 186, 124}};
1966  struct _GUID  const  FileIoGuid  =    {2429279289U, 19006, 4561, {132, 244, 0, 0, 248, 4, 100, 227}};
1967  struct _GUID  const  TcpIpGuid  =    {2586315456U, 51424, 4561, {132, 226, 0, 192, 79, 185, 152, 162}};
1968  struct _GUID  const  UdpIpGuid  =    {3208270021U, 43465, 18824, {160, 5, 45, 240, 183, 200, 15, 128}};
1969  struct _GUID  const  ImageLoadGuid  =    {749821213, 24513, 4562, {171, 225, 0, 160, 201, 17, 245, 24}};
1970  struct _GUID  const  RegistryGuid  =    {2924704302U, 51299, 4562, {134, 89, 0, 192, 79, 163, 33, 161}};
1971  struct _GUID  const  TraceErrorGuid  =    {964792796, 11687, 4563, {139, 152, 0, 128, 95, 133, 215, 198}};
1972#pragma once
1973extern NTSTATUS WmiCompleteRequest(PDEVICE_OBJECT DeviceObject , PIRP Irp , NTSTATUS Status ,
1974                                   ULONG BufferUsed , CCHAR PriorityBoost ) ;
1975NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject ,
1976                          PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) ;
1977int __BLAST_NONDET  ;
1978void errorFn(void) 
1979{ 
1980
1981  {
1982  ERROR: 
1983  goto ERROR;
1984}
1985}
1986int s  ;
1987int UNLOADED  ;
1988int NP  ;
1989int DC  ;
1990int SKIP1  ;
1991int SKIP2  ;
1992int MPR1  ;
1993int MPR3  ;
1994int IPC  ;
1995int pended  ;
1996NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context )  ;
1997int compRegistered  ;
1998int lowerDriverReturn  ;
1999int setEventCalled  ;
2000int customIrp  ;
2001int myStatus  ;
2002int routine  ;
2003void _BLAST_init(void) 
2004{ 
2005
2006  {
2007  UNLOADED = 0;
2008  NP = 1;
2009  DC = 2;
2010  SKIP1 = 3;
2011  SKIP2 = 4;
2012  MPR1 = 5;
2013  MPR3 = 6;
2014  IPC = 7;
2015  s = UNLOADED;
2016  pended = 0;
2017  compFptr = 0;
2018  compRegistered = 0;
2019  lowerDriverReturn = 0;
2020  setEventCalled = 0;
2021  customIrp = 0;
2022  return;
2023}
2024}
2025UNICODE_STRING DiskPerfRegistryPath  ;
2026NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ;
2027NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2028NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) ;
2029NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2030NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2031NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2032NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2033NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2034NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2035NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2036NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
2037NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2038NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2039void DiskPerfUnload(PDRIVER_OBJECT DriverObject ) ;
2040NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2041void DiskPerfLogError(PDEVICE_OBJECT DeviceObject , ULONG UniqueId , NTSTATUS ErrorCode ,
2042                      NTSTATUS Status ) ;
2043NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject ) ;
2044NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
2045NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject , ULONG *RegFlags , PUNICODE_STRING InstanceName ,
2046                                 PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName ,
2047                                 PDEVICE_OBJECT *Pdo ) ;
2048NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
2049                                   ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray ,
2050                                   ULONG BufferAvail , PUCHAR Buffer ) ;
2051void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice , PDEVICE_OBJECT TargetDevice ) ;
2052NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
2053                                    WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) ;
2054void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters , PDISK_PERFORMANCE NewCounters ,
2055                         LARGE_INTEGER Frequency ) ;
2056#pragma alloc_text(INIT,DriverEntry)
2057#pragma alloc_text(PAGE,DiskPerfAddDevice)
2058#pragma alloc_text(PAGE,DiskPerfDispatchPnp)
2059#pragma alloc_text(PAGE,DiskPerfStartDevice)
2060#pragma alloc_text(PAGE,DiskPerfRemoveDevice)
2061#pragma alloc_text(PAGE,DiskPerfUnload)
2062#pragma alloc_text(PAGE,DiskPerfWmi)
2063#pragma alloc_text(PAGE,DiskperfQueryWmiRegInfo)
2064#pragma alloc_text(PAGE,DiskPerfRegisterDevice)
2065#pragma alloc_text(PAGE,DiskPerfSyncFilterWithTarget)
2066WMIGUIDREGINFO DiskperfGuidList[1]  = {      {& DiskPerfGuid, 1, 0}};
2067NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) 
2068{ PDRIVER_DISPATCH *dispatch ;
2069  PVOID tmp ;
2070
2071  {
2072  {
2073  DiskPerfRegistryPath.MaximumLength = (unsigned int )RegistryPath->Length + sizeof((unsigned short)0);
2074  tmp = ExAllocatePoolWithTag(1, DiskPerfRegistryPath.MaximumLength, 1718767684UL);
2075  DiskPerfRegistryPath.Buffer = tmp;
2076  }
2077  if ((unsigned int )DiskPerfRegistryPath.Buffer != (unsigned int )((void *)0)) {
2078    {
2079/*     RtlCopyUnicodeString(& DiskPerfRegistryPath, RegistryPath); */ /* INLINED */
2080    }
2081  } else {
2082    DiskPerfRegistryPath.Length = 0;
2083    DiskPerfRegistryPath.MaximumLength = 0;
2084  }
2085  *dispatch = & DiskPerfSendToNextDriver;
2086  DriverObject->MajorFunction[0] = & DiskPerfCreate;
2087  DriverObject->MajorFunction[3] = & DiskPerfReadWrite;
2088  DriverObject->MajorFunction[4] = & DiskPerfReadWrite;
2089  DriverObject->MajorFunction[14] = & DiskPerfDeviceControl;
2090  DriverObject->MajorFunction[23] = & DiskPerfWmi;
2091  DriverObject->MajorFunction[16] = & DiskPerfShutdownFlush;
2092  DriverObject->MajorFunction[9] = & DiskPerfShutdownFlush;
2093  DriverObject->MajorFunction[27] = & DiskPerfDispatchPnp;
2094  DriverObject->MajorFunction[22] = & DiskPerfDispatchPower;
2095  (DriverObject->DriverExtension)->AddDevice = & DiskPerfAddDevice;
2096  DriverObject->DriverUnload = & DiskPerfUnload;
2097  return (0L);
2098}
2099}
2100void DiskPerfSyncFilterWithTarget(PDEVICE_OBJECT FilterDevice , PDEVICE_OBJECT TargetDevice ) 
2101{ ULONG propFlags ;
2102
2103  {
2104  propFlags = 0;
2105  FilterDevice->Flags |= propFlags;
2106  propFlags = TargetDevice->Characteristics & 7UL;
2107  FilterDevice->Characteristics |= propFlags;
2108  return;
2109}
2110}
2111NTSTATUS DiskPerfAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) 
2112{ NTSTATUS status ;
2113  PDEVICE_OBJECT filterDeviceObject ;
2114  PDEVICE_EXTENSION deviceExtension ;
2115  ULONG registrationFlag ;
2116  PWMILIB_CONTEXT wmilibContext ;
2117  PCHAR buffer ;
2118  ULONG buffersize ;
2119  PVOID tmp ;
2120
2121  {
2122  {
2123  registrationFlag = 0;
2124  status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION ), (void *)0, 7, 0,
2125                          0, & filterDeviceObject);
2126  }
2127  if (! (status >= 0L)) {
2128    return (status);
2129  } else {
2130
2131  }
2132  {
2133  filterDeviceObject->Flags |= 16UL;
2134  deviceExtension = (struct _DEVICE_EXTENSION *)filterDeviceObject->DeviceExtension;
2135  memset(deviceExtension, 0, sizeof(DEVICE_EXTENSION ));
2136  deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0);
2137  deviceExtension->Processors = (unsigned long )*KeNumberProcessors;
2138  buffersize = (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)) * deviceExtension->Processors;
2139  tmp = ExAllocatePoolWithTag(0, buffersize, 1718767684UL);
2140  buffer = (CHAR *)tmp;
2141  }
2142  if ((unsigned int )buffer != (unsigned int )((void *)0)) {
2143    {
2144    memset(buffer, 0, buffersize);
2145    deviceExtension->DiskCounters = (struct _DISK_PERFORMANCE *)buffer;
2146    }
2147  } else {
2148    {
2149    DiskPerfLogError(filterDeviceObject, 513, 0L, -1073479678L);
2150    }
2151  }
2152  {
2153  deviceExtension->PhysicalDeviceObject = PhysicalDeviceObject;
2154  deviceExtension->TargetDeviceObject = IoAttachDeviceToDeviceStack(filterDeviceObject,
2155                                                                    PhysicalDeviceObject);
2156  }
2157  if ((unsigned int )deviceExtension->TargetDeviceObject == (unsigned int )((void *)0)) {
2158    {
2159/*     IoDeleteDevice(filterDeviceObject); */ /* INLINED */
2160    }
2161    return (-1073741810L);
2162  } else {
2163
2164  }
2165  {
2166  deviceExtension->DeviceObject = filterDeviceObject;
2167  deviceExtension->PhysicalDeviceName.Buffer = deviceExtension->PhysicalDeviceNameBuffer;
2168/*   KeInitializeEvent(& deviceExtension->PagingPathCountEvent, 0, 1); */ /* INLINED */
2169  wmilibContext = & deviceExtension->WmilibContext;
2170  memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT ));
2171  wmilibContext->GuidCount = sizeof(DiskperfGuidList) / sizeof(WMIGUIDREGINFO );
2172  wmilibContext->GuidList = DiskperfGuidList;
2173  wmilibContext->QueryWmiRegInfo = & DiskperfQueryWmiRegInfo;
2174  wmilibContext->QueryWmiDataBlock = & DiskperfQueryWmiDataBlock;
2175  wmilibContext->WmiFunctionControl = & DiskperfWmiFunctionControl;
2176  filterDeviceObject->Flags |= 8192UL;
2177  filterDeviceObject->Flags &= 4294967167UL;
2178  }
2179  return (0L);
2180}
2181}
2182NTSTATUS DiskPerfDispatchPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2183{ PIO_STACK_LOCATION irpSp ;
2184  NTSTATUS status ;
2185  NTSTATUS tmp ;
2186
2187  {
2188  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2189  if (irpSp->MinorFunction == 0) {
2190    goto switch_0_0;
2191  } else {
2192    if (irpSp->MinorFunction == 2) {
2193      goto switch_0_2;
2194    } else {
2195      {
2196      goto switch_0_default;
2197      if (0) {
2198        switch_0_0: /* CIL Label */ 
2199        {
2200        status = DiskPerfStartDevice(DeviceObject, Irp);
2201        }
2202        goto switch_0_break;
2203        switch_0_2: /* CIL Label */ 
2204        {
2205        status = DiskPerfRemoveDevice(DeviceObject, Irp);
2206        }
2207        goto switch_0_break;
2208        switch_0_default: /* CIL Label */ 
2209        {
2210        tmp = DiskPerfSendToNextDriver(DeviceObject, Irp);
2211        }
2212        return (tmp);
2213      } else {
2214        switch_0_break: /* CIL Label */ ;
2215      }
2216      }
2217    }
2218  }
2219  return (status);
2220}
2221}
2222NTSTATUS DiskPerfIrpCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) 
2223{ PKEVENT Event ;
2224
2225  {
2226  {
2227  Event = (struct _KEVENT *)Context;
2228  KeSetEvent(Event, 0, 0);
2229  }
2230  return (-1073741802L);
2231}
2232}
2233NTSTATUS DiskPerfStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2234{ PDEVICE_EXTENSION deviceExtension ;
2235  NTSTATUS status ;
2236
2237  {
2238  {
2239  deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2240  status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp);
2241  DiskPerfSyncFilterWithTarget(DeviceObject, deviceExtension->TargetDeviceObject);
2242  DiskPerfRegisterDevice(DeviceObject);
2243  Irp->IoStatus.__annonCompField4.Status = status;
2244  myStatus = status;
2245  IofCompleteRequest(Irp, 0);
2246  }
2247  return (status);
2248}
2249}
2250NTSTATUS DiskPerfRemoveDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2251{ NTSTATUS status ;
2252  PDEVICE_EXTENSION deviceExtension ;
2253  PWMILIB_CONTEXT wmilibContext ;
2254
2255  {
2256  {
2257  deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2258  IoWMIRegistrationControl(DeviceObject, 2);
2259  wmilibContext = & deviceExtension->WmilibContext;
2260  InterlockedExchange((LONG *)(& wmilibContext->GuidCount), 0L);
2261  memset(wmilibContext, 0, sizeof(WMILIB_CONTEXT ));
2262  status = DiskPerfForwardIrpSynchronous(DeviceObject, Irp);
2263/*   IoDetachDevice(deviceExtension->TargetDeviceObject); */ /* INLINED */
2264/*   IoDeleteDevice(DeviceObject); */ /* INLINED */
2265  Irp->IoStatus.__annonCompField4.Status = status;
2266  myStatus = status;
2267  IofCompleteRequest(Irp, 0);
2268  }
2269  return (status);
2270}
2271}
2272NTSTATUS DiskPerfSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2273{ PDEVICE_EXTENSION deviceExtension ;
2274  NTSTATUS tmp ;
2275
2276  {
2277  if (s == NP) {
2278    s = SKIP1;
2279  } else {
2280    {
2281    errorFn();
2282    }
2283  }
2284  {
2285  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2286  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2287  deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2288  tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
2289  }
2290  return (tmp);
2291}
2292}
2293NTSTATUS DiskPerfDispatchPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2294{ PDEVICE_EXTENSION deviceExtension ;
2295  NTSTATUS tmp ;
2296
2297  {
2298  {
2299/*   PoStartNextPowerIrp(Irp); */ /* INLINED */
2300  }
2301  if (s == NP) {
2302    s = SKIP1;
2303  } else {
2304    {
2305    errorFn();
2306    }
2307  }
2308  {
2309  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2310  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2311  deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2312  tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp);
2313  }
2314  return (tmp);
2315}
2316}
2317NTSTATUS DiskPerfForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2318{ PDEVICE_EXTENSION deviceExtension ;
2319  KEVENT event ;
2320  NTSTATUS status ;
2321  PIO_STACK_LOCATION irpSp ;
2322  PIO_STACK_LOCATION nextIrpSp ;
2323  PIO_STACK_LOCATION irpSp___0 ;
2324
2325  {
2326  {
2327/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2328  deviceExtension = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2329  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2330  nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
2331  memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine));
2332  nextIrpSp->Control = 0;
2333  }
2334  if (s != NP) {
2335    {
2336    errorFn();
2337    }
2338  } else {
2339    if (compRegistered != 0) {
2340      {
2341      errorFn();
2342      }
2343    } else {
2344      compRegistered = 1;
2345      compFptr = & DiskPerfIrpCompletion;
2346      routine = 0;
2347    }
2348  }
2349  {
2350  irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
2351  irpSp___0->CompletionRoutine = & DiskPerfIrpCompletion;
2352  irpSp___0->Context = & event;
2353  irpSp___0->Control = 0;
2354  irpSp___0->Control = 64;
2355  irpSp___0->Control = (int )irpSp___0->Control | 128;
2356  irpSp___0->Control = (int )irpSp___0->Control | 32;
2357  status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
2358  }
2359  if (status == 259L) {
2360    {
2361    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2362    status = myStatus;
2363    }
2364  } else {
2365
2366  }
2367  return (status);
2368}
2369}
2370NTSTATUS DiskPerfCreate(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2371{ 
2372
2373  {
2374  {
2375  Irp->IoStatus.__annonCompField4.Status = 0L;
2376  myStatus = 0L;
2377  IofCompleteRequest(Irp, 0);
2378  }
2379  return (0L);
2380}
2381}
2382NTSTATUS DiskPerfReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2383{ PDEVICE_EXTENSION deviceExtension ;
2384  PIO_STACK_LOCATION currentIrpStack ;
2385  PIO_STACK_LOCATION nextIrpStack ;
2386  ULONG processor ;
2387  ULONG tmp ;
2388  PDISK_PERFORMANCE partitionCounters ;
2389  LONG queueLen ;
2390  PLARGE_INTEGER timeStamp ;
2391  NTSTATUS tmp___0 ;
2392  PIO_STACK_LOCATION irpSp ;
2393  NTSTATUS tmp___1 ;
2394
2395  {
2396  {
2397  deviceExtension = DeviceObject->DeviceExtension;
2398  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2399  nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
2400  tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */
2401  processor = tmp;
2402  partitionCounters = (void *)0;
2403  }
2404  if ((unsigned int )deviceExtension->DiskCounters != (unsigned int )((void *)0)) {
2405    partitionCounters = (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + processor * (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)));
2406  } else {
2407
2408  }
2409  if (deviceExtension->CountersEnabled <= 0L) {
2410    {
2411    tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp);
2412    }
2413    return (tmp___0);
2414  } else {
2415    if ((int )deviceExtension->PhysicalDeviceNameBuffer[0] == 0) {
2416      {
2417      tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp);
2418      }
2419      return (tmp___0);
2420    } else {
2421      if ((unsigned int )partitionCounters == (unsigned int )((void *)0)) {
2422        {
2423        tmp___0 = DiskPerfSendToNextDriver(DeviceObject, Irp);
2424        }
2425        return (tmp___0);
2426      } else {
2427
2428      }
2429    }
2430  }
2431  {
2432  queueLen = InterlockedIncrement(& deviceExtension->QueueDepth);
2433  *nextIrpStack = *currentIrpStack;
2434  timeStamp = (LARGE_INTEGER *)(& currentIrpStack->Parameters.Read);
2435  *timeStamp = KeQueryPerformanceCounter((void *)0);
2436  }
2437  if (queueLen == 1L) {
2438    partitionCounters->IdleTime.QuadPart += timeStamp->QuadPart - deviceExtension->LastIdleClock.QuadPart;
2439    deviceExtension->LastIdleClock.QuadPart = timeStamp->QuadPart;
2440  } else {
2441
2442  }
2443  if (s != NP) {
2444    {
2445    errorFn();
2446    }
2447  } else {
2448    if (compRegistered != 0) {
2449      {
2450      errorFn();
2451      }
2452    } else {
2453      compRegistered = 1;
2454      compFptr = & DiskPerfIoCompletion;
2455      routine = 1;
2456    }
2457  }
2458  {
2459  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
2460  irpSp->CompletionRoutine = & DiskPerfIoCompletion;
2461  irpSp->Context = DeviceObject;
2462  irpSp->Control = 0;
2463  irpSp->Control = 64;
2464  irpSp->Control = (int )irpSp->Control | 128;
2465  irpSp->Control = (int )irpSp->Control | 32;
2466  tmp___1 = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
2467  }
2468  return (tmp___1);
2469}
2470}
2471NTSTATUS DiskPerfIoCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) 
2472{ PDEVICE_EXTENSION deviceExtension ;
2473  PIO_STACK_LOCATION irpStack ;
2474  PDISK_PERFORMANCE partitionCounters ;
2475  LARGE_INTEGER timeStampComplete ;
2476  PLARGE_INTEGER difference ;
2477  LONG queueLen ;
2478  ULONG tmp ;
2479
2480  {
2481  {
2482  deviceExtension = DeviceObject->DeviceExtension;
2483  irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2484  tmp = 0UL; /* KeGetCurrentProcessorNumber(); */ /* INLINED */
2485  partitionCounters = (struct _DISK_PERFORMANCE *)((CHAR *)deviceExtension->DiskCounters + tmp * (unsigned long )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)));
2486  }
2487  if ((unsigned int )partitionCounters == (unsigned int )((void *)0)) {
2488    return (0L);
2489  } else {
2490
2491  }
2492  {
2493  difference = (LARGE_INTEGER *)(& irpStack->Parameters.Read);
2494  timeStampComplete = KeQueryPerformanceCounter((void *)0);
2495  difference->QuadPart = timeStampComplete.QuadPart - difference->QuadPart;
2496  queueLen = InterlockedDecrement(& deviceExtension->QueueDepth);
2497  }
2498  if (queueLen < 0L) {
2499    {
2500    queueLen = InterlockedIncrement(& deviceExtension->QueueDepth);
2501    }
2502  } else {
2503
2504  }
2505  if (queueLen == 0L) {
2506    deviceExtension->LastIdleClock = timeStampComplete;
2507  } else {
2508
2509  }
2510  if ((int )irpStack->MajorFunction == 3) {
2511    partitionCounters->BytesRead.QuadPart += (LONGLONG )Irp->IoStatus.Information;
2512    partitionCounters->ReadCount += 1UL;
2513    partitionCounters->ReadTime.QuadPart += difference->QuadPart;
2514  } else {
2515    partitionCounters->BytesWritten.QuadPart += (LONGLONG )Irp->IoStatus.Information;
2516    partitionCounters->WriteCount += 1UL;
2517    partitionCounters->WriteTime.QuadPart += difference->QuadPart;
2518  }
2519  if (Irp->Flags & 8UL) {
2520    partitionCounters->SplitCount += 1UL;
2521  } else {
2522
2523  }
2524  if (Irp->PendingReturned) {
2525    if (pended == 0) {
2526      pended = 1;
2527    } else {
2528      {
2529      errorFn();
2530      }
2531    }
2532    (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1;
2533  } else {
2534
2535  }
2536  return (0L);
2537}
2538}
2539NTSTATUS DiskPerfDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2540{ PDEVICE_EXTENSION deviceExtension ;
2541  PIO_STACK_LOCATION currentIrpStack ;
2542  NTSTATUS status ;
2543  ULONG i ;
2544  PDISK_PERFORMANCE totalCounters ;
2545  PDISK_PERFORMANCE diskCounters ;
2546  LARGE_INTEGER frequency ;
2547  LARGE_INTEGER perfctr ;
2548  LARGE_INTEGER difference ;
2549  NTSTATUS tmp ;
2550
2551  {
2552  deviceExtension = DeviceObject->DeviceExtension;
2553  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2554  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )((7 << 16) | (8 << 2))) {
2555    if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(DISK_PERFORMANCE )) {
2556      status = -1073741789L;
2557      Irp->IoStatus.Information = 0;
2558    } else {
2559      diskCounters = deviceExtension->DiskCounters;
2560      if ((unsigned int )diskCounters == (unsigned int )((void *)0)) {
2561        {
2562        Irp->IoStatus.__annonCompField4.Status = -1073741823L;
2563        myStatus = -1073741823L;
2564        IofCompleteRequest(Irp, 0);
2565        }
2566        return (-1073741823L);
2567      } else {
2568
2569      }
2570      {
2571      totalCounters = (struct _DISK_PERFORMANCE *)Irp->AssociatedIrp.SystemBuffer;
2572      memset(totalCounters, 0, sizeof(DISK_PERFORMANCE ));
2573      perfctr = KeQueryPerformanceCounter(& frequency);
2574      KeQuerySystemTime(& totalCounters->QueryTime);
2575      i = 0;
2576      }
2577      {
2578      while (1) {
2579        while_1_continue: /* CIL Label */ ;
2580        if (i < deviceExtension->Processors) {
2581
2582        } else {
2583          goto while_1_break;
2584        }
2585        {
2586        DiskPerfAddCounters(totalCounters, diskCounters, frequency);
2587        diskCounters = (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + (long )(& ((DISK_PERFORMANCE *)0)->QueryTime));
2588        i += 1UL;
2589        }
2590      }
2591      while_1_break: /* CIL Label */ ;
2592      }
2593      totalCounters->QueueDepth = deviceExtension->QueueDepth;
2594      if (totalCounters->QueueDepth == 0UL) {
2595        difference.QuadPart = perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart;
2596        if (difference.QuadPart > 0LL) {
2597          totalCounters->IdleTime.QuadPart += (10000000LL * difference.QuadPart) / frequency.QuadPart;
2598        } else {
2599
2600        }
2601      } else {
2602
2603      }
2604      {
2605      totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber;
2606      memcpy(& totalCounters->StorageManagerName[0], & deviceExtension->StorageManagerName[0],
2607             8U * sizeof(WCHAR ));
2608      status = 0L;
2609      Irp->IoStatus.Information = sizeof(DISK_PERFORMANCE );
2610      }
2611    }
2612    {
2613    Irp->IoStatus.__annonCompField4.Status = status;
2614    myStatus = status;
2615    IofCompleteRequest(Irp, 0);
2616    }
2617    return (status);
2618  } else {
2619    {
2620    Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2621    Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2622    tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
2623    }
2624    return (tmp);
2625  }
2626}
2627}
2628NTSTATUS DiskPerfWmi(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2629{ PIO_STACK_LOCATION irpSp ;
2630  NTSTATUS status ;
2631  PWMILIB_CONTEXT wmilibContext ;
2632  SYSCTL_IRP_DISPOSITION disposition ;
2633  PDEVICE_EXTENSION deviceExtension ;
2634  NTSTATUS tmp ;
2635
2636  {
2637  deviceExtension = DeviceObject->DeviceExtension;
2638  wmilibContext = & deviceExtension->WmilibContext;
2639  if (wmilibContext->GuidCount == 0UL) {
2640    {
2641    tmp = DiskPerfSendToNextDriver(DeviceObject, Irp);
2642    }
2643    return (tmp);
2644  } else {
2645
2646  }
2647  {
2648  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2649  status = 0L; /* WmiSystemControl(wmilibContext, DeviceObject, Irp, & disposition); */ /* INLINED */
2650  }
2651  if (disposition == 0) {
2652    goto switch_2_0;
2653  } else {
2654    if (disposition == 1) {
2655      goto switch_2_1;
2656    } else {
2657      {
2658      goto switch_2_default;
2659      if (0) {
2660        switch_2_0: /* CIL Label */ ;
2661        goto switch_2_break;
2662        switch_2_1: /* CIL Label */ 
2663        {
2664        IofCompleteRequest(Irp, 0);
2665        }
2666        goto switch_2_break;
2667        switch_2_default: /* CIL Label */ 
2668        {
2669        status = DiskPerfSendToNextDriver(DeviceObject, Irp);
2670        }
2671        goto switch_2_break;
2672      } else {
2673        switch_2_break: /* CIL Label */ ;
2674      }
2675      }
2676    }
2677  }
2678  return (status);
2679}
2680}
2681NTSTATUS DiskPerfShutdownFlush(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2682{ PDEVICE_EXTENSION deviceExtension ;
2683  NTSTATUS tmp ;
2684
2685  {
2686  {
2687  deviceExtension = DeviceObject->DeviceExtension;
2688  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2689  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2690  tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
2691  }
2692  return (tmp);
2693}
2694}
2695void DiskPerfUnload(PDRIVER_OBJECT DriverObject ) 
2696{ 
2697
2698  {
2699  return;
2700}
2701}
2702NTSTATUS DiskPerfRegisterDevice(PDEVICE_OBJECT DeviceObject ) 
2703{ NTSTATUS status ;
2704  IO_STATUS_BLOCK ioStatus ;
2705  KEVENT event ;
2706  PDEVICE_EXTENSION deviceExtension ;
2707  PIRP irp ;
2708  STORAGE_DEVICE_NUMBER number ;
2709  ULONG registrationFlag ;
2710  ULONG outputSize ;
2711  PMOUNTDEV_NAME output ;
2712  VOLUME_NUMBER volumeNumber ;
2713  PVOID tmp ;
2714  PVOID tmp___0 ;
2715
2716  {
2717  {
2718  registrationFlag = 0;
2719  deviceExtension = DeviceObject->DeviceExtension;
2720/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2721  irp = IoBuildDeviceIoControlRequest((45 << 16) | (1056 << 2), deviceExtension->TargetDeviceObject,
2722                                      (void *)0, 0, & number, sizeof(number), 0, & event,
2723                                      & ioStatus);
2724  }
2725  if (! irp) {
2726    {
2727    DiskPerfLogError(DeviceObject, 256, 0L, -1073479678L);
2728    }
2729    return (-1073741670L);
2730  } else {
2731
2732  }
2733  {
2734  status = IofCallDriver(deviceExtension->TargetDeviceObject, irp);
2735  }
2736  if (status == 259L) {
2737    {
2738    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2739    status = ioStatus.__annonCompField4.Status;
2740    }
2741  } else {
2742
2743  }
2744  if (status >= 0L) {
2745    {
2746    deviceExtension->DiskNumber = number.DeviceNumber;
2747    swprintf(deviceExtension->PhysicalDeviceNameBuffer, "\\\000D\000e\000v\000i\000c\000e\000\\\000H\000a\000r\000d\000d\000i\000s\000k\000%\000d\000\\\000P\000a\000r\000t\000i\000t\000i\000o\000n\000%\000d\000",
2748             number.DeviceNumber, number.PartitionNumber);
2749/*     RtlInitUnicodeString(& deviceExtension->PhysicalDeviceName, & deviceExtension->PhysicalDeviceNameBuffer[0]); */ /* INLINED */
2750    memcpy(& deviceExtension->StorageManagerName[0], "P\000h\000y\000s\000D\000i\000s\000k\000",
2751           8U * sizeof(WCHAR ));
2752    }
2753  } else {
2754    {
2755    outputSize = sizeof(MOUNTDEV_NAME );
2756    tmp = ExAllocatePoolWithTag(1, outputSize, 1718767684UL);
2757    output = tmp;
2758    }
2759    if (! output) {
2760      {
2761      DiskPerfLogError(DeviceObject, 257, 0L, -1073479678L);
2762      }
2763      return (-1073741670L);
2764    } else {
2765
2766    }
2767    {
2768/*     KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2769    irp = IoBuildDeviceIoControlRequest((77UL << 16) | (unsigned long )(2 << 2), deviceExtension->TargetDeviceObject,
2770                                        (void *)0, 0, output, outputSize, 0, & event,
2771                                        & ioStatus);
2772    }
2773    if (! irp) {
2774      {
2775/*       ExFreePool(output); */ /* INLINED */
2776      DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L);
2777      }
2778      return (-1073741670L);
2779    } else {
2780
2781    }
2782    {
2783    status = IofCallDriver(deviceExtension->TargetDeviceObject, irp);
2784    }
2785    if (status == 259L) {
2786      {
2787      KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2788      status = ioStatus.__annonCompField4.Status;
2789      }
2790    } else {
2791
2792    }
2793    if (status == -2147483643L) {
2794      {
2795      outputSize = sizeof(MOUNTDEV_NAME ) + (unsigned int )output->NameLength;
2796/*       ExFreePool(output); */ /* INLINED */
2797      tmp___0 = ExAllocatePoolWithTag(1, outputSize, 1718767684UL);
2798      output = tmp___0;
2799      }
2800      if (! output) {
2801        {
2802        DiskPerfLogError(DeviceObject, 258, 0L, -1073479678L);
2803        }
2804        return (-1073741670L);
2805      } else {
2806
2807      }
2808      {
2809/*       KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2810      irp = IoBuildDeviceIoControlRequest((77UL << 16) | (unsigned long )(2 << 2),
2811                                          deviceExtension->TargetDeviceObject, (void *)0,
2812                                          0, output, outputSize, 0, & event, & ioStatus);
2813      }
2814      if (! irp) {
2815        {
2816/*         ExFreePool(output); */ /* INLINED */
2817        DiskPerfLogError(DeviceObject, 259, 0L, -1073479678L);
2818        }
2819        return (-1073741670L);
2820      } else {
2821
2822      }
2823      {
2824      status = IofCallDriver(deviceExtension->TargetDeviceObject, irp);
2825      }
2826      if (status == 259L) {
2827        {
2828        KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2829        status = ioStatus.__annonCompField4.Status;
2830        }
2831      } else {
2832
2833      }
2834    } else {
2835
2836    }
2837    if (! (status >= 0L)) {
2838      {
2839/*       ExFreePool(output); */ /* INLINED */
2840      DiskPerfLogError(DeviceObject, 260, 0L, -1073479677L);
2841      }
2842      return (status);
2843    } else {
2844
2845    }
2846    {
2847    deviceExtension->DiskNumber = -1;
2848    deviceExtension->PhysicalDeviceName.Length = output->NameLength;
2849    deviceExtension->PhysicalDeviceName.MaximumLength = (unsigned int )output->NameLength + sizeof(WCHAR );
2850    memcpy(deviceExtension->PhysicalDeviceName.Buffer, output->Name, output->NameLength);
2851    *(deviceExtension->PhysicalDeviceName.Buffer + (unsigned int )deviceExtension->PhysicalDeviceName.Length / sizeof(WCHAR )) = 0;
2852/*     ExFreePool(output); */ /* INLINED */
2853    outputSize = sizeof(VOLUME_NUMBER );
2854    memset(& volumeNumber, 0, sizeof(VOLUME_NUMBER ));
2855/*     KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2856    irp = IoBuildDeviceIoControlRequest((86UL << 16) | (unsigned long )(7 << 2), deviceExtension->TargetDeviceObject,
2857                                        (void *)0, 0, & volumeNumber, sizeof(VOLUME_NUMBER ),
2858                                        0, & event, & ioStatus);
2859    }
2860    if (! irp) {
2861      {
2862      DiskPerfLogError(DeviceObject, 265, 0L, -1073479678L);
2863      }
2864      return (-1073741670L);
2865    } else {
2866
2867    }
2868    {
2869    status = IofCallDriver(deviceExtension->TargetDeviceObject, irp);
2870    }
2871    if (status == 259L) {
2872      {
2873      KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2874      status = ioStatus.__annonCompField4.Status;
2875      }
2876    } else {
2877
2878    }
2879    if (! (status >= 0L)) {
2880      goto _L;
2881    } else {
2882      if ((int )volumeNumber.VolumeManagerName[0] == 0) {
2883        _L: /* CIL Label */ 
2884        {
2885        memcpy(& deviceExtension->StorageManagerName[0], "L\000o\000g\000i\000D\000i\000s\000k\000",
2886               8U * sizeof(WCHAR ));
2887        }
2888        if (status >= 0L) {
2889          deviceExtension->DiskNumber = volumeNumber.VolumeNumber;
2890        } else {
2891
2892        }
2893      } else {
2894        {
2895        memcpy(& deviceExtension->StorageManagerName[0], & volumeNumber.VolumeManagerName[0],
2896               8U * sizeof(WCHAR ));
2897        deviceExtension->DiskNumber = volumeNumber.VolumeNumber;
2898        }
2899      }
2900    }
2901  }
2902  {
2903  status = IoWMIRegistrationControl(DeviceObject, 1UL | registrationFlag);
2904  }
2905  if (! (status >= 0L)) {
2906    {
2907    DiskPerfLogError(DeviceObject, 261, 0L, -1073479668L);
2908    }
2909  } else {
2910
2911  }
2912  return (status);
2913}
2914}
2915void DiskPerfLogError(PDEVICE_OBJECT DeviceObject , ULONG UniqueId , NTSTATUS ErrorCode ,
2916                      NTSTATUS Status ) 
2917{ PIO_ERROR_LOG_PACKET errorLogEntry ;
2918  PVOID tmp ;
2919
2920  {
2921  {
2922  tmp = IoAllocateErrorLogEntry(DeviceObject, (unsigned char )(sizeof(IO_ERROR_LOG_PACKET ) + sizeof(DEVICE_OBJECT )));
2923  errorLogEntry = (struct _IO_ERROR_LOG_PACKET *)tmp;
2924  }
2925  if ((unsigned int )errorLogEntry != (unsigned int )((void *)0)) {
2926    {
2927    errorLogEntry->ErrorCode = ErrorCode;
2928    errorLogEntry->UniqueErrorValue = UniqueId;
2929    errorLogEntry->FinalStatus = Status;
2930    memcpy(& errorLogEntry->DumpData[0], & DeviceObject, sizeof(DEVICE_OBJECT ));
2931    errorLogEntry->DumpDataSize = sizeof(DEVICE_OBJECT );
2932    IoWriteErrorLogEntry(errorLogEntry);
2933    }
2934  } else {
2935
2936  }
2937  return;
2938}
2939}
2940NTSTATUS DiskperfQueryWmiRegInfo(PDEVICE_OBJECT DeviceObject , ULONG *RegFlags , PUNICODE_STRING InstanceName ,
2941                                 PUNICODE_STRING *RegistryPath , PUNICODE_STRING MofResourceName ,
2942                                 PDEVICE_OBJECT *Pdo ) 
2943{ USHORT size ;
2944  NTSTATUS status ;
2945  PDEVICE_EXTENSION deviceExtension ;
2946  PVOID tmp ;
2947
2948  {
2949  {
2950  deviceExtension = DeviceObject->DeviceExtension;
2951  size = (unsigned int )deviceExtension->PhysicalDeviceName.Length + sizeof((unsigned short)0);
2952  tmp = ExAllocatePoolWithTag(1, size, 1718767684UL);
2953  InstanceName->Buffer = tmp;
2954  }
2955  if ((unsigned int )InstanceName->Buffer != (unsigned int )((void *)0)) {
2956    *RegistryPath = & DiskPerfRegistryPath;
2957    *RegFlags = 33;
2958    *Pdo = deviceExtension->PhysicalDeviceObject;
2959    status = 0L;
2960  } else {
2961    status = -1073741670L;
2962  }
2963  return (status);
2964}
2965}
2966NTSTATUS DiskperfQueryWmiDataBlock(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
2967                                   ULONG InstanceIndex , ULONG InstanceCount , PULONG InstanceLengthArray ,
2968                                   ULONG BufferAvail , PUCHAR Buffer ) 
2969{ NTSTATUS status ;
2970  PDEVICE_EXTENSION deviceExtension ;
2971  ULONG sizeNeeded ;
2972  PDISK_PERFORMANCE totalCounters ;
2973  PDISK_PERFORMANCE diskCounters ;
2974  PWMI_DISK_PERFORMANCE diskPerformance ;
2975  ULONG deviceNameSize ;
2976  PWCHAR diskNamePtr ;
2977  ULONG i ;
2978  LARGE_INTEGER perfctr ;
2979  LARGE_INTEGER frequency ;
2980  LARGE_INTEGER difference ;
2981  PWCHAR tmp ;
2982
2983  {
2984  deviceExtension = DeviceObject->DeviceExtension;
2985  if (GuidIndex == 0UL) {
2986    deviceNameSize = (unsigned int )deviceExtension->PhysicalDeviceName.Length + sizeof(USHORT );
2987    sizeNeeded = (ULONG )((sizeof(WMI_DISK_PERFORMANCE ) + 1U) & 4294967294U) + deviceNameSize;
2988    diskCounters = deviceExtension->DiskCounters;
2989    if ((unsigned int )diskCounters == (unsigned int )((void *)0)) {
2990      status = -1073741823L;
2991    } else {
2992      if (BufferAvail >= sizeNeeded) {
2993        {
2994        memset(Buffer, 0, sizeof(WMI_DISK_PERFORMANCE ));
2995        diskPerformance = (struct _WMI_DISK_PERFORMANCE *)Buffer;
2996        totalCounters = (struct _DISK_PERFORMANCE *)diskPerformance;
2997        KeQuerySystemTime(& totalCounters->QueryTime);
2998        perfctr = KeQueryPerformanceCounter(& frequency);
2999        i = 0;
3000        }
3001        {
3002        while (1) {
3003          while_3_continue: /* CIL Label */ ;
3004          if (i < deviceExtension->Processors) {
3005
3006          } else {
3007            goto while_3_break;
3008          }
3009          {
3010          DiskPerfAddCounters(totalCounters, diskCounters, frequency);
3011          diskCounters = (struct _DISK_PERFORMANCE *)((CHAR *)diskCounters + (long )(& ((DISK_PERFORMANCE *)0)->QueryTime));
3012          i += 1UL;
3013          }
3014        }
3015        while_3_break: /* CIL Label */ ;
3016        }
3017        totalCounters->QueueDepth = deviceExtension->QueueDepth;
3018        if (totalCounters->QueueDepth == 0UL) {
3019          difference.QuadPart = perfctr.QuadPart - deviceExtension->LastIdleClock.QuadPart;
3020          if (frequency.QuadPart > 0LL) {
3021            totalCounters->IdleTime.QuadPart += (10000000LL * difference.QuadPart) / frequency.QuadPart;
3022          } else {
3023
3024          }
3025        } else {
3026
3027        }
3028        {
3029        totalCounters->StorageDeviceNumber = deviceExtension->DiskNumber;
3030        memcpy(& totalCounters->StorageManagerName[0], & deviceExtension->StorageManagerName[0],
3031               8U * sizeof(WCHAR ));
3032        diskNamePtr = (WCHAR *)(Buffer + ((sizeof(DISK_PERFORMANCE ) + 1U) & 4294967294U));
3033        tmp = diskNamePtr;
3034        diskNamePtr += 1;
3035        *tmp = deviceExtension->PhysicalDeviceName.Length;
3036        memcpy(diskNamePtr, deviceExtension->PhysicalDeviceName.Buffer, deviceExtension->PhysicalDeviceName.Length);
3037        *InstanceLengthArray = sizeNeeded;
3038        status = 0L;
3039        }
3040      } else {
3041        status = -1073741789L;
3042      }
3043    }
3044  } else {
3045    status = -1073741163L;
3046  }
3047  {
3048  status = WmiCompleteRequest(DeviceObject, Irp, status, sizeNeeded, 0);
3049  }
3050  return (status);
3051}
3052}
3053NTSTATUS DiskperfWmiFunctionControl(PDEVICE_OBJECT DeviceObject , PIRP Irp , ULONG GuidIndex ,
3054                                    WMIENABLEDISABLECONTROL Function , BOOLEAN Enable ) 
3055{ NTSTATUS status ;
3056  PDEVICE_EXTENSION deviceExtension ;
3057  LONG tmp ;
3058  LONG tmp___0 ;
3059
3060  {
3061  deviceExtension = DeviceObject->DeviceExtension;
3062  if (GuidIndex == 0UL) {
3063    if ((int )Function == 1) {
3064      if (Enable) {
3065        {
3066        tmp = InterlockedIncrement(& deviceExtension->CountersEnabled);
3067        }
3068        if (tmp == 1L) {
3069          if ((unsigned int )deviceExtension->DiskCounters != (unsigned int )((void *)0)) {
3070            {
3071            memset(deviceExtension->DiskCounters, 0, (ULONG )((long )(& ((DISK_PERFORMANCE *)0)->QueryTime)) * deviceExtension->Processors);
3072            }
3073          } else {
3074
3075          }
3076          {
3077          deviceExtension->LastIdleClock = KeQueryPerformanceCounter((void *)0);
3078          deviceExtension->QueueDepth = 0;
3079          }
3080        } else {
3081
3082        }
3083      } else {
3084        {
3085        tmp___0 = InterlockedDecrement(& deviceExtension->CountersEnabled);
3086        }
3087        if (tmp___0 <= 0L) {
3088          deviceExtension->CountersEnabled = 0;
3089          deviceExtension->QueueDepth = 0;
3090        } else {
3091
3092        }
3093      }
3094    } else {
3095
3096    }
3097    status = 0L;
3098  } else {
3099    status = -1073741163L;
3100  }
3101  {
3102  status = WmiCompleteRequest(DeviceObject, Irp, status, 0, 0);
3103  }
3104  return (status);
3105}
3106}
3107void DiskPerfAddCounters(PDISK_PERFORMANCE TotalCounters , PDISK_PERFORMANCE NewCounters ,
3108                         LARGE_INTEGER Frequency ) 
3109{ 
3110
3111  {
3112  TotalCounters->BytesRead.QuadPart += NewCounters->BytesRead.QuadPart;
3113  TotalCounters->BytesWritten.QuadPart += NewCounters->BytesWritten.QuadPart;
3114  TotalCounters->ReadCount += NewCounters->ReadCount;
3115  TotalCounters->WriteCount += NewCounters->WriteCount;
3116  TotalCounters->SplitCount += NewCounters->SplitCount;
3117  if (Frequency.QuadPart > 0LL) {
3118    TotalCounters->ReadTime.QuadPart += (NewCounters->ReadTime.QuadPart * 10000000LL) / Frequency.QuadPart;
3119    TotalCounters->WriteTime.QuadPart += (NewCounters->WriteTime.QuadPart * 10000000LL) / Frequency.QuadPart;
3120    TotalCounters->IdleTime.QuadPart += (NewCounters->IdleTime.QuadPart * 10000000LL) / Frequency.QuadPart;
3121  } else {
3122    TotalCounters->ReadTime.QuadPart += NewCounters->ReadTime.QuadPart;
3123    TotalCounters->WriteTime.QuadPart += NewCounters->WriteTime.QuadPart;
3124    TotalCounters->IdleTime.QuadPart += NewCounters->IdleTime.QuadPart;
3125  }
3126  return;
3127}
3128}
3129#pragma once
3130#pragma once
3131#pragma once
3132#pragma once
3133#pragma warning(push)
3134#pragma warning(disable:4035)
3135#pragma warning(pop)
3136#pragma once
3137#pragma warning(disable:4103)
3138#pragma warning(disable:4103)
3139#pragma warning(push)
3140#pragma warning(disable:4035)
3141#pragma warning(pop)
3142#pragma warning(disable:4035)
3143#pragma warning(push)
3144#pragma warning(disable:4164)
3145#pragma function(_enable)
3146#pragma function(_disable)
3147#pragma warning(pop)
3148#pragma warning(disable:4103)
3149#pragma warning(disable:4103)
3150#pragma warning(disable:4103)
3151#pragma warning(disable:4103)
3152#pragma warning(disable:4103)
3153#pragma warning(disable:4103)
3154#pragma warning(disable:4200)
3155#pragma warning(default:4200)
3156IRP *pirp  ;
3157void stub_driver_init(void) 
3158{ 
3159
3160  {
3161  s = NP;
3162  customIrp = 0;
3163  setEventCalled = customIrp;
3164  lowerDriverReturn = setEventCalled;
3165  compRegistered = lowerDriverReturn;
3166  compFptr = compRegistered;
3167  pended = compFptr;
3168  return;
3169}
3170}
3171int main(void) 
3172{ DRIVER_OBJECT d ;
3173  NTSTATUS status ;
3174  int we_should_unload ;
3175  IRP irp ;
3176  int __BLAST_NONDET___0 ;
3177  int irp_choice ;
3178  DEVICE_OBJECT devobj ;
3179
3180  {
3181  {
3182  pirp = & irp;
3183  _BLAST_init();
3184  }
3185  if (status >= 0L) {
3186    s = NP;
3187    customIrp = 0;
3188    setEventCalled = customIrp;
3189    lowerDriverReturn = setEventCalled;
3190    compRegistered = lowerDriverReturn;
3191    compFptr = compRegistered;
3192    pended = compFptr;
3193    pirp->IoStatus.__annonCompField4.Status = 0L;
3194    myStatus = 0L;
3195    if (irp_choice == 0) {
3196      pirp->IoStatus.__annonCompField4.Status = -1073741637L;
3197      myStatus = -1073741637L;
3198    } else {
3199
3200    }
3201    {
3202    stub_driver_init();
3203    }
3204    if (! (status >= 0L)) {
3205      return (-1);
3206    } else {
3207
3208    }
3209    if (__BLAST_NONDET___0 == 0) {
3210      goto switch_4_0;
3211    } else {
3212      if (__BLAST_NONDET___0 == 2) {
3213        goto switch_4_2;
3214      } else {
3215        if (__BLAST_NONDET___0 == 3) {
3216          goto switch_4_3;
3217        } else {
3218          if (__BLAST_NONDET___0 == 4) {
3219            goto switch_4_4;
3220          } else {
3221            if (__BLAST_NONDET___0 == 12) {
3222              goto switch_4_12;
3223            } else {
3224              {
3225              goto switch_4_default;
3226              if (0) {
3227                switch_4_0: /* CIL Label */ 
3228                {
3229                status = DiskPerfCreate(& devobj, pirp);
3230                }
3231                goto switch_4_break;
3232                switch_4_2: /* CIL Label */ 
3233                {
3234                status = DiskPerfDeviceControl(& devobj, pirp);
3235                }
3236                goto switch_4_break;
3237                switch_4_3: /* CIL Label */ 
3238                {
3239                status = DiskPerfDispatchPnp(& devobj, pirp);
3240                }
3241                goto switch_4_break;
3242                switch_4_4: /* CIL Label */ 
3243                {
3244                status = DiskPerfDispatchPower(& devobj, pirp);
3245                }
3246                goto switch_4_break;
3247                switch_4_12: /* CIL Label */ 
3248                {
3249                status = DiskPerfShutdownFlush(& devobj, pirp);
3250                }
3251                goto switch_4_break;
3252                switch_4_default: /* CIL Label */ ;
3253                return (-1);
3254              } else {
3255                switch_4_break: /* CIL Label */ ;
3256              }
3257              }
3258            }
3259          }
3260        }
3261      }
3262    }
3263    if (we_should_unload) {
3264      {
3265/*       DiskPerfUnload(& d); */ /* INLINED */
3266      }
3267    } else {
3268
3269    }
3270  } else {
3271
3272  }
3273  if (pended == 1) {
3274    if (s == NP) {
3275      s = NP;
3276    } else {
3277      goto _L___2;
3278    }
3279  } else {
3280    _L___2: /* CIL Label */ 
3281    if (pended == 1) {
3282      if (s == MPR3) {
3283        s = MPR3;
3284      } else {
3285        goto _L___1;
3286      }
3287    } else {
3288      _L___1: /* CIL Label */ 
3289      if (s == UNLOADED) {
3290
3291      } else {
3292        if (status == -1L) {
3293
3294        } else {
3295          if (s != SKIP2) {
3296            if (s != IPC) {
3297              if (s != DC) {
3298                {
3299                errorFn();
3300                }
3301              } else {
3302                goto _L___0;
3303              }
3304            } else {
3305              goto _L___0;
3306            }
3307          } else {
3308            _L___0: /* CIL Label */ 
3309            if (pended == 1) {
3310              if (status != 259L) {
3311                {
3312                errorFn();
3313                }
3314              } else {
3315
3316              }
3317            } else {
3318              if (s == DC) {
3319                if (status == 259L) {
3320                  {
3321                  errorFn();
3322                  }
3323                } else {
3324
3325                }
3326              } else {
3327                if (status != (NTSTATUS )lowerDriverReturn) {
3328                  {
3329                  errorFn();
3330                  }
3331                } else {
3332
3333                }
3334              }
3335            }
3336          }
3337        }
3338      }
3339    }
3340  }
3341  return (status);
3342}
3343}
3344char _SLAM_alloc_dummy  ;
3345char *malloc(int i ) 
3346{ int __BLAST_NONDET___0 ;
3347
3348  {
3349  if (__BLAST_NONDET___0) {
3350    return ((char *)0);
3351  } else {
3352    return ((char *)1);
3353  }
3354}
3355}
3356  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
3357void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) 
3358{ 
3359
3360  {
3361  return;
3362}
3363}
3364  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
3365void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) 
3366{ 
3367
3368  {
3369  return;
3370}
3371}
3372  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
3373                                                                                            SIZE_T NumberOfBytes ,
3374                                                                                            ULONG Tag ) ;
3375PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes ,
3376                                                            ULONG Tag ) 
3377{ PVOID x ;
3378  char *tmp ;
3379
3380  {
3381  {
3382  tmp = malloc(NumberOfBytes);
3383  x = tmp;
3384  }
3385  return (x);
3386}
3387}
3388  void ExFreePool(PVOID P ) ;
3389void ExFreePool(PVOID P ) 
3390{ 
3391
3392  {
3393  return;
3394}
3395}
3396  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
3397                                                                                                          PLIST_ENTRY ListEntry ,
3398                                                                                                          PKSPIN_LOCK Lock ) ;
3399PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
3400                                                                          PLIST_ENTRY ListEntry ,
3401                                                                          PKSPIN_LOCK Lock ) 
3402{ 
3403
3404  {
3405  return ((void *)0);
3406}
3407}
3408  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
3409                                                                                                          PLIST_ENTRY ListEntry ,
3410                                                                                                          PKSPIN_LOCK Lock ) ;
3411PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
3412                                                                          PLIST_ENTRY ListEntry ,
3413                                                                          PKSPIN_LOCK Lock ) 
3414{ 
3415
3416  {
3417  return ((void *)0);
3418}
3419}
3420  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
3421                                                                                                          PKSPIN_LOCK Lock ) ;
3422PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
3423                                                                          PKSPIN_LOCK Lock ) 
3424{ 
3425
3426  {
3427  return ((void *)0);
3428}
3429}
3430  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
3431                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
3432                                                   PIRP Irp ) ;
3433PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer ,
3434                   BOOLEAN ChargeQuota , PIRP Irp ) 
3435{ int __BLAST_NONDET___0 ;
3436  char *tmp ;
3437
3438  {
3439  if (__BLAST_NONDET___0 == 0) {
3440    goto switch_5_0;
3441  } else {
3442    {
3443    goto switch_5_default;
3444    if (0) {
3445      switch_5_0: /* CIL Label */ 
3446      {
3447      tmp = malloc(sizeof(MDL ));
3448      }
3449      return ((void *)tmp);
3450      switch_5_default: /* CIL Label */ ;
3451      return ((void *)0);
3452    } else {
3453      switch_5_break: /* CIL Label */ ;
3454    }
3455    }
3456  }
3457}
3458}
3459  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
3460                                                                           PDEVICE_OBJECT TargetDevice ) ;
3461PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) 
3462{ int __BLAST_NONDET___0 ;
3463
3464  {
3465  if (__BLAST_NONDET___0 == 0) {
3466    goto switch_6_0;
3467  } else {
3468    {
3469    goto switch_6_default;
3470    if (0) {
3471      switch_6_0: /* CIL Label */ ;
3472      return (TargetDevice);
3473      switch_6_default: /* CIL Label */ ;
3474      return ((void *)0);
3475    } else {
3476      switch_6_break: /* CIL Label */ ;
3477    }
3478    }
3479  }
3480}
3481}
3482  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
3483                                                                   PDEVICE_OBJECT DeviceObject ,
3484                                                                   PVOID Buffer ,
3485                                                                   ULONG Length ,
3486                                                                   PLARGE_INTEGER StartingOffset ,
3487                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
3488PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject ,
3489                                   PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset ,
3490                                   PIO_STATUS_BLOCK IoStatusBlock ) 
3491{ int __BLAST_NONDET___0 ;
3492  char *tmp ;
3493
3494  {
3495  customIrp = 1;
3496  if (__BLAST_NONDET___0 == 0) {
3497    goto switch_7_0;
3498  } else {
3499    {
3500    goto switch_7_default;
3501    if (0) {
3502      switch_7_0: /* CIL Label */ 
3503      {
3504      tmp = malloc(sizeof(IRP ));
3505      }
3506      return ((void *)tmp);
3507      switch_7_default: /* CIL Label */ ;
3508      return ((void *)0);
3509    } else {
3510      switch_7_break: /* CIL Label */ ;
3511    }
3512    }
3513  }
3514}
3515}
3516  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
3517                                                                   PDEVICE_OBJECT DeviceObject ,
3518                                                                   PVOID InputBuffer ,
3519                                                                   ULONG InputBufferLength ,
3520                                                                   PVOID OutputBuffer ,
3521                                                                   ULONG OutputBufferLength ,
3522                                                                   BOOLEAN InternalDeviceIoControl ,
3523                                                                   PKEVENT Event ,
3524                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
3525PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject ,
3526                                   PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
3527                                   ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl ,
3528                                   PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) 
3529{ int __BLAST_NONDET___0 ;
3530  char *tmp ;
3531
3532  {
3533  customIrp = 1;
3534  if (__BLAST_NONDET___0 == 0) {
3535    goto switch_8_0;
3536  } else {
3537    {
3538    goto switch_8_default;
3539    if (0) {
3540      switch_8_0: /* CIL Label */ 
3541      {
3542      tmp = malloc(sizeof(IRP ));
3543      }
3544      return ((void *)tmp);
3545      switch_8_default: /* CIL Label */ ;
3546      return ((void *)0);
3547    } else {
3548      switch_8_break: /* CIL Label */ ;
3549    }
3550    }
3551  }
3552}
3553}
3554  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
3555                                                        ULONG DeviceExtensionSize ,
3556                                                        PUNICODE_STRING DeviceName ,
3557                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
3558                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
3559NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize ,
3560                        PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics ,
3561                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) 
3562{ int __BLAST_NONDET___0 ;
3563  char *tmp ;
3564
3565  {
3566  if (__BLAST_NONDET___0 == 0) {
3567    goto switch_9_0;
3568  } else {
3569    {
3570    goto switch_9_default;
3571    if (0) {
3572      switch_9_0: /* CIL Label */ 
3573      {
3574      tmp = malloc(sizeof(DEVICE_OBJECT ));
3575      *DeviceObject = (void *)tmp;
3576      }
3577      return (0L);
3578      switch_9_default: /* CIL Label */ ;
3579      return (-1073741823L);
3580    } else {
3581      switch_9_break: /* CIL Label */ ;
3582    }
3583    }
3584  }
3585}
3586}
3587  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
3588                                                              PUNICODE_STRING DeviceName ) ;
3589NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) 
3590{ int __BLAST_NONDET___0 ;
3591
3592  {
3593  if (__BLAST_NONDET___0 == 0) {
3594    goto switch_10_0;
3595  } else {
3596    {
3597    goto switch_10_default;
3598    if (0) {
3599      switch_10_0: /* CIL Label */ ;
3600      return (0L);
3601      switch_10_default: /* CIL Label */ ;
3602      return (-1073741823L);
3603    } else {
3604      switch_10_break: /* CIL Label */ ;
3605    }
3606    }
3607  }
3608}
3609}
3610  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
3611void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) 
3612{ 
3613
3614  {
3615  return;
3616}
3617}
3618  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
3619NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) 
3620{ int __BLAST_NONDET___0 ;
3621
3622  {
3623  if (__BLAST_NONDET___0 == 0) {
3624    goto switch_11_0;
3625  } else {
3626    {
3627    goto switch_11_default;
3628    if (0) {
3629      switch_11_0: /* CIL Label */ ;
3630      return (0L);
3631      switch_11_default: /* CIL Label */ ;
3632      return (-1073741823L);
3633    } else {
3634      switch_11_break: /* CIL Label */ ;
3635    }
3636    }
3637  }
3638}
3639}
3640  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
3641void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) 
3642{ 
3643
3644  {
3645  return;
3646}
3647}
3648  void IoFreeIrp(PIRP Irp ) ;
3649void IoFreeIrp(PIRP Irp ) 
3650{ 
3651
3652  {
3653  return;
3654}
3655}
3656  void IoFreeMdl(PMDL Mdl ) ;
3657void IoFreeMdl(PMDL Mdl ) 
3658{ 
3659
3660  {
3661  return;
3662}
3663}
3664  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
3665PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) 
3666{ char *tmp ;
3667
3668  {
3669  {
3670  tmp = malloc(sizeof(CONFIGURATION_INFORMATION ));
3671  }
3672  return ((void *)tmp);
3673}
3674}
3675  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
3676                                                                  PULONG BusNumber ,
3677                                                                  PCONFIGURATION_TYPE ControllerType ,
3678                                                                  PULONG ControllerNumber ,
3679                                                                  PCONFIGURATION_TYPE PeripheralType ,
3680                                                                  PULONG PeripheralNumber ,
3681                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
3682                                                                                             PUNICODE_STRING PathName ,
3683                                                                                             INTERFACE_TYPE BusType ,
3684                                                                                             ULONG BusNumber ,
3685                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
3686                                                                                             CONFIGURATION_TYPE ControllerType ,
3687                                                                                             ULONG ControllerNumber ,
3688                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
3689                                                                                             CONFIGURATION_TYPE PeripheralType ,
3690                                                                                             ULONG PeripheralNumber ,
3691                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
3692                                                                  PVOID Context ) ;
3693NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType ,
3694                                  PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType ,
3695                                  PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context ,
3696                                                                                       PUNICODE_STRING PathName ,
3697                                                                                       INTERFACE_TYPE BusType ,
3698                                                                                       ULONG BusNumber ,
3699                                                                                       PKEY_VALUE_FULL_INFORMATION *BusInformation ,
3700                                                                                       CONFIGURATION_TYPE ControllerType ,
3701                                                                                       ULONG ControllerNumber ,
3702                                                                                       PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
3703                                                                                       CONFIGURATION_TYPE PeripheralType ,
3704                                                                                       ULONG PeripheralNumber ,
3705                                                                                       PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
3706                                  PVOID Context ) 
3707{ int __BLAST_NONDET___0 ;
3708
3709  {
3710  if (__BLAST_NONDET___0 == 0) {
3711    goto switch_12_0;
3712  } else {
3713    {
3714    goto switch_12_default;
3715    if (0) {
3716      switch_12_0: /* CIL Label */ ;
3717      return (0L);
3718      switch_12_default: /* CIL Label */ ;
3719      return (-1073741823L);
3720    } else {
3721      switch_12_break: /* CIL Label */ ;
3722    }
3723    }
3724  }
3725}
3726}
3727  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
3728                                                                                                   GUID const   *InterfaceClassGuid ,
3729                                                                                                   PUNICODE_STRING ReferenceString ,
3730                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
3731NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
3732                                                                   GUID const   *InterfaceClassGuid ,
3733                                                                   PUNICODE_STRING ReferenceString ,
3734                                                                   PUNICODE_STRING SymbolicLinkName ) 
3735{ int __BLAST_NONDET___0 ;
3736
3737  {
3738  if (__BLAST_NONDET___0 == 0) {
3739    goto switch_13_0;
3740  } else {
3741    {
3742    goto switch_13_default;
3743    if (0) {
3744      switch_13_0: /* CIL Label */ ;
3745      return (0L);
3746      switch_13_default: /* CIL Label */ ;
3747      return (-1073741808L);
3748    } else {
3749      switch_13_break: /* CIL Label */ ;
3750    }
3751    }
3752  }
3753}
3754}
3755  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
3756void IoReleaseCancelSpinLock(KIRQL Irql ) 
3757{ 
3758
3759  {
3760  return;
3761}
3762}
3763  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
3764                                                                   BOOLEAN Enable ) ;
3765NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) 
3766{ int __BLAST_NONDET___0 ;
3767
3768  {
3769  if (__BLAST_NONDET___0 == 0) {
3770    goto switch_14_0;
3771  } else {
3772    {
3773    goto switch_14_default;
3774    if (0) {
3775      switch_14_0: /* CIL Label */ ;
3776      return (0L);
3777      switch_14_default: /* CIL Label */ ;
3778      return (-1073741823L);
3779    } else {
3780      switch_14_break: /* CIL Label */ ;
3781    }
3782    }
3783  }
3784}
3785}
3786  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
3787void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) 
3788{ 
3789
3790  {
3791  return;
3792}
3793}
3794void stubMoreProcessingRequired(void) 
3795{ 
3796
3797  {
3798  if (s == NP) {
3799    s = MPR1;
3800  } else {
3801    {
3802    errorFn();
3803    }
3804  }
3805  return;
3806}
3807}
3808  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
3809                                                                                        PIRP Irp ) ;
3810NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
3811                                                        PIRP Irp ) 
3812{ int __BLAST_NONDET___0 ;
3813  NTSTATUS returnVal2 ;
3814  int compRetStatus ;
3815  PVOID lcontext ;
3816  NTSTATUS tmp ;
3817  NTSTATUS tmp___0 ;
3818
3819  {
3820  if (compRegistered) {
3821    if (routine == 0) {
3822      {
3823      tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext);
3824      compRetStatus = tmp;
3825      }
3826    } else {
3827      {
3828      tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext);
3829      compRetStatus = tmp___0;
3830      }
3831    }
3832    if ((long )compRetStatus == -1073741802L) {
3833      {
3834      stubMoreProcessingRequired();
3835      }
3836    } else {
3837
3838    }
3839  } else {
3840
3841  }
3842  if (__BLAST_NONDET___0 == 0) {
3843    goto switch_15_0;
3844  } else {
3845    if (__BLAST_NONDET___0 == 1) {
3846      goto switch_15_1;
3847    } else {
3848      {
3849      goto switch_15_default;
3850      if (0) {
3851        switch_15_0: /* CIL Label */ 
3852        returnVal2 = 0L;
3853        goto switch_15_break;
3854        switch_15_1: /* CIL Label */ 
3855        returnVal2 = -1073741823L;
3856        goto switch_15_break;
3857        switch_15_default: /* CIL Label */ 
3858        returnVal2 = 259L;
3859        goto switch_15_break;
3860      } else {
3861        switch_15_break: /* CIL Label */ ;
3862      }
3863      }
3864    }
3865  }
3866  if (s == NP) {
3867    s = IPC;
3868    lowerDriverReturn = returnVal2;
3869  } else {
3870    if (s == MPR1) {
3871      if (returnVal2 == 259L) {
3872        s = MPR3;
3873        lowerDriverReturn = returnVal2;
3874      } else {
3875        s = NP;
3876        lowerDriverReturn = returnVal2;
3877      }
3878    } else {
3879      if (s == SKIP1) {
3880        s = SKIP2;
3881        lowerDriverReturn = returnVal2;
3882      } else {
3883        {
3884        errorFn();
3885        }
3886      }
3887    }
3888  }
3889  return (returnVal2);
3890}
3891}
3892  void IofCompleteRequest(PIRP Irp ,
3893                                                                                         CCHAR PriorityBoost ) ;
3894void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) 
3895{ 
3896
3897  {
3898  if (s == NP) {
3899    s = DC;
3900  } else {
3901    {
3902    errorFn();
3903    }
3904  }
3905  return;
3906}
3907}
3908  KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ;
3909KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) 
3910{ 
3911
3912  {
3913  return ((unsigned char)0);
3914}
3915}
3916  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
3917                                                                BOOLEAN Alertable ,
3918                                                                PLARGE_INTEGER Interval ) ;
3919NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) 
3920{ int __BLAST_NONDET___0 ;
3921
3922  {
3923  if (__BLAST_NONDET___0 == 0) {
3924    goto switch_16_0;
3925  } else {
3926    {
3927    goto switch_16_default;
3928    if (0) {
3929      switch_16_0: /* CIL Label */ ;
3930      return (0L);
3931      switch_16_default: /* CIL Label */ ;
3932      return (-1073741823L);
3933    } else {
3934      switch_16_break: /* CIL Label */ ;
3935    }
3936    }
3937  }
3938}
3939}
3940  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
3941                                                       BOOLEAN State ) ;
3942void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) 
3943{ 
3944
3945  {
3946  return;
3947}
3948}
3949  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
3950                                                           LONG Count , LONG Limit ) ;
3951void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) 
3952{ 
3953
3954  {
3955  return;
3956}
3957}
3958  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
3959void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) 
3960{ 
3961
3962  {
3963  return;
3964}
3965}
3966  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
3967                                                        LONG Adjustment , BOOLEAN Wait ) ;
3968LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment ,
3969                        BOOLEAN Wait ) 
3970{ LONG r ;
3971
3972  {
3973  return (r);
3974}
3975}
3976  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
3977                                                                                        KIRQL NewIrql ) ;
3978void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) 
3979{ 
3980
3981  {
3982  return;
3983}
3984}
3985  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
3986                                                BOOLEAN Wait ) ;
3987LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) 
3988{ LONG l ;
3989
3990  {
3991  setEventCalled = 1;
3992  return (l);
3993}
3994}
3995  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
3996                                                               KPROCESSOR_MODE WaitMode ,
3997                                                               BOOLEAN Alertable ,
3998                                                               PLARGE_INTEGER Timeout ) ;
3999NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode ,
4000                               BOOLEAN Alertable , PLARGE_INTEGER Timeout ) 
4001{ int __BLAST_NONDET___0 ;
4002
4003  {
4004  if (s == MPR3) {
4005    if (setEventCalled == 1) {
4006      s = NP;
4007      setEventCalled = 0;
4008    } else {
4009      goto _L;
4010    }
4011  } else {
4012    _L: /* CIL Label */ 
4013    if (customIrp == 1) {
4014      s = NP;
4015      customIrp = 0;
4016    } else {
4017      if (s == MPR3) {
4018        {
4019        errorFn();
4020        }
4021      } else {
4022
4023      }
4024    }
4025  }
4026  if (__BLAST_NONDET___0 == 0) {
4027    goto switch_17_0;
4028  } else {
4029    {
4030    goto switch_17_default;
4031    if (0) {
4032      switch_17_0: /* CIL Label */ ;
4033      return (0L);
4034      switch_17_default: /* CIL Label */ ;
4035      return (-1073741823L);
4036    } else {
4037      switch_17_break: /* CIL Label */ ;
4038    }
4039    }
4040  }
4041}
4042}
4043  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
4044                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
4045PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) 
4046{ int __BLAST_NONDET___0 ;
4047  char *tmp ;
4048
4049  {
4050  if (__BLAST_NONDET___0 == 0) {
4051    goto switch_18_0;
4052  } else {
4053    if (__BLAST_NONDET___0 == 1) {
4054      goto switch_18_1;
4055    } else {
4056      if (0) {
4057        switch_18_0: /* CIL Label */ 
4058        {
4059        tmp = malloc(NumberOfBytes);
4060        }
4061        return (tmp);
4062        switch_18_1: /* CIL Label */ ;
4063        return ((void *)0);
4064      } else {
4065        switch_18_break: /* CIL Label */ ;
4066      }
4067    }
4068  }
4069  return ((void *)0);
4070}
4071}
4072  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
4073void MmFreeContiguousMemory(PVOID BaseAddress ) 
4074{ 
4075
4076  {
4077  return;
4078}
4079}
4080  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
4081                                                                   KPROCESSOR_MODE AccessMode ,
4082                                                                   MEMORY_CACHING_TYPE CacheType ,
4083                                                                   PVOID BaseAddress ,
4084                                                                   ULONG BugCheckOnFailure ,
4085                                                                   MM_PAGE_PRIORITY Priority ) ;
4086PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode ,
4087                                   MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress ,
4088                                   ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) 
4089{ 
4090
4091  {
4092  return ((void *)0);
4093}
4094}
4095  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
4096PVOID MmPageEntireDriver(PVOID AddressWithinSection ) 
4097{ 
4098
4099  {
4100  return ((void *)0);
4101}
4102}
4103  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
4104void MmResetDriverPaging(PVOID AddressWithinSection ) 
4105{ 
4106
4107  {
4108  return;
4109}
4110}
4111  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
4112void MmUnlockPages(PMDL MemoryDescriptorList ) 
4113{ 
4114
4115  {
4116  return;
4117}
4118}
4119  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
4120                                                                   ACCESS_MASK DesiredAccess ,
4121                                                                   POBJECT_TYPE ObjectType ,
4122                                                                   KPROCESSOR_MODE AccessMode ,
4123                                                                   PVOID *Object ,
4124                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
4125NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType ,
4126                                   KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) 
4127{ int __BLAST_NONDET___0 ;
4128
4129  {
4130  if (__BLAST_NONDET___0 == 0) {
4131    goto switch_19_0;
4132  } else {
4133    {
4134    goto switch_19_default;
4135    if (0) {
4136      switch_19_0: /* CIL Label */ ;
4137      return (0L);
4138      switch_19_default: /* CIL Label */ ;
4139      return (-1073741823L);
4140    } else {
4141      switch_19_break: /* CIL Label */ ;
4142    }
4143    }
4144  }
4145}
4146}
4147  void ObfDereferenceObject(PVOID Object ) ;
4148void ObfDereferenceObject(PVOID Object ) 
4149{ 
4150
4151  {
4152  return;
4153}
4154}
4155  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
4156                                                      PIRP Irp ) ;
4157NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
4158{ int __BLAST_NONDET___0 ;
4159  int compRetStatus ;
4160  NTSTATUS returnVal ;
4161  PVOID lcontext ;
4162  NTSTATUS tmp ;
4163  NTSTATUS tmp___0 ;
4164
4165  {
4166  if (compRegistered) {
4167    if (routine == 0) {
4168      {
4169      tmp = DiskPerfIrpCompletion(DeviceObject, Irp, lcontext);
4170      compRetStatus = tmp;
4171      }
4172    } else {
4173      if (routine == 1) {
4174        {
4175        tmp___0 = DiskPerfIoCompletion(DeviceObject, Irp, lcontext);
4176        compRetStatus = tmp___0;
4177        }
4178      } else {
4179
4180      }
4181    }
4182    if ((long )compRetStatus == -1073741802L) {
4183      {
4184      stubMoreProcessingRequired();
4185      }
4186    } else {
4187
4188    }
4189  } else {
4190
4191  }
4192  if (__BLAST_NONDET___0 == 0) {
4193    goto switch_20_0;
4194  } else {
4195    if (__BLAST_NONDET___0 == 1) {
4196      goto switch_20_1;
4197    } else {
4198      {
4199      goto switch_20_default;
4200      if (0) {
4201        switch_20_0: /* CIL Label */ 
4202        returnVal = 0L;
4203        goto switch_20_break;
4204        switch_20_1: /* CIL Label */ 
4205        returnVal = -1073741823L;
4206        goto switch_20_break;
4207        switch_20_default: /* CIL Label */ 
4208        returnVal = 259L;
4209        goto switch_20_break;
4210      } else {
4211        switch_20_break: /* CIL Label */ ;
4212      }
4213      }
4214    }
4215  }
4216  if (s == NP) {
4217    s = IPC;
4218    lowerDriverReturn = returnVal;
4219  } else {
4220    if (s == MPR1) {
4221      if (returnVal == 259L) {
4222        s = MPR3;
4223        lowerDriverReturn = returnVal;
4224      } else {
4225        s = NP;
4226        lowerDriverReturn = returnVal;
4227      }
4228    } else {
4229      if (s == SKIP1) {
4230        s = SKIP2;
4231        lowerDriverReturn = returnVal;
4232      } else {
4233        {
4234        errorFn();
4235        }
4236      }
4237    }
4238  }
4239  return (returnVal);
4240}
4241}
4242  void PoStartNextPowerIrp(PIRP Irp ) ;
4243void PoStartNextPowerIrp(PIRP Irp ) 
4244{ 
4245
4246  {
4247  return;
4248}
4249}
4250  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
4251                                                              ULONG DesiredAccess ,
4252                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
4253                                                              HANDLE ProcessHandle ,
4254                                                              PCLIENT_ID ClientId ,
4255                                                              void (*StartRoutine)(PVOID StartContext ) ,
4256                                                              PVOID StartContext ) ;
4257NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes ,
4258                              HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) ,
4259                              PVOID StartContext ) 
4260{ int __BLAST_NONDET___0 ;
4261
4262  {
4263  if (__BLAST_NONDET___0 == 0) {
4264    goto switch_21_0;
4265  } else {
4266    {
4267    goto switch_21_default;
4268    if (0) {
4269      switch_21_0: /* CIL Label */ ;
4270      return (0L);
4271      switch_21_default: /* CIL Label */ ;
4272      return (-1073741823L);
4273    } else {
4274      switch_21_break: /* CIL Label */ ;
4275    }
4276    }
4277  }
4278}
4279}
4280  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
4281NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) 
4282{ int __BLAST_NONDET___0 ;
4283
4284  {
4285  if (__BLAST_NONDET___0 == 0) {
4286    goto switch_22_0;
4287  } else {
4288    {
4289    goto switch_22_default;
4290    if (0) {
4291      switch_22_0: /* CIL Label */ ;
4292      return (0L);
4293      switch_22_default: /* CIL Label */ ;
4294      return (-1073741823L);
4295    } else {
4296      switch_22_break: /* CIL Label */ ;
4297    }
4298    }
4299  }
4300}
4301}
4302  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
4303                                                                                                      PANSI_STRING SourceString ,
4304                                                                                                      BOOLEAN AllocateDestinationString ) ;
4305NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
4306                                                                      PANSI_STRING SourceString ,
4307                                                                      BOOLEAN AllocateDestinationString ) 
4308{ int __BLAST_NONDET___0 ;
4309
4310  {
4311  if (__BLAST_NONDET___0 == 0) {
4312    goto switch_23_0;
4313  } else {
4314    {
4315    goto switch_23_default;
4316    if (0) {
4317      switch_23_0: /* CIL Label */ ;
4318      return (0L);
4319      switch_23_default: /* CIL Label */ ;
4320      return (-1073741823L);
4321    } else {
4322      switch_23_break: /* CIL Label */ ;
4323    }
4324    }
4325  }
4326}
4327}
4328  SIZE_T RtlCompareMemory(void const   *Source1 ,
4329                                                                                        void const   *Source2 ,
4330                                                                                        SIZE_T Length ) ;
4331SIZE_T RtlCompareMemory(void const   *Source1 , void const   *Source2 ,
4332                                                        SIZE_T Length ) 
4333{ SIZE_T r ;
4334
4335  {
4336  return (r);
4337}
4338}
4339  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
4340                                                                                          PUNICODE_STRING SourceString ) ;
4341void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
4342                                                          PUNICODE_STRING SourceString ) 
4343{ 
4344
4345  {
4346  return;
4347}
4348}
4349  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
4350                                                                                                PCWSTR Path ,
4351                                                                                                PCWSTR ValueName ) ;
4352NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
4353                                                                PCWSTR Path , PCWSTR ValueName ) 
4354{ int __BLAST_NONDET___0 ;
4355
4356  {
4357  if (__BLAST_NONDET___0 == 0) {
4358    goto switch_24_0;
4359  } else {
4360    {
4361    goto switch_24_default;
4362    if (0) {
4363      switch_24_0: /* CIL Label */ ;
4364      return (0L);
4365      switch_24_default: /* CIL Label */ ;
4366      return (-1073741823L);
4367    } else {
4368      switch_24_break: /* CIL Label */ ;
4369    }
4370    }
4371  }
4372}
4373}
4374  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
4375void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) 
4376{ 
4377
4378  {
4379  return;
4380}
4381}
4382  void RtlInitString(PSTRING DestinationString ,
4383                                                                                   PCSZ SourceString ) ;
4384void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) 
4385{ 
4386
4387  {
4388  return;
4389}
4390}
4391  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
4392                                                                                          PCWSTR SourceString ) ;
4393void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
4394                                                          PCWSTR SourceString ) 
4395{ 
4396
4397  {
4398  return;
4399}
4400}
4401  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
4402                                                                                                PCWSTR Path ,
4403                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
4404                                                                                                PVOID Context ,
4405                                                                                                PVOID Environment ) ;
4406NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
4407                                                                PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable ,
4408                                                                PVOID Context , PVOID Environment ) 
4409{ int __BLAST_NONDET___0 ;
4410
4411  {
4412  if (__BLAST_NONDET___0 == 0) {
4413    goto switch_25_0;
4414  } else {
4415    {
4416    goto switch_25_default;
4417    if (0) {
4418      switch_25_0: /* CIL Label */ ;
4419      return (0L);
4420      switch_25_default: /* CIL Label */ ;
4421      return (-1073741823L);
4422    } else {
4423      switch_25_break: /* CIL Label */ ;
4424    }
4425    }
4426  }
4427}
4428}
4429  NTSTATUS ZwClose(HANDLE Handle ) ;
4430NTSTATUS ZwClose(HANDLE Handle ) 
4431{ int __BLAST_NONDET___0 ;
4432
4433  {
4434  if (__BLAST_NONDET___0 == 0) {
4435    goto switch_26_0;
4436  } else {
4437    {
4438    goto switch_26_default;
4439    if (0) {
4440      switch_26_0: /* CIL Label */ ;
4441      return (0L);
4442      switch_26_default: /* CIL Label */ ;
4443      return (-1073741823L);
4444    } else {
4445      switch_26_break: /* CIL Label */ ;
4446    }
4447    }
4448  }
4449}
4450}
4451NTSTATUS WmiSystemControl(PWMILIB_CONTEXT WmiLibInfo , PDEVICE_OBJECT DeviceObject ,
4452                          PIRP Irp , PSYSCTL_IRP_DISPOSITION IrpDisposition ) 
4453{ 
4454
4455  {
4456  return (0L);
4457}
4458}