Showing error 1555

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: ntdrivers/kbfiltr_unsafe.i.cil.c
Line in file: 1641
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 *PWSTR;
  20typedef WCHAR const   *PCWSTR;
  21typedef CHAR *PCHAR;
  22typedef LONG *PLONG;
  23typedef unsigned char UCHAR;
  24typedef unsigned short USHORT;
  25typedef unsigned long ULONG;
  26typedef UCHAR *PUCHAR;
  27typedef ULONG *PULONG;
  28typedef void *HANDLE;
  29typedef HANDLE *PHANDLE;
  30typedef char CCHAR;
  31typedef short CSHORT;
  32typedef ULONG LCID;
  33typedef LONG NTSTATUS;
  34typedef long long LONGLONG;
  35struct __anonstruct____missing_field_name_1 {
  36   ULONG LowPart ;
  37   LONG HighPart ;
  38};
  39struct __anonstruct_u_2 {
  40   ULONG LowPart ;
  41   LONG HighPart ;
  42};
  43union _LARGE_INTEGER {
  44   struct __anonstruct____missing_field_name_1 __annonCompField1 ;
  45   struct __anonstruct_u_2 u ;
  46   LONGLONG QuadPart ;
  47};
  48typedef union _LARGE_INTEGER LARGE_INTEGER;
  49typedef LARGE_INTEGER *PLARGE_INTEGER;
  50struct _LUID {
  51   ULONG LowPart ;
  52   LONG HighPart ;
  53};
  54typedef struct _LUID LUID;
  55typedef LARGE_INTEGER PHYSICAL_ADDRESS;
  56enum _EVENT_TYPE {
  57    NotificationEvent = 0,
  58    SynchronizationEvent = 1
  59} ;
  60typedef enum _EVENT_TYPE EVENT_TYPE;
  61typedef char const   *PCSZ;
  62struct _STRING {
  63   USHORT Length ;
  64   USHORT MaximumLength ;
  65   PCHAR Buffer ;
  66};
  67typedef struct _STRING STRING;
  68typedef STRING *PSTRING;
  69typedef PSTRING PANSI_STRING;
  70struct _UNICODE_STRING {
  71   USHORT Length ;
  72   USHORT MaximumLength ;
  73   PWSTR Buffer ;
  74};
  75typedef struct _UNICODE_STRING UNICODE_STRING;
  76typedef UNICODE_STRING *PUNICODE_STRING;
  77typedef UCHAR BOOLEAN;
  78typedef BOOLEAN *PBOOLEAN;
  79struct _LIST_ENTRY {
  80   struct _LIST_ENTRY *Flink ;
  81   struct _LIST_ENTRY *Blink ;
  82};
  83typedef struct _LIST_ENTRY LIST_ENTRY;
  84typedef struct _LIST_ENTRY *PLIST_ENTRY;
  85struct _OBJECT_ATTRIBUTES {
  86   ULONG Length ;
  87   HANDLE RootDirectory ;
  88   PUNICODE_STRING ObjectName ;
  89   ULONG Attributes ;
  90   PVOID SecurityDescriptor ;
  91   PVOID SecurityQualityOfService ;
  92};
  93typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES;
  94typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
  95struct _GUID {
  96   unsigned long Data1 ;
  97   unsigned short Data2 ;
  98   unsigned short Data3 ;
  99   unsigned char Data4[8] ;
 100};
 101typedef struct _GUID GUID;
 102typedef unsigned int size_t;
 103typedef UCHAR KIRQL;
 104struct _KTHREAD;
 105typedef struct _KTHREAD *PKTHREAD;
 106struct _ETHREAD;
 107typedef struct _ETHREAD *PETHREAD;
 108struct _EPROCESS;
 109typedef struct _EPROCESS *PEPROCESS;
 110struct _IO_TIMER;
 111typedef struct _IO_TIMER *PIO_TIMER;
 112struct _OBJECT_TYPE;
 113typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 114typedef CCHAR KPROCESSOR_MODE;
 115struct _KAPC;
 116struct _KAPC;
 117typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 );
 118struct _KAPC {
 119   CSHORT Type ;
 120   CSHORT Size ;
 121   ULONG Spare0 ;
 122   struct _KTHREAD *Thread ;
 123   LIST_ENTRY ApcListEntry ;
 124   void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext ,
 125                         PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ;
 126   void (*RundownRoutine)(struct _KAPC *Apc ) ;
 127   void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ;
 128   PVOID NormalContext ;
 129   PVOID SystemArgument1 ;
 130   PVOID SystemArgument2 ;
 131   CCHAR ApcStateIndex ;
 132   KPROCESSOR_MODE ApcMode ;
 133   BOOLEAN Inserted ;
 134};
 135typedef struct _KAPC KAPC;
 136struct _KDPC;
 137struct _KDPC;
 138struct _KDPC {
 139   CSHORT Type ;
 140   UCHAR Number ;
 141   UCHAR Importance ;
 142   LIST_ENTRY DpcListEntry ;
 143   void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 ,
 144                           PVOID SystemArgument2 ) ;
 145   PVOID DeferredContext ;
 146   PVOID SystemArgument1 ;
 147   PVOID SystemArgument2 ;
 148   PULONG_PTR Lock ;
 149};
 150typedef struct _KDPC KDPC;
 151typedef struct _KDPC *PKDPC;
 152struct _MDL {
 153   struct _MDL *Next ;
 154   CSHORT Size ;
 155   CSHORT MdlFlags ;
 156   struct _EPROCESS *Process ;
 157   PVOID MappedSystemVa ;
 158   PVOID StartVa ;
 159   ULONG ByteCount ;
 160   ULONG ByteOffset ;
 161};
 162typedef struct _MDL MDL;
 163typedef struct _MDL *PMDL;
 164typedef PVOID PACCESS_TOKEN;
 165typedef PVOID PSECURITY_DESCRIPTOR;
 166typedef ULONG ACCESS_MASK;
 167#pragma pack(push,4)
 168struct _LUID_AND_ATTRIBUTES {
 169   LUID Luid ;
 170   ULONG Attributes ;
 171};
 172typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES;
 173#pragma pack(pop)
 174struct _PRIVILEGE_SET {
 175   ULONG PrivilegeCount ;
 176   ULONG Control ;
 177   LUID_AND_ATTRIBUTES Privilege[1] ;
 178};
 179typedef struct _PRIVILEGE_SET PRIVILEGE_SET;
 180enum _SECURITY_IMPERSONATION_LEVEL {
 181    SecurityAnonymous = 0,
 182    SecurityIdentification = 1,
 183    SecurityImpersonation = 2,
 184    SecurityDelegation = 3
 185} ;
 186typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL;
 187typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE;
 188struct _SECURITY_QUALITY_OF_SERVICE {
 189   ULONG Length ;
 190   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 191   SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ;
 192   BOOLEAN EffectiveOnly ;
 193};
 194typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE;
 195typedef ULONG SECURITY_INFORMATION;
 196typedef LONG KPRIORITY;
 197typedef ULONG_PTR KSPIN_LOCK;
 198typedef KSPIN_LOCK *PKSPIN_LOCK;
 199struct _RTL_QUERY_REGISTRY_TABLE {
 200   NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType ,
 201                                                            PVOID ValueData , ULONG ValueLength ,
 202                                                            PVOID Context , PVOID EntryContext ) ;
 203   ULONG Flags ;
 204   PWSTR Name ;
 205   PVOID EntryContext ;
 206   ULONG DefaultType ;
 207   PVOID DefaultData ;
 208   ULONG DefaultLength ;
 209};
 210typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE;
 211union __anonunion____missing_field_name_6 {
 212   NTSTATUS Status ;
 213   PVOID Pointer ;
 214};
 215struct _IO_STATUS_BLOCK {
 216   union __anonunion____missing_field_name_6 __annonCompField4 ;
 217   ULONG_PTR Information ;
 218};
 219typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK;
 220typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK;
 221enum _FILE_INFORMATION_CLASS {
 222    FileDirectoryInformation = 1,
 223    FileFullDirectoryInformation = 2,
 224    FileBothDirectoryInformation = 3,
 225    FileBasicInformation = 4,
 226    FileStandardInformation = 5,
 227    FileInternalInformation = 6,
 228    FileEaInformation = 7,
 229    FileAccessInformation = 8,
 230    FileNameInformation = 9,
 231    FileRenameInformation = 10,
 232    FileLinkInformation = 11,
 233    FileNamesInformation = 12,
 234    FileDispositionInformation = 13,
 235    FilePositionInformation = 14,
 236    FileFullEaInformation = 15,
 237    FileModeInformation = 16,
 238    FileAlignmentInformation = 17,
 239    FileAllInformation = 18,
 240    FileAllocationInformation = 19,
 241    FileEndOfFileInformation = 20,
 242    FileAlternateNameInformation = 21,
 243    FileStreamInformation = 22,
 244    FilePipeInformation = 23,
 245    FilePipeLocalInformation = 24,
 246    FilePipeRemoteInformation = 25,
 247    FileMailslotQueryInformation = 26,
 248    FileMailslotSetInformation = 27,
 249    FileCompressionInformation = 28,
 250    FileObjectIdInformation = 29,
 251    FileCompletionInformation = 30,
 252    FileMoveClusterInformation = 31,
 253    FileQuotaInformation = 32,
 254    FileReparsePointInformation = 33,
 255    FileNetworkOpenInformation = 34,
 256    FileAttributeTagInformation = 35,
 257    FileTrackingInformation = 36,
 258    FileMaximumInformation = 37
 259} ;
 260typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS;
 261struct _FILE_BASIC_INFORMATION {
 262   LARGE_INTEGER CreationTime ;
 263   LARGE_INTEGER LastAccessTime ;
 264   LARGE_INTEGER LastWriteTime ;
 265   LARGE_INTEGER ChangeTime ;
 266   ULONG FileAttributes ;
 267};
 268typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION;
 269struct _FILE_STANDARD_INFORMATION {
 270   LARGE_INTEGER AllocationSize ;
 271   LARGE_INTEGER EndOfFile ;
 272   ULONG NumberOfLinks ;
 273   BOOLEAN DeletePending ;
 274   BOOLEAN Directory ;
 275};
 276typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
 277struct _FILE_NETWORK_OPEN_INFORMATION {
 278   LARGE_INTEGER CreationTime ;
 279   LARGE_INTEGER LastAccessTime ;
 280   LARGE_INTEGER LastWriteTime ;
 281   LARGE_INTEGER ChangeTime ;
 282   LARGE_INTEGER AllocationSize ;
 283   LARGE_INTEGER EndOfFile ;
 284   ULONG FileAttributes ;
 285};
 286typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION;
 287enum _FSINFOCLASS {
 288    FileFsVolumeInformation = 1,
 289    FileFsLabelInformation = 2,
 290    FileFsSizeInformation = 3,
 291    FileFsDeviceInformation = 4,
 292    FileFsAttributeInformation = 5,
 293    FileFsControlInformation = 6,
 294    FileFsFullSizeInformation = 7,
 295    FileFsObjectIdInformation = 8,
 296    FileFsMaximumInformation = 9
 297} ;
 298typedef enum _FSINFOCLASS FS_INFORMATION_CLASS;
 299enum _INTERFACE_TYPE {
 300    InterfaceTypeUndefined = -1,
 301    Internal = 0,
 302    Isa = 1,
 303    Eisa = 2,
 304    MicroChannel = 3,
 305    TurboChannel = 4,
 306    PCIBus = 5,
 307    VMEBus = 6,
 308    NuBus = 7,
 309    PCMCIABus = 8,
 310    CBus = 9,
 311    MPIBus = 10,
 312    MPSABus = 11,
 313    ProcessorInternal = 12,
 314    InternalPowerBus = 13,
 315    PNPISABus = 14,
 316    PNPBus = 15,
 317    MaximumInterfaceType = 16
 318} ;
 319typedef enum _INTERFACE_TYPE INTERFACE_TYPE;
 320typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE;
 321struct _IO_ERROR_LOG_PACKET {
 322   UCHAR MajorFunctionCode ;
 323   UCHAR RetryCount ;
 324   USHORT DumpDataSize ;
 325   USHORT NumberOfStrings ;
 326   USHORT StringOffset ;
 327   USHORT EventCategory ;
 328   NTSTATUS ErrorCode ;
 329   ULONG UniqueErrorValue ;
 330   NTSTATUS FinalStatus ;
 331   ULONG SequenceNumber ;
 332   ULONG IoControlCode ;
 333   LARGE_INTEGER DeviceOffset ;
 334   ULONG DumpData[1] ;
 335};
 336typedef struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET;
 337struct _KEY_VALUE_FULL_INFORMATION {
 338   ULONG TitleIndex ;
 339   ULONG Type ;
 340   ULONG DataOffset ;
 341   ULONG DataLength ;
 342   ULONG NameLength ;
 343   WCHAR Name[1] ;
 344};
 345typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION;
 346struct _CLIENT_ID {
 347   HANDLE UniqueProcess ;
 348   HANDLE UniqueThread ;
 349};
 350typedef struct _CLIENT_ID CLIENT_ID;
 351typedef CLIENT_ID *PCLIENT_ID;
 352enum _SYSTEM_POWER_STATE {
 353    PowerSystemUnspecified = 0,
 354    PowerSystemWorking = 1,
 355    PowerSystemSleeping1 = 2,
 356    PowerSystemSleeping2 = 3,
 357    PowerSystemSleeping3 = 4,
 358    PowerSystemHibernate = 5,
 359    PowerSystemShutdown = 6,
 360    PowerSystemMaximum = 7
 361} ;
 362typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE;
 363enum __anonenum_POWER_ACTION_11 {
 364    PowerActionNone = 0,
 365    PowerActionReserved = 1,
 366    PowerActionSleep = 2,
 367    PowerActionHibernate = 3,
 368    PowerActionShutdown = 4,
 369    PowerActionShutdownReset = 5,
 370    PowerActionShutdownOff = 6,
 371    PowerActionWarmEject = 7
 372} ;
 373typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION;
 374enum _DEVICE_POWER_STATE {
 375    PowerDeviceUnspecified = 0,
 376    PowerDeviceD0 = 1,
 377    PowerDeviceD1 = 2,
 378    PowerDeviceD2 = 3,
 379    PowerDeviceD3 = 4,
 380    PowerDeviceMaximum = 5
 381} ;
 382typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE;
 383union _POWER_STATE {
 384   SYSTEM_POWER_STATE SystemState ;
 385   DEVICE_POWER_STATE DeviceState ;
 386};
 387typedef union _POWER_STATE POWER_STATE;
 388enum _POWER_STATE_TYPE {
 389    SystemPowerState = 0,
 390    DevicePowerState = 1
 391} ;
 392typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE;
 393typedef PVOID PASSIGNED_RESOURCE;
 394#pragma pack(push,4)
 395struct __anonstruct_Generic_16 {
 396   PHYSICAL_ADDRESS Start ;
 397   ULONG Length ;
 398};
 399struct __anonstruct_Port_17 {
 400   PHYSICAL_ADDRESS Start ;
 401   ULONG Length ;
 402};
 403struct __anonstruct_Interrupt_18 {
 404   ULONG Level ;
 405   ULONG Vector ;
 406   ULONG Affinity ;
 407};
 408struct __anonstruct_Memory_19 {
 409   PHYSICAL_ADDRESS Start ;
 410   ULONG Length ;
 411};
 412struct __anonstruct_Dma_20 {
 413   ULONG Channel ;
 414   ULONG Port ;
 415   ULONG Reserved1 ;
 416};
 417struct __anonstruct_DevicePrivate_21 {
 418   ULONG Data[3] ;
 419};
 420struct __anonstruct_BusNumber_22 {
 421   ULONG Start ;
 422   ULONG Length ;
 423   ULONG Reserved ;
 424};
 425struct __anonstruct_DeviceSpecificData_23 {
 426   ULONG DataSize ;
 427   ULONG Reserved1 ;
 428   ULONG Reserved2 ;
 429};
 430union __anonunion_u_15 {
 431   struct __anonstruct_Generic_16 Generic ;
 432   struct __anonstruct_Port_17 Port ;
 433   struct __anonstruct_Interrupt_18 Interrupt ;
 434   struct __anonstruct_Memory_19 Memory ;
 435   struct __anonstruct_Dma_20 Dma ;
 436   struct __anonstruct_DevicePrivate_21 DevicePrivate ;
 437   struct __anonstruct_BusNumber_22 BusNumber ;
 438   struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ;
 439};
 440struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
 441   UCHAR Type ;
 442   UCHAR ShareDisposition ;
 443   USHORT Flags ;
 444   union __anonunion_u_15 u ;
 445};
 446typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR;
 447#pragma pack(pop)
 448struct _CM_PARTIAL_RESOURCE_LIST {
 449   USHORT Version ;
 450   USHORT Revision ;
 451   ULONG Count ;
 452   CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ;
 453};
 454typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST;
 455struct _CM_FULL_RESOURCE_DESCRIPTOR {
 456   INTERFACE_TYPE InterfaceType ;
 457   ULONG BusNumber ;
 458   CM_PARTIAL_RESOURCE_LIST PartialResourceList ;
 459};
 460typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR;
 461struct _CM_RESOURCE_LIST {
 462   ULONG Count ;
 463   CM_FULL_RESOURCE_DESCRIPTOR List[1] ;
 464};
 465typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST;
 466#pragma pack(push,1)
 467#pragma pack(pop)
 468struct __anonstruct_Port_25 {
 469   ULONG Length ;
 470   ULONG Alignment ;
 471   PHYSICAL_ADDRESS MinimumAddress ;
 472   PHYSICAL_ADDRESS MaximumAddress ;
 473};
 474struct __anonstruct_Memory_26 {
 475   ULONG Length ;
 476   ULONG Alignment ;
 477   PHYSICAL_ADDRESS MinimumAddress ;
 478   PHYSICAL_ADDRESS MaximumAddress ;
 479};
 480struct __anonstruct_Interrupt_27 {
 481   ULONG MinimumVector ;
 482   ULONG MaximumVector ;
 483};
 484struct __anonstruct_Dma_28 {
 485   ULONG MinimumChannel ;
 486   ULONG MaximumChannel ;
 487};
 488struct __anonstruct_Generic_29 {
 489   ULONG Length ;
 490   ULONG Alignment ;
 491   PHYSICAL_ADDRESS MinimumAddress ;
 492   PHYSICAL_ADDRESS MaximumAddress ;
 493};
 494struct __anonstruct_DevicePrivate_30 {
 495   ULONG Data[3] ;
 496};
 497struct __anonstruct_BusNumber_31 {
 498   ULONG Length ;
 499   ULONG MinBusNumber ;
 500   ULONG MaxBusNumber ;
 501   ULONG Reserved ;
 502};
 503struct __anonstruct_AssignedResource_32 {
 504   PASSIGNED_RESOURCE AssignedResource ;
 505};
 506struct __anonstruct_SubAllocateFrom_33 {
 507   UCHAR Type ;
 508   UCHAR Reserved[3] ;
 509   PASSIGNED_RESOURCE AssignedResource ;
 510   PHYSICAL_ADDRESS Transformation ;
 511};
 512struct __anonstruct_ConfigData_34 {
 513   ULONG Priority ;
 514   ULONG Reserved1 ;
 515   ULONG Reserved2 ;
 516};
 517union __anonunion_u_24 {
 518   struct __anonstruct_Port_25 Port ;
 519   struct __anonstruct_Memory_26 Memory ;
 520   struct __anonstruct_Interrupt_27 Interrupt ;
 521   struct __anonstruct_Dma_28 Dma ;
 522   struct __anonstruct_Generic_29 Generic ;
 523   struct __anonstruct_DevicePrivate_30 DevicePrivate ;
 524   struct __anonstruct_BusNumber_31 BusNumber ;
 525   struct __anonstruct_AssignedResource_32 AssignedResource ;
 526   struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ;
 527   struct __anonstruct_ConfigData_34 ConfigData ;
 528};
 529struct _IO_RESOURCE_DESCRIPTOR {
 530   UCHAR Option ;
 531   UCHAR Type ;
 532   UCHAR ShareDisposition ;
 533   UCHAR Spare1 ;
 534   USHORT Flags ;
 535   USHORT Spare2 ;
 536   union __anonunion_u_24 u ;
 537};
 538typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR;
 539struct _IO_RESOURCE_LIST {
 540   USHORT Version ;
 541   USHORT Revision ;
 542   ULONG Count ;
 543   IO_RESOURCE_DESCRIPTOR Descriptors[1] ;
 544};
 545typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST;
 546struct _IO_RESOURCE_REQUIREMENTS_LIST {
 547   ULONG ListSize ;
 548   INTERFACE_TYPE InterfaceType ;
 549   ULONG BusNumber ;
 550   ULONG SlotNumber ;
 551   ULONG Reserved[3] ;
 552   ULONG AlternativeLists ;
 553   IO_RESOURCE_LIST List[1] ;
 554};
 555typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST;
 556enum _CONFIGURATION_TYPE {
 557    ArcSystem = 0,
 558    CentralProcessor = 1,
 559    FloatingPointProcessor = 2,
 560    PrimaryIcache = 3,
 561    PrimaryDcache = 4,
 562    SecondaryIcache = 5,
 563    SecondaryDcache = 6,
 564    SecondaryCache = 7,
 565    EisaAdapter = 8,
 566    TcAdapter = 9,
 567    ScsiAdapter = 10,
 568    DtiAdapter = 11,
 569    MultiFunctionAdapter = 12,
 570    DiskController = 13,
 571    TapeController = 14,
 572    CdromController = 15,
 573    WormController = 16,
 574    SerialController = 17,
 575    NetworkController = 18,
 576    DisplayController = 19,
 577    ParallelController = 20,
 578    PointerController = 21,
 579    KeyboardController = 22,
 580    AudioController = 23,
 581    OtherController = 24,
 582    DiskPeripheral = 25,
 583    FloppyDiskPeripheral = 26,
 584    TapePeripheral = 27,
 585    ModemPeripheral = 28,
 586    MonitorPeripheral = 29,
 587    PrinterPeripheral = 30,
 588    PointerPeripheral = 31,
 589    KeyboardPeripheral = 32,
 590    TerminalPeripheral = 33,
 591    OtherPeripheral = 34,
 592    LinePeripheral = 35,
 593    NetworkPeripheral = 36,
 594    SystemMemory = 37,
 595    DockingInformation = 38,
 596    RealModeIrqRoutingTable = 39,
 597    MaximumType = 40
 598} ;
 599typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE;
 600typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE;
 601enum _KWAIT_REASON {
 602    Executive = 0,
 603    FreePage = 1,
 604    PageIn = 2,
 605    PoolAllocation = 3,
 606    DelayExecution = 4,
 607    Suspended = 5,
 608    UserRequest = 6,
 609    WrExecutive = 7,
 610    WrFreePage = 8,
 611    WrPageIn = 9,
 612    WrPoolAllocation = 10,
 613    WrDelayExecution = 11,
 614    WrSuspended = 12,
 615    WrUserRequest = 13,
 616    WrEventPair = 14,
 617    WrQueue = 15,
 618    WrLpcReceive = 16,
 619    WrLpcReply = 17,
 620    WrVirtualMemory = 18,
 621    WrPageOut = 19,
 622    WrRendezvous = 20,
 623    Spare2 = 21,
 624    Spare3 = 22,
 625    Spare4 = 23,
 626    Spare5 = 24,
 627    Spare6 = 25,
 628    WrKernel = 26,
 629    MaximumWaitReason = 27
 630} ;
 631typedef enum _KWAIT_REASON KWAIT_REASON;
 632struct _DISPATCHER_HEADER {
 633   UCHAR Type ;
 634   UCHAR Absolute ;
 635   UCHAR Size ;
 636   UCHAR Inserted ;
 637   LONG SignalState ;
 638   LIST_ENTRY WaitListHead ;
 639};
 640typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER;
 641struct _KDEVICE_QUEUE {
 642   CSHORT Type ;
 643   CSHORT Size ;
 644   LIST_ENTRY DeviceListHead ;
 645   KSPIN_LOCK Lock ;
 646   BOOLEAN Busy ;
 647};
 648typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE;
 649struct _KDEVICE_QUEUE_ENTRY {
 650   LIST_ENTRY DeviceListEntry ;
 651   ULONG SortKey ;
 652   BOOLEAN Inserted ;
 653};
 654typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY;
 655struct _KEVENT {
 656   DISPATCHER_HEADER Header ;
 657};
 658typedef struct _KEVENT KEVENT;
 659typedef struct _KEVENT *PKEVENT;
 660typedef struct _KEVENT *PRKEVENT;
 661struct _KSEMAPHORE {
 662   DISPATCHER_HEADER Header ;
 663   LONG Limit ;
 664};
 665typedef struct _KSEMAPHORE *PKSEMAPHORE;
 666typedef struct _KSEMAPHORE *PRKSEMAPHORE;
 667enum _MEMORY_CACHING_TYPE {
 668    MmNonCached = 0,
 669    MmCached = 1,
 670    MmWriteCombined = 2,
 671    MmHardwareCoherentCached = 3,
 672    MmNonCachedUnordered = 4,
 673    MmUSWCCached = 5,
 674    MmMaximumCacheType = 6
 675} ;
 676typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE;
 677enum _POOL_TYPE {
 678    NonPagedPool = 0,
 679    PagedPool = 1,
 680    NonPagedPoolMustSucceed = 2,
 681    DontUseThisType = 3,
 682    NonPagedPoolCacheAligned = 4,
 683    PagedPoolCacheAligned = 5,
 684    NonPagedPoolCacheAlignedMustS = 6,
 685    MaxPoolType = 7,
 686    NonPagedPoolSession = 32,
 687    PagedPoolSession = 33,
 688    NonPagedPoolMustSucceedSession = 34,
 689    DontUseThisTypeSession = 35,
 690    NonPagedPoolCacheAlignedSession = 36,
 691    PagedPoolCacheAlignedSession = 37,
 692    NonPagedPoolCacheAlignedMustSSession = 38
 693} ;
 694typedef enum _POOL_TYPE POOL_TYPE;
 695struct _FAST_MUTEX {
 696   LONG Count ;
 697   PKTHREAD Owner ;
 698   ULONG Contention ;
 699   KEVENT Event ;
 700   ULONG OldIrql ;
 701};
 702typedef struct _FAST_MUTEX *PFAST_MUTEX;
 703typedef ULONG_PTR ERESOURCE_THREAD;
 704union __anonunion____missing_field_name_38 {
 705   LONG OwnerCount ;
 706   ULONG TableSize ;
 707};
 708struct _OWNER_ENTRY {
 709   ERESOURCE_THREAD OwnerThread ;
 710   union __anonunion____missing_field_name_38 __annonCompField10 ;
 711};
 712typedef struct _OWNER_ENTRY OWNER_ENTRY;
 713typedef struct _OWNER_ENTRY *POWNER_ENTRY;
 714union __anonunion____missing_field_name_39 {
 715   PVOID Address ;
 716   ULONG_PTR CreatorBackTraceIndex ;
 717};
 718struct _ERESOURCE {
 719   LIST_ENTRY SystemResourcesList ;
 720   POWNER_ENTRY OwnerTable ;
 721   SHORT ActiveCount ;
 722   USHORT Flag ;
 723   PKSEMAPHORE SharedWaiters ;
 724   PKEVENT ExclusiveWaiters ;
 725   OWNER_ENTRY OwnerThreads[2] ;
 726   ULONG ContentionCount ;
 727   USHORT NumberOfSharedWaiters ;
 728   USHORT NumberOfExclusiveWaiters ;
 729   union __anonunion____missing_field_name_39 __annonCompField11 ;
 730   KSPIN_LOCK SpinLock ;
 731};
 732enum _MM_PAGE_PRIORITY {
 733    LowPagePriority = 0,
 734    NormalPagePriority = 16,
 735    HighPagePriority = 32
 736} ;
 737typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY;
 738struct _DRIVER_OBJECT;
 739struct _DRIVER_OBJECT;
 740struct _SECURITY_SUBJECT_CONTEXT {
 741   PACCESS_TOKEN ClientToken ;
 742   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 743   PACCESS_TOKEN PrimaryToken ;
 744   PVOID ProcessAuditId ;
 745};
 746typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT;
 747struct _INITIAL_PRIVILEGE_SET {
 748   ULONG PrivilegeCount ;
 749   ULONG Control ;
 750   LUID_AND_ATTRIBUTES Privilege[3] ;
 751};
 752typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET;
 753union __anonunion_Privileges_40 {
 754   INITIAL_PRIVILEGE_SET InitialPrivilegeSet ;
 755   PRIVILEGE_SET PrivilegeSet ;
 756};
 757struct _ACCESS_STATE {
 758   LUID OperationID ;
 759   BOOLEAN SecurityEvaluated ;
 760   BOOLEAN GenerateAudit ;
 761   BOOLEAN GenerateOnClose ;
 762   BOOLEAN PrivilegesAllocated ;
 763   ULONG Flags ;
 764   ACCESS_MASK RemainingDesiredAccess ;
 765   ACCESS_MASK PreviouslyGrantedAccess ;
 766   ACCESS_MASK OriginalDesiredAccess ;
 767   SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ;
 768   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 769   PVOID AuxData ;
 770   union __anonunion_Privileges_40 Privileges ;
 771   BOOLEAN AuditPrivileges ;
 772   UNICODE_STRING ObjectName ;
 773   UNICODE_STRING ObjectTypeName ;
 774};
 775typedef struct _ACCESS_STATE *PACCESS_STATE;
 776struct _DEVICE_OBJECT;
 777struct _DEVICE_OBJECT;
 778struct _DRIVER_OBJECT;
 779struct _FILE_OBJECT;
 780struct _FILE_OBJECT;
 781struct _IRP;
 782struct _IRP;
 783struct _SCSI_REQUEST_BLOCK;
 784struct _SCSI_REQUEST_BLOCK;
 785typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp );
 786struct _COMPRESSED_DATA_INFO;
 787struct _FAST_IO_DISPATCH {
 788   ULONG SizeOfFastIoDispatch ;
 789   BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 790                                    ULONG Length , BOOLEAN Wait , ULONG LockKey ,
 791                                    BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus ,
 792                                    struct _DEVICE_OBJECT *DeviceObject ) ;
 793   BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 794                         ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 795                         PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 796   BOOLEAN (*FastIoWrite)(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 (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 800                                   PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 801                                   struct _DEVICE_OBJECT *DeviceObject ) ;
 802   BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 803                                      PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 804                                      struct _DEVICE_OBJECT *DeviceObject ) ;
 805   BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 806                         PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 807                         BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus ,
 808                         struct _DEVICE_OBJECT *DeviceObject ) ;
 809   BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 810                                 PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 811                                 PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 812   BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId ,
 813                              PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 814   BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId ,
 815                                   ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 816   BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 817                                  PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
 818                                  ULONG OutputBufferLength , ULONG IoControlCode ,
 819                                  PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 820   void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 821   void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 822   void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ;
 823   BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 824                                         struct _FILE_NETWORK_OPEN_INFORMATION *Buffer ,
 825                                         struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 826   NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset ,
 827                                  struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ;
 828   BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 829                      ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 830                      struct _DEVICE_OBJECT *DeviceObject ) ;
 831   BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 832   BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 833                              ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 834                              struct _DEVICE_OBJECT *DeviceObject ) ;
 835   BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 836                               PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 837   BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 838                                   ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain ,
 839                                   PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 840                                   ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 841   BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 842                                    ULONG Length , ULONG LockKey , PVOID Buffer ,
 843                                    PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 844                                    ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 845   BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain ,
 846                                        struct _DEVICE_OBJECT *DeviceObject ) ;
 847   BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 848                                         PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 849   BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation ,
 850                              struct _DEVICE_OBJECT *DeviceObject ) ;
 851   NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease ,
 852                                  struct _DEVICE_OBJECT *DeviceObject ) ;
 853   NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 854   NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 855};
 856typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH;
 857enum _IO_ALLOCATION_ACTION {
 858    KeepObject = 1,
 859    DeallocateObject = 2,
 860    DeallocateObjectKeepRegisters = 3
 861} ;
 862typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION;
 863struct _IO_SECURITY_CONTEXT {
 864   PSECURITY_QUALITY_OF_SERVICE SecurityQos ;
 865   PACCESS_STATE AccessState ;
 866   ACCESS_MASK DesiredAccess ;
 867   ULONG FullCreateOptions ;
 868};
 869typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT;
 870struct _VPB {
 871   CSHORT Type ;
 872   CSHORT Size ;
 873   USHORT Flags ;
 874   USHORT VolumeLabelLength ;
 875   struct _DEVICE_OBJECT *DeviceObject ;
 876   struct _DEVICE_OBJECT *RealDevice ;
 877   ULONG SerialNumber ;
 878   ULONG ReferenceCount ;
 879   WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ;
 880};
 881typedef struct _VPB *PVPB;
 882struct _WAIT_CONTEXT_BLOCK {
 883   KDEVICE_QUEUE_ENTRY WaitQueueEntry ;
 884   IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ,
 885                                         PVOID MapRegisterBase , PVOID Context ) ;
 886   PVOID DeviceContext ;
 887   ULONG NumberOfMapRegisters ;
 888   PVOID DeviceObject ;
 889   PVOID CurrentIrp ;
 890   PKDPC BufferChainingDpc ;
 891};
 892typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK;
 893union __anonunion_Queue_43 {
 894   LIST_ENTRY ListEntry ;
 895   WAIT_CONTEXT_BLOCK Wcb ;
 896};
 897struct _DEVOBJ_EXTENSION;
 898struct _DEVICE_OBJECT {
 899   CSHORT Type ;
 900   USHORT Size ;
 901   LONG ReferenceCount ;
 902   struct _DRIVER_OBJECT *DriverObject ;
 903   struct _DEVICE_OBJECT *NextDevice ;
 904   struct _DEVICE_OBJECT *AttachedDevice ;
 905   struct _IRP *CurrentIrp ;
 906   PIO_TIMER Timer ;
 907   ULONG Flags ;
 908   ULONG Characteristics ;
 909   PVPB Vpb ;
 910   PVOID DeviceExtension ;
 911   ULONG DeviceType ;
 912   CCHAR StackSize ;
 913   union __anonunion_Queue_43 Queue ;
 914   ULONG AlignmentRequirement ;
 915   KDEVICE_QUEUE DeviceQueue ;
 916   KDPC Dpc ;
 917   ULONG ActiveThreadCount ;
 918   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 919   KEVENT DeviceLock ;
 920   USHORT SectorSize ;
 921   USHORT Spare1 ;
 922   struct _DEVOBJ_EXTENSION *DeviceObjectExtension ;
 923   PVOID Reserved ;
 924};
 925typedef struct _DEVICE_OBJECT DEVICE_OBJECT;
 926typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
 927struct _DEVOBJ_EXTENSION {
 928   CSHORT Type ;
 929   USHORT Size ;
 930   PDEVICE_OBJECT DeviceObject ;
 931};
 932struct _DRIVER_EXTENSION {
 933   struct _DRIVER_OBJECT *DriverObject ;
 934   NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ;
 935   ULONG Count ;
 936   UNICODE_STRING ServiceKeyName ;
 937};
 938typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION;
 939struct _DRIVER_OBJECT {
 940   CSHORT Type ;
 941   CSHORT Size ;
 942   PDEVICE_OBJECT DeviceObject ;
 943   ULONG Flags ;
 944   PVOID DriverStart ;
 945   ULONG DriverSize ;
 946   PVOID DriverSection ;
 947   PDRIVER_EXTENSION DriverExtension ;
 948   UNICODE_STRING DriverName ;
 949   PUNICODE_STRING HardwareDatabase ;
 950   PFAST_IO_DISPATCH FastIoDispatch ;
 951   NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ;
 952   void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
 953   void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ;
 954   PDRIVER_DISPATCH MajorFunction[28] ;
 955};
 956typedef struct _DRIVER_OBJECT DRIVER_OBJECT;
 957typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
 958struct _SECTION_OBJECT_POINTERS {
 959   PVOID DataSectionObject ;
 960   PVOID SharedCacheMap ;
 961   PVOID ImageSectionObject ;
 962};
 963typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS;
 964typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS;
 965struct _IO_COMPLETION_CONTEXT {
 966   PVOID Port ;
 967   PVOID Key ;
 968};
 969typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT;
 970struct _FILE_OBJECT {
 971   CSHORT Type ;
 972   CSHORT Size ;
 973   PDEVICE_OBJECT DeviceObject ;
 974   PVPB Vpb ;
 975   PVOID FsContext ;
 976   PVOID FsContext2 ;
 977   PSECTION_OBJECT_POINTERS SectionObjectPointer ;
 978   PVOID PrivateCacheMap ;
 979   NTSTATUS FinalStatus ;
 980   struct _FILE_OBJECT *RelatedFileObject ;
 981   BOOLEAN LockOperation ;
 982   BOOLEAN DeletePending ;
 983   BOOLEAN ReadAccess ;
 984   BOOLEAN WriteAccess ;
 985   BOOLEAN DeleteAccess ;
 986   BOOLEAN SharedRead ;
 987   BOOLEAN SharedWrite ;
 988   BOOLEAN SharedDelete ;
 989   ULONG Flags ;
 990   UNICODE_STRING FileName ;
 991   LARGE_INTEGER CurrentByteOffset ;
 992   ULONG Waiters ;
 993   ULONG Busy ;
 994   PVOID LastLock ;
 995   KEVENT Lock ;
 996   KEVENT Event ;
 997   PIO_COMPLETION_CONTEXT CompletionContext ;
 998};
 999typedef struct _FILE_OBJECT *PFILE_OBJECT;
