Showing error 1548

User: Jiri Slaby
Error type: Reachable Error Location
Error type description: A specified error location is reachable in some program path
File location: ntdrivers/cdaudio_safe.i.cil.c
Line in file: 2838
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;
  35typedef unsigned long long ULONGLONG;
  36struct __anonstruct____missing_field_name_1 {
  37   ULONG LowPart ;
  38   LONG HighPart ;
  39};
  40struct __anonstruct_u_2 {
  41   ULONG LowPart ;
  42   LONG HighPart ;
  43};
  44union _LARGE_INTEGER {
  45   struct __anonstruct____missing_field_name_1 __annonCompField1 ;
  46   struct __anonstruct_u_2 u ;
  47   LONGLONG QuadPart ;
  48};
  49typedef union _LARGE_INTEGER LARGE_INTEGER;
  50typedef LARGE_INTEGER *PLARGE_INTEGER;
  51struct __anonstruct____missing_field_name_3 {
  52   ULONG LowPart ;
  53   ULONG HighPart ;
  54};
  55struct __anonstruct_u_4 {
  56   ULONG LowPart ;
  57   ULONG HighPart ;
  58};
  59union _ULARGE_INTEGER {
  60   struct __anonstruct____missing_field_name_3 __annonCompField2 ;
  61   struct __anonstruct_u_4 u ;
  62   ULONGLONG QuadPart ;
  63};
  64typedef union _ULARGE_INTEGER ULARGE_INTEGER;
  65struct _LUID {
  66   ULONG LowPart ;
  67   LONG HighPart ;
  68};
  69typedef struct _LUID LUID;
  70typedef LARGE_INTEGER PHYSICAL_ADDRESS;
  71enum _EVENT_TYPE {
  72    NotificationEvent = 0,
  73    SynchronizationEvent = 1
  74} ;
  75typedef enum _EVENT_TYPE EVENT_TYPE;
  76typedef char const   *PCSZ;
  77struct _STRING {
  78   USHORT Length ;
  79   USHORT MaximumLength ;
  80   PCHAR Buffer ;
  81};
  82typedef struct _STRING STRING;
  83typedef STRING *PSTRING;
  84typedef PSTRING PANSI_STRING;
  85struct _UNICODE_STRING {
  86   USHORT Length ;
  87   USHORT MaximumLength ;
  88   PWSTR Buffer ;
  89};
  90typedef struct _UNICODE_STRING UNICODE_STRING;
  91typedef UNICODE_STRING *PUNICODE_STRING;
  92typedef UCHAR BOOLEAN;
  93struct _LIST_ENTRY {
  94   struct _LIST_ENTRY *Flink ;
  95   struct _LIST_ENTRY *Blink ;
  96};
  97typedef struct _LIST_ENTRY LIST_ENTRY;
  98typedef struct _LIST_ENTRY *PLIST_ENTRY;
  99struct _OBJECT_ATTRIBUTES {
 100   ULONG Length ;
 101   HANDLE RootDirectory ;
 102   PUNICODE_STRING ObjectName ;
 103   ULONG Attributes ;
 104   PVOID SecurityDescriptor ;
 105   PVOID SecurityQualityOfService ;
 106};
 107typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES;
 108typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
 109struct _GUID {
 110   unsigned long Data1 ;
 111   unsigned short Data2 ;
 112   unsigned short Data3 ;
 113   unsigned char Data4[8] ;
 114};
 115typedef struct _GUID GUID;
 116typedef unsigned int size_t;
 117typedef UCHAR KIRQL;
 118struct _KTHREAD;
 119typedef struct _KTHREAD *PKTHREAD;
 120struct _ETHREAD;
 121typedef struct _ETHREAD *PETHREAD;
 122struct _EPROCESS;
 123typedef struct _EPROCESS *PEPROCESS;
 124struct _IO_TIMER;
 125typedef struct _IO_TIMER *PIO_TIMER;
 126struct _OBJECT_TYPE;
 127typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 128typedef CCHAR KPROCESSOR_MODE;
 129struct _KAPC;
 130struct _KAPC;
 131typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 );
 132struct _KAPC {
 133   CSHORT Type ;
 134   CSHORT Size ;
 135   ULONG Spare0 ;
 136   struct _KTHREAD *Thread ;
 137   LIST_ENTRY ApcListEntry ;
 138   void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext ,
 139                         PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ;
 140   void (*RundownRoutine)(struct _KAPC *Apc ) ;
 141   void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ;
 142   PVOID NormalContext ;
 143   PVOID SystemArgument1 ;
 144   PVOID SystemArgument2 ;
 145   CCHAR ApcStateIndex ;
 146   KPROCESSOR_MODE ApcMode ;
 147   BOOLEAN Inserted ;
 148};
 149typedef struct _KAPC KAPC;
 150struct _KDPC;
 151struct _KDPC;
 152struct _KDPC {
 153   CSHORT Type ;
 154   UCHAR Number ;
 155   UCHAR Importance ;
 156   LIST_ENTRY DpcListEntry ;
 157   void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 ,
 158                           PVOID SystemArgument2 ) ;
 159   PVOID DeferredContext ;
 160   PVOID SystemArgument1 ;
 161   PVOID SystemArgument2 ;
 162   PULONG_PTR Lock ;
 163};
 164typedef struct _KDPC KDPC;
 165typedef struct _KDPC *PKDPC;
 166typedef struct _KDPC *PRKDPC;
 167struct _MDL {
 168   struct _MDL *Next ;
 169   CSHORT Size ;
 170   CSHORT MdlFlags ;
 171   struct _EPROCESS *Process ;
 172   PVOID MappedSystemVa ;
 173   PVOID StartVa ;
 174   ULONG ByteCount ;
 175   ULONG ByteOffset ;
 176};
 177typedef struct _MDL MDL;
 178typedef struct _MDL *PMDL;
 179typedef PVOID PACCESS_TOKEN;
 180typedef PVOID PSECURITY_DESCRIPTOR;
 181typedef ULONG ACCESS_MASK;
 182#pragma pack(push,4)
 183struct _LUID_AND_ATTRIBUTES {
 184   LUID Luid ;
 185   ULONG Attributes ;
 186};
 187typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES;
 188#pragma pack(pop)
 189struct _PRIVILEGE_SET {
 190   ULONG PrivilegeCount ;
 191   ULONG Control ;
 192   LUID_AND_ATTRIBUTES Privilege[1] ;
 193};
 194typedef struct _PRIVILEGE_SET PRIVILEGE_SET;
 195enum _SECURITY_IMPERSONATION_LEVEL {
 196    SecurityAnonymous = 0,
 197    SecurityIdentification = 1,
 198    SecurityImpersonation = 2,
 199    SecurityDelegation = 3
 200} ;
 201typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL;
 202typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE;
 203struct _SECURITY_QUALITY_OF_SERVICE {
 204   ULONG Length ;
 205   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 206   SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ;
 207   BOOLEAN EffectiveOnly ;
 208};
 209typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE;
 210typedef ULONG SECURITY_INFORMATION;
 211typedef LONG KPRIORITY;
 212typedef ULONG_PTR KSPIN_LOCK;
 213typedef KSPIN_LOCK *PKSPIN_LOCK;
 214struct _RTL_QUERY_REGISTRY_TABLE {
 215   NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType ,
 216                                                            PVOID ValueData , ULONG ValueLength ,
 217                                                            PVOID Context , PVOID EntryContext ) ;
 218   ULONG Flags ;
 219   PWSTR Name ;
 220   PVOID EntryContext ;
 221   ULONG DefaultType ;
 222   PVOID DefaultData ;
 223   ULONG DefaultLength ;
 224};
 225typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE;
 226typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE;
 227union __anonunion____missing_field_name_6 {
 228   NTSTATUS Status ;
 229   PVOID Pointer ;
 230};
 231struct _IO_STATUS_BLOCK {
 232   union __anonunion____missing_field_name_6 __annonCompField4 ;
 233   ULONG_PTR Information ;
 234};
 235typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK;
 236typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK;
 237enum _FILE_INFORMATION_CLASS {
 238    FileDirectoryInformation = 1,
 239    FileFullDirectoryInformation = 2,
 240    FileBothDirectoryInformation = 3,
 241    FileBasicInformation = 4,
 242    FileStandardInformation = 5,
 243    FileInternalInformation = 6,
 244    FileEaInformation = 7,
 245    FileAccessInformation = 8,
 246    FileNameInformation = 9,
 247    FileRenameInformation = 10,
 248    FileLinkInformation = 11,
 249    FileNamesInformation = 12,
 250    FileDispositionInformation = 13,
 251    FilePositionInformation = 14,
 252    FileFullEaInformation = 15,
 253    FileModeInformation = 16,
 254    FileAlignmentInformation = 17,
 255    FileAllInformation = 18,
 256    FileAllocationInformation = 19,
 257    FileEndOfFileInformation = 20,
 258    FileAlternateNameInformation = 21,
 259    FileStreamInformation = 22,
 260    FilePipeInformation = 23,
 261    FilePipeLocalInformation = 24,
 262    FilePipeRemoteInformation = 25,
 263    FileMailslotQueryInformation = 26,
 264    FileMailslotSetInformation = 27,
 265    FileCompressionInformation = 28,
 266    FileObjectIdInformation = 29,
 267    FileCompletionInformation = 30,
 268    FileMoveClusterInformation = 31,
 269    FileQuotaInformation = 32,
 270    FileReparsePointInformation = 33,
 271    FileNetworkOpenInformation = 34,
 272    FileAttributeTagInformation = 35,
 273    FileTrackingInformation = 36,
 274    FileMaximumInformation = 37
 275} ;
 276typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS;
 277struct _FILE_BASIC_INFORMATION {
 278   LARGE_INTEGER CreationTime ;
 279   LARGE_INTEGER LastAccessTime ;
 280   LARGE_INTEGER LastWriteTime ;
 281   LARGE_INTEGER ChangeTime ;
 282   ULONG FileAttributes ;
 283};
 284typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION;
 285struct _FILE_STANDARD_INFORMATION {
 286   LARGE_INTEGER AllocationSize ;
 287   LARGE_INTEGER EndOfFile ;
 288   ULONG NumberOfLinks ;
 289   BOOLEAN DeletePending ;
 290   BOOLEAN Directory ;
 291};
 292typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
 293struct _FILE_NETWORK_OPEN_INFORMATION {
 294   LARGE_INTEGER CreationTime ;
 295   LARGE_INTEGER LastAccessTime ;
 296   LARGE_INTEGER LastWriteTime ;
 297   LARGE_INTEGER ChangeTime ;
 298   LARGE_INTEGER AllocationSize ;
 299   LARGE_INTEGER EndOfFile ;
 300   ULONG FileAttributes ;
 301};
 302typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION;
 303enum _FSINFOCLASS {
 304    FileFsVolumeInformation = 1,
 305    FileFsLabelInformation = 2,
 306    FileFsSizeInformation = 3,
 307    FileFsDeviceInformation = 4,
 308    FileFsAttributeInformation = 5,
 309    FileFsControlInformation = 6,
 310    FileFsFullSizeInformation = 7,
 311    FileFsObjectIdInformation = 8,
 312    FileFsMaximumInformation = 9
 313} ;
 314typedef enum _FSINFOCLASS FS_INFORMATION_CLASS;
 315enum _INTERFACE_TYPE {
 316    InterfaceTypeUndefined = -1,
 317    Internal = 0,
 318    Isa = 1,
 319    Eisa = 2,
 320    MicroChannel = 3,
 321    TurboChannel = 4,
 322    PCIBus = 5,
 323    VMEBus = 6,
 324    NuBus = 7,
 325    PCMCIABus = 8,
 326    CBus = 9,
 327    MPIBus = 10,
 328    MPSABus = 11,
 329    ProcessorInternal = 12,
 330    InternalPowerBus = 13,
 331    PNPISABus = 14,
 332    PNPBus = 15,
 333    MaximumInterfaceType = 16
 334} ;
 335typedef enum _INTERFACE_TYPE INTERFACE_TYPE;
 336typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE;
 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;
 667struct _KTIMER {
 668   DISPATCHER_HEADER Header ;
 669   ULARGE_INTEGER DueTime ;
 670   LIST_ENTRY TimerListEntry ;
 671   struct _KDPC *Dpc ;
 672   LONG Period ;
 673};
 674typedef struct _KTIMER *PKTIMER;
 675enum _MEMORY_CACHING_TYPE {
 676    MmNonCached = 0,
 677    MmCached = 1,
 678    MmWriteCombined = 2,
 679    MmHardwareCoherentCached = 3,
 680    MmNonCachedUnordered = 4,
 681    MmUSWCCached = 5,
 682    MmMaximumCacheType = 6
 683} ;
 684typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE;
 685enum _POOL_TYPE {
 686    NonPagedPool = 0,
 687    PagedPool = 1,
 688    NonPagedPoolMustSucceed = 2,
 689    DontUseThisType = 3,
 690    NonPagedPoolCacheAligned = 4,
 691    PagedPoolCacheAligned = 5,
 692    NonPagedPoolCacheAlignedMustS = 6,
 693    MaxPoolType = 7,
 694    NonPagedPoolSession = 32,
 695    PagedPoolSession = 33,
 696    NonPagedPoolMustSucceedSession = 34,
 697    DontUseThisTypeSession = 35,
 698    NonPagedPoolCacheAlignedSession = 36,
 699    PagedPoolCacheAlignedSession = 37,
 700    NonPagedPoolCacheAlignedMustSSession = 38
 701} ;
 702typedef enum _POOL_TYPE POOL_TYPE;
 703struct _FAST_MUTEX {
 704   LONG Count ;
 705   PKTHREAD Owner ;
 706   ULONG Contention ;
 707   KEVENT Event ;
 708   ULONG OldIrql ;
 709};
 710typedef struct _FAST_MUTEX *PFAST_MUTEX;
 711typedef ULONG_PTR ERESOURCE_THREAD;
 712union __anonunion____missing_field_name_38 {
 713   LONG OwnerCount ;
 714   ULONG TableSize ;
 715};
 716struct _OWNER_ENTRY {
 717   ERESOURCE_THREAD OwnerThread ;
 718   union __anonunion____missing_field_name_38 __annonCompField10 ;
 719};
 720typedef struct _OWNER_ENTRY OWNER_ENTRY;
 721typedef struct _OWNER_ENTRY *POWNER_ENTRY;
 722union __anonunion____missing_field_name_39 {
 723   PVOID Address ;
 724   ULONG_PTR CreatorBackTraceIndex ;
 725};
 726struct _ERESOURCE {
 727   LIST_ENTRY SystemResourcesList ;
 728   POWNER_ENTRY OwnerTable ;
 729   SHORT ActiveCount ;
 730   USHORT Flag ;
 731   PKSEMAPHORE SharedWaiters ;
 732   PKEVENT ExclusiveWaiters ;
 733   OWNER_ENTRY OwnerThreads[2] ;
 734   ULONG ContentionCount ;
 735   USHORT NumberOfSharedWaiters ;
 736   USHORT NumberOfExclusiveWaiters ;
 737   union __anonunion____missing_field_name_39 __annonCompField11 ;
 738   KSPIN_LOCK SpinLock ;
 739};
 740enum _MM_PAGE_PRIORITY {
 741    LowPagePriority = 0,
 742    NormalPagePriority = 16,
 743    HighPagePriority = 32
 744} ;
 745typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY;
 746struct _DRIVER_OBJECT;
 747struct _DRIVER_OBJECT;
 748struct _SECURITY_SUBJECT_CONTEXT {
 749   PACCESS_TOKEN ClientToken ;
 750   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 751   PACCESS_TOKEN PrimaryToken ;
 752   PVOID ProcessAuditId ;
 753};
 754typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT;
 755struct _INITIAL_PRIVILEGE_SET {
 756   ULONG PrivilegeCount ;
 757   ULONG Control ;
 758   LUID_AND_ATTRIBUTES Privilege[3] ;
 759};
 760typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET;
 761union __anonunion_Privileges_40 {
 762   INITIAL_PRIVILEGE_SET InitialPrivilegeSet ;
 763   PRIVILEGE_SET PrivilegeSet ;
 764};
 765struct _ACCESS_STATE {
 766   LUID OperationID ;
 767   BOOLEAN SecurityEvaluated ;
 768   BOOLEAN GenerateAudit ;
 769   BOOLEAN GenerateOnClose ;
 770   BOOLEAN PrivilegesAllocated ;
 771   ULONG Flags ;
 772   ACCESS_MASK RemainingDesiredAccess ;
 773   ACCESS_MASK PreviouslyGrantedAccess ;
 774   ACCESS_MASK OriginalDesiredAccess ;
 775   SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ;
 776   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 777   PVOID AuxData ;
 778   union __anonunion_Privileges_40 Privileges ;
 779   BOOLEAN AuditPrivileges ;
 780   UNICODE_STRING ObjectName ;
 781   UNICODE_STRING ObjectTypeName ;
 782};
 783typedef struct _ACCESS_STATE *PACCESS_STATE;
 784struct _DEVICE_OBJECT;
 785struct _DEVICE_OBJECT;
 786struct _DRIVER_OBJECT;
 787struct _FILE_OBJECT;
 788struct _FILE_OBJECT;
 789struct _IRP;
 790struct _IRP;
 791struct _SCSI_REQUEST_BLOCK;
 792struct _SCSI_REQUEST_BLOCK;
 793typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp );
 794struct _COMPRESSED_DATA_INFO;
 795struct _FAST_IO_DISPATCH {
 796   ULONG SizeOfFastIoDispatch ;
 797   BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 798                                    ULONG Length , BOOLEAN Wait , ULONG LockKey ,
 799                                    BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus ,
 800                                    struct _DEVICE_OBJECT *DeviceObject ) ;
 801   BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 802                         ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 803                         PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 804   BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 805                          ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 806                          PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 807   BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 808                                   PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 809                                   struct _DEVICE_OBJECT *DeviceObject ) ;
 810   BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 811                                      PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 812                                      struct _DEVICE_OBJECT *DeviceObject ) ;
 813   BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 814                         PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 815                         BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus ,
 816                         struct _DEVICE_OBJECT *DeviceObject ) ;
 817   BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 818                                 PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 819                                 PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 820   BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId ,
 821                              PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 822   BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId ,
 823                                   ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 824   BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 825                                  PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
 826                                  ULONG OutputBufferLength , ULONG IoControlCode ,
 827                                  PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 828   void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 829   void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 830   void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ;
 831   BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 832                                         struct _FILE_NETWORK_OPEN_INFORMATION *Buffer ,
 833                                         struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 834   NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset ,
 835                                  struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ;
 836   BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 837                      ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 838                      struct _DEVICE_OBJECT *DeviceObject ) ;
 839   BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 840   BOOLEAN (*PrepareMdlWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 841                              ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 842                              struct _DEVICE_OBJECT *DeviceObject ) ;
 843   BOOLEAN (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 844                               PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 845   BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 846                                   ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain ,
 847                                   PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 848                                   ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 849   BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 850                                    ULONG Length , ULONG LockKey , PVOID Buffer ,
 851                                    PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 852                                    ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 853   BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain ,
 854                                        struct _DEVICE_OBJECT *DeviceObject ) ;
 855   BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 856                                         PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 857   BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation ,
 858                              struct _DEVICE_OBJECT *DeviceObject ) ;
 859   NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease ,
 860                                  struct _DEVICE_OBJECT *DeviceObject ) ;
 861   NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 862   NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 863};
 864typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH;
 865enum _IO_ALLOCATION_ACTION {
 866    KeepObject = 1,
 867    DeallocateObject = 2,
 868    DeallocateObjectKeepRegisters = 3
 869} ;
 870typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION;
 871struct _IO_SECURITY_CONTEXT {
 872   PSECURITY_QUALITY_OF_SERVICE SecurityQos ;
 873   PACCESS_STATE AccessState ;
 874   ACCESS_MASK DesiredAccess ;
 875   ULONG FullCreateOptions ;
 876};
 877typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT;
 878struct _VPB {
 879   CSHORT Type ;
 880   CSHORT Size ;
 881   USHORT Flags ;
 882   USHORT VolumeLabelLength ;
 883   struct _DEVICE_OBJECT *DeviceObject ;
 884   struct _DEVICE_OBJECT *RealDevice ;
 885   ULONG SerialNumber ;
 886   ULONG ReferenceCount ;
 887   WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ;
 888};
 889typedef struct _VPB *PVPB;
 890struct _WAIT_CONTEXT_BLOCK {
 891   KDEVICE_QUEUE_ENTRY WaitQueueEntry ;
 892   IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ,
 893                                         PVOID MapRegisterBase , PVOID Context ) ;
 894   PVOID DeviceContext ;
 895   ULONG NumberOfMapRegisters ;
 896   PVOID DeviceObject ;
 897   PVOID CurrentIrp ;
 898   PKDPC BufferChainingDpc ;
 899};
 900typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK;
 901union __anonunion_Queue_43 {
 902   LIST_ENTRY ListEntry ;
 903   WAIT_CONTEXT_BLOCK Wcb ;
 904};
 905struct _DEVOBJ_EXTENSION;
 906struct _DEVICE_OBJECT {
 907   CSHORT Type ;
 908   USHORT Size ;
 909   LONG ReferenceCount ;
 910   struct _DRIVER_OBJECT *DriverObject ;
 911   struct _DEVICE_OBJECT *NextDevice ;
 912   struct _DEVICE_OBJECT *AttachedDevice ;
 913   struct _IRP *CurrentIrp ;
 914   PIO_TIMER Timer ;
 915   ULONG Flags ;
 916   ULONG Characteristics ;
 917   PVPB Vpb ;
 918   PVOID DeviceExtension ;
 919   ULONG DeviceType ;
 920   CCHAR StackSize ;
 921   union __anonunion_Queue_43 Queue ;
 922   ULONG AlignmentRequirement ;
 923   KDEVICE_QUEUE DeviceQueue ;
 924   KDPC Dpc ;
 925   ULONG ActiveThreadCount ;
 926   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 927   KEVENT DeviceLock ;
 928   USHORT SectorSize ;
 929   USHORT Spare1 ;
 930   struct _DEVOBJ_EXTENSION *DeviceObjectExtension ;
 931   PVOID Reserved ;
 932};
 933typedef struct _DEVICE_OBJECT DEVICE_OBJECT;
 934typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
 935struct _DEVOBJ_EXTENSION {
 936   CSHORT Type ;
 937   USHORT Size ;
 938   PDEVICE_OBJECT DeviceObject ;
 939};
 940struct _DRIVER_EXTENSION {
 941   struct _DRIVER_OBJECT *DriverObject ;
 942   NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ;
 943   ULONG Count ;
 944   UNICODE_STRING ServiceKeyName ;
 945};
 946typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION;
 947struct _DRIVER_OBJECT {
 948   CSHORT Type ;
 949   CSHORT Size ;
 950   PDEVICE_OBJECT DeviceObject ;
 951   ULONG Flags ;
 952   PVOID DriverStart ;
 953   ULONG DriverSize ;
 954   PVOID DriverSection ;
 955   PDRIVER_EXTENSION DriverExtension ;
 956   UNICODE_STRING DriverName ;
 957   PUNICODE_STRING HardwareDatabase ;
 958   PFAST_IO_DISPATCH FastIoDispatch ;
 959   NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ;
 960   void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
 961   void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ;
 962   PDRIVER_DISPATCH MajorFunction[28] ;
 963};
 964typedef struct _DRIVER_OBJECT DRIVER_OBJECT;
 965typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
 966struct _SECTION_OBJECT_POINTERS {
 967   PVOID DataSectionObject ;
 968   PVOID SharedCacheMap ;
 969   PVOID ImageSectionObject ;
 970};
 971typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS;
 972typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS;
 973struct _IO_COMPLETION_CONTEXT {
 974   PVOID Port ;
 975   PVOID Key ;
 976};
 977typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT;
 978struct _FILE_OBJECT {
 979   CSHORT Type ;
 980   CSHORT Size ;
 981   PDEVICE_OBJECT DeviceObject ;
 982   PVPB Vpb ;
 983   PVOID FsContext ;
 984   PVOID FsContext2 ;
 985   PSECTION_OBJECT_POINTERS SectionObjectPointer ;
 986   PVOID PrivateCacheMap ;
 987   NTSTATUS FinalStatus ;
 988   struct _FILE_OBJECT *RelatedFileObject ;
 989   BOOLEAN LockOperation ;
 990   BOOLEAN DeletePending ;
 991   BOOLEAN ReadAccess ;
 992   BOOLEAN WriteAccess ;
 993   BOOLEAN DeleteAccess ;
 994   BOOLEAN SharedRead ;
 995   BOOLEAN SharedWrite ;
 996   BOOLEAN SharedDelete ;
 997   ULONG Flags ;
 998   UNICODE_STRING FileName ;
 999   LARGE_INTEGER CurrentByteOffset ;
1000   ULONG Waiters ;
1001   ULONG Busy ;
1002   PVOID LastLock ;
1003   KEVENT Lock ;
1004   KEVENT Event ;
1005   PIO_COMPLETION_CONTEXT CompletionContext ;
1006};
1007typedef struct _FILE_OBJECT *PFILE_OBJECT;
1008union __anonunion_AssociatedIrp_44 {
1009   struct _IRP *MasterIrp ;
1010   LONG IrpCount ;
1011   PVOID SystemBuffer ;
1012};
1013struct __anonstruct_AsynchronousParameters_46 {
1014   void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock ,
1015                                                          ULONG Reserved ) ;
1016   PVOID UserApcContext ;
1017};
1018union __anonunion_Overlay_45 {
1019   struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ;
1020   LARGE_INTEGER AllocationSize ;
1021};
1022struct __anonstruct____missing_field_name_50 {
1023   PVOID DriverContext[4] ;
1024};
1025union __anonunion____missing_field_name_49 {
1026   KDEVICE_QUEUE_ENTRY DeviceQueueEntry ;
1027   struct __anonstruct____missing_field_name_50 __annonCompField14 ;
1028};
1029struct _IO_STACK_LOCATION;
1030union __anonunion____missing_field_name_52 {
1031   struct _IO_STACK_LOCATION *CurrentStackLocation ;
1032   ULONG PacketType ;
1033};
1034struct __anonstruct____missing_field_name_51 {
1035   LIST_ENTRY ListEntry ;
1036   union __anonunion____missing_field_name_52 __annonCompField16 ;
1037};
1038struct __anonstruct_Overlay_48 {
1039   union __anonunion____missing_field_name_49 __annonCompField15 ;
1040   PETHREAD Thread ;
1041   PCHAR AuxiliaryBuffer ;
1042   struct __anonstruct____missing_field_name_51 __annonCompField17 ;
1043   PFILE_OBJECT OriginalFileObject ;
1044};
1045union __anonunion_Tail_47 {
1046   struct __anonstruct_Overlay_48 Overlay ;
1047   KAPC Apc ;
1048   PVOID CompletionKey ;
1049};
1050struct _IRP {
1051   CSHORT Type ;
1052   USHORT Size ;
1053   PMDL MdlAddress ;
1054   ULONG Flags ;
1055   union __anonunion_AssociatedIrp_44 AssociatedIrp ;
1056   LIST_ENTRY ThreadListEntry ;
1057   IO_STATUS_BLOCK IoStatus ;
1058   KPROCESSOR_MODE RequestorMode ;
1059   BOOLEAN PendingReturned ;
1060   CHAR StackCount ;
1061   CHAR CurrentLocation ;
1062   BOOLEAN Cancel ;
1063   KIRQL CancelIrql ;
1064   CCHAR ApcEnvironment ;
1065   UCHAR AllocationFlags ;
1066   PIO_STATUS_BLOCK UserIosb ;
1067   PKEVENT UserEvent ;
1068   union __anonunion_Overlay_45 Overlay ;
1069   void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
1070   PVOID UserBuffer ;
1071   union __anonunion_Tail_47 Tail ;
1072};
1073typedef struct _IRP IRP;
1074typedef struct _IRP *PIRP;
1075enum _DEVICE_RELATION_TYPE {
1076    BusRelations = 0,
1077    EjectionRelations = 1,
1078    PowerRelations = 2,
1079    RemovalRelations = 3,
1080    TargetDeviceRelation = 4
1081} ;
1082typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE;
1083enum _DEVICE_USAGE_NOTIFICATION_TYPE {
1084    DeviceUsageTypeUndefined = 0,
1085    DeviceUsageTypePaging = 1,
1086    DeviceUsageTypeHibernation = 2,
1087    DeviceUsageTypeDumpFile = 3
1088} ;
1089typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE;
1090struct _INTERFACE {
1091   USHORT Size ;
1092   USHORT Version ;
1093   PVOID Context ;
1094   void (*InterfaceReference)(PVOID Context ) ;
1095   void (*InterfaceDereference)(PVOID Context ) ;
1096};
1097typedef struct _INTERFACE *PINTERFACE;
1098struct _DEVICE_CAPABILITIES {
1099   USHORT Size ;
1100   USHORT Version ;
1101   ULONG DeviceD1 : 1 ;
1102   ULONG DeviceD2 : 1 ;
1103   ULONG LockSupported : 1 ;
1104   ULONG EjectSupported : 1 ;
1105   ULONG Removable : 1 ;
1106   ULONG DockDevice : 1 ;
1107   ULONG UniqueID : 1 ;
1108   ULONG SilentInstall : 1 ;
1109   ULONG RawDeviceOK : 1 ;
1110   ULONG SurpriseRemovalOK : 1 ;
1111   ULONG WakeFromD0 : 1 ;
1112   ULONG WakeFromD1 : 1 ;
1113   ULONG WakeFromD2 : 1 ;
1114   ULONG WakeFromD3 : 1 ;
1115   ULONG HardwareDisabled : 1 ;
1116   ULONG NonDynamic : 1 ;
1117   ULONG WarmEjectSupported : 1 ;
1118   ULONG Reserved : 15 ;
1119   ULONG Address ;
1120   ULONG UINumber ;
1121   DEVICE_POWER_STATE DeviceState[7] ;
1122   SYSTEM_POWER_STATE SystemWake ;
1123   DEVICE_POWER_STATE DeviceWake ;
1124   ULONG D1Latency ;
1125   ULONG D2Latency ;
1126   ULONG D3Latency ;
1127};
1128typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES;
1129struct _POWER_SEQUENCE {
1130   ULONG SequenceD1 ;
1131   ULONG SequenceD2 ;
1132   ULONG SequenceD3 ;
1133};
1134typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE;
1135enum __anonenum_BUS_QUERY_ID_TYPE_53 {
1136    BusQueryDeviceID = 0,
1137    BusQueryHardwareIDs = 1,
1138    BusQueryCompatibleIDs = 2,
1139    BusQueryInstanceID = 3,
1140    BusQueryDeviceSerialNumber = 4
1141} ;
1142typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE;
1143enum __anonenum_DEVICE_TEXT_TYPE_54 {
1144    DeviceTextDescription = 0,
1145    DeviceTextLocationInformation = 1
1146} ;
1147typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE;
1148#pragma pack(push,4)
1149struct __anonstruct_Create_56 {
1150   PIO_SECURITY_CONTEXT SecurityContext ;
1151   ULONG Options ;
1152   USHORT FileAttributes ;
1153   USHORT ShareAccess ;
1154   ULONG EaLength ;
1155};
1156struct __anonstruct_Read_57 {
1157   ULONG Length ;
1158   ULONG Key ;
1159   LARGE_INTEGER ByteOffset ;
1160};
1161struct __anonstruct_Write_58 {
1162   ULONG Length ;
1163   ULONG Key ;
1164   LARGE_INTEGER ByteOffset ;
1165};
1166struct __anonstruct_QueryFile_59 {
1167   ULONG Length ;
1168   FILE_INFORMATION_CLASS FileInformationClass ;
1169};
1170struct __anonstruct____missing_field_name_62 {
1171   BOOLEAN ReplaceIfExists ;
1172   BOOLEAN AdvanceOnly ;
1173};
1174union __anonunion____missing_field_name_61 {
1175   struct __anonstruct____missing_field_name_62 __annonCompField18 ;
1176   ULONG ClusterCount ;
1177   HANDLE DeleteHandle ;
1178};
1179struct __anonstruct_SetFile_60 {
1180   ULONG Length ;
1181   FILE_INFORMATION_CLASS FileInformationClass ;
1182   PFILE_OBJECT FileObject ;
1183   union __anonunion____missing_field_name_61 __annonCompField19 ;
1184};
1185struct __anonstruct_QueryVolume_63 {
1186   ULONG Length ;
1187   FS_INFORMATION_CLASS FsInformationClass ;
1188};
1189struct __anonstruct_DeviceIoControl_64 {
1190   ULONG OutputBufferLength ;
1191   ULONG InputBufferLength ;
1192   ULONG IoControlCode ;
1193   PVOID Type3InputBuffer ;
1194};
1195struct __anonstruct_QuerySecurity_65 {
1196   SECURITY_INFORMATION SecurityInformation ;
1197   ULONG Length ;
1198};
1199struct __anonstruct_SetSecurity_66 {
1200   SECURITY_INFORMATION SecurityInformation ;
1201   PSECURITY_DESCRIPTOR SecurityDescriptor ;
1202};
1203struct __anonstruct_MountVolume_67 {
1204   PVPB Vpb ;
1205   PDEVICE_OBJECT DeviceObject ;
1206};
1207struct __anonstruct_VerifyVolume_68 {
1208   PVPB Vpb ;
1209   PDEVICE_OBJECT DeviceObject ;
1210};
1211struct __anonstruct_Scsi_69 {
1212   struct _SCSI_REQUEST_BLOCK *Srb ;
1213};
1214struct __anonstruct_QueryDeviceRelations_70 {
1215   DEVICE_RELATION_TYPE Type ;
1216};
1217struct __anonstruct_QueryInterface_71 {
1218   GUID const   *InterfaceType ;
1219   USHORT Size ;
1220   USHORT Version ;
1221   PINTERFACE Interface ;
1222   PVOID InterfaceSpecificData ;
1223};
1224struct __anonstruct_DeviceCapabilities_72 {
1225   PDEVICE_CAPABILITIES Capabilities ;
1226};
1227struct __anonstruct_FilterResourceRequirements_73 {
1228   PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ;
1229};
1230struct __anonstruct_ReadWriteConfig_74 {
1231   ULONG WhichSpace ;
1232   PVOID Buffer ;
1233   ULONG Offset ;
1234   ULONG Length ;
1235};
1236struct __anonstruct_SetLock_75 {
1237   BOOLEAN Lock ;
1238};
1239struct __anonstruct_QueryId_76 {
1240   BUS_QUERY_ID_TYPE IdType ;
1241};
1242struct __anonstruct_QueryDeviceText_77 {
1243   DEVICE_TEXT_TYPE DeviceTextType ;
1244   LCID LocaleId ;
1245};
1246struct __anonstruct_UsageNotification_78 {
1247   BOOLEAN InPath ;
1248   BOOLEAN Reserved[3] ;
1249   DEVICE_USAGE_NOTIFICATION_TYPE Type ;
1250};
1251struct __anonstruct_WaitWake_79 {
1252   SYSTEM_POWER_STATE PowerState ;
1253};
1254struct __anonstruct_PowerSequence_80 {
1255   PPOWER_SEQUENCE PowerSequence ;
1256};
1257struct __anonstruct_Power_81 {
1258   ULONG SystemContext ;
1259   POWER_STATE_TYPE Type ;
1260   POWER_STATE State ;
1261   POWER_ACTION ShutdownType ;
1262};
1263struct __anonstruct_StartDevice_82 {
1264   PCM_RESOURCE_LIST AllocatedResources ;
1265   PCM_RESOURCE_LIST AllocatedResourcesTranslated ;
1266};
1267struct __anonstruct_WMI_83 {
1268   ULONG_PTR ProviderId ;
1269   PVOID DataPath ;
1270   ULONG BufferSize ;
1271   PVOID Buffer ;
1272};
1273struct __anonstruct_Others_84 {
1274   PVOID Argument1 ;
1275   PVOID Argument2 ;
1276   PVOID Argument3 ;
1277   PVOID Argument4 ;
1278};
1279union __anonunion_Parameters_55 {
1280   struct __anonstruct_Create_56 Create ;
1281   struct __anonstruct_Read_57 Read ;
1282   struct __anonstruct_Write_58 Write ;
1283   struct __anonstruct_QueryFile_59 QueryFile ;
1284   struct __anonstruct_SetFile_60 SetFile ;
1285   struct __anonstruct_QueryVolume_63 QueryVolume ;
1286   struct __anonstruct_DeviceIoControl_64 DeviceIoControl ;
1287   struct __anonstruct_QuerySecurity_65 QuerySecurity ;
1288   struct __anonstruct_SetSecurity_66 SetSecurity ;
1289   struct __anonstruct_MountVolume_67 MountVolume ;
1290   struct __anonstruct_VerifyVolume_68 VerifyVolume ;
1291   struct __anonstruct_Scsi_69 Scsi ;
1292   struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ;
1293   struct __anonstruct_QueryInterface_71 QueryInterface ;
1294   struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ;
1295   struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ;
1296   struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ;
1297   struct __anonstruct_SetLock_75 SetLock ;
1298   struct __anonstruct_QueryId_76 QueryId ;
1299   struct __anonstruct_QueryDeviceText_77 QueryDeviceText ;
1300   struct __anonstruct_UsageNotification_78 UsageNotification ;
1301   struct __anonstruct_WaitWake_79 WaitWake ;
1302   struct __anonstruct_PowerSequence_80 PowerSequence ;
1303   struct __anonstruct_Power_81 Power ;
1304   struct __anonstruct_StartDevice_82 StartDevice ;
1305   struct __anonstruct_WMI_83 WMI ;
1306   struct __anonstruct_Others_84 Others ;
1307};
1308struct _IO_STACK_LOCATION {
1309   UCHAR MajorFunction ;
1310   UCHAR MinorFunction ;
1311   UCHAR Flags ;
1312   UCHAR Control ;
1313   union __anonunion_Parameters_55 Parameters ;
1314   PDEVICE_OBJECT DeviceObject ;
1315   PFILE_OBJECT FileObject ;
1316   NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
1317   PVOID Context ;
1318};
1319typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION;
1320typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION;
1321#pragma pack(pop)
1322struct _CONFIGURATION_INFORMATION {
1323   ULONG DiskCount ;
1324   ULONG FloppyCount ;
1325   ULONG CdRomCount ;
1326   ULONG TapeCount ;
1327   ULONG ScsiPortCount ;
1328   ULONG SerialCount ;
1329   ULONG ParallelCount ;
1330   BOOLEAN AtDiskPrimaryAddressClaimed ;
1331   BOOLEAN AtDiskSecondaryAddressClaimed ;
1332   ULONG Version ;
1333   ULONG MediumChangerCount ;
1334};
1335typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION;
1336typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION;
1337struct _OBJECT_HANDLE_INFORMATION {
1338   ULONG HandleAttributes ;
1339   ACCESS_MASK GrantedAccess ;
1340};
1341typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
1342struct _SCSI_PASS_THROUGH {
1343   USHORT Length ;
1344   UCHAR ScsiStatus ;
1345   UCHAR PathId ;
1346   UCHAR TargetId ;
1347   UCHAR Lun ;
1348   UCHAR CdbLength ;
1349   UCHAR SenseInfoLength ;
1350   UCHAR DataIn ;
1351   ULONG DataTransferLength ;
1352   ULONG TimeOutValue ;
1353   ULONG_PTR DataBufferOffset ;
1354   ULONG SenseInfoOffset ;
1355   UCHAR Cdb[16] ;
1356};
1357typedef struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH;
1358typedef struct _SCSI_PASS_THROUGH *PSCSI_PASS_THROUGH;
1359struct _TRACK_DATA {
1360   UCHAR Reserved ;
1361   UCHAR Control : 4 ;
1362   UCHAR Adr : 4 ;
1363   UCHAR TrackNumber ;
1364   UCHAR Reserved1 ;
1365   UCHAR Address[4] ;
1366};
1367typedef struct _TRACK_DATA TRACK_DATA;
1368struct _CDROM_TOC {
1369   UCHAR Length[2] ;
1370   UCHAR FirstTrack ;
1371   UCHAR LastTrack ;
1372   TRACK_DATA TrackData[100] ;
1373};
1374typedef struct _CDROM_TOC CDROM_TOC;
1375typedef struct _CDROM_TOC *PCDROM_TOC;
1376struct _CDROM_PLAY_AUDIO_MSF {
1377   UCHAR StartingM ;
1378   UCHAR StartingS ;
1379   UCHAR StartingF ;
1380   UCHAR EndingM ;
1381   UCHAR EndingS ;
1382   UCHAR EndingF ;
1383};
1384typedef struct _CDROM_PLAY_AUDIO_MSF CDROM_PLAY_AUDIO_MSF;
1385typedef struct _CDROM_PLAY_AUDIO_MSF *PCDROM_PLAY_AUDIO_MSF;
1386struct _CDROM_SEEK_AUDIO_MSF {
1387   UCHAR M ;
1388   UCHAR S ;
1389   UCHAR F ;
1390};
1391typedef struct _CDROM_SEEK_AUDIO_MSF CDROM_SEEK_AUDIO_MSF;
1392typedef struct _CDROM_SEEK_AUDIO_MSF *PCDROM_SEEK_AUDIO_MSF;
1393struct _CDROM_SUB_Q_DATA_FORMAT {
1394   UCHAR Format ;
1395   UCHAR Track ;
1396};
1397struct _SUB_Q_HEADER {
1398   UCHAR Reserved ;
1399   UCHAR AudioStatus ;
1400   UCHAR DataLength[2] ;
1401};
1402typedef struct _SUB_Q_HEADER SUB_Q_HEADER;
1403struct _SUB_Q_CURRENT_POSITION {
1404   SUB_Q_HEADER Header ;
1405   UCHAR FormatCode ;
1406   UCHAR Control : 4 ;
1407   UCHAR ADR : 4 ;
1408   UCHAR TrackNumber ;
1409   UCHAR IndexNumber ;
1410   UCHAR AbsoluteAddress[4] ;
1411   UCHAR TrackRelativeAddress[4] ;
1412};
1413typedef struct _SUB_Q_CURRENT_POSITION SUB_Q_CURRENT_POSITION;
1414typedef struct _SUB_Q_CURRENT_POSITION *PSUB_Q_CURRENT_POSITION;
1415struct _SUB_Q_MEDIA_CATALOG_NUMBER {
1416   SUB_Q_HEADER Header ;
1417   UCHAR FormatCode ;
1418   UCHAR Reserved[3] ;
1419   UCHAR Reserved1 : 7 ;
1420   UCHAR Mcval : 1 ;
1421   UCHAR MediaCatalog[15] ;
1422};
1423typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER SUB_Q_MEDIA_CATALOG_NUMBER;
1424struct _SUB_Q_TRACK_ISRC {
1425   SUB_Q_HEADER Header ;
1426   UCHAR FormatCode ;
1427   UCHAR Reserved0 ;
1428   UCHAR Track ;
1429   UCHAR Reserved1 ;
1430   UCHAR Reserved2 : 7 ;
1431   UCHAR Tcval : 1 ;
1432   UCHAR TrackIsrc[15] ;
1433};
1434typedef struct _SUB_Q_TRACK_ISRC SUB_Q_TRACK_ISRC;
1435union _SUB_Q_CHANNEL_DATA {
1436   SUB_Q_CURRENT_POSITION CurrentPosition ;
1437   SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog ;
1438   SUB_Q_TRACK_ISRC TrackIsrc ;
1439};
1440typedef union _SUB_Q_CHANNEL_DATA SUB_Q_CHANNEL_DATA;
1441#pragma pack(push,8)
1442#pragma pack(pop)
1443union __anonunion____missing_field_name_116 {
1444   ULONG InternalStatus ;
1445   ULONG QueueSortKey ;
1446};
1447struct _SCSI_REQUEST_BLOCK {
1448   USHORT Length ;
1449   UCHAR Function ;
1450   UCHAR SrbStatus ;
1451   UCHAR ScsiStatus ;
1452   UCHAR PathId ;
1453   UCHAR TargetId ;
1454   UCHAR Lun ;
1455   UCHAR QueueTag ;
1456   UCHAR QueueAction ;
1457   UCHAR CdbLength ;
1458   UCHAR SenseInfoBufferLength ;
1459   ULONG SrbFlags ;
1460   ULONG DataTransferLength ;
1461   ULONG TimeOutValue ;
1462   PVOID DataBuffer ;
1463   PVOID SenseInfoBuffer ;
1464   struct _SCSI_REQUEST_BLOCK *NextSrb ;
1465   PVOID OriginalRequest ;
1466   PVOID SrbExtension ;
1467   union __anonunion____missing_field_name_116 __annonCompField21 ;
1468   UCHAR Cdb[16] ;
1469};
1470struct _CDB6GENERIC {
1471   UCHAR OperationCode ;
1472   UCHAR Immediate : 1 ;
1473   UCHAR CommandUniqueBits : 4 ;
1474   UCHAR LogicalUnitNumber : 3 ;
1475   UCHAR CommandUniqueBytes[3] ;
1476   UCHAR Link : 1 ;
1477   UCHAR Flag : 1 ;
1478   UCHAR Reserved : 4 ;
1479   UCHAR VendorUnique : 2 ;
1480};
1481struct _CDB6READWRITE {
1482   UCHAR OperationCode ;
1483   UCHAR LogicalBlockMsb1 : 5 ;
1484   UCHAR LogicalUnitNumber : 3 ;
1485   UCHAR LogicalBlockMsb0 ;
1486   UCHAR LogicalBlockLsb ;
1487   UCHAR TransferBlocks ;
1488   UCHAR Control ;
1489};
1490struct _CDB6INQUIRY {
1491   UCHAR OperationCode ;
1492   UCHAR Reserved1 : 5 ;
1493   UCHAR LogicalUnitNumber : 3 ;
1494   UCHAR PageCode ;
1495   UCHAR IReserved ;
1496   UCHAR AllocationLength ;
1497   UCHAR Control ;
1498};
1499struct _CDB6VERIFY {
1500   UCHAR OperationCode ;
1501   UCHAR Fixed : 1 ;
1502   UCHAR ByteCompare : 1 ;
1503   UCHAR Immediate : 1 ;
1504   UCHAR Reserved : 2 ;
1505   UCHAR LogicalUnitNumber : 3 ;
1506   UCHAR VerificationLength[3] ;
1507   UCHAR Control ;
1508};
1509struct _CDB6FORMAT {
1510   UCHAR OperationCode ;
1511   UCHAR FormatControl : 5 ;
1512   UCHAR LogicalUnitNumber : 3 ;
1513   UCHAR FReserved1 ;
1514   UCHAR InterleaveMsb ;
1515   UCHAR InterleaveLsb ;
1516   UCHAR FReserved2 ;
1517};
1518struct _CDB10 {
1519   UCHAR OperationCode ;
1520   UCHAR RelativeAddress : 1 ;
1521   UCHAR Reserved1 : 2 ;
1522   UCHAR ForceUnitAccess : 1 ;
1523   UCHAR DisablePageOut : 1 ;
1524   UCHAR LogicalUnitNumber : 3 ;
1525   UCHAR LogicalBlockByte0 ;
1526   UCHAR LogicalBlockByte1 ;
1527   UCHAR LogicalBlockByte2 ;
1528   UCHAR LogicalBlockByte3 ;
1529   UCHAR Reserved2 ;
1530   UCHAR TransferBlocksMsb ;
1531   UCHAR TransferBlocksLsb ;
1532   UCHAR Control ;
1533};
1534struct _CDB12 {
1535   UCHAR OperationCode ;
1536   UCHAR RelativeAddress : 1 ;
1537   UCHAR Reserved1 : 2 ;
1538   UCHAR ForceUnitAccess : 1 ;
1539   UCHAR DisablePageOut : 1 ;
1540   UCHAR LogicalUnitNumber : 3 ;
1541   UCHAR LogicalBlock[4] ;
1542   UCHAR TransferLength[4] ;
1543   UCHAR Reserved2 ;
1544   UCHAR Control ;
1545};
1546struct _PAUSE_RESUME {
1547   UCHAR OperationCode ;
1548   UCHAR Reserved1 : 5 ;
1549   UCHAR LogicalUnitNumber : 3 ;
1550   UCHAR Reserved2[6] ;
1551   UCHAR Action ;
1552   UCHAR Control ;
1553};
1554struct _READ_TOC {
1555   UCHAR OperationCode ;
1556   UCHAR Reserved0 : 1 ;
1557   UCHAR Msf : 1 ;
1558   UCHAR Reserved1 : 3 ;
1559   UCHAR LogicalUnitNumber : 3 ;
1560   UCHAR Format2 : 4 ;
1561   UCHAR Reserved2 : 4 ;
1562   UCHAR Reserved3[3] ;
1563   UCHAR StartingTrack ;
1564   UCHAR AllocationLength[2] ;
1565   UCHAR Control : 6 ;
1566   UCHAR Format : 2 ;
1567};
1568struct _READ_DISK_INFORMATION {
1569   UCHAR OperationCode ;
1570   UCHAR Reserved1 : 5 ;
1571   UCHAR Lun : 3 ;
1572   UCHAR Reserved2[5] ;
1573   UCHAR AllocationLength[2] ;
1574   UCHAR Control ;
1575};
1576struct _READ_TRACK_INFORMATION {
1577   UCHAR OperationCode ;
1578   UCHAR Track : 1 ;
1579   UCHAR Reserved1 : 3 ;
1580   UCHAR Reserved2 : 1 ;
1581   UCHAR Lun : 3 ;
1582   UCHAR BlockAddress[4] ;
1583   UCHAR Reserved3 ;
1584   UCHAR AllocationLength[2] ;
1585   UCHAR Control ;
1586};
1587struct _READ_HEADER {
1588   UCHAR OperationCode ;
1589   UCHAR Reserved1 : 1 ;
1590   UCHAR Msf : 1 ;
1591   UCHAR Reserved2 : 3 ;
1592   UCHAR Lun : 3 ;
1593   UCHAR LogicalBlockAddress[4] ;
1594   UCHAR Reserved3 ;
1595   UCHAR AllocationLength[2] ;
1596   UCHAR Control ;
1597};
1598struct _PLAY_AUDIO {
1599   UCHAR OperationCode ;
1600   UCHAR Reserved1 : 5 ;
1601   UCHAR LogicalUnitNumber : 3 ;
1602   UCHAR StartingBlockAddress[4] ;
1603   UCHAR Reserved2 ;
1604   UCHAR PlayLength[2] ;
1605   UCHAR Control ;
1606};
1607struct _PLAY_AUDIO_MSF {
1608   UCHAR OperationCode ;
1609   UCHAR Reserved1 : 5 ;
1610   UCHAR LogicalUnitNumber : 3 ;
1611   UCHAR Reserved2 ;
1612   UCHAR StartingM ;
1613   UCHAR StartingS ;
1614   UCHAR StartingF ;
1615   UCHAR EndingM ;
1616   UCHAR EndingS ;
1617   UCHAR EndingF ;
1618   UCHAR Control ;
1619};
1620struct _LBA {
1621   UCHAR StartingBlockAddress[4] ;
1622   UCHAR PlayLength[4] ;
1623};
1624struct _MSF {
1625   UCHAR Reserved1 ;
1626   UCHAR StartingM ;
1627   UCHAR StartingS ;
1628   UCHAR StartingF ;
1629   UCHAR EndingM ;
1630   UCHAR EndingS ;
1631   UCHAR EndingF ;
1632   UCHAR Reserved2 ;
1633};
1634union __anonunion____missing_field_name_117 {
1635   struct _LBA LBA ;
1636   struct _MSF MSF ;
1637};
1638struct _PLAY_CD {
1639   UCHAR OperationCode ;
1640   UCHAR Reserved1 : 1 ;
1641   UCHAR CMSF : 1 ;
1642   UCHAR ExpectedSectorType : 3 ;
1643   UCHAR Lun : 3 ;
1644   union __anonunion____missing_field_name_117 __annonCompField22 ;
1645   UCHAR Audio : 1 ;
1646   UCHAR Composite : 1 ;
1647   UCHAR Port1 : 1 ;
1648   UCHAR Port2 : 1 ;
1649   UCHAR Reserved2 : 3 ;
1650   UCHAR Speed : 1 ;
1651   UCHAR Control ;
1652};
1653struct _SCAN_CD {
1654   UCHAR OperationCode ;
1655   UCHAR RelativeAddress : 1 ;
1656   UCHAR Reserved1 : 3 ;
1657   UCHAR Direct : 1 ;
1658   UCHAR Lun : 3 ;
1659   UCHAR StartingAddress[4] ;
1660   UCHAR Reserved2[3] ;
1661   UCHAR Reserved3 : 6 ;
1662   UCHAR Type : 2 ;
1663   UCHAR Reserved4 ;
1664   UCHAR Control ;
1665};
1666struct _STOP_PLAY_SCAN {
1667   UCHAR OperationCode ;
1668   UCHAR Reserved1 : 5 ;
1669   UCHAR Lun : 3 ;
1670   UCHAR Reserved2[7] ;
1671   UCHAR Control ;
1672};
1673struct _SUBCHANNEL {
1674   UCHAR OperationCode ;
1675   UCHAR Reserved0 : 1 ;
1676   UCHAR Msf : 1 ;
1677   UCHAR Reserved1 : 3 ;
1678   UCHAR LogicalUnitNumber : 3 ;
1679   UCHAR Reserved2 : 6 ;
1680   UCHAR SubQ : 1 ;
1681   UCHAR Reserved3 : 1 ;
1682   UCHAR Format ;
1683   UCHAR Reserved4[2] ;
1684   UCHAR TrackNumber ;
1685   UCHAR AllocationLength[2] ;
1686   UCHAR Control ;
1687};
1688struct _READ_CD {
1689   UCHAR OperationCode ;
1690   UCHAR RelativeAddress : 1 ;
1691   UCHAR Reserved0 : 1 ;
1692   UCHAR ExpectedSectorType : 3 ;
1693   UCHAR Lun : 3 ;
1694   UCHAR StartingLBA[4] ;
1695   UCHAR TransferBlocks[3] ;
1696   UCHAR Reserved2 : 1 ;
1697   UCHAR ErrorFlags : 2 ;
1698   UCHAR IncludeEDC : 1 ;
1699   UCHAR IncludeUserData : 1 ;
1700   UCHAR HeaderCode : 2 ;
1701   UCHAR IncludeSyncData : 1 ;
1702   UCHAR SubChannelSelection : 3 ;
1703   UCHAR Reserved3 : 5 ;
1704   UCHAR Control ;
1705};
1706struct _READ_CD_MSF {
1707   UCHAR OperationCode ;
1708   UCHAR RelativeAddress : 1 ;
1709   UCHAR Reserved1 : 1 ;
1710   UCHAR ExpectedSectorType : 3 ;
1711   UCHAR Lun : 3 ;
1712   UCHAR Reserved2 ;
1713   UCHAR StartingM ;
1714   UCHAR StartingS ;
1715   UCHAR StartingF ;
1716   UCHAR EndingM ;
1717   UCHAR EndingS ;
1718   UCHAR EndingF ;
1719   UCHAR Reserved3 ;
1720   UCHAR Reserved4 : 1 ;
1721   UCHAR ErrorFlags : 2 ;
1722   UCHAR IncludeEDC : 1 ;
1723   UCHAR IncludeUserData : 1 ;
1724   UCHAR HeaderCode : 2 ;
1725   UCHAR IncludeSyncData : 1 ;
1726   UCHAR SubChannelSelection : 3 ;
1727   UCHAR Reserved5 : 5 ;
1728   UCHAR Control ;
1729};
1730struct _PLXTR_READ_CDDA {
1731   UCHAR OperationCode ;
1732   UCHAR Reserved0 : 5 ;
1733   UCHAR LogicalUnitNumber : 3 ;
1734   UCHAR LogicalBlockByte0 ;
1735   UCHAR LogicalBlockByte1 ;
1736   UCHAR LogicalBlockByte2 ;
1737   UCHAR LogicalBlockByte3 ;
1738   UCHAR TransferBlockByte0 ;
1739   UCHAR TransferBlockByte1 ;
1740   UCHAR TransferBlockByte2 ;
1741   UCHAR TransferBlockByte3 ;
1742   UCHAR SubCode ;
1743   UCHAR Control ;
1744};
1745struct _NEC_READ_CDDA {
1746   UCHAR OperationCode ;
1747   UCHAR Reserved0 ;
1748   UCHAR LogicalBlockByte0 ;
1749   UCHAR LogicalBlockByte1 ;
1750   UCHAR LogicalBlockByte2 ;
1751   UCHAR LogicalBlockByte3 ;
1752   UCHAR Reserved1 ;
1753   UCHAR TransferBlockByte0 ;
1754   UCHAR TransferBlockByte1 ;
1755   UCHAR Control ;
1756};
1757struct _MODE_SENSE {
1758   UCHAR OperationCode ;
1759   UCHAR Reserved1 : 3 ;
1760   UCHAR Dbd : 1 ;
1761   UCHAR Reserved2 : 1 ;
1762   UCHAR LogicalUnitNumber : 3 ;
1763   UCHAR PageCode : 6 ;
1764   UCHAR Pc : 2 ;
1765   UCHAR Reserved3 ;
1766   UCHAR AllocationLength ;
1767   UCHAR Control ;
1768};
1769struct _MODE_SENSE10 {
1770   UCHAR OperationCode ;
1771   UCHAR Reserved1 : 3 ;
1772   UCHAR Dbd : 1 ;
1773   UCHAR Reserved2 : 1 ;
1774   UCHAR LogicalUnitNumber : 3 ;
1775   UCHAR PageCode : 6 ;
1776   UCHAR Pc : 2 ;
1777   UCHAR Reserved3[4] ;
1778   UCHAR AllocationLength[2] ;
1779   UCHAR Control ;
1780};
1781struct _MODE_SELECT {
1782   UCHAR OperationCode ;
1783   UCHAR SPBit : 1 ;
1784   UCHAR Reserved1 : 3 ;
1785   UCHAR PFBit : 1 ;
1786   UCHAR LogicalUnitNumber : 3 ;
1787   UCHAR Reserved2[2] ;
1788   UCHAR ParameterListLength ;
1789   UCHAR Control ;
1790};
1791struct _MODE_SELECT10 {
1792   UCHAR OperationCode ;
1793   UCHAR SPBit : 1 ;
1794   UCHAR Reserved1 : 3 ;
1795   UCHAR PFBit : 1 ;
1796   UCHAR LogicalUnitNumber : 3 ;
1797   UCHAR Reserved2[5] ;
1798   UCHAR ParameterListLength[2] ;
1799   UCHAR Control ;
1800};
1801struct _LOCATE {
1802   UCHAR OperationCode ;
1803   UCHAR Immediate : 1 ;
1804   UCHAR CPBit : 1 ;
1805   UCHAR BTBit : 1 ;
1806   UCHAR Reserved1 : 2 ;
1807   UCHAR LogicalUnitNumber : 3 ;
1808   UCHAR Reserved3 ;
1809   UCHAR LogicalBlockAddress[4] ;
1810   UCHAR Reserved4 ;
1811   UCHAR Partition ;
1812   UCHAR Control ;
1813};
1814struct _LOGSENSE {
1815   UCHAR OperationCode ;
1816   UCHAR SPBit : 1 ;
1817   UCHAR PPCBit : 1 ;
1818   UCHAR Reserved1 : 3 ;
1819   UCHAR LogicalUnitNumber : 3 ;
1820   UCHAR PageCode : 6 ;
1821   UCHAR PCBit : 2 ;
1822   UCHAR Reserved2 ;
1823   UCHAR Reserved3 ;
1824   UCHAR ParameterPointer[2] ;
1825   UCHAR AllocationLength[2] ;
1826   UCHAR Control ;
1827};
1828struct _LOGSELECT {
1829   UCHAR OperationCode ;
1830   UCHAR SPBit : 1 ;
1831   UCHAR PCRBit : 1 ;
1832   UCHAR Reserved1 : 3 ;
1833   UCHAR LogicalUnitNumber : 3 ;
1834   UCHAR Reserved : 6 ;
1835   UCHAR PCBit : 2 ;
1836   UCHAR Reserved2[4] ;
1837   UCHAR ParameterListLength[2] ;
1838   UCHAR Control ;
1839};
1840struct _PRINT {
1841   UCHAR OperationCode ;
1842   UCHAR Reserved : 5 ;
1843   UCHAR LogicalUnitNumber : 3 ;
1844   UCHAR TransferLength[3] ;
1845   UCHAR Control ;
1846};
1847struct _SEEK {
1848   UCHAR OperationCode ;
1849   UCHAR Reserved1 : 5 ;
1850   UCHAR LogicalUnitNumber : 3 ;
1851   UCHAR LogicalBlockAddress[4] ;
1852   UCHAR Reserved2[3] ;
1853   UCHAR Control ;
1854};
1855struct _ERASE {
1856   UCHAR OperationCode ;
1857   UCHAR Long : 1 ;
1858   UCHAR Immediate : 1 ;
1859   UCHAR Reserved1 : 3 ;
1860   UCHAR LogicalUnitNumber : 3 ;
1861   UCHAR Reserved2[3] ;
1862   UCHAR Control ;
1863};
1864struct _START_STOP {
1865   UCHAR OperationCode ;
1866   UCHAR Immediate : 1 ;
1867   UCHAR Reserved1 : 4 ;
1868   UCHAR LogicalUnitNumber : 3 ;
1869   UCHAR Reserved2[2] ;
1870   UCHAR Start : 1 ;
1871   UCHAR LoadEject : 1 ;
1872   UCHAR Reserved3 : 6 ;
1873   UCHAR Control ;
1874};
1875struct _MEDIA_REMOVAL {
1876   UCHAR OperationCode ;
1877   UCHAR Reserved1 : 5 ;
1878   UCHAR LogicalUnitNumber : 3 ;
1879   UCHAR Reserved2[2] ;
1880   UCHAR Prevent : 1 ;
1881   UCHAR Persistant : 1 ;
1882   UCHAR Reserved3 : 6 ;
1883   UCHAR Control ;
1884};
1885struct _SEEK_BLOCK {
1886   UCHAR OperationCode ;
1887   UCHAR Immediate : 1 ;
1888   UCHAR Reserved1 : 7 ;
1889   UCHAR BlockAddress[3] ;
1890   UCHAR Link : 1 ;
1891   UCHAR Flag : 1 ;
1892   UCHAR Reserved2 : 4 ;
1893   UCHAR VendorUnique : 2 ;
1894};
1895struct _REQUEST_BLOCK_ADDRESS {
1896   UCHAR OperationCode ;
1897   UCHAR Reserved1[3] ;
1898   UCHAR AllocationLength ;
1899   UCHAR Link : 1 ;
1900   UCHAR Flag : 1 ;
1901   UCHAR Reserved2 : 4 ;
1902   UCHAR VendorUnique : 2 ;
1903};
1904struct _PARTITION {
1905   UCHAR OperationCode ;
1906   UCHAR Immediate : 1 ;
1907   UCHAR Sel : 1 ;
1908   UCHAR PartitionSelect : 6 ;
1909   UCHAR Reserved1[3] ;
1910   UCHAR Control ;
1911};
1912struct _WRITE_TAPE_MARKS {
1913   UCHAR OperationCode ;
1914   UCHAR Immediate : 1 ;
1915   UCHAR WriteSetMarks : 1 ;
1916   UCHAR Reserved : 3 ;
1917   UCHAR LogicalUnitNumber : 3 ;
1918   UCHAR TransferLength[3] ;
1919   UCHAR Control ;
1920};
1921struct __anonstruct_Fields_119 {
1922   UCHAR Link : 1 ;
1923   UCHAR Flag : 1 ;
1924   UCHAR Reserved : 4 ;
1925   UCHAR VendorUnique : 2 ;
1926};
1927union __anonunion_Byte6_118 {
1928   UCHAR value ;
1929   struct __anonstruct_Fields_119 Fields ;
1930};
1931struct _SPACE_TAPE_MARKS {
1932   UCHAR OperationCode ;
1933   UCHAR Code : 3 ;
1934   UCHAR Reserved : 2 ;
1935   UCHAR LogicalUnitNumber : 3 ;
1936   UCHAR NumMarksMSB ;
1937   UCHAR NumMarks ;
1938   UCHAR NumMarksLSB ;
1939   union __anonunion_Byte6_118 Byte6 ;
1940};
1941struct _READ_POSITION {
1942   UCHAR Operation ;
1943   UCHAR BlockType : 1 ;
1944   UCHAR Reserved1 : 4 ;
1945   UCHAR Lun : 3 ;
1946   UCHAR Reserved2[7] ;
1947   UCHAR Control ;
1948};
1949struct _CDB6READWRITETAPE {
1950   UCHAR OperationCode ;
1951   UCHAR VendorSpecific : 5 ;
1952   UCHAR Reserved : 3 ;
1953   UCHAR TransferLenMSB ;
1954   UCHAR TransferLen ;
1955   UCHAR TransferLenLSB ;
1956   UCHAR Link : 1 ;
1957   UCHAR Flag : 1 ;
1958   UCHAR Reserved1 : 4 ;
1959   UCHAR VendorUnique : 2 ;
1960};
1961struct _INIT_ELEMENT_STATUS {
1962   UCHAR OperationCode ;
1963   UCHAR Reserved1 : 5 ;
1964   UCHAR LogicalUnitNubmer : 3 ;
1965   UCHAR Reserved2[3] ;
1966   UCHAR Reserved3 : 7 ;
1967   UCHAR NoBarCode : 1 ;
1968};
1969struct _INITIALIZE_ELEMENT_RANGE {
1970   UCHAR OperationCode ;
1971   UCHAR Range : 1 ;
1972   UCHAR Reserved1 : 4 ;
1973   UCHAR LogicalUnitNubmer : 3 ;
1974   UCHAR FirstElementAddress[2] ;
1975   UCHAR Reserved2[2] ;
1976   UCHAR NumberOfElements[2] ;
1977   UCHAR Reserved3 ;
1978   UCHAR Reserved4 : 7 ;
1979   UCHAR NoBarCode : 1 ;
1980};
1981struct _POSITION_TO_ELEMENT {
1982   UCHAR OperationCode ;
1983   UCHAR Reserved1 : 5 ;
1984   UCHAR LogicalUnitNumber : 3 ;
1985   UCHAR TransportElementAddress[2] ;
1986   UCHAR DestinationElementAddress[2] ;
1987   UCHAR Reserved2[2] ;
1988   UCHAR Flip : 1 ;
1989   UCHAR Reserved3 : 7 ;
1990   UCHAR Control ;
1991};
1992struct _MOVE_MEDIUM {
1993   UCHAR OperationCode ;
1994   UCHAR Reserved1 : 5 ;
1995   UCHAR LogicalUnitNumber : 3 ;
1996   UCHAR TransportElementAddress[2] ;
1997   UCHAR SourceElementAddress[2] ;
1998   UCHAR DestinationElementAddress[2] ;
1999   UCHAR Reserved2[2] ;
2000   UCHAR Flip : 1 ;
2001   UCHAR Reserved3 : 7 ;
2002   UCHAR Control ;
2003};
2004struct _EXCHANGE_MEDIUM {
2005   UCHAR OperationCode ;
2006   UCHAR Reserved1 : 5 ;
2007   UCHAR LogicalUnitNumber : 3 ;
2008   UCHAR TransportElementAddress[2] ;
2009   UCHAR SourceElementAddress[2] ;
2010   UCHAR Destination1ElementAddress[2] ;
2011   UCHAR Destination2ElementAddress[2] ;
2012   UCHAR Flip1 : 1 ;
2013   UCHAR Flip2 : 1 ;
2014   UCHAR Reserved3 : 6 ;
2015   UCHAR Control ;
2016};
2017struct _READ_ELEMENT_STATUS {
2018   UCHAR OperationCode ;
2019   UCHAR ElementType : 4 ;
2020   UCHAR VolTag : 1 ;
2021   UCHAR LogicalUnitNumber : 3 ;
2022   UCHAR StartingElementAddress[2] ;
2023   UCHAR NumberOfElements[2] ;
2024   UCHAR Reserved1 ;
2025   UCHAR AllocationLength[3] ;
2026   UCHAR Reserved2 ;
2027   UCHAR Control ;
2028};
2029struct _SEND_VOLUME_TAG {
2030   UCHAR OperationCode ;
2031   UCHAR ElementType : 4 ;
2032   UCHAR Reserved1 : 1 ;
2033   UCHAR LogicalUnitNumber : 3 ;
2034   UCHAR StartingElementAddress[2] ;
2035   UCHAR Reserved2 ;
2036   UCHAR ActionCode : 5 ;
2037   UCHAR Reserved3 : 3 ;
2038   UCHAR Reserved4[2] ;
2039   UCHAR ParameterListLength[2] ;
2040   UCHAR Reserved5 ;
2041   UCHAR Control ;
2042};
2043struct _REQUEST_VOLUME_ELEMENT_ADDRESS {
2044   UCHAR OperationCode ;
2045   UCHAR ElementType : 4 ;
2046   UCHAR VolTag : 1 ;
2047   UCHAR LogicalUnitNumber : 3 ;
2048   UCHAR StartingElementAddress[2] ;
2049   UCHAR NumberElements[2] ;
2050   UCHAR Reserved1 ;
2051   UCHAR AllocationLength[3] ;
2052   UCHAR Reserved2 ;
2053   UCHAR Control ;
2054};
2055struct _LOAD_UNLOAD {
2056   UCHAR OperationCode ;
2057   UCHAR Immediate : 1 ;
2058   UCHAR Reserved1 : 4 ;
2059   UCHAR Lun : 3 ;
2060   UCHAR Reserved2[2] ;
2061   UCHAR Start : 1 ;
2062   UCHAR LoadEject : 1 ;
2063   UCHAR Reserved3 : 6 ;
2064   UCHAR Reserved4[3] ;
2065   UCHAR Slot ;
2066   UCHAR Reserved5[3] ;
2067};
2068struct _MECH_STATUS {
2069   UCHAR OperationCode ;
2070   UCHAR Reserved : 5 ;
2071   UCHAR Lun : 3 ;
2072   UCHAR Reserved1[6] ;
2073   UCHAR AllocationLength[2] ;
2074   UCHAR Reserved2[1] ;
2075   UCHAR Control ;
2076};
2077struct _SYNCHRONIZE_CACHE10 {
2078   UCHAR OperationCode ;
2079   UCHAR RelAddr : 1 ;
2080   UCHAR Immediate : 1 ;
2081   UCHAR Reserved : 3 ;
2082   UCHAR Lun : 3 ;
2083   UCHAR LogicalBlockAddress[4] ;
2084   UCHAR Reserved2 ;
2085   UCHAR BlockCount[2] ;
2086   UCHAR Control ;
2087};
2088struct _GET_EVENT_STATUS_NOTIFICATION {
2089   UCHAR OperationCode ;
2090   UCHAR Immediate : 1 ;
2091   UCHAR Reserved : 4 ;
2092   UCHAR Lun : 3 ;
2093   UCHAR Reserved2[2] ;
2094   UCHAR NotificationClassRequest ;
2095   UCHAR Reserved3[2] ;
2096   UCHAR EventListLength[2] ;
2097   UCHAR Control ;
2098};
2099struct _READ_DVD_STRUCTURE {
2100   UCHAR OperationCode ;
2101   UCHAR Reserved1 : 5 ;
2102   UCHAR Lun : 3 ;
2103   UCHAR RMDBlockNumber[4] ;
2104   UCHAR LayerNumber ;
2105   UCHAR Format ;
2106   UCHAR AllocationLength[2] ;
2107   UCHAR Reserved3 : 6 ;
2108   UCHAR AGID : 2 ;
2109   UCHAR Control ;
2110};
2111struct _SEND_KEY {
2112   UCHAR OperationCode ;
2113   UCHAR Reserved1 : 5 ;
2114   UCHAR Lun : 3 ;
2115   UCHAR Reserved2[6] ;
2116   UCHAR ParameterListLength[2] ;
2117   UCHAR KeyFormat : 6 ;
2118   UCHAR AGID : 2 ;
2119   UCHAR Control ;
2120};
2121struct _REPORT_KEY {
2122   UCHAR OperationCode ;
2123   UCHAR Reserved1 : 5 ;
2124   UCHAR Lun : 3 ;
2125   UCHAR LogicalBlockAddress[4] ;
2126   UCHAR Reserved2[2] ;
2127   UCHAR AllocationLength[2] ;
2128   UCHAR KeyFormat : 6 ;
2129   UCHAR AGID : 2 ;
2130   UCHAR Control ;
2131};
2132struct _SET_READ_AHEAD {
2133   UCHAR OperationCode ;
2134   UCHAR Reserved1 : 5 ;
2135   UCHAR Lun : 3 ;
2136   UCHAR TriggerLBA[4] ;
2137   UCHAR ReadAheadLBA[4] ;
2138   UCHAR Reserved2 ;
2139   UCHAR Control ;
2140};
2141struct _READ_FORMATTED_CAPACITIES {
2142   UCHAR OperationCode ;
2143   UCHAR Reserved1 : 5 ;
2144   UCHAR Lun : 3 ;
2145   UCHAR Reserved2[5] ;
2146   UCHAR AllocationLength[2] ;
2147   UCHAR Control ;
2148};
2149struct _REPORT_LUNS {
2150   UCHAR OperationCode ;
2151   UCHAR Reserved1[5] ;
2152   UCHAR AllocationLength[4] ;
2153   UCHAR Reserved2[1] ;
2154   UCHAR Control ;
2155};
2156union _CDB {
2157   struct _CDB6GENERIC CDB6GENERIC ;
2158   struct _CDB6GENERIC *PCDB6GENERIC ;
2159   struct _CDB6READWRITE CDB6READWRITE ;
2160   struct _CDB6READWRITE *PCDB6READWRITE ;
2161   struct _CDB6INQUIRY CDB6INQUIRY ;
2162   struct _CDB6INQUIRY *PCDB6INQUIRY ;
2163   struct _CDB6VERIFY CDB6VERIFY ;
2164   struct _CDB6VERIFY *PCDB6VERIFY ;
2165   struct _CDB6FORMAT CDB6FORMAT ;
2166   struct _CDB6FORMAT *PCDB6FORMAT ;
2167   struct _CDB10 CDB10 ;
2168   struct _CDB10 *PCDB10 ;
2169   struct _CDB12 CDB12 ;
2170   struct _CDB12 *PCDB12 ;
2171   struct _PAUSE_RESUME PAUSE_RESUME ;
2172   struct _PAUSE_RESUME *PPAUSE_RESUME ;
2173   struct _READ_TOC READ_TOC ;
2174   struct _READ_TOC *PREAD_TOC ;
2175   struct _READ_DISK_INFORMATION READ_DISK_INFORMATION ;
2176   struct _READ_DISK_INFORMATION *PREAD_DISK_INFORMATION ;
2177   struct _READ_TRACK_INFORMATION READ_TRACK_INFORMATION ;
2178   struct _READ_TRACK_INFORMATION *PREAD_TRACK_INFORMATION ;
2179   struct _READ_HEADER READ_HEADER ;
2180   struct _READ_HEADER *PREAD_HEADER ;
2181   struct _PLAY_AUDIO PLAY_AUDIO ;
2182   struct _PLAY_AUDIO *PPLAY_AUDIO ;
2183   struct _PLAY_AUDIO_MSF PLAY_AUDIO_MSF ;
2184   struct _PLAY_AUDIO_MSF *PPLAY_AUDIO_MSF ;
2185   struct _PLAY_CD PLAY_CD ;
2186   struct _PLAY_CD *PPLAY_CD ;
2187   struct _SCAN_CD SCAN_CD ;
2188   struct _SCAN_CD *PSCAN_CD ;
2189   struct _STOP_PLAY_SCAN STOP_PLAY_SCAN ;
2190   struct _STOP_PLAY_SCAN *PSTOP_PLAY_SCAN ;
2191   struct _SUBCHANNEL SUBCHANNEL ;
2192   struct _SUBCHANNEL *PSUBCHANNEL ;
2193   struct _READ_CD READ_CD ;
2194   struct _READ_CD *PREAD_CD ;
2195   struct _READ_CD_MSF READ_CD_MSF ;
2196   struct _READ_CD_MSF *PREAD_CD_MSF ;
2197   struct _PLXTR_READ_CDDA PLXTR_READ_CDDA ;
2198   struct _PLXTR_READ_CDDA *PPLXTR_READ_CDDA ;
2199   struct _NEC_READ_CDDA NEC_READ_CDDA ;
2200   struct _NEC_READ_CDDA *PNEC_READ_CDDA ;
2201   struct _MODE_SENSE MODE_SENSE ;
2202   struct _MODE_SENSE *PMODE_SENSE ;
2203   struct _MODE_SENSE10 MODE_SENSE10 ;
2204   struct _MODE_SENSE10 *PMODE_SENSE10 ;
2205   struct _MODE_SELECT MODE_SELECT ;
2206   struct _MODE_SELECT *PMODE_SELECT ;
2207   struct _MODE_SELECT10 MODE_SELECT10 ;
2208   struct _MODE_SELECT10 *PMODE_SELECT10 ;
2209   struct _LOCATE LOCATE ;
2210   struct _LOCATE *PLOCATE ;
2211   struct _LOGSENSE LOGSENSE ;
2212   struct _LOGSENSE *PLOGSENSE ;
2213   struct _LOGSELECT LOGSELECT ;
2214   struct _LOGSELECT *PLOGSELECT ;
2215   struct _PRINT PRINT ;
2216   struct _PRINT *PPRINT ;
2217   struct _SEEK SEEK ;
2218   struct _SEEK *PSEEK ;
2219   struct _ERASE ERASE ;
2220   struct _ERASE *PERASE ;
2221   struct _START_STOP START_STOP ;
2222   struct _START_STOP *PSTART_STOP ;
2223   struct _MEDIA_REMOVAL MEDIA_REMOVAL ;
2224   struct _MEDIA_REMOVAL *PMEDIA_REMOVAL ;
2225   struct _SEEK_BLOCK SEEK_BLOCK ;
2226   struct _SEEK_BLOCK *PSEEK_BLOCK ;
2227   struct _REQUEST_BLOCK_ADDRESS REQUEST_BLOCK_ADDRESS ;
2228   struct _REQUEST_BLOCK_ADDRESS *PREQUEST_BLOCK_ADDRESS ;
2229   struct _PARTITION PARTITION ;
2230   struct _PARTITION *PPARTITION ;
2231   struct _WRITE_TAPE_MARKS WRITE_TAPE_MARKS ;
2232   struct _WRITE_TAPE_MARKS *PWRITE_TAPE_MARKS ;
2233   struct _SPACE_TAPE_MARKS SPACE_TAPE_MARKS ;
2234   struct _SPACE_TAPE_MARKS *PSPACE_TAPE_MARKS ;
2235   struct _READ_POSITION READ_POSITION ;
2236   struct _READ_POSITION *PREAD_POSITION ;
2237   struct _CDB6READWRITETAPE CDB6READWRITETAPE ;
2238   struct _CDB6READWRITETAPE *PCDB6READWRITETAPE ;
2239   struct _INIT_ELEMENT_STATUS INIT_ELEMENT_STATUS ;
2240   struct _INIT_ELEMENT_STATUS *PINIT_ELEMENT_STATUS ;
2241   struct _INITIALIZE_ELEMENT_RANGE INITIALIZE_ELEMENT_RANGE ;
2242   struct _INITIALIZE_ELEMENT_RANGE *PINITIALIZE_ELEMENT_RANGE ;
2243   struct _POSITION_TO_ELEMENT POSITION_TO_ELEMENT ;
2244   struct _POSITION_TO_ELEMENT *PPOSITION_TO_ELEMENT ;
2245   struct _MOVE_MEDIUM MOVE_MEDIUM ;
2246   struct _MOVE_MEDIUM *PMOVE_MEDIUM ;
2247   struct _EXCHANGE_MEDIUM EXCHANGE_MEDIUM ;
2248   struct _EXCHANGE_MEDIUM *PEXCHANGE_MEDIUM ;
2249   struct _READ_ELEMENT_STATUS READ_ELEMENT_STATUS ;
2250   struct _READ_ELEMENT_STATUS *PREAD_ELEMENT_STATUS ;
2251   struct _SEND_VOLUME_TAG SEND_VOLUME_TAG ;
2252   struct _SEND_VOLUME_TAG *PSEND_VOLUME_TAG ;
2253   struct _REQUEST_VOLUME_ELEMENT_ADDRESS REQUEST_VOLUME_ELEMENT_ADDRESS ;
2254   struct _REQUEST_VOLUME_ELEMENT_ADDRESS *PREQUEST_VOLUME_ELEMENT_ADDRESS ;
2255   struct _LOAD_UNLOAD LOAD_UNLOAD ;
2256   struct _LOAD_UNLOAD *PLOAD_UNLOAD ;
2257   struct _MECH_STATUS MECH_STATUS ;
2258   struct _MECH_STATUS *PMECH_STATUS ;
2259   struct _SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10 ;
2260   struct _SYNCHRONIZE_CACHE10 *PSYNCHRONIZE_CACHE10 ;
2261   struct _GET_EVENT_STATUS_NOTIFICATION GET_EVENT_STATUS_NOTIFICATION ;
2262   struct _GET_EVENT_STATUS_NOTIFICATION *PGET_EVENT_STATUS_NOTIFICATION ;
2263   struct _READ_DVD_STRUCTURE READ_DVD_STRUCTURE ;
2264   struct _READ_DVD_STRUCTURE *PREAD_DVD_STRUCTURE ;
2265   struct _SEND_KEY SEND_KEY ;
2266   struct _SEND_KEY *PSEND_KEY ;
2267   struct _REPORT_KEY REPORT_KEY ;
2268   struct _REPORT_KEY *PREPORT_KEY ;
2269   struct _SET_READ_AHEAD SET_READ_AHEAD ;
2270   struct _SET_READ_AHEAD *PSET_READ_AHEAD ;
2271   struct _READ_FORMATTED_CAPACITIES READ_FORMATTED_CAPACITIES ;
2272   struct _READ_FORMATTED_CAPACITIES *PREAD_FORMATTED_CAPACITIES ;
2273   struct _REPORT_LUNS REPORT_LUNS ;
2274   struct _REPORT_LUNS *PREPORT_LUNS ;
2275   ULONG AsUlong[4] ;
2276   UCHAR AsByte[16] ;
2277};
2278typedef union _CDB *PCDB;
2279#pragma pack(1)
2280#pragma pack()
2281struct _INQUIRYDATA {
2282   UCHAR DeviceType : 5 ;
2283   UCHAR DeviceTypeQualifier : 3 ;
2284   UCHAR DeviceTypeModifier : 7 ;
2285   UCHAR RemovableMedia : 1 ;
2286   UCHAR Versions ;
2287   UCHAR ResponseDataFormat : 4 ;
2288   UCHAR HiSupport : 1 ;
2289   UCHAR NormACA : 1 ;
2290   UCHAR ReservedBit : 1 ;
2291   UCHAR AERC : 1 ;
2292   UCHAR AdditionalLength ;
2293   UCHAR Reserved[2] ;
2294   UCHAR SoftReset : 1 ;
2295   UCHAR CommandQueue : 1 ;
2296   UCHAR Reserved2 : 1 ;
2297   UCHAR LinkedCommands : 1 ;
2298   UCHAR Synchronous : 1 ;
2299   UCHAR Wide16Bit : 1 ;
2300   UCHAR Wide32Bit : 1 ;
2301   UCHAR RelativeAddressing : 1 ;
2302   UCHAR VendorId[8] ;
2303   UCHAR ProductId[16] ;
2304   UCHAR ProductRevisionLevel[4] ;
2305   UCHAR VendorSpecific[20] ;
2306   UCHAR Reserved3[40] ;
2307};
2308typedef struct _INQUIRYDATA *PINQUIRYDATA;
2309struct _READ_CAPACITY_DATA {
2310   ULONG LogicalBlockAddress ;
2311   ULONG BytesPerBlock ;
2312};
2313typedef struct _READ_CAPACITY_DATA READ_CAPACITY_DATA;
2314typedef struct _READ_CAPACITY_DATA *PREAD_CAPACITY_DATA;
2315struct _CD_DEVICE_EXTENSION {
2316   PDEVICE_OBJECT TargetDeviceObject ;
2317   PDEVICE_OBJECT TargetPdo ;
2318   PDEVICE_OBJECT DeviceObject ;
2319   ULONG PagingPathCount ;
2320   KEVENT PagingPathCountEvent ;
2321   PRKDPC Dpc ;
2322   PKTIMER Timer ;
2323   LONG Sync ;
2324   UCHAR Active ;
2325   UCHAR Paused ;
2326   UCHAR PausedM ;
2327   UCHAR PausedS ;
2328   UCHAR PausedF ;
2329   UCHAR LastEndM ;
2330   UCHAR LastEndS ;
2331   UCHAR LastEndF ;
2332   BOOLEAN PlayActive ;
2333};
2334typedef struct _CD_DEVICE_EXTENSION CD_DEVICE_EXTENSION;
2335typedef struct _CD_DEVICE_EXTENSION *PCD_DEVICE_EXTENSION;
2336struct _NEC_READ_TOC {
2337   UCHAR OperationCode ;
2338   UCHAR Type : 2 ;
2339   UCHAR Reserved1 : 6 ;
2340   UCHAR TrackNumber ;
2341   UCHAR Reserved2[6] ;
2342   UCHAR Control ;
2343};
2344struct _NEC_PLAY_AUDIO {
2345   UCHAR OperationCode ;
2346   UCHAR PlayMode : 3 ;
2347   UCHAR Reserved1 : 5 ;
2348   UCHAR Minute ;
2349   UCHAR Second ;
2350   UCHAR Frame ;
2351   UCHAR Reserved2[4] ;
2352   UCHAR Control ;
2353};
2354struct _NEC_SEEK_AUDIO {
2355   UCHAR OperationCode ;
2356   UCHAR Play : 1 ;
2357   UCHAR Reserved1 : 7 ;
2358   UCHAR Minute ;
2359   UCHAR Second ;
2360   UCHAR Frame ;
2361   UCHAR Reserved2[4] ;
2362   UCHAR Control ;
2363};
2364struct _NEC_PAUSE_AUDIO {
2365   UCHAR OperationCode ;
2366   UCHAR Reserved1[8] ;
2367   UCHAR Control ;
2368};
2369struct _NEC_READ_Q_CHANNEL {
2370   UCHAR OperationCode ;
2371   UCHAR TransferSize : 5 ;
2372   UCHAR Reserved1 : 3 ;
2373   UCHAR Reserved2[7] ;
2374   UCHAR Control ;
2375};
2376struct _NEC_EJECT {
2377   UCHAR OperationCode ;
2378   UCHAR Immediate : 1 ;
2379   UCHAR Reserved1 : 7 ;
2380   UCHAR Reserved2[7] ;
2381   UCHAR Control ;
2382};
2383union _NEC_CDB {
2384   struct _NEC_READ_TOC NEC_READ_TOC ;
2385   struct _NEC_READ_TOC *PNEC_READ_TOC ;
2386   struct _NEC_PLAY_AUDIO NEC_PLAY_AUDIO ;
2387   struct _NEC_PLAY_AUDIO *PNEC_PLAY_AUDIO ;
2388   struct _NEC_SEEK_AUDIO NEC_SEEK_AUDIO ;
2389   struct _NEC_SEEK_AUDIO *PNEC_SEEK_AUDIO ;
2390   struct _NEC_PAUSE_AUDIO NEC_PAUSE_AUDIO ;
2391   struct _NEC_PAUSE_AUDIO *PNEC_PAUSE_AUDIO ;
2392   struct _NEC_READ_Q_CHANNEL NEC_READ_Q_CHANNEL ;
2393   struct _NEC_READ_Q_CHANNEL *PNEC_READ_Q_CHANNEL ;
2394   struct _NEC_EJECT NEC_EJECT ;
2395   struct _NEC_EJECT *PNEC_EJECT ;
2396};
2397typedef union _NEC_CDB *PNEC_CDB;
2398struct _PNR_START_STOP {
2399   UCHAR OperationCode ;
2400   UCHAR Immediate : 1 ;
2401   UCHAR Reserved1 : 4 ;
2402   UCHAR Lun : 3 ;
2403   UCHAR Reserved2 : 7 ;
2404   UCHAR PCF : 1 ;
2405   UCHAR Reserved3 ;
2406   UCHAR Start : 1 ;
2407   UCHAR Eject : 1 ;
2408   UCHAR Reserved4 : 6 ;
2409   UCHAR Link : 1 ;
2410   UCHAR Flag : 1 ;
2411   UCHAR Reserved5 : 4 ;
2412   UCHAR Vendor : 2 ;
2413};
2414struct _PNR_READ_TOC {
2415   UCHAR OperationCode ;
2416   UCHAR Reserved1 : 5 ;
2417   UCHAR Lun : 3 ;
2418   UCHAR Reserved2[3] ;
2419   UCHAR TrackNumber ;
2420   UCHAR Reserved3 ;
2421   UCHAR AssignedLength[2] ;
2422   UCHAR Link : 1 ;
2423   UCHAR Flag : 1 ;
2424   UCHAR Reserved4 : 4 ;
2425   UCHAR Type : 2 ;
2426};
2427struct _PNR_PLAY_AUDIO {
2428   UCHAR OperationCode ;
2429   UCHAR PlayMode : 4 ;
2430   UCHAR StopAddr : 1 ;
2431   UCHAR Lun : 3 ;
2432   UCHAR Reserved1 ;
2433   UCHAR Minute ;
2434   UCHAR Second ;
2435   UCHAR Frame ;
2436   UCHAR Reserved2[3] ;
2437   UCHAR Link : 1 ;
2438   UCHAR Flag : 1 ;
2439   UCHAR Reserved3 : 4 ;
2440   UCHAR Type : 2 ;
2441};
2442struct _PNR_SEEK_AUDIO {
2443   UCHAR OperationCode ;
2444   UCHAR PlayMode : 4 ;
2445   UCHAR PlayBack : 1 ;
2446   UCHAR Lun : 3 ;
2447   UCHAR Reserved1 ;
2448   UCHAR Minute ;
2449   UCHAR Second ;
2450   UCHAR Frame ;
2451   UCHAR Reserved2[3] ;
2452   UCHAR Link : 1 ;
2453   UCHAR Flag : 1 ;
2454   UCHAR Reserved3 : 4 ;
2455   UCHAR Type : 2 ;
2456};
2457struct _PNR_PAUSE_AUDIO {
2458   UCHAR OperationCode ;
2459   UCHAR Reserved1 : 4 ;
2460   UCHAR Pause : 1 ;
2461   UCHAR Lun : 3 ;
2462   UCHAR Reserved2[7] ;
2463   UCHAR Link : 1 ;
2464   UCHAR Flag : 1 ;
2465   UCHAR Reserved3 : 4 ;
2466   UCHAR Reserved4 : 2 ;
2467};
2468struct _PNR_AUDIO_STATUS {
2469   UCHAR OperationCode ;
2470   UCHAR Reserved1 : 4 ;
2471   UCHAR Reserved2 : 1 ;
2472   UCHAR Lun : 3 ;
2473   UCHAR Reserved3[6] ;
2474   UCHAR AssignedLength ;
2475   UCHAR Link : 1 ;
2476   UCHAR Flag : 1 ;
2477   UCHAR Reserved4 : 4 ;
2478   UCHAR Reserved5 : 2 ;
2479};
2480struct _PNR_READ_Q_CHANNEL {
2481   UCHAR OperationCode ;
2482   UCHAR Reserved1 : 4 ;
2483   UCHAR Reserved2 : 1 ;
2484   UCHAR Lun : 3 ;
2485   UCHAR Reserved3[6] ;
2486   UCHAR AssignedLength ;
2487   UCHAR Link : 1 ;
2488   UCHAR Flag : 1 ;
2489   UCHAR Reserved4 : 4 ;
2490   UCHAR Reserved5 : 2 ;
2491};
2492struct _PNR_EJECT {
2493   UCHAR OperationCode ;
2494   UCHAR Immediate : 1 ;
2495   UCHAR Reserved1 : 4 ;
2496   UCHAR Lun : 3 ;
2497   UCHAR Reserved2[7] ;
2498   UCHAR Link : 1 ;
2499   UCHAR Flag : 1 ;
2500   UCHAR Reserved4 : 4 ;
2501   UCHAR Reserved5 : 2 ;
2502};
2503struct _PNR_READ_STATUS {
2504   UCHAR OperationCode ;
2505   UCHAR Reserved1 : 4 ;
2506   UCHAR Lun : 3 ;
2507   UCHAR PageCode : 5 ;
2508   UCHAR PCField : 1 ;
2509   UCHAR Reserved2[5] ;
2510   UCHAR AllocationLengthMsb ;
2511   UCHAR AllocationLengthLsb ;
2512   UCHAR Link : 1 ;
2513   UCHAR Flag : 1 ;
2514   UCHAR Reserved3 : 4 ;
2515   UCHAR Reserved4 : 2 ;
2516};
2517union _PIONEER_CDB {
2518   struct _PNR_START_STOP PNR_START_STOP ;
2519   struct _PNR_START_STOP *PPNR_START_STOP ;
2520   struct _PNR_READ_TOC PNR_READ_TOC ;
2521   struct _PNR_READ_TOC *PPNR_READ_TOC ;
2522   struct _PNR_PLAY_AUDIO PNR_PLAY_AUDIO ;
2523   struct _PNR_PLAY_AUDIO *PPNR_PLAY_AUDIO ;
2524   struct _PNR_SEEK_AUDIO PNR_SEEK_AUDIO ;
2525   struct _PNR_SEEK_AUDIO *PPNR_SEEK_AUDIO ;
2526   struct _PNR_PAUSE_AUDIO PNR_PAUSE_AUDIO ;
2527   struct _PNR_PAUSE_AUDIO *PPNR_PAUSE_AUDIO ;
2528   struct _PNR_AUDIO_STATUS PNR_AUDIO_STATUS ;
2529   struct _PNR_AUDIO_STATUS *PPNR_AUDIO_STATUS ;
2530   struct _PNR_READ_Q_CHANNEL PNR_READ_Q_CHANNEL ;
2531   struct _PNR_READ_Q_CHANNEL *PPNR_READ_Q_CHANNEL ;
2532   struct _PNR_EJECT PNR_EJECT ;
2533   struct _PNR_EJECT *PPNR_EJECT ;
2534   struct _PNR_READ_STATUS PNR_READ_STATUS ;
2535   struct _PNR_READ_STATUS *PPNR_READ_STATUS ;
2536};
2537typedef union _PIONEER_CDB *PPNR_CDB;
2538struct _READ_DISC_INFO {
2539   UCHAR OperationCode ;
2540   UCHAR Reserved : 5 ;
2541   UCHAR LogicalUnitNumber : 3 ;
2542   UCHAR Reserved1[7] ;
2543   UCHAR AllocationLength[2] ;
2544   UCHAR Link : 1 ;
2545   UCHAR Flag : 1 ;
2546   UCHAR Reserved2 : 4 ;
2547   UCHAR VendorUniqueBits : 2 ;
2548};
2549struct __anonstruct_PLAY_AUDIO_127 {
2550   UCHAR OperationCode ;
2551   UCHAR Immediate : 1 ;
2552   UCHAR Right : 1 ;
2553   UCHAR Left : 1 ;
2554   UCHAR Reserved : 2 ;
2555   UCHAR Lun : 3 ;
2556   UCHAR StartingM ;
2557   UCHAR StartingS ;
2558   UCHAR StartingF ;
2559   UCHAR Reserved1[2] ;
2560   UCHAR EndingM ;
2561   UCHAR EndingS ;
2562   UCHAR EndingF ;
2563   UCHAR Reserved2 ;
2564   UCHAR Link : 1 ;
2565   UCHAR Flag : 1 ;
2566   UCHAR Reserved3 : 4 ;
2567   UCHAR VendorUniqueBits : 2 ;
2568};
2569struct _PAUSE {
2570   UCHAR OperationCode ;
2571   UCHAR Reserved : 5 ;
2572   UCHAR Lun : 3 ;
2573   UCHAR Reserved1[9] ;
2574   UCHAR Link : 1 ;
2575   UCHAR Flag : 1 ;
2576   UCHAR Reserved2 : 4 ;
2577   UCHAR VendorUnqiueBits : 2 ;
2578};
2579struct _EJECT {
2580   UCHAR OperationCode ;
2581   UCHAR Reserved : 5 ;
2582   UCHAR Lun : 3 ;
2583   UCHAR Reserved1[8] ;
2584   UCHAR Eject : 1 ;
2585   UCHAR Mode : 1 ;
2586   UCHAR Reserved2 : 6 ;
2587   UCHAR Link : 1 ;
2588   UCHAR Flag : 1 ;
2589   UCHAR Reserved3 : 4 ;
2590   UCHAR VendorUnqiueBits : 2 ;
2591};
2592struct _AUDIO_STATUS {
2593   UCHAR OperationCode ;
2594   UCHAR Reserved : 5 ;
2595   UCHAR Lun : 3 ;
2596   UCHAR Reserved1[9] ;
2597   UCHAR Link : 1 ;
2598   UCHAR Flag : 1 ;
2599   UCHAR Reserved2 : 4 ;
2600   UCHAR VendorUnqiueBits : 2 ;
2601};
2602struct _STOP_PLAY {
2603   UCHAR OperationCode ;
2604   UCHAR Reserved[11] ;
2605};
2606union _HITACHICDB {
2607   struct _READ_DISC_INFO READ_DISC_INFO ;
2608   struct _READ_DISC_INFO *PREAD_DISC_INFO ;
2609   struct __anonstruct_PLAY_AUDIO_127 PLAY_AUDIO ;
2610   struct __anonstruct_PLAY_AUDIO_127 *PPLAY_AUDIO ;
2611   struct _PAUSE PAUSE_AUDIO ;
2612   struct _PAUSE *PPAUSE_AUDIO ;
2613   struct _EJECT EJECT ;
2614   struct _EJECT *PEJECT ;
2615   struct _AUDIO_STATUS AUDIO_STATUS ;
2616   struct _AUDIO_STATUS *PAUDIO_STATUS ;
2617   struct _STOP_PLAY STOP_PLAY ;
2618   struct _STOP_PLAY *PSTOP_PLAY ;
2619};
2620typedef union _HITACHICDB *PHITACHICDB;
2621#pragma pack(push,8)
2622#pragma pack(pop)
2623struct _KAPC;
2624struct _KDPC;
2625#pragma pack(push,4)
2626#pragma pack(pop)
2627#pragma pack(push,4)
2628#pragma pack(pop)
2629#pragma pack(push,1)
2630#pragma pack(pop)
2631struct _DRIVER_OBJECT;
2632struct _DEVICE_OBJECT;
2633struct _DRIVER_OBJECT;
2634struct _FILE_OBJECT;
2635struct _IRP;
2636struct _SCSI_REQUEST_BLOCK;
2637#pragma pack(push,4)
2638#pragma pack(pop)
2639#pragma once
2640#pragma once
2641#pragma once
2642#pragma once
2643#pragma warning(push)
2644#pragma warning(disable:4035)
2645#pragma warning(pop)
2646#pragma once
2647extern void *memcpy(void * , void const   * , size_t  ) ;
2648extern int memcmp(void const   * , void const   * ,
2649                                                size_t  ) ;
2650extern void *memset(void * , int  , size_t  ) ;
2651#pragma warning(disable:4103)
2652#pragma warning(disable:4103)
2653  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
2654                                                                                                PCWSTR Path ,
2655                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
2656                                                                                                PVOID Context ,
2657                                                                                                PVOID Environment ) ;
2658extern   NTSTATUS RtlWriteRegistryValue(ULONG RelativeTo ,
2659                                                                                                      PCWSTR Path ,
2660                                                                                                      PCWSTR ValueName ,
2661                                                                                                      ULONG ValueType ,
2662                                                                                                      PVOID ValueData ,
2663                                                                                                      ULONG ValueLength ) ;
2664  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
2665                                                                                                PCWSTR Path ,
2666                                                                                                PCWSTR ValueName ) ;
2667  void RtlInitString(PSTRING DestinationString ,
2668                                                                                   PCSZ SourceString ) ;
2669  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
2670                                                                                          PCWSTR SourceString ) ;
2671  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
2672                                                                                                      PANSI_STRING SourceString ,
2673                                                                                                      BOOLEAN AllocateDestinationString ) ;
2674  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
2675                                                                                          PUNICODE_STRING SourceString ) ;
2676  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
2677  SIZE_T RtlCompareMemory(void const   *Source1 ,
2678                                                                                        void const   *Source2 ,
2679                                                                                        SIZE_T Length ) ;
2680#pragma warning(push)
2681#pragma warning(disable:4035)
2682#pragma warning(pop)
2683extern   LONG InterlockedIncrement(PLONG Addend ) ;
2684extern   LONG InterlockedDecrement(PLONG Addend ) ;
2685#pragma warning(disable:4035)
2686#pragma warning(push)
2687#pragma warning(disable:4164)
2688#pragma function(_enable)
2689#pragma function(_disable)
2690#pragma warning(pop)
2691#pragma warning(disable:4103)
2692#pragma warning(disable:4103)
2693#pragma warning(disable:4103)
2694#pragma warning(disable:4103)
2695  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
2696                                                       BOOLEAN State ) ;
2697  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
2698                                                BOOLEAN Wait ) ;
2699  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
2700                                                           LONG Count , LONG Limit ) ;
2701  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
2702                                                        LONG Adjustment , BOOLEAN Wait ) ;
2703  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
2704                                                                BOOLEAN Alertable ,
2705                                                                PLARGE_INTEGER Interval ) ;
2706  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
2707                                                               KPROCESSOR_MODE WaitMode ,
2708                                                               BOOLEAN Alertable ,
2709                                                               PLARGE_INTEGER Timeout ) ;
2710  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
2711  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
2712                                                                                        KIRQL NewIrql ) ;
2713  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
2714                                                                                            SIZE_T NumberOfBytes ,
2715                                                                                            ULONG Tag ) ;
2716  void ExFreePool(PVOID P ) ;
2717  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
2718  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
2719  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
2720                                                                                                          PLIST_ENTRY ListEntry ,
2721                                                                                                          PKSPIN_LOCK Lock ) ;
2722  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
2723                                                                                                          PLIST_ENTRY ListEntry ,
2724                                                                                                          PKSPIN_LOCK Lock ) ;
2725  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
2726                                                                                                          PKSPIN_LOCK Lock ) ;
2727  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
2728  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
2729                                                                   KPROCESSOR_MODE AccessMode ,
2730                                                                   MEMORY_CACHING_TYPE CacheType ,
2731                                                                   PVOID BaseAddress ,
2732                                                                   ULONG BugCheckOnFailure ,
2733                                                                   MM_PAGE_PRIORITY Priority ) ;
2734  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
2735                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
2736  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
2737extern   PVOID MmLockPagableDataSection(PVOID AddressWithinSection ) ;
2738  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
2739  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
2740  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
2741                                                              ULONG DesiredAccess ,
2742                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
2743                                                              HANDLE ProcessHandle ,
2744                                                              PCLIENT_ID ClientId ,
2745                                                              void (*StartRoutine)(PVOID StartContext ) ,
2746                                                              PVOID StartContext ) ;
2747  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
2748#pragma warning(disable:4103)
2749#pragma warning(disable:4103)
2750  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
2751                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
2752                                                   PIRP Irp ) ;
2753  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
2754                                                                           PDEVICE_OBJECT TargetDevice ) ;
2755  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
2756                                                                   PDEVICE_OBJECT DeviceObject ,
2757                                                                   PVOID Buffer ,
2758                                                                   ULONG Length ,
2759                                                                   PLARGE_INTEGER StartingOffset ,
2760                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
2761  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
2762                                                                   PDEVICE_OBJECT DeviceObject ,
2763                                                                   PVOID InputBuffer ,
2764                                                                   ULONG InputBufferLength ,
2765                                                                   PVOID OutputBuffer ,
2766                                                                   ULONG OutputBufferLength ,
2767                                                                   BOOLEAN InternalDeviceIoControl ,
2768                                                                   PKEVENT Event ,
2769                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
2770  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
2771                                                                                        PIRP Irp ) ;
2772  void IofCompleteRequest(PIRP Irp ,
2773                                                                                         CCHAR PriorityBoost ) ;
2774  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
2775                                                        ULONG DeviceExtensionSize ,
2776                                                        PUNICODE_STRING DeviceName ,
2777                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
2778                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
2779  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
2780                                                              PUNICODE_STRING DeviceName ) ;
2781  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
2782  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
2783  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
2784  void IoFreeIrp(PIRP Irp ) ;
2785  void IoFreeMdl(PMDL Mdl ) ;
2786  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
2787  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
2788                                                                  PULONG BusNumber ,
2789                                                                  PCONFIGURATION_TYPE ControllerType ,
2790                                                                  PULONG ControllerNumber ,
2791                                                                  PCONFIGURATION_TYPE PeripheralType ,
2792                                                                  PULONG PeripheralNumber ,
2793                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
2794                                                                                             PUNICODE_STRING PathName ,
2795                                                                                             INTERFACE_TYPE BusType ,
2796                                                                                             ULONG BusNumber ,
2797                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
2798                                                                                             CONFIGURATION_TYPE ControllerType ,
2799                                                                                             ULONG ControllerNumber ,
2800                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
2801                                                                                             CONFIGURATION_TYPE PeripheralType ,
2802                                                                                             ULONG PeripheralNumber ,
2803                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
2804                                                                  PVOID Context ) ;
2805  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
2806  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
2807extern   NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject ,
2808                                                                        ULONG DevInstKeyType ,
2809                                                                        ACCESS_MASK DesiredAccess ,
2810                                                                        PHANDLE DevInstRegKey ) ;
2811  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
2812                                                                                                   GUID const   *InterfaceClassGuid ,
2813                                                                                                   PUNICODE_STRING ReferenceString ,
2814                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
2815  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
2816                                                                   BOOLEAN Enable ) ;
2817#pragma warning(disable:4200)
2818#pragma warning(default:4200)
2819  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
2820                                                      PIRP Irp ) ;
2821  void PoStartNextPowerIrp(PIRP Irp ) ;
2822  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
2823                                                                   ACCESS_MASK DesiredAccess ,
2824                                                                   POBJECT_TYPE ObjectType ,
2825                                                                   KPROCESSOR_MODE AccessMode ,
2826                                                                   PVOID *Object ,
2827                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
2828  void ObfDereferenceObject(PVOID Object ) ;
2829  NTSTATUS ZwClose(HANDLE Handle ) ;
2830#pragma once
2831#pragma once
2832#pragma warning(disable:4200)
2833#pragma warning(default:4200)
2834void errorFn(void) 
2835{ 
2836
2837  {
2838  ERROR: 
2839  goto ERROR;
2840}
2841}
2842int s  ;
2843int UNLOADED  ;
2844int NP  ;
2845int DC  ;
2846int SKIP1  ;
2847int SKIP2  ;
2848int MPR1  ;
2849int MPR3  ;
2850int IPC  ;
2851int pended  ;
2852NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context )  ;
2853int compRegistered  ;
2854int lowerDriverReturn  ;
2855int setEventCalled  ;
2856int customIrp  ;
2857int routine  ;
2858int myStatus  ;
2859int myIrp_PendingReturned  ;
2860void _BLAST_init(void) 
2861{ 
2862
2863  {
2864  UNLOADED = 0;
2865  NP = 1;
2866  DC = 2;
2867  SKIP1 = 3;
2868  SKIP2 = 4;
2869  MPR1 = 5;
2870  MPR3 = 6;
2871  IPC = 7;
2872  s = UNLOADED;
2873  pended = 0;
2874  compFptr = 0;
2875  compRegistered = 0;
2876  lowerDriverReturn = 0;
2877  setEventCalled = 0;
2878  customIrp = 0;
2879  return;
2880}
2881}
2882NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ;
2883NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2884NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2885NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2886BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) ;
2887BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) ;
2888NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2889NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2890NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2891NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) ;
2892NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2893NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2894NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2895NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2896NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2897void HpCdrProcessLastSession(PCDROM_TOC Toc ) ;
2898NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
2899NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2900NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2901void CdAudioUnload(PDRIVER_OBJECT DriverObject ) ;
2902#pragma alloc_text(INIT,DriverEntry)
2903#pragma alloc_text(PAGECDNC,CdAudioNECDeviceControl)
2904#pragma alloc_text(PAGECDOT,CdAudioHitachiSendPauseCommand)
2905#pragma alloc_text(PAGECDOT,CdAudioHitachiDeviceControl)
2906#pragma alloc_text(PAGECDOT,CdAudioDenonDeviceControl)
2907#pragma alloc_text(PAGECDNC,CdAudio435DeviceControl)
2908#pragma alloc_text(PAGECDNC,CdAudio535DeviceControl)
2909#pragma alloc_text(PAGECDOT,CdAudioPioneerDeviceControl)
2910#pragma alloc_text(PAGECDNC,CdAudioPan533DeviceControl)
2911#pragma alloc_text(PAGECDOT,CdAudioAtapiDeviceControl)
2912#pragma alloc_text(PAGECDOT,CdAudioLionOpticsDeviceControl)
2913#pragma alloc_text(PAGECDOT,CdAudioHPCdrDeviceControl)
2914#pragma alloc_text(PAGECDOT,HpCdrProcessLastSession)
2915#pragma alloc_text(PAGECDOT,HPCdrCompletion)
2916NTSTATUS SendSrbSynchronous(PCD_DEVICE_EXTENSION Extension , PSCSI_PASS_THROUGH Srb ,
2917                            PVOID Buffer , ULONG BufferLength ) 
2918{ ULONG ioctl ;
2919  KEVENT event ;
2920  PIRP irp ;
2921  IO_STATUS_BLOCK ioStatus ;
2922  NTSTATUS status = __VERIFIER_nondet_long() ;
2923
2924  {
2925  irp = (void *)0;
2926  Srb->Length = sizeof(SCSI_PASS_THROUGH );
2927  Srb->SenseInfoLength = 0;
2928  Srb->SenseInfoOffset = 0;
2929  if (Buffer) {
2930    Srb->DataIn = 1;
2931    Srb->DataTransferLength = BufferLength;
2932    Srb->DataBufferOffset = (unsigned long )Buffer;
2933    ioctl = ((4 << 16) | (3 << 14)) | (1029 << 2);
2934  } else {
2935    Srb->DataIn = 0;
2936    Srb->DataTransferLength = 0;
2937    Srb->DataBufferOffset = 0;
2938    ioctl = ((4 << 16) | (3 << 14)) | (1025 << 2);
2939  }
2940  {
2941/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2942  }
2943  if (! irp) {
2944    return (-1073741670L);
2945  } else {
2946
2947  }
2948  if (status == 259L) {
2949    {
2950    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2951    status = ioStatus.__annonCompField4.Status;
2952    }
2953  } else {
2954
2955  }
2956  return (status);
2957}
2958}
2959NTSTATUS CdAudioAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) 
2960{ NTSTATUS status ;
2961  PDEVICE_OBJECT deviceObject ;
2962  PCD_DEVICE_EXTENSION extension ;
2963  ULONG regActive ;
2964  HANDLE deviceParameterHandle ;
2965  RTL_QUERY_REGISTRY_TABLE queryTable[2] ;
2966
2967  {
2968  {
2969  regActive = 255;
2970  status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 2, 131097L, & deviceParameterHandle);
2971  }
2972  if (! (status >= 0L)) {
2973    regActive = 255;
2974    goto AddDeviceEndRegistry;
2975  } else {
2976
2977  }
2978  {
2979  memset(& queryTable, 0, sizeof(queryTable));
2980  queryTable[0].Flags = 36;
2981  queryTable[0].Name = "M\000a\000p\000T\000y\000p\000e\000";
2982  queryTable[0].EntryContext = & regActive;
2983  queryTable[0].DefaultType = 4;
2984  queryTable[0].DefaultData = (void *)0;
2985  queryTable[0].DefaultLength = 0;
2986  status = RtlQueryRegistryValues(1073741824, (WCHAR *)deviceParameterHandle, queryTable,
2987                                  (void *)0, (void *)0);
2988  }
2989  if (! (status >= 0L)) {
2990    regActive = 255;
2991  } else {
2992    if (regActive > 10UL) {
2993      regActive = 255;
2994    } else {
2995
2996    }
2997  }
2998  {
2999  ZwClose(deviceParameterHandle);
3000  }
3001  AddDeviceEndRegistry: 
3002  if (regActive > 10UL) {
3003    if (regActive != 255UL) {
3004      regActive = 255;
3005    } else {
3006
3007    }
3008  } else {
3009
3010  }
3011  if (regActive == 0UL) {
3012    return (0L);
3013  } else {
3014
3015  }
3016  if (regActive == 8) {
3017    goto switch_0_8;
3018  } else {
3019    if (regActive == 9) {
3020      goto switch_0_9;
3021    } else {
3022      if (regActive == 10) {
3023        goto switch_0_10;
3024      } else {
3025        if (regActive == 4) {
3026          goto switch_0_4;
3027        } else {
3028          if (regActive == 6) {
3029            goto switch_0_6;
3030          } else {
3031            if (regActive == 5) {
3032              goto switch_0_5;
3033            } else {
3034              if (regActive == 2) {
3035                goto switch_0_2;
3036              } else {
3037                if (regActive == 3) {
3038                  goto switch_0_3;
3039                } else {
3040                  if (regActive == 1) {
3041                    goto switch_0_1;
3042                  } else {
3043                    if (regActive == 7) {
3044                      goto switch_0_7;
3045                    } else {
3046                      if (regActive == 255) {
3047                        goto switch_0_255;
3048                      } else {
3049                        {
3050                        goto switch_0_default;
3051                        if (0) {
3052                          switch_0_8: /* CIL Label */ 
3053                          {
3054                          MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl));
3055                          }
3056                          goto switch_0_break;
3057                          switch_0_9: /* CIL Label */ ;
3058                          switch_0_10: /* CIL Label */ 
3059                          {
3060                          MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl));
3061                          }
3062                          goto switch_0_break;
3063                          switch_0_4: /* CIL Label */ 
3064                          {
3065                          MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl));
3066                          }
3067                          goto switch_0_break;
3068                          switch_0_6: /* CIL Label */ ;
3069                          switch_0_5: /* CIL Label */ 
3070                          {
3071                          MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3072                          }
3073                          goto switch_0_break;
3074                          switch_0_2: /* CIL Label */ 
3075                          {
3076                          MmLockPagableDataSection((void *)(& CdAudio535DeviceControl));
3077                          }
3078                          goto switch_0_break;
3079                          switch_0_3: /* CIL Label */ 
3080                          {
3081                          MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3082                          }
3083                          goto switch_0_break;
3084                          switch_0_1: /* CIL Label */ 
3085                          {
3086                          MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3087                          }
3088                          goto switch_0_break;
3089                          switch_0_7: /* CIL Label */ 
3090                          {
3091                          MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl));
3092                          }
3093                          goto switch_0_break;
3094                          switch_0_255: /* CIL Label */ ;
3095                          switch_0_default: /* CIL Label */ ;
3096                          goto switch_0_break;
3097                        } else {
3098                          switch_0_break: /* CIL Label */ ;
3099                        }
3100                        }
3101                      }
3102                    }
3103                  }
3104                }
3105              }
3106            }
3107          }
3108        }
3109      }
3110    }
3111  }
3112  {
3113  status = IoCreateDevice(DriverObject, sizeof(CD_DEVICE_EXTENSION ), (void *)0, 2,
3114                          0, 0, & deviceObject);
3115  }
3116  if (! (status >= 0L)) {
3117    return (status);
3118  } else {
3119
3120  }
3121  deviceObject->Flags |= 16UL;
3122  if (deviceObject->Flags & 16384UL) {
3123
3124  } else {
3125    deviceObject->Flags |= 8192UL;
3126  }
3127  {
3128  extension = deviceObject->DeviceExtension;
3129  memset(extension, 0, sizeof(CD_DEVICE_EXTENSION ));
3130  extension->TargetDeviceObject = IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject);
3131  }
3132  if (! extension->TargetDeviceObject) {
3133    {
3134/*     IoDeleteDevice(deviceObject); */ /* INLINED */
3135    }
3136    return (-1073741810L);
3137  } else {
3138
3139  }
3140  {
3141/*   KeInitializeEvent(& extension->PagingPathCountEvent, 1, 1); */ /* INLINED */
3142  extension->Active = (unsigned char )regActive;
3143  extension->DeviceObject = deviceObject;
3144  extension->TargetPdo = PhysicalDeviceObject;
3145  deviceObject->Flags &= 4294967167UL;
3146  }
3147  return (0L);
3148}
3149}
3150NTSTATUS CdAudioSignalCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) 
3151{ 
3152
3153  {
3154  {
3155  KeSetEvent(Event, 0, 0);
3156  }
3157  return (-1073741802L);
3158}
3159}
3160NTSTATUS CdAudioStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3161{ PCD_DEVICE_EXTENSION deviceExtension ;
3162  NTSTATUS status ;
3163  SCSI_PASS_THROUGH srb ;
3164  PCDB cdb ;
3165  PUCHAR inquiryDataPtr ;
3166  UCHAR attempt ;
3167  PVOID tmp ;
3168  UCHAR tmp___0 ;
3169  BOOLEAN tmp___1 ;
3170  int tmp___2 ;
3171  int tmp___3 ;
3172  int tmp___4 ;
3173  int tmp___5 ;
3174  int tmp___6 ;
3175  int tmp___7 ;
3176  int tmp___8 ;
3177  int tmp___9 ;
3178  int tmp___10 ;
3179  int tmp___11 ;
3180  int tmp___12 ;
3181  int tmp___13 ;
3182  int tmp___14 ;
3183  int tmp___15 ;
3184  HANDLE deviceParameterHandle ;
3185  ULONG keyValue ;
3186
3187  {
3188  {
3189  deviceExtension = DeviceObject->DeviceExtension;
3190  status = CdAudioForwardIrpSynchronous(DeviceObject, Irp);
3191  }
3192  if (! (status >= 0L)) {
3193    return (status);
3194  } else {
3195
3196  }
3197  deviceExtension->Paused = 0;
3198  deviceExtension->PausedM = 0;
3199  deviceExtension->PausedS = 0;
3200  deviceExtension->PausedF = 0;
3201  deviceExtension->LastEndM = 0;
3202  deviceExtension->LastEndS = 0;
3203  deviceExtension->LastEndF = 0;
3204  if ((int )deviceExtension->Active == 255) {
3205    {
3206    cdb = (union _CDB *)(srb.Cdb);
3207    inquiryDataPtr = (void *)0;
3208    attempt = 0;
3209    tmp = ExAllocatePoolWithTag(4, 36, 541156419UL);
3210    inquiryDataPtr = (UCHAR *)tmp;
3211    }
3212    if (! inquiryDataPtr) {
3213      deviceExtension->Active = 0;
3214      return (0L);
3215    } else {
3216
3217    }
3218    status = -1073741823L;
3219    {
3220    while (1) {
3221      while_1_continue: /* CIL Label */ ;
3222      if (! (status >= 0L)) {
3223        tmp___0 = attempt;
3224        attempt = (UCHAR )((int )attempt + 1);
3225        if (tmp___0 < 4) {
3226
3227        } else {
3228          goto while_1_break;
3229        }
3230      } else {
3231        goto while_1_break;
3232      }
3233      {
3234      memset(& srb, 0, sizeof(SCSI_PASS_THROUGH ));
3235      memset(inquiryDataPtr, 0, 36);
3236      cdb->CDB6INQUIRY.OperationCode = 18;
3237      cdb->CDB6INQUIRY.AllocationLength = 36;
3238      srb.CdbLength = 6;
3239      srb.TimeOutValue = 10;
3240      status = SendSrbSynchronous(deviceExtension, & srb, inquiryDataPtr, 36);
3241      }
3242    }
3243    while_1_break: /* CIL Label */ ;
3244    }
3245    if (! (status >= 0L)) {
3246      {
3247/*       ExFreePool(inquiryDataPtr); */ /* INLINED */
3248      deviceExtension->Active = 0;
3249      }
3250      return (0L);
3251    } else {
3252
3253    }
3254    {
3255    deviceExtension->Active = 0;
3256    tmp___2 = memcmp(inquiryDataPtr + 8, "NEC     ", 8);
3257    }
3258    if (tmp___2) {
3259
3260    } else {
3261      {
3262      tmp___1 = NecSupportNeeded(inquiryDataPtr);
3263      }
3264      if (tmp___1) {
3265        {
3266        MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl));
3267        deviceExtension->Active = 8;
3268        }
3269      } else {
3270
3271      }
3272    }
3273    {
3274    tmp___3 = memcmp(inquiryDataPtr + 8, "PIONEER ", 8);
3275    }
3276    if (tmp___3) {
3277
3278    } else {
3279      {
3280      tmp___4 = memcmp(inquiryDataPtr + 16, "CD-ROM DRM-600", 15);
3281      }
3282      if (tmp___4) {
3283
3284      } else {
3285        {
3286        MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl));
3287        deviceExtension->Active = 9;
3288        }
3289      }
3290    }
3291    if ((int )*(inquiryDataPtr + 8) == 68) {
3292      if ((int )*(inquiryDataPtr + 9) == 69) {
3293        if ((int )*(inquiryDataPtr + 10) == 78) {
3294          if ((int )*(inquiryDataPtr + 16) == 68) {
3295            if ((int )*(inquiryDataPtr + 17) == 82) {
3296              if ((int )*(inquiryDataPtr + 18) == 68) {
3297                if ((int )*(inquiryDataPtr + 20) == 50) {
3298                  if ((int )*(inquiryDataPtr + 21) == 53) {
3299                    if ((int )*(inquiryDataPtr + 22) == 88) {
3300                      {
3301                      MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl));
3302                      deviceExtension->Active = 4;
3303                      }
3304                    } else {
3305
3306                    }
3307                  } else {
3308
3309                  }
3310                } else {
3311
3312                }
3313              } else {
3314
3315              }
3316            } else {
3317
3318            }
3319          } else {
3320
3321          }
3322        } else {
3323
3324        }
3325      } else {
3326
3327      }
3328    } else {
3329
3330    }
3331    {
3332    tmp___5 = memcmp(inquiryDataPtr + 8, "CHINON", 6);
3333    }
3334    if (tmp___5) {
3335
3336    } else {
3337      if ((int )*(inquiryDataPtr + 27) == 53) {
3338        if ((int )*(inquiryDataPtr + 28) == 51) {
3339          if ((int )*(inquiryDataPtr + 29) == 53) {
3340            if ((int )*(inquiryDataPtr + 32) == 81) {
3341              {
3342              MmLockPagableDataSection((void *)(& CdAudio535DeviceControl));
3343              deviceExtension->Active = 2;
3344              }
3345            } else {
3346
3347            }
3348          } else {
3349
3350          }
3351        } else {
3352
3353        }
3354      } else {
3355
3356      }
3357      if ((int )*(inquiryDataPtr + 27) == 52) {
3358        if ((int )*(inquiryDataPtr + 28) == 51) {
3359          if ((int )*(inquiryDataPtr + 29) == 53) {
3360            goto _L;
3361          } else {
3362            if ((int )*(inquiryDataPtr + 29) == 49) {
3363              _L: /* CIL Label */ 
3364              if ((int )*(inquiryDataPtr + 32) == 77) {
3365                {
3366                MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3367                deviceExtension->Active = 3;
3368                }
3369              } else {
3370                if ((int )*(inquiryDataPtr + 32) == 78) {
3371                  {
3372                  MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3373                  deviceExtension->Active = 3;
3374                  }
3375                } else {
3376                  if ((int )*(inquiryDataPtr + 32) == 83) {
3377                    {
3378                    MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3379                    deviceExtension->Active = 3;
3380                    }
3381                  } else {
3382                    if ((int )*(inquiryDataPtr + 32) == 85) {
3383                      {
3384                      MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3385                      deviceExtension->Active = 3;
3386                      }
3387                    } else {
3388                      if ((int )*(inquiryDataPtr + 32) == 72) {
3389                        {
3390                        MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3391                        deviceExtension->Active = 3;
3392                        }
3393                      } else {
3394
3395                      }
3396                    }
3397                  }
3398                }
3399              }
3400            } else {
3401
3402            }
3403          }
3404        } else {
3405
3406        }
3407      } else {
3408
3409      }
3410    }
3411    {
3412    tmp___6 = memcmp(inquiryDataPtr + 8, "HITACHI ", 8);
3413    }
3414    if (tmp___6) {
3415
3416    } else {
3417      {
3418      tmp___7 = memcmp(inquiryDataPtr + 16, "CDR-3650/1650S  ", 16);
3419      }
3420      if (tmp___7) {
3421        {
3422        tmp___8 = memcmp(inquiryDataPtr + 16, "CDR-1750S       ", 16);
3423        }
3424        if (tmp___8) {
3425
3426        } else {
3427          {
3428          MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3429          deviceExtension->Active = 6;
3430          }
3431        }
3432      } else {
3433        {
3434        MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3435        deviceExtension->Active = 6;
3436        }
3437      }
3438    }
3439    {
3440    tmp___9 = memcmp(inquiryDataPtr + 8, "WEARNES ", 8);
3441    }
3442    if (tmp___9) {
3443      _L___0: /* CIL Label */ 
3444      {
3445      tmp___11 = memcmp(inquiryDataPtr + 8, "OTI     ", 8);
3446      }
3447      if (tmp___11) {
3448
3449      } else {
3450        {
3451        tmp___12 = memcmp(inquiryDataPtr + 16, "DOLPHIN ", 8);
3452        }
3453        if (tmp___12) {
3454
3455        } else {
3456          {
3457          MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3458          deviceExtension->Active = 1;
3459          *(inquiryDataPtr + 25) = (unsigned char)0;
3460          }
3461        }
3462      }
3463    } else {
3464      {
3465      tmp___10 = memcmp(inquiryDataPtr + 16, "RUB", 3);
3466      }
3467      if (tmp___10) {
3468        goto _L___0;
3469      } else {
3470        {
3471        MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3472        deviceExtension->Active = 1;
3473        *(inquiryDataPtr + 25) = (unsigned char)0;
3474        }
3475      }
3476    }
3477    {
3478    tmp___13 = memcmp(inquiryDataPtr + 8, "FUJITSU ", 8);
3479    }
3480    if (tmp___13) {
3481
3482    } else {
3483      if ((int )*(inquiryDataPtr + 16) == 67) {
3484        if ((int )*(inquiryDataPtr + 17) == 68) {
3485          if ((int )*(inquiryDataPtr + 18) == 82) {
3486            if ((int )*(inquiryDataPtr + 20) == 51) {
3487              if ((int )*(inquiryDataPtr + 21) == 54) {
3488                if ((int )*(inquiryDataPtr + 22) == 53) {
3489                  if ((int )*(inquiryDataPtr + 23) == 48) {
3490                    {
3491                    MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3492                    deviceExtension->Active = 6;
3493                    *(inquiryDataPtr + 25) = (unsigned char)0;
3494                    }
3495                  } else {
3496                    goto _L___6;
3497                  }
3498                } else {
3499                  goto _L___6;
3500                }
3501              } else {
3502                goto _L___6;
3503              }
3504            } else {
3505              goto _L___6;
3506            }
3507          } else {
3508            goto _L___6;
3509          }
3510        } else {
3511          goto _L___6;
3512        }
3513      } else {
3514        _L___6: /* CIL Label */ 
3515        if ((int )*(inquiryDataPtr + 16) == 70) {
3516          if ((int )*(inquiryDataPtr + 17) == 77) {
3517            if ((int )*(inquiryDataPtr + 18) == 67) {
3518              if ((int )*(inquiryDataPtr + 21) == 49) {
3519                if ((int )*(inquiryDataPtr + 22) == 48) {
3520                  if ((int )*(inquiryDataPtr + 23) == 49) {
3521                    {
3522                    MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3523                    deviceExtension->Active = 5;
3524                    *(inquiryDataPtr + 25) = (unsigned char)0;
3525                    }
3526                  } else {
3527                    if ((int )*(inquiryDataPtr + 23) == 50) {
3528                      {
3529                      MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3530                      deviceExtension->Active = 5;
3531                      *(inquiryDataPtr + 25) = (unsigned char)0;
3532                      }
3533                    } else {
3534
3535                    }
3536                  }
3537                } else {
3538
3539                }
3540              } else {
3541
3542              }
3543            } else {
3544
3545            }
3546          } else {
3547
3548          }
3549        } else {
3550
3551        }
3552      }
3553    }
3554    {
3555    tmp___14 = memcmp(inquiryDataPtr + 8, "HP      ", 8);
3556    }
3557    if (tmp___14) {
3558
3559    } else {
3560      {
3561      tmp___15 = memcmp(inquiryDataPtr + 16, "C4324/C4325", 11);
3562      }
3563      if (tmp___15) {
3564
3565      } else {
3566        {
3567        MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl));
3568        deviceExtension->Active = 7;
3569        }
3570      }
3571    }
3572    {
3573/*     ExFreePool(inquiryDataPtr); */ /* INLINED */
3574    }
3575  } else {
3576
3577  }
3578  {
3579  keyValue = (unsigned long )deviceExtension->Active;
3580  status = IoOpenDeviceRegistryKey(deviceExtension->TargetPdo, 2, 131078L, & deviceParameterHandle);
3581  }
3582  if (! (status >= 0L)) {
3583    return (0L);
3584  } else {
3585
3586  }
3587  {
3588  status = RtlWriteRegistryValue(1073741824, (WCHAR *)deviceParameterHandle, "M\000a\000p\000T\000y\000p\000e\000",
3589                                 4, & keyValue, sizeof(keyValue));
3590  }
3591  if (! (status >= 0L)) {
3592
3593  } else {
3594
3595  }
3596  {
3597  ZwClose(deviceParameterHandle);
3598  }
3599  return (0L);
3600}
3601}
3602NTSTATUS CdAudioPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3603{ PIO_STACK_LOCATION irpSp ;
3604  NTSTATUS status ;
3605  BOOLEAN setPagable ;
3606  PCD_DEVICE_EXTENSION deviceExtension ;
3607  NTSTATUS tmp ;
3608  NTSTATUS tmp___0 ;
3609
3610  {
3611  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
3612  status = -1073741637L;
3613  if (irpSp->MinorFunction == 0) {
3614    goto switch_2_0;
3615  } else {
3616    if (irpSp->MinorFunction == 22) {
3617      goto switch_2_22;
3618    } else {
3619      {
3620      goto switch_2_default;
3621      if (0) {
3622        switch_2_0: /* CIL Label */ 
3623        {
3624        status = CdAudioStartDevice(DeviceObject, Irp);
3625        Irp->IoStatus.__annonCompField4.Status = status;
3626        myStatus = status;
3627        IofCompleteRequest(Irp, 0);
3628        }
3629        return (status);
3630        switch_2_22: /* CIL Label */ ;
3631        if ((int )irpSp->Parameters.UsageNotification.Type != 1) {
3632          {
3633          tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
3634          }
3635          return (tmp);
3636        } else {
3637
3638        }
3639        {
3640        deviceExtension = DeviceObject->DeviceExtension;
3641        status = KeWaitForSingleObject(& deviceExtension->PagingPathCountEvent, 0,
3642                                       0, 0, (void *)0);
3643        setPagable = 0;
3644        }
3645        if (! irpSp->Parameters.UsageNotification.InPath) {
3646          if (deviceExtension->PagingPathCount == 1UL) {
3647            if (DeviceObject->Flags & 16384UL) {
3648
3649            } else {
3650              DeviceObject->Flags |= 8192UL;
3651              setPagable = 1;
3652            }
3653          } else {
3654
3655          }
3656        } else {
3657
3658        }
3659        {
3660        status = CdAudioForwardIrpSynchronous(DeviceObject, Irp);
3661        }
3662        if (status >= 0L) {
3663          if (irpSp->Parameters.UsageNotification.InPath) {
3664            {
3665            InterlockedIncrement(& deviceExtension->PagingPathCount);
3666            }
3667          } else {
3668            {
3669            InterlockedDecrement(& deviceExtension->PagingPathCount);
3670            }
3671          }
3672          if (irpSp->Parameters.UsageNotification.InPath) {
3673            if (deviceExtension->PagingPathCount == 1UL) {
3674              DeviceObject->Flags &= 4294959103UL;
3675            } else {
3676
3677            }
3678          } else {
3679
3680          }
3681        } else {
3682          if ((int )setPagable == 1) {
3683            DeviceObject->Flags &= 4294959103UL;
3684            setPagable = 0;
3685          } else {
3686
3687          }
3688        }
3689        {
3690        KeSetEvent(& deviceExtension->PagingPathCountEvent, 0, 0);
3691        IofCompleteRequest(Irp, 0);
3692        }
3693        return (status);
3694        goto switch_2_break;
3695        switch_2_default: /* CIL Label */ 
3696        {
3697        tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp);
3698        }
3699        return (tmp___0);
3700      } else {
3701        switch_2_break: /* CIL Label */ ;
3702      }
3703      }
3704    }
3705  }
3706  return (0L);
3707}
3708}
3709NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) 
3710{ ULONG i = __VERIFIER_nondet_long() ;
3711
3712  {
3713  DriverObject->MajorFunction[i] = & CdAudioSendToNextDriver;
3714  DriverObject->MajorFunction[3] = & CdAudioReadWrite;
3715  DriverObject->MajorFunction[4] = & CdAudioReadWrite;
3716  DriverObject->MajorFunction[14] = & CdAudioDeviceControl;
3717  DriverObject->MajorFunction[27] = & CdAudioPnp;
3718  DriverObject->MajorFunction[22] = & CdAudioPower;
3719  (DriverObject->DriverExtension)->AddDevice = & CdAudioAddDevice;
3720  DriverObject->DriverUnload = & CdAudioUnload;
3721  return (0L);
3722}
3723}
3724BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) 
3725{ PINQUIRYDATA inquiryData ;
3726  ULONG i = __VERIFIER_nondet_long() ;
3727  PUCHAR badDriveList[12] ;
3728  SIZE_T tmp ;
3729
3730  {
3731  {
3732  inquiryData = (struct _INQUIRYDATA *)InquiryData;
3733  badDriveList[0] = "CD-ROM DRIVE:80 ";
3734  badDriveList[1] = "CD-ROM DRIVE:82 ";
3735  badDriveList[2] = "CD-ROM DRIVE:83 ";
3736  badDriveList[3] = "CD-ROM DRIVE:84 ";
3737  badDriveList[4] = "CD-ROM DRIVE:841";
3738  badDriveList[5] = "CD-ROM DRIVE:38 ";
3739  badDriveList[6] = "CD-ROM DRIVE 4 M";
3740  badDriveList[7] = "CD-ROM DRIVE:500";
3741  badDriveList[8] = "CD-ROM DRIVE:400";
3742  badDriveList[9] = "CD-ROM DRIVE:401";
3743  badDriveList[10] = "CD-ROM DRIVE:501";
3744  badDriveList[11] = "CD-ROM DRIVE:900";
3745  tmp = RtlCompareMemory(inquiryData->ProductId, badDriveList[i], 16);
3746  }
3747  if (tmp == 16UL) {
3748    return (1);
3749  } else {
3750
3751  }
3752  return (0);
3753}
3754}
3755NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3756{ PCD_DEVICE_EXTENSION deviceExtension ;
3757  NTSTATUS tmp ;
3758
3759  {
3760  deviceExtension = DeviceObject->DeviceExtension;
3761  if (deviceExtension->PlayActive) {
3762    {
3763    Irp->IoStatus.__annonCompField4.Status = -2147483631L;
3764    myStatus = -2147483631L;
3765    IofCompleteRequest(Irp, 0);
3766    }
3767    return (-2147483631L);
3768  } else {
3769
3770  }
3771  {
3772  tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
3773  }
3774  return (tmp);
3775}
3776}
3777NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3778{ PCD_DEVICE_EXTENSION deviceExtension ;
3779  NTSTATUS status ;
3780
3781  {
3782  deviceExtension = DeviceObject->DeviceExtension;
3783  if (deviceExtension->Active == 2) {
3784    goto switch_3_2;
3785  } else {
3786    if (deviceExtension->Active == 3) {
3787      goto switch_3_3;
3788    } else {
3789      if (deviceExtension->Active == 1) {
3790        goto switch_3_1;
3791      } else {
3792        if (deviceExtension->Active == 7) {
3793          goto switch_3_7;
3794        } else {
3795          {
3796          goto switch_3_default;
3797          if (0) {
3798            switch_3_2: /* CIL Label */ 
3799            {
3800            status = CdAudio535DeviceControl(DeviceObject, Irp);
3801            }
3802            goto switch_3_break;
3803            switch_3_3: /* CIL Label */ 
3804            {
3805            status = CdAudio435DeviceControl(DeviceObject, Irp);
3806            }
3807            goto switch_3_break;
3808            switch_3_1: /* CIL Label */ 
3809            {
3810            status = CdAudioAtapiDeviceControl(DeviceObject, Irp);
3811            }
3812            goto switch_3_break;
3813            switch_3_7: /* CIL Label */ 
3814            {
3815            status = CdAudioHPCdrDeviceControl(DeviceObject, Irp);
3816            }
3817            goto switch_3_break;
3818            switch_3_default: /* CIL Label */ 
3819            {
3820            deviceExtension->Active = 0;
3821            status = CdAudioSendToNextDriver(DeviceObject, Irp);
3822            }
3823          } else {
3824            switch_3_break: /* CIL Label */ ;
3825          }
3826          }
3827        }
3828      }
3829    }
3830  }
3831  return (status);
3832}
3833}
3834NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3835{ PCD_DEVICE_EXTENSION deviceExtension ;
3836  NTSTATUS tmp ;
3837
3838  {
3839  deviceExtension = DeviceObject->DeviceExtension;
3840  if (s == NP) {
3841    s = SKIP1;
3842  } else {
3843    {
3844    errorFn();
3845    }
3846  }
3847  {
3848  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
3849  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
3850  tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
3851  }
3852  return (tmp);
3853}
3854}
3855BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) 
3856{ PCD_DEVICE_EXTENSION deviceExtension ;
3857  PIRP irp_CdAudioIsPlayActive = __VERIFIER_nondet_pointer() ;
3858  IO_STATUS_BLOCK ioStatus ;
3859  KEVENT event ;
3860  NTSTATUS status = __VERIFIER_nondet_long() ;
3861  PSUB_Q_CURRENT_POSITION currentBuffer ;
3862  BOOLEAN returnValue ;
3863  PVOID tmp ;
3864
3865  {
3866  deviceExtension = DeviceObject->DeviceExtension;
3867  if (! deviceExtension->PlayActive) {
3868    return (0);
3869  } else {
3870
3871  }
3872  {
3873  tmp = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ), 541156419UL);
3874  currentBuffer = tmp;
3875  }
3876  if ((unsigned int )currentBuffer == (unsigned int )((void *)0)) {
3877    return (0);
3878  } else {
3879
3880  }
3881  {
3882  ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Format = 1;
3883  ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Track = 0;
3884/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
3885  }
3886  if ((unsigned int )irp_CdAudioIsPlayActive == (unsigned int )((void *)0)) {
3887    {
3888/*     ExFreePool(currentBuffer); */ /* INLINED */
3889    }
3890    return (0);
3891  } else {
3892
3893  }
3894  if (status == 259L) {
3895    {
3896    KeWaitForSingleObject(& event, 5, 0, 0, (void *)0);
3897    status = ioStatus.__annonCompField4.Status;
3898    }
3899  } else {
3900
3901  }
3902  if (! (status >= 0L)) {
3903    {
3904/*     ExFreePool(currentBuffer); */ /* INLINED */
3905    }
3906    return (0);
3907  } else {
3908
3909  }
3910  if ((int )currentBuffer->Header.AudioStatus == 17) {
3911    returnValue = 1;
3912  } else {
3913    returnValue = 0;
3914    deviceExtension->PlayActive = 0;
3915  }
3916  {
3917/*   ExFreePool(currentBuffer); */ /* INLINED */
3918  }
3919  return (returnValue);
3920}
3921}
3922NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3923{ PIO_STACK_LOCATION currentIrpStack ;
3924  PCD_DEVICE_EXTENSION deviceExtension ;
3925  PCDROM_TOC cdaudioDataOut ;
3926  SCSI_PASS_THROUGH srb ;
3927  PNEC_CDB cdb ;
3928  NTSTATUS status ;
3929  ULONG i ;
3930  ULONG bytesTransfered ;
3931  PUCHAR Toc ;
3932  ULONG retryCount ;
3933  ULONG address ;
3934  LARGE_INTEGER delay ;
3935  BOOLEAN tmp ;
3936  PVOID tmp___0 ;
3937  BOOLEAN tmp___1 ;
3938  PVOID tmp___2 ;
3939  ULONG tracksToReturn ;
3940  ULONG tracksOnCd ;
3941  ULONG tracksInBuffer ;
3942  ULONG dataLength ;
3943  NTSTATUS tmp___3 ;
3944  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
3945  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
3946  PSUB_Q_CURRENT_POSITION userPtr ;
3947  PUCHAR SubQPtr ;
3948  PVOID tmp___4 ;
3949  ULONG tmp___5 ;
3950  NTSTATUS tmp___6 ;
3951
3952  {
3953  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
3954  deviceExtension = DeviceObject->DeviceExtension;
3955  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
3956  cdb = (union _NEC_CDB *)(srb.Cdb);
3957  retryCount = 0;
3958  NECRestart: 
3959  {
3960  memset(cdb, 0, 12);
3961  }
3962  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
3963    goto switch_4_exp_0;
3964  } else {
3965    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
3966      goto switch_4_exp_1;
3967    } else {
3968      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
3969        goto switch_4_exp_2;
3970      } else {
3971        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
3972          goto switch_4_exp_3;
3973        } else {
3974          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
3975            goto switch_4_exp_4;
3976          } else {
3977            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
3978              goto switch_4_exp_5;
3979            } else {
3980              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
3981                goto switch_4_exp_6;
3982              } else {
3983                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
3984                  goto switch_4_exp_7;
3985                } else {
3986                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
3987                    goto switch_4_exp_8;
3988                  } else {
3989                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
3990                      goto switch_4_exp_9;
3991                    } else {
3992                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
3993                        goto switch_4_exp_10;
3994                      } else {
3995                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
3996                          goto switch_4_exp_11;
3997                        } else {
3998                          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
3999                            goto switch_4_exp_12;
4000                          } else {
4001                            {
4002                            goto switch_4_default;
4003                            if (0) {
4004                              switch_4_exp_0: /* CIL Label */ ;
4005                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) {
4006                                status = -1073741789L;
4007                                Irp->IoStatus.Information = 0;
4008                                goto switch_4_break;
4009                              } else {
4010
4011                              }
4012                              {
4013                              tmp = CdAudioIsPlayActive(DeviceObject);
4014                              }
4015                              if (tmp) {
4016                                Irp->IoStatus.Information = 0;
4017                                status = -2147483631L;
4018                                goto switch_4_break;
4019                              } else {
4020
4021                              }
4022                              {
4023                              tmp___0 = ExAllocatePoolWithTag(4, 1022, 541156419UL);
4024                              Toc = (UCHAR *)tmp___0;
4025                              }
4026                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4027                                status = -1073741670L;
4028                                Irp->IoStatus.Information = 0;
4029                                goto SetStatusAndReturn;
4030                              } else {
4031
4032                              }
4033                              {
4034                              memset(Toc, 0, 1022);
4035                              srb.CdbLength = 10;
4036                              cdb->NEC_READ_TOC.OperationCode = 222;
4037                              cdb->NEC_READ_TOC.Type = 3;
4038                              cdb->NEC_READ_TOC.TrackNumber = 176;
4039                              srb.TimeOutValue = 10;
4040                              status = SendSrbSynchronous(deviceExtension, & srb,
4041                                                          Toc, 1022);
4042                              }
4043                              if (! (status >= 0L)) {
4044                                if (status != -1073741764L) {
4045                                  {
4046/*                                   ExFreePool(Toc); */ /* INLINED */
4047                                  Irp->IoStatus.Information = 0;
4048                                  }
4049                                  goto SetStatusAndReturn;
4050                                } else {
4051                                  status = 0L;
4052                                }
4053                              } else {
4054                                status = 0L;
4055                              }
4056                              {
4057                              bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]);
4058                              Irp->IoStatus.Information = bytesTransfered;
4059                              memset(cdaudioDataOut, 0, bytesTransfered);
4060                              cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8);
4061                              cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL);
4062                              }
4063                              if (*((ULONG *)(Toc + 14)) == 0UL) {
4064                                {
4065/*                                 ExFreePool(Toc); */ /* INLINED */
4066                                }
4067                                goto switch_4_break;
4068                              } else {
4069
4070                              }
4071                              {
4072                              cdaudioDataOut->FirstTrack = 1;
4073                              cdaudioDataOut->LastTrack = 2;
4074                              cdaudioDataOut->TrackData[0].Reserved = 0;
4075                              cdaudioDataOut->TrackData[0].Control = (((int )*(Toc + 2) & 15) << 4) | ((int )*(Toc + 2) >> 4);
4076                              cdaudioDataOut->TrackData[0].TrackNumber = 1;
4077                              cdaudioDataOut->TrackData[0].Reserved1 = 0;
4078                              address = (((((int )*(Toc + 15) & 240) >> 4) * 10 + ((int )*(Toc + 15) & 15)) * 60 + ((((int )*(Toc + 16) & 240) >> 4) * 10 + ((int )*(Toc + 16) & 15))) * 75 + ((((int )*(Toc + 17) & 240) >> 4) * 10 + ((int )*(Toc + 17) & 15));
4079                              cdaudioDataOut->TrackData[0].Address[0] = (unsigned char )(address >> 24);
4080                              cdaudioDataOut->TrackData[0].Address[1] = (unsigned char )(address >> 16);
4081                              cdaudioDataOut->TrackData[0].Address[2] = (unsigned char )(address >> 8);
4082                              cdaudioDataOut->TrackData[0].Address[3] = (unsigned char )address;
4083/*                               ExFreePool(Toc); */ /* INLINED */
4084                              }
4085                              goto switch_4_break;
4086                              switch_4_exp_1: /* CIL Label */ 
4087                              {
4088                              tmp___1 = CdAudioIsPlayActive(DeviceObject);
4089                              }
4090                              if (tmp___1) {
4091                                status = -2147483631L;
4092                                Irp->IoStatus.Information = 0;
4093                                goto switch_4_break;
4094                              } else {
4095
4096                              }
4097                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
4098                                status = -1073741789L;
4099                                Irp->IoStatus.Information = 0;
4100                                goto switch_4_break;
4101                              } else {
4102
4103                              }
4104                              {
4105                              tmp___2 = ExAllocatePoolWithTag(4, 1022, 541156419UL);
4106                              Toc = (UCHAR *)tmp___2;
4107                              }
4108                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4109                                status = -1073741670L;
4110                                Irp->IoStatus.Information = 0;
4111                                goto SetStatusAndReturn;
4112                              } else {
4113
4114                              }
4115                              {
4116                              memset(Toc, 0, 1022);
4117                              srb.CdbLength = 10;
4118                              cdb->NEC_READ_TOC.OperationCode = 222;
4119                              cdb->NEC_READ_TOC.Type = 3;
4120                              srb.TimeOutValue = 10;
4121                              status = SendSrbSynchronous(deviceExtension, & srb,
4122                                                          Toc, 1022);
4123                              }
4124                              if (! (status >= 0L)) {
4125                                if (status != -1073741764L) {
4126                                  if (status != -1073741764L) {
4127                                    {
4128                                    Irp->IoStatus.Information = 0;
4129/*                                     ExFreePool(Toc); */ /* INLINED */
4130                                    }
4131                                    goto SetStatusAndReturn;
4132                                  } else {
4133
4134                                  }
4135                                } else {
4136                                  status = 0L;
4137                                }
4138                              } else {
4139                                status = 0L;
4140                              }
4141                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
4142                                bytesTransfered = sizeof(CDROM_TOC );
4143                              } else {
4144                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
4145                              }
4146                              cdaudioDataOut->FirstTrack = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15);
4147                              cdaudioDataOut->LastTrack = (((int )*(Toc + 19) & 240) >> 4) * 10 + ((int )*(Toc + 19) & 15);
4148                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
4149                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
4150                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
4151                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
4152                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
4153                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
4154                              if (tracksInBuffer < tracksOnCd) {
4155                                tracksToReturn = tracksInBuffer;
4156                              } else {
4157                                tracksToReturn = tracksOnCd;
4158                              }
4159                              i = 0;
4160                              {
4161                              while (1) {
4162                                while_5_continue: /* CIL Label */ ;
4163                                if (i < tracksToReturn) {
4164
4165                                } else {
4166                                  goto while_5_break;
4167                                }
4168                                cdaudioDataOut->TrackData[i].Reserved = 0;
4169                                cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 10UL + 32UL)) & 15) << 4) | ((int )*(Toc + (i * 10UL + 32UL)) >> 4);
4170                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
4171                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
4172                                cdaudioDataOut->TrackData[i].Address[0] = 0;
4173                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 10UL + 39UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 39UL)) & 15);
4174                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 10UL + 40UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 40UL)) & 15);
4175                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 10UL + 41UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 41UL)) & 15);
4176                                i += 1UL;
4177                              }
4178                              while_5_break: /* CIL Label */ ;
4179                              }
4180                              if (tracksInBuffer > tracksOnCd) {
4181                                cdaudioDataOut->TrackData[i].Reserved = 0;
4182                                cdaudioDataOut->TrackData[i].Control = 16;
4183                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
4184                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
4185                                cdaudioDataOut->TrackData[i].Address[0] = 0;
4186                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 29) & 240) >> 4) * 10 + ((int )*(Toc + 29) & 15);
4187                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 30) & 240) >> 4) * 10 + ((int )*(Toc + 30) & 15);
4188                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 31) & 240) >> 4) * 10 + ((int )*(Toc + 31) & 15);
4189                                i += 1UL;
4190                              } else {
4191
4192                              }
4193                              {
4194                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
4195/*                               ExFreePool(Toc); */ /* INLINED */
4196                              }
4197                              goto switch_4_break;
4198                              switch_4_exp_2: /* CIL Label */ 
4199                              {
4200                              deviceExtension->PlayActive = 0;
4201                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
4202                              }
4203                              return (tmp___3);
4204                              goto switch_4_break;
4205                              switch_4_exp_3: /* CIL Label */ 
4206                              inputBuffer = Irp->AssociatedIrp.SystemBuffer;
4207                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
4208                                status = -1073741820L;
4209                                Irp->IoStatus.Information = 0;
4210                                goto switch_4_break;
4211                              } else {
4212
4213                              }
4214                              {
4215                              srb.CdbLength = 10;
4216                              srb.TimeOutValue = 10;
4217                              cdb->NEC_PLAY_AUDIO.OperationCode = 216;
4218                              cdb->NEC_PLAY_AUDIO.PlayMode = 1;
4219                              cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
4220                              cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
4221                              cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
4222                              cdb->NEC_PLAY_AUDIO.Control = 64;
4223                              status = SendSrbSynchronous(deviceExtension, & srb,
4224                                                          (void *)0, 0);
4225                              }
4226                              if (status >= 0L) {
4227                                {
4228                                deviceExtension->PlayActive = 1;
4229                                memset(cdb, 0, 12);
4230                                cdb->NEC_PLAY_AUDIO.OperationCode = 217;
4231                                cdb->NEC_PLAY_AUDIO.PlayMode = 3;
4232                                cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
4233                                cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
4234                                cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
4235                                cdb->NEC_PLAY_AUDIO.Control = 64;
4236                                status = SendSrbSynchronous(deviceExtension, & srb,
4237                                                            (void *)0, 0);
4238                                }
4239                              } else {
4240
4241                              }
4242                              goto switch_4_break;
4243                              switch_4_exp_4: /* CIL Label */ 
4244                              inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
4245                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
4246                                status = -1073741820L;
4247                                Irp->IoStatus.Information = 0;
4248                                goto switch_4_break;
4249                              } else {
4250
4251                              }
4252                              {
4253                              srb.CdbLength = 10;
4254                              srb.TimeOutValue = 10;
4255                              cdb->NEC_SEEK_AUDIO.OperationCode = 216;
4256                              cdb->NEC_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
4257                              cdb->NEC_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
4258                              cdb->NEC_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
4259                              cdb->NEC_SEEK_AUDIO.Control = 64;
4260                              status = SendSrbSynchronous(deviceExtension, & srb,
4261                                                          (void *)0, 0);
4262                              }
4263                              goto switch_4_break;
4264                              switch_4_exp_5: /* CIL Label */ 
4265                              {
4266                              deviceExtension->PlayActive = 0;
4267                              srb.CdbLength = 10;
4268                              srb.TimeOutValue = 10;
4269                              cdb->NEC_PAUSE_AUDIO.OperationCode = 218;
4270                              status = SendSrbSynchronous(deviceExtension, & srb,
4271                                                          (void *)0, 0);
4272                              }
4273                              goto switch_4_break;
4274                              switch_4_exp_6: /* CIL Label */ 
4275                              {
4276                              srb.CdbLength = 10;
4277                              srb.TimeOutValue = 10;
4278                              cdb->NEC_PLAY_AUDIO.OperationCode = 217;
4279                              cdb->NEC_PLAY_AUDIO.PlayMode = 3;
4280                              cdb->NEC_PLAY_AUDIO.Control = 192;
4281                              status = SendSrbSynchronous(deviceExtension, & srb,
4282                                                          (void *)0, 0);
4283                              }
4284                              goto switch_4_break;
4285                              switch_4_exp_7: /* CIL Label */ 
4286                              {
4287                              userPtr = Irp->AssociatedIrp.SystemBuffer;
4288                              tmp___4 = ExAllocatePoolWithTag(4, 10, 541156419UL);
4289                              SubQPtr = tmp___4;
4290                              }
4291                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
4292                                status = -1073741789L;
4293                                Irp->IoStatus.Information = 0;
4294                                if (SubQPtr) {
4295                                  {
4296/*                                   ExFreePool(SubQPtr); */ /* INLINED */
4297                                  }
4298                                } else {
4299
4300                                }
4301                                goto switch_4_break;
4302                              } else {
4303
4304                              }
4305                              if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
4306                                status = -1073741670L;
4307                                Irp->IoStatus.Information = 0;
4308                                goto SetStatusAndReturn;
4309                              } else {
4310
4311                              }
4312                              {
4313                              memset(SubQPtr, 0, 10);
4314                              }
4315                              if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
4316                                {
4317/*                                 ExFreePool(SubQPtr); */ /* INLINED */
4318                                status = -1073741823L;
4319                                Irp->IoStatus.Information = 0;
4320                                }
4321                                goto SetStatusAndReturn;
4322                              } else {
4323
4324                              }
4325                              NECSeek: 
4326                              {
4327                              srb.CdbLength = 10;
4328                              srb.TimeOutValue = 10;
4329                              cdb->NEC_READ_Q_CHANNEL.OperationCode = 221;
4330                              cdb->NEC_READ_Q_CHANNEL.TransferSize = 10;
4331                              status = SendSrbSynchronous(deviceExtension, & srb,
4332                                                          SubQPtr, 10);
4333                              }
4334                              if (status >= 0L) {
4335                                goto _L;
4336                              } else {
4337                                if (status == -1073741764L) {
4338                                  _L: /* CIL Label */ 
4339                                  userPtr->Header.Reserved = 0;
4340                                  if ((int )*(SubQPtr + 0) == 0) {
4341                                    userPtr->Header.AudioStatus = 17;
4342                                  } else {
4343                                    if ((int )*(SubQPtr + 0) == 1) {
4344                                      userPtr->Header.AudioStatus = 18;
4345                                      deviceExtension->PlayActive = 0;
4346                                    } else {
4347                                      if ((int )*(SubQPtr + 0) == 2) {
4348                                        userPtr->Header.AudioStatus = 18;
4349                                        deviceExtension->PlayActive = 0;
4350                                      } else {
4351                                        if ((int )*(SubQPtr + 0) == 3) {
4352                                          userPtr->Header.AudioStatus = 19;
4353                                          deviceExtension->PlayActive = 0;
4354                                        } else {
4355                                          deviceExtension->PlayActive = 0;
4356                                        }
4357                                      }
4358                                    }
4359                                  }
4360                                  userPtr->Header.DataLength[0] = 0;
4361                                  userPtr->Header.DataLength[0] = 12;
4362                                  userPtr->FormatCode = 1;
4363                                  userPtr->Control = (int )*(SubQPtr + 1) & 15;
4364                                  userPtr->ADR = 0;
4365                                  userPtr->TrackNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15);
4366                                  userPtr->IndexNumber = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15);
4367                                  userPtr->AbsoluteAddress[0] = 0;
4368                                  userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
4369                                  userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15);
4370                                  userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr + 9) & 15);
4371                                  userPtr->TrackRelativeAddress[0] = 0;
4372                                  userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15);
4373                                  userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15);
4374                                  userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
4375                                  Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
4376                                  if ((int )userPtr->TrackNumber > 100) {
4377                                    {
4378                                    delay.QuadPart = -5000000;
4379                                    KeDelayExecutionThread(0, 0, & delay);
4380                                    tmp___5 = retryCount;
4381                                    retryCount += 1UL;
4382                                    }
4383                                    if (tmp___5 < 4UL) {
4384                                      goto NECSeek;
4385                                    } else {
4386                                      Irp->IoStatus.Information = 0;
4387                                      status = -1073741434L;
4388                                    }
4389                                  } else {
4390                                    status = 0L;
4391                                  }
4392                                } else {
4393                                  {
4394                                  memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4395                                  Irp->IoStatus.Information = 0;
4396                                  }
4397                                }
4398                              }
4399                              {
4400/*                               ExFreePool(SubQPtr); */ /* INLINED */
4401                              }
4402                              goto switch_4_break;
4403                              switch_4_exp_8: /* CIL Label */ 
4404                              {
4405                              deviceExtension->PlayActive = 0;
4406                              srb.CdbLength = 10;
4407                              srb.TimeOutValue = 10;
4408                              cdb->NEC_EJECT.OperationCode = 220;
4409                              status = SendSrbSynchronous(deviceExtension, & srb,
4410                                                          (void *)0, 0);
4411                              Irp->IoStatus.Information = 0;
4412                              }
4413                              goto switch_4_break;
4414                              switch_4_exp_9: /* CIL Label */ ;
4415                              switch_4_exp_10: /* CIL Label */ ;
4416                              switch_4_exp_11: /* CIL Label */ 
4417                              Irp->IoStatus.Information = 0;
4418                              status = -1073741808L;
4419                              goto switch_4_break;
4420                              switch_4_exp_12: /* CIL Label */ 
4421                              {
4422                              CdAudioIsPlayActive(DeviceObject);
4423                              }
4424                              switch_4_default: /* CIL Label */ 
4425                              {
4426                              tmp___6 = CdAudioSendToNextDriver(DeviceObject, Irp);
4427                              }
4428                              return (tmp___6);
4429                              goto switch_4_break;
4430                            } else {
4431                              switch_4_break: /* CIL Label */ ;
4432                            }
4433                            }
4434                          }
4435                        }
4436                      }
4437                    }
4438                  }
4439                }
4440              }
4441            }
4442          }
4443        }
4444      }
4445    }
4446  }
4447  SetStatusAndReturn: 
4448  if (status == -2147483626L) {
4449    if ((int )currentIrpStack->Flags & 2) {
4450      status = -1073741435L;
4451      goto NECRestart;
4452    } else {
4453
4454    }
4455    {
4456/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
4457    Irp->IoStatus.Information = 0;
4458    }
4459  } else {
4460
4461  }
4462  {
4463  Irp->IoStatus.__annonCompField4.Status = status;
4464  myStatus = status;
4465  IofCompleteRequest(Irp, 0);
4466  }
4467  return (status);
4468}
4469}
4470NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
4471{ PIO_STACK_LOCATION currentIrpStack ;
4472  PCD_DEVICE_EXTENSION deviceExtension ;
4473  PCDROM_TOC cdaudioDataOut ;
4474  SCSI_PASS_THROUGH srb ;
4475  PPNR_CDB cdb ;
4476  PCDB scsiCdb ;
4477  NTSTATUS status ;
4478  ULONG i ;
4479  ULONG retry ;
4480  PUCHAR Toc ;
4481  BOOLEAN tmp ;
4482  PVOID tmp___0 ;
4483  ULONG tracksToReturn ;
4484  ULONG tracksOnCd ;
4485  ULONG tracksInBuffer ;
4486  ULONG dataLength ;
4487  NTSTATUS tmp___1 ;
4488  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
4489  ULONG tmp___2 ;
4490  ULONG tmp___3 ;
4491  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
4492  ULONG tmp___4 ;
4493  PSUB_Q_CURRENT_POSITION userPtr ;
4494  PUCHAR SubQPtr ;
4495  PVOID tmp___5 ;
4496  ULONG tmp___6 ;
4497  ULONG tmp___7 ;
4498  NTSTATUS tmp___8 ;
4499
4500  {
4501  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
4502  deviceExtension = DeviceObject->DeviceExtension;
4503  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
4504  cdb = (union _PIONEER_CDB *)(srb.Cdb);
4505  scsiCdb = (union _CDB *)(srb.Cdb);
4506  PioneerRestart: 
4507  {
4508  memset(cdb, 0, 12);
4509  }
4510  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
4511    goto switch_6_exp_13;
4512  } else {
4513    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
4514      goto switch_6_exp_14;
4515    } else {
4516      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
4517        goto switch_6_exp_15;
4518      } else {
4519        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
4520          goto switch_6_exp_16;
4521        } else {
4522          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
4523            goto switch_6_exp_17;
4524          } else {
4525            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
4526              goto switch_6_exp_18;
4527            } else {
4528              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
4529                goto switch_6_exp_19;
4530              } else {
4531                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
4532                  goto switch_6_exp_20;
4533                } else {
4534                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
4535                    goto switch_6_exp_21;
4536                  } else {
4537                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
4538                      goto switch_6_exp_22;
4539                    } else {
4540                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
4541                        goto switch_6_exp_23;
4542                      } else {
4543                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
4544                          goto switch_6_exp_24;
4545                        } else {
4546                          {
4547                          goto switch_6_default;
4548                          if (0) {
4549                            switch_6_exp_13: /* CIL Label */ ;
4550                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
4551                              status = -1073741789L;
4552                              Irp->IoStatus.Information = 0;
4553                              goto switch_6_break;
4554                            } else {
4555
4556                            }
4557                            {
4558                            tmp = CdAudioIsPlayActive(DeviceObject);
4559                            }
4560                            if (tmp) {
4561                              status = -2147483631L;
4562                              Irp->IoStatus.Information = 0;
4563                              goto switch_6_break;
4564                            } else {
4565
4566                            }
4567                            {
4568                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
4569                                                            541156419UL);
4570                            Toc = (UCHAR *)tmp___0;
4571                            }
4572                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4573                              status = -1073741670L;
4574                              Irp->IoStatus.Information = 0;
4575                              goto SetStatusAndReturn;
4576                            } else {
4577
4578                            }
4579                            {
4580                            memset(Toc, 0, sizeof(CDROM_TOC ));
4581                            }
4582                            if ((int )deviceExtension->Active == 9) {
4583                              cdb->PNR_START_STOP.Immediate = 1;
4584                            } else {
4585                              cdb->PNR_START_STOP.Immediate = 0;
4586                            }
4587                            {
4588                            cdb->PNR_START_STOP.OperationCode = 27;
4589                            cdb->PNR_START_STOP.Start = 1;
4590                            srb.CdbLength = 6;
4591                            srb.TimeOutValue = 10;
4592                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4593                                                        0);
4594                            }
4595                            if (! (status >= 0L)) {
4596                              {
4597/*                               ExFreePool(Toc); */ /* INLINED */
4598                              Irp->IoStatus.Information = 0;
4599                              }
4600                              goto SetStatusAndReturn;
4601                            } else {
4602
4603                            }
4604                            {
4605                            memset(cdb, 0, 12);
4606                            srb.CdbLength = 10;
4607                            cdb->PNR_READ_TOC.OperationCode = 193;
4608                            cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4609                            cdb->PNR_READ_TOC.Type = 0;
4610                            srb.TimeOutValue = 10;
4611                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
4612                                                        4);
4613                            }
4614                            if (! (status >= 0L)) {
4615                              {
4616/*                               ExFreePool(Toc); */ /* INLINED */
4617                              Irp->IoStatus.Information = 0;
4618                              }
4619                              goto SetStatusAndReturn;
4620                            } else {
4621
4622                            }
4623                            cdaudioDataOut->FirstTrack = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15);
4624                            cdaudioDataOut->LastTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4625                            tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
4626                            dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
4627                            cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
4628                            cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
4629                            tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
4630                            tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
4631                            if (tracksInBuffer < tracksOnCd) {
4632                              tracksToReturn = tracksInBuffer;
4633                            } else {
4634                              tracksToReturn = tracksOnCd;
4635                            }
4636                            i = 0;
4637                            {
4638                            while (1) {
4639                              while_7_continue: /* CIL Label */ ;
4640                              if (i < tracksToReturn) {
4641
4642                              } else {
4643                                goto while_7_break;
4644                              }
4645                              {
4646                              memset(cdb, 0, 12);
4647                              cdb->PNR_READ_TOC.OperationCode = 193;
4648                              cdb->PNR_READ_TOC.TrackNumber = (unsigned char )(((i + (ULONG )cdaudioDataOut->FirstTrack) / 10UL << 4) + (i + (ULONG )cdaudioDataOut->FirstTrack) % 10UL);
4649                              cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4650                              cdb->PNR_READ_TOC.Type = 2;
4651                              srb.TimeOutValue = 10;
4652                              status = SendSrbSynchronous(deviceExtension, & srb,
4653                                                          Toc, 4);
4654                              }
4655                              if (! (status >= 0L)) {
4656                                {
4657/*                                 ExFreePool(Toc); */ /* INLINED */
4658                                Irp->IoStatus.Information = 0;
4659                                }
4660                                goto SetStatusAndReturn;
4661                              } else {
4662
4663                              }
4664                              cdaudioDataOut->TrackData[i].Reserved = 0;
4665                              cdaudioDataOut->TrackData[i].Control = *(Toc + 0);
4666                              cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
4667                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
4668                              cdaudioDataOut->TrackData[i].Address[0] = 0;
4669                              cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4670                              cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
4671                              cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
4672                              i += 1UL;
4673                            }
4674                            while_7_break: /* CIL Label */ ;
4675                            }
4676                            if (tracksInBuffer > tracksOnCd) {
4677                              {
4678                              memset(cdb, 0, 12);
4679                              cdb->PNR_READ_TOC.OperationCode = 193;
4680                              cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4681                              cdb->PNR_READ_TOC.Type = 1;
4682                              srb.TimeOutValue = 10;
4683                              status = SendSrbSynchronous(deviceExtension, & srb,
4684                                                          Toc, 4);
4685                              }
4686                              if (! (status >= 0L)) {
4687                                {
4688/*                                 ExFreePool(Toc); */ /* INLINED */
4689                                Irp->IoStatus.Information = 0;
4690                                }
4691                                goto SetStatusAndReturn;
4692                              } else {
4693
4694                              }
4695                              cdaudioDataOut->TrackData[i].Reserved = 0;
4696                              cdaudioDataOut->TrackData[i].Control = 16;
4697                              cdaudioDataOut->TrackData[i].TrackNumber = 170;
4698                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
4699                              cdaudioDataOut->TrackData[i].Address[0] = 0;
4700                              cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15);
4701                              cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4702                              cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
4703                              i += 1UL;
4704                            } else {
4705
4706                            }
4707                            {
4708                            Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
4709/*                             ExFreePool(Toc); */ /* INLINED */
4710                            }
4711                            goto switch_6_break;
4712                            switch_6_exp_14: /* CIL Label */ 
4713                            {
4714                            deviceExtension->PlayActive = 0;
4715                            tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp);
4716                            }
4717                            return (tmp___1);
4718                            goto switch_6_break;
4719                            switch_6_exp_15: /* CIL Label */ 
4720                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
4721                            Irp->IoStatus.Information = 0;
4722                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
4723                              status = -1073741820L;
4724                              goto switch_6_break;
4725                            } else {
4726
4727                            }
4728                            retry = 5;
4729                            {
4730                            while (1) {
4731                              while_8_continue: /* CIL Label */ ;
4732                              {
4733                              srb.CdbLength = 10;
4734                              srb.TimeOutValue = 10;
4735                              cdb->PNR_SEEK_AUDIO.OperationCode = 200;
4736                              cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
4737                              cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
4738                              cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
4739                              cdb->PNR_SEEK_AUDIO.Type = 1;
4740                              status = SendSrbSynchronous(deviceExtension, & srb,
4741                                                          (void *)0, 0);
4742                              }
4743                              if (! (status >= 0L)) {
4744                                tmp___2 = retry;
4745                                retry -= 1UL;
4746                                if (tmp___2 > 0UL) {
4747
4748                                } else {
4749                                  goto while_8_break;
4750                                }
4751                              } else {
4752                                goto while_8_break;
4753                              }
4754                            }
4755                            while_8_break: /* CIL Label */ ;
4756                            }
4757                            if (status >= 0L) {
4758                              {
4759                              memset(cdb, 0, 12);
4760                              retry = 5;
4761                              }
4762                              {
4763                              while (1) {
4764                                while_9_continue: /* CIL Label */ ;
4765                                {
4766                                srb.CdbLength = 10;
4767                                srb.TimeOutValue = 10;
4768                                cdb->PNR_PLAY_AUDIO.OperationCode = 201;
4769                                cdb->PNR_PLAY_AUDIO.StopAddr = 1;
4770                                cdb->PNR_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
4771                                cdb->PNR_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
4772                                cdb->PNR_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
4773                                cdb->PNR_PLAY_AUDIO.Type = 1;
4774                                status = SendSrbSynchronous(deviceExtension, & srb,
4775                                                            (void *)0, 0);
4776                                }
4777                                if (! (status >= 0L)) {
4778                                  tmp___3 = retry;
4779                                  retry -= 1UL;
4780                                  if (tmp___3 > 0UL) {
4781
4782                                  } else {
4783                                    goto while_9_break;
4784                                  }
4785                                } else {
4786                                  goto while_9_break;
4787                                }
4788                              }
4789                              while_9_break: /* CIL Label */ ;
4790                              }
4791                              if (status >= 0L) {
4792                                deviceExtension->PlayActive = 1;
4793                              } else {
4794
4795                              }
4796                            } else {
4797
4798                            }
4799                            goto switch_6_break;
4800                            switch_6_exp_16: /* CIL Label */ 
4801                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
4802                            Irp->IoStatus.Information = 0;
4803                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
4804                              status = -1073741820L;
4805                              goto switch_6_break;
4806                            } else {
4807
4808                            }
4809                            retry = 5;
4810                            {
4811                            while (1) {
4812                              while_10_continue: /* CIL Label */ ;
4813                              {
4814                              srb.CdbLength = 10;
4815                              srb.TimeOutValue = 10;
4816                              cdb->PNR_SEEK_AUDIO.OperationCode = 200;
4817                              cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
4818                              cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
4819                              cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
4820                              cdb->PNR_SEEK_AUDIO.Type = 1;
4821                              status = SendSrbSynchronous(deviceExtension, & srb,
4822                                                          (void *)0, 0);
4823                              }
4824                              if (! (status >= 0L)) {
4825                                tmp___4 = retry;
4826                                retry -= 1UL;
4827                                if (tmp___4 > 0UL) {
4828
4829                                } else {
4830                                  goto while_10_break;
4831                                }
4832                              } else {
4833                                goto while_10_break;
4834                              }
4835                            }
4836                            while_10_break: /* CIL Label */ ;
4837                            }
4838                            goto switch_6_break;
4839                            switch_6_exp_17: /* CIL Label */ 
4840                            {
4841                            Irp->IoStatus.Information = 0;
4842                            deviceExtension->PlayActive = 0;
4843                            srb.CdbLength = 10;
4844                            srb.TimeOutValue = 10;
4845                            cdb->PNR_PAUSE_AUDIO.OperationCode = 202;
4846                            cdb->PNR_PAUSE_AUDIO.Pause = 1;
4847                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4848                                                        0);
4849                            }
4850                            goto switch_6_break;
4851                            switch_6_exp_18: /* CIL Label */ 
4852                            {
4853                            Irp->IoStatus.Information = 0;
4854                            srb.CdbLength = 10;
4855                            srb.TimeOutValue = 10;
4856                            cdb->PNR_PAUSE_AUDIO.OperationCode = 202;
4857                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4858                                                        0);
4859                            }
4860                            goto switch_6_break;
4861                            switch_6_exp_19: /* CIL Label */ 
4862                            {
4863                            userPtr = Irp->AssociatedIrp.SystemBuffer;
4864                            tmp___5 = ExAllocatePoolWithTag(4, 9, 541156419UL);
4865                            SubQPtr = tmp___5;
4866                            }
4867                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
4868                              status = -1073741789L;
4869                              Irp->IoStatus.Information = 0;
4870                              if (SubQPtr) {
4871                                {
4872/*                                 ExFreePool(SubQPtr); */ /* INLINED */
4873                                }
4874                              } else {
4875
4876                              }
4877                              goto switch_6_break;
4878                            } else {
4879
4880                            }
4881                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
4882                              {
4883                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4884                              status = -1073741670L;
4885                              Irp->IoStatus.Information = 0;
4886                              }
4887                              goto SetStatusAndReturn;
4888                            } else {
4889
4890                            }
4891                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
4892                              {
4893/*                               ExFreePool(SubQPtr); */ /* INLINED */
4894                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4895                              Irp->IoStatus.Information = 0;
4896                              status = -1073741808L;
4897                              }
4898                              goto SetStatusAndReturn;
4899                            } else {
4900
4901                            }
4902                            retry = 5;
4903                            {
4904                            while (1) {
4905                              while_11_continue: /* CIL Label */ ;
4906                              {
4907                              srb.CdbLength = 10;
4908                              srb.TimeOutValue = 10;
4909                              cdb->PNR_AUDIO_STATUS.OperationCode = 204;
4910                              cdb->PNR_AUDIO_STATUS.AssignedLength = 6;
4911                              status = SendSrbSynchronous(deviceExtension, & srb,
4912                                                          SubQPtr, 6);
4913                              }
4914                              if (! (status >= 0L)) {
4915                                tmp___6 = retry;
4916                                retry -= 1UL;
4917                                if (tmp___6 > 0UL) {
4918                                  if (status != -1073741661L) {
4919
4920                                  } else {
4921                                    goto while_11_break;
4922                                  }
4923                                } else {
4924                                  goto while_11_break;
4925                                }
4926                              } else {
4927                                goto while_11_break;
4928                              }
4929                            }
4930                            while_11_break: /* CIL Label */ ;
4931                            }
4932                            if (status >= 0L) {
4933                              userPtr->Header.Reserved = 0;
4934                              if ((int )*(SubQPtr + 0) == 0) {
4935                                userPtr->Header.AudioStatus = 17;
4936                              } else {
4937                                if ((int )*(SubQPtr + 0) == 1) {
4938                                  deviceExtension->PlayActive = 0;
4939                                  userPtr->Header.AudioStatus = 18;
4940                                } else {
4941                                  if ((int )*(SubQPtr + 0) == 2) {
4942                                    deviceExtension->PlayActive = 0;
4943                                    userPtr->Header.AudioStatus = 18;
4944                                  } else {
4945                                    if ((int )*(SubQPtr + 0) == 3) {
4946                                      userPtr->Header.AudioStatus = 19;
4947                                      deviceExtension->PlayActive = 0;
4948                                    } else {
4949                                      deviceExtension->PlayActive = 0;
4950                                    }
4951                                  }
4952                                }
4953                              }
4954                            } else {
4955                              {
4956/*                               ExFreePool(SubQPtr); */ /* INLINED */
4957                              Irp->IoStatus.Information = 0;
4958                              }
4959                              goto SetStatusAndReturn;
4960                            }
4961                            {
4962                            memset(cdb, 0, 12);
4963                            retry = 5;
4964                            }
4965                            {
4966                            while (1) {
4967                              while_12_continue: /* CIL Label */ ;
4968                              {
4969                              srb.CdbLength = 10;
4970                              srb.TimeOutValue = 10;
4971                              cdb->PNR_READ_Q_CHANNEL.OperationCode = 194;
4972                              cdb->PNR_READ_Q_CHANNEL.AssignedLength = 9;
4973                              status = SendSrbSynchronous(deviceExtension, & srb,
4974                                                          SubQPtr, 9);
4975                              }
4976                              if (! (status >= 0L)) {
4977                                tmp___7 = retry;
4978                                retry -= 1UL;
4979                                if (tmp___7 > 0UL) {
4980
4981                                } else {
4982                                  goto while_12_break;
4983                                }
4984                              } else {
4985                                goto while_12_break;
4986                              }
4987                            }
4988                            while_12_break: /* CIL Label */ ;
4989                            }
4990                            if (status >= 0L) {
4991                              userPtr->Header.DataLength[0] = 0;
4992                              userPtr->Header.DataLength[0] = 12;
4993                              userPtr->FormatCode = 1;
4994                              userPtr->Control = (int )*(SubQPtr + 0) & 15;
4995                              userPtr->ADR = 0;
4996                              userPtr->TrackNumber = (((int )*(SubQPtr + 1) & 240) >> 4) * 10 + ((int )*(SubQPtr + 1) & 15);
4997                              userPtr->IndexNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15);
4998                              userPtr->AbsoluteAddress[0] = 0;
4999                              userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
5000                              userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
5001                              userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15);
5002                              userPtr->TrackRelativeAddress[0] = 0;
5003                              userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15);
5004                              userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15);
5005                              userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15);
5006                              Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
5007                            } else {
5008                              Irp->IoStatus.Information = 0;
5009                            }
5010                            {
5011/*                             ExFreePool(SubQPtr); */ /* INLINED */
5012                            }
5013                            goto switch_6_break;
5014                            switch_6_exp_20: /* CIL Label */ 
5015                            Irp->IoStatus.Information = 0;
5016                            deviceExtension->PlayActive = 0;
5017                            if ((int )deviceExtension->Active == 9) {
5018                              srb.CdbLength = 10;
5019                              srb.TimeOutValue = 10;
5020                              cdb->PNR_EJECT.OperationCode = 192;
5021                              cdb->PNR_EJECT.Immediate = 1;
5022                            } else {
5023                              srb.CdbLength = 6;
5024                              scsiCdb->START_STOP.OperationCode = 27;
5025                              scsiCdb->START_STOP.LoadEject = 1;
5026                              scsiCdb->START_STOP.Start = 0;
5027                            }
5028                            {
5029                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
5030                                                        0);
5031                            }
5032                            goto switch_6_break;
5033                            switch_6_exp_21: /* CIL Label */ ;
5034                            switch_6_exp_22: /* CIL Label */ ;
5035                            switch_6_exp_23: /* CIL Label */ 
5036                            Irp->IoStatus.Information = 0;
5037                            status = -1073741808L;
5038                            goto switch_6_break;
5039                            switch_6_exp_24: /* CIL Label */ 
5040                            {
5041                            CdAudioIsPlayActive(DeviceObject);
5042                            }
5043                            switch_6_default: /* CIL Label */ 
5044                            {
5045                            tmp___8 = CdAudioSendToNextDriver(DeviceObject, Irp);
5046                            }
5047                            return (tmp___8);
5048                            goto switch_6_break;
5049                          } else {
5050                            switch_6_break: /* CIL Label */ ;
5051                          }
5052                          }
5053                        }
5054                      }
5055                    }
5056                  }
5057                }
5058              }
5059            }
5060          }
5061        }
5062      }
5063    }
5064  }
5065  SetStatusAndReturn: 
5066  if (status == -2147483626L) {
5067    if ((int )currentIrpStack->Flags & 2) {
5068      status = -1073741435L;
5069      goto PioneerRestart;
5070    } else {
5071
5072    }
5073    {
5074/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
5075    Irp->IoStatus.Information = 0;
5076    }
5077  } else {
5078
5079  }
5080  {
5081  Irp->IoStatus.__annonCompField4.Status = status;
5082  myStatus = status;
5083  IofCompleteRequest(Irp, 0);
5084  }
5085  return (status);
5086}
5087}
5088NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
5089{ PIO_STACK_LOCATION currentIrpStack ;
5090  PCD_DEVICE_EXTENSION deviceExtension ;
5091  PCDROM_TOC cdaudioDataOut ;
5092  SCSI_PASS_THROUGH srb ;
5093  PCDB cdb ;
5094  NTSTATUS status ;
5095  ULONG i ;
5096  ULONG bytesTransfered ;
5097  PUCHAR Toc ;
5098  BOOLEAN tmp ;
5099  PVOID tmp___0 ;
5100  ULONG tracksToReturn ;
5101  ULONG tracksOnCd ;
5102  ULONG tracksInBuffer ;
5103  ULONG dataLength ;
5104  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
5105  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
5106  PUCHAR SubQPtr ;
5107  PVOID tmp___1 ;
5108  PSUB_Q_CURRENT_POSITION userPtr ;
5109  PUCHAR SubQPtr___0 ;
5110  PVOID tmp___2 ;
5111  NTSTATUS tmp___3 ;
5112
5113  {
5114  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
5115  deviceExtension = DeviceObject->DeviceExtension;
5116  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
5117  cdb = (union _CDB *)(srb.Cdb);
5118  DenonRestart: 
5119  {
5120  memset(cdb, 0, 12);
5121  }
5122  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
5123    goto switch_13_exp_25;
5124  } else {
5125    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
5126      goto switch_13_exp_26;
5127    } else {
5128      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
5129        goto switch_13_exp_27;
5130      } else {
5131        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
5132          goto switch_13_exp_28;
5133        } else {
5134          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
5135            goto switch_13_exp_29;
5136          } else {
5137            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
5138              goto switch_13_exp_30;
5139            } else {
5140              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
5141                goto switch_13_exp_31;
5142              } else {
5143                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
5144                  goto switch_13_exp_32;
5145                } else {
5146                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
5147                    goto switch_13_exp_33;
5148                  } else {
5149                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
5150                      goto switch_13_exp_34;
5151                    } else {
5152                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
5153                        goto switch_13_exp_35;
5154                      } else {
5155                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
5156                          goto switch_13_exp_36;
5157                        } else {
5158                          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
5159                            goto switch_13_exp_37;
5160                          } else {
5161                            {
5162                            goto switch_13_default;
5163                            if (0) {
5164                              switch_13_exp_25: /* CIL Label */ 
5165                              status = -1073741808L;
5166                              Irp->IoStatus.Information = 0;
5167                              goto switch_13_break;
5168                              switch_13_exp_26: /* CIL Label */ ;
5169                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
5170                                status = -1073741789L;
5171                                Irp->IoStatus.Information = 0;
5172                                goto switch_13_break;
5173                              } else {
5174
5175                              }
5176                              {
5177                              tmp = CdAudioIsPlayActive(DeviceObject);
5178                              }
5179                              if (tmp) {
5180                                status = -2147483631L;
5181                                Irp->IoStatus.Information = 0;
5182                                goto switch_13_break;
5183                              } else {
5184
5185                              }
5186                              {
5187                              tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
5188                                                              541156419UL);
5189                              Toc = (UCHAR *)tmp___0;
5190                              }
5191                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
5192                                status = -1073741670L;
5193                                Irp->IoStatus.Information = 0;
5194                                goto SetStatusAndReturn;
5195                              } else {
5196
5197                              }
5198                              {
5199                              memset(Toc, 0, sizeof(CDROM_TOC ));
5200                              cdb->CDB6GENERIC.OperationCode = 233;
5201                              srb.TimeOutValue = 10;
5202                              srb.CdbLength = 6;
5203                              status = SendSrbSynchronous(deviceExtension, & srb,
5204                                                          Toc, sizeof(CDROM_TOC ));
5205                              }
5206                              if (! (status >= 0L)) {
5207                                if (status != -1073741764L) {
5208                                  if (status != -1073741764L) {
5209                                    {
5210/*                                     ExFreePool(Toc); */ /* INLINED */
5211                                    Irp->IoStatus.Information = 0;
5212                                    }
5213                                    goto SetStatusAndReturn;
5214                                  } else {
5215
5216                                  }
5217                                } else {
5218
5219                                }
5220                              } else {
5221
5222                              }
5223                              status = 0L;
5224                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > srb.DataTransferLength) {
5225                                bytesTransfered = srb.DataTransferLength;
5226                              } else {
5227                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5228                              }
5229                              cdaudioDataOut->FirstTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
5230                              cdaudioDataOut->LastTrack = (((int )*(Toc + 5) & 240) >> 4) * 10 + ((int )*(Toc + 5) & 15);
5231                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5232                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
5233                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
5234                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
5235                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5236                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
5237                              if (tracksInBuffer < tracksOnCd) {
5238                                tracksToReturn = tracksInBuffer;
5239                              } else {
5240                                tracksToReturn = tracksOnCd;
5241                              }
5242                              i = 0;
5243                              {
5244                              while (1) {
5245                                while_14_continue: /* CIL Label */ ;
5246                                if (i < tracksToReturn) {
5247
5248                                } else {
5249                                  goto while_14_break;
5250                                }
5251                                cdaudioDataOut->TrackData[i].Reserved = 0;
5252                                cdaudioDataOut->TrackData[i].Control = *(Toc + (i * 4UL + 12UL));
5253                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5254                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5255                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5256                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 4UL + 13UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 13UL)) & 15);
5257                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 4UL + 14UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 14UL)) & 15);
5258                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 4UL + 15UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 15UL)) & 15);
5259                                i += 1UL;
5260                              }
5261                              while_14_break: /* CIL Label */ ;
5262                              }
5263                              if (tracksInBuffer > tracksOnCd) {
5264                                cdaudioDataOut->TrackData[i].Reserved = 0;
5265                                cdaudioDataOut->TrackData[i].Control = 0;
5266                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5267                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5268                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5269                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15);
5270                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 10) & 240) >> 4) * 10 + ((int )*(Toc + 10) & 15);
5271                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 11) & 240) >> 4) * 10 + ((int )*(Toc + 11) & 15);
5272                                i += 1UL;
5273                              } else {
5274
5275                              }
5276                              {
5277                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5278                              deviceExtension->Paused = 0;
5279                              deviceExtension->PausedM = 0;
5280                              deviceExtension->PausedS = 0;
5281                              deviceExtension->PausedF = 0;
5282                              deviceExtension->LastEndM = 0;
5283                              deviceExtension->LastEndS = 0;
5284                              deviceExtension->LastEndF = 0;
5285/*                               ExFreePool(Toc); */ /* INLINED */
5286                              }
5287                              goto switch_13_break;
5288                              switch_13_exp_27: /* CIL Label */ ;
5289                              switch_13_exp_28: /* CIL Label */ 
5290                              {
5291                              inputBuffer = Irp->AssociatedIrp.SystemBuffer;
5292                              Irp->IoStatus.Information = 0;
5293                              deviceExtension->PlayActive = 0;
5294                              srb.CdbLength = 6;
5295                              srb.TimeOutValue = 10;
5296                              cdb->CDB6GENERIC.OperationCode = 231;
5297                              status = SendSrbSynchronous(deviceExtension, & srb,
5298                                                          (void *)0, 0);
5299                              }
5300                              if (status >= 0L) {
5301                                deviceExtension->Paused = 0;
5302                                deviceExtension->PausedM = 0;
5303                                deviceExtension->PausedS = 0;
5304                                deviceExtension->PausedF = 0;
5305                                deviceExtension->LastEndM = 0;
5306                                deviceExtension->LastEndS = 0;
5307                                deviceExtension->LastEndF = 0;
5308                              } else {
5309
5310                              }
5311                              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
5312                                goto SetStatusAndReturn;
5313                              } else {
5314
5315                              }
5316                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
5317                                status = -1073741820L;
5318                                goto switch_13_break;
5319                              } else {
5320
5321                              }
5322                              {
5323                              srb.CdbLength = 10;
5324                              srb.TimeOutValue = 10;
5325                              cdb->CDB10.OperationCode = 34;
5326                              cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
5327                              cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
5328                              cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
5329                              cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
5330                              cdb->CDB10.Reserved2 = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
5331                              cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
5332                              status = SendSrbSynchronous(deviceExtension, & srb,
5333                                                          (void *)0, 0);
5334                              }
5335                              if (status >= 0L) {
5336                                deviceExtension->PlayActive = 1;
5337                                deviceExtension->Paused = 0;
5338                                deviceExtension->LastEndM = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
5339                                deviceExtension->LastEndS = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
5340                                deviceExtension->LastEndF = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
5341                              } else {
5342                                if (status == -1073741808L) {
5343                                  status = -1073741803L;
5344                                } else {
5345
5346                                }
5347                              }
5348                              goto switch_13_break;
5349                              switch_13_exp_29: /* CIL Label */ 
5350                              inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
5351                              Irp->IoStatus.Information = 0;
5352                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
5353                                status = -1073741820L;
5354                                goto switch_13_break;
5355                              } else {
5356
5357                              }
5358                              {
5359                              srb.CdbLength = 10;
5360                              srb.TimeOutValue = 10;
5361                              cdb->CDB10.OperationCode = 34;
5362                              cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5363                              cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5364                              cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5365                              cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5366                              cdb->CDB10.Reserved2 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5367                              cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5368                              status = SendSrbSynchronous(deviceExtension, & srb,
5369                                                          (void *)0, 0);
5370                              }
5371                              if (status >= 0L) {
5372                                deviceExtension->Paused = 1;
5373                                deviceExtension->PausedM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5374                                deviceExtension->PausedS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5375                                deviceExtension->PausedF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5376                                deviceExtension->LastEndM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5377                                deviceExtension->LastEndS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5378                                deviceExtension->LastEndF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5379                              } else {
5380                                if (status == -1073741808L) {
5381                                  status = -1073741803L;
5382                                } else {
5383
5384                                }
5385                              }
5386                              goto switch_13_break;
5387                              switch_13_exp_30: /* CIL Label */ 
5388                              {
5389                              tmp___1 = ExAllocatePoolWithTag(4, 10, 541156419UL);
5390                              SubQPtr = tmp___1;
5391                              Irp->IoStatus.Information = 0;
5392                              deviceExtension->PlayActive = 0;
5393                              }
5394                              if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
5395                                status = -1073741670L;
5396                                goto SetStatusAndReturn;
5397                              } else {
5398
5399                              }
5400                              if ((int )deviceExtension->Paused == 1) {
5401                                {
5402/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5403                                status = 0L;
5404                                }
5405                                goto SetStatusAndReturn;
5406                              } else {
5407
5408                              }
5409                              {
5410                              srb.CdbLength = 6;
5411                              srb.TimeOutValue = 10;
5412                              cdb->CDB6GENERIC.OperationCode = 235;
5413                              cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10;
5414                              status = SendSrbSynchronous(deviceExtension, & srb,
5415                                                          SubQPtr, 10);
5416                              }
5417                              if (! (status >= 0L)) {
5418                                {
5419/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5420                                }
5421                                goto SetStatusAndReturn;
5422                              } else {
5423
5424                              }
5425                              {
5426                              deviceExtension->PausedM = *(SubQPtr + 7);
5427                              deviceExtension->PausedS = *(SubQPtr + 8);
5428                              deviceExtension->PausedF = *(SubQPtr + 9);
5429                              memset(cdb, 0, 12);
5430                              srb.CdbLength = 6;
5431                              srb.TimeOutValue = 10;
5432                              cdb->CDB6GENERIC.OperationCode = 231;
5433                              status = SendSrbSynchronous(deviceExtension, & srb,
5434                                                          (void *)0, 0);
5435                              }
5436                              if (! (status >= 0L)) {
5437                                {
5438/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5439                                }
5440                                goto SetStatusAndReturn;
5441                              } else {
5442
5443                              }
5444                              {
5445                              deviceExtension->Paused = 1;
5446                              deviceExtension->PausedM = *(SubQPtr + 7);
5447                              deviceExtension->PausedS = *(SubQPtr + 8);
5448                              deviceExtension->PausedF = *(SubQPtr + 9);
5449/*                               ExFreePool(SubQPtr); */ /* INLINED */
5450                              }
5451                              goto switch_13_break;
5452                              switch_13_exp_31: /* CIL Label */ 
5453                              Irp->IoStatus.Information = 0;
5454                              if ((int )deviceExtension->Paused == 0) {
5455                                status = -1073741823L;
5456                                goto SetStatusAndReturn;
5457                              } else {
5458
5459                              }
5460                              {
5461                              srb.CdbLength = 10;
5462                              srb.TimeOutValue = 10;
5463                              cdb->CDB10.OperationCode = 34;
5464                              cdb->CDB10.LogicalBlockByte0 = deviceExtension->PausedM;
5465                              cdb->CDB10.LogicalBlockByte1 = deviceExtension->PausedS;
5466                              cdb->CDB10.LogicalBlockByte2 = deviceExtension->PausedF;
5467                              cdb->CDB10.LogicalBlockByte3 = deviceExtension->LastEndM;
5468                              cdb->CDB10.Reserved2 = deviceExtension->LastEndS;
5469                              cdb->CDB10.TransferBlocksMsb = deviceExtension->LastEndF;
5470                              status = SendSrbSynchronous(deviceExtension, & srb,
5471                                                          (void *)0, 0);
5472                              }
5473                              if (status >= 0L) {
5474                                deviceExtension->Paused = 0;
5475                              } else {
5476
5477                              }
5478                              goto switch_13_break;
5479                              switch_13_exp_32: /* CIL Label */ 
5480                              {
5481                              userPtr = Irp->AssociatedIrp.SystemBuffer;
5482                              tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
5483                                                              541156419UL);
5484                              SubQPtr___0 = tmp___2;
5485                              }
5486                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
5487                                status = -1073741789L;
5488                                Irp->IoStatus.Information = 0;
5489                                if (SubQPtr___0) {
5490                                  {
5491/*                                   ExFreePool(SubQPtr___0); */ /* INLINED */
5492                                  }
5493                                } else {
5494
5495                                }
5496                                goto switch_13_break;
5497                              } else {
5498
5499                              }
5500                              if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) {
5501                                {
5502                                memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
5503                                status = -1073741670L;
5504                                Irp->IoStatus.Information = 0;
5505                                }
5506                                goto SetStatusAndReturn;
5507                              } else {
5508
5509                              }
5510                              if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
5511                                {
5512/*                                 ExFreePool(SubQPtr___0); */ /* INLINED */
5513                                memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
5514                                status = -1073741823L;
5515                                Irp->IoStatus.Information = 0;
5516                                }
5517                                goto SetStatusAndReturn;
5518                              } else {
5519
5520                              }
5521                              {
5522                              srb.CdbLength = 6;
5523                              srb.TimeOutValue = 10;
5524                              cdb->CDB6GENERIC.OperationCode = 235;
5525                              cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10;
5526                              status = SendSrbSynchronous(deviceExtension, & srb,
5527                                                          SubQPtr___0, 10);
5528                              }
5529                              if (status >= 0L) {
5530                                userPtr->Header.Reserved = 0;
5531                                if ((int )deviceExtension->Paused == 1) {
5532                                  deviceExtension->PlayActive = 0;
5533                                  userPtr->Header.AudioStatus = 18;
5534                                } else {
5535                                  if ((int )*(SubQPtr___0 + 0) == 1) {
5536                                    userPtr->Header.AudioStatus = 17;
5537                                  } else {
5538                                    if ((int )*(SubQPtr___0 + 0) == 0) {
5539                                      userPtr->Header.AudioStatus = 19;
5540                                      deviceExtension->PlayActive = 0;
5541                                    } else {
5542                                      deviceExtension->PlayActive = 0;
5543                                    }
5544                                  }
5545                                }
5546                                userPtr->Header.DataLength[0] = 0;
5547                                userPtr->Header.DataLength[0] = 12;
5548                                userPtr->FormatCode = 1;
5549                                userPtr->Control = *(SubQPtr___0 + 1);
5550                                userPtr->ADR = 0;
5551                                userPtr->TrackNumber = (((int )*(SubQPtr___0 + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 2) & 15);
5552                                userPtr->IndexNumber = (((int )*(SubQPtr___0 + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 3) & 15);
5553                                userPtr->AbsoluteAddress[0] = 0;
5554                                userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15);
5555                                userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr___0 + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 8) & 15);
5556                                userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr___0 + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 9) & 15);
5557                                userPtr->TrackRelativeAddress[0] = 0;
5558                                userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr___0 + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 4) & 15);
5559                                userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr___0 + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 5) & 15);
5560                                userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15);
5561                                Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
5562                              } else {
5563                                Irp->IoStatus.Information = 0;
5564                              }
5565                              {
5566/*                               ExFreePool(SubQPtr___0); */ /* INLINED */
5567                              }
5568                              goto switch_13_break;
5569                              switch_13_exp_33: /* CIL Label */ 
5570                              {
5571                              Irp->IoStatus.Information = 0;
5572                              deviceExtension->PlayActive = 0;
5573                              srb.CdbLength = 6;
5574                              srb.TimeOutValue = 10;
5575                              cdb->CDB6GENERIC.OperationCode = 230;
5576                              status = SendSrbSynchronous(deviceExtension, & srb,
5577                                                          (void *)0, 0);
5578                              }
5579                              goto switch_13_break;
5580                              switch_13_exp_34: /* CIL Label */ ;
5581                              switch_13_exp_35: /* CIL Label */ ;
5582                              switch_13_exp_36: /* CIL Label */ 
5583                              Irp->IoStatus.Information = 0;
5584                              status = -1073741808L;
5585                              goto switch_13_break;
5586                              switch_13_exp_37: /* CIL Label */ 
5587                              {
5588                              CdAudioIsPlayActive(DeviceObject);
5589                              }
5590                              switch_13_default: /* CIL Label */ 
5591                              {
5592                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
5593                              }
5594                              return (tmp___3);
5595                              goto switch_13_break;
5596                            } else {
5597                              switch_13_break: /* CIL Label */ ;
5598                            }
5599                            }
5600                          }
5601                        }
5602                      }
5603                    }
5604                  }
5605                }
5606              }
5607            }
5608          }
5609        }
5610      }
5611    }
5612  }
5613  SetStatusAndReturn: 
5614  if (status == -2147483626L) {
5615    if ((int )currentIrpStack->Flags & 2) {
5616      status = -1073741435L;
5617      goto DenonRestart;
5618    } else {
5619
5620    }
5621    {
5622/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
5623    Irp->IoStatus.Information = 0;
5624    }
5625  } else {
5626
5627  }
5628  {
5629  Irp->IoStatus.__annonCompField4.Status = status;
5630  myStatus = status;
5631  IofCompleteRequest(Irp, 0);
5632  }
5633  return (status);
5634}
5635}
5636NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) 
5637{ PCD_DEVICE_EXTENSION deviceExtension ;
5638  SCSI_PASS_THROUGH srb ;
5639  PHITACHICDB cdb ;
5640  NTSTATUS status ;
5641  PUCHAR PausePos ;
5642  PVOID tmp ;
5643
5644  {
5645  {
5646  deviceExtension = DeviceObject->DeviceExtension;
5647  cdb = (union _HITACHICDB *)(srb.Cdb);
5648  tmp = ExAllocatePoolWithTag(4, 3, 541156419UL);
5649  PausePos = (UCHAR *)tmp;
5650  }
5651  if ((unsigned int )PausePos == (unsigned int )((void *)0)) {
5652    return (-1073741670L);
5653  } else {
5654
5655  }
5656  {
5657  memset(PausePos, 0, 3);
5658  memset(cdb, 0, 12);
5659  srb.CdbLength = 12;
5660  srb.TimeOutValue = 10;
5661  cdb->PAUSE_AUDIO.OperationCode = 225;
5662  status = SendSrbSynchronous(deviceExtension, & srb, PausePos, 3);
5663/*   ExFreePool(PausePos); */ /* INLINED */
5664  }
5665  return (status);
5666}
5667}
5668NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
5669{ PIO_STACK_LOCATION currentIrpStack ;
5670  PCD_DEVICE_EXTENSION deviceExtension ;
5671  PCDROM_TOC cdaudioDataOut ;
5672  SCSI_PASS_THROUGH srb ;
5673  PHITACHICDB cdb ;
5674  NTSTATUS status ;
5675  ULONG i ;
5676  ULONG bytesTransfered ;
5677  PUCHAR Toc ;
5678  BOOLEAN tmp ;
5679  PVOID tmp___0 ;
5680  ULONG tracksToReturn ;
5681  ULONG tracksOnCd ;
5682  ULONG tracksInBuffer ;
5683  ULONG dataLength ;
5684  ULONG tracksToReturn___0 ;
5685  ULONG tracksOnCd___0 ;
5686  ULONG tracksInBuffer___0 ;
5687  ULONG dataLength___0 ;
5688  NTSTATUS tmp___1 ;
5689  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
5690  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
5691  PUCHAR PausePos ;
5692  PVOID tmp___2 ;
5693  PSUB_Q_CURRENT_POSITION userPtr ;
5694  PUCHAR SubQPtr ;
5695  PVOID tmp___3 ;
5696  PUCHAR EjectStatus ;
5697  PVOID tmp___4 ;
5698  NTSTATUS tmp___5 ;
5699
5700  {
5701  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
5702  deviceExtension = DeviceObject->DeviceExtension;
5703  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
5704  cdb = (union _HITACHICDB *)(srb.Cdb);
5705  HitachiRestart: 
5706  {
5707  memset(cdb, 0, 12);
5708  }
5709  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
5710    goto switch_15_exp_38;
5711  } else {
5712    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
5713      goto switch_15_exp_39;
5714    } else {
5715      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
5716        goto switch_15_exp_40;
5717      } else {
5718        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
5719          goto switch_15_exp_41;
5720        } else {
5721          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
5722            goto switch_15_exp_42;
5723          } else {
5724            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
5725              goto switch_15_exp_43;
5726            } else {
5727              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
5728                goto switch_15_exp_44;
5729              } else {
5730                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
5731                  goto switch_15_exp_45;
5732                } else {
5733                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
5734                    goto switch_15_exp_46;
5735                  } else {
5736                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
5737                      goto switch_15_exp_47;
5738                    } else {
5739                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
5740                        goto switch_15_exp_48;
5741                      } else {
5742                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
5743                          goto switch_15_exp_49;
5744                        } else {
5745                          {
5746                          goto switch_15_default;
5747                          if (0) {
5748                            switch_15_exp_38: /* CIL Label */ ;
5749                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
5750                              status = -1073741789L;
5751                              Irp->IoStatus.Information = 0;
5752                              goto switch_15_break;
5753                            } else {
5754
5755                            }
5756                            {
5757                            tmp = CdAudioIsPlayActive(DeviceObject);
5758                            }
5759                            if (tmp) {
5760                              status = -2147483631L;
5761                              Irp->IoStatus.Information = 0;
5762                              goto switch_15_break;
5763                            } else {
5764
5765                            }
5766                            {
5767                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
5768                                                            541156419UL);
5769                            Toc = (UCHAR *)tmp___0;
5770                            }
5771                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
5772                              status = -1073741670L;
5773                              Irp->IoStatus.Information = 0;
5774                              goto SetStatusAndReturn;
5775                            } else {
5776
5777                            }
5778                            {
5779                            memset(Toc, 0, sizeof(CDROM_TOC ));
5780                            srb.CdbLength = 12;
5781                            }
5782                            if ((int )deviceExtension->Active == 5) {
5783                              cdb->READ_DISC_INFO.OperationCode = 227;
5784                            } else {
5785                              cdb->READ_DISC_INFO.OperationCode = 232;
5786                            }
5787                            {
5788                            cdb->READ_DISC_INFO.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8;
5789                            cdb->READ_DISC_INFO.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U;
5790                            srb.TimeOutValue = 10;
5791                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
5792                                                        sizeof(CDROM_TOC ));
5793                            }
5794                            if (! (status >= 0L)) {
5795                              if (status != -1073741764L) {
5796                                if (status != -1073741764L) {
5797                                  {
5798/*                                   ExFreePool(Toc); */ /* INLINED */
5799                                  Irp->IoStatus.Information = 0;
5800                                  }
5801                                  goto SetStatusAndReturn;
5802                                } else {
5803
5804                                }
5805                              } else {
5806                                status = 0L;
5807                              }
5808                            } else {
5809                              status = 0L;
5810                            }
5811                            if ((int )deviceExtension->Active == 6) {
5812                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
5813                                bytesTransfered = sizeof(CDROM_TOC );
5814                              } else {
5815                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5816                              }
5817                              cdaudioDataOut->FirstTrack = *(Toc + 2);
5818                              cdaudioDataOut->LastTrack = *(Toc + 3);
5819                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5820                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
5821                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
5822                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
5823                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5824                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
5825                              if (tracksInBuffer < tracksOnCd) {
5826                                tracksToReturn = tracksInBuffer;
5827                              } else {
5828                                tracksToReturn = tracksOnCd;
5829                              }
5830                              i = 0;
5831                              {
5832                              while (1) {
5833                                while_16_continue: /* CIL Label */ ;
5834                                if (i < tracksToReturn) {
5835
5836                                } else {
5837                                  goto while_16_break;
5838                                }
5839                                cdaudioDataOut->TrackData[i].Reserved = 0;
5840                                cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 4UL + 8UL)) & 15) << 4) | ((int )*(Toc + (i * 4UL + 8UL)) >> 4);
5841                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5842                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5843                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5844                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + (i * 4UL + 9UL));
5845                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 4UL + 10UL));
5846                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 4UL + 11UL));
5847                                i += 1UL;
5848                              }
5849                              while_16_break: /* CIL Label */ ;
5850                              }
5851                              if (tracksInBuffer > tracksOnCd) {
5852                                cdaudioDataOut->TrackData[i].Reserved = 0;
5853                                cdaudioDataOut->TrackData[i].Control = 16;
5854                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5855                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5856                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5857                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 5);
5858                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 6);
5859                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 7);
5860                                i += 1UL;
5861                              } else {
5862
5863                              }
5864                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5865                              deviceExtension->Paused = 0;
5866                              deviceExtension->PausedM = 0;
5867                              deviceExtension->PausedS = 0;
5868                              deviceExtension->PausedF = 0;
5869                              deviceExtension->LastEndM = 0;
5870                              deviceExtension->LastEndS = 0;
5871                              deviceExtension->LastEndF = 0;
5872                            } else {
5873                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
5874                                bytesTransfered = sizeof(CDROM_TOC );
5875                              } else {
5876                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5877                              }
5878                              cdaudioDataOut->FirstTrack = *(Toc + 1);
5879                              cdaudioDataOut->LastTrack = *(Toc + 2);
5880                              tracksOnCd___0 = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5881                              dataLength___0 = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd___0])) - 2UL;
5882                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength___0 >> 8);
5883                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength___0 & 255UL);
5884                              tracksInBuffer___0 = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5885                              tracksInBuffer___0 /= (ULONG )sizeof(TRACK_DATA );
5886                              if (tracksInBuffer___0 < tracksOnCd___0) {
5887                                tracksToReturn___0 = tracksInBuffer___0;
5888                              } else {
5889                                tracksToReturn___0 = tracksOnCd___0;
5890                              }
5891                              i = 0;
5892                              {
5893                              while (1) {
5894                                while_17_continue: /* CIL Label */ ;
5895                                if (i < tracksToReturn___0) {
5896
5897                                } else {
5898                                  goto while_17_break;
5899                                }
5900                                cdaudioDataOut->TrackData[i].Reserved = 0;
5901                                if ((int )*(Toc + (i * 3UL + 6UL)) & 128) {
5902                                  cdaudioDataOut->TrackData[i].Control = 4;
5903                                } else {
5904                                  cdaudioDataOut->TrackData[i].Control = 0;
5905                                }
5906                                cdaudioDataOut->TrackData[i].Adr = 0;
5907                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5908                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5909                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5910                                cdaudioDataOut->TrackData[i].Address[1] = (int )*(Toc + (i * 3UL + 6UL)) & 127;
5911                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 3UL + 7UL));
5912                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 3UL + 8UL));
5913                                i += 1UL;
5914                              }
5915                              while_17_break: /* CIL Label */ ;
5916                              }
5917                              if (tracksInBuffer___0 > tracksOnCd___0) {
5918                                cdaudioDataOut->TrackData[i].Reserved = 0;
5919                                cdaudioDataOut->TrackData[i].Control = 16;
5920                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5921                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5922                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5923                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 3);
5924                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 4);
5925                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 5);
5926                                i += 1UL;
5927                              } else {
5928
5929                              }
5930                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5931                            }
5932                            {
5933/*                             ExFreePool(Toc); */ /* INLINED */
5934                            }
5935                            goto switch_15_break;
5936                            switch_15_exp_39: /* CIL Label */ 
5937                            {
5938                            deviceExtension->PlayActive = 0;
5939                            Irp->IoStatus.Information = 0;
5940                            CdAudioHitachiSendPauseCommand(DeviceObject);
5941                            deviceExtension->Paused = 0;
5942                            deviceExtension->PausedM = 0;
5943                            deviceExtension->PausedS = 0;
5944                            deviceExtension->PausedF = 0;
5945                            deviceExtension->LastEndM = 0;
5946                            deviceExtension->LastEndS = 0;
5947                            deviceExtension->LastEndF = 0;
5948                            tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp);
5949                            }
5950                            return (tmp___1);
5951                            goto switch_15_break;
5952                            switch_15_exp_40: /* CIL Label */ 
5953                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
5954                            Irp->IoStatus.Information = 0;
5955                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
5956                              status = -1073741820L;
5957                              goto switch_15_break;
5958                            } else {
5959
5960                            }
5961                            {
5962                            CdAudioHitachiSendPauseCommand(DeviceObject);
5963                            srb.CdbLength = 12;
5964                            srb.TimeOutValue = 10;
5965                            cdb->PLAY_AUDIO.OperationCode = 224;
5966                            cdb->PLAY_AUDIO.Immediate = 1;
5967                            cdb->PLAY_AUDIO.StartingM = inputBuffer->StartingM;
5968                            cdb->PLAY_AUDIO.StartingS = inputBuffer->StartingS;
5969                            cdb->PLAY_AUDIO.StartingF = inputBuffer->StartingF;
5970                            cdb->PLAY_AUDIO.EndingM = inputBuffer->EndingM;
5971                            cdb->PLAY_AUDIO.EndingS = inputBuffer->EndingS;
5972                            cdb->PLAY_AUDIO.EndingF = inputBuffer->EndingF;
5973                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
5974                                                        0);
5975                            }
5976                            if (status >= 0L) {
5977                              deviceExtension->PlayActive = 1;
5978                              deviceExtension->Paused = 0;
5979                              deviceExtension->PausedM = inputBuffer->StartingM;
5980                              deviceExtension->PausedS = inputBuffer->StartingS;
5981                              deviceExtension->PausedF = inputBuffer->StartingF;
5982                              deviceExtension->LastEndM = inputBuffer->EndingM;
5983                              deviceExtension->LastEndS = inputBuffer->EndingS;
5984                              deviceExtension->LastEndF = inputBuffer->EndingF;
5985                            } else {
5986
5987                            }
5988                            goto switch_15_break;
5989                            switch_15_exp_41: /* CIL Label */ 
5990                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
5991                            Irp->IoStatus.Information = 0;
5992                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
5993                              status = -1073741820L;
5994                              goto switch_15_break;
5995                            } else {
5996
5997                            }
5998                            {
5999                            CdAudioHitachiSendPauseCommand(DeviceObject);
6000                            srb.CdbLength = 12;
6001                            srb.TimeOutValue = 10;
6002                            cdb->PLAY_AUDIO.OperationCode = 224;
6003                            cdb->PLAY_AUDIO.Immediate = 1;
6004                            cdb->PLAY_AUDIO.StartingM = inputBuffer___0->M;
6005                            cdb->PLAY_AUDIO.StartingS = inputBuffer___0->S;
6006                            cdb->PLAY_AUDIO.StartingF = inputBuffer___0->F;
6007                            cdb->PLAY_AUDIO.EndingM = inputBuffer___0->M;
6008                            cdb->PLAY_AUDIO.EndingS = inputBuffer___0->S;
6009                            cdb->PLAY_AUDIO.EndingF = inputBuffer___0->F;
6010                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6011                                                        0);
6012                            }
6013                            if (status >= 0L) {
6014                              deviceExtension->PausedM = inputBuffer___0->M;
6015                              deviceExtension->PausedS = inputBuffer___0->S;
6016                              deviceExtension->PausedF = inputBuffer___0->F;
6017                              deviceExtension->LastEndM = inputBuffer___0->M;
6018                              deviceExtension->LastEndS = inputBuffer___0->S;
6019                              deviceExtension->LastEndF = inputBuffer___0->F;
6020                            } else {
6021
6022                            }
6023                            goto switch_15_break;
6024                            switch_15_exp_42: /* CIL Label */ 
6025                            {
6026                            tmp___2 = ExAllocatePoolWithTag(4, 3, 541156419UL);
6027                            PausePos = tmp___2;
6028                            Irp->IoStatus.Information = 0;
6029                            }
6030                            if ((unsigned int )PausePos == (unsigned int )((void *)0)) {
6031                              status = -1073741670L;
6032                              goto SetStatusAndReturn;
6033                            } else {
6034
6035                            }
6036                            {
6037                            deviceExtension->PlayActive = 0;
6038                            memset(PausePos, 0, 3);
6039                            srb.CdbLength = 12;
6040                            srb.TimeOutValue = 10;
6041                            cdb->PAUSE_AUDIO.OperationCode = 225;
6042                            status = SendSrbSynchronous(deviceExtension, & srb, PausePos,
6043                                                        3);
6044                            deviceExtension->Paused = 1;
6045                            deviceExtension->PausedM = *(PausePos + 0);
6046                            deviceExtension->PausedS = *(PausePos + 1);
6047                            deviceExtension->PausedF = *(PausePos + 2);
6048/*                             ExFreePool(PausePos); */ /* INLINED */
6049                            }
6050                            goto switch_15_break;
6051                            switch_15_exp_43: /* CIL Label */ 
6052                            {
6053                            Irp->IoStatus.Information = 0;
6054                            CdAudioHitachiSendPauseCommand(DeviceObject);
6055                            srb.CdbLength = 12;
6056                            srb.TimeOutValue = 10;
6057                            cdb->PLAY_AUDIO.OperationCode = 224;
6058                            cdb->PLAY_AUDIO.Immediate = 1;
6059                            cdb->PLAY_AUDIO.StartingM = deviceExtension->PausedM;
6060                            cdb->PLAY_AUDIO.StartingS = deviceExtension->PausedS;
6061                            cdb->PLAY_AUDIO.StartingF = deviceExtension->PausedF;
6062                            cdb->PLAY_AUDIO.EndingM = deviceExtension->LastEndM;
6063                            cdb->PLAY_AUDIO.EndingS = deviceExtension->LastEndS;
6064                            cdb->PLAY_AUDIO.EndingF = deviceExtension->LastEndF;
6065                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6066                                                        0);
6067                            }
6068                            if (status >= 0L) {
6069                              deviceExtension->Paused = 0;
6070                            } else {
6071
6072                            }
6073                            goto switch_15_break;
6074                            switch_15_exp_44: /* CIL Label */ 
6075                            {
6076                            userPtr = Irp->AssociatedIrp.SystemBuffer;
6077                            tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
6078                                                            541156419UL);
6079                            SubQPtr = tmp___3;
6080                            }
6081                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
6082                              status = -1073741789L;
6083                              Irp->IoStatus.Information = 0;
6084                              if (SubQPtr) {
6085                                {
6086/*                                 ExFreePool(SubQPtr); */ /* INLINED */
6087                                }
6088                              } else {
6089
6090                              }
6091                              goto switch_15_break;
6092                            } else {
6093
6094                            }
6095                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
6096                              status = -1073741670L;
6097                              Irp->IoStatus.Information = 0;
6098                              goto SetStatusAndReturn;
6099                            } else {
6100
6101                            }
6102                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
6103                              {
6104/*                               ExFreePool(SubQPtr); */ /* INLINED */
6105                              status = -1073741823L;
6106                              Irp->IoStatus.Information = 0;
6107                              }
6108                              goto SetStatusAndReturn;
6109                            } else {
6110
6111                            }
6112                            srb.CdbLength = 12;
6113                            srb.TimeOutValue = 10;
6114                            cdb->AUDIO_STATUS.OperationCode = 229;
6115                            Retry: 
6116                            {
6117                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
6118                                                        sizeof(SUB_Q_CHANNEL_DATA ));
6119                            }
6120                            if (status >= 0L) {
6121                              goto _L;
6122                            } else {
6123                              if (status == -1073741764L) {
6124                                _L: /* CIL Label */ 
6125                                if (((int )*(SubQPtr + 1) & 15) != 1) {
6126                                  goto Retry;
6127                                } else {
6128
6129                                }
6130                                userPtr->Header.Reserved = 0;
6131                                if ((int )deviceExtension->Paused == 1) {
6132                                  deviceExtension->PlayActive = 0;
6133                                  userPtr->Header.AudioStatus = 18;
6134                                } else {
6135                                  if ((int )*(SubQPtr + 0) == 1) {
6136                                    userPtr->Header.AudioStatus = 17;
6137                                  } else {
6138                                    if ((int )*(SubQPtr + 0) == 0) {
6139                                      userPtr->Header.AudioStatus = 19;
6140                                      deviceExtension->PlayActive = 0;
6141                                    } else {
6142                                      deviceExtension->PlayActive = 0;
6143                                    }
6144                                  }
6145                                }
6146                                userPtr->Header.DataLength[0] = 0;
6147                                userPtr->Header.DataLength[0] = 12;
6148                                userPtr->FormatCode = 1;
6149                                userPtr->Control = ((int )*(SubQPtr + 1) & 240) >> 4;
6150                                userPtr->ADR = (int )*(SubQPtr + 1) & 15;
6151                                userPtr->TrackNumber = *(SubQPtr + 2);
6152                                userPtr->IndexNumber = *(SubQPtr + 3);
6153                                userPtr->AbsoluteAddress[0] = 0;
6154                                userPtr->AbsoluteAddress[1] = *(SubQPtr + 8);
6155                                userPtr->AbsoluteAddress[2] = *(SubQPtr + 9);
6156                                userPtr->AbsoluteAddress[3] = *(SubQPtr + 10);
6157                                userPtr->TrackRelativeAddress[0] = 0;
6158                                userPtr->TrackRelativeAddress[1] = *(SubQPtr + 4);
6159                                userPtr->TrackRelativeAddress[2] = *(SubQPtr + 5);
6160                                userPtr->TrackRelativeAddress[3] = *(SubQPtr + 6);
6161                                Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
6162                                status = 0L;
6163                              } else {
6164                                Irp->IoStatus.Information = 0;
6165                              }
6166                            }
6167                            {
6168/*                             ExFreePool(SubQPtr); */ /* INLINED */
6169                            }
6170                            goto switch_15_break;
6171                            switch_15_exp_45: /* CIL Label */ 
6172                            {
6173                            tmp___4 = ExAllocatePoolWithTag(4, 1, 541156419UL);
6174                            EjectStatus = tmp___4;
6175                            Irp->IoStatus.Information = 0;
6176                            }
6177                            if ((unsigned int )EjectStatus == (unsigned int )((void *)0)) {
6178                              status = -1073741670L;
6179                              goto SetStatusAndReturn;
6180                            } else {
6181
6182                            }
6183                            {
6184                            deviceExtension->PlayActive = 0;
6185                            srb.CdbLength = 12;
6186                            srb.TimeOutValue = 10;
6187                            cdb->EJECT.OperationCode = 228;
6188                            cdb->EJECT.Eject = 1;
6189                            status = SendSrbSynchronous(deviceExtension, & srb, EjectStatus,
6190                                                        1);
6191                            }
6192                            if (status >= 0L) {
6193                              deviceExtension->Paused = 0;
6194                              deviceExtension->PausedM = 0;
6195                              deviceExtension->PausedS = 0;
6196                              deviceExtension->PausedF = 0;
6197                              deviceExtension->LastEndM = 0;
6198                              deviceExtension->LastEndS = 0;
6199                              deviceExtension->LastEndF = 0;
6200                            } else {
6201
6202                            }
6203                            {
6204/*                             ExFreePool(EjectStatus); */ /* INLINED */
6205                            }
6206                            goto switch_15_break;
6207                            switch_15_exp_46: /* CIL Label */ ;
6208                            switch_15_exp_47: /* CIL Label */ ;
6209                            switch_15_exp_48: /* CIL Label */ 
6210                            Irp->IoStatus.Information = 0;
6211                            status = -1073741808L;
6212                            goto switch_15_break;
6213                            switch_15_exp_49: /* CIL Label */ 
6214                            {
6215                            CdAudioIsPlayActive(DeviceObject);
6216                            }
6217                            switch_15_default: /* CIL Label */ 
6218                            {
6219                            tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp);
6220                            }
6221                            return (tmp___5);
6222                            goto switch_15_break;
6223                          } else {
6224                            switch_15_break: /* CIL Label */ ;
6225                          }
6226                          }
6227                        }
6228                      }
6229                    }
6230                  }
6231                }
6232              }
6233            }
6234          }
6235        }
6236      }
6237    }
6238  }
6239  SetStatusAndReturn: 
6240  if (status == -2147483626L) {
6241    if ((int )currentIrpStack->Flags & 2) {
6242      status = -1073741435L;
6243      goto HitachiRestart;
6244    } else {
6245
6246    }
6247    {
6248/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
6249    Irp->IoStatus.Information = 0;
6250    }
6251  } else {
6252
6253  }
6254  {
6255  Irp->IoStatus.__annonCompField4.Status = status;
6256  myStatus = status;
6257  IofCompleteRequest(Irp, 0);
6258  }
6259  return (status);
6260}
6261}
6262NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
6263{ PIO_STACK_LOCATION currentIrpStack ;
6264  PCD_DEVICE_EXTENSION deviceExtension ;
6265  PCDROM_TOC cdaudioDataOut ;
6266  SCSI_PASS_THROUGH srb ;
6267  PREAD_CAPACITY_DATA lastSession ;
6268  PCDB cdb ;
6269  NTSTATUS status ;
6270  ULONG i ;
6271  ULONG bytesTransfered ;
6272  PUCHAR Toc ;
6273  ULONG destblock ;
6274  BOOLEAN tmp ;
6275  PVOID tmp___0 ;
6276  BOOLEAN tmp___1 ;
6277  PVOID tmp___2 ;
6278  ULONG tracksToReturn ;
6279  ULONG tracksOnCd ;
6280  ULONG tracksInBuffer ;
6281  PSUB_Q_CURRENT_POSITION userPtr ;
6282  PUCHAR SubQPtr ;
6283  PVOID tmp___3 ;
6284  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
6285  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
6286  NTSTATUS tmp___4 ;
6287
6288  {
6289  {
6290  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
6291  deviceExtension = DeviceObject->DeviceExtension;
6292  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
6293  cdb = (union _CDB *)(srb.Cdb);
6294  memset(cdb, 0, 12);
6295  }
6296  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
6297    goto switch_18_exp_50;
6298  } else {
6299    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
6300      goto switch_18_exp_51;
6301    } else {
6302      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
6303        goto switch_18_exp_52;
6304      } else {
6305        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
6306          goto switch_18_exp_53;
6307        } else {
6308          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
6309            goto switch_18_exp_54;
6310          } else {
6311            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
6312              goto switch_18_exp_55;
6313            } else {
6314              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
6315                goto switch_18_exp_56;
6316              } else {
6317                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
6318                  goto switch_18_exp_57;
6319                } else {
6320                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
6321                    goto switch_18_exp_58;
6322                  } else {
6323                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
6324                      goto switch_18_exp_59;
6325                    } else {
6326                      {
6327                      goto switch_18_default;
6328                      if (0) {
6329                        switch_18_exp_50: /* CIL Label */ 
6330                        {
6331                        tmp = CdAudioIsPlayActive(DeviceObject);
6332                        }
6333                        if (tmp) {
6334                          status = -2147483631L;
6335                          Irp->IoStatus.Information = 0;
6336                          goto switch_18_break;
6337                        } else {
6338
6339                        }
6340                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) {
6341                          status = -1073741789L;
6342                          Irp->IoStatus.Information = 0;
6343                          goto switch_18_break;
6344                        } else {
6345
6346                        }
6347                        {
6348                        tmp___0 = ExAllocatePoolWithTag(4, sizeof(READ_CAPACITY_DATA ),
6349                                                        541156419UL);
6350                        lastSession = tmp___0;
6351                        }
6352                        if ((unsigned int )lastSession == (unsigned int )((void *)0)) {
6353                          status = -1073741670L;
6354                          Irp->IoStatus.Information = 0;
6355                          goto SetStatusAndReturn;
6356                        } else {
6357
6358                        }
6359                        {
6360                        memset(lastSession, 0, sizeof(READ_CAPACITY_DATA ));
6361                        srb.CdbLength = 10;
6362                        cdb->CDB10.OperationCode = 38;
6363                        srb.TimeOutValue = 10;
6364                        status = SendSrbSynchronous(deviceExtension, & srb, lastSession,
6365                                                    sizeof(READ_CAPACITY_DATA ));
6366                        }
6367                        if (! (status >= 0L)) {
6368                          {
6369/*                           ExFreePool(lastSession); */ /* INLINED */
6370                          Irp->IoStatus.Information = 0;
6371                          }
6372                          goto SetStatusAndReturn;
6373                        } else {
6374                          status = 0L;
6375                        }
6376                        {
6377                        bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]);
6378                        Irp->IoStatus.Information = bytesTransfered;
6379                        memset(cdaudioDataOut, 0, bytesTransfered);
6380                        cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8);
6381                        cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL);
6382                        }
6383                        if (lastSession->LogicalBlockAddress == 0UL) {
6384                          {
6385/*                           ExFreePool(lastSession); */ /* INLINED */
6386                          }
6387                          goto switch_18_break;
6388                        } else {
6389
6390                        }
6391                        {
6392                        cdaudioDataOut->FirstTrack = 1;
6393                        cdaudioDataOut->LastTrack = 2;
6394                        *((ULONG *)(& cdaudioDataOut->TrackData[0].Address[0])) = lastSession->LogicalBlockAddress;
6395/*                         ExFreePool(lastSession); */ /* INLINED */
6396                        }
6397                        goto switch_18_break;
6398                        switch_18_exp_51: /* CIL Label */ ;
6399                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
6400                          status = -1073741789L;
6401                          Irp->IoStatus.Information = 0;
6402                          goto switch_18_break;
6403                        } else {
6404
6405                        }
6406                        {
6407                        tmp___1 = CdAudioIsPlayActive(DeviceObject);
6408                        }
6409                        if (tmp___1) {
6410                          status = -2147483631L;
6411                          Irp->IoStatus.Information = 0;
6412                          goto switch_18_break;
6413                        } else {
6414
6415                        }
6416                        {
6417                        tmp___2 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), 541156419UL);
6418                        Toc = (UCHAR *)tmp___2;
6419                        }
6420                        if ((unsigned int )Toc == (unsigned int )((void *)0)) {
6421                          status = -1073741670L;
6422                          Irp->IoStatus.Information = 0;
6423                          goto SetStatusAndReturn;
6424                        } else {
6425
6426                        }
6427                        {
6428                        memset(Toc, 0, sizeof(CDROM_TOC ));
6429                        cdb->CDB10.OperationCode = 67;
6430                        cdb->CDB10.Reserved1 = 1;
6431                        cdb->CDB10.TransferBlocksMsb = sizeof(CDROM_TOC ) >> 8;
6432                        cdb->CDB10.TransferBlocksLsb = sizeof(CDROM_TOC ) & 255U;
6433                        srb.TimeOutValue = 10;
6434                        srb.CdbLength = 10;
6435                        status = SendSrbSynchronous(deviceExtension, & srb, Toc, sizeof(CDROM_TOC ));
6436                        }
6437                        if (! (status >= 0L)) {
6438                          if (status != -1073741764L) {
6439                            if (status != -1073741764L) {
6440                              {
6441/*                               ExFreePool(Toc); */ /* INLINED */
6442                              Irp->IoStatus.Information = 0;
6443                              }
6444                              goto SetStatusAndReturn;
6445                            } else {
6446
6447                            }
6448                          } else {
6449                            status = 0L;
6450                          }
6451                        } else {
6452                          status = 0L;
6453                        }
6454                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
6455                          bytesTransfered = sizeof(CDROM_TOC );
6456                        } else {
6457                          bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
6458                        }
6459                        cdaudioDataOut->Length[0] = *(Toc + 0);
6460                        cdaudioDataOut->Length[1] = *(Toc + 1);
6461                        cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
6462                        cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
6463                        tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
6464                        tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
6465                        tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
6466                        if (tracksInBuffer < tracksOnCd) {
6467                          tracksToReturn = tracksInBuffer;
6468                        } else {
6469                          tracksToReturn = tracksOnCd;
6470                        }
6471                        i = 0;
6472                        {
6473                        while (1) {
6474                          while_19_continue: /* CIL Label */ ;
6475                          if (i < tracksToReturn) {
6476
6477                          } else {
6478                            goto while_19_break;
6479                          }
6480                          cdaudioDataOut->TrackData[i].Reserved = 0;
6481                          cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6482                          cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15);
6483                          cdaudioDataOut->TrackData[i].Reserved1 = 0;
6484                          cdaudioDataOut->TrackData[i].Address[0] = 0;
6485                          cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6486                          cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6487                          cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6488                          i += 1UL;
6489                        }
6490                        while_19_break: /* CIL Label */ ;
6491                        }
6492                        if (tracksInBuffer > tracksOnCd) {
6493                          cdaudioDataOut->TrackData[i].Reserved = 0;
6494                          cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6495                          cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL));
6496                          cdaudioDataOut->TrackData[i].Reserved1 = 0;
6497                          cdaudioDataOut->TrackData[i].Address[0] = 0;
6498                          cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6499                          cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6500                          cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6501                          i += 1UL;
6502                        } else {
6503
6504                        }
6505                        {
6506                        Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
6507/*                         ExFreePool(Toc); */ /* INLINED */
6508                        }
6509                        goto switch_18_break;
6510                        switch_18_exp_52: /* CIL Label */ 
6511                        {
6512                        userPtr = Irp->AssociatedIrp.SystemBuffer;
6513                        tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ),
6514                                                        541156419UL);
6515                        SubQPtr = tmp___3;
6516                        }
6517                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
6518                          status = -1073741789L;
6519                          Irp->IoStatus.Information = 0;
6520                          if (SubQPtr) {
6521                            {
6522/*                             ExFreePool(SubQPtr); */ /* INLINED */
6523                            }
6524                          } else {
6525
6526                          }
6527                          goto switch_18_break;
6528                        } else {
6529
6530                        }
6531                        if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
6532                          {
6533                          memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
6534                          status = -1073741670L;
6535                          Irp->IoStatus.Information = 0;
6536                          }
6537                          goto SetStatusAndReturn;
6538                        } else {
6539
6540                        }
6541                        if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
6542                          {
6543/*                           ExFreePool(SubQPtr); */ /* INLINED */
6544                          memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
6545                          status = -1073741823L;
6546                          Irp->IoStatus.Information = 0;
6547                          }
6548                          goto SetStatusAndReturn;
6549                        } else {
6550
6551                        }
6552                        {
6553                        srb.CdbLength = 10;
6554                        srb.TimeOutValue = 10;
6555                        cdb->SUBCHANNEL.OperationCode = 66;
6556                        cdb->SUBCHANNEL.Msf = 1;
6557                        cdb->SUBCHANNEL.SubQ = 1;
6558                        cdb->SUBCHANNEL.Format = 1;
6559                        cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CURRENT_POSITION );
6560                        status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
6561                                                    sizeof(SUB_Q_CURRENT_POSITION ));
6562                        }
6563                        if (status >= 0L) {
6564                          if ((int )*(SubQPtr + 1) == 17) {
6565                            deviceExtension->PlayActive = 1;
6566                          } else {
6567                            deviceExtension->PlayActive = 0;
6568                          }
6569                          userPtr->Header.Reserved = 0;
6570                          userPtr->Header.AudioStatus = *(SubQPtr + 1);
6571                          userPtr->Header.DataLength[0] = 0;
6572                          userPtr->Header.DataLength[1] = 12;
6573                          userPtr->FormatCode = 1;
6574                          userPtr->Control = *(SubQPtr + 5);
6575                          userPtr->ADR = 0;
6576                          userPtr->TrackNumber = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
6577                          userPtr->IndexNumber = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
6578                          userPtr->AbsoluteAddress[0] = 0;
6579                          userPtr->AbsoluteAddress[1] = *(SubQPtr + 9);
6580                          userPtr->AbsoluteAddress[2] = *(SubQPtr + 10);
6581                          userPtr->AbsoluteAddress[3] = *(SubQPtr + 11);
6582                          userPtr->TrackRelativeAddress[0] = 0;
6583                          userPtr->TrackRelativeAddress[1] = *(SubQPtr + 13);
6584                          userPtr->TrackRelativeAddress[2] = *(SubQPtr + 14);
6585                          userPtr->TrackRelativeAddress[3] = *(SubQPtr + 15);
6586                          Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
6587                        } else {
6588                          Irp->IoStatus.Information = 0;
6589                        }
6590                        {
6591/*                         ExFreePool(SubQPtr); */ /* INLINED */
6592                        }
6593                        goto switch_18_break;
6594                        switch_18_exp_53: /* CIL Label */ 
6595                        inputBuffer = Irp->AssociatedIrp.SystemBuffer;
6596                        Irp->IoStatus.Information = 0;
6597                        if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
6598                          status = -1073741820L;
6599                          goto switch_18_break;
6600                        } else {
6601
6602                        }
6603                        if ((int )inputBuffer->StartingM == (int )inputBuffer->EndingM) {
6604                          if ((int )inputBuffer->StartingS == (int )inputBuffer->EndingS) {
6605                            if ((int )inputBuffer->StartingF == (int )inputBuffer->EndingF) {
6606                              cdb->PAUSE_RESUME.OperationCode = 75;
6607                              cdb->PAUSE_RESUME.Action = 0;
6608                            } else {
6609                              goto _L___0;
6610                            }
6611                          } else {
6612                            goto _L___0;
6613                          }
6614                        } else {
6615                          _L___0: /* CIL Label */ 
6616                          cdb->PLAY_AUDIO_MSF.OperationCode = 71;
6617                          cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM;
6618                          cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS;
6619                          cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF;
6620                          cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM;
6621                          cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS;
6622                          cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF;
6623                        }
6624                        {
6625                        srb.CdbLength = 10;
6626                        srb.TimeOutValue = 10;
6627                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6628                                                    0);
6629                        }
6630                        if (status >= 0L) {
6631                          if ((int )cdb->PLAY_AUDIO_MSF.OperationCode == 71) {
6632                            deviceExtension->PlayActive = 1;
6633                          } else {
6634
6635                          }
6636                        } else {
6637
6638                        }
6639                        goto switch_18_break;
6640                        switch_18_exp_54: /* CIL Label */ 
6641                        inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
6642                        Irp->IoStatus.Information = 0;
6643                        if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
6644                          status = -1073741820L;
6645                          goto switch_18_break;
6646                        } else {
6647
6648                        }
6649                        {
6650                        destblock = (((unsigned long )inputBuffer___0->M * 60UL + (unsigned long )inputBuffer___0->S) * 75UL + (unsigned long )inputBuffer___0->F) - 150UL;
6651                        srb.CdbLength = 10;
6652                        srb.TimeOutValue = 10;
6653                        cdb->SEEK.OperationCode = 43;
6654                        cdb->SEEK.LogicalBlockAddress[0] = (int )((unsigned char )(destblock >> 24)) & 255;
6655                        cdb->SEEK.LogicalBlockAddress[1] = (int )((unsigned char )(destblock >> 16)) & 255;
6656                        cdb->SEEK.LogicalBlockAddress[2] = (int )((unsigned char )(destblock >> 8)) & 255;
6657                        cdb->SEEK.LogicalBlockAddress[3] = (unsigned char )(destblock & 255UL);
6658                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6659                                                    0);
6660                        }
6661                        if (! (status >= 0L)) {
6662
6663                        } else {
6664
6665                        }
6666                        goto switch_18_break;
6667                        switch_18_exp_55: /* CIL Label */ 
6668                        {
6669                        Irp->IoStatus.Information = 0;
6670                        deviceExtension->PlayActive = 0;
6671                        srb.CdbLength = 10;
6672                        srb.TimeOutValue = 10;
6673                        cdb->CDB10.OperationCode = 192;
6674                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6675                                                    0);
6676                        }
6677                        goto switch_18_break;
6678                        switch_18_exp_56: /* CIL Label */ ;
6679                        switch_18_exp_57: /* CIL Label */ ;
6680                        switch_18_exp_58: /* CIL Label */ 
6681                        Irp->IoStatus.Information = 0;
6682                        status = -1073741808L;
6683                        goto switch_18_break;
6684                        switch_18_exp_59: /* CIL Label */ 
6685                        {
6686                        CdAudioIsPlayActive(DeviceObject);
6687                        }
6688                        switch_18_default: /* CIL Label */ 
6689                        {
6690                        tmp___4 = CdAudioSendToNextDriver(DeviceObject, Irp);
6691                        }
6692                        return (tmp___4);
6693                        goto switch_18_break;
6694                      } else {
6695                        switch_18_break: /* CIL Label */ ;
6696                      }
6697                      }
6698                    }
6699                  }
6700                }
6701              }
6702            }
6703          }
6704        }
6705      }
6706    }
6707  }
6708  SetStatusAndReturn: 
6709  if (status == -2147483626L) {
6710    {
6711/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
6712    Irp->IoStatus.Information = 0;
6713    }
6714  } else {
6715
6716  }
6717  {
6718  Irp->IoStatus.__annonCompField4.Status = status;
6719  myStatus = status;
6720  IofCompleteRequest(Irp, 0);
6721  }
6722  return (status);
6723}
6724}
6725NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
6726{ PIO_STACK_LOCATION currentIrpStack ;
6727  PCD_DEVICE_EXTENSION deviceExtension ;
6728  PCDROM_TOC cdaudioDataOut ;
6729  SCSI_PASS_THROUGH srb ;
6730  PCDB cdb ;
6731  NTSTATUS status ;
6732  ULONG i ;
6733  ULONG bytesTransfered ;
6734  PUCHAR Toc ;
6735  BOOLEAN tmp ;
6736  PVOID tmp___0 ;
6737  ULONG tracksToReturn ;
6738  ULONG tracksOnCd ;
6739  ULONG tracksInBuffer ;
6740  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
6741  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
6742  PUCHAR SubQPtr ;
6743  PVOID tmp___1 ;
6744  PSUB_Q_CURRENT_POSITION userPtr ;
6745  PUCHAR SubQPtr___0 ;
6746  PVOID tmp___2 ;
6747  NTSTATUS tmp___3 ;
6748  BOOLEAN tmp___4 ;
6749  NTSTATUS tmp___5 ;
6750
6751  {
6752  {
6753  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
6754  deviceExtension = DeviceObject->DeviceExtension;
6755  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
6756  cdb = (union _CDB *)(srb.Cdb);
6757  memset(cdb, 0, 12);
6758  }
6759  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
6760    goto switch_20_exp_60;
6761  } else {
6762    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
6763      goto switch_20_exp_61;
6764    } else {
6765      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
6766        goto switch_20_exp_62;
6767      } else {
6768        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
6769          goto switch_20_exp_63;
6770        } else {
6771          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
6772            goto switch_20_exp_64;
6773          } else {
6774            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
6775              goto switch_20_exp_65;
6776            } else {
6777              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
6778                goto switch_20_exp_66;
6779              } else {
6780                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
6781                  goto switch_20_exp_67;
6782                } else {
6783                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
6784                    goto switch_20_exp_68;
6785                  } else {
6786                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
6787                      goto switch_20_exp_69;
6788                    } else {
6789                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
6790                        goto switch_20_exp_70;
6791                      } else {
6792                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
6793                          goto switch_20_exp_71;
6794                        } else {
6795                          {
6796                          goto switch_20_default;
6797                          if (0) {
6798                            switch_20_exp_60: /* CIL Label */ ;
6799                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
6800                              status = -1073741789L;
6801                              Irp->IoStatus.Information = 0;
6802                              goto switch_20_break;
6803                            } else {
6804
6805                            }
6806                            {
6807                            tmp = CdAudioIsPlayActive(DeviceObject);
6808                            }
6809                            if (tmp) {
6810                              status = -2147483631L;
6811                              Irp->IoStatus.Information = 0;
6812                              goto switch_20_break;
6813                            } else {
6814
6815                            }
6816                            {
6817                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
6818                                                            541156419UL);
6819                            Toc = (UCHAR *)tmp___0;
6820                            }
6821                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
6822                              status = -1073741670L;
6823                              Irp->IoStatus.Information = 0;
6824                              goto SetStatusAndReturn;
6825                            } else {
6826
6827                            }
6828                            {
6829                            memset(Toc, 0, sizeof(CDROM_TOC ));
6830                            cdb->READ_TOC.OperationCode = 67;
6831                            cdb->READ_TOC.Msf = 1;
6832                            cdb->READ_TOC.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8;
6833                            cdb->READ_TOC.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U;
6834                            srb.TimeOutValue = 10;
6835                            srb.CdbLength = 10;
6836                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
6837                                                        sizeof(CDROM_TOC ));
6838                            }
6839                            if (! (status >= 0L)) {
6840                              if (status != -1073741764L) {
6841                                if (status != -1073741764L) {
6842                                  {
6843/*                                   ExFreePool(Toc); */ /* INLINED */
6844                                  Irp->IoStatus.Information = 0;
6845                                  }
6846                                  goto SetStatusAndReturn;
6847                                } else {
6848
6849                                }
6850                              } else {
6851                                status = 0L;
6852                              }
6853                            } else {
6854                              status = 0L;
6855                            }
6856                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
6857                              bytesTransfered = sizeof(CDROM_TOC );
6858                            } else {
6859                              bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
6860                            }
6861                            cdaudioDataOut->Length[0] = *(Toc + 0);
6862                            cdaudioDataOut->Length[1] = *(Toc + 1);
6863                            cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
6864                            cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
6865                            tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
6866                            tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
6867                            tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
6868                            if (tracksInBuffer < tracksOnCd) {
6869                              tracksToReturn = tracksInBuffer;
6870                            } else {
6871                              tracksToReturn = tracksOnCd;
6872                            }
6873                            i = 0;
6874                            {
6875                            while (1) {
6876                              while_21_continue: /* CIL Label */ ;
6877                              if (i < tracksToReturn) {
6878
6879                              } else {
6880                                goto while_21_break;
6881                              }
6882                              cdaudioDataOut->TrackData[i].Reserved = 0;
6883                              cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6884                              cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15);
6885                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
6886                              cdaudioDataOut->TrackData[i].Address[0] = 0;
6887                              cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6888                              cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6889                              cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6890                              i += 1UL;
6891                            }
6892                            while_21_break: /* CIL Label */ ;
6893                            }
6894                            if (tracksInBuffer > tracksOnCd) {
6895                              cdaudioDataOut->TrackData[i].Reserved = 0;
6896                              cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6897                              cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL));
6898                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
6899                              cdaudioDataOut->TrackData[i].Address[0] = 0;
6900                              cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6901                              cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6902                              cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6903                              i += 1UL;
6904                            } else {
6905
6906                            }
6907                            {
6908                            Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
6909                            deviceExtension->Paused = 0;
6910                            deviceExtension->PausedM = 0;
6911                            deviceExtension->PausedS = 0;
6912                            deviceExtension->PausedF = 0;
6913                            deviceExtension->LastEndM = 0;
6914                            deviceExtension->LastEndS = 0;
6915                            deviceExtension->LastEndF = 0;
6916/*                             ExFreePool(Toc); */ /* INLINED */
6917                            }
6918                            goto switch_20_break;
6919                            switch_20_exp_61: /* CIL Label */ ;
6920                            switch_20_exp_62: /* CIL Label */ 
6921                            {
6922                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
6923                            Irp->IoStatus.Information = 0;
6924                            srb.CdbLength = 10;
6925                            srb.TimeOutValue = 10;
6926                            cdb->CDB10.OperationCode = 198;
6927                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6928                                                        0);
6929                            }
6930                            if (status >= 0L) {
6931                              deviceExtension->PlayActive = 0;
6932                              deviceExtension->Paused = 0;
6933                              deviceExtension->PausedM = 0;
6934                              deviceExtension->PausedS = 0;
6935                              deviceExtension->PausedF = 0;
6936                              deviceExtension->LastEndM = 0;
6937                              deviceExtension->LastEndS = 0;
6938                              deviceExtension->LastEndF = 0;
6939                            } else {
6940
6941                            }
6942                            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
6943                              goto SetStatusAndReturn;
6944                            } else {
6945
6946                            }
6947                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
6948                              status = -1073741820L;
6949                              goto switch_20_break;
6950                            } else {
6951
6952                            }
6953                            {
6954                            srb.CdbLength = 10;
6955                            srb.TimeOutValue = 10;
6956                            cdb->PLAY_AUDIO_MSF.OperationCode = 71;
6957                            cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM;
6958                            cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS;
6959                            cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF;
6960                            cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM;
6961                            cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS;
6962                            cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF;
6963                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6964                                                        0);
6965                            }
6966                            if (status >= 0L) {
6967                              deviceExtension->PlayActive = 1;
6968                              deviceExtension->Paused = 0;
6969                              deviceExtension->LastEndM = inputBuffer->EndingM;
6970                              deviceExtension->LastEndS = inputBuffer->EndingS;
6971                              deviceExtension->LastEndF = inputBuffer->EndingF;
6972                            } else {
6973
6974                            }
6975                            goto switch_20_break;
6976                            switch_20_exp_63: /* CIL Label */ 
6977                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
6978                            Irp->IoStatus.Information = 0;
6979                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
6980                              status = -1073741820L;
6981                              goto switch_20_break;
6982                            } else {
6983
6984                            }
6985                            {
6986                            srb.CdbLength = 10;
6987                            srb.TimeOutValue = 10;
6988                            cdb->CDB10.OperationCode = 71;
6989                            cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer___0->M;
6990                            cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer___0->S;
6991                            cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer___0->F;
6992                            cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer___0->M;
6993                            cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer___0->S;
6994                            cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer___0->F;
6995                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6996                                                        0);
6997                            }
6998                            if (status >= 0L) {
6999                              deviceExtension->Paused = 1;
7000                              deviceExtension->PausedM = inputBuffer___0->M;
7001                              deviceExtension->PausedS = inputBuffer___0->S;
7002                              deviceExtension->PausedF = inputBuffer___0->F;
7003                              deviceExtension->LastEndM = inputBuffer___0->M;
7004                              deviceExtension->LastEndS = inputBuffer___0->S;
7005                              deviceExtension->LastEndF = inputBuffer___0->F;
7006                            } else {
7007                              if (status == -1073741808L) {
7008                                status = -1073741803L;
7009                              } else {
7010
7011                              }
7012                            }
7013                            goto switch_20_break;
7014                            switch_20_exp_64: /* CIL Label */ 
7015                            {
7016                            tmp___1 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
7017                                                            541156419UL);
7018                            SubQPtr = tmp___1;
7019                            Irp->IoStatus.Information = 0;
7020                            }
7021                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
7022                              status = -1073741670L;
7023                              goto SetStatusAndReturn;
7024                            } else {
7025
7026                            }
7027                            if ((int )deviceExtension->Paused == 1) {
7028                              {
7029/*                               ExFreePool(SubQPtr); */ /* INLINED */
7030                              status = 0L;
7031                              }
7032                              goto SetStatusAndReturn;
7033                            } else {
7034
7035                            }
7036                            {
7037                            srb.CdbLength = 10;
7038                            srb.TimeOutValue = 10;
7039                            cdb->SUBCHANNEL.OperationCode = 66;
7040                            cdb->SUBCHANNEL.Msf = 1;
7041                            cdb->SUBCHANNEL.SubQ = 1;
7042                            cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA );
7043                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
7044                                                        sizeof(SUB_Q_CHANNEL_DATA ));
7045                            }
7046                            if (! (status >= 0L)) {
7047                              {
7048/*                               ExFreePool(SubQPtr); */ /* INLINED */
7049                              }
7050                              goto SetStatusAndReturn;
7051                            } else {
7052
7053                            }
7054                            {
7055                            deviceExtension->PausedM = *(SubQPtr + 9);
7056                            deviceExtension->PausedS = *(SubQPtr + 10);
7057                            deviceExtension->PausedF = *(SubQPtr + 11);
7058                            memset(cdb, 0, 12);
7059                            srb.CdbLength = 10;
7060                            srb.TimeOutValue = 10;
7061                            cdb->CDB10.OperationCode = 198;
7062                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7063                                                        0);
7064                            }
7065                            if (! (status >= 0L)) {
7066                              {
7067/*                               ExFreePool(SubQPtr); */ /* INLINED */
7068                              }
7069                              goto SetStatusAndReturn;
7070                            } else {
7071
7072                            }
7073                            {
7074                            deviceExtension->PlayActive = 0;
7075                            deviceExtension->Paused = 1;
7076                            deviceExtension->PausedM = *(SubQPtr + 9);
7077                            deviceExtension->PausedS = *(SubQPtr + 10);
7078                            deviceExtension->PausedF = *(SubQPtr + 11);
7079/*                             ExFreePool(SubQPtr); */ /* INLINED */
7080                            }
7081                            goto switch_20_break;
7082                            switch_20_exp_65: /* CIL Label */ 
7083                            Irp->IoStatus.Information = 0;
7084                            if ((int )deviceExtension->Paused == 0) {
7085                              status = -1073741823L;
7086                              goto SetStatusAndReturn;
7087                            } else {
7088
7089                            }
7090                            {
7091                            srb.CdbLength = 10;
7092                            srb.TimeOutValue = 10;
7093                            cdb->PLAY_AUDIO_MSF.OperationCode = 71;
7094                            cdb->PLAY_AUDIO_MSF.StartingM = deviceExtension->PausedM;
7095                            cdb->PLAY_AUDIO_MSF.StartingS = deviceExtension->PausedS;
7096                            cdb->PLAY_AUDIO_MSF.StartingF = deviceExtension->PausedF;
7097                            cdb->PLAY_AUDIO_MSF.EndingM = deviceExtension->LastEndM;
7098                            cdb->PLAY_AUDIO_MSF.EndingS = deviceExtension->LastEndS;
7099                            cdb->PLAY_AUDIO_MSF.EndingF = deviceExtension->LastEndF;
7100                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7101                                                        0);
7102                            }
7103                            if (status >= 0L) {
7104                              deviceExtension->PlayActive = 1;
7105                              deviceExtension->Paused = 0;
7106                            } else {
7107
7108                            }
7109                            goto switch_20_break;
7110                            switch_20_exp_66: /* CIL Label */ 
7111                            {
7112                            userPtr = Irp->AssociatedIrp.SystemBuffer;
7113                            tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
7114                                                            541156419UL);
7115                            SubQPtr___0 = tmp___2;
7116                            }
7117                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
7118                              status = -1073741789L;
7119                              Irp->IoStatus.Information = 0;
7120                              if (SubQPtr___0) {
7121                                {
7122/*                                 ExFreePool(SubQPtr___0); */ /* INLINED */
7123                                }
7124                              } else {
7125
7126                              }
7127                              goto switch_20_break;
7128                            } else {
7129
7130                            }
7131                            if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) {
7132                              {
7133                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
7134                              status = -1073741670L;
7135                              Irp->IoStatus.Information = 0;
7136                              }
7137                              goto SetStatusAndReturn;
7138                            } else {
7139
7140                            }
7141                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
7142                              {
7143/*                               ExFreePool(SubQPtr___0); */ /* INLINED */
7144                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
7145                              status = -1073741823L;
7146                              Irp->IoStatus.Information = 0;
7147                              }
7148                              goto SetStatusAndReturn;
7149                            } else {
7150
7151                            }
7152                            {
7153                            srb.CdbLength = 10;
7154                            srb.TimeOutValue = 10;
7155                            cdb->SUBCHANNEL.OperationCode = 66;
7156                            cdb->SUBCHANNEL.Msf = 1;
7157                            cdb->SUBCHANNEL.SubQ = 1;
7158                            cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA );
7159                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr___0,
7160                                                        sizeof(SUB_Q_CHANNEL_DATA ));
7161                            }
7162                            if (status >= 0L) {
7163                              userPtr->Header.Reserved = 0;
7164                              if ((int )deviceExtension->Paused == 1) {
7165                                deviceExtension->PlayActive = 0;
7166                                userPtr->Header.AudioStatus = 18;
7167                              } else {
7168                                if ((int )*(SubQPtr___0 + 1) == 17) {
7169                                  deviceExtension->PlayActive = 1;
7170                                  userPtr->Header.AudioStatus = 17;
7171                                } else {
7172                                  deviceExtension->PlayActive = 0;
7173                                  userPtr->Header.AudioStatus = 19;
7174                                }
7175                              }
7176                              userPtr->Header.DataLength[0] = 0;
7177                              userPtr->Header.DataLength[1] = 12;
7178                              userPtr->FormatCode = 1;
7179                              userPtr->Control = *(SubQPtr___0 + 5);
7180                              userPtr->ADR = 0;
7181                              userPtr->TrackNumber = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15);
7182                              userPtr->IndexNumber = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15);
7183                              userPtr->AbsoluteAddress[0] = 0;
7184                              userPtr->AbsoluteAddress[1] = *(SubQPtr___0 + 9);
7185                              userPtr->AbsoluteAddress[2] = *(SubQPtr___0 + 10);
7186                              userPtr->AbsoluteAddress[3] = *(SubQPtr___0 + 11);
7187                              userPtr->TrackRelativeAddress[0] = 0;
7188                              userPtr->TrackRelativeAddress[1] = *(SubQPtr___0 + 13);
7189                              userPtr->TrackRelativeAddress[2] = *(SubQPtr___0 + 14);
7190                              userPtr->TrackRelativeAddress[3] = *(SubQPtr___0 + 15);
7191                              Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
7192                            } else {
7193                              Irp->IoStatus.Information = 0;
7194                            }
7195                            {
7196/*                             ExFreePool(SubQPtr___0); */ /* INLINED */
7197                            }
7198                            goto switch_20_break;
7199                            switch_20_exp_67: /* CIL Label */ 
7200                            {
7201                            Irp->IoStatus.Information = 0;
7202                            srb.CdbLength = 10;
7203                            srb.TimeOutValue = 10;
7204                            cdb->CDB10.OperationCode = 192;
7205                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7206                                                        0);
7207                            deviceExtension->Paused = 0;
7208                            deviceExtension->PausedM = 0;
7209                            deviceExtension->PausedS = 0;
7210                            deviceExtension->PausedF = 0;
7211                            deviceExtension->LastEndM = 0;
7212                            deviceExtension->LastEndS = 0;
7213                            deviceExtension->LastEndF = 0;
7214                            }
7215                            goto switch_20_break;
7216                            switch_20_exp_68: /* CIL Label */ ;
7217                            switch_20_exp_69: /* CIL Label */ ;
7218                            switch_20_exp_70: /* CIL Label */ 
7219                            Irp->IoStatus.Information = 0;
7220                            status = -1073741808L;
7221                            goto switch_20_break;
7222                            switch_20_exp_71: /* CIL Label */ 
7223                            {
7224                            tmp___4 = CdAudioIsPlayActive(DeviceObject);
7225                            }
7226                            if ((int )tmp___4 == 1) {
7227                              deviceExtension->PlayActive = 1;
7228                              status = 0L;
7229                              Irp->IoStatus.Information = 0;
7230                              goto SetStatusAndReturn;
7231                            } else {
7232                              {
7233                              deviceExtension->PlayActive = 0;
7234                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
7235                              }
7236                              return (tmp___3);
7237                            }
7238                            goto switch_20_break;
7239                            switch_20_default: /* CIL Label */ 
7240                            {
7241                            tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp);
7242                            }
7243                            return (tmp___5);
7244                            goto switch_20_break;
7245                          } else {
7246                            switch_20_break: /* CIL Label */ ;
7247                          }
7248                          }
7249                        }
7250                      }
7251                    }
7252                  }
7253                }
7254              }
7255            }
7256          }
7257        }
7258      }
7259    }
7260  }
7261  SetStatusAndReturn: 
7262  if (status == -2147483626L) {
7263    {
7264/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
7265    Irp->IoStatus.Information = 0;
7266    }
7267  } else {
7268
7269  }
7270  {
7271  Irp->IoStatus.__annonCompField4.Status = status;
7272  myStatus = status;
7273  IofCompleteRequest(Irp, 0);
7274  }
7275  return (status);
7276}
7277}
7278NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7279{ NTSTATUS status ;
7280  PCD_DEVICE_EXTENSION deviceExtension ;
7281  PIO_STACK_LOCATION currentIrpStack ;
7282  SCSI_PASS_THROUGH srb ;
7283  PHITACHICDB cdb ;
7284  NTSTATUS tmp ;
7285
7286  {
7287  deviceExtension = DeviceObject->DeviceExtension;
7288  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7289  cdb = (union _HITACHICDB *)(srb.Cdb);
7290  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
7291    {
7292    Irp->IoStatus.Information = 0;
7293    deviceExtension->PlayActive = 0;
7294    memset(& srb, 0, sizeof(SCSI_PASS_THROUGH ));
7295    cdb->STOP_PLAY.OperationCode = 78;
7296    srb.CdbLength = 12;
7297    srb.TimeOutValue = 10;
7298    status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, 0);
7299    }
7300    if (! (status >= 0L)) {
7301      {
7302      Irp->IoStatus.__annonCompField4.Status = status;
7303      myStatus = status;
7304      IofCompleteRequest(Irp, 0);
7305      }
7306      return (status);
7307    } else {
7308
7309    }
7310  } else {
7311    {
7312    tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
7313    }
7314    return (tmp);
7315  }
7316  {
7317  Irp->IoStatus.__annonCompField4.Status = status;
7318  myStatus = status;
7319  IofCompleteRequest(Irp, 0);
7320  }
7321  return (status);
7322}
7323}
7324void HpCdrProcessLastSession(PCDROM_TOC Toc ) 
7325{ ULONG index ;
7326
7327  {
7328  index = Toc->FirstTrack;
7329  if (index) {
7330    index -= 1UL;
7331    Toc->FirstTrack = Toc->TrackData[0].Reserved;
7332    Toc->LastTrack = Toc->TrackData[index].Reserved;
7333    Toc->TrackData[0] = Toc->TrackData[index];
7334  } else {
7335    Toc->LastTrack = 0;
7336    Toc->FirstTrack = Toc->LastTrack;
7337  }
7338  return;
7339}
7340}
7341NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) 
7342{ 
7343
7344  {
7345  if (myIrp_PendingReturned) {
7346    if (pended == 0) {
7347      pended = 1;
7348    } else {
7349      {
7350      errorFn();
7351      }
7352    }
7353    (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1;
7354  } else {
7355
7356  }
7357  if ((long )myStatus >= 0L) {
7358    {
7359    HpCdrProcessLastSession((struct _CDROM_TOC *)Irp->AssociatedIrp.SystemBuffer);
7360    }
7361  } else {
7362
7363  }
7364  return (myStatus);
7365}
7366}
7367NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7368{ PIO_STACK_LOCATION currentIrpStack ;
7369  PIO_STACK_LOCATION nextIrpStack ;
7370  PCD_DEVICE_EXTENSION deviceExtension ;
7371  PIO_STACK_LOCATION irpSp ;
7372  PIO_STACK_LOCATION nextIrpSp ;
7373  PIO_STACK_LOCATION irpSp___0 ;
7374  NTSTATUS tmp ;
7375  NTSTATUS tmp___0 ;
7376
7377  {
7378  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7379  nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7380  deviceExtension = DeviceObject->DeviceExtension;
7381  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (14 << 2))) {
7382    {
7383    irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7384    nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7385    memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine));
7386    nextIrpSp->Control = 0;
7387    }
7388    if (s != NP) {
7389      {
7390      errorFn();
7391      }
7392    } else {
7393      if (compRegistered != 0) {
7394        {
7395        errorFn();
7396        }
7397      } else {
7398        compRegistered = 1;
7399        routine = 0;
7400        compFptr = & HPCdrCompletion;
7401      }
7402    }
7403    {
7404    irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7405    irpSp___0->CompletionRoutine = & HPCdrCompletion;
7406    irpSp___0->Context = deviceExtension;
7407    irpSp___0->Control = 0;
7408    irpSp___0->Control = 64;
7409    irpSp___0->Control = (int )irpSp___0->Control | 128;
7410    irpSp___0->Control = (int )irpSp___0->Control | 32;
7411    tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
7412    }
7413    return (tmp);
7414  } else {
7415    {
7416    tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp);
7417    }
7418    return (tmp___0);
7419  }
7420  return (-1073741823L);
7421}
7422}
7423NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7424{ PCD_DEVICE_EXTENSION deviceExtension ;
7425  KEVENT event ;
7426  NTSTATUS status ;
7427  PIO_STACK_LOCATION irpSp ;
7428  PIO_STACK_LOCATION nextIrpSp ;
7429  PIO_STACK_LOCATION irpSp___0 ;
7430
7431  {
7432  {
7433/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
7434  deviceExtension = (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
7435  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7436  nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7437  memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine));
7438  nextIrpSp->Control = 0;
7439  }
7440  if (s != NP) {
7441    {
7442    errorFn();
7443    }
7444  } else {
7445    if (compRegistered != 0) {
7446      {
7447      errorFn();
7448      }
7449    } else {
7450      compRegistered = 1;
7451      routine = 1;
7452      compFptr = & CdAudioSignalCompletion;
7453    }
7454  }
7455  {
7456  irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7457  irpSp___0->CompletionRoutine = & CdAudioSignalCompletion;
7458  irpSp___0->Context = & event;
7459  irpSp___0->Control = 0;
7460  irpSp___0->Control = 64;
7461  irpSp___0->Control = (int )irpSp___0->Control | 128;
7462  irpSp___0->Control = (int )irpSp___0->Control | 32;
7463  status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
7464  status = 259L;
7465  }
7466  if (status) {
7467    {
7468    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
7469    status = Irp->IoStatus.__annonCompField4.Status;
7470    status = myStatus;
7471    }
7472  } else {
7473
7474  }
7475  return (status);
7476}
7477}
7478void CdAudioUnload(PDRIVER_OBJECT DriverObject ) 
7479{ 
7480
7481  {
7482  return;
7483}
7484}
7485NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7486{ PCD_DEVICE_EXTENSION deviceExtension ;
7487  NTSTATUS tmp ;
7488
7489  {
7490  {
7491/*   PoStartNextPowerIrp(Irp); */ /* INLINED */
7492  }
7493  if (s == NP) {
7494    s = SKIP1;
7495  } else {
7496    {
7497    errorFn();
7498    }
7499  }
7500  {
7501  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
7502  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
7503  deviceExtension = (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
7504  tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp);
7505  }
7506  return (tmp);
7507}
7508}
7509#pragma once
7510#pragma once
7511#pragma once
7512#pragma once
7513#pragma warning(push)
7514#pragma warning(disable:4035)
7515#pragma warning(pop)
7516#pragma once
7517#pragma warning(disable:4103)
7518#pragma warning(disable:4103)
7519#pragma warning(push)
7520#pragma warning(disable:4035)
7521#pragma warning(pop)
7522#pragma warning(disable:4035)
7523#pragma warning(push)
7524#pragma warning(disable:4164)
7525#pragma function(_enable)
7526#pragma function(_disable)
7527#pragma warning(pop)
7528#pragma warning(disable:4103)
7529#pragma warning(disable:4103)
7530#pragma warning(disable:4103)
7531#pragma warning(disable:4103)
7532#pragma warning(disable:4103)
7533#pragma warning(disable:4103)
7534#pragma warning(disable:4200)
7535#pragma warning(default:4200)
7536IRP *pirp  ;
7537void stub_driver_init(void) 
7538{ 
7539
7540  {
7541  s = NP;
7542  customIrp = 0;
7543  setEventCalled = customIrp;
7544  lowerDriverReturn = setEventCalled;
7545  compRegistered = lowerDriverReturn;
7546  compFptr = compRegistered;
7547  pended = compFptr;
7548  return;
7549}
7550}
7551int main(void) 
7552{ DRIVER_OBJECT d ;
7553  NTSTATUS status = __VERIFIER_nondet_long() ;
7554  IRP irp ;
7555  int we_should_unload = __VERIFIER_nondet_int() ;
7556  int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7557  int irp_choice = __VERIFIER_nondet_int() ;
7558  DEVICE_OBJECT devobj ;
7559  devobj.DeviceExtension = malloc(sizeof (CD_DEVICE_EXTENSION));
7560  irp.Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation = malloc(sizeof (IO_STACK_LOCATION));
7561  irp.AssociatedIrp.SystemBuffer = malloc(sizeof (CDROM_TOC));
7562
7563  {
7564  {
7565  pirp = & irp;
7566  _BLAST_init();
7567  }
7568  if (status >= 0L) {
7569    s = NP;
7570    customIrp = 0;
7571    setEventCalled = customIrp;
7572    lowerDriverReturn = setEventCalled;
7573    compRegistered = lowerDriverReturn;
7574    compFptr = compRegistered;
7575    pended = compFptr;
7576    pirp->IoStatus.__annonCompField4.Status = 0L;
7577    myStatus = 0L;
7578    if (irp_choice == 0) {
7579      pirp->IoStatus.__annonCompField4.Status = -1073741637L;
7580      myStatus = -1073741637L;
7581    } else {
7582
7583    }
7584    {
7585    stub_driver_init();
7586    }
7587    if (! (status >= 0L)) {
7588      return (-1);
7589    } else {
7590
7591    }
7592    if (__BLAST_NONDET___0 == 2) {
7593      goto switch_22_2;
7594    } else {
7595      if (__BLAST_NONDET___0 == 3) {
7596        goto switch_22_3;
7597      } else {
7598        if (__BLAST_NONDET___0 == 4) {
7599          goto switch_22_4;
7600        } else {
7601          {
7602          goto switch_22_default;
7603          if (0) {
7604            switch_22_2: /* CIL Label */ 
7605            {
7606            status = CdAudioDeviceControl(& devobj, pirp);
7607            }
7608            goto switch_22_break;
7609            switch_22_3: /* CIL Label */ 
7610            {
7611            status = CdAudioPnp(& devobj, pirp);
7612            }
7613            goto switch_22_break;
7614            switch_22_4: /* CIL Label */ 
7615            {
7616            status = CdAudioPower(& devobj, pirp);
7617            }
7618            goto switch_22_break;
7619            switch_22_default: /* CIL Label */ ;
7620            return (-1);
7621          } else {
7622            switch_22_break: /* CIL Label */ ;
7623          }
7624          }
7625        }
7626      }
7627    }
7628    if (we_should_unload) {
7629      {
7630/*       CdAudioUnload(& d); */ /* INLINED */
7631      }
7632    } else {
7633
7634    }
7635  } else {
7636
7637  }
7638  if (pended == 1) {
7639    if (s == NP) {
7640      s = NP;
7641    } else {
7642      goto _L___2;
7643    }
7644  } else {
7645    _L___2: /* CIL Label */ 
7646    if (pended == 1) {
7647      if (s == MPR3) {
7648        s = MPR3;
7649      } else {
7650        goto _L___1;
7651      }
7652    } else {
7653      _L___1: /* CIL Label */ 
7654      if (s == UNLOADED) {
7655
7656      } else {
7657        if (status == -1L) {
7658
7659        } else {
7660          if (s != SKIP2) {
7661            if (s != IPC) {
7662              if (s != DC) {
7663                {
7664                errorFn();
7665                }
7666              } else {
7667                goto _L___0;
7668              }
7669            } else {
7670              goto _L___0;
7671            }
7672          } else {
7673            _L___0: /* CIL Label */ 
7674            if (pended == 1) {
7675              if (status != 259L) {
7676                {
7677                errorFn();
7678                }
7679              } else {
7680
7681              }
7682            } else {
7683              if (s == DC) {
7684                if (status == 259L) {
7685                  {
7686                  errorFn();
7687                  }
7688                } else {
7689
7690                }
7691              } else {
7692                if (status != (NTSTATUS )lowerDriverReturn) {
7693                  {
7694                  errorFn();
7695                  }
7696                } else {
7697
7698                }
7699              }
7700            }
7701          }
7702        }
7703      }
7704    }
7705  }
7706  return (status);
7707}
7708}
7709char _SLAM_alloc_dummy  ;
7710extern int ( /* missing proto */  malloc)() ;
7711char *nondet_malloc(int i ) 
7712{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7713  int tmp ;
7714
7715  {
7716  if (__BLAST_NONDET___0) {
7717    return ((char *)0);
7718  } else {
7719    {
7720    tmp = malloc(i);
7721    }
7722    return ((char *)tmp);
7723  }
7724}
7725}
7726  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
7727void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) 
7728{ 
7729
7730  {
7731  return;
7732}
7733}
7734  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
7735void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) 
7736{ 
7737
7738  {
7739  return;
7740}
7741}
7742  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
7743                                                                                            SIZE_T NumberOfBytes ,
7744                                                                                            ULONG Tag ) ;
7745PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes ,
7746                                                            ULONG Tag ) 
7747{ PVOID x ;
7748  char *tmp ;
7749
7750  {
7751  {
7752  tmp = nondet_malloc(NumberOfBytes);
7753  x = tmp;
7754  }
7755  return (x);
7756}
7757}
7758  void ExFreePool(PVOID P ) ;
7759void ExFreePool(PVOID P ) 
7760{ 
7761
7762  {
7763  return;
7764}
7765}
7766  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
7767                                                                                                          PLIST_ENTRY ListEntry ,
7768                                                                                                          PKSPIN_LOCK Lock ) ;
7769PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
7770                                                                          PLIST_ENTRY ListEntry ,
7771                                                                          PKSPIN_LOCK Lock ) 
7772{ 
7773
7774  {
7775  return ((void *)0);
7776}
7777}
7778  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
7779                                                                                                          PLIST_ENTRY ListEntry ,
7780                                                                                                          PKSPIN_LOCK Lock ) ;
7781PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
7782                                                                          PLIST_ENTRY ListEntry ,
7783                                                                          PKSPIN_LOCK Lock ) 
7784{ 
7785
7786  {
7787  return ((void *)0);
7788}
7789}
7790  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
7791                                                                                                          PKSPIN_LOCK Lock ) ;
7792PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
7793                                                                          PKSPIN_LOCK Lock ) 
7794{ 
7795
7796  {
7797  return ((void *)0);
7798}
7799}
7800  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
7801                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
7802                                                   PIRP Irp ) ;
7803PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer ,
7804                   BOOLEAN ChargeQuota , PIRP Irp ) 
7805{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7806  char *tmp ;
7807
7808  {
7809  if (__BLAST_NONDET___0 == 0) {
7810    goto switch_23_0;
7811  } else {
7812    {
7813    goto switch_23_default;
7814    if (0) {
7815      switch_23_0: /* CIL Label */ 
7816      {
7817      tmp = nondet_malloc(sizeof(MDL ));
7818      }
7819      return ((void *)tmp);
7820      switch_23_default: /* CIL Label */ ;
7821      return ((void *)0);
7822    } else {
7823      switch_23_break: /* CIL Label */ ;
7824    }
7825    }
7826  }
7827}
7828}
7829  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
7830                                                                           PDEVICE_OBJECT TargetDevice ) ;
7831PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) 
7832{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7833
7834  {
7835  if (__BLAST_NONDET___0 == 0) {
7836    goto switch_24_0;
7837  } else {
7838    {
7839    goto switch_24_default;
7840    if (0) {
7841      switch_24_0: /* CIL Label */ ;
7842      return (TargetDevice);
7843      switch_24_default: /* CIL Label */ ;
7844      return ((void *)0);
7845    } else {
7846      switch_24_break: /* CIL Label */ ;
7847    }
7848    }
7849  }
7850}
7851}
7852  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
7853                                                                   PDEVICE_OBJECT DeviceObject ,
7854                                                                   PVOID Buffer ,
7855                                                                   ULONG Length ,
7856                                                                   PLARGE_INTEGER StartingOffset ,
7857                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
7858PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject ,
7859                                   PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset ,
7860                                   PIO_STATUS_BLOCK IoStatusBlock ) 
7861{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7862  int tmp ;
7863
7864  {
7865  customIrp = 1;
7866  if (__BLAST_NONDET___0 == 0) {
7867    goto switch_25_0;
7868  } else {
7869    {
7870    goto switch_25_default;
7871    if (0) {
7872      switch_25_0: /* CIL Label */ 
7873      {
7874      tmp = malloc(sizeof(IRP ));
7875      }
7876      return ((void *)tmp);
7877      switch_25_default: /* CIL Label */ ;
7878      return ((void *)0);
7879    } else {
7880      switch_25_break: /* CIL Label */ ;
7881    }
7882    }
7883  }
7884}
7885}
7886  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
7887                                                                   PDEVICE_OBJECT DeviceObject ,
7888                                                                   PVOID InputBuffer ,
7889                                                                   ULONG InputBufferLength ,
7890                                                                   PVOID OutputBuffer ,
7891                                                                   ULONG OutputBufferLength ,
7892                                                                   BOOLEAN InternalDeviceIoControl ,
7893                                                                   PKEVENT Event ,
7894                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
7895PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject ,
7896                                   PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
7897                                   ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl ,
7898                                   PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) 
7899{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7900  int tmp ;
7901
7902  {
7903  customIrp = 1;
7904  if (__BLAST_NONDET___0 == 0) {
7905    goto switch_26_0;
7906  } else {
7907    {
7908    goto switch_26_default;
7909    if (0) {
7910      switch_26_0: /* CIL Label */ 
7911      {
7912      tmp = malloc(sizeof(IRP ));
7913      }
7914      return ((void *)tmp);
7915      switch_26_default: /* CIL Label */ ;
7916      return ((void *)0);
7917    } else {
7918      switch_26_break: /* CIL Label */ ;
7919    }
7920    }
7921  }
7922}
7923}
7924  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
7925                                                        ULONG DeviceExtensionSize ,
7926                                                        PUNICODE_STRING DeviceName ,
7927                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
7928                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
7929NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize ,
7930                        PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics ,
7931                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) 
7932{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7933  int tmp ;
7934
7935  {
7936  if (__BLAST_NONDET___0 == 0) {
7937    goto switch_27_0;
7938  } else {
7939    {
7940    goto switch_27_default;
7941    if (0) {
7942      switch_27_0: /* CIL Label */ 
7943      {
7944      tmp = malloc(sizeof(DEVICE_OBJECT ));
7945      *DeviceObject = (void *)tmp;
7946      }
7947      return (0L);
7948      switch_27_default: /* CIL Label */ ;
7949      return (-1073741823L);
7950    } else {
7951      switch_27_break: /* CIL Label */ ;
7952    }
7953    }
7954  }
7955}
7956}
7957  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
7958                                                              PUNICODE_STRING DeviceName ) ;
7959NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) 
7960{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7961
7962  {
7963  if (__BLAST_NONDET___0 == 0) {
7964    goto switch_28_0;
7965  } else {
7966    {
7967    goto switch_28_default;
7968    if (0) {
7969      switch_28_0: /* CIL Label */ ;
7970      return (0L);
7971      switch_28_default: /* CIL Label */ ;
7972      return (-1073741823L);
7973    } else {
7974      switch_28_break: /* CIL Label */ ;
7975    }
7976    }
7977  }
7978}
7979}
7980  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
7981void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) 
7982{ 
7983
7984  {
7985  return;
7986}
7987}
7988  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
7989NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) 
7990{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7991
7992  {
7993  if (__BLAST_NONDET___0 == 0) {
7994    goto switch_29_0;
7995  } else {
7996    {
7997    goto switch_29_default;
7998    if (0) {
7999      switch_29_0: /* CIL Label */ ;
8000      return (0L);
8001      switch_29_default: /* CIL Label */ ;
8002      return (-1073741823L);
8003    } else {
8004      switch_29_break: /* CIL Label */ ;
8005    }
8006    }
8007  }
8008}
8009}
8010  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
8011void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) 
8012{ 
8013
8014  {
8015  return;
8016}
8017}
8018  void IoFreeIrp(PIRP Irp ) ;
8019void IoFreeIrp(PIRP Irp ) 
8020{ 
8021
8022  {
8023  return;
8024}
8025}
8026  void IoFreeMdl(PMDL Mdl ) ;
8027void IoFreeMdl(PMDL Mdl ) 
8028{ 
8029
8030  {
8031  return;
8032}
8033}
8034  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
8035PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) 
8036{ char *tmp ;
8037
8038  {
8039  {
8040  tmp = nondet_malloc(sizeof(CONFIGURATION_INFORMATION ));
8041  }
8042  return ((void *)tmp);
8043}
8044}
8045  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
8046                                                                  PULONG BusNumber ,
8047                                                                  PCONFIGURATION_TYPE ControllerType ,
8048                                                                  PULONG ControllerNumber ,
8049                                                                  PCONFIGURATION_TYPE PeripheralType ,
8050                                                                  PULONG PeripheralNumber ,
8051                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
8052                                                                                             PUNICODE_STRING PathName ,
8053                                                                                             INTERFACE_TYPE BusType ,
8054                                                                                             ULONG BusNumber ,
8055                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
8056                                                                                             CONFIGURATION_TYPE ControllerType ,
8057                                                                                             ULONG ControllerNumber ,
8058                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
8059                                                                                             CONFIGURATION_TYPE PeripheralType ,
8060                                                                                             ULONG PeripheralNumber ,
8061                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
8062                                                                  PVOID Context ) ;
8063NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType ,
8064                                  PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType ,
8065                                  PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context ,
8066                                                                                       PUNICODE_STRING PathName ,
8067                                                                                       INTERFACE_TYPE BusType ,
8068                                                                                       ULONG BusNumber ,
8069                                                                                       PKEY_VALUE_FULL_INFORMATION *BusInformation ,
8070                                                                                       CONFIGURATION_TYPE ControllerType ,
8071                                                                                       ULONG ControllerNumber ,
8072                                                                                       PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
8073                                                                                       CONFIGURATION_TYPE PeripheralType ,
8074                                                                                       ULONG PeripheralNumber ,
8075                                                                                       PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
8076                                  PVOID Context ) 
8077{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8078
8079  {
8080  if (__BLAST_NONDET___0 == 0) {
8081    goto switch_30_0;
8082  } else {
8083    {
8084    goto switch_30_default;
8085    if (0) {
8086      switch_30_0: /* CIL Label */ ;
8087      return (0L);
8088      switch_30_default: /* CIL Label */ ;
8089      return (-1073741823L);
8090    } else {
8091      switch_30_break: /* CIL Label */ ;
8092    }
8093    }
8094  }
8095}
8096}
8097  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
8098                                                                                                   GUID const   *InterfaceClassGuid ,
8099                                                                                                   PUNICODE_STRING ReferenceString ,
8100                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
8101NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
8102                                                                   GUID const   *InterfaceClassGuid ,
8103                                                                   PUNICODE_STRING ReferenceString ,
8104                                                                   PUNICODE_STRING SymbolicLinkName ) 
8105{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8106
8107  {
8108  if (__BLAST_NONDET___0 == 0) {
8109    goto switch_31_0;
8110  } else {
8111    {
8112    goto switch_31_default;
8113    if (0) {
8114      switch_31_0: /* CIL Label */ ;
8115      return (0L);
8116      switch_31_default: /* CIL Label */ ;
8117      return (-1073741808L);
8118    } else {
8119      switch_31_break: /* CIL Label */ ;
8120    }
8121    }
8122  }
8123}
8124}
8125  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
8126void IoReleaseCancelSpinLock(KIRQL Irql ) 
8127{ 
8128
8129  {
8130  return;
8131}
8132}
8133  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
8134                                                                   BOOLEAN Enable ) ;
8135NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) 
8136{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8137
8138  {
8139  if (__BLAST_NONDET___0 == 0) {
8140    goto switch_32_0;
8141  } else {
8142    {
8143    goto switch_32_default;
8144    if (0) {
8145      switch_32_0: /* CIL Label */ ;
8146      return (0L);
8147      switch_32_default: /* CIL Label */ ;
8148      return (-1073741823L);
8149    } else {
8150      switch_32_break: /* CIL Label */ ;
8151    }
8152    }
8153  }
8154}
8155}
8156  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
8157void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) 
8158{ 
8159
8160  {
8161  return;
8162}
8163}
8164void stubMoreProcessingRequired(void) 
8165{ 
8166
8167  {
8168  if (s == NP) {
8169    s = MPR1;
8170  } else {
8171    {
8172    errorFn();
8173    }
8174  }
8175  return;
8176}
8177}
8178  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
8179                                                                                        PIRP Irp ) ;
8180NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
8181                                                        PIRP Irp ) 
8182{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8183  NTSTATUS returnVal2 ;
8184  int compRetStatus ;
8185  PVOID lcontext = __VERIFIER_nondet_pointer() ;
8186  NTSTATUS tmp ;
8187  NTSTATUS tmp___0 ;
8188
8189  {
8190  if (compRegistered) {
8191    if (routine == 0) {
8192      {
8193      tmp = HPCdrCompletion(DeviceObject, Irp, lcontext);
8194      compRetStatus = tmp;
8195      }
8196    } else {
8197      if (routine == 1) {
8198        {
8199        tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext);
8200        compRetStatus = tmp___0;
8201        }
8202      } else {
8203
8204      }
8205    }
8206    if ((long )compRetStatus == -1073741802L) {
8207      {
8208      stubMoreProcessingRequired();
8209      }
8210    } else {
8211
8212    }
8213  } else {
8214
8215  }
8216  if (myIrp_PendingReturned) {
8217    returnVal2 = 259L;
8218  } else {
8219    if (__BLAST_NONDET___0 == 0) {
8220      goto switch_33_0;
8221    } else {
8222      if (__BLAST_NONDET___0 == 1) {
8223        goto switch_33_1;
8224      } else {
8225        {
8226        goto switch_33_default;
8227        if (0) {
8228          switch_33_0: /* CIL Label */ 
8229          returnVal2 = 0L;
8230          goto switch_33_break;
8231          switch_33_1: /* CIL Label */ 
8232          returnVal2 = -1073741823L;
8233          goto switch_33_break;
8234          switch_33_default: /* CIL Label */ 
8235          returnVal2 = 259L;
8236          goto switch_33_break;
8237        } else {
8238          switch_33_break: /* CIL Label */ ;
8239        }
8240        }
8241      }
8242    }
8243  }
8244  if (s == NP) {
8245    s = IPC;
8246    lowerDriverReturn = returnVal2;
8247  } else {
8248    if (s == MPR1) {
8249      if (returnVal2 == 259L) {
8250        s = MPR3;
8251        lowerDriverReturn = returnVal2;
8252      } else {
8253        s = NP;
8254        lowerDriverReturn = returnVal2;
8255      }
8256    } else {
8257      if (s == SKIP1) {
8258        s = SKIP2;
8259        lowerDriverReturn = returnVal2;
8260      } else {
8261        {
8262        errorFn();
8263        }
8264      }
8265    }
8266  }
8267  return (returnVal2);
8268}
8269}
8270  void IofCompleteRequest(PIRP Irp ,
8271                                                                                         CCHAR PriorityBoost ) ;
8272void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) 
8273{ 
8274
8275  {
8276  if (s == NP) {
8277    s = DC;
8278  } else {
8279    {
8280    errorFn();
8281    }
8282  }
8283  return;
8284}
8285}
8286  KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ;
8287KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) 
8288{ 
8289
8290  {
8291  return ((unsigned char)0);
8292}
8293}
8294  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
8295                                                                BOOLEAN Alertable ,
8296                                                                PLARGE_INTEGER Interval ) ;
8297NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) 
8298{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8299
8300  {
8301  if (__BLAST_NONDET___0 == 0) {
8302    goto switch_34_0;
8303  } else {
8304    {
8305    goto switch_34_default;
8306    if (0) {
8307      switch_34_0: /* CIL Label */ ;
8308      return (0L);
8309      switch_34_default: /* CIL Label */ ;
8310      return (-1073741823L);
8311    } else {
8312      switch_34_break: /* CIL Label */ ;
8313    }
8314    }
8315  }
8316}
8317}
8318  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
8319                                                       BOOLEAN State ) ;
8320void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) 
8321{ 
8322
8323  {
8324  return;
8325}
8326}
8327  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
8328                                                           LONG Count , LONG Limit ) ;
8329void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) 
8330{ 
8331
8332  {
8333  return;
8334}
8335}
8336  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
8337void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) 
8338{ 
8339
8340  {
8341  return;
8342}
8343}
8344  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
8345                                                        LONG Adjustment , BOOLEAN Wait ) ;
8346LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment ,
8347                        BOOLEAN Wait ) 
8348{ LONG r = __VERIFIER_nondet_long() ;
8349
8350  {
8351  return (r);
8352}
8353}
8354  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
8355                                                                                        KIRQL NewIrql ) ;
8356void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) 
8357{ 
8358
8359  {
8360  return;
8361}
8362}
8363  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
8364                                                BOOLEAN Wait ) ;
8365LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) 
8366{ LONG l = __VERIFIER_nondet_long() ;
8367
8368  {
8369  setEventCalled = 1;
8370  return (l);
8371}
8372}
8373  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
8374                                                               KPROCESSOR_MODE WaitMode ,
8375                                                               BOOLEAN Alertable ,
8376                                                               PLARGE_INTEGER Timeout ) ;
8377NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode ,
8378                               BOOLEAN Alertable , PLARGE_INTEGER Timeout ) 
8379{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8380
8381  {
8382  if (s == MPR3) {
8383    if (setEventCalled == 1) {
8384      s = NP;
8385      setEventCalled = 0;
8386    } else {
8387      goto _L;
8388    }
8389  } else {
8390    _L: /* CIL Label */ 
8391    if (customIrp == 1) {
8392      s = NP;
8393      customIrp = 0;
8394    } else {
8395      if (s == MPR3) {
8396        {
8397        errorFn();
8398        }
8399      } else {
8400
8401      }
8402    }
8403  }
8404  if (__BLAST_NONDET___0 == 0) {
8405    goto switch_35_0;
8406  } else {
8407    {
8408    goto switch_35_default;
8409    if (0) {
8410      switch_35_0: /* CIL Label */ ;
8411      return (0L);
8412      switch_35_default: /* CIL Label */ ;
8413      return (-1073741823L);
8414    } else {
8415      switch_35_break: /* CIL Label */ ;
8416    }
8417    }
8418  }
8419}
8420}
8421  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
8422                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
8423PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) 
8424{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8425  int tmp ;
8426
8427  {
8428  if (__BLAST_NONDET___0 == 0) {
8429    goto switch_36_0;
8430  } else {
8431    if (__BLAST_NONDET___0 == 1) {
8432      goto switch_36_1;
8433    } else {
8434      if (0) {
8435        switch_36_0: /* CIL Label */ 
8436        {
8437        tmp = malloc(NumberOfBytes);
8438        }
8439        return (tmp);
8440        switch_36_1: /* CIL Label */ ;
8441        return ((void *)0);
8442      } else {
8443        switch_36_break: /* CIL Label */ ;
8444      }
8445    }
8446  }
8447  return ((void *)0);
8448}
8449}
8450  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
8451void MmFreeContiguousMemory(PVOID BaseAddress ) 
8452{ 
8453
8454  {
8455  return;
8456}
8457}
8458  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
8459                                                                   KPROCESSOR_MODE AccessMode ,
8460                                                                   MEMORY_CACHING_TYPE CacheType ,
8461                                                                   PVOID BaseAddress ,
8462                                                                   ULONG BugCheckOnFailure ,
8463                                                                   MM_PAGE_PRIORITY Priority ) ;
8464PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode ,
8465                                   MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress ,
8466                                   ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) 
8467{ 
8468
8469  {
8470  return ((void *)0);
8471}
8472}
8473  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
8474PVOID MmPageEntireDriver(PVOID AddressWithinSection ) 
8475{ 
8476
8477  {
8478  return ((void *)0);
8479}
8480}
8481  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
8482void MmResetDriverPaging(PVOID AddressWithinSection ) 
8483{ 
8484
8485  {
8486  return;
8487}
8488}
8489  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
8490void MmUnlockPages(PMDL MemoryDescriptorList ) 
8491{ 
8492
8493  {
8494  return;
8495}
8496}
8497  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
8498                                                                   ACCESS_MASK DesiredAccess ,
8499                                                                   POBJECT_TYPE ObjectType ,
8500                                                                   KPROCESSOR_MODE AccessMode ,
8501                                                                   PVOID *Object ,
8502                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
8503NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType ,
8504                                   KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) 
8505{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8506
8507  {
8508  if (__BLAST_NONDET___0 == 0) {
8509    goto switch_37_0;
8510  } else {
8511    {
8512    goto switch_37_default;
8513    if (0) {
8514      switch_37_0: /* CIL Label */ ;
8515      return (0L);
8516      switch_37_default: /* CIL Label */ ;
8517      return (-1073741823L);
8518    } else {
8519      switch_37_break: /* CIL Label */ ;
8520    }
8521    }
8522  }
8523}
8524}
8525  void ObfDereferenceObject(PVOID Object ) ;
8526void ObfDereferenceObject(PVOID Object ) 
8527{ 
8528
8529  {
8530  return;
8531}
8532}
8533  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
8534                                                      PIRP Irp ) ;
8535NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
8536{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8537  int compRetStatus ;
8538  NTSTATUS returnVal ;
8539  PVOID lcontext = __VERIFIER_nondet_pointer() ;
8540  NTSTATUS tmp ;
8541  NTSTATUS tmp___0 ;
8542
8543  {
8544  if (compRegistered) {
8545    if (routine == 0) {
8546      {
8547      tmp = HPCdrCompletion(DeviceObject, Irp, lcontext);
8548      compRetStatus = tmp;
8549      }
8550    } else {
8551      if (routine == 1) {
8552        {
8553        tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext);
8554        compRetStatus = tmp___0;
8555        }
8556      } else {
8557
8558      }
8559    }
8560    if ((long )compRetStatus == -1073741802L) {
8561      {
8562      stubMoreProcessingRequired();
8563      }
8564    } else {
8565
8566    }
8567  } else {
8568
8569  }
8570  if (__BLAST_NONDET___0 == 0) {
8571    goto switch_38_0;
8572  } else {
8573    if (__BLAST_NONDET___0 == 1) {
8574      goto switch_38_1;
8575    } else {
8576      {
8577      goto switch_38_default;
8578      if (0) {
8579        switch_38_0: /* CIL Label */ 
8580        returnVal = 0L;
8581        goto switch_38_break;
8582        switch_38_1: /* CIL Label */ 
8583        returnVal = -1073741823L;
8584        goto switch_38_break;
8585        switch_38_default: /* CIL Label */ 
8586        returnVal = 259L;
8587        goto switch_38_break;
8588      } else {
8589        switch_38_break: /* CIL Label */ ;
8590      }
8591      }
8592    }
8593  }
8594  if (s == NP) {
8595    s = IPC;
8596    lowerDriverReturn = returnVal;
8597  } else {
8598    if (s == MPR1) {
8599      if (returnVal == 259L) {
8600        s = MPR3;
8601        lowerDriverReturn = returnVal;
8602      } else {
8603        s = NP;
8604        lowerDriverReturn = returnVal;
8605      }
8606    } else {
8607      if (s == SKIP1) {
8608        s = SKIP2;
8609        lowerDriverReturn = returnVal;
8610      } else {
8611        {
8612        errorFn();
8613        }
8614      }
8615    }
8616  }
8617  return (returnVal);
8618}
8619}
8620  void PoStartNextPowerIrp(PIRP Irp ) ;
8621void PoStartNextPowerIrp(PIRP Irp ) 
8622{ 
8623
8624  {
8625  return;
8626}
8627}
8628  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
8629                                                              ULONG DesiredAccess ,
8630                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
8631                                                              HANDLE ProcessHandle ,
8632                                                              PCLIENT_ID ClientId ,
8633                                                              void (*StartRoutine)(PVOID StartContext ) ,
8634                                                              PVOID StartContext ) ;
8635NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes ,
8636                              HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) ,
8637                              PVOID StartContext ) 
8638{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8639
8640  {
8641  if (__BLAST_NONDET___0 == 0) {
8642    goto switch_39_0;
8643  } else {
8644    {
8645    goto switch_39_default;
8646    if (0) {
8647      switch_39_0: /* CIL Label */ ;
8648      return (0L);
8649      switch_39_default: /* CIL Label */ ;
8650      return (-1073741823L);
8651    } else {
8652      switch_39_break: /* CIL Label */ ;
8653    }
8654    }
8655  }
8656}
8657}
8658  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
8659NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) 
8660{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8661
8662  {
8663  if (__BLAST_NONDET___0 == 0) {
8664    goto switch_40_0;
8665  } else {
8666    {
8667    goto switch_40_default;
8668    if (0) {
8669      switch_40_0: /* CIL Label */ ;
8670      return (0L);
8671      switch_40_default: /* CIL Label */ ;
8672      return (-1073741823L);
8673    } else {
8674      switch_40_break: /* CIL Label */ ;
8675    }
8676    }
8677  }
8678}
8679}
8680  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
8681                                                                                                      PANSI_STRING SourceString ,
8682                                                                                                      BOOLEAN AllocateDestinationString ) ;
8683NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
8684                                                                      PANSI_STRING SourceString ,
8685                                                                      BOOLEAN AllocateDestinationString ) 
8686{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8687
8688  {
8689  if (__BLAST_NONDET___0 == 0) {
8690    goto switch_41_0;
8691  } else {
8692    {
8693    goto switch_41_default;
8694    if (0) {
8695      switch_41_0: /* CIL Label */ ;
8696      return (0L);
8697      switch_41_default: /* CIL Label */ ;
8698      return (-1073741823L);
8699    } else {
8700      switch_41_break: /* CIL Label */ ;
8701    }
8702    }
8703  }
8704}
8705}
8706  SIZE_T RtlCompareMemory(void const   *Source1 ,
8707                                                                                        void const   *Source2 ,
8708                                                                                        SIZE_T Length ) ;
8709SIZE_T RtlCompareMemory(void const   *Source1 , void const   *Source2 ,
8710                                                        SIZE_T Length ) 
8711{ SIZE_T r = __VERIFIER_nondet_long() ;
8712
8713  {
8714  return (r);
8715}
8716}
8717  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
8718                                                                                          PUNICODE_STRING SourceString ) ;
8719void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
8720                                                          PUNICODE_STRING SourceString ) 
8721{ 
8722
8723  {
8724  return;
8725}
8726}
8727  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
8728                                                                                                PCWSTR Path ,
8729                                                                                                PCWSTR ValueName ) ;
8730NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
8731                                                                PCWSTR Path , PCWSTR ValueName ) 
8732{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8733
8734  {
8735  if (__BLAST_NONDET___0 == 0) {
8736    goto switch_42_0;
8737  } else {
8738    {
8739    goto switch_42_default;
8740    if (0) {
8741      switch_42_0: /* CIL Label */ ;
8742      return (0L);
8743      switch_42_default: /* CIL Label */ ;
8744      return (-1073741823L);
8745    } else {
8746      switch_42_break: /* CIL Label */ ;
8747    }
8748    }
8749  }
8750}
8751}
8752  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
8753void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) 
8754{ 
8755
8756  {
8757  return;
8758}
8759}
8760  void RtlInitString(PSTRING DestinationString ,
8761                                                                                   PCSZ SourceString ) ;
8762void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) 
8763{ 
8764
8765  {
8766  return;
8767}
8768}
8769  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
8770                                                                                          PCWSTR SourceString ) ;
8771void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
8772                                                          PCWSTR SourceString ) 
8773{ 
8774
8775  {
8776  return;
8777}
8778}
8779  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
8780                                                                                                PCWSTR Path ,
8781                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
8782                                                                                                PVOID Context ,
8783                                                                                                PVOID Environment ) ;
8784NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
8785                                                                PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable ,
8786                                                                PVOID Context , PVOID Environment ) 
8787{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8788
8789  {
8790  if (__BLAST_NONDET___0 == 0) {
8791    goto switch_43_0;
8792  } else {
8793    {
8794    goto switch_43_default;
8795    if (0) {
8796      switch_43_0: /* CIL Label */ ;
8797      return (0L);
8798      switch_43_default: /* CIL Label */ ;
8799      return (-1073741823L);
8800    } else {
8801      switch_43_break: /* CIL Label */ ;
8802    }
8803    }
8804  }
8805}
8806}
8807  NTSTATUS ZwClose(HANDLE Handle ) ;
8808NTSTATUS ZwClose(HANDLE Handle ) 
8809{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8810
8811  {
8812  if (__BLAST_NONDET___0 == 0) {
8813    goto switch_44_0;
8814  } else {
8815    {
8816    goto switch_44_default;
8817    if (0) {
8818      switch_44_0: /* CIL Label */ ;
8819      return (0L);
8820      switch_44_default: /* CIL Label */ ;
8821      return (-1073741823L);
8822    } else {
8823      switch_44_break: /* CIL Label */ ;
8824    }
8825    }
8826  }
8827}
8828}