Showing error 1551

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_unsafe.i.cil.c
Line in file: 1985
Project: SV-COMP 2013
Project version: 2.6.28
Tools: Manual Work
Entered: 2013-01-17 16:57:54 UTC


Source:

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