1000union __anonunion_AssociatedIrp_44 {
1001   struct _IRP *MasterIrp ;
1002   LONG IrpCount ;
1003   PVOID SystemBuffer ;
1004};
1005struct __anonstruct_AsynchronousParameters_46 {
1006   void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock ,
1007                                                          ULONG Reserved ) ;
1008   PVOID UserApcContext ;
1009};
1010union __anonunion_Overlay_45 {
1011   struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ;
1012   LARGE_INTEGER AllocationSize ;
1013};
1014struct __anonstruct____missing_field_name_50 {
1015   PVOID DriverContext[4] ;
1016};
1017union __anonunion____missing_field_name_49 {
1018   KDEVICE_QUEUE_ENTRY DeviceQueueEntry ;
1019   struct __anonstruct____missing_field_name_50 __annonCompField14 ;
1020};
1021struct _IO_STACK_LOCATION;
1022union __anonunion____missing_field_name_52 {
1023   struct _IO_STACK_LOCATION *CurrentStackLocation ;
1024   ULONG PacketType ;
1025};
1026struct __anonstruct____missing_field_name_51 {
1027   LIST_ENTRY ListEntry ;
1028   union __anonunion____missing_field_name_52 __annonCompField16 ;
1029};
1030struct __anonstruct_Overlay_48 {
1031   union __anonunion____missing_field_name_49 __annonCompField15 ;
1032   PETHREAD Thread ;
1033   PCHAR AuxiliaryBuffer ;
1034   struct __anonstruct____missing_field_name_51 __annonCompField17 ;
1035   PFILE_OBJECT OriginalFileObject ;
1036};
1037union __anonunion_Tail_47 {
1038   struct __anonstruct_Overlay_48 Overlay ;
1039   KAPC Apc ;
1040   PVOID CompletionKey ;
1041};
1042struct _IRP {
1043   CSHORT Type ;
1044   USHORT Size ;
1045   PMDL MdlAddress ;
1046   ULONG Flags ;
1047   union __anonunion_AssociatedIrp_44 AssociatedIrp ;
1048   LIST_ENTRY ThreadListEntry ;
1049   IO_STATUS_BLOCK IoStatus ;
1050   KPROCESSOR_MODE RequestorMode ;
1051   BOOLEAN PendingReturned ;
1052   CHAR StackCount ;
1053   CHAR CurrentLocation ;
1054   BOOLEAN Cancel ;
1055   KIRQL CancelIrql ;
1056   CCHAR ApcEnvironment ;
1057   UCHAR AllocationFlags ;
1058   PIO_STATUS_BLOCK UserIosb ;
1059   PKEVENT UserEvent ;
1060   union __anonunion_Overlay_45 Overlay ;
1061   void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
1062   PVOID UserBuffer ;
1063   union __anonunion_Tail_47 Tail ;
1064};
1065typedef struct _IRP IRP;
1066typedef struct _IRP *PIRP;
1067enum _DEVICE_RELATION_TYPE {
1068    BusRelations = 0,
1069    EjectionRelations = 1,
1070    PowerRelations = 2,
1071    RemovalRelations = 3,
1072    TargetDeviceRelation = 4
1073} ;
1074typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE;
1075enum _DEVICE_USAGE_NOTIFICATION_TYPE {
1076    DeviceUsageTypeUndefined = 0,
1077    DeviceUsageTypePaging = 1,
1078    DeviceUsageTypeHibernation = 2,
1079    DeviceUsageTypeDumpFile = 3
1080} ;
1081typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE;
1082struct _INTERFACE {
1083   USHORT Size ;
1084   USHORT Version ;
1085   PVOID Context ;
1086   void (*InterfaceReference)(PVOID Context ) ;
1087   void (*InterfaceDereference)(PVOID Context ) ;
1088};
1089typedef struct _INTERFACE *PINTERFACE;
1090struct _DEVICE_CAPABILITIES {
1091   USHORT Size ;
1092   USHORT Version ;
1093   ULONG DeviceD1 : 1 ;
1094   ULONG DeviceD2 : 1 ;
1095   ULONG LockSupported : 1 ;
1096   ULONG EjectSupported : 1 ;
1097   ULONG Removable : 1 ;
1098   ULONG DockDevice : 1 ;
1099   ULONG UniqueID : 1 ;
1100   ULONG SilentInstall : 1 ;
1101   ULONG RawDeviceOK : 1 ;
1102   ULONG SurpriseRemovalOK : 1 ;
1103   ULONG WakeFromD0 : 1 ;
1104   ULONG WakeFromD1 : 1 ;
1105   ULONG WakeFromD2 : 1 ;
1106   ULONG WakeFromD3 : 1 ;
1107   ULONG HardwareDisabled : 1 ;
1108   ULONG NonDynamic : 1 ;
1109   ULONG WarmEjectSupported : 1 ;
1110   ULONG Reserved : 15 ;
1111   ULONG Address ;
1112   ULONG UINumber ;
1113   DEVICE_POWER_STATE DeviceState[7] ;
1114   SYSTEM_POWER_STATE SystemWake ;
1115   DEVICE_POWER_STATE DeviceWake ;
1116   ULONG D1Latency ;
1117   ULONG D2Latency ;
1118   ULONG D3Latency ;
1119};
1120typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES;
1121struct _POWER_SEQUENCE {
1122   ULONG SequenceD1 ;
1123   ULONG SequenceD2 ;
1124   ULONG SequenceD3 ;
1125};
1126typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE;
1127enum __anonenum_BUS_QUERY_ID_TYPE_53 {
1128    BusQueryDeviceID = 0,
1129    BusQueryHardwareIDs = 1,
1130    BusQueryCompatibleIDs = 2,
1131    BusQueryInstanceID = 3,
1132    BusQueryDeviceSerialNumber = 4
1133} ;
1134typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE;
1135enum __anonenum_DEVICE_TEXT_TYPE_54 {
1136    DeviceTextDescription = 0,
1137    DeviceTextLocationInformation = 1
1138} ;
1139typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE;
1140#pragma pack(push,4)
1141struct __anonstruct_Create_56 {
1142   PIO_SECURITY_CONTEXT SecurityContext ;
1143   ULONG Options ;
1144   USHORT FileAttributes ;
1145   USHORT ShareAccess ;
1146   ULONG EaLength ;
1147};
1148struct __anonstruct_Read_57 {
1149   ULONG Length ;
1150   ULONG Key ;
1151   LARGE_INTEGER ByteOffset ;
1152};
1153struct __anonstruct_Write_58 {
1154   ULONG Length ;
1155   ULONG Key ;
1156   LARGE_INTEGER ByteOffset ;
1157};
1158struct __anonstruct_QueryFile_59 {
1159   ULONG Length ;
1160   FILE_INFORMATION_CLASS FileInformationClass ;
1161};
1162struct __anonstruct____missing_field_name_62 {
1163   BOOLEAN ReplaceIfExists ;
1164   BOOLEAN AdvanceOnly ;
1165};
1166union __anonunion____missing_field_name_61 {
1167   struct __anonstruct____missing_field_name_62 __annonCompField18 ;
1168   ULONG ClusterCount ;
1169   HANDLE DeleteHandle ;
1170};
1171struct __anonstruct_SetFile_60 {
1172   ULONG Length ;
1173   FILE_INFORMATION_CLASS FileInformationClass ;
1174   PFILE_OBJECT FileObject ;
1175   union __anonunion____missing_field_name_61 __annonCompField19 ;
1176};
1177struct __anonstruct_QueryVolume_63 {
1178   ULONG Length ;
1179   FS_INFORMATION_CLASS FsInformationClass ;
1180};
1181struct __anonstruct_DeviceIoControl_64 {
1182   ULONG OutputBufferLength ;
1183   ULONG InputBufferLength ;
1184   ULONG IoControlCode ;
1185   PVOID Type3InputBuffer ;
1186};
1187struct __anonstruct_QuerySecurity_65 {
1188   SECURITY_INFORMATION SecurityInformation ;
1189   ULONG Length ;
1190};
1191struct __anonstruct_SetSecurity_66 {
1192   SECURITY_INFORMATION SecurityInformation ;
1193   PSECURITY_DESCRIPTOR SecurityDescriptor ;
1194};
1195struct __anonstruct_MountVolume_67 {
1196   PVPB Vpb ;
1197   PDEVICE_OBJECT DeviceObject ;
1198};
1199struct __anonstruct_VerifyVolume_68 {
1200   PVPB Vpb ;
1201   PDEVICE_OBJECT DeviceObject ;
1202};
1203struct __anonstruct_Scsi_69 {
1204   struct _SCSI_REQUEST_BLOCK *Srb ;
1205};
1206struct __anonstruct_QueryDeviceRelations_70 {
1207   DEVICE_RELATION_TYPE Type ;
1208};
1209struct __anonstruct_QueryInterface_71 {
1210   GUID const   *InterfaceType ;
1211   USHORT Size ;
1212   USHORT Version ;
1213   PINTERFACE Interface ;
1214   PVOID InterfaceSpecificData ;
1215};
1216struct __anonstruct_DeviceCapabilities_72 {
1217   PDEVICE_CAPABILITIES Capabilities ;
1218};
1219struct __anonstruct_FilterResourceRequirements_73 {
1220   PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ;
1221};
1222struct __anonstruct_ReadWriteConfig_74 {
1223   ULONG WhichSpace ;
1224   PVOID Buffer ;
1225   ULONG Offset ;
1226   ULONG Length ;
1227};
1228struct __anonstruct_SetLock_75 {
1229   BOOLEAN Lock ;
1230};
1231struct __anonstruct_QueryId_76 {
1232   BUS_QUERY_ID_TYPE IdType ;
1233};
1234struct __anonstruct_QueryDeviceText_77 {
1235   DEVICE_TEXT_TYPE DeviceTextType ;
1236   LCID LocaleId ;
1237};
1238struct __anonstruct_UsageNotification_78 {
1239   BOOLEAN InPath ;
1240   BOOLEAN Reserved[3] ;
1241   DEVICE_USAGE_NOTIFICATION_TYPE Type ;
1242};
1243struct __anonstruct_WaitWake_79 {
1244   SYSTEM_POWER_STATE PowerState ;
1245};
1246struct __anonstruct_PowerSequence_80 {
1247   PPOWER_SEQUENCE PowerSequence ;
1248};
1249struct __anonstruct_Power_81 {
1250   ULONG SystemContext ;
1251   POWER_STATE_TYPE Type ;
1252   POWER_STATE State ;
1253   POWER_ACTION ShutdownType ;
1254};
1255struct __anonstruct_StartDevice_82 {
1256   PCM_RESOURCE_LIST AllocatedResources ;
1257   PCM_RESOURCE_LIST AllocatedResourcesTranslated ;
1258};
1259struct __anonstruct_WMI_83 {
1260   ULONG_PTR ProviderId ;
1261   PVOID DataPath ;
1262   ULONG BufferSize ;
1263   PVOID Buffer ;
1264};
1265struct __anonstruct_Others_84 {
1266   PVOID Argument1 ;
1267   PVOID Argument2 ;
1268   PVOID Argument3 ;
1269   PVOID Argument4 ;
1270};
1271union __anonunion_Parameters_55 {
1272   struct __anonstruct_Create_56 Create ;
1273   struct __anonstruct_Read_57 Read ;
1274   struct __anonstruct_Write_58 Write ;
1275   struct __anonstruct_QueryFile_59 QueryFile ;
1276   struct __anonstruct_SetFile_60 SetFile ;
1277   struct __anonstruct_QueryVolume_63 QueryVolume ;
1278   struct __anonstruct_DeviceIoControl_64 DeviceIoControl ;
1279   struct __anonstruct_QuerySecurity_65 QuerySecurity ;
1280   struct __anonstruct_SetSecurity_66 SetSecurity ;
1281   struct __anonstruct_MountVolume_67 MountVolume ;
1282   struct __anonstruct_VerifyVolume_68 VerifyVolume ;
1283   struct __anonstruct_Scsi_69 Scsi ;
1284   struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ;
1285   struct __anonstruct_QueryInterface_71 QueryInterface ;
1286   struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ;
1287   struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ;
1288   struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ;
1289   struct __anonstruct_SetLock_75 SetLock ;
1290   struct __anonstruct_QueryId_76 QueryId ;
1291   struct __anonstruct_QueryDeviceText_77 QueryDeviceText ;
1292   struct __anonstruct_UsageNotification_78 UsageNotification ;
1293   struct __anonstruct_WaitWake_79 WaitWake ;
1294   struct __anonstruct_PowerSequence_80 PowerSequence ;
1295   struct __anonstruct_Power_81 Power ;
1296   struct __anonstruct_StartDevice_82 StartDevice ;
1297   struct __anonstruct_WMI_83 WMI ;
1298   struct __anonstruct_Others_84 Others ;
1299};
1300struct _IO_STACK_LOCATION {
1301   UCHAR MajorFunction ;
1302   UCHAR MinorFunction ;
1303   UCHAR Flags ;
1304   UCHAR Control ;
1305   union __anonunion_Parameters_55 Parameters ;
1306   PDEVICE_OBJECT DeviceObject ;
1307   PFILE_OBJECT FileObject ;
1308   NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
1309   PVOID Context ;
1310};
1311typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION;
1312typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION;
1313#pragma pack(pop)
1314struct _CONFIGURATION_INFORMATION {
1315   ULONG DiskCount ;
1316   ULONG FloppyCount ;
1317   ULONG CdRomCount ;
1318   ULONG TapeCount ;
1319   ULONG ScsiPortCount ;
1320   ULONG SerialCount ;
1321   ULONG ParallelCount ;
1322   BOOLEAN AtDiskPrimaryAddressClaimed ;
1323   BOOLEAN AtDiskSecondaryAddressClaimed ;
1324   ULONG Version ;
1325   ULONG MediumChangerCount ;
1326};
1327typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION;
1328typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION;
1329struct _OBJECT_HANDLE_INFORMATION {
1330   ULONG HandleAttributes ;
1331   ACCESS_MASK GrantedAccess ;
1332};
1333typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
1334struct _KEYBOARD_INPUT_DATA {
1335   USHORT UnitId ;
1336   USHORT MakeCode ;
1337   USHORT Flags ;
1338   USHORT Reserved ;
1339   ULONG ExtraInformation ;
1340};
1341typedef struct _KEYBOARD_INPUT_DATA *PKEYBOARD_INPUT_DATA;
1342struct _CONNECT_DATA {
1343   PDEVICE_OBJECT ClassDeviceObject ;
1344   PVOID ClassService ;
1345};
1346typedef struct _CONNECT_DATA CONNECT_DATA;
1347typedef struct _CONNECT_DATA *PCONNECT_DATA;
1348enum _TRANSMIT_STATE {
1349    Idle = 0,
1350    SendingBytes = 1
1351} ;
1352typedef enum _TRANSMIT_STATE TRANSMIT_STATE;
1353struct _OUTPUT_PACKET {
1354   PUCHAR Bytes ;
1355   ULONG CurrentByte ;
1356   ULONG ByteCount ;
1357   TRANSMIT_STATE State ;
1358};
1359typedef struct _OUTPUT_PACKET *POUTPUT_PACKET;
1360enum _KEYBOARD_SCAN_STATE {
1361    Normal = 0,
1362    GotE0 = 1,
1363    GotE1 = 2
1364} ;
1365typedef enum _KEYBOARD_SCAN_STATE *PKEYBOARD_SCAN_STATE;
1366struct _INTERNAL_I8042_HOOK_KEYBOARD {
1367   PVOID Context ;
1368   NTSTATUS (*InitializationRoutine)(PVOID InitializationContext , PVOID SynchFuncContext ,
1369                                     NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value ,
1370                                                          BOOLEAN WaitForACK ) , NTSTATUS (*WritePort)(PVOID Context ,
1371                                                                                                       UCHAR Value ,
1372                                                                                                       BOOLEAN WaitForACK ) ,
1373                                     PBOOLEAN TurnTranslationOn ) ;
1374   BOOLEAN (*IsrRoutine)(PVOID IsrContext , PKEYBOARD_INPUT_DATA CurrentInput , POUTPUT_PACKET CurrentOutput ,
1375                         UCHAR StatusByte , PUCHAR Byte , PBOOLEAN ContinueProcessing ,
1376                         PKEYBOARD_SCAN_STATE ScanState ) ;
1377   void (*IsrWritePort)(PVOID Context , UCHAR Value ) ;
1378   void (*QueueKeyboardPacket)(PVOID Context ) ;
1379   PVOID CallContext ;
1380};
1381typedef struct _INTERNAL_I8042_HOOK_KEYBOARD INTERNAL_I8042_HOOK_KEYBOARD;
1382typedef struct _INTERNAL_I8042_HOOK_KEYBOARD *PINTERNAL_I8042_HOOK_KEYBOARD;
1383struct _DEVICE_EXTENSION {
1384   PDEVICE_OBJECT Self ;
1385   PDEVICE_OBJECT PDO ;
1386   PDEVICE_OBJECT TopOfStack ;
1387   LONG EnableCount ;
1388   CONNECT_DATA UpperConnectData ;
1389   PVOID UpperContext ;
1390   NTSTATUS (*UpperInitializationRoutine)(PVOID InitializationContext , PVOID SynchFuncContext ,
1391                                          NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value ,
1392                                                               BOOLEAN WaitForACK ) ,
1393                                          NTSTATUS (*WritePort)(PVOID Context , UCHAR Value ,
1394                                                                BOOLEAN WaitForACK ) ,
1395                                          PBOOLEAN TurnTranslationOn ) ;
1396   BOOLEAN (*UpperIsrHook)(PVOID IsrContext , PKEYBOARD_INPUT_DATA CurrentInput ,
1397                           POUTPUT_PACKET CurrentOutput , UCHAR StatusByte , PUCHAR Byte ,
1398                           PBOOLEAN ContinueProcessing , PKEYBOARD_SCAN_STATE ScanState ) ;
1399   void (*IsrWritePort)(PVOID Context , UCHAR Value ) ;
1400   void (*QueueKeyboardPacket)(PVOID Context ) ;
1401   PVOID CallContext ;
1402   DEVICE_POWER_STATE DeviceState ;
1403   BOOLEAN Started ;
1404   BOOLEAN SurpriseRemoved ;
1405   BOOLEAN Removed ;
1406};
1407typedef struct _DEVICE_EXTENSION DEVICE_EXTENSION;
1408typedef struct _DEVICE_EXTENSION *PDEVICE_EXTENSION;
1409#pragma pack(push,8)
1410#pragma pack(pop)
1411struct _KAPC;
1412struct _KDPC;
1413#pragma pack(push,4)
1414#pragma pack(pop)
1415#pragma pack(push,4)
1416#pragma pack(pop)
1417#pragma pack(push,1)
1418#pragma pack(pop)
1419struct _DRIVER_OBJECT;
1420struct _DEVICE_OBJECT;
1421struct _DRIVER_OBJECT;
1422struct _FILE_OBJECT;
1423struct _IRP;
1424struct _SCSI_REQUEST_BLOCK;
1425#pragma pack(push,4)
1426#pragma pack(pop)
1427#pragma once
1428#pragma once
1429#pragma once
1430#pragma once
1431#pragma warning(push)
1432#pragma warning(disable:4035)
1433#pragma warning(pop)
1434#pragma once
1435extern void *memcpy(void * , void const   * , size_t  ) ;
1436extern void *memset(void * , int  , size_t  ) ;
1437#pragma warning(disable:4103)
1438#pragma warning(disable:4103)
1439  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
1440                                                                                                PCWSTR Path ,
1441                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
1442                                                                                                PVOID Context ,
1443                                                                                                PVOID Environment ) ;
1444  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
1445                                                                                                PCWSTR Path ,
1446                                                                                                PCWSTR ValueName ) ;
1447  void RtlInitString(PSTRING DestinationString ,
1448                                                                                   PCSZ SourceString ) ;
1449  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
1450                                                                                          PCWSTR SourceString ) ;
1451  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
1452                                                                                                      PANSI_STRING SourceString ,
1453                                                                                                      BOOLEAN AllocateDestinationString ) ;
1454  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
1455                                                                                          PUNICODE_STRING SourceString ) ;
1456  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
1457  SIZE_T RtlCompareMemory(void const   *Source1 ,
1458                                                                                        void const   *Source2 ,
1459                                                                                        SIZE_T Length ) ;
1460#pragma warning(push)
1461#pragma warning(disable:4035)
1462#pragma warning(pop)
1463extern   LONG InterlockedIncrement(PLONG Addend ) ;
1464extern   LONG InterlockedDecrement(PLONG Addend ) ;
1465#pragma warning(disable:4035)
1466#pragma warning(push)
1467#pragma warning(disable:4164)
1468#pragma function(_enable)
1469#pragma function(_disable)
1470#pragma warning(pop)
1471#pragma warning(disable:4103)
1472#pragma warning(disable:4103)
1473#pragma warning(disable:4103)
1474#pragma warning(disable:4103)
1475  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
1476                                                       BOOLEAN State ) ;
1477  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
1478                                                BOOLEAN Wait ) ;
1479  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
1480                                                           LONG Count , LONG Limit ) ;
1481  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
1482                                                        LONG Adjustment , BOOLEAN Wait ) ;
1483  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
1484                                                                BOOLEAN Alertable ,
1485                                                                PLARGE_INTEGER Interval ) ;
1486  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
1487                                                               KPROCESSOR_MODE WaitMode ,
1488                                                               BOOLEAN Alertable ,
1489                                                               PLARGE_INTEGER Timeout ) ;
1490  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
1491  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
1492                                                                                        KIRQL NewIrql ) ;
1493  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
1494                                                                                            SIZE_T NumberOfBytes ,
1495                                                                                            ULONG Tag ) ;
1496  void ExFreePool(PVOID P ) ;
1497  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
1498  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
1499  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
1500                                                                                                          PLIST_ENTRY ListEntry ,
1501                                                                                                          PKSPIN_LOCK Lock ) ;
1502  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
1503                                                                                                          PLIST_ENTRY ListEntry ,
1504                                                                                                          PKSPIN_LOCK Lock ) ;
1505  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
1506                                                                                                          PKSPIN_LOCK Lock ) ;
1507  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
1508  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
1509                                                                   KPROCESSOR_MODE AccessMode ,
1510                                                                   MEMORY_CACHING_TYPE CacheType ,
1511                                                                   PVOID BaseAddress ,
1512                                                                   ULONG BugCheckOnFailure ,
1513                                                                   MM_PAGE_PRIORITY Priority ) ;
1514  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
1515                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
1516  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
1517  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
1518  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
1519  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
1520                                                              ULONG DesiredAccess ,
1521                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
1522                                                              HANDLE ProcessHandle ,
1523                                                              PCLIENT_ID ClientId ,
1524                                                              void (*StartRoutine)(PVOID StartContext ) ,
1525                                                              PVOID StartContext ) ;
1526  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
1527#pragma warning(disable:4103)
1528#pragma warning(disable:4103)
1529  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
1530                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
1531                                                   PIRP Irp ) ;
1532  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
1533                                                                           PDEVICE_OBJECT TargetDevice ) ;
1534  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
1535                                                                   PDEVICE_OBJECT DeviceObject ,
1536                                                                   PVOID Buffer ,
1537                                                                   ULONG Length ,
1538                                                                   PLARGE_INTEGER StartingOffset ,
1539                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
1540  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
1541                                                                   PDEVICE_OBJECT DeviceObject ,
1542                                                                   PVOID InputBuffer ,
1543                                                                   ULONG InputBufferLength ,
1544                                                                   PVOID OutputBuffer ,
1545                                                                   ULONG OutputBufferLength ,
1546                                                                   BOOLEAN InternalDeviceIoControl ,
1547                                                                   PKEVENT Event ,
1548                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
1549  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
1550                                                                                        PIRP Irp ) ;
1551  void IofCompleteRequest(PIRP Irp ,
1552                                                                                         CCHAR PriorityBoost ) ;
1553  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
1554                                                        ULONG DeviceExtensionSize ,
1555                                                        PUNICODE_STRING DeviceName ,
1556                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
1557                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
1558  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
1559                                                              PUNICODE_STRING DeviceName ) ;
1560  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
1561  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
1562  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
1563  void IoFreeIrp(PIRP Irp ) ;
1564  void IoFreeMdl(PMDL Mdl ) ;
1565  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
1566  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
1567                                                                  PULONG BusNumber ,
1568                                                                  PCONFIGURATION_TYPE ControllerType ,
1569                                                                  PULONG ControllerNumber ,
1570                                                                  PCONFIGURATION_TYPE PeripheralType ,
1571                                                                  PULONG PeripheralNumber ,
1572                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
1573                                                                                             PUNICODE_STRING PathName ,
1574                                                                                             INTERFACE_TYPE BusType ,
1575                                                                                             ULONG BusNumber ,
1576                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
1577                                                                                             CONFIGURATION_TYPE ControllerType ,
1578                                                                                             ULONG ControllerNumber ,
1579                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
1580                                                                                             CONFIGURATION_TYPE PeripheralType ,
1581                                                                                             ULONG PeripheralNumber ,
1582                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
1583                                                                  PVOID Context ) ;
1584  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
1585  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
1586  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
1587                                                                                                   GUID const   *InterfaceClassGuid ,
1588                                                                                                   PUNICODE_STRING ReferenceString ,
1589                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
1590  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
1591                                                                   BOOLEAN Enable ) ;
1592#pragma warning(disable:4200)
1593#pragma warning(default:4200)
1594  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
1595                                                      PIRP Irp ) ;
1596  void PoStartNextPowerIrp(PIRP Irp ) ;
1597  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
1598                                                                   ACCESS_MASK DesiredAccess ,
1599                                                                   POBJECT_TYPE ObjectType ,
1600                                                                   KPROCESSOR_MODE AccessMode ,
1601                                                                   PVOID *Object ,
1602                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
1603  void ObfDereferenceObject(PVOID Object ) ;
1604  NTSTATUS ZwClose(HANDLE Handle ) ;
1605#pragma once
1606#pragma once
1607#pragma once
1608NTSTATUS KbFilter_AddDevice(PDRIVER_OBJECT Driver , PDEVICE_OBJECT PDO ) ;
1609NTSTATUS KbFilter_CreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
1610NTSTATUS KbFilter_DispatchPassThrough(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
1611NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
1612extern NTSTATUS KbFilter_IoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
1613NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
1614NTSTATUS KbFilter_Power(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
1615NTSTATUS KbFilter_InitializationRoutine(PDEVICE_OBJECT DeviceObject , PVOID SynchFuncContext ,
1616                                        NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value ,
1617                                                             BOOLEAN WaitForACK ) ,
1618                                        NTSTATUS (*WritePort)(PVOID Context , UCHAR Value ,
1619                                                              BOOLEAN WaitForACK ) ,
1620                                        PBOOLEAN TurnTranslationOn ) ;
1621BOOLEAN KbFilter_IsrHook(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA CurrentInput ,
1622                         POUTPUT_PACKET CurrentOutput , UCHAR StatusByte , PUCHAR DataByte ,
1623                         PBOOLEAN ContinueProcessing , PKEYBOARD_SCAN_STATE ScanState ) ;
1624void KbFilter_ServiceCallback(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA InputDataStart ,
1625                              PKEYBOARD_INPUT_DATA InputDataEnd , PULONG InputDataConsumed ) ;
1626void KbFilter_Unload(PDRIVER_OBJECT Driver ) ;
1627NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ;
1628#pragma alloc_text(INIT,DriverEntry)
1629#pragma alloc_text(PAGE,KbFilter_AddDevice)
1630#pragma alloc_text(PAGE,KbFilter_CreateClose)
1631#pragma alloc_text(PAGE,KbFilter_IoCtl)
1632#pragma alloc_text(PAGE,KbFilter_InternIoCtl)
1633#pragma alloc_text(PAGE,KbFilter_Unload)
1634#pragma alloc_text(PAGE,KbFilter_DispatchPassThrough)
1635#pragma alloc_text(PAGE,KbFilter_PnP)
1636#pragma alloc_text(PAGE,KbFilter_Power)
1637void errorFn(void) 
1638{ 
1639
1640  {
1641  ERROR: 
1642  goto ERROR;
1643}
1644}
1645int s  ;
1646int UNLOADED  ;
1647int NP  ;
1648int DC  ;
1649int SKIP1  ;
1650int SKIP2  ;
1651int MPR1  ;
1652int MPR3  ;
1653int IPC  ;
1654int pended  ;
1655NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context )  ;
1656int compRegistered  ;
1657int lowerDriverReturn  ;
1658int setEventCalled  ;
1659int customIrp  ;
1660int myStatus  ;
1661void _BLAST_init(void) 
1662{ 
1663
1664  {
1665  UNLOADED = 0;
1666  NP = 1;
1667  DC = 2;
1668  SKIP1 = 3;
1669  SKIP2 = 4;
1670  MPR1 = 5;
1671  MPR3 = 6;
1672  IPC = 7;
1673  s = UNLOADED;
1674  pended = 0;
1675  compFptr = 0;
1676  compRegistered = 0;
1677  lowerDriverReturn = 0;
1678  setEventCalled = 0;
1679  customIrp = 0;
1680  return;
1681}
1682}
1683NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) 
1684{ ULONG i = __VERIFIER_nondet_long() ;
1685
1686  {
1687  DriverObject->MajorFunction[i] = & KbFilter_DispatchPassThrough;
1688  DriverObject->MajorFunction[0] = & KbFilter_CreateClose;
1689  DriverObject->MajorFunction[2] = & KbFilter_CreateClose;
1690  DriverObject->MajorFunction[27] = & KbFilter_PnP;
1691  DriverObject->MajorFunction[22] = & KbFilter_Power;
1692  DriverObject->MajorFunction[15] = & KbFilter_InternIoCtl;
1693  DriverObject->DriverUnload = & KbFilter_Unload;
1694  (DriverObject->DriverExtension)->AddDevice = & KbFilter_AddDevice;
1695  return (0L);
1696}
1697}
1698NTSTATUS KbFilter_AddDevice(PDRIVER_OBJECT Driver , PDEVICE_OBJECT PDO ) 
1699{ PDEVICE_EXTENSION devExt ;
1700  PDEVICE_OBJECT device ;
1701  NTSTATUS status ;
1702
1703  {
1704  {
1705  status = 0L;
1706  status = IoCreateDevice(Driver, sizeof(DEVICE_EXTENSION ), (void *)0, 11, 0, 0,
1707                          & device);
1708  }
1709  if (! (status >= 0L)) {
1710    return (status);
1711  } else {
1712
1713  }
1714  {
1715  memset(device->DeviceExtension, 0, sizeof(DEVICE_EXTENSION ));
1716  devExt = (struct _DEVICE_EXTENSION *)device->DeviceExtension;
1717  devExt->TopOfStack = IoAttachDeviceToDeviceStack(device, PDO);
1718  devExt->Self = device;
1719  devExt->PDO = PDO;
1720  devExt->DeviceState = 1;
1721  devExt->SurpriseRemoved = 0;
1722  devExt->Removed = 0;
1723  devExt->Started = 0;
1724  device->Flags |= 8196UL;
1725  device->Flags &= 4294967167UL;
1726  }
1727  return (status);
1728}
1729}
1730NTSTATUS KbFilter_Complete(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) 
1731{ PKEVENT event ;
1732
1733  {
1734  {
1735  event = (struct _KEVENT *)Context;
1736  KeSetEvent(event, 0, 0);
1737  }
1738  return (-1073741802L);
1739}
1740}
1741NTSTATUS KbFilter_CreateClose(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
1742{ PIO_STACK_LOCATION irpStack ;
1743  NTSTATUS status ;
1744  PDEVICE_EXTENSION devExt ;
1745  LONG tmp ;
1746  LONG tmp___0 ;
1747  NTSTATUS tmp___1 ;
1748
1749  {
1750  irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
1751  devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
1752  status = Irp->IoStatus.__annonCompField4.Status;
1753  status = myStatus;
1754  if (irpStack->MajorFunction == 0) {
1755    goto switch_0_0;
1756  } else {
1757    if (irpStack->MajorFunction == 2) {
1758      goto switch_0_2;
1759    } else {
1760      if (0) {
1761        switch_0_0: /* CIL Label */ ;
1762        if ((unsigned int )((void *)0) == (unsigned int )devExt->UpperConnectData.ClassService) {
1763          status = -1073741436L;
1764        } else {
1765          {
1766          tmp = InterlockedIncrement(& devExt->EnableCount);
1767          }
1768          if (1L == tmp) {
1769
1770          } else {
1771
1772          }
1773        }
1774        goto switch_0_break;
1775        switch_0_2: /* CIL Label */ 
1776        {
1777        tmp___0 = InterlockedDecrement(& devExt->EnableCount);
1778        }
1779        if (0L == tmp___0) {
1780
1781        } else {
1782
1783        }
1784        goto switch_0_break;
1785      } else {
1786        switch_0_break: /* CIL Label */ ;
1787      }
1788    }
1789  }
1790  {
1791  Irp->IoStatus.__annonCompField4.Status = status;
1792  myStatus = status;
1793  tmp___1 = KbFilter_DispatchPassThrough(DeviceObject, Irp);
1794  }
1795  return (tmp___1);
1796}
1797}
1798NTSTATUS KbFilter_DispatchPassThrough(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
1799{ PIO_STACK_LOCATION irpStack ;
1800  NTSTATUS tmp ;
1801
1802  {
1803  irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
1804  if (s == NP) {
1805    s = SKIP1;
1806  } else {
1807    {
1808    errorFn();
1809    }
1810  }
1811  {
1812  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
1813  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
1814  tmp = IofCallDriver(((struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension)->TopOfStack,
1815                      Irp);
1816  }
1817  return (tmp);
1818}
1819}
1820NTSTATUS KbFilter_InternIoCtl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
1821{ PIO_STACK_LOCATION irpStack ;
1822  PDEVICE_EXTENSION devExt ;
1823  PINTERNAL_I8042_HOOK_KEYBOARD hookKeyboard ;
1824  PCONNECT_DATA connectData ;
1825  NTSTATUS status ;
1826  NTSTATUS tmp ;
1827
1828  {
1829  status = 0L;
1830  devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
1831  Irp->IoStatus.Information = 0;
1832  irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
1833  if (irpStack->Parameters.DeviceIoControl.IoControlCode == (((11 << 16) | (128 << 2)) | 3)) {
1834    goto switch_1_exp_0;
1835  } else {
1836    if (irpStack->Parameters.DeviceIoControl.IoControlCode == (((11 << 16) | (256 << 2)) | 3)) {
1837      goto switch_1_exp_1;
1838    } else {
1839      if (irpStack->Parameters.DeviceIoControl.IoControlCode == (((11 << 16) | (4080 << 2)) | 3)) {
1840        goto switch_1_exp_2;
1841      } else {
1842        if (irpStack->Parameters.DeviceIoControl.IoControlCode == 11 << 16) {
1843          goto switch_1_exp_3;
1844        } else {
1845          if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (32 << 2))) {
1846            goto switch_1_exp_4;
1847          } else {
1848            if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (16 << 2))) {
1849              goto switch_1_exp_5;
1850            } else {
1851              if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (2 << 2))) {
1852                goto switch_1_exp_6;
1853              } else {
1854                if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (8 << 2))) {
1855                  goto switch_1_exp_7;
1856                } else {
1857                  if (irpStack->Parameters.DeviceIoControl.IoControlCode == ((11 << 16) | (1 << 2))) {
1858                    goto switch_1_exp_8;
1859                  } else {
1860                    if (0) {
1861                      switch_1_exp_0: /* CIL Label */ ;
1862                      if ((unsigned int )devExt->UpperConnectData.ClassService != (unsigned int )((void *)0)) {
1863                        status = -1073741757L;
1864                        goto switch_1_break;
1865                      } else {
1866                        if (irpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CONNECT_DATA )) {
1867                          status = -1073741811L;
1868                          goto switch_1_break;
1869                        } else {
1870
1871                        }
1872                      }
1873                      connectData = (struct _CONNECT_DATA *)irpStack->Parameters.DeviceIoControl.Type3InputBuffer;
1874                      devExt->UpperConnectData = *connectData;
1875                      connectData->ClassDeviceObject = devExt->Self;
1876                      connectData->ClassService = & KbFilter_ServiceCallback;
1877                      goto switch_1_break;
1878                      switch_1_exp_1: /* CIL Label */ 
1879                      status = -1073741822L;
1880                      goto switch_1_break;
1881                      switch_1_exp_2: /* CIL Label */ ;
1882                      if (irpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(INTERNAL_I8042_HOOK_KEYBOARD )) {
1883                        status = -1073741811L;
1884                        goto switch_1_break;
1885                      } else {
1886
1887                      }
1888                      hookKeyboard = (struct _INTERNAL_I8042_HOOK_KEYBOARD *)irpStack->Parameters.DeviceIoControl.Type3InputBuffer;
1889                      devExt->UpperContext = hookKeyboard->Context;
1890                      hookKeyboard->Context = (void *)DeviceObject;
1891                      if (hookKeyboard->InitializationRoutine) {
1892                        devExt->UpperInitializationRoutine = hookKeyboard->InitializationRoutine;
1893                      } else {
1894
1895                      }
1896                      hookKeyboard->InitializationRoutine = (NTSTATUS (*)(PVOID InitializationContext ,
1897                                                                          PVOID SynchFuncContext ,
1898                                                                          NTSTATUS (*ReadPort)(PVOID Context ,
1899                                                                                               PUCHAR Value ,
1900                                                                                               BOOLEAN WaitForACK ) ,
1901                                                                          NTSTATUS (*WritePort)(PVOID Context ,
1902                                                                                                UCHAR Value ,
1903                                                                                                BOOLEAN WaitForACK ) ,
1904                                                                          PBOOLEAN TurnTranslationOn ))(& KbFilter_InitializationRoutine);
1905                      if (hookKeyboard->IsrRoutine) {
1906                        devExt->UpperIsrHook = hookKeyboard->IsrRoutine;
1907                      } else {
1908
1909                      }
1910                      hookKeyboard->IsrRoutine = (BOOLEAN (*)(PVOID IsrContext , PKEYBOARD_INPUT_DATA CurrentInput ,
1911                                                              POUTPUT_PACKET CurrentOutput ,
1912                                                              UCHAR StatusByte , PUCHAR Byte ,
1913                                                              PBOOLEAN ContinueProcessing ,
1914                                                              PKEYBOARD_SCAN_STATE ScanState ))(& KbFilter_IsrHook);
1915                      devExt->IsrWritePort = hookKeyboard->IsrWritePort;
1916                      devExt->QueueKeyboardPacket = hookKeyboard->QueueKeyboardPacket;
1917                      devExt->CallContext = hookKeyboard->CallContext;
1918                      status = 0L;
1919                      goto switch_1_break;
1920                      switch_1_exp_3: /* CIL Label */ ;
1921                      switch_1_exp_4: /* CIL Label */ ;
1922                      switch_1_exp_5: /* CIL Label */ ;
1923                      switch_1_exp_6: /* CIL Label */ ;
1924                      switch_1_exp_7: /* CIL Label */ ;
1925                      switch_1_exp_8: /* CIL Label */ ;
1926                      goto switch_1_break;
1927                    } else {
1928                      switch_1_break: /* CIL Label */ ;
1929                    }
1930                  }
1931                }
1932              }
1933            }
1934          }
1935        }
1936      }
1937    }
1938  }
1939  if (! (status >= 0L)) {
1940    {
1941    Irp->IoStatus.__annonCompField4.Status = status;
1942    myStatus = status;
1943    IofCompleteRequest(Irp, 0);
1944    }
1945    return (status);
1946  } else {
1947
1948  }
1949  {
1950  tmp = KbFilter_DispatchPassThrough(DeviceObject, Irp);
1951  }
1952  return (tmp);
1953}
1954}
1955NTSTATUS KbFilter_PnP(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
1956{ PDEVICE_EXTENSION devExt ;
1957  PIO_STACK_LOCATION irpStack ;
1958  NTSTATUS status ;
1959  KEVENT event ;
1960  PIO_STACK_LOCATION irpSp ;
1961  PIO_STACK_LOCATION nextIrpSp ;
1962  PIO_STACK_LOCATION irpSp___0 ;
1963
1964  {
1965  status = 0L;
1966  devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
1967  irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
1968  if (irpStack->MinorFunction == 0) {
1969    goto switch_2_0;
1970  } else {
1971    if (irpStack->MinorFunction == 23) {
1972      goto switch_2_23;
1973    } else {
1974      if (irpStack->MinorFunction == 2) {
1975        goto switch_2_2;
1976      } else {
1977        if (irpStack->MinorFunction == 1) {
1978          goto switch_2_1;
1979        } else {
1980          if (irpStack->MinorFunction == 5) {
1981            goto switch_2_5;
1982          } else {
1983            if (irpStack->MinorFunction == 3) {
1984              goto switch_2_3;
1985            } else {
1986              if (irpStack->MinorFunction == 6) {
1987                goto switch_2_6;
1988              } else {
1989                if (irpStack->MinorFunction == 13) {
1990                  goto switch_2_13;
1991                } else {
1992                  if (irpStack->MinorFunction == 4) {
1993                    goto switch_2_4;
1994                  } else {
1995                    if (irpStack->MinorFunction == 7) {
1996                      goto switch_2_7;
1997                    } else {
1998                      if (irpStack->MinorFunction == 8) {
1999                        goto switch_2_8;
2000                      } else {
2001                        if (irpStack->MinorFunction == 9) {
2002                          goto switch_2_9;
2003                        } else {
2004                          if (irpStack->MinorFunction == 12) {
2005                            goto switch_2_12;
2006                          } else {
2007                            if (irpStack->MinorFunction == 10) {
2008                              goto switch_2_10;
2009                            } else {
2010                              if (irpStack->MinorFunction == 11) {
2011                                goto switch_2_11;
2012                              } else {
2013                                if (irpStack->MinorFunction == 15) {
2014                                  goto switch_2_15;
2015                                } else {
2016                                  if (irpStack->MinorFunction == 16) {
2017                                    goto switch_2_16;
2018                                  } else {
2019                                    if (irpStack->MinorFunction == 17) {
2020                                      goto switch_2_17;
2021                                    } else {
2022                                      if (irpStack->MinorFunction == 18) {
2023                                        goto switch_2_18;
2024                                      } else {
2025                                        if (irpStack->MinorFunction == 19) {
2026                                          goto switch_2_19;
2027                                        } else {
2028                                          if (irpStack->MinorFunction == 20) {
2029                                            goto switch_2_20;
2030                                          } else {
2031                                            {
2032                                            goto switch_2_default;
2033                                            if (0) {
2034                                              switch_2_0: /* CIL Label */ 
2035                                              {
2036                                              irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2037                                              nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
2038                                              memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine));
2039                                              nextIrpSp->Control = 0;
2040/*                                               KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2041                                              }
2042                                              if (s != NP) {
2043                                                {
2044                                                errorFn();
2045                                                }
2046                                              } else {
2047                                                if (compRegistered != 0) {
2048                                                  {
2049                                                  errorFn();
2050                                                  }
2051                                                } else {
2052                                                  compRegistered = 1;
2053                                                  compFptr = & KbFilter_Complete;
2054                                                }
2055                                              }
2056                                              {
2057                                              irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
2058                                              irpSp___0->CompletionRoutine = & KbFilter_Complete;
2059                                              irpSp___0->Context = & event;
2060                                              irpSp___0->Control = 0;
2061                                              irpSp___0->Control = 64;
2062                                              irpSp___0->Control = (int )irpSp___0->Control | 128;
2063                                              irpSp___0->Control = (int )irpSp___0->Control | 32;
2064                                              status = IofCallDriver(devExt->TopOfStack,
2065                                                                     Irp);
2066                                              }
2067                                              if (259L == status) {
2068                                                {
2069                                                KeWaitForSingleObject(& event, 0,
2070                                                                      0, 0, (void *)0);
2071                                                }
2072                                              } else {
2073
2074                                              }
2075                                              if (status >= 0L) {
2076                                                if ((long )myStatus >= 0L) {
2077                                                  devExt->Started = 1;
2078                                                  devExt->Removed = 0;
2079                                                  devExt->SurpriseRemoved = 0;
2080                                                } else {
2081
2082                                                }
2083                                              } else {
2084
2085                                              }
2086                                              {
2087                                              Irp->IoStatus.__annonCompField4.Status = status;
2088                                              myStatus = status;
2089                                              Irp->IoStatus.Information = 0;
2090                                              IofCompleteRequest(Irp, 0);
2091                                              }
2092                                              goto switch_2_break;
2093                                              switch_2_23: /* CIL Label */ 
2094                                              devExt->SurpriseRemoved = 1;
2095                                              if (s == NP) {
2096                                                s = SKIP1;
2097                                              } else {
2098                                                {
2099                                                errorFn();
2100                                                }
2101                                              }
2102                                              {
2103                                              Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2104                                              Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2105                                              status = IofCallDriver(devExt->TopOfStack,
2106                                                                     Irp);
2107                                              }
2108                                              goto switch_2_break;
2109                                              switch_2_2: /* CIL Label */ 
2110                                              devExt->Removed = 1;
2111                                              if (s == NP) {
2112                                                s = SKIP1;
2113                                              } else {
2114                                                {
2115                                                errorFn();
2116                                                }
2117                                              }
2118                                              {
2119                                              Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2120                                              Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2121                                              IofCallDriver(devExt->TopOfStack, Irp);
2122/*                                               IoDetachDevice(devExt->TopOfStack); */ /* INLINED */
2123/*                                               IoDeleteDevice(DeviceObject); */ /* INLINED */
2124                                              status = 0L;
2125                                              }
2126                                              goto switch_2_break;
2127                                              switch_2_1: /* CIL Label */ ;
2128                                              switch_2_5: /* CIL Label */ ;
2129                                              switch_2_3: /* CIL Label */ ;
2130                                              switch_2_6: /* CIL Label */ ;
2131                                              switch_2_13: /* CIL Label */ ;
2132                                              switch_2_4: /* CIL Label */ ;
2133                                              switch_2_7: /* CIL Label */ ;
2134                                              switch_2_8: /* CIL Label */ ;
2135                                              switch_2_9: /* CIL Label */ ;
2136                                              switch_2_12: /* CIL Label */ ;
2137                                              switch_2_10: /* CIL Label */ ;
2138                                              switch_2_11: /* CIL Label */ ;
2139                                              switch_2_15: /* CIL Label */ ;
2140                                              switch_2_16: /* CIL Label */ ;
2141                                              switch_2_17: /* CIL Label */ ;
2142                                              switch_2_18: /* CIL Label */ ;
2143                                              switch_2_19: /* CIL Label */ ;
2144                                              switch_2_20: /* CIL Label */ ;
2145                                              switch_2_default: /* CIL Label */ ;
2146                                              if (s == NP) {
2147                                                s = SKIP1;
2148                                              } else {
2149                                                {
2150                                                errorFn();
2151                                                }
2152                                              }
2153                                              {
2154                                              Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2155                                              Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2156                                              status = IofCallDriver(devExt->TopOfStack,
2157                                                                     Irp);
2158                                              }
2159                                              goto switch_2_break;
2160                                            } else {
2161                                              switch_2_break: /* CIL Label */ ;
2162                                            }
2163                                            }
2164                                          }
2165                                        }
2166                                      }
2167                                    }
2168                                  }
2169                                }
2170                              }
2171                            }
2172                          }
2173                        }
2174                      }
2175                    }
2176                  }
2177                }
2178              }
2179            }
2180          }
2181        }
2182      }
2183    }
2184  }
2185  return (status);
2186}
2187}
2188NTSTATUS KbFilter_Power(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
2189{ PIO_STACK_LOCATION irpStack ;
2190  PDEVICE_EXTENSION devExt ;
2191  POWER_STATE powerState ;
2192  POWER_STATE_TYPE powerType ;
2193  NTSTATUS tmp ;
2194
2195  {
2196  devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2197  irpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
2198  powerType = irpStack->Parameters.Power.Type;
2199  powerState = irpStack->Parameters.Power.State;
2200  if (irpStack->MinorFunction == 2) {
2201    goto switch_3_2;
2202  } else {
2203    if (irpStack->MinorFunction == 1) {
2204      goto switch_3_1;
2205    } else {
2206      if (irpStack->MinorFunction == 0) {
2207        goto switch_3_0;
2208      } else {
2209        if (irpStack->MinorFunction == 3) {
2210          goto switch_3_3;
2211        } else {
2212          {
2213          goto switch_3_default;
2214          if (0) {
2215            switch_3_2: /* CIL Label */ ;
2216            if ((int )powerType == 1) {
2217              devExt->DeviceState = powerState.DeviceState;
2218            } else {
2219
2220            }
2221            switch_3_1: /* CIL Label */ ;
2222            switch_3_0: /* CIL Label */ ;
2223            switch_3_3: /* CIL Label */ ;
2224            switch_3_default: /* CIL Label */ ;
2225            goto switch_3_break;
2226          } else {
2227            switch_3_break: /* CIL Label */ ;
2228          }
2229          }
2230        }
2231      }
2232    }
2233  }
2234  {
2235/*   PoStartNextPowerIrp(Irp); */ /* INLINED */
2236  }
2237  if (s == NP) {
2238    s = SKIP1;
2239  } else {
2240    {
2241    errorFn();
2242    }
2243  }
2244  {
2245  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
2246  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
2247  tmp = PoCallDriver(devExt->TopOfStack, Irp);
2248  }
2249  return (tmp);
2250}
2251}
2252NTSTATUS KbFilter_InitializationRoutine(PDEVICE_OBJECT DeviceObject , PVOID SynchFuncContext ,
2253                                        NTSTATUS (*ReadPort)(PVOID Context , PUCHAR Value ,
2254                                                             BOOLEAN WaitForACK ) ,
2255                                        NTSTATUS (*WritePort)(PVOID Context , UCHAR Value ,
2256                                                              BOOLEAN WaitForACK ) ,
2257                                        PBOOLEAN TurnTranslationOn ) 
2258{ PDEVICE_EXTENSION devExt ;
2259  NTSTATUS status ;
2260
2261  {
2262  status = 0L;
2263  devExt = DeviceObject->DeviceExtension;
2264  if (devExt->UpperInitializationRoutine) {
2265    {
2266    status = (*(devExt->UpperInitializationRoutine))(devExt->UpperContext, SynchFuncContext,
2267                                                     ReadPort, WritePort, TurnTranslationOn);
2268    }
2269    if (! (status >= 0L)) {
2270      return (status);
2271    } else {
2272
2273    }
2274  } else {
2275
2276  }
2277  *TurnTranslationOn = 1;
2278  return (status);
2279}
2280}
2281BOOLEAN KbFilter_IsrHook(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA CurrentInput ,
2282                         POUTPUT_PACKET CurrentOutput , UCHAR StatusByte , PUCHAR DataByte ,
2283                         PBOOLEAN ContinueProcessing , PKEYBOARD_SCAN_STATE ScanState ) 
2284{ PDEVICE_EXTENSION devExt ;
2285  BOOLEAN retVal ;
2286
2287  {
2288  retVal = 1;
2289  devExt = DeviceObject->DeviceExtension;
2290  if (devExt->UpperIsrHook) {
2291    {
2292    retVal = (*(devExt->UpperIsrHook))(devExt->UpperContext, CurrentInput, CurrentOutput,
2293                                       StatusByte, DataByte, ContinueProcessing, ScanState);
2294    }
2295    if (! retVal) {
2296      return (retVal);
2297    } else {
2298      if (! *ContinueProcessing) {
2299        return (retVal);
2300      } else {
2301
2302      }
2303    }
2304  } else {
2305
2306  }
2307  *ContinueProcessing = 1;
2308  return (retVal);
2309}
2310}
2311void KbFilter_ServiceCallback(PDEVICE_OBJECT DeviceObject , PKEYBOARD_INPUT_DATA InputDataStart ,
2312                              PKEYBOARD_INPUT_DATA InputDataEnd , PULONG InputDataConsumed ) 
2313{ PDEVICE_EXTENSION devExt ;
2314
2315  {
2316  {
2317  devExt = (struct _DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
2318  (*((void (*)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ,
2319               PVOID SystemArgument3 ))devExt->UpperConnectData.ClassService))(devExt->UpperConnectData.ClassDeviceObject,
2320                                                                               InputDataStart,
2321                                                                               InputDataEnd,
2322                                                                               InputDataConsumed);
2323  }
2324  return;
2325}
2326}
2327void KbFilter_Unload(PDRIVER_OBJECT Driver ) 
2328{ 
2329
2330  {
2331  return;
2332}
2333}
2334#pragma once
2335#pragma once
2336#pragma once
2337#pragma once
2338#pragma warning(push)
2339#pragma warning(disable:4035)
2340#pragma warning(pop)
2341#pragma once
2342#pragma warning(disable:4103)
2343#pragma warning(disable:4103)
2344#pragma warning(push)
2345#pragma warning(disable:4035)
2346#pragma warning(pop)
2347#pragma warning(disable:4035)
2348#pragma warning(push)
2349#pragma warning(disable:4164)
2350#pragma function(_enable)
2351#pragma function(_disable)
2352#pragma warning(pop)
2353#pragma warning(disable:4103)
2354#pragma warning(disable:4103)
2355#pragma warning(disable:4103)
2356#pragma warning(disable:4103)
2357#pragma warning(disable:4103)
2358#pragma warning(disable:4103)
2359#pragma warning(disable:4200)
2360#pragma warning(default:4200)
2361IRP *pirp  ;
2362void stub_driver_init(void) 
2363{ 
2364
2365  {
2366  s = NP;
2367  pended = 0;
2368  compFptr = 0;
2369  compRegistered = 0;
2370  lowerDriverReturn = 0;
2371  setEventCalled = 0;
2372  customIrp = 0;
2373  return;
2374}
2375}
2376int main(void) 
2377{ DRIVER_OBJECT d ;
2378  UNICODE_STRING u ;
2379  NTSTATUS status ;
2380  int we_should_unload = __VERIFIER_nondet_int() ;
2381  PIRP irp ;
2382  int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2383  int irp_choice = __VERIFIER_nondet_int() ;
2384  DEVICE_OBJECT devobj ;
2385
2386  {
2387  {
2388  pirp = & irp;
2389  _BLAST_init();
2390  status = DriverEntry(& d, & u);
2391  }
2392  if (status >= 0L) {
2393    s = NP;
2394    customIrp = 0;
2395    setEventCalled = customIrp;
2396    lowerDriverReturn = setEventCalled;
2397    compRegistered = lowerDriverReturn;
2398    compFptr = compRegistered;
2399    pended = compFptr;
2400    pirp->IoStatus.__annonCompField4.Status = 0L;
2401    myStatus = 0L;
2402    if (irp_choice == 0) {
2403      pirp->IoStatus.__annonCompField4.Status = -1073741637L;
2404      myStatus = -1073741637L;
2405    } else {
2406
2407    }
2408    {
2409    status = KbFilter_AddDevice(& d, & devobj);
2410    stub_driver_init();
2411    }
2412    if (! (status >= 0L)) {
2413      return (-1);
2414    } else {
2415
2416    }
2417    if (__BLAST_NONDET == 0) {
2418      goto switch_4_0;
2419    } else {
2420      if (__BLAST_NONDET == 1) {
2421        goto switch_4_1;
2422      } else {
2423        if (__BLAST_NONDET == 2) {
2424          goto switch_4_2;
2425        } else {
2426          if (__BLAST_NONDET == 3) {
2427            goto switch_4_3;
2428          } else {
2429            if (__BLAST_NONDET == 4) {
2430              goto switch_4_4;
2431            } else {
2432              if (__BLAST_NONDET == 8) {
2433                goto switch_4_8;
2434              } else {
2435                {
2436                goto switch_4_default;
2437                if (0) {
2438                  switch_4_0: /* CIL Label */ 
2439                  {
2440                  status = KbFilter_CreateClose(& devobj, pirp);
2441                  }
2442                  goto switch_4_break;
2443                  switch_4_1: /* CIL Label */ 
2444                  {
2445                  status = KbFilter_CreateClose(& devobj, pirp);
2446                  }
2447                  goto switch_4_break;
2448                  switch_4_2: /* CIL Label */ 
2449                  {
2450                  status = KbFilter_IoCtl(& devobj, pirp);
2451                  }
2452                  goto switch_4_break;
2453                  switch_4_3: /* CIL Label */ 
2454                  {
2455                  status = KbFilter_PnP(& devobj, pirp);
2456                  }
2457                  goto switch_4_break;
2458                  switch_4_4: /* CIL Label */ 
2459                  {
2460                  status = KbFilter_Power(& devobj, pirp);
2461                  }
2462                  goto switch_4_break;
2463                  switch_4_8: /* CIL Label */ 
2464                  {
2465                  status = KbFilter_InternIoCtl(& devobj, pirp);
2466                  }
2467                  goto switch_4_break;
2468                  switch_4_default: /* CIL Label */ ;
2469                  return (-1);
2470                } else {
2471                  switch_4_break: /* CIL Label */ ;
2472                }
2473                }
2474              }
2475            }
2476          }
2477        }
2478      }
2479    }
2480    if (we_should_unload) {
2481      {
2482/*       KbFilter_Unload(& d); */ /* INLINED */
2483      }
2484    } else {
2485
2486    }
2487  } else {
2488
2489  }
2490  if (pended == 1) {
2491    if (s == NP) {
2492      s = NP;
2493    } else {
2494      goto _L___2;
2495    }
2496  } else {
2497    _L___2: /* CIL Label */ 
2498    if (pended == 1) {
2499      if (s == MPR3) {
2500        s = MPR3;
2501      } else {
2502        goto _L___1;
2503      }
2504    } else {
2505      _L___1: /* CIL Label */ 
2506      if (s == UNLOADED) {
2507
2508      } else {
2509        if (status == -1L) {
2510
2511        } else {
2512          if (s != SKIP2) {
2513            if (s != IPC) {
2514              if (s != DC) {
2515
2516              } else {
2517                goto _L___0;
2518              }
2519            } else {
2520              goto _L___0;
2521            }
2522          } else {
2523            _L___0: /* CIL Label */ 
2524            if (pended == 1) {
2525              if (status != 259L) {
2526                {
2527                errorFn();
2528                }
2529              } else {
2530
2531              }
2532            } else {
2533              if (s == DC) {
2534                if (status == 259L) {
2535                  {
2536                  errorFn();
2537                  }
2538                } else {
2539
2540                }
2541              } else {
2542                if (status != (NTSTATUS )lowerDriverReturn) {
2543
2544                } else {
2545
2546                }
2547              }
2548            }
2549          }
2550        }
2551      }
2552    }
2553  }
2554  return (status);
2555}
2556}
2557char _SLAM_alloc_dummy  ;
2558char *malloc(int i ) 
2559{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2560
2561  {
2562  if (__BLAST_NONDET) {
2563    return ((char *)0);
2564  } else {
2565    return ((char *)1);
2566  }
2567}
2568}
2569  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
2570void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) 
2571{ 
2572
2573  {
2574  return;
2575}
2576}
2577  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
2578void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) 
2579{ 
2580
2581  {
2582  return;
2583}
2584}
2585  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
2586                                                                                            SIZE_T NumberOfBytes ,
2587                                                                                            ULONG Tag ) ;
2588PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes ,
2589                                                            ULONG Tag ) 
2590{ PVOID x ;
2591  char *tmp ;
2592
2593  {
2594  {
2595  tmp = malloc(NumberOfBytes);
2596  x = tmp;
2597  }
2598  return (x);
2599}
2600}
2601  void ExFreePool(PVOID P ) ;
2602void ExFreePool(PVOID P ) 
2603{ 
2604
2605  {
2606  return;
2607}
2608}
2609  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
2610                                                                                                          PLIST_ENTRY ListEntry ,
2611                                                                                                          PKSPIN_LOCK Lock ) ;
2612PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
2613                                                                          PLIST_ENTRY ListEntry ,
2614                                                                          PKSPIN_LOCK Lock ) 
2615{ 
2616
2617  {
2618  return ((void *)0);
2619}
2620}
2621  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
2622                                                                                                          PLIST_ENTRY ListEntry ,
2623                                                                                                          PKSPIN_LOCK Lock ) ;
2624PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
2625                                                                          PLIST_ENTRY ListEntry ,
2626                                                                          PKSPIN_LOCK Lock ) 
2627{ 
2628
2629  {
2630  return ((void *)0);
2631}
2632}
2633  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
2634                                                                                                          PKSPIN_LOCK Lock ) ;
2635PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
2636                                                                          PKSPIN_LOCK Lock ) 
2637{ 
2638
2639  {
2640  return ((void *)0);
2641}
2642}
2643  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
2644                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
2645                                                   PIRP Irp ) ;
2646PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer ,
2647                   BOOLEAN ChargeQuota , PIRP Irp ) 
2648{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2649  char *tmp ;
2650
2651  {
2652  if (__BLAST_NONDET == 0) {
2653    goto switch_5_0;
2654  } else {
2655    {
2656    goto switch_5_default;
2657    if (0) {
2658      switch_5_0: /* CIL Label */ 
2659      {
2660      tmp = malloc(sizeof(MDL ));
2661      }
2662      return ((void *)tmp);
2663      switch_5_default: /* CIL Label */ ;
2664      return ((void *)0);
2665    } else {
2666      switch_5_break: /* CIL Label */ ;
2667    }
2668    }
2669  }
2670}
2671}
2672  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
2673                                                                           PDEVICE_OBJECT TargetDevice ) ;
2674PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) 
2675{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2676
2677  {
2678  if (__BLAST_NONDET == 0) {
2679    goto switch_6_0;
2680  } else {
2681    {
2682    goto switch_6_default;
2683    if (0) {
2684      switch_6_0: /* CIL Label */ ;
2685      return (TargetDevice);
2686      switch_6_default: /* CIL Label */ ;
2687      return ((void *)0);
2688    } else {
2689      switch_6_break: /* CIL Label */ ;
2690    }
2691    }
2692  }
2693}
2694}
2695  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
2696                                                                   PDEVICE_OBJECT DeviceObject ,
2697                                                                   PVOID Buffer ,
2698                                                                   ULONG Length ,
2699                                                                   PLARGE_INTEGER StartingOffset ,
2700                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
2701PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject ,
2702                                   PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset ,
2703                                   PIO_STATUS_BLOCK IoStatusBlock ) 
2704{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2705  char *tmp ;
2706
2707  {
2708  customIrp = 1;
2709  if (__BLAST_NONDET == 0) {
2710    goto switch_7_0;
2711  } else {
2712    {
2713    goto switch_7_default;
2714    if (0) {
2715      switch_7_0: /* CIL Label */ 
2716      {
2717      tmp = malloc(sizeof(IRP ));
2718      }
2719      return ((void *)tmp);
2720      switch_7_default: /* CIL Label */ ;
2721      return ((void *)0);
2722    } else {
2723      switch_7_break: /* CIL Label */ ;
2724    }
2725    }
2726  }
2727}
2728}
2729  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
2730                                                                   PDEVICE_OBJECT DeviceObject ,
2731                                                                   PVOID InputBuffer ,
2732                                                                   ULONG InputBufferLength ,
2733                                                                   PVOID OutputBuffer ,
2734                                                                   ULONG OutputBufferLength ,
2735                                                                   BOOLEAN InternalDeviceIoControl ,
2736                                                                   PKEVENT Event ,
2737                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
2738PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject ,
2739                                   PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
2740                                   ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl ,
2741                                   PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) 
2742{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2743  char *tmp ;
2744
2745  {
2746  customIrp = 1;
2747  if (__BLAST_NONDET == 0) {
2748    goto switch_8_0;
2749  } else {
2750    {
2751    goto switch_8_default;
2752    if (0) {
2753      switch_8_0: /* CIL Label */ 
2754      {
2755      tmp = malloc(sizeof(IRP ));
2756      }
2757      return ((void *)tmp);
2758      switch_8_default: /* CIL Label */ ;
2759      return ((void *)0);
2760    } else {
2761      switch_8_break: /* CIL Label */ ;
2762    }
2763    }
2764  }
2765}
2766}
2767  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
2768                                                        ULONG DeviceExtensionSize ,
2769                                                        PUNICODE_STRING DeviceName ,
2770                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
2771                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
2772NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize ,
2773                        PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics ,
2774                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) 
2775{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2776  char *tmp ;
2777
2778  {
2779  if (__BLAST_NONDET == 0) {
2780    goto switch_9_0;
2781  } else {
2782    {
2783    goto switch_9_default;
2784    if (0) {
2785      switch_9_0: /* CIL Label */ 
2786      {
2787      tmp = malloc(sizeof(DEVICE_OBJECT ));
2788      *DeviceObject = (void *)tmp;
2789      }
2790      return (0L);
2791      switch_9_default: /* CIL Label */ ;
2792      return (-1073741823L);
2793    } else {
2794      switch_9_break: /* CIL Label */ ;
2795    }
2796    }
2797  }
2798}
2799}
2800  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
2801                                                              PUNICODE_STRING DeviceName ) ;
2802NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) 
2803{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2804
2805  {
2806  if (__BLAST_NONDET == 0) {
2807    goto switch_10_0;
2808  } else {
2809    {
2810    goto switch_10_default;
2811    if (0) {
2812      switch_10_0: /* CIL Label */ ;
2813      return (0L);
2814      switch_10_default: /* CIL Label */ ;
2815      return (-1073741823L);
2816    } else {
2817      switch_10_break: /* CIL Label */ ;
2818    }
2819    }
2820  }
2821}
2822}
2823  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
2824void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) 
2825{ 
2826
2827  {
2828  return;
2829}
2830}
2831  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
2832NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) 
2833{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2834
2835  {
2836  if (__BLAST_NONDET == 0) {
2837    goto switch_11_0;
2838  } else {
2839    {
2840    goto switch_11_default;
2841    if (0) {
2842      switch_11_0: /* CIL Label */ ;
2843      return (0L);
2844      switch_11_default: /* CIL Label */ ;
2845      return (-1073741823L);
2846    } else {
2847      switch_11_break: /* CIL Label */ ;
2848    }
2849    }
2850  }
2851}
2852}
2853  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
2854void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) 
2855{ 
2856
2857  {
2858  return;
2859}
2860}
2861  void IoFreeIrp(PIRP Irp ) ;
2862void IoFreeIrp(PIRP Irp ) 
2863{ 
2864
2865  {
2866  return;
2867}
2868}
2869  void IoFreeMdl(PMDL Mdl ) ;
2870void IoFreeMdl(PMDL Mdl ) 
2871{ 
2872
2873  {
2874  return;
2875}
2876}
2877  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
2878PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) 
2879{ char *tmp ;
2880
2881  {
2882  {
2883  tmp = malloc(sizeof(CONFIGURATION_INFORMATION ));
2884  }
2885  return ((void *)tmp);
2886}
2887}
2888  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
2889                                                                  PULONG BusNumber ,
2890                                                                  PCONFIGURATION_TYPE ControllerType ,
2891                                                                  PULONG ControllerNumber ,
2892                                                                  PCONFIGURATION_TYPE PeripheralType ,
2893                                                                  PULONG PeripheralNumber ,
2894                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
2895                                                                                             PUNICODE_STRING PathName ,
2896                                                                                             INTERFACE_TYPE BusType ,
2897                                                                                             ULONG BusNumber ,
2898                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
2899                                                                                             CONFIGURATION_TYPE ControllerType ,
2900                                                                                             ULONG ControllerNumber ,
2901                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
2902                                                                                             CONFIGURATION_TYPE PeripheralType ,
2903                                                                                             ULONG PeripheralNumber ,
2904                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
2905                                                                  PVOID Context ) ;
2906NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType ,
2907                                  PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType ,
2908                                  PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context ,
2909                                                                                       PUNICODE_STRING PathName ,
2910                                                                                       INTERFACE_TYPE BusType ,
2911                                                                                       ULONG BusNumber ,
2912                                                                                       PKEY_VALUE_FULL_INFORMATION *BusInformation ,
2913                                                                                       CONFIGURATION_TYPE ControllerType ,
2914                                                                                       ULONG ControllerNumber ,
2915                                                                                       PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
2916                                                                                       CONFIGURATION_TYPE PeripheralType ,
2917                                                                                       ULONG PeripheralNumber ,
2918                                                                                       PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
2919                                  PVOID Context ) 
2920{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2921
2922  {
2923  if (__BLAST_NONDET == 0) {
2924    goto switch_12_0;
2925  } else {
2926    {
2927    goto switch_12_default;
2928    if (0) {
2929      switch_12_0: /* CIL Label */ ;
2930      return (0L);
2931      switch_12_default: /* CIL Label */ ;
2932      return (-1073741823L);
2933    } else {
2934      switch_12_break: /* CIL Label */ ;
2935    }
2936    }
2937  }
2938}
2939}
2940  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
2941                                                                                                   GUID const   *InterfaceClassGuid ,
2942                                                                                                   PUNICODE_STRING ReferenceString ,
2943                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
2944NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
2945                                                                   GUID const   *InterfaceClassGuid ,
2946                                                                   PUNICODE_STRING ReferenceString ,
2947                                                                   PUNICODE_STRING SymbolicLinkName ) 
2948{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2949
2950  {
2951  if (__BLAST_NONDET == 0) {
2952    goto switch_13_0;
2953  } else {
2954    {
2955    goto switch_13_default;
2956    if (0) {
2957      switch_13_0: /* CIL Label */ ;
2958      return (0L);
2959      switch_13_default: /* CIL Label */ ;
2960      return (-1073741808L);
2961    } else {
2962      switch_13_break: /* CIL Label */ ;
2963    }
2964    }
2965  }
2966}
2967}
2968  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
2969void IoReleaseCancelSpinLock(KIRQL Irql ) 
2970{ 
2971
2972  {
2973  return;
2974}
2975}
2976  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
2977                                                                   BOOLEAN Enable ) ;
2978NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) 
2979{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
2980
2981  {
2982  if (__BLAST_NONDET == 0) {
2983    goto switch_14_0;
2984  } else {
2985    {
2986    goto switch_14_default;
2987    if (0) {
2988      switch_14_0: /* CIL Label */ ;
2989      return (0L);
2990      switch_14_default: /* CIL Label */ ;
2991      return (-1073741823L);
2992    } else {
2993      switch_14_break: /* CIL Label */ ;
2994    }
2995    }
2996  }
2997}
2998}
2999  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
3000void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) 
3001{ 
3002
3003  {
3004  return;
3005}
3006}
3007void stubMoreProcessingRequired(void) 
3008{ 
3009
3010  {
3011  if (s == NP) {
3012    s = MPR1;
3013  } else {
3014    {
3015    errorFn();
3016    }
3017  }
3018  return;
3019}
3020}
3021  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
3022                                                                                        PIRP Irp ) ;
3023NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
3024                                                        PIRP Irp ) 
3025{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3026  NTSTATUS returnVal2 ;
3027  int compRetStatus ;
3028  PVOID lcontext = __VERIFIER_nondet_pointer() ;
3029  NTSTATUS tmp ;
3030
3031  {
3032  if (compRegistered) {
3033    {
3034    tmp = KbFilter_Complete(DeviceObject, Irp, lcontext);
3035    compRetStatus = tmp;
3036    }
3037    if ((long )compRetStatus == -1073741802L) {
3038      {
3039      stubMoreProcessingRequired();
3040      }
3041    } else {
3042
3043    }
3044  } else {
3045
3046  }
3047  if (__BLAST_NONDET == 0) {
3048    goto switch_15_0;
3049  } else {
3050    if (__BLAST_NONDET == 1) {
3051      goto switch_15_1;
3052    } else {
3053      {
3054      goto switch_15_default;
3055      if (0) {
3056        switch_15_0: /* CIL Label */ 
3057        returnVal2 = 0L;
3058        goto switch_15_break;
3059        switch_15_1: /* CIL Label */ 
3060        returnVal2 = -1073741823L;
3061        goto switch_15_break;
3062        switch_15_default: /* CIL Label */ 
3063        returnVal2 = 259L;
3064        goto switch_15_break;
3065      } else {
3066        switch_15_break: /* CIL Label */ ;
3067      }
3068      }
3069    }
3070  }
3071  if (s == NP) {
3072    s = IPC;
3073    lowerDriverReturn = returnVal2;
3074  } else {
3075    if (s == MPR1) {
3076      if (returnVal2 == 259L) {
3077        s = MPR3;
3078        lowerDriverReturn = returnVal2;
3079      } else {
3080        s = NP;
3081        lowerDriverReturn = returnVal2;
3082      }
3083    } else {
3084      if (s == SKIP1) {
3085        s = SKIP2;
3086        lowerDriverReturn = returnVal2;
3087      } else {
3088        {
3089        errorFn();
3090        }
3091      }
3092    }
3093  }
3094  return (returnVal2);
3095}
3096}
3097  void IofCompleteRequest(PIRP Irp ,
3098                                                                                         CCHAR PriorityBoost ) ;
3099void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) 
3100{ 
3101
3102  {
3103  if (s == NP) {
3104    s = DC;
3105  } else {
3106    {
3107    errorFn();
3108    }
3109  }
3110  return;
3111}
3112}
3113  KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ;
3114KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) 
3115{ 
3116
3117  {
3118  return ((unsigned char)0);
3119}
3120}
3121  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
3122                                                                BOOLEAN Alertable ,
3123                                                                PLARGE_INTEGER Interval ) ;
3124NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) 
3125{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3126
3127  {
3128  if (__BLAST_NONDET == 0) {
3129    goto switch_16_0;
3130  } else {
3131    {
3132    goto switch_16_default;
3133    if (0) {
3134      switch_16_0: /* CIL Label */ ;
3135      return (0L);
3136      switch_16_default: /* CIL Label */ ;
3137      return (-1073741823L);
3138    } else {
3139      switch_16_break: /* CIL Label */ ;
3140    }
3141    }
3142  }
3143}
3144}
3145  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
3146                                                       BOOLEAN State ) ;
3147void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) 
3148{ 
3149
3150  {
3151  return;
3152}
3153}
3154  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
3155                                                           LONG Count , LONG Limit ) ;
3156void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) 
3157{ 
3158
3159  {
3160  return;
3161}
3162}
3163  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
3164void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) 
3165{ 
3166
3167  {
3168  return;
3169}
3170}
3171  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
3172                                                        LONG Adjustment , BOOLEAN Wait ) ;
3173LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment ,
3174                        BOOLEAN Wait ) 
3175{ LONG r = __VERIFIER_nondet_long() ;
3176
3177  {
3178  return (r);
3179}
3180}
3181  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
3182                                                                                        KIRQL NewIrql ) ;
3183void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) 
3184{ 
3185
3186  {
3187  return;
3188}
3189}
3190  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
3191                                                BOOLEAN Wait ) ;
3192LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) 
3193{ LONG l = __VERIFIER_nondet_long() ;
3194
3195  {
3196  setEventCalled = 1;
3197  return (l);
3198}
3199}
3200  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
3201                                                               KPROCESSOR_MODE WaitMode ,
3202                                                               BOOLEAN Alertable ,
3203                                                               PLARGE_INTEGER Timeout ) ;
3204NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode ,
3205                               BOOLEAN Alertable , PLARGE_INTEGER Timeout ) 
3206{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3207
3208  {
3209  if (s == MPR3) {
3210    if (setEventCalled == 1) {
3211      s = NP;
3212      setEventCalled = 0;
3213    } else {
3214      goto _L;
3215    }
3216  } else {
3217    _L: /* CIL Label */ 
3218    if (customIrp == 1) {
3219      s = NP;
3220      customIrp = 0;
3221    } else {
3222      if (s == MPR3) {
3223        {
3224        errorFn();
3225        }
3226      } else {
3227
3228      }
3229    }
3230  }
3231  if (__BLAST_NONDET == 0) {
3232    goto switch_17_0;
3233  } else {
3234    {
3235    goto switch_17_default;
3236    if (0) {
3237      switch_17_0: /* CIL Label */ ;
3238      return (0L);
3239      switch_17_default: /* CIL Label */ ;
3240      return (-1073741823L);
3241    } else {
3242      switch_17_break: /* CIL Label */ ;
3243    }
3244    }
3245  }
3246}
3247}
3248  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
3249                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
3250PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) 
3251{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3252  char *tmp ;
3253
3254  {
3255  if (__BLAST_NONDET == 0) {
3256    goto switch_18_0;
3257  } else {
3258    if (__BLAST_NONDET == 1) {
3259      goto switch_18_1;
3260    } else {
3261      if (0) {
3262        switch_18_0: /* CIL Label */ 
3263        {
3264        tmp = malloc(NumberOfBytes);
3265        }
3266        return (tmp);
3267        switch_18_1: /* CIL Label */ ;
3268        return ((void *)0);
3269      } else {
3270        switch_18_break: /* CIL Label */ ;
3271      }
3272    }
3273  }
3274  return ((void *)0);
3275}
3276}
3277  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
3278void MmFreeContiguousMemory(PVOID BaseAddress ) 
3279{ 
3280
3281  {
3282  return;
3283}
3284}
3285  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
3286                                                                   KPROCESSOR_MODE AccessMode ,
3287                                                                   MEMORY_CACHING_TYPE CacheType ,
3288                                                                   PVOID BaseAddress ,
3289                                                                   ULONG BugCheckOnFailure ,
3290                                                                   MM_PAGE_PRIORITY Priority ) ;
3291PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode ,
3292                                   MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress ,
3293                                   ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) 
3294{ 
3295
3296  {
3297  return ((void *)0);
3298}
3299}
3300  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
3301PVOID MmPageEntireDriver(PVOID AddressWithinSection ) 
3302{ 
3303
3304  {
3305  return ((void *)0);
3306}
3307}
3308  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
3309void MmResetDriverPaging(PVOID AddressWithinSection ) 
3310{ 
3311
3312  {
3313  return;
3314}
3315}
3316  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
3317void MmUnlockPages(PMDL MemoryDescriptorList ) 
3318{ 
3319
3320  {
3321  return;
3322}
3323}
3324  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
3325                                                                   ACCESS_MASK DesiredAccess ,
3326                                                                   POBJECT_TYPE ObjectType ,
3327                                                                   KPROCESSOR_MODE AccessMode ,
3328                                                                   PVOID *Object ,
3329                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
3330NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType ,
3331                                   KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) 
3332{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3333
3334  {
3335  if (__BLAST_NONDET == 0) {
3336    goto switch_19_0;
3337  } else {
3338    {
3339    goto switch_19_default;
3340    if (0) {
3341      switch_19_0: /* CIL Label */ ;
3342      return (0L);
3343      switch_19_default: /* CIL Label */ ;
3344      return (-1073741823L);
3345    } else {
3346      switch_19_break: /* CIL Label */ ;
3347    }
3348    }
3349  }
3350}
3351}
3352  void ObfDereferenceObject(PVOID Object ) ;
3353void ObfDereferenceObject(PVOID Object ) 
3354{ 
3355
3356  {
3357  return;
3358}
3359}
3360  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
3361                                                      PIRP Irp ) ;
3362NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3363{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3364  int compRetStatus ;
3365  NTSTATUS returnVal ;
3366  PVOID lcontext = __VERIFIER_nondet_pointer() ;
3367  NTSTATUS tmp ;
3368
3369  {
3370  if (compRegistered) {
3371    {
3372    tmp = KbFilter_Complete(DeviceObject, Irp, lcontext);
3373    compRetStatus = tmp;
3374    }
3375    if ((long )compRetStatus == -1073741802L) {
3376      {
3377      stubMoreProcessingRequired();
3378      }
3379    } else {
3380
3381    }
3382  } else {
3383
3384  }
3385  if (__BLAST_NONDET == 0) {
3386    goto switch_20_0;
3387  } else {
3388    if (__BLAST_NONDET == 1) {
3389      goto switch_20_1;
3390    } else {
3391      {
3392      goto switch_20_default;
3393      if (0) {
3394        switch_20_0: /* CIL Label */ 
3395        returnVal = 0L;
3396        goto switch_20_break;
3397        switch_20_1: /* CIL Label */ 
3398        returnVal = -1073741823L;
3399        goto switch_20_break;
3400        switch_20_default: /* CIL Label */ 
3401        returnVal = 259L;
3402        goto switch_20_break;
3403      } else {
3404        switch_20_break: /* CIL Label */ ;
3405      }
3406      }
3407    }
3408  }
3409  if (s == NP) {
3410    s = IPC;
3411    lowerDriverReturn = returnVal;
3412  } else {
3413    if (s == MPR1) {
3414      if (returnVal == 259L) {
3415        s = MPR3;
3416        lowerDriverReturn = returnVal;
3417      } else {
3418        s = NP;
3419        lowerDriverReturn = returnVal;
3420      }
3421    } else {
3422      if (s == SKIP1) {
3423        s = SKIP2;
3424        lowerDriverReturn = returnVal;
3425      } else {
3426        {
3427        errorFn();
3428        }
3429      }
3430    }
3431  }
3432  return (returnVal);
3433}
3434}
3435  void PoStartNextPowerIrp(PIRP Irp ) ;
3436void PoStartNextPowerIrp(PIRP Irp ) 
3437{ 
3438
3439  {
3440  return;
3441}
3442}
3443  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
3444                                                              ULONG DesiredAccess ,
3445                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
3446                                                              HANDLE ProcessHandle ,
3447                                                              PCLIENT_ID ClientId ,
3448                                                              void (*StartRoutine)(PVOID StartContext ) ,
3449                                                              PVOID StartContext ) ;
3450NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes ,
3451                              HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) ,
3452                              PVOID StartContext ) 
3453{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3454
3455  {
3456  if (__BLAST_NONDET == 0) {
3457    goto switch_21_0;
3458  } else {
3459    {
3460    goto switch_21_default;
3461    if (0) {
3462      switch_21_0: /* CIL Label */ ;
3463      return (0L);
3464      switch_21_default: /* CIL Label */ ;
3465      return (-1073741823L);
3466    } else {
3467      switch_21_break: /* CIL Label */ ;
3468    }
3469    }
3470  }
3471}
3472}
3473  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
3474NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) 
3475{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3476
3477  {
3478  if (__BLAST_NONDET == 0) {
3479    goto switch_22_0;
3480  } else {
3481    {
3482    goto switch_22_default;
3483    if (0) {
3484      switch_22_0: /* CIL Label */ ;
3485      return (0L);
3486      switch_22_default: /* CIL Label */ ;
3487      return (-1073741823L);
3488    } else {
3489      switch_22_break: /* CIL Label */ ;
3490    }
3491    }
3492  }
3493}
3494}
3495  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
3496                                                                                                      PANSI_STRING SourceString ,
3497                                                                                                      BOOLEAN AllocateDestinationString ) ;
3498NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
3499                                                                      PANSI_STRING SourceString ,
3500                                                                      BOOLEAN AllocateDestinationString ) 
3501{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3502
3503  {
3504  if (__BLAST_NONDET == 0) {
3505    goto switch_23_0;
3506  } else {
3507    {
3508    goto switch_23_default;
3509    if (0) {
3510      switch_23_0: /* CIL Label */ ;
3511      return (0L);
3512      switch_23_default: /* CIL Label */ ;
3513      return (-1073741823L);
3514    } else {
3515      switch_23_break: /* CIL Label */ ;
3516    }
3517    }
3518  }
3519}
3520}
3521  SIZE_T RtlCompareMemory(void const   *Source1 ,
3522                                                                                        void const   *Source2 ,
3523                                                                                        SIZE_T Length ) ;
3524SIZE_T RtlCompareMemory(void const   *Source1 , void const   *Source2 ,
3525                                                        SIZE_T Length ) 
3526{ SIZE_T r = __VERIFIER_nondet_long() ;
3527
3528  {
3529  return (r);
3530}
3531}
3532  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
3533                                                                                          PUNICODE_STRING SourceString ) ;
3534void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
3535                                                          PUNICODE_STRING SourceString ) 
3536{ 
3537
3538  {
3539  return;
3540}
3541}
3542  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
3543                                                                                                PCWSTR Path ,
3544                                                                                                PCWSTR ValueName ) ;
3545NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
3546                                                                PCWSTR Path , PCWSTR ValueName ) 
3547{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3548
3549  {
3550  if (__BLAST_NONDET == 0) {
3551    goto switch_24_0;
3552  } else {
3553    {
3554    goto switch_24_default;
3555    if (0) {
3556      switch_24_0: /* CIL Label */ ;
3557      return (0L);
3558      switch_24_default: /* CIL Label */ ;
3559      return (-1073741823L);
3560    } else {
3561      switch_24_break: /* CIL Label */ ;
3562    }
3563    }
3564  }
3565}
3566}
3567  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
3568void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) 
3569{ 
3570
3571  {
3572  return;
3573}
3574}
3575  void RtlInitString(PSTRING DestinationString ,
3576                                                                                   PCSZ SourceString ) ;
3577void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) 
3578{ 
3579
3580  {
3581  return;
3582}
3583}
3584  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
3585                                                                                          PCWSTR SourceString ) ;
3586void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
3587                                                          PCWSTR SourceString ) 
3588{ 
3589
3590  {
3591  return;
3592}
3593}
3594  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
3595                                                                                                PCWSTR Path ,
3596                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
3597                                                                                                PVOID Context ,
3598                                                                                                PVOID Environment ) ;
3599NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
3600                                                                PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable ,
3601                                                                PVOID Context , PVOID Environment ) 
3602{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3603
3604  {
3605  if (__BLAST_NONDET == 0) {
3606    goto switch_25_0;
3607  } else {
3608    {
3609    goto switch_25_default;
3610    if (0) {
3611      switch_25_0: /* CIL Label */ ;
3612      return (0L);
3613      switch_25_default: /* CIL Label */ ;
3614      return (-1073741823L);
3615    } else {
3616      switch_25_break: /* CIL Label */ ;
3617    }
3618    }
3619  }
3620}
3621}
3622  NTSTATUS ZwClose(HANDLE Handle ) ;
3623NTSTATUS ZwClose(HANDLE Handle ) 
3624{ int __BLAST_NONDET = __VERIFIER_nondet_int() ;
3625
3626  {
3627  if (__BLAST_NONDET == 0) {
3628    goto switch_26_0;
3629  } else {
3630    {
3631    goto switch_26_default;
3632    if (0) {
3633      switch_26_0: /* CIL Label */ ;
3634      return (0L);
3635      switch_26_default: /* CIL Label */ ;
3636      return (-1073741823L);
3637    } else {
3638      switch_26_break: /* CIL Label */ ;
3639    }
3640    }
3641  }
3642}
3643}