Showing error 1549

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_unsafe.i.cil.c
Line in file: 2839
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)
2834int __BLAST_NONDET ;
2835void errorFn(void) 
2836{ 
2837
2838  {
2839  ERROR: 
2840  goto ERROR;
2841}
2842}
2843int s  ;
2844int UNLOADED  ;
2845int NP  ;
2846int DC  ;
2847int SKIP1  ;
2848int SKIP2  ;
2849int MPR1  ;
2850int MPR3  ;
2851int IPC  ;
2852int pended  ;
2853NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context )  ;
2854int compRegistered  ;
2855int lowerDriverReturn  ;
2856int setEventCalled  ;
2857int customIrp  ;
2858int routine  ;
2859int myStatus  ;
2860int myIrp_PendingReturned  ;
2861void _BLAST_init(void) 
2862{ 
2863
2864  {
2865  UNLOADED = 0;
2866  NP = 1;
2867  DC = 2;
2868  SKIP1 = 3;
2869  SKIP2 = 4;
2870  MPR1 = 5;
2871  MPR3 = 6;
2872  IPC = 7;
2873  s = UNLOADED;
2874  pended = 0;
2875  compFptr = 0;
2876  compRegistered = 0;
2877  lowerDriverReturn = 0;
2878  setEventCalled = 0;
2879  customIrp = 0;
2880  return;
2881}
2882}
2883NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ;
2884NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2885NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2886NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2887BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) ;
2888BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) ;
2889NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2890NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2891NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2892NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) ;
2893NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2894NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2895NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2896NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2897NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2898void HpCdrProcessLastSession(PCDROM_TOC Toc ) ;
2899NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
2900NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2901NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2902void CdAudioUnload(PDRIVER_OBJECT DriverObject ) ;
2903#pragma alloc_text(INIT,DriverEntry)
2904#pragma alloc_text(PAGECDNC,CdAudioNECDeviceControl)
2905#pragma alloc_text(PAGECDOT,CdAudioHitachiSendPauseCommand)
2906#pragma alloc_text(PAGECDOT,CdAudioHitachiDeviceControl)
2907#pragma alloc_text(PAGECDOT,CdAudioDenonDeviceControl)
2908#pragma alloc_text(PAGECDNC,CdAudio435DeviceControl)
2909#pragma alloc_text(PAGECDNC,CdAudio535DeviceControl)
2910#pragma alloc_text(PAGECDOT,CdAudioPioneerDeviceControl)
2911#pragma alloc_text(PAGECDNC,CdAudioPan533DeviceControl)
2912#pragma alloc_text(PAGECDOT,CdAudioAtapiDeviceControl)
2913#pragma alloc_text(PAGECDOT,CdAudioLionOpticsDeviceControl)
2914#pragma alloc_text(PAGECDOT,CdAudioHPCdrDeviceControl)
2915#pragma alloc_text(PAGECDOT,HpCdrProcessLastSession)
2916#pragma alloc_text(PAGECDOT,HPCdrCompletion)
2917NTSTATUS SendSrbSynchronous(PCD_DEVICE_EXTENSION Extension , PSCSI_PASS_THROUGH Srb ,
2918                            PVOID Buffer , ULONG BufferLength ) 
2919{ ULONG ioctl ;
2920  KEVENT event ;
2921  PIRP irp ;
2922  IO_STATUS_BLOCK ioStatus ;
2923  NTSTATUS status = __VERIFIER_nondet_long() ;
2924
2925  {
2926  irp = (void *)0;
2927  Srb->Length = sizeof(SCSI_PASS_THROUGH );
2928  Srb->SenseInfoLength = 0;
2929  Srb->SenseInfoOffset = 0;
2930  if (Buffer) {
2931    Srb->DataIn = 1;
2932    Srb->DataTransferLength = BufferLength;
2933    Srb->DataBufferOffset = (unsigned long )Buffer;
2934    ioctl = ((4 << 16) | (3 << 14)) | (1029 << 2);
2935  } else {
2936    Srb->DataIn = 0;
2937    Srb->DataTransferLength = 0;
2938    Srb->DataBufferOffset = 0;
2939    ioctl = ((4 << 16) | (3 << 14)) | (1025 << 2);
2940  }
2941  {
2942/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2943  }
2944  if (! irp) {
2945    return (-1073741670L);
2946  } else {
2947
2948  }
2949  if (status == 259L) {
2950    {
2951    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2952    status = ioStatus.__annonCompField4.Status;
2953    }
2954  } else {
2955
2956  }
2957  return (status);
2958}
2959}
2960NTSTATUS CdAudioAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) 
2961{ NTSTATUS status ;
2962  PDEVICE_OBJECT deviceObject ;
2963  PCD_DEVICE_EXTENSION extension ;
2964  ULONG regActive ;
2965  HANDLE deviceParameterHandle ;
2966  RTL_QUERY_REGISTRY_TABLE queryTable[2] ;
2967
2968  {
2969  {
2970  regActive = 255;
2971  status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 2, 131097L, & deviceParameterHandle);
2972  }
2973  if (! (status >= 0L)) {
2974    regActive = 255;
2975    goto AddDeviceEndRegistry;
2976  } else {
2977
2978  }
2979  {
2980  memset(& queryTable, 0, sizeof(queryTable));
2981  queryTable[0].Flags = 36;
2982  queryTable[0].Name = "M\000a\000p\000T\000y\000p\000e\000";
2983  queryTable[0].EntryContext = & regActive;
2984  queryTable[0].DefaultType = 4;
2985  queryTable[0].DefaultData = (void *)0;
2986  queryTable[0].DefaultLength = 0;
2987  status = RtlQueryRegistryValues(1073741824, (WCHAR *)deviceParameterHandle, queryTable,
2988                                  (void *)0, (void *)0);
2989  }
2990  if (! (status >= 0L)) {
2991    regActive = 255;
2992  } else {
2993    if (regActive > 10UL) {
2994      regActive = 255;
2995    } else {
2996
2997    }
2998  }
2999  {
3000  ZwClose(deviceParameterHandle);
3001  }
3002  AddDeviceEndRegistry: 
3003  if (regActive > 10UL) {
3004    if (regActive != 255UL) {
3005      regActive = 255;
3006    } else {
3007
3008    }
3009  } else {
3010
3011  }
3012  if (regActive == 0UL) {
3013    return (0L);
3014  } else {
3015
3016  }
3017  if (regActive == 8) {
3018    goto switch_0_8;
3019  } else {
3020    if (regActive == 9) {
3021      goto switch_0_9;
3022    } else {
3023      if (regActive == 10) {
3024        goto switch_0_10;
3025      } else {
3026        if (regActive == 4) {
3027          goto switch_0_4;
3028        } else {
3029          if (regActive == 6) {
3030            goto switch_0_6;
3031          } else {
3032            if (regActive == 5) {
3033              goto switch_0_5;
3034            } else {
3035              if (regActive == 2) {
3036                goto switch_0_2;
3037              } else {
3038                if (regActive == 3) {
3039                  goto switch_0_3;
3040                } else {
3041                  if (regActive == 1) {
3042                    goto switch_0_1;
3043                  } else {
3044                    if (regActive == 7) {
3045                      goto switch_0_7;
3046                    } else {
3047                      if (regActive == 255) {
3048                        goto switch_0_255;
3049                      } else {
3050                        {
3051                        goto switch_0_default;
3052                        if (0) {
3053                          switch_0_8: /* CIL Label */ 
3054                          {
3055                          MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl));
3056                          }
3057                          goto switch_0_break;
3058                          switch_0_9: /* CIL Label */ ;
3059                          switch_0_10: /* CIL Label */ 
3060                          {
3061                          MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl));
3062                          }
3063                          goto switch_0_break;
3064                          switch_0_4: /* CIL Label */ 
3065                          {
3066                          MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl));
3067                          }
3068                          goto switch_0_break;
3069                          switch_0_6: /* CIL Label */ ;
3070                          switch_0_5: /* CIL Label */ 
3071                          {
3072                          MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3073                          }
3074                          goto switch_0_break;
3075                          switch_0_2: /* CIL Label */ 
3076                          {
3077                          MmLockPagableDataSection((void *)(& CdAudio535DeviceControl));
3078                          }
3079                          goto switch_0_break;
3080                          switch_0_3: /* CIL Label */ 
3081                          {
3082                          MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3083                          }
3084                          goto switch_0_break;
3085                          switch_0_1: /* CIL Label */ 
3086                          {
3087                          MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3088                          }
3089                          goto switch_0_break;
3090                          switch_0_7: /* CIL Label */ 
3091                          {
3092                          MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl));
3093                          }
3094                          goto switch_0_break;
3095                          switch_0_255: /* CIL Label */ ;
3096                          switch_0_default: /* CIL Label */ ;
3097                          goto switch_0_break;
3098                        } else {
3099                          switch_0_break: /* CIL Label */ ;
3100                        }
3101                        }
3102                      }
3103                    }
3104                  }
3105                }
3106              }
3107            }
3108          }
3109        }
3110      }
3111    }
3112  }
3113  {
3114  status = IoCreateDevice(DriverObject, sizeof(CD_DEVICE_EXTENSION ), (void *)0, 2,
3115                          0, 0, & deviceObject);
3116  }
3117  if (! (status >= 0L)) {
3118    return (status);
3119  } else {
3120
3121  }
3122  deviceObject->Flags |= 16UL;
3123  if (deviceObject->Flags & 16384UL) {
3124
3125  } else {
3126    deviceObject->Flags |= 8192UL;
3127  }
3128  {
3129  extension = deviceObject->DeviceExtension;
3130  memset(extension, 0, sizeof(CD_DEVICE_EXTENSION ));
3131  extension->TargetDeviceObject = IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject);
3132  }
3133  if (! extension->TargetDeviceObject) {
3134    {
3135/*     IoDeleteDevice(deviceObject); */ /* INLINED */
3136    }
3137    return (-1073741810L);
3138  } else {
3139
3140  }
3141  {
3142/*   KeInitializeEvent(& extension->PagingPathCountEvent, 1, 1); */ /* INLINED */
3143  extension->Active = (unsigned char )regActive;
3144  extension->DeviceObject = deviceObject;
3145  extension->TargetPdo = PhysicalDeviceObject;
3146  deviceObject->Flags &= 4294967167UL;
3147  }
3148  return (0L);
3149}
3150}
3151NTSTATUS CdAudioSignalCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) 
3152{ 
3153
3154  {
3155  {
3156  KeSetEvent(Event, 0, 0);
3157  }
3158  return (-1073741802L);
3159}
3160}
3161NTSTATUS CdAudioStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3162{ PCD_DEVICE_EXTENSION deviceExtension ;
3163  NTSTATUS status ;
3164  SCSI_PASS_THROUGH srb ;
3165  PCDB cdb ;
3166  PUCHAR inquiryDataPtr ;
3167  UCHAR attempt ;
3168  PVOID tmp ;
3169  UCHAR tmp___0 ;
3170  BOOLEAN tmp___1 ;
3171  int tmp___2 ;
3172  int tmp___3 ;
3173  int tmp___4 ;
3174  int tmp___5 ;
3175  int tmp___6 ;
3176  int tmp___7 ;
3177  int tmp___8 ;
3178  int tmp___9 ;
3179  int tmp___10 ;
3180  int tmp___11 ;
3181  int tmp___12 ;
3182  int tmp___13 ;
3183  int tmp___14 ;
3184  int tmp___15 ;
3185  HANDLE deviceParameterHandle ;
3186  ULONG keyValue ;
3187
3188  {
3189  {
3190  deviceExtension = DeviceObject->DeviceExtension;
3191  status = CdAudioForwardIrpSynchronous(DeviceObject, Irp);
3192  }
3193  if (! (status >= 0L)) {
3194    return (status);
3195  } else {
3196
3197  }
3198  deviceExtension->Paused = 0;
3199  deviceExtension->PausedM = 0;
3200  deviceExtension->PausedS = 0;
3201  deviceExtension->PausedF = 0;
3202  deviceExtension->LastEndM = 0;
3203  deviceExtension->LastEndS = 0;
3204  deviceExtension->LastEndF = 0;
3205  if ((int )deviceExtension->Active == 255) {
3206    {
3207    cdb = (union _CDB *)(srb.Cdb);
3208    inquiryDataPtr = (void *)0;
3209    attempt = 0;
3210    tmp = ExAllocatePoolWithTag(4, 36, 541156419UL);
3211    inquiryDataPtr = (UCHAR *)tmp;
3212    }
3213    if (! inquiryDataPtr) {
3214      deviceExtension->Active = 0;
3215      return (0L);
3216    } else {
3217
3218    }
3219    status = -1073741823L;
3220    {
3221    while (1) {
3222      while_1_continue: /* CIL Label */ ;
3223      if (! (status >= 0L)) {
3224        tmp___0 = attempt;
3225        attempt = (UCHAR )((int )attempt + 1);
3226        if (tmp___0 < 4) {
3227
3228        } else {
3229          goto while_1_break;
3230        }
3231      } else {
3232        goto while_1_break;
3233      }
3234      {
3235      memset(& srb, 0, sizeof(SCSI_PASS_THROUGH ));
3236      memset(inquiryDataPtr, 0, 36);
3237      cdb->CDB6INQUIRY.OperationCode = 18;
3238      cdb->CDB6INQUIRY.AllocationLength = 36;
3239      srb.CdbLength = 6;
3240      srb.TimeOutValue = 10;
3241      status = SendSrbSynchronous(deviceExtension, & srb, inquiryDataPtr, 36);
3242      }
3243    }
3244    while_1_break: /* CIL Label */ ;
3245    }
3246    if (! (status >= 0L)) {
3247      {
3248/*       ExFreePool(inquiryDataPtr); */ /* INLINED */
3249      deviceExtension->Active = 0;
3250      }
3251      return (0L);
3252    } else {
3253
3254    }
3255    {
3256    deviceExtension->Active = 0;
3257    tmp___2 = memcmp(inquiryDataPtr + 8, "NEC     ", 8);
3258    }
3259    if (tmp___2) {
3260
3261    } else {
3262      {
3263      tmp___1 = NecSupportNeeded(inquiryDataPtr);
3264      }
3265      if (tmp___1) {
3266        {
3267        MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl));
3268        deviceExtension->Active = 8;
3269        }
3270      } else {
3271
3272      }
3273    }
3274    {
3275    tmp___3 = memcmp(inquiryDataPtr + 8, "PIONEER ", 8);
3276    }
3277    if (tmp___3) {
3278
3279    } else {
3280      {
3281      tmp___4 = memcmp(inquiryDataPtr + 16, "CD-ROM DRM-600", 15);
3282      }
3283      if (tmp___4) {
3284
3285      } else {
3286        {
3287        MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl));
3288        deviceExtension->Active = 9;
3289        }
3290      }
3291    }
3292    if ((int )*(inquiryDataPtr + 8) == 68) {
3293      if ((int )*(inquiryDataPtr + 9) == 69) {
3294        if ((int )*(inquiryDataPtr + 10) == 78) {
3295          if ((int )*(inquiryDataPtr + 16) == 68) {
3296            if ((int )*(inquiryDataPtr + 17) == 82) {
3297              if ((int )*(inquiryDataPtr + 18) == 68) {
3298                if ((int )*(inquiryDataPtr + 20) == 50) {
3299                  if ((int )*(inquiryDataPtr + 21) == 53) {
3300                    if ((int )*(inquiryDataPtr + 22) == 88) {
3301                      {
3302                      MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl));
3303                      deviceExtension->Active = 4;
3304                      }
3305                    } else {
3306
3307                    }
3308                  } else {
3309
3310                  }
3311                } else {
3312
3313                }
3314              } else {
3315
3316              }
3317            } else {
3318
3319            }
3320          } else {
3321
3322          }
3323        } else {
3324
3325        }
3326      } else {
3327
3328      }
3329    } else {
3330
3331    }
3332    {
3333    tmp___5 = memcmp(inquiryDataPtr + 8, "CHINON", 6);
3334    }
3335    if (tmp___5) {
3336
3337    } else {
3338      if ((int )*(inquiryDataPtr + 27) == 53) {
3339        if ((int )*(inquiryDataPtr + 28) == 51) {
3340          if ((int )*(inquiryDataPtr + 29) == 53) {
3341            if ((int )*(inquiryDataPtr + 32) == 81) {
3342              {
3343              MmLockPagableDataSection((void *)(& CdAudio535DeviceControl));
3344              deviceExtension->Active = 2;
3345              }
3346            } else {
3347
3348            }
3349          } else {
3350
3351          }
3352        } else {
3353
3354        }
3355      } else {
3356
3357      }
3358      if ((int )*(inquiryDataPtr + 27) == 52) {
3359        if ((int )*(inquiryDataPtr + 28) == 51) {
3360          if ((int )*(inquiryDataPtr + 29) == 53) {
3361            goto _L;
3362          } else {
3363            if ((int )*(inquiryDataPtr + 29) == 49) {
3364              _L: /* CIL Label */ 
3365              if ((int )*(inquiryDataPtr + 32) == 77) {
3366                {
3367                MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3368                deviceExtension->Active = 3;
3369                }
3370              } else {
3371                if ((int )*(inquiryDataPtr + 32) == 78) {
3372                  {
3373                  MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3374                  deviceExtension->Active = 3;
3375                  }
3376                } else {
3377                  if ((int )*(inquiryDataPtr + 32) == 83) {
3378                    {
3379                    MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3380                    deviceExtension->Active = 3;
3381                    }
3382                  } else {
3383                    if ((int )*(inquiryDataPtr + 32) == 85) {
3384                      {
3385                      MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3386                      deviceExtension->Active = 3;
3387                      }
3388                    } else {
3389                      if ((int )*(inquiryDataPtr + 32) == 72) {
3390                        {
3391                        MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3392                        deviceExtension->Active = 3;
3393                        }
3394                      } else {
3395
3396                      }
3397                    }
3398                  }
3399                }
3400              }
3401            } else {
3402
3403            }
3404          }
3405        } else {
3406
3407        }
3408      } else {
3409
3410      }
3411    }
3412    {
3413    tmp___6 = memcmp(inquiryDataPtr + 8, "HITACHI ", 8);
3414    }
3415    if (tmp___6) {
3416
3417    } else {
3418      {
3419      tmp___7 = memcmp(inquiryDataPtr + 16, "CDR-3650/1650S  ", 16);
3420      }
3421      if (tmp___7) {
3422        {
3423        tmp___8 = memcmp(inquiryDataPtr + 16, "CDR-1750S       ", 16);
3424        }
3425        if (tmp___8) {
3426
3427        } else {
3428          {
3429          MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3430          deviceExtension->Active = 6;
3431          }
3432        }
3433      } else {
3434        {
3435        MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3436        deviceExtension->Active = 6;
3437        }
3438      }
3439    }
3440    {
3441    tmp___9 = memcmp(inquiryDataPtr + 8, "WEARNES ", 8);
3442    }
3443    if (tmp___9) {
3444      _L___0: /* CIL Label */ 
3445      {
3446      tmp___11 = memcmp(inquiryDataPtr + 8, "OTI     ", 8);
3447      }
3448      if (tmp___11) {
3449
3450      } else {
3451        {
3452        tmp___12 = memcmp(inquiryDataPtr + 16, "DOLPHIN ", 8);
3453        }
3454        if (tmp___12) {
3455
3456        } else {
3457          {
3458          MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3459          deviceExtension->Active = 1;
3460          *(inquiryDataPtr + 25) = (unsigned char)0;
3461          }
3462        }
3463      }
3464    } else {
3465      {
3466      tmp___10 = memcmp(inquiryDataPtr + 16, "RUB", 3);
3467      }
3468      if (tmp___10) {
3469        goto _L___0;
3470      } else {
3471        {
3472        MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3473        deviceExtension->Active = 1;
3474        *(inquiryDataPtr + 25) = (unsigned char)0;
3475        }
3476      }
3477    }
3478    {
3479    tmp___13 = memcmp(inquiryDataPtr + 8, "FUJITSU ", 8);
3480    }
3481    if (tmp___13) {
3482
3483    } else {
3484      if ((int )*(inquiryDataPtr + 16) == 67) {
3485        if ((int )*(inquiryDataPtr + 17) == 68) {
3486          if ((int )*(inquiryDataPtr + 18) == 82) {
3487            if ((int )*(inquiryDataPtr + 20) == 51) {
3488              if ((int )*(inquiryDataPtr + 21) == 54) {
3489                if ((int )*(inquiryDataPtr + 22) == 53) {
3490                  if ((int )*(inquiryDataPtr + 23) == 48) {
3491                    {
3492                    MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3493                    deviceExtension->Active = 6;
3494                    *(inquiryDataPtr + 25) = (unsigned char)0;
3495                    }
3496                  } else {
3497                    goto _L___6;
3498                  }
3499                } else {
3500                  goto _L___6;
3501                }
3502              } else {
3503                goto _L___6;
3504              }
3505            } else {
3506              goto _L___6;
3507            }
3508          } else {
3509            goto _L___6;
3510          }
3511        } else {
3512          goto _L___6;
3513        }
3514      } else {
3515        _L___6: /* CIL Label */ 
3516        if ((int )*(inquiryDataPtr + 16) == 70) {
3517          if ((int )*(inquiryDataPtr + 17) == 77) {
3518            if ((int )*(inquiryDataPtr + 18) == 67) {
3519              if ((int )*(inquiryDataPtr + 21) == 49) {
3520                if ((int )*(inquiryDataPtr + 22) == 48) {
3521                  if ((int )*(inquiryDataPtr + 23) == 49) {
3522                    {
3523                    MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3524                    deviceExtension->Active = 5;
3525                    *(inquiryDataPtr + 25) = (unsigned char)0;
3526                    }
3527                  } else {
3528                    if ((int )*(inquiryDataPtr + 23) == 50) {
3529                      {
3530                      MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3531                      deviceExtension->Active = 5;
3532                      *(inquiryDataPtr + 25) = (unsigned char)0;
3533                      }
3534                    } else {
3535
3536                    }
3537                  }
3538                } else {
3539
3540                }
3541              } else {
3542
3543              }
3544            } else {
3545
3546            }
3547          } else {
3548
3549          }
3550        } else {
3551
3552        }
3553      }
3554    }
3555    {
3556    tmp___14 = memcmp(inquiryDataPtr + 8, "HP      ", 8);
3557    }
3558    if (tmp___14) {
3559
3560    } else {
3561      {
3562      tmp___15 = memcmp(inquiryDataPtr + 16, "C4324/C4325", 11);
3563      }
3564      if (tmp___15) {
3565
3566      } else {
3567        {
3568        MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl));
3569        deviceExtension->Active = 7;
3570        }
3571      }
3572    }
3573    {
3574/*     ExFreePool(inquiryDataPtr); */ /* INLINED */
3575    }
3576  } else {
3577
3578  }
3579  {
3580  keyValue = (unsigned long )deviceExtension->Active;
3581  status = IoOpenDeviceRegistryKey(deviceExtension->TargetPdo, 2, 131078L, & deviceParameterHandle);
3582  }
3583  if (! (status >= 0L)) {
3584    return (0L);
3585  } else {
3586
3587  }
3588  {
3589  status = RtlWriteRegistryValue(1073741824, (WCHAR *)deviceParameterHandle, "M\000a\000p\000T\000y\000p\000e\000",
3590                                 4, & keyValue, sizeof(keyValue));
3591  }
3592  if (! (status >= 0L)) {
3593
3594  } else {
3595
3596  }
3597  {
3598  ZwClose(deviceParameterHandle);
3599  }
3600  return (0L);
3601}
3602}
3603NTSTATUS CdAudioPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3604{ PIO_STACK_LOCATION irpSp ;
3605  NTSTATUS status ;
3606  BOOLEAN setPagable ;
3607  PCD_DEVICE_EXTENSION deviceExtension ;
3608  NTSTATUS tmp ;
3609  NTSTATUS tmp___0 ;
3610
3611  {
3612  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
3613  status = -1073741637L;
3614  if (irpSp->MinorFunction == 0) {
3615    goto switch_2_0;
3616  } else {
3617    if (irpSp->MinorFunction == 22) {
3618      goto switch_2_22;
3619    } else {
3620      {
3621      goto switch_2_default;
3622      if (0) {
3623        switch_2_0: /* CIL Label */ 
3624        {
3625        status = CdAudioStartDevice(DeviceObject, Irp);
3626        Irp->IoStatus.__annonCompField4.Status = status;
3627        myStatus = status;
3628        IofCompleteRequest(Irp, 0);
3629        }
3630        return (status);
3631        switch_2_22: /* CIL Label */ ;
3632        if ((int )irpSp->Parameters.UsageNotification.Type != 1) {
3633          {
3634          tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
3635          }
3636          return (tmp);
3637        } else {
3638
3639        }
3640        {
3641        deviceExtension = DeviceObject->DeviceExtension;
3642        status = KeWaitForSingleObject(& deviceExtension->PagingPathCountEvent, 0,
3643                                       0, 0, (void *)0);
3644        setPagable = 0;
3645        }
3646        if (! irpSp->Parameters.UsageNotification.InPath) {
3647          if (deviceExtension->PagingPathCount == 1UL) {
3648            if (DeviceObject->Flags & 16384UL) {
3649
3650            } else {
3651              DeviceObject->Flags |= 8192UL;
3652              setPagable = 1;
3653            }
3654          } else {
3655
3656          }
3657        } else {
3658
3659        }
3660        {
3661        status = CdAudioForwardIrpSynchronous(DeviceObject, Irp);
3662        }
3663        if (status >= 0L) {
3664          if (irpSp->Parameters.UsageNotification.InPath) {
3665            {
3666            InterlockedIncrement(& deviceExtension->PagingPathCount);
3667            }
3668          } else {
3669            {
3670            InterlockedDecrement(& deviceExtension->PagingPathCount);
3671            }
3672          }
3673          if (irpSp->Parameters.UsageNotification.InPath) {
3674            if (deviceExtension->PagingPathCount == 1UL) {
3675              DeviceObject->Flags &= 4294959103UL;
3676            } else {
3677
3678            }
3679          } else {
3680
3681          }
3682        } else {
3683          if ((int )setPagable == 1) {
3684            DeviceObject->Flags &= 4294959103UL;
3685            setPagable = 0;
3686          } else {
3687
3688          }
3689        }
3690        {
3691        KeSetEvent(& deviceExtension->PagingPathCountEvent, 0, 0);
3692        IofCompleteRequest(Irp, 0);
3693        }
3694        return (status);
3695        goto switch_2_break;
3696        switch_2_default: /* CIL Label */ 
3697        {
3698        tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp);
3699        }
3700        return (tmp___0);
3701      } else {
3702        switch_2_break: /* CIL Label */ ;
3703      }
3704      }
3705    }
3706  }
3707  return (0L);
3708}
3709}
3710NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) 
3711{ ULONG i = __VERIFIER_nondet_long() ;
3712
3713  {
3714  DriverObject->MajorFunction[i] = & CdAudioSendToNextDriver;
3715  DriverObject->MajorFunction[3] = & CdAudioReadWrite;
3716  DriverObject->MajorFunction[4] = & CdAudioReadWrite;
3717  DriverObject->MajorFunction[14] = & CdAudioDeviceControl;
3718  DriverObject->MajorFunction[27] = & CdAudioPnp;
3719  DriverObject->MajorFunction[22] = & CdAudioPower;
3720  (DriverObject->DriverExtension)->AddDevice = & CdAudioAddDevice;
3721  DriverObject->DriverUnload = & CdAudioUnload;
3722  return (0L);
3723}
3724}
3725BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) 
3726{ PINQUIRYDATA inquiryData ;
3727  ULONG i = __VERIFIER_nondet_long() ;
3728  PUCHAR badDriveList[12] ;
3729  SIZE_T tmp ;
3730
3731  {
3732  {
3733  inquiryData = (struct _INQUIRYDATA *)InquiryData;
3734  badDriveList[0] = "CD-ROM DRIVE:80 ";
3735  badDriveList[1] = "CD-ROM DRIVE:82 ";
3736  badDriveList[2] = "CD-ROM DRIVE:83 ";
3737  badDriveList[3] = "CD-ROM DRIVE:84 ";
3738  badDriveList[4] = "CD-ROM DRIVE:841";
3739  badDriveList[5] = "CD-ROM DRIVE:38 ";
3740  badDriveList[6] = "CD-ROM DRIVE 4 M";
3741  badDriveList[7] = "CD-ROM DRIVE:500";
3742  badDriveList[8] = "CD-ROM DRIVE:400";
3743  badDriveList[9] = "CD-ROM DRIVE:401";
3744  badDriveList[10] = "CD-ROM DRIVE:501";
3745  badDriveList[11] = "CD-ROM DRIVE:900";
3746  tmp = RtlCompareMemory(inquiryData->ProductId, badDriveList[i], 16);
3747  }
3748  if (tmp == 16UL) {
3749    return (1);
3750  } else {
3751
3752  }
3753  return (0);
3754}
3755}
3756NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3757{ PCD_DEVICE_EXTENSION deviceExtension ;
3758  NTSTATUS tmp ;
3759
3760  {
3761  deviceExtension = DeviceObject->DeviceExtension;
3762  if (deviceExtension->PlayActive) {
3763    {
3764    Irp->IoStatus.__annonCompField4.Status = -2147483631L;
3765    myStatus = -2147483631L;
3766    IofCompleteRequest(Irp, 0);
3767    }
3768    return (-2147483631L);
3769  } else {
3770
3771  }
3772  {
3773  tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
3774  }
3775  return (tmp);
3776}
3777}
3778NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3779{ PCD_DEVICE_EXTENSION deviceExtension ;
3780  NTSTATUS status ;
3781
3782  {
3783  deviceExtension = DeviceObject->DeviceExtension;
3784  if (deviceExtension->Active == 2) {
3785    goto switch_3_2;
3786  } else {
3787    if (deviceExtension->Active == 3) {
3788      goto switch_3_3;
3789    } else {
3790      if (deviceExtension->Active == 1) {
3791        goto switch_3_1;
3792      } else {
3793        if (deviceExtension->Active == 7) {
3794          goto switch_3_7;
3795        } else {
3796          {
3797          goto switch_3_default;
3798          if (0) {
3799            switch_3_2: /* CIL Label */ 
3800            {
3801            status = CdAudio535DeviceControl(DeviceObject, Irp);
3802            }
3803            goto switch_3_break;
3804            switch_3_3: /* CIL Label */ 
3805            {
3806            status = CdAudio435DeviceControl(DeviceObject, Irp);
3807            }
3808            goto switch_3_break;
3809            switch_3_1: /* CIL Label */ 
3810            {
3811            status = CdAudioAtapiDeviceControl(DeviceObject, Irp);
3812            }
3813            goto switch_3_break;
3814            switch_3_7: /* CIL Label */ 
3815            {
3816            status = CdAudioHPCdrDeviceControl(DeviceObject, Irp);
3817            }
3818            goto switch_3_break;
3819            switch_3_default: /* CIL Label */ 
3820            {
3821            deviceExtension->Active = 0;
3822            status = CdAudioSendToNextDriver(DeviceObject, Irp);
3823            }
3824          } else {
3825            switch_3_break: /* CIL Label */ ;
3826          }
3827          }
3828        }
3829      }
3830    }
3831  }
3832  return (status);
3833}
3834}
3835NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3836{ PCD_DEVICE_EXTENSION deviceExtension ;
3837  NTSTATUS tmp ;
3838
3839  {
3840  deviceExtension = DeviceObject->DeviceExtension;
3841  if (s == NP) {
3842    s = SKIP1;
3843  } else {
3844    {
3845    errorFn();
3846    }
3847  }
3848  {
3849  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
3850  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
3851  tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
3852  }
3853  return (tmp);
3854}
3855}
3856BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) 
3857{ PCD_DEVICE_EXTENSION deviceExtension ;
3858  PIRP irp_CdAudioIsPlayActive = __VERIFIER_nondet_pointer() ;
3859  IO_STATUS_BLOCK ioStatus ;
3860  KEVENT event ;
3861  NTSTATUS status = __VERIFIER_nondet_long() ;
3862  PSUB_Q_CURRENT_POSITION currentBuffer ;
3863  BOOLEAN returnValue ;
3864  PVOID tmp ;
3865
3866  {
3867  deviceExtension = DeviceObject->DeviceExtension;
3868  if (! deviceExtension->PlayActive) {
3869    return (0);
3870  } else {
3871
3872  }
3873  {
3874  tmp = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ), 541156419UL);
3875  currentBuffer = tmp;
3876  }
3877  if ((unsigned int )currentBuffer == (unsigned int )((void *)0)) {
3878    return (0);
3879  } else {
3880
3881  }
3882  {
3883  ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Format = 1;
3884  ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Track = 0;
3885/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
3886  }
3887  if ((unsigned int )irp_CdAudioIsPlayActive == (unsigned int )((void *)0)) {
3888    {
3889/*     ExFreePool(currentBuffer); */ /* INLINED */
3890    }
3891    return (0);
3892  } else {
3893
3894  }
3895  if (status == 259L) {
3896    {
3897    KeWaitForSingleObject(& event, 5, 0, 0, (void *)0);
3898    status = ioStatus.__annonCompField4.Status;
3899    }
3900  } else {
3901
3902  }
3903  if (! (status >= 0L)) {
3904    {
3905/*     ExFreePool(currentBuffer); */ /* INLINED */
3906    }
3907    return (0);
3908  } else {
3909
3910  }
3911  if ((int )currentBuffer->Header.AudioStatus == 17) {
3912    returnValue = 1;
3913  } else {
3914    returnValue = 0;
3915    deviceExtension->PlayActive = 0;
3916  }
3917  {
3918/*   ExFreePool(currentBuffer); */ /* INLINED */
3919  }
3920  return (returnValue);
3921}
3922}
3923NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3924{ PIO_STACK_LOCATION currentIrpStack ;
3925  PCD_DEVICE_EXTENSION deviceExtension ;
3926  PCDROM_TOC cdaudioDataOut ;
3927  SCSI_PASS_THROUGH srb ;
3928  PNEC_CDB cdb ;
3929  NTSTATUS status ;
3930  ULONG i ;
3931  ULONG bytesTransfered ;
3932  PUCHAR Toc ;
3933  ULONG retryCount ;
3934  ULONG address ;
3935  LARGE_INTEGER delay ;
3936  BOOLEAN tmp ;
3937  PVOID tmp___0 ;
3938  BOOLEAN tmp___1 ;
3939  PVOID tmp___2 ;
3940  ULONG tracksToReturn ;
3941  ULONG tracksOnCd ;
3942  ULONG tracksInBuffer ;
3943  ULONG dataLength ;
3944  NTSTATUS tmp___3 ;
3945  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
3946  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
3947  PSUB_Q_CURRENT_POSITION userPtr ;
3948  PUCHAR SubQPtr ;
3949  PVOID tmp___4 ;
3950  ULONG tmp___5 ;
3951  NTSTATUS tmp___6 ;
3952
3953  {
3954  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
3955  deviceExtension = DeviceObject->DeviceExtension;
3956  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
3957  cdb = (union _NEC_CDB *)(srb.Cdb);
3958  retryCount = 0;
3959  NECRestart: 
3960  {
3961  memset(cdb, 0, 12);
3962  }
3963  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
3964    goto switch_4_exp_0;
3965  } else {
3966    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
3967      goto switch_4_exp_1;
3968    } else {
3969      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
3970        goto switch_4_exp_2;
3971      } else {
3972        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
3973          goto switch_4_exp_3;
3974        } else {
3975          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
3976            goto switch_4_exp_4;
3977          } else {
3978            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
3979              goto switch_4_exp_5;
3980            } else {
3981              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
3982                goto switch_4_exp_6;
3983              } else {
3984                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
3985                  goto switch_4_exp_7;
3986                } else {
3987                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
3988                    goto switch_4_exp_8;
3989                  } else {
3990                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
3991                      goto switch_4_exp_9;
3992                    } else {
3993                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
3994                        goto switch_4_exp_10;
3995                      } else {
3996                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
3997                          goto switch_4_exp_11;
3998                        } else {
3999                          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
4000                            goto switch_4_exp_12;
4001                          } else {
4002                            {
4003                            goto switch_4_default;
4004                            if (0) {
4005                              switch_4_exp_0: /* CIL Label */ ;
4006                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) {
4007                                status = -1073741789L;
4008                                Irp->IoStatus.Information = 0;
4009                                goto switch_4_break;
4010                              } else {
4011
4012                              }
4013                              {
4014                              tmp = CdAudioIsPlayActive(DeviceObject);
4015                              }
4016                              if (tmp) {
4017                                Irp->IoStatus.Information = 0;
4018                                status = -2147483631L;
4019                                goto switch_4_break;
4020                              } else {
4021
4022                              }
4023                              {
4024                              tmp___0 = ExAllocatePoolWithTag(4, 1022, 541156419UL);
4025                              Toc = (UCHAR *)tmp___0;
4026                              }
4027                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4028                                status = -1073741670L;
4029                                Irp->IoStatus.Information = 0;
4030                                goto SetStatusAndReturn;
4031                              } else {
4032
4033                              }
4034                              {
4035                              memset(Toc, 0, 1022);
4036                              srb.CdbLength = 10;
4037                              cdb->NEC_READ_TOC.OperationCode = 222;
4038                              cdb->NEC_READ_TOC.Type = 3;
4039                              cdb->NEC_READ_TOC.TrackNumber = 176;
4040                              srb.TimeOutValue = 10;
4041                              status = SendSrbSynchronous(deviceExtension, & srb,
4042                                                          Toc, 1022);
4043                              }
4044                              if (! (status >= 0L)) {
4045                                if (status != -1073741764L) {
4046                                  {
4047/*                                   ExFreePool(Toc); */ /* INLINED */
4048                                  Irp->IoStatus.Information = 0;
4049                                  }
4050                                  goto SetStatusAndReturn;
4051                                } else {
4052                                  status = 0L;
4053                                }
4054                              } else {
4055                                status = 0L;
4056                              }
4057                              {
4058                              bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]);
4059                              Irp->IoStatus.Information = bytesTransfered;
4060                              memset(cdaudioDataOut, 0, bytesTransfered);
4061                              cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8);
4062                              cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL);
4063                              }
4064                              if (*((ULONG *)(Toc + 14)) == 0UL) {
4065                                {
4066/*                                 ExFreePool(Toc); */ /* INLINED */
4067                                }
4068                                goto switch_4_break;
4069                              } else {
4070
4071                              }
4072                              {
4073                              cdaudioDataOut->FirstTrack = 1;
4074                              cdaudioDataOut->LastTrack = 2;
4075                              cdaudioDataOut->TrackData[0].Reserved = 0;
4076                              cdaudioDataOut->TrackData[0].Control = (((int )*(Toc + 2) & 15) << 4) | ((int )*(Toc + 2) >> 4);
4077                              cdaudioDataOut->TrackData[0].TrackNumber = 1;
4078                              cdaudioDataOut->TrackData[0].Reserved1 = 0;
4079                              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));
4080                              cdaudioDataOut->TrackData[0].Address[0] = (unsigned char )(address >> 24);
4081                              cdaudioDataOut->TrackData[0].Address[1] = (unsigned char )(address >> 16);
4082                              cdaudioDataOut->TrackData[0].Address[2] = (unsigned char )(address >> 8);
4083                              cdaudioDataOut->TrackData[0].Address[3] = (unsigned char )address;
4084/*                               ExFreePool(Toc); */ /* INLINED */
4085                              }
4086                              goto switch_4_break;
4087                              switch_4_exp_1: /* CIL Label */ 
4088                              {
4089                              tmp___1 = CdAudioIsPlayActive(DeviceObject);
4090                              }
4091                              if (tmp___1) {
4092                                status = -2147483631L;
4093                                Irp->IoStatus.Information = 0;
4094                                goto switch_4_break;
4095                              } else {
4096
4097                              }
4098                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
4099                                status = -1073741789L;
4100                                Irp->IoStatus.Information = 0;
4101                                goto switch_4_break;
4102                              } else {
4103
4104                              }
4105                              {
4106                              tmp___2 = ExAllocatePoolWithTag(4, 1022, 541156419UL);
4107                              Toc = (UCHAR *)tmp___2;
4108                              }
4109                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4110                                status = -1073741670L;
4111                                Irp->IoStatus.Information = 0;
4112                                goto SetStatusAndReturn;
4113                              } else {
4114
4115                              }
4116                              {
4117                              memset(Toc, 0, 1022);
4118                              srb.CdbLength = 10;
4119                              cdb->NEC_READ_TOC.OperationCode = 222;
4120                              cdb->NEC_READ_TOC.Type = 3;
4121                              srb.TimeOutValue = 10;
4122                              status = SendSrbSynchronous(deviceExtension, & srb,
4123                                                          Toc, 1022);
4124                              }
4125                              if (! (status >= 0L)) {
4126                                if (status != -1073741764L) {
4127                                  if (status != -1073741764L) {
4128                                    {
4129                                    Irp->IoStatus.Information = 0;
4130/*                                     ExFreePool(Toc); */ /* INLINED */
4131                                    }
4132                                    goto SetStatusAndReturn;
4133                                  } else {
4134
4135                                  }
4136                                } else {
4137                                  status = 0L;
4138                                }
4139                              } else {
4140                                status = 0L;
4141                              }
4142                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
4143                                bytesTransfered = sizeof(CDROM_TOC );
4144                              } else {
4145                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
4146                              }
4147                              cdaudioDataOut->FirstTrack = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15);
4148                              cdaudioDataOut->LastTrack = (((int )*(Toc + 19) & 240) >> 4) * 10 + ((int )*(Toc + 19) & 15);
4149                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
4150                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
4151                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
4152                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
4153                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
4154                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
4155                              if (tracksInBuffer < tracksOnCd) {
4156                                tracksToReturn = tracksInBuffer;
4157                              } else {
4158                                tracksToReturn = tracksOnCd;
4159                              }
4160                              i = 0;
4161                              {
4162                              while (1) {
4163                                while_5_continue: /* CIL Label */ ;
4164                                if (i < tracksToReturn) {
4165
4166                                } else {
4167                                  goto while_5_break;
4168                                }
4169                                cdaudioDataOut->TrackData[i].Reserved = 0;
4170                                cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 10UL + 32UL)) & 15) << 4) | ((int )*(Toc + (i * 10UL + 32UL)) >> 4);
4171                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
4172                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
4173                                cdaudioDataOut->TrackData[i].Address[0] = 0;
4174                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 10UL + 39UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 39UL)) & 15);
4175                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 10UL + 40UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 40UL)) & 15);
4176                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 10UL + 41UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 41UL)) & 15);
4177                                i += 1UL;
4178                              }
4179                              while_5_break: /* CIL Label */ ;
4180                              }
4181                              if (tracksInBuffer > tracksOnCd) {
4182                                cdaudioDataOut->TrackData[i].Reserved = 0;
4183                                cdaudioDataOut->TrackData[i].Control = 16;
4184                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
4185                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
4186                                cdaudioDataOut->TrackData[i].Address[0] = 0;
4187                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 29) & 240) >> 4) * 10 + ((int )*(Toc + 29) & 15);
4188                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 30) & 240) >> 4) * 10 + ((int )*(Toc + 30) & 15);
4189                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 31) & 240) >> 4) * 10 + ((int )*(Toc + 31) & 15);
4190                                i += 1UL;
4191                              } else {
4192
4193                              }
4194                              {
4195                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
4196/*                               ExFreePool(Toc); */ /* INLINED */
4197                              }
4198                              goto switch_4_break;
4199                              switch_4_exp_2: /* CIL Label */ 
4200                              {
4201                              deviceExtension->PlayActive = 0;
4202                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
4203                              }
4204                              return (tmp___3);
4205                              goto switch_4_break;
4206                              switch_4_exp_3: /* CIL Label */ 
4207                              inputBuffer = Irp->AssociatedIrp.SystemBuffer;
4208                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
4209                                status = -1073741820L;
4210                                Irp->IoStatus.Information = 0;
4211                                goto switch_4_break;
4212                              } else {
4213
4214                              }
4215                              {
4216                              srb.CdbLength = 10;
4217                              srb.TimeOutValue = 10;
4218                              cdb->NEC_PLAY_AUDIO.OperationCode = 216;
4219                              cdb->NEC_PLAY_AUDIO.PlayMode = 1;
4220                              cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
4221                              cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
4222                              cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
4223                              cdb->NEC_PLAY_AUDIO.Control = 64;
4224                              status = SendSrbSynchronous(deviceExtension, & srb,
4225                                                          (void *)0, 0);
4226                              }
4227                              if (status >= 0L) {
4228                                {
4229                                deviceExtension->PlayActive = 1;
4230                                memset(cdb, 0, 12);
4231                                cdb->NEC_PLAY_AUDIO.OperationCode = 217;
4232                                cdb->NEC_PLAY_AUDIO.PlayMode = 3;
4233                                cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
4234                                cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
4235                                cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
4236                                cdb->NEC_PLAY_AUDIO.Control = 64;
4237                                status = SendSrbSynchronous(deviceExtension, & srb,
4238                                                            (void *)0, 0);
4239                                }
4240                              } else {
4241
4242                              }
4243                              goto switch_4_break;
4244                              switch_4_exp_4: /* CIL Label */ 
4245                              inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
4246                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
4247                                status = -1073741820L;
4248                                Irp->IoStatus.Information = 0;
4249                                goto switch_4_break;
4250                              } else {
4251
4252                              }
4253                              {
4254                              srb.CdbLength = 10;
4255                              srb.TimeOutValue = 10;
4256                              cdb->NEC_SEEK_AUDIO.OperationCode = 216;
4257                              cdb->NEC_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
4258                              cdb->NEC_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
4259                              cdb->NEC_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
4260                              cdb->NEC_SEEK_AUDIO.Control = 64;
4261                              status = SendSrbSynchronous(deviceExtension, & srb,
4262                                                          (void *)0, 0);
4263                              }
4264                              goto switch_4_break;
4265                              switch_4_exp_5: /* CIL Label */ 
4266                              {
4267                              deviceExtension->PlayActive = 0;
4268                              srb.CdbLength = 10;
4269                              srb.TimeOutValue = 10;
4270                              cdb->NEC_PAUSE_AUDIO.OperationCode = 218;
4271                              status = SendSrbSynchronous(deviceExtension, & srb,
4272                                                          (void *)0, 0);
4273                              }
4274                              goto switch_4_break;
4275                              switch_4_exp_6: /* CIL Label */ 
4276                              {
4277                              srb.CdbLength = 10;
4278                              srb.TimeOutValue = 10;
4279                              cdb->NEC_PLAY_AUDIO.OperationCode = 217;
4280                              cdb->NEC_PLAY_AUDIO.PlayMode = 3;
4281                              cdb->NEC_PLAY_AUDIO.Control = 192;
4282                              status = SendSrbSynchronous(deviceExtension, & srb,
4283                                                          (void *)0, 0);
4284                              }
4285                              goto switch_4_break;
4286                              switch_4_exp_7: /* CIL Label */ 
4287                              {
4288                              userPtr = Irp->AssociatedIrp.SystemBuffer;
4289                              tmp___4 = ExAllocatePoolWithTag(4, 10, 541156419UL);
4290                              SubQPtr = tmp___4;
4291                              }
4292                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
4293                                status = -1073741789L;
4294                                Irp->IoStatus.Information = 0;
4295                                if (SubQPtr) {
4296                                  {
4297/*                                   ExFreePool(SubQPtr); */ /* INLINED */
4298                                  }
4299                                } else {
4300
4301                                }
4302                                goto switch_4_break;
4303                              } else {
4304
4305                              }
4306                              if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
4307                                status = -1073741670L;
4308                                Irp->IoStatus.Information = 0;
4309                                goto SetStatusAndReturn;
4310                              } else {
4311
4312                              }
4313                              {
4314                              memset(SubQPtr, 0, 10);
4315                              }
4316                              if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
4317                                {
4318/*                                 ExFreePool(SubQPtr); */ /* INLINED */
4319                                status = -1073741823L;
4320                                Irp->IoStatus.Information = 0;
4321                                }
4322                                goto SetStatusAndReturn;
4323                              } else {
4324
4325                              }
4326                              NECSeek: 
4327                              {
4328                              srb.CdbLength = 10;
4329                              srb.TimeOutValue = 10;
4330                              cdb->NEC_READ_Q_CHANNEL.OperationCode = 221;
4331                              cdb->NEC_READ_Q_CHANNEL.TransferSize = 10;
4332                              status = SendSrbSynchronous(deviceExtension, & srb,
4333                                                          SubQPtr, 10);
4334                              }
4335                              if (status >= 0L) {
4336                                goto _L;
4337                              } else {
4338                                if (status == -1073741764L) {
4339                                  _L: /* CIL Label */ 
4340                                  userPtr->Header.Reserved = 0;
4341                                  if ((int )*(SubQPtr + 0) == 0) {
4342                                    userPtr->Header.AudioStatus = 17;
4343                                  } else {
4344                                    if ((int )*(SubQPtr + 0) == 1) {
4345                                      userPtr->Header.AudioStatus = 18;
4346                                      deviceExtension->PlayActive = 0;
4347                                    } else {
4348                                      if ((int )*(SubQPtr + 0) == 2) {
4349                                        userPtr->Header.AudioStatus = 18;
4350                                        deviceExtension->PlayActive = 0;
4351                                      } else {
4352                                        if ((int )*(SubQPtr + 0) == 3) {
4353                                          userPtr->Header.AudioStatus = 19;
4354                                          deviceExtension->PlayActive = 0;
4355                                        } else {
4356                                          deviceExtension->PlayActive = 0;
4357                                        }
4358                                      }
4359                                    }
4360                                  }
4361                                  userPtr->Header.DataLength[0] = 0;
4362                                  userPtr->Header.DataLength[0] = 12;
4363                                  userPtr->FormatCode = 1;
4364                                  userPtr->Control = (int )*(SubQPtr + 1) & 15;
4365                                  userPtr->ADR = 0;
4366                                  userPtr->TrackNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15);
4367                                  userPtr->IndexNumber = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15);
4368                                  userPtr->AbsoluteAddress[0] = 0;
4369                                  userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
4370                                  userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15);
4371                                  userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr + 9) & 15);
4372                                  userPtr->TrackRelativeAddress[0] = 0;
4373                                  userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15);
4374                                  userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15);
4375                                  userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
4376                                  Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
4377                                  if ((int )userPtr->TrackNumber > 100) {
4378                                    {
4379                                    delay.QuadPart = -5000000;
4380                                    KeDelayExecutionThread(0, 0, & delay);
4381                                    tmp___5 = retryCount;
4382                                    retryCount += 1UL;
4383                                    }
4384                                    if (tmp___5 < 4UL) {
4385                                      goto NECSeek;
4386                                    } else {
4387                                      Irp->IoStatus.Information = 0;
4388                                      status = -1073741434L;
4389                                    }
4390                                  } else {
4391                                    status = 0L;
4392                                  }
4393                                } else {
4394                                  {
4395                                  memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4396                                  Irp->IoStatus.Information = 0;
4397                                  }
4398                                }
4399                              }
4400                              {
4401/*                               ExFreePool(SubQPtr); */ /* INLINED */
4402                              }
4403                              goto switch_4_break;
4404                              switch_4_exp_8: /* CIL Label */ 
4405                              {
4406                              deviceExtension->PlayActive = 0;
4407                              srb.CdbLength = 10;
4408                              srb.TimeOutValue = 10;
4409                              cdb->NEC_EJECT.OperationCode = 220;
4410                              status = SendSrbSynchronous(deviceExtension, & srb,
4411                                                          (void *)0, 0);
4412                              Irp->IoStatus.Information = 0;
4413                              }
4414                              goto switch_4_break;
4415                              switch_4_exp_9: /* CIL Label */ ;
4416                              switch_4_exp_10: /* CIL Label */ ;
4417                              switch_4_exp_11: /* CIL Label */ 
4418                              Irp->IoStatus.Information = 0;
4419                              status = -1073741808L;
4420                              goto switch_4_break;
4421                              switch_4_exp_12: /* CIL Label */ 
4422                              {
4423                              CdAudioIsPlayActive(DeviceObject);
4424                              }
4425                              switch_4_default: /* CIL Label */ 
4426                              {
4427                              tmp___6 = CdAudioSendToNextDriver(DeviceObject, Irp);
4428                              }
4429                              return (tmp___6);
4430                              goto switch_4_break;
4431                            } else {
4432                              switch_4_break: /* CIL Label */ ;
4433                            }
4434                            }
4435                          }
4436                        }
4437                      }
4438                    }
4439                  }
4440                }
4441              }
4442            }
4443          }
4444        }
4445      }
4446    }
4447  }
4448  SetStatusAndReturn: 
4449  if (status == -2147483626L) {
4450    if ((int )currentIrpStack->Flags & 2) {
4451      status = -1073741435L;
4452      goto NECRestart;
4453    } else {
4454
4455    }
4456    {
4457/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
4458    Irp->IoStatus.Information = 0;
4459    }
4460  } else {
4461
4462  }
4463  {
4464  Irp->IoStatus.__annonCompField4.Status = status;
4465  myStatus = status;
4466  IofCompleteRequest(Irp, 0);
4467  }
4468  return (status);
4469}
4470}
4471NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
4472{ PIO_STACK_LOCATION currentIrpStack ;
4473  PCD_DEVICE_EXTENSION deviceExtension ;
4474  PCDROM_TOC cdaudioDataOut ;
4475  SCSI_PASS_THROUGH srb ;
4476  PPNR_CDB cdb ;
4477  PCDB scsiCdb ;
4478  NTSTATUS status ;
4479  ULONG i ;
4480  ULONG retry ;
4481  PUCHAR Toc ;
4482  BOOLEAN tmp ;
4483  PVOID tmp___0 ;
4484  ULONG tracksToReturn ;
4485  ULONG tracksOnCd ;
4486  ULONG tracksInBuffer ;
4487  ULONG dataLength ;
4488  NTSTATUS tmp___1 ;
4489  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
4490  ULONG tmp___2 ;
4491  ULONG tmp___3 ;
4492  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
4493  ULONG tmp___4 ;
4494  PSUB_Q_CURRENT_POSITION userPtr ;
4495  PUCHAR SubQPtr ;
4496  PVOID tmp___5 ;
4497  ULONG tmp___6 ;
4498  ULONG tmp___7 ;
4499  NTSTATUS tmp___8 ;
4500
4501  {
4502  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
4503  deviceExtension = DeviceObject->DeviceExtension;
4504  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
4505  cdb = (union _PIONEER_CDB *)(srb.Cdb);
4506  scsiCdb = (union _CDB *)(srb.Cdb);
4507  PioneerRestart: 
4508  {
4509  memset(cdb, 0, 12);
4510  }
4511  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
4512    goto switch_6_exp_13;
4513  } else {
4514    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
4515      goto switch_6_exp_14;
4516    } else {
4517      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
4518        goto switch_6_exp_15;
4519      } else {
4520        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
4521          goto switch_6_exp_16;
4522        } else {
4523          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
4524            goto switch_6_exp_17;
4525          } else {
4526            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
4527              goto switch_6_exp_18;
4528            } else {
4529              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
4530                goto switch_6_exp_19;
4531              } else {
4532                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
4533                  goto switch_6_exp_20;
4534                } else {
4535                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
4536                    goto switch_6_exp_21;
4537                  } else {
4538                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
4539                      goto switch_6_exp_22;
4540                    } else {
4541                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
4542                        goto switch_6_exp_23;
4543                      } else {
4544                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
4545                          goto switch_6_exp_24;
4546                        } else {
4547                          {
4548                          goto switch_6_default;
4549                          if (0) {
4550                            switch_6_exp_13: /* CIL Label */ ;
4551                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
4552                              status = -1073741789L;
4553                              Irp->IoStatus.Information = 0;
4554                              goto switch_6_break;
4555                            } else {
4556
4557                            }
4558                            {
4559                            tmp = CdAudioIsPlayActive(DeviceObject);
4560                            }
4561                            if (tmp) {
4562                              status = -2147483631L;
4563                              Irp->IoStatus.Information = 0;
4564                              goto switch_6_break;
4565                            } else {
4566
4567                            }
4568                            {
4569                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
4570                                                            541156419UL);
4571                            Toc = (UCHAR *)tmp___0;
4572                            }
4573                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4574                              status = -1073741670L;
4575                              Irp->IoStatus.Information = 0;
4576                              goto SetStatusAndReturn;
4577                            } else {
4578
4579                            }
4580                            {
4581                            memset(Toc, 0, sizeof(CDROM_TOC ));
4582                            }
4583                            if ((int )deviceExtension->Active == 9) {
4584                              cdb->PNR_START_STOP.Immediate = 1;
4585                            } else {
4586                              cdb->PNR_START_STOP.Immediate = 0;
4587                            }
4588                            {
4589                            cdb->PNR_START_STOP.OperationCode = 27;
4590                            cdb->PNR_START_STOP.Start = 1;
4591                            srb.CdbLength = 6;
4592                            srb.TimeOutValue = 10;
4593                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4594                                                        0);
4595                            }
4596                            if (! (status >= 0L)) {
4597                              {
4598/*                               ExFreePool(Toc); */ /* INLINED */
4599                              Irp->IoStatus.Information = 0;
4600                              }
4601                              goto SetStatusAndReturn;
4602                            } else {
4603
4604                            }
4605                            {
4606                            memset(cdb, 0, 12);
4607                            srb.CdbLength = 10;
4608                            cdb->PNR_READ_TOC.OperationCode = 193;
4609                            cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4610                            cdb->PNR_READ_TOC.Type = 0;
4611                            srb.TimeOutValue = 10;
4612                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
4613                                                        4);
4614                            }
4615                            if (! (status >= 0L)) {
4616                              {
4617/*                               ExFreePool(Toc); */ /* INLINED */
4618                              Irp->IoStatus.Information = 0;
4619                              }
4620                              goto SetStatusAndReturn;
4621                            } else {
4622
4623                            }
4624                            cdaudioDataOut->FirstTrack = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15);
4625                            cdaudioDataOut->LastTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4626                            tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
4627                            dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
4628                            cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
4629                            cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
4630                            tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
4631                            tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
4632                            if (tracksInBuffer < tracksOnCd) {
4633                              tracksToReturn = tracksInBuffer;
4634                            } else {
4635                              tracksToReturn = tracksOnCd;
4636                            }
4637                            i = 0;
4638                            {
4639                            while (1) {
4640                              while_7_continue: /* CIL Label */ ;
4641                              if (i < tracksToReturn) {
4642
4643                              } else {
4644                                goto while_7_break;
4645                              }
4646                              {
4647                              memset(cdb, 0, 12);
4648                              cdb->PNR_READ_TOC.OperationCode = 193;
4649                              cdb->PNR_READ_TOC.TrackNumber = (unsigned char )(((i + (ULONG )cdaudioDataOut->FirstTrack) / 10UL << 4) + (i + (ULONG )cdaudioDataOut->FirstTrack) % 10UL);
4650                              cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4651                              cdb->PNR_READ_TOC.Type = 2;
4652                              srb.TimeOutValue = 10;
4653                              status = SendSrbSynchronous(deviceExtension, & srb,
4654                                                          Toc, 4);
4655                              }
4656                              if (! (status >= 0L)) {
4657                                {
4658/*                                 ExFreePool(Toc); */ /* INLINED */
4659                                Irp->IoStatus.Information = 0;
4660                                }
4661                                goto SetStatusAndReturn;
4662                              } else {
4663
4664                              }
4665                              cdaudioDataOut->TrackData[i].Reserved = 0;
4666                              cdaudioDataOut->TrackData[i].Control = *(Toc + 0);
4667                              cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
4668                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
4669                              cdaudioDataOut->TrackData[i].Address[0] = 0;
4670                              cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4671                              cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
4672                              cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
4673                              i += 1UL;
4674                            }
4675                            while_7_break: /* CIL Label */ ;
4676                            }
4677                            if (tracksInBuffer > tracksOnCd) {
4678                              {
4679                              memset(cdb, 0, 12);
4680                              cdb->PNR_READ_TOC.OperationCode = 193;
4681                              cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4682                              cdb->PNR_READ_TOC.Type = 1;
4683                              srb.TimeOutValue = 10;
4684                              status = SendSrbSynchronous(deviceExtension, & srb,
4685                                                          Toc, 4);
4686                              }
4687                              if (! (status >= 0L)) {
4688                                {
4689/*                                 ExFreePool(Toc); */ /* INLINED */
4690                                Irp->IoStatus.Information = 0;
4691                                }
4692                                goto SetStatusAndReturn;
4693                              } else {
4694
4695                              }
4696                              cdaudioDataOut->TrackData[i].Reserved = 0;
4697                              cdaudioDataOut->TrackData[i].Control = 16;
4698                              cdaudioDataOut->TrackData[i].TrackNumber = 170;
4699                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
4700                              cdaudioDataOut->TrackData[i].Address[0] = 0;
4701                              cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15);
4702                              cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4703                              cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
4704                              i += 1UL;
4705                            } else {
4706
4707                            }
4708                            {
4709                            Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
4710/*                             ExFreePool(Toc); */ /* INLINED */
4711                            }
4712                            goto switch_6_break;
4713                            switch_6_exp_14: /* CIL Label */ 
4714                            {
4715                            deviceExtension->PlayActive = 0;
4716                            tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp);
4717                            }
4718                            return (tmp___1);
4719                            goto switch_6_break;
4720                            switch_6_exp_15: /* CIL Label */ 
4721                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
4722                            Irp->IoStatus.Information = 0;
4723                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
4724                              status = -1073741820L;
4725                              goto switch_6_break;
4726                            } else {
4727
4728                            }
4729                            retry = 5;
4730                            {
4731                            while (1) {
4732                              while_8_continue: /* CIL Label */ ;
4733                              {
4734                              srb.CdbLength = 10;
4735                              srb.TimeOutValue = 10;
4736                              cdb->PNR_SEEK_AUDIO.OperationCode = 200;
4737                              cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
4738                              cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
4739                              cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
4740                              cdb->PNR_SEEK_AUDIO.Type = 1;
4741                              status = SendSrbSynchronous(deviceExtension, & srb,
4742                                                          (void *)0, 0);
4743                              }
4744                              if (! (status >= 0L)) {
4745                                tmp___2 = retry;
4746                                retry -= 1UL;
4747                                if (tmp___2 > 0UL) {
4748
4749                                } else {
4750                                  goto while_8_break;
4751                                }
4752                              } else {
4753                                goto while_8_break;
4754                              }
4755                            }
4756                            while_8_break: /* CIL Label */ ;
4757                            }
4758                            if (status >= 0L) {
4759                              {
4760                              memset(cdb, 0, 12);
4761                              retry = 5;
4762                              }
4763                              {
4764                              while (1) {
4765                                while_9_continue: /* CIL Label */ ;
4766                                {
4767                                srb.CdbLength = 10;
4768                                srb.TimeOutValue = 10;
4769                                cdb->PNR_PLAY_AUDIO.OperationCode = 201;
4770                                cdb->PNR_PLAY_AUDIO.StopAddr = 1;
4771                                cdb->PNR_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
4772                                cdb->PNR_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
4773                                cdb->PNR_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
4774                                cdb->PNR_PLAY_AUDIO.Type = 1;
4775                                status = SendSrbSynchronous(deviceExtension, & srb,
4776                                                            (void *)0, 0);
4777                                }
4778                                if (! (status >= 0L)) {
4779                                  tmp___3 = retry;
4780                                  retry -= 1UL;
4781                                  if (tmp___3 > 0UL) {
4782
4783                                  } else {
4784                                    goto while_9_break;
4785                                  }
4786                                } else {
4787                                  goto while_9_break;
4788                                }
4789                              }
4790                              while_9_break: /* CIL Label */ ;
4791                              }
4792                              if (status >= 0L) {
4793                                deviceExtension->PlayActive = 1;
4794                              } else {
4795
4796                              }
4797                            } else {
4798
4799                            }
4800                            goto switch_6_break;
4801                            switch_6_exp_16: /* CIL Label */ 
4802                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
4803                            Irp->IoStatus.Information = 0;
4804                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
4805                              status = -1073741820L;
4806                              goto switch_6_break;
4807                            } else {
4808
4809                            }
4810                            retry = 5;
4811                            {
4812                            while (1) {
4813                              while_10_continue: /* CIL Label */ ;
4814                              {
4815                              srb.CdbLength = 10;
4816                              srb.TimeOutValue = 10;
4817                              cdb->PNR_SEEK_AUDIO.OperationCode = 200;
4818                              cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
4819                              cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
4820                              cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
4821                              cdb->PNR_SEEK_AUDIO.Type = 1;
4822                              status = SendSrbSynchronous(deviceExtension, & srb,
4823                                                          (void *)0, 0);
4824                              }
4825                              if (! (status >= 0L)) {
4826                                tmp___4 = retry;
4827                                retry -= 1UL;
4828                                if (tmp___4 > 0UL) {
4829
4830                                } else {
4831                                  goto while_10_break;
4832                                }
4833                              } else {
4834                                goto while_10_break;
4835                              }
4836                            }
4837                            while_10_break: /* CIL Label */ ;
4838                            }
4839                            goto switch_6_break;
4840                            switch_6_exp_17: /* CIL Label */ 
4841                            {
4842                            Irp->IoStatus.Information = 0;
4843                            deviceExtension->PlayActive = 0;
4844                            srb.CdbLength = 10;
4845                            srb.TimeOutValue = 10;
4846                            cdb->PNR_PAUSE_AUDIO.OperationCode = 202;
4847                            cdb->PNR_PAUSE_AUDIO.Pause = 1;
4848                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4849                                                        0);
4850                            }
4851                            goto switch_6_break;
4852                            switch_6_exp_18: /* CIL Label */ 
4853                            {
4854                            Irp->IoStatus.Information = 0;
4855                            srb.CdbLength = 10;
4856                            srb.TimeOutValue = 10;
4857                            cdb->PNR_PAUSE_AUDIO.OperationCode = 202;
4858                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4859                                                        0);
4860                            }
4861                            goto switch_6_break;
4862                            switch_6_exp_19: /* CIL Label */ 
4863                            {
4864                            userPtr = Irp->AssociatedIrp.SystemBuffer;
4865                            tmp___5 = ExAllocatePoolWithTag(4, 9, 541156419UL);
4866                            SubQPtr = tmp___5;
4867                            }
4868                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
4869                              status = -1073741789L;
4870                              Irp->IoStatus.Information = 0;
4871                              if (SubQPtr) {
4872                                {
4873/*                                 ExFreePool(SubQPtr); */ /* INLINED */
4874                                }
4875                              } else {
4876
4877                              }
4878                              goto switch_6_break;
4879                            } else {
4880
4881                            }
4882                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
4883                              {
4884                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4885                              status = -1073741670L;
4886                              Irp->IoStatus.Information = 0;
4887                              }
4888                              goto SetStatusAndReturn;
4889                            } else {
4890
4891                            }
4892                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
4893                              {
4894/*                               ExFreePool(SubQPtr); */ /* INLINED */
4895                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4896                              Irp->IoStatus.Information = 0;
4897                              status = -1073741808L;
4898                              }
4899                              goto SetStatusAndReturn;
4900                            } else {
4901
4902                            }
4903                            retry = 5;
4904                            {
4905                            while (1) {
4906                              while_11_continue: /* CIL Label */ ;
4907                              {
4908                              srb.CdbLength = 10;
4909                              srb.TimeOutValue = 10;
4910                              cdb->PNR_AUDIO_STATUS.OperationCode = 204;
4911                              cdb->PNR_AUDIO_STATUS.AssignedLength = 6;
4912                              status = SendSrbSynchronous(deviceExtension, & srb,
4913                                                          SubQPtr, 6);
4914                              }
4915                              if (! (status >= 0L)) {
4916                                tmp___6 = retry;
4917                                retry -= 1UL;
4918                                if (tmp___6 > 0UL) {
4919                                  if (status != -1073741661L) {
4920
4921                                  } else {
4922                                    goto while_11_break;
4923                                  }
4924                                } else {
4925                                  goto while_11_break;
4926                                }
4927                              } else {
4928                                goto while_11_break;
4929                              }
4930                            }
4931                            while_11_break: /* CIL Label */ ;
4932                            }
4933                            if (status >= 0L) {
4934                              userPtr->Header.Reserved = 0;
4935                              if ((int )*(SubQPtr + 0) == 0) {
4936                                userPtr->Header.AudioStatus = 17;
4937                              } else {
4938                                if ((int )*(SubQPtr + 0) == 1) {
4939                                  deviceExtension->PlayActive = 0;
4940                                  userPtr->Header.AudioStatus = 18;
4941                                } else {
4942                                  if ((int )*(SubQPtr + 0) == 2) {
4943                                    deviceExtension->PlayActive = 0;
4944                                    userPtr->Header.AudioStatus = 18;
4945                                  } else {
4946                                    if ((int )*(SubQPtr + 0) == 3) {
4947                                      userPtr->Header.AudioStatus = 19;
4948                                      deviceExtension->PlayActive = 0;
4949                                    } else {
4950                                      deviceExtension->PlayActive = 0;
4951                                    }
4952                                  }
4953                                }
4954                              }
4955                            } else {
4956                              {
4957/*                               ExFreePool(SubQPtr); */ /* INLINED */
4958                              Irp->IoStatus.Information = 0;
4959                              }
4960                              goto SetStatusAndReturn;
4961                            }
4962                            {
4963                            memset(cdb, 0, 12);
4964                            retry = 5;
4965                            }
4966                            {
4967                            while (1) {
4968                              while_12_continue: /* CIL Label */ ;
4969                              {
4970                              srb.CdbLength = 10;
4971                              srb.TimeOutValue = 10;
4972                              cdb->PNR_READ_Q_CHANNEL.OperationCode = 194;
4973                              cdb->PNR_READ_Q_CHANNEL.AssignedLength = 9;
4974                              status = SendSrbSynchronous(deviceExtension, & srb,
4975                                                          SubQPtr, 9);
4976                              }
4977                              if (! (status >= 0L)) {
4978                                tmp___7 = retry;
4979                                retry -= 1UL;
4980                                if (tmp___7 > 0UL) {
4981
4982                                } else {
4983                                  goto while_12_break;
4984                                }
4985                              } else {
4986                                goto while_12_break;
4987                              }
4988                            }
4989                            while_12_break: /* CIL Label */ ;
4990                            }
4991                            if (status >= 0L) {
4992                              userPtr->Header.DataLength[0] = 0;
4993                              userPtr->Header.DataLength[0] = 12;
4994                              userPtr->FormatCode = 1;
4995                              userPtr->Control = (int )*(SubQPtr + 0) & 15;
4996                              userPtr->ADR = 0;
4997                              userPtr->TrackNumber = (((int )*(SubQPtr + 1) & 240) >> 4) * 10 + ((int )*(SubQPtr + 1) & 15);
4998                              userPtr->IndexNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15);
4999                              userPtr->AbsoluteAddress[0] = 0;
5000                              userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
5001                              userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
5002                              userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15);
5003                              userPtr->TrackRelativeAddress[0] = 0;
5004                              userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15);
5005                              userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15);
5006                              userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15);
5007                              Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
5008                            } else {
5009                              Irp->IoStatus.Information = 0;
5010                            }
5011                            {
5012/*                             ExFreePool(SubQPtr); */ /* INLINED */
5013                            }
5014                            goto switch_6_break;
5015                            switch_6_exp_20: /* CIL Label */ 
5016                            Irp->IoStatus.Information = 0;
5017                            deviceExtension->PlayActive = 0;
5018                            if ((int )deviceExtension->Active == 9) {
5019                              srb.CdbLength = 10;
5020                              srb.TimeOutValue = 10;
5021                              cdb->PNR_EJECT.OperationCode = 192;
5022                              cdb->PNR_EJECT.Immediate = 1;
5023                            } else {
5024                              srb.CdbLength = 6;
5025                              scsiCdb->START_STOP.OperationCode = 27;
5026                              scsiCdb->START_STOP.LoadEject = 1;
5027                              scsiCdb->START_STOP.Start = 0;
5028                            }
5029                            {
5030                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
5031                                                        0);
5032                            }
5033                            goto switch_6_break;
5034                            switch_6_exp_21: /* CIL Label */ ;
5035                            switch_6_exp_22: /* CIL Label */ ;
5036                            switch_6_exp_23: /* CIL Label */ 
5037                            Irp->IoStatus.Information = 0;
5038                            status = -1073741808L;
5039                            goto switch_6_break;
5040                            switch_6_exp_24: /* CIL Label */ 
5041                            {
5042                            CdAudioIsPlayActive(DeviceObject);
5043                            }
5044                            switch_6_default: /* CIL Label */ 
5045                            {
5046                            tmp___8 = CdAudioSendToNextDriver(DeviceObject, Irp);
5047                            }
5048                            return (tmp___8);
5049                            goto switch_6_break;
5050                          } else {
5051                            switch_6_break: /* CIL Label */ ;
5052                          }
5053                          }
5054                        }
5055                      }
5056                    }
5057                  }
5058                }
5059              }
5060            }
5061          }
5062        }
5063      }
5064    }
5065  }
5066  SetStatusAndReturn: 
5067  if (status == -2147483626L) {
5068    if ((int )currentIrpStack->Flags & 2) {
5069      status = -1073741435L;
5070      goto PioneerRestart;
5071    } else {
5072
5073    }
5074    {
5075/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
5076    Irp->IoStatus.Information = 0;
5077    }
5078  } else {
5079
5080  }
5081  {
5082  Irp->IoStatus.__annonCompField4.Status = status;
5083  myStatus = status;
5084  IofCompleteRequest(Irp, 0);
5085  }
5086  return (status);
5087}
5088}
5089NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
5090{ PIO_STACK_LOCATION currentIrpStack ;
5091  PCD_DEVICE_EXTENSION deviceExtension ;
5092  PCDROM_TOC cdaudioDataOut ;
5093  SCSI_PASS_THROUGH srb ;
5094  PCDB cdb ;
5095  NTSTATUS status ;
5096  ULONG i ;
5097  ULONG bytesTransfered ;
5098  PUCHAR Toc ;
5099  BOOLEAN tmp ;
5100  PVOID tmp___0 ;
5101  ULONG tracksToReturn ;
5102  ULONG tracksOnCd ;
5103  ULONG tracksInBuffer ;
5104  ULONG dataLength ;
5105  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
5106  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
5107  PUCHAR SubQPtr ;
5108  PVOID tmp___1 ;
5109  PSUB_Q_CURRENT_POSITION userPtr ;
5110  PUCHAR SubQPtr___0 ;
5111  PVOID tmp___2 ;
5112  NTSTATUS tmp___3 ;
5113
5114  {
5115  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
5116  deviceExtension = DeviceObject->DeviceExtension;
5117  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
5118  cdb = (union _CDB *)(srb.Cdb);
5119  DenonRestart: 
5120  {
5121  memset(cdb, 0, 12);
5122  }
5123  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
5124    goto switch_13_exp_25;
5125  } else {
5126    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
5127      goto switch_13_exp_26;
5128    } else {
5129      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
5130        goto switch_13_exp_27;
5131      } else {
5132        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
5133          goto switch_13_exp_28;
5134        } else {
5135          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
5136            goto switch_13_exp_29;
5137          } else {
5138            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
5139              goto switch_13_exp_30;
5140            } else {
5141              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
5142                goto switch_13_exp_31;
5143              } else {
5144                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
5145                  goto switch_13_exp_32;
5146                } else {
5147                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
5148                    goto switch_13_exp_33;
5149                  } else {
5150                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
5151                      goto switch_13_exp_34;
5152                    } else {
5153                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
5154                        goto switch_13_exp_35;
5155                      } else {
5156                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
5157                          goto switch_13_exp_36;
5158                        } else {
5159                          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
5160                            goto switch_13_exp_37;
5161                          } else {
5162                            {
5163                            goto switch_13_default;
5164                            if (0) {
5165                              switch_13_exp_25: /* CIL Label */ 
5166                              status = -1073741808L;
5167                              Irp->IoStatus.Information = 0;
5168                              goto switch_13_break;
5169                              switch_13_exp_26: /* CIL Label */ ;
5170                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
5171                                status = -1073741789L;
5172                                Irp->IoStatus.Information = 0;
5173                                goto switch_13_break;
5174                              } else {
5175
5176                              }
5177                              {
5178                              tmp = CdAudioIsPlayActive(DeviceObject);
5179                              }
5180                              if (tmp) {
5181                                status = -2147483631L;
5182                                Irp->IoStatus.Information = 0;
5183                                goto switch_13_break;
5184                              } else {
5185
5186                              }
5187                              {
5188                              tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
5189                                                              541156419UL);
5190                              Toc = (UCHAR *)tmp___0;
5191                              }
5192                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
5193                                status = -1073741670L;
5194                                Irp->IoStatus.Information = 0;
5195                                goto SetStatusAndReturn;
5196                              } else {
5197
5198                              }
5199                              {
5200                              memset(Toc, 0, sizeof(CDROM_TOC ));
5201                              cdb->CDB6GENERIC.OperationCode = 233;
5202                              srb.TimeOutValue = 10;
5203                              srb.CdbLength = 6;
5204                              status = SendSrbSynchronous(deviceExtension, & srb,
5205                                                          Toc, sizeof(CDROM_TOC ));
5206                              }
5207                              if (! (status >= 0L)) {
5208                                if (status != -1073741764L) {
5209                                  if (status != -1073741764L) {
5210                                    {
5211/*                                     ExFreePool(Toc); */ /* INLINED */
5212                                    Irp->IoStatus.Information = 0;
5213                                    }
5214                                    goto SetStatusAndReturn;
5215                                  } else {
5216
5217                                  }
5218                                } else {
5219
5220                                }
5221                              } else {
5222
5223                              }
5224                              status = 0L;
5225                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > srb.DataTransferLength) {
5226                                bytesTransfered = srb.DataTransferLength;
5227                              } else {
5228                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5229                              }
5230                              cdaudioDataOut->FirstTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
5231                              cdaudioDataOut->LastTrack = (((int )*(Toc + 5) & 240) >> 4) * 10 + ((int )*(Toc + 5) & 15);
5232                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5233                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
5234                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
5235                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
5236                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5237                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
5238                              if (tracksInBuffer < tracksOnCd) {
5239                                tracksToReturn = tracksInBuffer;
5240                              } else {
5241                                tracksToReturn = tracksOnCd;
5242                              }
5243                              i = 0;
5244                              {
5245                              while (1) {
5246                                while_14_continue: /* CIL Label */ ;
5247                                if (i < tracksToReturn) {
5248
5249                                } else {
5250                                  goto while_14_break;
5251                                }
5252                                cdaudioDataOut->TrackData[i].Reserved = 0;
5253                                cdaudioDataOut->TrackData[i].Control = *(Toc + (i * 4UL + 12UL));
5254                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5255                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5256                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5257                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 4UL + 13UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 13UL)) & 15);
5258                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 4UL + 14UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 14UL)) & 15);
5259                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 4UL + 15UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 15UL)) & 15);
5260                                i += 1UL;
5261                              }
5262                              while_14_break: /* CIL Label */ ;
5263                              }
5264                              if (tracksInBuffer > tracksOnCd) {
5265                                cdaudioDataOut->TrackData[i].Reserved = 0;
5266                                cdaudioDataOut->TrackData[i].Control = 0;
5267                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5268                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5269                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5270                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15);
5271                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 10) & 240) >> 4) * 10 + ((int )*(Toc + 10) & 15);
5272                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 11) & 240) >> 4) * 10 + ((int )*(Toc + 11) & 15);
5273                                i += 1UL;
5274                              } else {
5275
5276                              }
5277                              {
5278                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5279                              deviceExtension->Paused = 0;
5280                              deviceExtension->PausedM = 0;
5281                              deviceExtension->PausedS = 0;
5282                              deviceExtension->PausedF = 0;
5283                              deviceExtension->LastEndM = 0;
5284                              deviceExtension->LastEndS = 0;
5285                              deviceExtension->LastEndF = 0;
5286/*                               ExFreePool(Toc); */ /* INLINED */
5287                              }
5288                              goto switch_13_break;
5289                              switch_13_exp_27: /* CIL Label */ ;
5290                              switch_13_exp_28: /* CIL Label */ 
5291                              {
5292                              inputBuffer = Irp->AssociatedIrp.SystemBuffer;
5293                              Irp->IoStatus.Information = 0;
5294                              deviceExtension->PlayActive = 0;
5295                              srb.CdbLength = 6;
5296                              srb.TimeOutValue = 10;
5297                              cdb->CDB6GENERIC.OperationCode = 231;
5298                              status = SendSrbSynchronous(deviceExtension, & srb,
5299                                                          (void *)0, 0);
5300                              }
5301                              if (status >= 0L) {
5302                                deviceExtension->Paused = 0;
5303                                deviceExtension->PausedM = 0;
5304                                deviceExtension->PausedS = 0;
5305                                deviceExtension->PausedF = 0;
5306                                deviceExtension->LastEndM = 0;
5307                                deviceExtension->LastEndS = 0;
5308                                deviceExtension->LastEndF = 0;
5309                              } else {
5310
5311                              }
5312                              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
5313                                goto SetStatusAndReturn;
5314                              } else {
5315
5316                              }
5317                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
5318                                status = -1073741820L;
5319                                goto switch_13_break;
5320                              } else {
5321
5322                              }
5323                              {
5324                              srb.CdbLength = 10;
5325                              srb.TimeOutValue = 10;
5326                              cdb->CDB10.OperationCode = 34;
5327                              cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
5328                              cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
5329                              cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
5330                              cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
5331                              cdb->CDB10.Reserved2 = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
5332                              cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
5333                              status = SendSrbSynchronous(deviceExtension, & srb,
5334                                                          (void *)0, 0);
5335                              }
5336                              if (status >= 0L) {
5337                                deviceExtension->PlayActive = 1;
5338                                deviceExtension->Paused = 0;
5339                                deviceExtension->LastEndM = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
5340                                deviceExtension->LastEndS = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
5341                                deviceExtension->LastEndF = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
5342                              } else {
5343                                if (status == -1073741808L) {
5344                                  status = -1073741803L;
5345                                } else {
5346
5347                                }
5348                              }
5349                              goto switch_13_break;
5350                              switch_13_exp_29: /* CIL Label */ 
5351                              inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
5352                              Irp->IoStatus.Information = 0;
5353                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
5354                                status = -1073741820L;
5355                                goto switch_13_break;
5356                              } else {
5357
5358                              }
5359                              {
5360                              srb.CdbLength = 10;
5361                              srb.TimeOutValue = 10;
5362                              cdb->CDB10.OperationCode = 34;
5363                              cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5364                              cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5365                              cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5366                              cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5367                              cdb->CDB10.Reserved2 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5368                              cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5369                              status = SendSrbSynchronous(deviceExtension, & srb,
5370                                                          (void *)0, 0);
5371                              }
5372                              if (status >= 0L) {
5373                                deviceExtension->Paused = 1;
5374                                deviceExtension->PausedM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5375                                deviceExtension->PausedS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5376                                deviceExtension->PausedF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5377                                deviceExtension->LastEndM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5378                                deviceExtension->LastEndS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5379                                deviceExtension->LastEndF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5380                              } else {
5381                                if (status == -1073741808L) {
5382                                  status = -1073741803L;
5383                                } else {
5384
5385                                }
5386                              }
5387                              goto switch_13_break;
5388                              switch_13_exp_30: /* CIL Label */ 
5389                              {
5390                              tmp___1 = ExAllocatePoolWithTag(4, 10, 541156419UL);
5391                              SubQPtr = tmp___1;
5392                              Irp->IoStatus.Information = 0;
5393                              deviceExtension->PlayActive = 0;
5394                              }
5395                              if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
5396                                status = -1073741670L;
5397                                goto SetStatusAndReturn;
5398                              } else {
5399
5400                              }
5401                              if ((int )deviceExtension->Paused == 1) {
5402                                {
5403/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5404                                status = 0L;
5405                                }
5406                                goto SetStatusAndReturn;
5407                              } else {
5408
5409                              }
5410                              {
5411                              srb.CdbLength = 6;
5412                              srb.TimeOutValue = 10;
5413                              cdb->CDB6GENERIC.OperationCode = 235;
5414                              cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10;
5415                              status = SendSrbSynchronous(deviceExtension, & srb,
5416                                                          SubQPtr, 10);
5417                              }
5418                              if (! (status >= 0L)) {
5419                                {
5420/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5421                                }
5422                                goto SetStatusAndReturn;
5423                              } else {
5424
5425                              }
5426                              {
5427                              deviceExtension->PausedM = *(SubQPtr + 7);
5428                              deviceExtension->PausedS = *(SubQPtr + 8);
5429                              deviceExtension->PausedF = *(SubQPtr + 9);
5430                              memset(cdb, 0, 12);
5431                              srb.CdbLength = 6;
5432                              srb.TimeOutValue = 10;
5433                              cdb->CDB6GENERIC.OperationCode = 231;
5434                              status = SendSrbSynchronous(deviceExtension, & srb,
5435                                                          (void *)0, 0);
5436                              }
5437                              if (! (status >= 0L)) {
5438                                {
5439/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5440                                }
5441                                goto SetStatusAndReturn;
5442                              } else {
5443
5444                              }
5445                              {
5446                              deviceExtension->Paused = 1;
5447                              deviceExtension->PausedM = *(SubQPtr + 7);
5448                              deviceExtension->PausedS = *(SubQPtr + 8);
5449                              deviceExtension->PausedF = *(SubQPtr + 9);
5450/*                               ExFreePool(SubQPtr); */ /* INLINED */
5451                              }
5452                              goto switch_13_break;
5453                              switch_13_exp_31: /* CIL Label */ 
5454                              Irp->IoStatus.Information = 0;
5455                              if ((int )deviceExtension->Paused == 0) {
5456                                status = -1073741823L;
5457                                goto SetStatusAndReturn;
5458                              } else {
5459
5460                              }
5461                              {
5462                              srb.CdbLength = 10;
5463                              srb.TimeOutValue = 10;
5464                              cdb->CDB10.OperationCode = 34;
5465                              cdb->CDB10.LogicalBlockByte0 = deviceExtension->PausedM;
5466                              cdb->CDB10.LogicalBlockByte1 = deviceExtension->PausedS;
5467                              cdb->CDB10.LogicalBlockByte2 = deviceExtension->PausedF;
5468                              cdb->CDB10.LogicalBlockByte3 = deviceExtension->LastEndM;
5469                              cdb->CDB10.Reserved2 = deviceExtension->LastEndS;
5470                              cdb->CDB10.TransferBlocksMsb = deviceExtension->LastEndF;
5471                              status = SendSrbSynchronous(deviceExtension, & srb,
5472                                                          (void *)0, 0);
5473                              }
5474                              if (status >= 0L) {
5475                                deviceExtension->Paused = 0;
5476                              } else {
5477
5478                              }
5479                              goto switch_13_break;
5480                              switch_13_exp_32: /* CIL Label */ 
5481                              {
5482                              userPtr = Irp->AssociatedIrp.SystemBuffer;
5483                              tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
5484                                                              541156419UL);
5485                              SubQPtr___0 = tmp___2;
5486                              }
5487                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
5488                                status = -1073741789L;
5489                                Irp->IoStatus.Information = 0;
5490                                if (SubQPtr___0) {
5491                                  {
5492/*                                   ExFreePool(SubQPtr___0); */ /* INLINED */
5493                                  }
5494                                } else {
5495
5496                                }
5497                                goto switch_13_break;
5498                              } else {
5499
5500                              }
5501                              if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) {
5502                                {
5503                                memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
5504                                status = -1073741670L;
5505                                Irp->IoStatus.Information = 0;
5506                                }
5507                                goto SetStatusAndReturn;
5508                              } else {
5509
5510                              }
5511                              if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
5512                                {
5513/*                                 ExFreePool(SubQPtr___0); */ /* INLINED */
5514                                memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
5515                                status = -1073741823L;
5516                                Irp->IoStatus.Information = 0;
5517                                }
5518                                goto SetStatusAndReturn;
5519                              } else {
5520
5521                              }
5522                              {
5523                              srb.CdbLength = 6;
5524                              srb.TimeOutValue = 10;
5525                              cdb->CDB6GENERIC.OperationCode = 235;
5526                              cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10;
5527                              status = SendSrbSynchronous(deviceExtension, & srb,
5528                                                          SubQPtr___0, 10);
5529                              }
5530                              if (status >= 0L) {
5531                                userPtr->Header.Reserved = 0;
5532                                if ((int )deviceExtension->Paused == 1) {
5533                                  deviceExtension->PlayActive = 0;
5534                                  userPtr->Header.AudioStatus = 18;
5535                                } else {
5536                                  if ((int )*(SubQPtr___0 + 0) == 1) {
5537                                    userPtr->Header.AudioStatus = 17;
5538                                  } else {
5539                                    if ((int )*(SubQPtr___0 + 0) == 0) {
5540                                      userPtr->Header.AudioStatus = 19;
5541                                      deviceExtension->PlayActive = 0;
5542                                    } else {
5543                                      deviceExtension->PlayActive = 0;
5544                                    }
5545                                  }
5546                                }
5547                                userPtr->Header.DataLength[0] = 0;
5548                                userPtr->Header.DataLength[0] = 12;
5549                                userPtr->FormatCode = 1;
5550                                userPtr->Control = *(SubQPtr___0 + 1);
5551                                userPtr->ADR = 0;
5552                                userPtr->TrackNumber = (((int )*(SubQPtr___0 + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 2) & 15);
5553                                userPtr->IndexNumber = (((int )*(SubQPtr___0 + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 3) & 15);
5554                                userPtr->AbsoluteAddress[0] = 0;
5555                                userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15);
5556                                userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr___0 + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 8) & 15);
5557                                userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr___0 + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 9) & 15);
5558                                userPtr->TrackRelativeAddress[0] = 0;
5559                                userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr___0 + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 4) & 15);
5560                                userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr___0 + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 5) & 15);
5561                                userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15);
5562                                Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
5563                              } else {
5564                                Irp->IoStatus.Information = 0;
5565                              }
5566                              {
5567/*                               ExFreePool(SubQPtr___0); */ /* INLINED */
5568                              }
5569                              goto switch_13_break;
5570                              switch_13_exp_33: /* CIL Label */ 
5571                              {
5572                              Irp->IoStatus.Information = 0;
5573                              deviceExtension->PlayActive = 0;
5574                              srb.CdbLength = 6;
5575                              srb.TimeOutValue = 10;
5576                              cdb->CDB6GENERIC.OperationCode = 230;
5577                              status = SendSrbSynchronous(deviceExtension, & srb,
5578                                                          (void *)0, 0);
5579                              }
5580                              goto switch_13_break;
5581                              switch_13_exp_34: /* CIL Label */ ;
5582                              switch_13_exp_35: /* CIL Label */ ;
5583                              switch_13_exp_36: /* CIL Label */ 
5584                              Irp->IoStatus.Information = 0;
5585                              status = -1073741808L;
5586                              goto switch_13_break;
5587                              switch_13_exp_37: /* CIL Label */ 
5588                              {
5589                              CdAudioIsPlayActive(DeviceObject);
5590                              }
5591                              switch_13_default: /* CIL Label */ 
5592                              {
5593                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
5594                              }
5595                              return (tmp___3);
5596                              goto switch_13_break;
5597                            } else {
5598                              switch_13_break: /* CIL Label */ ;
5599                            }
5600                            }
5601                          }
5602                        }
5603                      }
5604                    }
5605                  }
5606                }
5607              }
5608            }
5609          }
5610        }
5611      }
5612    }
5613  }
5614  SetStatusAndReturn: 
5615  if (status == -2147483626L) {
5616    if ((int )currentIrpStack->Flags & 2) {
5617      status = -1073741435L;
5618      goto DenonRestart;
5619    } else {
5620
5621    }
5622    {
5623/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
5624    Irp->IoStatus.Information = 0;
5625    }
5626  } else {
5627
5628  }
5629  {
5630  Irp->IoStatus.__annonCompField4.Status = status;
5631  myStatus = status;
5632  IofCompleteRequest(Irp, 0);
5633  }
5634  return (status);
5635}
5636}
5637NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) 
5638{ PCD_DEVICE_EXTENSION deviceExtension ;
5639  SCSI_PASS_THROUGH srb ;
5640  PHITACHICDB cdb ;
5641  NTSTATUS status ;
5642  PUCHAR PausePos ;
5643  PVOID tmp ;
5644
5645  {
5646  {
5647  deviceExtension = DeviceObject->DeviceExtension;
5648  cdb = (union _HITACHICDB *)(srb.Cdb);
5649  tmp = ExAllocatePoolWithTag(4, 3, 541156419UL);
5650  PausePos = (UCHAR *)tmp;
5651  }
5652  if ((unsigned int )PausePos == (unsigned int )((void *)0)) {
5653    return (-1073741670L);
5654  } else {
5655
5656  }
5657  {
5658  memset(PausePos, 0, 3);
5659  memset(cdb, 0, 12);
5660  srb.CdbLength = 12;
5661  srb.TimeOutValue = 10;
5662  cdb->PAUSE_AUDIO.OperationCode = 225;
5663  status = SendSrbSynchronous(deviceExtension, & srb, PausePos, 3);
5664/*   ExFreePool(PausePos); */ /* INLINED */
5665  }
5666  return (status);
5667}
5668}
5669NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
5670{ PIO_STACK_LOCATION currentIrpStack ;
5671  PCD_DEVICE_EXTENSION deviceExtension ;
5672  PCDROM_TOC cdaudioDataOut ;
5673  SCSI_PASS_THROUGH srb ;
5674  PHITACHICDB cdb ;
5675  NTSTATUS status ;
5676  ULONG i ;
5677  ULONG bytesTransfered ;
5678  PUCHAR Toc ;
5679  BOOLEAN tmp ;
5680  PVOID tmp___0 ;
5681  ULONG tracksToReturn ;
5682  ULONG tracksOnCd ;
5683  ULONG tracksInBuffer ;
5684  ULONG dataLength ;
5685  ULONG tracksToReturn___0 ;
5686  ULONG tracksOnCd___0 ;
5687  ULONG tracksInBuffer___0 ;
5688  ULONG dataLength___0 ;
5689  NTSTATUS tmp___1 ;
5690  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
5691  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
5692  PUCHAR PausePos ;
5693  PVOID tmp___2 ;
5694  PSUB_Q_CURRENT_POSITION userPtr ;
5695  PUCHAR SubQPtr ;
5696  PVOID tmp___3 ;
5697  PUCHAR EjectStatus ;
5698  PVOID tmp___4 ;
5699  NTSTATUS tmp___5 ;
5700
5701  {
5702  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
5703  deviceExtension = DeviceObject->DeviceExtension;
5704  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
5705  cdb = (union _HITACHICDB *)(srb.Cdb);
5706  HitachiRestart: 
5707  {
5708  memset(cdb, 0, 12);
5709  }
5710  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
5711    goto switch_15_exp_38;
5712  } else {
5713    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
5714      goto switch_15_exp_39;
5715    } else {
5716      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
5717        goto switch_15_exp_40;
5718      } else {
5719        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
5720          goto switch_15_exp_41;
5721        } else {
5722          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
5723            goto switch_15_exp_42;
5724          } else {
5725            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
5726              goto switch_15_exp_43;
5727            } else {
5728              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
5729                goto switch_15_exp_44;
5730              } else {
5731                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
5732                  goto switch_15_exp_45;
5733                } else {
5734                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
5735                    goto switch_15_exp_46;
5736                  } else {
5737                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
5738                      goto switch_15_exp_47;
5739                    } else {
5740                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
5741                        goto switch_15_exp_48;
5742                      } else {
5743                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
5744                          goto switch_15_exp_49;
5745                        } else {
5746                          {
5747                          goto switch_15_default;
5748                          if (0) {
5749                            switch_15_exp_38: /* CIL Label */ ;
5750                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
5751                              status = -1073741789L;
5752                              Irp->IoStatus.Information = 0;
5753                              goto switch_15_break;
5754                            } else {
5755
5756                            }
5757                            {
5758                            tmp = CdAudioIsPlayActive(DeviceObject);
5759                            }
5760                            if (tmp) {
5761                              status = -2147483631L;
5762                              Irp->IoStatus.Information = 0;
5763                              goto switch_15_break;
5764                            } else {
5765
5766                            }
5767                            {
5768                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
5769                                                            541156419UL);
5770                            Toc = (UCHAR *)tmp___0;
5771                            }
5772                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
5773                              status = -1073741670L;
5774                              Irp->IoStatus.Information = 0;
5775                              goto SetStatusAndReturn;
5776                            } else {
5777
5778                            }
5779                            {
5780                            memset(Toc, 0, sizeof(CDROM_TOC ));
5781                            srb.CdbLength = 12;
5782                            }
5783                            if ((int )deviceExtension->Active == 5) {
5784                              cdb->READ_DISC_INFO.OperationCode = 227;
5785                            } else {
5786                              cdb->READ_DISC_INFO.OperationCode = 232;
5787                            }
5788                            {
5789                            cdb->READ_DISC_INFO.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8;
5790                            cdb->READ_DISC_INFO.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U;
5791                            srb.TimeOutValue = 10;
5792                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
5793                                                        sizeof(CDROM_TOC ));
5794                            }
5795                            if (! (status >= 0L)) {
5796                              if (status != -1073741764L) {
5797                                if (status != -1073741764L) {
5798                                  {
5799/*                                   ExFreePool(Toc); */ /* INLINED */
5800                                  Irp->IoStatus.Information = 0;
5801                                  }
5802                                  goto SetStatusAndReturn;
5803                                } else {
5804
5805                                }
5806                              } else {
5807                                status = 0L;
5808                              }
5809                            } else {
5810                              status = 0L;
5811                            }
5812                            if ((int )deviceExtension->Active == 6) {
5813                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
5814                                bytesTransfered = sizeof(CDROM_TOC );
5815                              } else {
5816                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5817                              }
5818                              cdaudioDataOut->FirstTrack = *(Toc + 2);
5819                              cdaudioDataOut->LastTrack = *(Toc + 3);
5820                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5821                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
5822                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
5823                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
5824                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5825                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
5826                              if (tracksInBuffer < tracksOnCd) {
5827                                tracksToReturn = tracksInBuffer;
5828                              } else {
5829                                tracksToReturn = tracksOnCd;
5830                              }
5831                              i = 0;
5832                              {
5833                              while (1) {
5834                                while_16_continue: /* CIL Label */ ;
5835                                if (i < tracksToReturn) {
5836
5837                                } else {
5838                                  goto while_16_break;
5839                                }
5840                                cdaudioDataOut->TrackData[i].Reserved = 0;
5841                                cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 4UL + 8UL)) & 15) << 4) | ((int )*(Toc + (i * 4UL + 8UL)) >> 4);
5842                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5843                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5844                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5845                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + (i * 4UL + 9UL));
5846                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 4UL + 10UL));
5847                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 4UL + 11UL));
5848                                i += 1UL;
5849                              }
5850                              while_16_break: /* CIL Label */ ;
5851                              }
5852                              if (tracksInBuffer > tracksOnCd) {
5853                                cdaudioDataOut->TrackData[i].Reserved = 0;
5854                                cdaudioDataOut->TrackData[i].Control = 16;
5855                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5856                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5857                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5858                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 5);
5859                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 6);
5860                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 7);
5861                                i += 1UL;
5862                              } else {
5863
5864                              }
5865                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5866                              deviceExtension->Paused = 0;
5867                              deviceExtension->PausedM = 0;
5868                              deviceExtension->PausedS = 0;
5869                              deviceExtension->PausedF = 0;
5870                              deviceExtension->LastEndM = 0;
5871                              deviceExtension->LastEndS = 0;
5872                              deviceExtension->LastEndF = 0;
5873                            } else {
5874                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
5875                                bytesTransfered = sizeof(CDROM_TOC );
5876                              } else {
5877                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5878                              }
5879                              cdaudioDataOut->FirstTrack = *(Toc + 1);
5880                              cdaudioDataOut->LastTrack = *(Toc + 2);
5881                              tracksOnCd___0 = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5882                              dataLength___0 = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd___0])) - 2UL;
5883                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength___0 >> 8);
5884                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength___0 & 255UL);
5885                              tracksInBuffer___0 = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5886                              tracksInBuffer___0 /= (ULONG )sizeof(TRACK_DATA );
5887                              if (tracksInBuffer___0 < tracksOnCd___0) {
5888                                tracksToReturn___0 = tracksInBuffer___0;
5889                              } else {
5890                                tracksToReturn___0 = tracksOnCd___0;
5891                              }
5892                              i = 0;
5893                              {
5894                              while (1) {
5895                                while_17_continue: /* CIL Label */ ;
5896                                if (i < tracksToReturn___0) {
5897
5898                                } else {
5899                                  goto while_17_break;
5900                                }
5901                                cdaudioDataOut->TrackData[i].Reserved = 0;
5902                                if ((int )*(Toc + (i * 3UL + 6UL)) & 128) {
5903                                  cdaudioDataOut->TrackData[i].Control = 4;
5904                                } else {
5905                                  cdaudioDataOut->TrackData[i].Control = 0;
5906                                }
5907                                cdaudioDataOut->TrackData[i].Adr = 0;
5908                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5909                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5910                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5911                                cdaudioDataOut->TrackData[i].Address[1] = (int )*(Toc + (i * 3UL + 6UL)) & 127;
5912                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 3UL + 7UL));
5913                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 3UL + 8UL));
5914                                i += 1UL;
5915                              }
5916                              while_17_break: /* CIL Label */ ;
5917                              }
5918                              if (tracksInBuffer___0 > tracksOnCd___0) {
5919                                cdaudioDataOut->TrackData[i].Reserved = 0;
5920                                cdaudioDataOut->TrackData[i].Control = 16;
5921                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5922                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5923                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5924                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 3);
5925                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 4);
5926                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 5);
5927                                i += 1UL;
5928                              } else {
5929
5930                              }
5931                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5932                            }
5933                            {
5934/*                             ExFreePool(Toc); */ /* INLINED */
5935                            }
5936                            goto switch_15_break;
5937                            switch_15_exp_39: /* CIL Label */ 
5938                            {
5939                            deviceExtension->PlayActive = 0;
5940                            Irp->IoStatus.Information = 0;
5941                            CdAudioHitachiSendPauseCommand(DeviceObject);
5942                            deviceExtension->Paused = 0;
5943                            deviceExtension->PausedM = 0;
5944                            deviceExtension->PausedS = 0;
5945                            deviceExtension->PausedF = 0;
5946                            deviceExtension->LastEndM = 0;
5947                            deviceExtension->LastEndS = 0;
5948                            deviceExtension->LastEndF = 0;
5949                            tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp);
5950                            }
5951                            return (tmp___1);
5952                            goto switch_15_break;
5953                            switch_15_exp_40: /* CIL Label */ 
5954                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
5955                            Irp->IoStatus.Information = 0;
5956                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
5957                              status = -1073741820L;
5958                              goto switch_15_break;
5959                            } else {
5960
5961                            }
5962                            {
5963                            CdAudioHitachiSendPauseCommand(DeviceObject);
5964                            srb.CdbLength = 12;
5965                            srb.TimeOutValue = 10;
5966                            cdb->PLAY_AUDIO.OperationCode = 224;
5967                            cdb->PLAY_AUDIO.Immediate = 1;
5968                            cdb->PLAY_AUDIO.StartingM = inputBuffer->StartingM;
5969                            cdb->PLAY_AUDIO.StartingS = inputBuffer->StartingS;
5970                            cdb->PLAY_AUDIO.StartingF = inputBuffer->StartingF;
5971                            cdb->PLAY_AUDIO.EndingM = inputBuffer->EndingM;
5972                            cdb->PLAY_AUDIO.EndingS = inputBuffer->EndingS;
5973                            cdb->PLAY_AUDIO.EndingF = inputBuffer->EndingF;
5974                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
5975                                                        0);
5976                            }
5977                            if (status >= 0L) {
5978                              deviceExtension->PlayActive = 1;
5979                              deviceExtension->Paused = 0;
5980                              deviceExtension->PausedM = inputBuffer->StartingM;
5981                              deviceExtension->PausedS = inputBuffer->StartingS;
5982                              deviceExtension->PausedF = inputBuffer->StartingF;
5983                              deviceExtension->LastEndM = inputBuffer->EndingM;
5984                              deviceExtension->LastEndS = inputBuffer->EndingS;
5985                              deviceExtension->LastEndF = inputBuffer->EndingF;
5986                            } else {
5987
5988                            }
5989                            goto switch_15_break;
5990                            switch_15_exp_41: /* CIL Label */ 
5991                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
5992                            Irp->IoStatus.Information = 0;
5993                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
5994                              status = -1073741820L;
5995                              goto switch_15_break;
5996                            } else {
5997
5998                            }
5999                            {
6000                            CdAudioHitachiSendPauseCommand(DeviceObject);
6001                            srb.CdbLength = 12;
6002                            srb.TimeOutValue = 10;
6003                            cdb->PLAY_AUDIO.OperationCode = 224;
6004                            cdb->PLAY_AUDIO.Immediate = 1;
6005                            cdb->PLAY_AUDIO.StartingM = inputBuffer___0->M;
6006                            cdb->PLAY_AUDIO.StartingS = inputBuffer___0->S;
6007                            cdb->PLAY_AUDIO.StartingF = inputBuffer___0->F;
6008                            cdb->PLAY_AUDIO.EndingM = inputBuffer___0->M;
6009                            cdb->PLAY_AUDIO.EndingS = inputBuffer___0->S;
6010                            cdb->PLAY_AUDIO.EndingF = inputBuffer___0->F;
6011                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6012                                                        0);
6013                            }
6014                            if (status >= 0L) {
6015                              deviceExtension->PausedM = inputBuffer___0->M;
6016                              deviceExtension->PausedS = inputBuffer___0->S;
6017                              deviceExtension->PausedF = inputBuffer___0->F;
6018                              deviceExtension->LastEndM = inputBuffer___0->M;
6019                              deviceExtension->LastEndS = inputBuffer___0->S;
6020                              deviceExtension->LastEndF = inputBuffer___0->F;
6021                            } else {
6022
6023                            }
6024                            goto switch_15_break;
6025                            switch_15_exp_42: /* CIL Label */ 
6026                            {
6027                            tmp___2 = ExAllocatePoolWithTag(4, 3, 541156419UL);
6028                            PausePos = tmp___2;
6029                            Irp->IoStatus.Information = 0;
6030                            }
6031                            if ((unsigned int )PausePos == (unsigned int )((void *)0)) {
6032                              status = -1073741670L;
6033                              goto SetStatusAndReturn;
6034                            } else {
6035
6036                            }
6037                            {
6038                            deviceExtension->PlayActive = 0;
6039                            memset(PausePos, 0, 3);
6040                            srb.CdbLength = 12;
6041                            srb.TimeOutValue = 10;
6042                            cdb->PAUSE_AUDIO.OperationCode = 225;
6043                            status = SendSrbSynchronous(deviceExtension, & srb, PausePos,
6044                                                        3);
6045                            deviceExtension->Paused = 1;
6046                            deviceExtension->PausedM = *(PausePos + 0);
6047                            deviceExtension->PausedS = *(PausePos + 1);
6048                            deviceExtension->PausedF = *(PausePos + 2);
6049/*                             ExFreePool(PausePos); */ /* INLINED */
6050                            }
6051                            goto switch_15_break;
6052                            switch_15_exp_43: /* CIL Label */ 
6053                            {
6054                            Irp->IoStatus.Information = 0;
6055                            CdAudioHitachiSendPauseCommand(DeviceObject);
6056                            srb.CdbLength = 12;
6057                            srb.TimeOutValue = 10;
6058                            cdb->PLAY_AUDIO.OperationCode = 224;
6059                            cdb->PLAY_AUDIO.Immediate = 1;
6060                            cdb->PLAY_AUDIO.StartingM = deviceExtension->PausedM;
6061                            cdb->PLAY_AUDIO.StartingS = deviceExtension->PausedS;
6062                            cdb->PLAY_AUDIO.StartingF = deviceExtension->PausedF;
6063                            cdb->PLAY_AUDIO.EndingM = deviceExtension->LastEndM;
6064                            cdb->PLAY_AUDIO.EndingS = deviceExtension->LastEndS;
6065                            cdb->PLAY_AUDIO.EndingF = deviceExtension->LastEndF;
6066                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6067                                                        0);
6068                            }
6069                            if (status >= 0L) {
6070                              deviceExtension->Paused = 0;
6071                            } else {
6072
6073                            }
6074                            goto switch_15_break;
6075                            switch_15_exp_44: /* CIL Label */ 
6076                            {
6077                            userPtr = Irp->AssociatedIrp.SystemBuffer;
6078                            tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
6079                                                            541156419UL);
6080                            SubQPtr = tmp___3;
6081                            }
6082                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
6083                              status = -1073741789L;
6084                              Irp->IoStatus.Information = 0;
6085                              if (SubQPtr) {
6086                                {
6087/*                                 ExFreePool(SubQPtr); */ /* INLINED */
6088                                }
6089                              } else {
6090
6091                              }
6092                              goto switch_15_break;
6093                            } else {
6094
6095                            }
6096                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
6097                              status = -1073741670L;
6098                              Irp->IoStatus.Information = 0;
6099                              goto SetStatusAndReturn;
6100                            } else {
6101
6102                            }
6103                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
6104                              {
6105/*                               ExFreePool(SubQPtr); */ /* INLINED */
6106                              status = -1073741823L;
6107                              Irp->IoStatus.Information = 0;
6108                              }
6109                              goto SetStatusAndReturn;
6110                            } else {
6111
6112                            }
6113                            srb.CdbLength = 12;
6114                            srb.TimeOutValue = 10;
6115                            cdb->AUDIO_STATUS.OperationCode = 229;
6116                            Retry: 
6117                            {
6118                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
6119                                                        sizeof(SUB_Q_CHANNEL_DATA ));
6120                            }
6121                            if (status >= 0L) {
6122                              goto _L;
6123                            } else {
6124                              if (status == -1073741764L) {
6125                                _L: /* CIL Label */ 
6126                                if (((int )*(SubQPtr + 1) & 15) != 1) {
6127                                  goto Retry;
6128                                } else {
6129
6130                                }
6131                                userPtr->Header.Reserved = 0;
6132                                if ((int )deviceExtension->Paused == 1) {
6133                                  deviceExtension->PlayActive = 0;
6134                                  userPtr->Header.AudioStatus = 18;
6135                                } else {
6136                                  if ((int )*(SubQPtr + 0) == 1) {
6137                                    userPtr->Header.AudioStatus = 17;
6138                                  } else {
6139                                    if ((int )*(SubQPtr + 0) == 0) {
6140                                      userPtr->Header.AudioStatus = 19;
6141                                      deviceExtension->PlayActive = 0;
6142                                    } else {
6143                                      deviceExtension->PlayActive = 0;
6144                                    }
6145                                  }
6146                                }
6147                                userPtr->Header.DataLength[0] = 0;
6148                                userPtr->Header.DataLength[0] = 12;
6149                                userPtr->FormatCode = 1;
6150                                userPtr->Control = ((int )*(SubQPtr + 1) & 240) >> 4;
6151                                userPtr->ADR = (int )*(SubQPtr + 1) & 15;
6152                                userPtr->TrackNumber = *(SubQPtr + 2);
6153                                userPtr->IndexNumber = *(SubQPtr + 3);
6154                                userPtr->AbsoluteAddress[0] = 0;
6155                                userPtr->AbsoluteAddress[1] = *(SubQPtr + 8);
6156                                userPtr->AbsoluteAddress[2] = *(SubQPtr + 9);
6157                                userPtr->AbsoluteAddress[3] = *(SubQPtr + 10);
6158                                userPtr->TrackRelativeAddress[0] = 0;
6159                                userPtr->TrackRelativeAddress[1] = *(SubQPtr + 4);
6160                                userPtr->TrackRelativeAddress[2] = *(SubQPtr + 5);
6161                                userPtr->TrackRelativeAddress[3] = *(SubQPtr + 6);
6162                                Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
6163                                status = 0L;
6164                              } else {
6165                                Irp->IoStatus.Information = 0;
6166                              }
6167                            }
6168                            {
6169/*                             ExFreePool(SubQPtr); */ /* INLINED */
6170                            }
6171                            goto switch_15_break;
6172                            switch_15_exp_45: /* CIL Label */ 
6173                            {
6174                            tmp___4 = ExAllocatePoolWithTag(4, 1, 541156419UL);
6175                            EjectStatus = tmp___4;
6176                            Irp->IoStatus.Information = 0;
6177                            }
6178                            if ((unsigned int )EjectStatus == (unsigned int )((void *)0)) {
6179                              status = -1073741670L;
6180                              goto SetStatusAndReturn;
6181                            } else {
6182
6183                            }
6184                            {
6185                            deviceExtension->PlayActive = 0;
6186                            srb.CdbLength = 12;
6187                            srb.TimeOutValue = 10;
6188                            cdb->EJECT.OperationCode = 228;
6189                            cdb->EJECT.Eject = 1;
6190                            status = SendSrbSynchronous(deviceExtension, & srb, EjectStatus,
6191                                                        1);
6192                            }
6193                            if (status >= 0L) {
6194                              deviceExtension->Paused = 0;
6195                              deviceExtension->PausedM = 0;
6196                              deviceExtension->PausedS = 0;
6197                              deviceExtension->PausedF = 0;
6198                              deviceExtension->LastEndM = 0;
6199                              deviceExtension->LastEndS = 0;
6200                              deviceExtension->LastEndF = 0;
6201                            } else {
6202
6203                            }
6204                            {
6205/*                             ExFreePool(EjectStatus); */ /* INLINED */
6206                            }
6207                            goto switch_15_break;
6208                            switch_15_exp_46: /* CIL Label */ ;
6209                            switch_15_exp_47: /* CIL Label */ ;
6210                            switch_15_exp_48: /* CIL Label */ 
6211                            Irp->IoStatus.Information = 0;
6212                            status = -1073741808L;
6213                            goto switch_15_break;
6214                            switch_15_exp_49: /* CIL Label */ 
6215                            {
6216                            CdAudioIsPlayActive(DeviceObject);
6217                            }
6218                            switch_15_default: /* CIL Label */ 
6219                            {
6220                            tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp);
6221                            }
6222                            return (tmp___5);
6223                            goto switch_15_break;
6224                          } else {
6225                            switch_15_break: /* CIL Label */ ;
6226                          }
6227                          }
6228                        }
6229                      }
6230                    }
6231                  }
6232                }
6233              }
6234            }
6235          }
6236        }
6237      }
6238    }
6239  }
6240  SetStatusAndReturn: 
6241  if (status == -2147483626L) {
6242    if ((int )currentIrpStack->Flags & 2) {
6243      status = -1073741435L;
6244      goto HitachiRestart;
6245    } else {
6246
6247    }
6248    {
6249/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
6250    Irp->IoStatus.Information = 0;
6251    }
6252  } else {
6253
6254  }
6255  {
6256  Irp->IoStatus.__annonCompField4.Status = status;
6257  myStatus = status;
6258  IofCompleteRequest(Irp, 0);
6259  }
6260  return (status);
6261}
6262}
6263NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
6264{ PIO_STACK_LOCATION currentIrpStack ;
6265  PCD_DEVICE_EXTENSION deviceExtension ;
6266  PCDROM_TOC cdaudioDataOut ;
6267  SCSI_PASS_THROUGH srb ;
6268  PREAD_CAPACITY_DATA lastSession ;
6269  PCDB cdb ;
6270  NTSTATUS status ;
6271  ULONG i ;
6272  ULONG bytesTransfered ;
6273  PUCHAR Toc ;
6274  ULONG destblock ;
6275  BOOLEAN tmp ;
6276  PVOID tmp___0 ;
6277  BOOLEAN tmp___1 ;
6278  PVOID tmp___2 ;
6279  ULONG tracksToReturn ;
6280  ULONG tracksOnCd ;
6281  ULONG tracksInBuffer ;
6282  PSUB_Q_CURRENT_POSITION userPtr ;
6283  PUCHAR SubQPtr ;
6284  PVOID tmp___3 ;
6285  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
6286  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
6287  NTSTATUS tmp___4 ;
6288
6289  {
6290  {
6291  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
6292  deviceExtension = DeviceObject->DeviceExtension;
6293  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
6294  cdb = (union _CDB *)(srb.Cdb);
6295  memset(cdb, 0, 12);
6296  }
6297  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
6298    goto switch_18_exp_50;
6299  } else {
6300    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
6301      goto switch_18_exp_51;
6302    } else {
6303      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
6304        goto switch_18_exp_52;
6305      } else {
6306        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
6307          goto switch_18_exp_53;
6308        } else {
6309          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
6310            goto switch_18_exp_54;
6311          } else {
6312            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
6313              goto switch_18_exp_55;
6314            } else {
6315              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
6316                goto switch_18_exp_56;
6317              } else {
6318                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
6319                  goto switch_18_exp_57;
6320                } else {
6321                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
6322                    goto switch_18_exp_58;
6323                  } else {
6324                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
6325                      goto switch_18_exp_59;
6326                    } else {
6327                      {
6328                      goto switch_18_default;
6329                      if (0) {
6330                        switch_18_exp_50: /* CIL Label */ 
6331                        {
6332                        tmp = CdAudioIsPlayActive(DeviceObject);
6333                        }
6334                        if (tmp) {
6335                          status = -2147483631L;
6336                          Irp->IoStatus.Information = 0;
6337                          goto switch_18_break;
6338                        } else {
6339
6340                        }
6341                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) {
6342                          status = -1073741789L;
6343                          Irp->IoStatus.Information = 0;
6344                          goto switch_18_break;
6345                        } else {
6346
6347                        }
6348                        {
6349                        tmp___0 = ExAllocatePoolWithTag(4, sizeof(READ_CAPACITY_DATA ),
6350                                                        541156419UL);
6351                        lastSession = tmp___0;
6352                        }
6353                        if ((unsigned int )lastSession == (unsigned int )((void *)0)) {
6354                          status = -1073741670L;
6355                          Irp->IoStatus.Information = 0;
6356                          goto SetStatusAndReturn;
6357                        } else {
6358
6359                        }
6360                        {
6361                        memset(lastSession, 0, sizeof(READ_CAPACITY_DATA ));
6362                        srb.CdbLength = 10;
6363                        cdb->CDB10.OperationCode = 38;
6364                        srb.TimeOutValue = 10;
6365                        status = SendSrbSynchronous(deviceExtension, & srb, lastSession,
6366                                                    sizeof(READ_CAPACITY_DATA ));
6367                        }
6368                        if (! (status >= 0L)) {
6369                          {
6370/*                           ExFreePool(lastSession); */ /* INLINED */
6371                          Irp->IoStatus.Information = 0;
6372                          }
6373                          goto SetStatusAndReturn;
6374                        } else {
6375                          status = 0L;
6376                        }
6377                        {
6378                        bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]);
6379                        Irp->IoStatus.Information = bytesTransfered;
6380                        memset(cdaudioDataOut, 0, bytesTransfered);
6381                        cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8);
6382                        cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL);
6383                        }
6384                        if (lastSession->LogicalBlockAddress == 0UL) {
6385                          {
6386/*                           ExFreePool(lastSession); */ /* INLINED */
6387                          }
6388                          goto switch_18_break;
6389                        } else {
6390
6391                        }
6392                        {
6393                        cdaudioDataOut->FirstTrack = 1;
6394                        cdaudioDataOut->LastTrack = 2;
6395                        *((ULONG *)(& cdaudioDataOut->TrackData[0].Address[0])) = lastSession->LogicalBlockAddress;
6396/*                         ExFreePool(lastSession); */ /* INLINED */
6397                        }
6398                        goto switch_18_break;
6399                        switch_18_exp_51: /* CIL Label */ ;
6400                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
6401                          status = -1073741789L;
6402                          Irp->IoStatus.Information = 0;
6403                          goto switch_18_break;
6404                        } else {
6405
6406                        }
6407                        {
6408                        tmp___1 = CdAudioIsPlayActive(DeviceObject);
6409                        }
6410                        if (tmp___1) {
6411                          status = -2147483631L;
6412                          Irp->IoStatus.Information = 0;
6413                          goto switch_18_break;
6414                        } else {
6415
6416                        }
6417                        {
6418                        tmp___2 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), 541156419UL);
6419                        Toc = (UCHAR *)tmp___2;
6420                        }
6421                        if ((unsigned int )Toc == (unsigned int )((void *)0)) {
6422                          status = -1073741670L;
6423                          Irp->IoStatus.Information = 0;
6424                          goto SetStatusAndReturn;
6425                        } else {
6426
6427                        }
6428                        {
6429                        memset(Toc, 0, sizeof(CDROM_TOC ));
6430                        cdb->CDB10.OperationCode = 67;
6431                        cdb->CDB10.Reserved1 = 1;
6432                        cdb->CDB10.TransferBlocksMsb = sizeof(CDROM_TOC ) >> 8;
6433                        cdb->CDB10.TransferBlocksLsb = sizeof(CDROM_TOC ) & 255U;
6434                        srb.TimeOutValue = 10;
6435                        srb.CdbLength = 10;
6436                        status = SendSrbSynchronous(deviceExtension, & srb, Toc, sizeof(CDROM_TOC ));
6437                        }
6438                        if (! (status >= 0L)) {
6439                          if (status != -1073741764L) {
6440                            if (status != -1073741764L) {
6441                              {
6442/*                               ExFreePool(Toc); */ /* INLINED */
6443                              Irp->IoStatus.Information = 0;
6444                              }
6445                              goto SetStatusAndReturn;
6446                            } else {
6447
6448                            }
6449                          } else {
6450                            status = 0L;
6451                          }
6452                        } else {
6453                          status = 0L;
6454                        }
6455                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
6456                          bytesTransfered = sizeof(CDROM_TOC );
6457                        } else {
6458                          bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
6459                        }
6460                        cdaudioDataOut->Length[0] = *(Toc + 0);
6461                        cdaudioDataOut->Length[1] = *(Toc + 1);
6462                        cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
6463                        cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
6464                        tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
6465                        tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
6466                        tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
6467                        if (tracksInBuffer < tracksOnCd) {
6468                          tracksToReturn = tracksInBuffer;
6469                        } else {
6470                          tracksToReturn = tracksOnCd;
6471                        }
6472                        i = 0;
6473                        {
6474                        while (1) {
6475                          while_19_continue: /* CIL Label */ ;
6476                          if (i < tracksToReturn) {
6477
6478                          } else {
6479                            goto while_19_break;
6480                          }
6481                          cdaudioDataOut->TrackData[i].Reserved = 0;
6482                          cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6483                          cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15);
6484                          cdaudioDataOut->TrackData[i].Reserved1 = 0;
6485                          cdaudioDataOut->TrackData[i].Address[0] = 0;
6486                          cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6487                          cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6488                          cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6489                          i += 1UL;
6490                        }
6491                        while_19_break: /* CIL Label */ ;
6492                        }
6493                        if (tracksInBuffer > tracksOnCd) {
6494                          cdaudioDataOut->TrackData[i].Reserved = 0;
6495                          cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6496                          cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL));
6497                          cdaudioDataOut->TrackData[i].Reserved1 = 0;
6498                          cdaudioDataOut->TrackData[i].Address[0] = 0;
6499                          cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6500                          cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6501                          cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6502                          i += 1UL;
6503                        } else {
6504
6505                        }
6506                        {
6507                        Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
6508/*                         ExFreePool(Toc); */ /* INLINED */
6509                        }
6510                        goto switch_18_break;
6511                        switch_18_exp_52: /* CIL Label */ 
6512                        {
6513                        userPtr = Irp->AssociatedIrp.SystemBuffer;
6514                        tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ),
6515                                                        541156419UL);
6516                        SubQPtr = tmp___3;
6517                        }
6518                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
6519                          status = -1073741789L;
6520                          Irp->IoStatus.Information = 0;
6521                          if (SubQPtr) {
6522                            {
6523/*                             ExFreePool(SubQPtr); */ /* INLINED */
6524                            }
6525                          } else {
6526
6527                          }
6528                          goto switch_18_break;
6529                        } else {
6530
6531                        }
6532                        if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
6533                          {
6534                          memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
6535                          status = -1073741670L;
6536                          Irp->IoStatus.Information = 0;
6537                          }
6538                          goto SetStatusAndReturn;
6539                        } else {
6540
6541                        }
6542                        if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
6543                          {
6544/*                           ExFreePool(SubQPtr); */ /* INLINED */
6545                          memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
6546                          status = -1073741823L;
6547                          Irp->IoStatus.Information = 0;
6548                          }
6549                          goto SetStatusAndReturn;
6550                        } else {
6551
6552                        }
6553                        {
6554                        srb.CdbLength = 10;
6555                        srb.TimeOutValue = 10;
6556                        cdb->SUBCHANNEL.OperationCode = 66;
6557                        cdb->SUBCHANNEL.Msf = 1;
6558                        cdb->SUBCHANNEL.SubQ = 1;
6559                        cdb->SUBCHANNEL.Format = 1;
6560                        cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CURRENT_POSITION );
6561                        status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
6562                                                    sizeof(SUB_Q_CURRENT_POSITION ));
6563                        }
6564                        if (status >= 0L) {
6565                          if ((int )*(SubQPtr + 1) == 17) {
6566                            deviceExtension->PlayActive = 1;
6567                          } else {
6568                            deviceExtension->PlayActive = 0;
6569                          }
6570                          userPtr->Header.Reserved = 0;
6571                          userPtr->Header.AudioStatus = *(SubQPtr + 1);
6572                          userPtr->Header.DataLength[0] = 0;
6573                          userPtr->Header.DataLength[1] = 12;
6574                          userPtr->FormatCode = 1;
6575                          userPtr->Control = *(SubQPtr + 5);
6576                          userPtr->ADR = 0;
6577                          userPtr->TrackNumber = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
6578                          userPtr->IndexNumber = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
6579                          userPtr->AbsoluteAddress[0] = 0;
6580                          userPtr->AbsoluteAddress[1] = *(SubQPtr + 9);
6581                          userPtr->AbsoluteAddress[2] = *(SubQPtr + 10);
6582                          userPtr->AbsoluteAddress[3] = *(SubQPtr + 11);
6583                          userPtr->TrackRelativeAddress[0] = 0;
6584                          userPtr->TrackRelativeAddress[1] = *(SubQPtr + 13);
6585                          userPtr->TrackRelativeAddress[2] = *(SubQPtr + 14);
6586                          userPtr->TrackRelativeAddress[3] = *(SubQPtr + 15);
6587                          Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
6588                        } else {
6589                          Irp->IoStatus.Information = 0;
6590                        }
6591                        {
6592/*                         ExFreePool(SubQPtr); */ /* INLINED */
6593                        }
6594                        goto switch_18_break;
6595                        switch_18_exp_53: /* CIL Label */ 
6596                        inputBuffer = Irp->AssociatedIrp.SystemBuffer;
6597                        Irp->IoStatus.Information = 0;
6598                        if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
6599                          status = -1073741820L;
6600                          goto switch_18_break;
6601                        } else {
6602
6603                        }
6604                        if ((int )inputBuffer->StartingM == (int )inputBuffer->EndingM) {
6605                          if ((int )inputBuffer->StartingS == (int )inputBuffer->EndingS) {
6606                            if ((int )inputBuffer->StartingF == (int )inputBuffer->EndingF) {
6607                              cdb->PAUSE_RESUME.OperationCode = 75;
6608                              cdb->PAUSE_RESUME.Action = 0;
6609                            } else {
6610                              goto _L___0;
6611                            }
6612                          } else {
6613                            goto _L___0;
6614                          }
6615                        } else {
6616                          _L___0: /* CIL Label */ 
6617                          cdb->PLAY_AUDIO_MSF.OperationCode = 71;
6618                          cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM;
6619                          cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS;
6620                          cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF;
6621                          cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM;
6622                          cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS;
6623                          cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF;
6624                        }
6625                        {
6626                        srb.CdbLength = 10;
6627                        srb.TimeOutValue = 10;
6628                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6629                                                    0);
6630                        }
6631                        if (status >= 0L) {
6632                          if ((int )cdb->PLAY_AUDIO_MSF.OperationCode == 71) {
6633                            deviceExtension->PlayActive = 1;
6634                          } else {
6635
6636                          }
6637                        } else {
6638
6639                        }
6640                        goto switch_18_break;
6641                        switch_18_exp_54: /* CIL Label */ 
6642                        inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
6643                        Irp->IoStatus.Information = 0;
6644                        if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
6645                          status = -1073741820L;
6646                          goto switch_18_break;
6647                        } else {
6648
6649                        }
6650                        {
6651                        destblock = (((unsigned long )inputBuffer___0->M * 60UL + (unsigned long )inputBuffer___0->S) * 75UL + (unsigned long )inputBuffer___0->F) - 150UL;
6652                        srb.CdbLength = 10;
6653                        srb.TimeOutValue = 10;
6654                        cdb->SEEK.OperationCode = 43;
6655                        cdb->SEEK.LogicalBlockAddress[0] = (int )((unsigned char )(destblock >> 24)) & 255;
6656                        cdb->SEEK.LogicalBlockAddress[1] = (int )((unsigned char )(destblock >> 16)) & 255;
6657                        cdb->SEEK.LogicalBlockAddress[2] = (int )((unsigned char )(destblock >> 8)) & 255;
6658                        cdb->SEEK.LogicalBlockAddress[3] = (unsigned char )(destblock & 255UL);
6659                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6660                                                    0);
6661                        }
6662                        if (! (status >= 0L)) {
6663
6664                        } else {
6665
6666                        }
6667                        goto switch_18_break;
6668                        switch_18_exp_55: /* CIL Label */ 
6669                        {
6670                        Irp->IoStatus.Information = 0;
6671                        deviceExtension->PlayActive = 0;
6672                        srb.CdbLength = 10;
6673                        srb.TimeOutValue = 10;
6674                        cdb->CDB10.OperationCode = 192;
6675                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6676                                                    0);
6677                        }
6678                        goto switch_18_break;
6679                        switch_18_exp_56: /* CIL Label */ ;
6680                        switch_18_exp_57: /* CIL Label */ ;
6681                        switch_18_exp_58: /* CIL Label */ 
6682                        Irp->IoStatus.Information = 0;
6683                        status = -1073741808L;
6684                        goto switch_18_break;
6685                        switch_18_exp_59: /* CIL Label */ 
6686                        {
6687                        CdAudioIsPlayActive(DeviceObject);
6688                        }
6689                        switch_18_default: /* CIL Label */ 
6690                        {
6691                        tmp___4 = CdAudioSendToNextDriver(DeviceObject, Irp);
6692                        }
6693                        return (tmp___4);
6694                        goto switch_18_break;
6695                      } else {
6696                        switch_18_break: /* CIL Label */ ;
6697                      }
6698                      }
6699                    }
6700                  }
6701                }
6702              }
6703            }
6704          }
6705        }
6706      }
6707    }
6708  }
6709  SetStatusAndReturn: 
6710  if (status == -2147483626L) {
6711    {
6712/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
6713    Irp->IoStatus.Information = 0;
6714    }
6715  } else {
6716
6717  }
6718  {
6719  Irp->IoStatus.__annonCompField4.Status = status;
6720  myStatus = status;
6721  IofCompleteRequest(Irp, 0);
6722  }
6723  return (status);
6724}
6725}
6726NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
6727{ PIO_STACK_LOCATION currentIrpStack ;
6728  PCD_DEVICE_EXTENSION deviceExtension ;
6729  PCDROM_TOC cdaudioDataOut ;
6730  SCSI_PASS_THROUGH srb ;
6731  PCDB cdb ;
6732  NTSTATUS status ;
6733  ULONG i ;
6734  ULONG bytesTransfered ;
6735  PUCHAR Toc ;
6736  BOOLEAN tmp ;
6737  PVOID tmp___0 ;
6738  ULONG tracksToReturn ;
6739  ULONG tracksOnCd ;
6740  ULONG tracksInBuffer ;
6741  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
6742  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
6743  PUCHAR SubQPtr ;
6744  PVOID tmp___1 ;
6745  PSUB_Q_CURRENT_POSITION userPtr ;
6746  PUCHAR SubQPtr___0 ;
6747  PVOID tmp___2 ;
6748  NTSTATUS tmp___3 ;
6749  BOOLEAN tmp___4 ;
6750  NTSTATUS tmp___5 ;
6751
6752  {
6753  {
6754  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
6755  deviceExtension = DeviceObject->DeviceExtension;
6756  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
6757  cdb = (union _CDB *)(srb.Cdb);
6758  memset(cdb, 0, 12);
6759  }
6760  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
6761    goto switch_20_exp_60;
6762  } else {
6763    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
6764      goto switch_20_exp_61;
6765    } else {
6766      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
6767        goto switch_20_exp_62;
6768      } else {
6769        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
6770          goto switch_20_exp_63;
6771        } else {
6772          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
6773            goto switch_20_exp_64;
6774          } else {
6775            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
6776              goto switch_20_exp_65;
6777            } else {
6778              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
6779                goto switch_20_exp_66;
6780              } else {
6781                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
6782                  goto switch_20_exp_67;
6783                } else {
6784                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
6785                    goto switch_20_exp_68;
6786                  } else {
6787                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
6788                      goto switch_20_exp_69;
6789                    } else {
6790                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
6791                        goto switch_20_exp_70;
6792                      } else {
6793                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
6794                          goto switch_20_exp_71;
6795                        } else {
6796                          {
6797                          goto switch_20_default;
6798                          if (0) {
6799                            switch_20_exp_60: /* CIL Label */ ;
6800                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
6801                              status = -1073741789L;
6802                              Irp->IoStatus.Information = 0;
6803                              goto switch_20_break;
6804                            } else {
6805
6806                            }
6807                            {
6808                            tmp = CdAudioIsPlayActive(DeviceObject);
6809                            }
6810                            if (tmp) {
6811                              status = -2147483631L;
6812                              Irp->IoStatus.Information = 0;
6813                              goto switch_20_break;
6814                            } else {
6815
6816                            }
6817                            {
6818                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
6819                                                            541156419UL);
6820                            Toc = (UCHAR *)tmp___0;
6821                            }
6822                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
6823                              status = -1073741670L;
6824                              Irp->IoStatus.Information = 0;
6825                              goto SetStatusAndReturn;
6826                            } else {
6827
6828                            }
6829                            {
6830                            memset(Toc, 0, sizeof(CDROM_TOC ));
6831                            cdb->READ_TOC.OperationCode = 67;
6832                            cdb->READ_TOC.Msf = 1;
6833                            cdb->READ_TOC.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8;
6834                            cdb->READ_TOC.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U;
6835                            srb.TimeOutValue = 10;
6836                            srb.CdbLength = 10;
6837                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
6838                                                        sizeof(CDROM_TOC ));
6839                            }
6840                            if (! (status >= 0L)) {
6841                              if (status != -1073741764L) {
6842                                if (status != -1073741764L) {
6843                                  {
6844/*                                   ExFreePool(Toc); */ /* INLINED */
6845                                  Irp->IoStatus.Information = 0;
6846                                  }
6847                                  goto SetStatusAndReturn;
6848                                } else {
6849
6850                                }
6851                              } else {
6852                                status = 0L;
6853                              }
6854                            } else {
6855                              status = 0L;
6856                            }
6857                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
6858                              bytesTransfered = sizeof(CDROM_TOC );
6859                            } else {
6860                              bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
6861                            }
6862                            cdaudioDataOut->Length[0] = *(Toc + 0);
6863                            cdaudioDataOut->Length[1] = *(Toc + 1);
6864                            cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
6865                            cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
6866                            tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
6867                            tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
6868                            tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
6869                            if (tracksInBuffer < tracksOnCd) {
6870                              tracksToReturn = tracksInBuffer;
6871                            } else {
6872                              tracksToReturn = tracksOnCd;
6873                            }
6874                            i = 0;
6875                            {
6876                            while (1) {
6877                              while_21_continue: /* CIL Label */ ;
6878                              if (i < tracksToReturn) {
6879
6880                              } else {
6881                                goto while_21_break;
6882                              }
6883                              cdaudioDataOut->TrackData[i].Reserved = 0;
6884                              cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6885                              cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15);
6886                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
6887                              cdaudioDataOut->TrackData[i].Address[0] = 0;
6888                              cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6889                              cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6890                              cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6891                              i += 1UL;
6892                            }
6893                            while_21_break: /* CIL Label */ ;
6894                            }
6895                            if (tracksInBuffer > tracksOnCd) {
6896                              cdaudioDataOut->TrackData[i].Reserved = 0;
6897                              cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6898                              cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL));
6899                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
6900                              cdaudioDataOut->TrackData[i].Address[0] = 0;
6901                              cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6902                              cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6903                              cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6904                              i += 1UL;
6905                            } else {
6906
6907                            }
6908                            {
6909                            Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
6910                            deviceExtension->Paused = 0;
6911                            deviceExtension->PausedM = 0;
6912                            deviceExtension->PausedS = 0;
6913                            deviceExtension->PausedF = 0;
6914                            deviceExtension->LastEndM = 0;
6915                            deviceExtension->LastEndS = 0;
6916                            deviceExtension->LastEndF = 0;
6917/*                             ExFreePool(Toc); */ /* INLINED */
6918                            }
6919                            goto switch_20_break;
6920                            switch_20_exp_61: /* CIL Label */ ;
6921                            switch_20_exp_62: /* CIL Label */ 
6922                            {
6923                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
6924                            Irp->IoStatus.Information = 0;
6925                            srb.CdbLength = 10;
6926                            srb.TimeOutValue = 10;
6927                            cdb->CDB10.OperationCode = 198;
6928                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6929                                                        0);
6930                            }
6931                            if (status >= 0L) {
6932                              deviceExtension->PlayActive = 0;
6933                              deviceExtension->Paused = 0;
6934                              deviceExtension->PausedM = 0;
6935                              deviceExtension->PausedS = 0;
6936                              deviceExtension->PausedF = 0;
6937                              deviceExtension->LastEndM = 0;
6938                              deviceExtension->LastEndS = 0;
6939                              deviceExtension->LastEndF = 0;
6940                            } else {
6941
6942                            }
6943                            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
6944                              goto SetStatusAndReturn;
6945                            } else {
6946
6947                            }
6948                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
6949                              status = -1073741820L;
6950                              goto switch_20_break;
6951                            } else {
6952
6953                            }
6954                            {
6955                            srb.CdbLength = 10;
6956                            srb.TimeOutValue = 10;
6957                            cdb->PLAY_AUDIO_MSF.OperationCode = 71;
6958                            cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM;
6959                            cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS;
6960                            cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF;
6961                            cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM;
6962                            cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS;
6963                            cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF;
6964                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6965                                                        0);
6966                            }
6967                            if (status >= 0L) {
6968                              deviceExtension->PlayActive = 1;
6969                              deviceExtension->Paused = 0;
6970                              deviceExtension->LastEndM = inputBuffer->EndingM;
6971                              deviceExtension->LastEndS = inputBuffer->EndingS;
6972                              deviceExtension->LastEndF = inputBuffer->EndingF;
6973                            } else {
6974
6975                            }
6976                            goto switch_20_break;
6977                            switch_20_exp_63: /* CIL Label */ 
6978                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
6979                            Irp->IoStatus.Information = 0;
6980                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
6981                              status = -1073741820L;
6982                              goto switch_20_break;
6983                            } else {
6984
6985                            }
6986                            {
6987                            srb.CdbLength = 10;
6988                            srb.TimeOutValue = 10;
6989                            cdb->CDB10.OperationCode = 71;
6990                            cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer___0->M;
6991                            cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer___0->S;
6992                            cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer___0->F;
6993                            cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer___0->M;
6994                            cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer___0->S;
6995                            cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer___0->F;
6996                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6997                                                        0);
6998                            }
6999                            if (status >= 0L) {
7000                              deviceExtension->Paused = 1;
7001                              deviceExtension->PausedM = inputBuffer___0->M;
7002                              deviceExtension->PausedS = inputBuffer___0->S;
7003                              deviceExtension->PausedF = inputBuffer___0->F;
7004                              deviceExtension->LastEndM = inputBuffer___0->M;
7005                              deviceExtension->LastEndS = inputBuffer___0->S;
7006                              deviceExtension->LastEndF = inputBuffer___0->F;
7007                            } else {
7008                              if (status == -1073741808L) {
7009                                status = -1073741803L;
7010                              } else {
7011
7012                              }
7013                            }
7014                            goto switch_20_break;
7015                            switch_20_exp_64: /* CIL Label */ 
7016                            {
7017                            tmp___1 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
7018                                                            541156419UL);
7019                            SubQPtr = tmp___1;
7020                            Irp->IoStatus.Information = 0;
7021                            }
7022                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
7023                              status = -1073741670L;
7024                              goto SetStatusAndReturn;
7025                            } else {
7026
7027                            }
7028                            if ((int )deviceExtension->Paused == 1) {
7029                              {
7030/*                               ExFreePool(SubQPtr); */ /* INLINED */
7031                              status = 0L;
7032                              }
7033                              goto SetStatusAndReturn;
7034                            } else {
7035
7036                            }
7037                            {
7038                            srb.CdbLength = 10;
7039                            srb.TimeOutValue = 10;
7040                            cdb->SUBCHANNEL.OperationCode = 66;
7041                            cdb->SUBCHANNEL.Msf = 1;
7042                            cdb->SUBCHANNEL.SubQ = 1;
7043                            cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA );
7044                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
7045                                                        sizeof(SUB_Q_CHANNEL_DATA ));
7046                            }
7047                            if (! (status >= 0L)) {
7048                              {
7049/*                               ExFreePool(SubQPtr); */ /* INLINED */
7050                              }
7051                              goto SetStatusAndReturn;
7052                            } else {
7053
7054                            }
7055                            {
7056                            deviceExtension->PausedM = *(SubQPtr + 9);
7057                            deviceExtension->PausedS = *(SubQPtr + 10);
7058                            deviceExtension->PausedF = *(SubQPtr + 11);
7059                            memset(cdb, 0, 12);
7060                            srb.CdbLength = 10;
7061                            srb.TimeOutValue = 10;
7062                            cdb->CDB10.OperationCode = 198;
7063                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7064                                                        0);
7065                            }
7066                            if (! (status >= 0L)) {
7067                              {
7068/*                               ExFreePool(SubQPtr); */ /* INLINED */
7069                              }
7070                              goto SetStatusAndReturn;
7071                            } else {
7072
7073                            }
7074                            {
7075                            deviceExtension->PlayActive = 0;
7076                            deviceExtension->Paused = 1;
7077                            deviceExtension->PausedM = *(SubQPtr + 9);
7078                            deviceExtension->PausedS = *(SubQPtr + 10);
7079                            deviceExtension->PausedF = *(SubQPtr + 11);
7080/*                             ExFreePool(SubQPtr); */ /* INLINED */
7081                            }
7082                            goto switch_20_break;
7083                            switch_20_exp_65: /* CIL Label */ 
7084                            Irp->IoStatus.Information = 0;
7085                            if ((int )deviceExtension->Paused == 0) {
7086                              status = -1073741823L;
7087                              goto SetStatusAndReturn;
7088                            } else {
7089
7090                            }
7091                            {
7092                            srb.CdbLength = 10;
7093                            srb.TimeOutValue = 10;
7094                            cdb->PLAY_AUDIO_MSF.OperationCode = 71;
7095                            cdb->PLAY_AUDIO_MSF.StartingM = deviceExtension->PausedM;
7096                            cdb->PLAY_AUDIO_MSF.StartingS = deviceExtension->PausedS;
7097                            cdb->PLAY_AUDIO_MSF.StartingF = deviceExtension->PausedF;
7098                            cdb->PLAY_AUDIO_MSF.EndingM = deviceExtension->LastEndM;
7099                            cdb->PLAY_AUDIO_MSF.EndingS = deviceExtension->LastEndS;
7100                            cdb->PLAY_AUDIO_MSF.EndingF = deviceExtension->LastEndF;
7101                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7102                                                        0);
7103                            }
7104                            if (status >= 0L) {
7105                              deviceExtension->PlayActive = 1;
7106                              deviceExtension->Paused = 0;
7107                            } else {
7108
7109                            }
7110                            goto switch_20_break;
7111                            switch_20_exp_66: /* CIL Label */ 
7112                            {
7113                            userPtr = Irp->AssociatedIrp.SystemBuffer;
7114                            tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
7115                                                            541156419UL);
7116                            SubQPtr___0 = tmp___2;
7117                            }
7118                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
7119                              status = -1073741789L;
7120                              Irp->IoStatus.Information = 0;
7121                              if (SubQPtr___0) {
7122                                {
7123/*                                 ExFreePool(SubQPtr___0); */ /* INLINED */
7124                                }
7125                              } else {
7126
7127                              }
7128                              goto switch_20_break;
7129                            } else {
7130
7131                            }
7132                            if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) {
7133                              {
7134                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
7135                              status = -1073741670L;
7136                              Irp->IoStatus.Information = 0;
7137                              }
7138                              goto SetStatusAndReturn;
7139                            } else {
7140
7141                            }
7142                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
7143                              {
7144/*                               ExFreePool(SubQPtr___0); */ /* INLINED */
7145                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
7146                              status = -1073741823L;
7147                              Irp->IoStatus.Information = 0;
7148                              }
7149                              goto SetStatusAndReturn;
7150                            } else {
7151
7152                            }
7153                            {
7154                            srb.CdbLength = 10;
7155                            srb.TimeOutValue = 10;
7156                            cdb->SUBCHANNEL.OperationCode = 66;
7157                            cdb->SUBCHANNEL.Msf = 1;
7158                            cdb->SUBCHANNEL.SubQ = 1;
7159                            cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA );
7160                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr___0,
7161                                                        sizeof(SUB_Q_CHANNEL_DATA ));
7162                            }
7163                            if (status >= 0L) {
7164                              userPtr->Header.Reserved = 0;
7165                              if ((int )deviceExtension->Paused == 1) {
7166                                deviceExtension->PlayActive = 0;
7167                                userPtr->Header.AudioStatus = 18;
7168                              } else {
7169                                if ((int )*(SubQPtr___0 + 1) == 17) {
7170                                  deviceExtension->PlayActive = 1;
7171                                  userPtr->Header.AudioStatus = 17;
7172                                } else {
7173                                  deviceExtension->PlayActive = 0;
7174                                  userPtr->Header.AudioStatus = 19;
7175                                }
7176                              }
7177                              userPtr->Header.DataLength[0] = 0;
7178                              userPtr->Header.DataLength[1] = 12;
7179                              userPtr->FormatCode = 1;
7180                              userPtr->Control = *(SubQPtr___0 + 5);
7181                              userPtr->ADR = 0;
7182                              userPtr->TrackNumber = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15);
7183                              userPtr->IndexNumber = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15);
7184                              userPtr->AbsoluteAddress[0] = 0;
7185                              userPtr->AbsoluteAddress[1] = *(SubQPtr___0 + 9);
7186                              userPtr->AbsoluteAddress[2] = *(SubQPtr___0 + 10);
7187                              userPtr->AbsoluteAddress[3] = *(SubQPtr___0 + 11);
7188                              userPtr->TrackRelativeAddress[0] = 0;
7189                              userPtr->TrackRelativeAddress[1] = *(SubQPtr___0 + 13);
7190                              userPtr->TrackRelativeAddress[2] = *(SubQPtr___0 + 14);
7191                              userPtr->TrackRelativeAddress[3] = *(SubQPtr___0 + 15);
7192                              Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
7193                            } else {
7194                              Irp->IoStatus.Information = 0;
7195                            }
7196                            {
7197/*                             ExFreePool(SubQPtr___0); */ /* INLINED */
7198                            }
7199                            goto switch_20_break;
7200                            switch_20_exp_67: /* CIL Label */ 
7201                            {
7202                            Irp->IoStatus.Information = 0;
7203                            srb.CdbLength = 10;
7204                            srb.TimeOutValue = 10;
7205                            cdb->CDB10.OperationCode = 192;
7206                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7207                                                        0);
7208                            deviceExtension->Paused = 0;
7209                            deviceExtension->PausedM = 0;
7210                            deviceExtension->PausedS = 0;
7211                            deviceExtension->PausedF = 0;
7212                            deviceExtension->LastEndM = 0;
7213                            deviceExtension->LastEndS = 0;
7214                            deviceExtension->LastEndF = 0;
7215                            }
7216                            goto switch_20_break;
7217                            switch_20_exp_68: /* CIL Label */ ;
7218                            switch_20_exp_69: /* CIL Label */ ;
7219                            switch_20_exp_70: /* CIL Label */ 
7220                            Irp->IoStatus.Information = 0;
7221                            status = -1073741808L;
7222                            goto switch_20_break;
7223                            switch_20_exp_71: /* CIL Label */ 
7224                            {
7225                            tmp___4 = CdAudioIsPlayActive(DeviceObject);
7226                            }
7227                            if ((int )tmp___4 == 1) {
7228                              deviceExtension->PlayActive = 1;
7229                              status = 0L;
7230                              Irp->IoStatus.Information = 0;
7231                              goto SetStatusAndReturn;
7232                            } else {
7233                              {
7234                              deviceExtension->PlayActive = 0;
7235                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
7236                              }
7237                              return (tmp___3);
7238                            }
7239                            goto switch_20_break;
7240                            switch_20_default: /* CIL Label */ 
7241                            {
7242                            tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp);
7243                            }
7244                            return (tmp___5);
7245                            goto switch_20_break;
7246                          } else {
7247                            switch_20_break: /* CIL Label */ ;
7248                          }
7249                          }
7250                        }
7251                      }
7252                    }
7253                  }
7254                }
7255              }
7256            }
7257          }
7258        }
7259      }
7260    }
7261  }
7262  SetStatusAndReturn: 
7263  if (status == -2147483626L) {
7264    {
7265/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
7266    Irp->IoStatus.Information = 0;
7267    }
7268  } else {
7269
7270  }
7271  {
7272  Irp->IoStatus.__annonCompField4.Status = status;
7273  myStatus = status;
7274  IofCompleteRequest(Irp, 0);
7275  }
7276  return (status);
7277}
7278}
7279NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7280{ NTSTATUS status ;
7281  PCD_DEVICE_EXTENSION deviceExtension ;
7282  PIO_STACK_LOCATION currentIrpStack ;
7283  SCSI_PASS_THROUGH srb ;
7284  PHITACHICDB cdb ;
7285  NTSTATUS tmp ;
7286
7287  {
7288  deviceExtension = DeviceObject->DeviceExtension;
7289  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7290  cdb = (union _HITACHICDB *)(srb.Cdb);
7291  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
7292    {
7293    Irp->IoStatus.Information = 0;
7294    deviceExtension->PlayActive = 0;
7295    memset(& srb, 0, sizeof(SCSI_PASS_THROUGH ));
7296    cdb->STOP_PLAY.OperationCode = 78;
7297    srb.CdbLength = 12;
7298    srb.TimeOutValue = 10;
7299    status = SendSrbSynchronous(deviceExtension, & srb, (void *)0, 0);
7300    }
7301    if (! (status >= 0L)) {
7302      {
7303      Irp->IoStatus.__annonCompField4.Status = status;
7304      myStatus = status;
7305      IofCompleteRequest(Irp, 0);
7306      }
7307      return (status);
7308    } else {
7309
7310    }
7311  } else {
7312    {
7313    tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
7314    }
7315    return (tmp);
7316  }
7317  {
7318  Irp->IoStatus.__annonCompField4.Status = status;
7319  myStatus = status;
7320  IofCompleteRequest(Irp, 0);
7321  }
7322  return (status);
7323}
7324}
7325void HpCdrProcessLastSession(PCDROM_TOC Toc ) 
7326{ ULONG index ;
7327
7328  {
7329  index = Toc->FirstTrack;
7330  if (index) {
7331    index -= 1UL;
7332    Toc->FirstTrack = Toc->TrackData[0].Reserved;
7333    Toc->LastTrack = Toc->TrackData[index].Reserved;
7334    Toc->TrackData[0] = Toc->TrackData[index];
7335  } else {
7336    Toc->LastTrack = 0;
7337    Toc->FirstTrack = Toc->LastTrack;
7338  }
7339  return;
7340}
7341}
7342NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) 
7343{ 
7344
7345  {
7346  if (myIrp_PendingReturned) {
7347    if (pended == 0) {
7348      pended = 1;
7349    } else {
7350      {
7351      errorFn();
7352      }
7353    }
7354    (Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control = (int )(Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation)->Control | 1;
7355  } else {
7356
7357  }
7358  if ((long )myStatus >= 0L) {
7359    {
7360    HpCdrProcessLastSession((struct _CDROM_TOC *)Irp->AssociatedIrp.SystemBuffer);
7361    }
7362  } else {
7363
7364  }
7365  return (myStatus);
7366}
7367}
7368NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7369{ PIO_STACK_LOCATION currentIrpStack ;
7370  PIO_STACK_LOCATION nextIrpStack ;
7371  PCD_DEVICE_EXTENSION deviceExtension ;
7372  PIO_STACK_LOCATION irpSp ;
7373  PIO_STACK_LOCATION nextIrpSp ;
7374  PIO_STACK_LOCATION irpSp___0 ;
7375  NTSTATUS tmp ;
7376  NTSTATUS tmp___0 ;
7377
7378  {
7379  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7380  nextIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7381  deviceExtension = DeviceObject->DeviceExtension;
7382  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (14 << 2))) {
7383    {
7384    irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7385    nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7386    memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine));
7387    nextIrpSp->Control = 0;
7388    }
7389    if (s != NP) {
7390      {
7391      errorFn();
7392      }
7393    } else {
7394      if (compRegistered != 0) {
7395        {
7396        errorFn();
7397        }
7398      } else {
7399        compRegistered = 1;
7400        routine = 0;
7401        compFptr = & HPCdrCompletion;
7402      }
7403    }
7404    {
7405    irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7406    irpSp___0->CompletionRoutine = & HPCdrCompletion;
7407    irpSp___0->Context = deviceExtension;
7408    irpSp___0->Control = 0;
7409    irpSp___0->Control = 64;
7410    irpSp___0->Control = (int )irpSp___0->Control | 128;
7411    irpSp___0->Control = (int )irpSp___0->Control | 32;
7412    tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
7413    }
7414    return (tmp);
7415  } else {
7416    {
7417    tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp);
7418    }
7419    return (tmp___0);
7420  }
7421  return (-1073741823L);
7422}
7423}
7424NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7425{ PCD_DEVICE_EXTENSION deviceExtension ;
7426  KEVENT event ;
7427  NTSTATUS status ;
7428  PIO_STACK_LOCATION irpSp ;
7429  PIO_STACK_LOCATION nextIrpSp ;
7430  PIO_STACK_LOCATION irpSp___0 ;
7431
7432  {
7433  {
7434/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
7435  deviceExtension = (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
7436  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
7437  nextIrpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7438  memcpy(nextIrpSp, irpSp, (long )(& ((IO_STACK_LOCATION *)0)->CompletionRoutine));
7439  nextIrpSp->Control = 0;
7440  }
7441  if (s != NP) {
7442    {
7443    errorFn();
7444    }
7445  } else {
7446    if (compRegistered != 0) {
7447      {
7448      errorFn();
7449      }
7450    } else {
7451      compRegistered = 1;
7452      routine = 1;
7453      compFptr = & CdAudioSignalCompletion;
7454    }
7455  }
7456  {
7457  irpSp___0 = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation - 1;
7458  irpSp___0->CompletionRoutine = & CdAudioSignalCompletion;
7459  irpSp___0->Context = & event;
7460  irpSp___0->Control = 0;
7461  irpSp___0->Control = 64;
7462  irpSp___0->Control = (int )irpSp___0->Control | 128;
7463  irpSp___0->Control = (int )irpSp___0->Control | 32;
7464  status = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
7465  status = 259L;
7466  }
7467  if (status) {
7468    {
7469    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
7470    status = Irp->IoStatus.__annonCompField4.Status;
7471    status = myStatus;
7472    }
7473  } else {
7474
7475  }
7476  return (status);
7477}
7478}
7479void CdAudioUnload(PDRIVER_OBJECT DriverObject ) 
7480{ 
7481
7482  {
7483  return;
7484}
7485}
7486NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
7487{ PCD_DEVICE_EXTENSION deviceExtension ;
7488  NTSTATUS tmp ;
7489
7490  {
7491  {
7492/*   PoStartNextPowerIrp(Irp); */ /* INLINED */
7493  }
7494  if (s == NP) {
7495    s = SKIP1;
7496  } else {
7497    {
7498    errorFn();
7499    }
7500  }
7501  {
7502  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
7503  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
7504  deviceExtension = (struct _CD_DEVICE_EXTENSION *)DeviceObject->DeviceExtension;
7505  tmp = PoCallDriver(deviceExtension->TargetDeviceObject, Irp);
7506  }
7507  return (tmp);
7508}
7509}
7510#pragma once
7511#pragma once
7512#pragma once
7513#pragma once
7514#pragma warning(push)
7515#pragma warning(disable:4035)
7516#pragma warning(pop)
7517#pragma once
7518#pragma warning(disable:4103)
7519#pragma warning(disable:4103)
7520#pragma warning(push)
7521#pragma warning(disable:4035)
7522#pragma warning(pop)
7523#pragma warning(disable:4035)
7524#pragma warning(push)
7525#pragma warning(disable:4164)
7526#pragma function(_enable)
7527#pragma function(_disable)
7528#pragma warning(pop)
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:4103)
7535#pragma warning(disable:4200)
7536#pragma warning(default:4200)
7537IRP *pirp  ;
7538void stub_driver_init(void) 
7539{ 
7540
7541  {
7542  s = NP;
7543  customIrp = 0;
7544  setEventCalled = customIrp;
7545  lowerDriverReturn = setEventCalled;
7546  compRegistered = lowerDriverReturn;
7547  compFptr = compRegistered;
7548  pended = compFptr;
7549  return;
7550}
7551}
7552int main(void) 
7553{ DRIVER_OBJECT d ;
7554  NTSTATUS status = __VERIFIER_nondet_long() ;
7555  IRP irp ;
7556  int we_should_unload = __VERIFIER_nondet_int() ;
7557  int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7558  int irp_choice = __VERIFIER_nondet_int() ;
7559  DEVICE_OBJECT devobj ;
7560  devobj.DeviceExtension = malloc(sizeof (CD_DEVICE_EXTENSION));
7561  irp.Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation = malloc(sizeof (IO_STACK_LOCATION));
7562  irp.AssociatedIrp.SystemBuffer = malloc(sizeof (CDROM_TOC));
7563
7564  {
7565  {
7566  pirp = & irp;
7567  _BLAST_init();
7568  }
7569  if (status >= 0L) {
7570    s = NP;
7571    customIrp = 0;
7572    setEventCalled = customIrp;
7573    lowerDriverReturn = setEventCalled;
7574    compRegistered = lowerDriverReturn;
7575    compFptr = compRegistered;
7576    pended = compFptr;
7577    pirp->IoStatus.__annonCompField4.Status = 0L;
7578    myStatus = 0L;
7579    if (irp_choice == 0) {
7580      pirp->IoStatus.__annonCompField4.Status = -1073741637L;
7581      myStatus = -1073741637L;
7582    } else {
7583
7584    }
7585    {
7586    stub_driver_init();
7587    }
7588    if (! (status >= 0L)) {
7589      return (-1);
7590    } else {
7591
7592    }
7593    if (__BLAST_NONDET___0 == 2) {
7594      goto switch_22_2;
7595    } else {
7596      if (__BLAST_NONDET___0 == 3) {
7597        goto switch_22_3;
7598      } else {
7599        if (__BLAST_NONDET___0 == 4) {
7600          goto switch_22_4;
7601        } else {
7602          {
7603          goto switch_22_default;
7604          if (0) {
7605            switch_22_2: /* CIL Label */ 
7606            {
7607            status = CdAudioDeviceControl(& devobj, pirp);
7608            }
7609            goto switch_22_break;
7610            switch_22_3: /* CIL Label */ 
7611            {
7612            status = CdAudioPnp(& devobj, pirp);
7613            }
7614            goto switch_22_break;
7615            switch_22_4: /* CIL Label */ 
7616            {
7617            status = CdAudioPower(& devobj, pirp);
7618            }
7619            goto switch_22_break;
7620            switch_22_default: /* CIL Label */ ;
7621            return (-1);
7622          } else {
7623            switch_22_break: /* CIL Label */ ;
7624          }
7625          }
7626        }
7627      }
7628    }
7629    if (we_should_unload) {
7630      {
7631/*       CdAudioUnload(& d); */ /* INLINED */
7632      }
7633    } else {
7634
7635    }
7636  } else {
7637
7638  }
7639  if (pended == 1) {
7640    if (s == NP) {
7641      s = NP;
7642    } else {
7643      goto _L___2;
7644    }
7645  } else {
7646    _L___2: /* CIL Label */ 
7647    if (pended == 1) {
7648      if (s == MPR3) {
7649        s = MPR3;
7650      } else {
7651        goto _L___1;
7652      }
7653    } else {
7654      _L___1: /* CIL Label */ 
7655      if (s == UNLOADED) {
7656
7657      } else {
7658        if (status == -1L) {
7659
7660        } else {
7661          if (s != SKIP2) {
7662            if (s != IPC) {
7663              if (s != DC) {
7664                {
7665                errorFn();
7666                }
7667              } else {
7668                goto _L___0;
7669              }
7670            } else {
7671              goto _L___0;
7672            }
7673          } else {
7674            _L___0: /* CIL Label */ 
7675            if (pended == 1) {
7676              if (status != 259L) {
7677                {
7678                errorFn();
7679                }
7680              } else {
7681
7682              }
7683            } else {
7684              if (s == DC) {
7685                {
7686                errorFn();
7687                }
7688              } else {
7689                if (status != (NTSTATUS )lowerDriverReturn) {
7690                  {
7691                  errorFn();
7692                  }
7693                } else {
7694
7695                }
7696              }
7697            }
7698          }
7699        }
7700      }
7701    }
7702  }
7703  return (status);
7704}
7705}
7706char _SLAM_alloc_dummy  ;
7707extern int ( /* missing proto */  malloc)() ;
7708char *nondet_malloc(int i ) 
7709{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7710  int tmp ;
7711
7712  {
7713  if (__BLAST_NONDET___0) {
7714    return ((char *)0);
7715  } else {
7716    {
7717    tmp = malloc(i);
7718    }
7719    return ((char *)tmp);
7720  }
7721}
7722}
7723  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
7724void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) 
7725{ 
7726
7727  {
7728  return;
7729}
7730}
7731  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
7732void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) 
7733{ 
7734
7735  {
7736  return;
7737}
7738}
7739  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
7740                                                                                            SIZE_T NumberOfBytes ,
7741                                                                                            ULONG Tag ) ;
7742PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType , SIZE_T NumberOfBytes ,
7743                                                            ULONG Tag ) 
7744{ PVOID x ;
7745  char *tmp ;
7746
7747  {
7748  {
7749  tmp = nondet_malloc(NumberOfBytes);
7750  x = tmp;
7751  }
7752  return (x);
7753}
7754}
7755  void ExFreePool(PVOID P ) ;
7756void ExFreePool(PVOID P ) 
7757{ 
7758
7759  {
7760  return;
7761}
7762}
7763  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
7764                                                                                                          PLIST_ENTRY ListEntry ,
7765                                                                                                          PKSPIN_LOCK Lock ) ;
7766PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
7767                                                                          PLIST_ENTRY ListEntry ,
7768                                                                          PKSPIN_LOCK Lock ) 
7769{ 
7770
7771  {
7772  return ((void *)0);
7773}
7774}
7775  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
7776                                                                                                          PLIST_ENTRY ListEntry ,
7777                                                                                                          PKSPIN_LOCK Lock ) ;
7778PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
7779                                                                          PLIST_ENTRY ListEntry ,
7780                                                                          PKSPIN_LOCK Lock ) 
7781{ 
7782
7783  {
7784  return ((void *)0);
7785}
7786}
7787  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
7788                                                                                                          PKSPIN_LOCK Lock ) ;
7789PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
7790                                                                          PKSPIN_LOCK Lock ) 
7791{ 
7792
7793  {
7794  return ((void *)0);
7795}
7796}
7797  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
7798                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
7799                                                   PIRP Irp ) ;
7800PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length , BOOLEAN SecondaryBuffer ,
7801                   BOOLEAN ChargeQuota , PIRP Irp ) 
7802{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7803  char *tmp ;
7804
7805  {
7806  if (__BLAST_NONDET___0 == 0) {
7807    goto switch_23_0;
7808  } else {
7809    {
7810    goto switch_23_default;
7811    if (0) {
7812      switch_23_0: /* CIL Label */ 
7813      {
7814      tmp = nondet_malloc(sizeof(MDL ));
7815      }
7816      return ((void *)tmp);
7817      switch_23_default: /* CIL Label */ ;
7818      return ((void *)0);
7819    } else {
7820      switch_23_break: /* CIL Label */ ;
7821    }
7822    }
7823  }
7824}
7825}
7826  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
7827                                                                           PDEVICE_OBJECT TargetDevice ) ;
7828PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice , PDEVICE_OBJECT TargetDevice ) 
7829{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7830
7831  {
7832  if (__BLAST_NONDET___0 == 0) {
7833    goto switch_24_0;
7834  } else {
7835    {
7836    goto switch_24_default;
7837    if (0) {
7838      switch_24_0: /* CIL Label */ ;
7839      return (TargetDevice);
7840      switch_24_default: /* CIL Label */ ;
7841      return ((void *)0);
7842    } else {
7843      switch_24_break: /* CIL Label */ ;
7844    }
7845    }
7846  }
7847}
7848}
7849  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
7850                                                                   PDEVICE_OBJECT DeviceObject ,
7851                                                                   PVOID Buffer ,
7852                                                                   ULONG Length ,
7853                                                                   PLARGE_INTEGER StartingOffset ,
7854                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
7855PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction , PDEVICE_OBJECT DeviceObject ,
7856                                   PVOID Buffer , ULONG Length , PLARGE_INTEGER StartingOffset ,
7857                                   PIO_STATUS_BLOCK IoStatusBlock ) 
7858{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7859  int tmp ;
7860
7861  {
7862  customIrp = 1;
7863  if (__BLAST_NONDET___0 == 0) {
7864    goto switch_25_0;
7865  } else {
7866    {
7867    goto switch_25_default;
7868    if (0) {
7869      switch_25_0: /* CIL Label */ 
7870      {
7871      tmp = malloc(sizeof(IRP ));
7872      }
7873      return ((void *)tmp);
7874      switch_25_default: /* CIL Label */ ;
7875      return ((void *)0);
7876    } else {
7877      switch_25_break: /* CIL Label */ ;
7878    }
7879    }
7880  }
7881}
7882}
7883  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
7884                                                                   PDEVICE_OBJECT DeviceObject ,
7885                                                                   PVOID InputBuffer ,
7886                                                                   ULONG InputBufferLength ,
7887                                                                   PVOID OutputBuffer ,
7888                                                                   ULONG OutputBufferLength ,
7889                                                                   BOOLEAN InternalDeviceIoControl ,
7890                                                                   PKEVENT Event ,
7891                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
7892PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode , PDEVICE_OBJECT DeviceObject ,
7893                                   PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
7894                                   ULONG OutputBufferLength , BOOLEAN InternalDeviceIoControl ,
7895                                   PKEVENT Event , PIO_STATUS_BLOCK IoStatusBlock ) 
7896{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7897  int tmp ;
7898
7899  {
7900  customIrp = 1;
7901  if (__BLAST_NONDET___0 == 0) {
7902    goto switch_26_0;
7903  } else {
7904    {
7905    goto switch_26_default;
7906    if (0) {
7907      switch_26_0: /* CIL Label */ 
7908      {
7909      tmp = malloc(sizeof(IRP ));
7910      }
7911      return ((void *)tmp);
7912      switch_26_default: /* CIL Label */ ;
7913      return ((void *)0);
7914    } else {
7915      switch_26_break: /* CIL Label */ ;
7916    }
7917    }
7918  }
7919}
7920}
7921  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
7922                                                        ULONG DeviceExtensionSize ,
7923                                                        PUNICODE_STRING DeviceName ,
7924                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
7925                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
7926NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject , ULONG DeviceExtensionSize ,
7927                        PUNICODE_STRING DeviceName , ULONG DeviceType , ULONG DeviceCharacteristics ,
7928                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) 
7929{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7930  int tmp ;
7931
7932  {
7933  if (__BLAST_NONDET___0 == 0) {
7934    goto switch_27_0;
7935  } else {
7936    {
7937    goto switch_27_default;
7938    if (0) {
7939      switch_27_0: /* CIL Label */ 
7940      {
7941      tmp = malloc(sizeof(DEVICE_OBJECT ));
7942      *DeviceObject = (void *)tmp;
7943      }
7944      return (0L);
7945      switch_27_default: /* CIL Label */ ;
7946      return (-1073741823L);
7947    } else {
7948      switch_27_break: /* CIL Label */ ;
7949    }
7950    }
7951  }
7952}
7953}
7954  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
7955                                                              PUNICODE_STRING DeviceName ) ;
7956NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName , PUNICODE_STRING DeviceName ) 
7957{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7958
7959  {
7960  if (__BLAST_NONDET___0 == 0) {
7961    goto switch_28_0;
7962  } else {
7963    {
7964    goto switch_28_default;
7965    if (0) {
7966      switch_28_0: /* CIL Label */ ;
7967      return (0L);
7968      switch_28_default: /* CIL Label */ ;
7969      return (-1073741823L);
7970    } else {
7971      switch_28_break: /* CIL Label */ ;
7972    }
7973    }
7974  }
7975}
7976}
7977  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
7978void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) 
7979{ 
7980
7981  {
7982  return;
7983}
7984}
7985  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
7986NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) 
7987{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
7988
7989  {
7990  if (__BLAST_NONDET___0 == 0) {
7991    goto switch_29_0;
7992  } else {
7993    {
7994    goto switch_29_default;
7995    if (0) {
7996      switch_29_0: /* CIL Label */ ;
7997      return (0L);
7998      switch_29_default: /* CIL Label */ ;
7999      return (-1073741823L);
8000    } else {
8001      switch_29_break: /* CIL Label */ ;
8002    }
8003    }
8004  }
8005}
8006}
8007  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
8008void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) 
8009{ 
8010
8011  {
8012  return;
8013}
8014}
8015  void IoFreeIrp(PIRP Irp ) ;
8016void IoFreeIrp(PIRP Irp ) 
8017{ 
8018
8019  {
8020  return;
8021}
8022}
8023  void IoFreeMdl(PMDL Mdl ) ;
8024void IoFreeMdl(PMDL Mdl ) 
8025{ 
8026
8027  {
8028  return;
8029}
8030}
8031  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
8032PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) 
8033{ char *tmp ;
8034
8035  {
8036  {
8037  tmp = nondet_malloc(sizeof(CONFIGURATION_INFORMATION ));
8038  }
8039  return ((void *)tmp);
8040}
8041}
8042  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
8043                                                                  PULONG BusNumber ,
8044                                                                  PCONFIGURATION_TYPE ControllerType ,
8045                                                                  PULONG ControllerNumber ,
8046                                                                  PCONFIGURATION_TYPE PeripheralType ,
8047                                                                  PULONG PeripheralNumber ,
8048                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
8049                                                                                             PUNICODE_STRING PathName ,
8050                                                                                             INTERFACE_TYPE BusType ,
8051                                                                                             ULONG BusNumber ,
8052                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
8053                                                                                             CONFIGURATION_TYPE ControllerType ,
8054                                                                                             ULONG ControllerNumber ,
8055                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
8056                                                                                             CONFIGURATION_TYPE PeripheralType ,
8057                                                                                             ULONG PeripheralNumber ,
8058                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
8059                                                                  PVOID Context ) ;
8060NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType , PULONG BusNumber , PCONFIGURATION_TYPE ControllerType ,
8061                                  PULONG ControllerNumber , PCONFIGURATION_TYPE PeripheralType ,
8062                                  PULONG PeripheralNumber , NTSTATUS (*CalloutRoutine)(PVOID Context ,
8063                                                                                       PUNICODE_STRING PathName ,
8064                                                                                       INTERFACE_TYPE BusType ,
8065                                                                                       ULONG BusNumber ,
8066                                                                                       PKEY_VALUE_FULL_INFORMATION *BusInformation ,
8067                                                                                       CONFIGURATION_TYPE ControllerType ,
8068                                                                                       ULONG ControllerNumber ,
8069                                                                                       PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
8070                                                                                       CONFIGURATION_TYPE PeripheralType ,
8071                                                                                       ULONG PeripheralNumber ,
8072                                                                                       PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
8073                                  PVOID Context ) 
8074{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8075
8076  {
8077  if (__BLAST_NONDET___0 == 0) {
8078    goto switch_30_0;
8079  } else {
8080    {
8081    goto switch_30_default;
8082    if (0) {
8083      switch_30_0: /* CIL Label */ ;
8084      return (0L);
8085      switch_30_default: /* CIL Label */ ;
8086      return (-1073741823L);
8087    } else {
8088      switch_30_break: /* CIL Label */ ;
8089    }
8090    }
8091  }
8092}
8093}
8094  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
8095                                                                                                   GUID const   *InterfaceClassGuid ,
8096                                                                                                   PUNICODE_STRING ReferenceString ,
8097                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
8098NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
8099                                                                   GUID const   *InterfaceClassGuid ,
8100                                                                   PUNICODE_STRING ReferenceString ,
8101                                                                   PUNICODE_STRING SymbolicLinkName ) 
8102{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8103
8104  {
8105  if (__BLAST_NONDET___0 == 0) {
8106    goto switch_31_0;
8107  } else {
8108    {
8109    goto switch_31_default;
8110    if (0) {
8111      switch_31_0: /* CIL Label */ ;
8112      return (0L);
8113      switch_31_default: /* CIL Label */ ;
8114      return (-1073741808L);
8115    } else {
8116      switch_31_break: /* CIL Label */ ;
8117    }
8118    }
8119  }
8120}
8121}
8122  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
8123void IoReleaseCancelSpinLock(KIRQL Irql ) 
8124{ 
8125
8126  {
8127  return;
8128}
8129}
8130  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
8131                                                                   BOOLEAN Enable ) ;
8132NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName , BOOLEAN Enable ) 
8133{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8134
8135  {
8136  if (__BLAST_NONDET___0 == 0) {
8137    goto switch_32_0;
8138  } else {
8139    {
8140    goto switch_32_default;
8141    if (0) {
8142      switch_32_0: /* CIL Label */ ;
8143      return (0L);
8144      switch_32_default: /* CIL Label */ ;
8145      return (-1073741823L);
8146    } else {
8147      switch_32_break: /* CIL Label */ ;
8148    }
8149    }
8150  }
8151}
8152}
8153  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
8154void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) 
8155{ 
8156
8157  {
8158  return;
8159}
8160}
8161void stubMoreProcessingRequired(void) 
8162{ 
8163
8164  {
8165  if (s == NP) {
8166    s = MPR1;
8167  } else {
8168    {
8169    errorFn();
8170    }
8171  }
8172  return;
8173}
8174}
8175  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
8176                                                                                        PIRP Irp ) ;
8177NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
8178                                                        PIRP Irp ) 
8179{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8180  NTSTATUS returnVal2 ;
8181  int compRetStatus ;
8182  PVOID lcontext = __VERIFIER_nondet_pointer() ;
8183  NTSTATUS tmp ;
8184  NTSTATUS tmp___0 ;
8185
8186  {
8187  if (compRegistered) {
8188    if (routine == 0) {
8189      {
8190      tmp = HPCdrCompletion(DeviceObject, Irp, lcontext);
8191      compRetStatus = tmp;
8192      }
8193    } else {
8194      if (routine == 1) {
8195        {
8196        tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext);
8197        compRetStatus = tmp___0;
8198        }
8199      } else {
8200
8201      }
8202    }
8203    if ((long )compRetStatus == -1073741802L) {
8204      {
8205      stubMoreProcessingRequired();
8206      }
8207    } else {
8208
8209    }
8210  } else {
8211
8212  }
8213  if (myIrp_PendingReturned) {
8214    returnVal2 = 259L;
8215  } else {
8216    if (__BLAST_NONDET___0 == 0) {
8217      goto switch_33_0;
8218    } else {
8219      if (__BLAST_NONDET___0 == 1) {
8220        goto switch_33_1;
8221      } else {
8222        {
8223        goto switch_33_default;
8224        if (0) {
8225          switch_33_0: /* CIL Label */ 
8226          returnVal2 = 0L;
8227          goto switch_33_break;
8228          switch_33_1: /* CIL Label */ 
8229          returnVal2 = -1073741823L;
8230          goto switch_33_break;
8231          switch_33_default: /* CIL Label */ 
8232          returnVal2 = 259L;
8233          goto switch_33_break;
8234        } else {
8235          switch_33_break: /* CIL Label */ ;
8236        }
8237        }
8238      }
8239    }
8240  }
8241  if (s == NP) {
8242    s = IPC;
8243    lowerDriverReturn = returnVal2;
8244  } else {
8245    if (s == MPR1) {
8246      if (returnVal2 == 259L) {
8247        s = MPR3;
8248        lowerDriverReturn = returnVal2;
8249      } else {
8250        s = NP;
8251        lowerDriverReturn = returnVal2;
8252      }
8253    } else {
8254      if (s == SKIP1) {
8255        s = SKIP2;
8256        lowerDriverReturn = returnVal2;
8257      } else {
8258        {
8259        errorFn();
8260        }
8261      }
8262    }
8263  }
8264  return (returnVal2);
8265}
8266}
8267  void IofCompleteRequest(PIRP Irp ,
8268                                                                                         CCHAR PriorityBoost ) ;
8269void IofCompleteRequest(PIRP Irp , CCHAR PriorityBoost ) 
8270{ 
8271
8272  {
8273  if (s == NP) {
8274    s = DC;
8275  } else {
8276    {
8277    errorFn();
8278    }
8279  }
8280  return;
8281}
8282}
8283  KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) ;
8284KIRQL KeAcquireSpinLockRaiseToDpc(PKSPIN_LOCK SpinLock ) 
8285{ 
8286
8287  {
8288  return ((unsigned char)0);
8289}
8290}
8291  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
8292                                                                BOOLEAN Alertable ,
8293                                                                PLARGE_INTEGER Interval ) ;
8294NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode , BOOLEAN Alertable , PLARGE_INTEGER Interval ) 
8295{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8296
8297  {
8298  if (__BLAST_NONDET___0 == 0) {
8299    goto switch_34_0;
8300  } else {
8301    {
8302    goto switch_34_default;
8303    if (0) {
8304      switch_34_0: /* CIL Label */ ;
8305      return (0L);
8306      switch_34_default: /* CIL Label */ ;
8307      return (-1073741823L);
8308    } else {
8309      switch_34_break: /* CIL Label */ ;
8310    }
8311    }
8312  }
8313}
8314}
8315  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
8316                                                       BOOLEAN State ) ;
8317void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type , BOOLEAN State ) 
8318{ 
8319
8320  {
8321  return;
8322}
8323}
8324  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
8325                                                           LONG Count , LONG Limit ) ;
8326void KeInitializeSemaphore(PRKSEMAPHORE Semaphore , LONG Count , LONG Limit ) 
8327{ 
8328
8329  {
8330  return;
8331}
8332}
8333  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
8334void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) 
8335{ 
8336
8337  {
8338  return;
8339}
8340}
8341  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
8342                                                        LONG Adjustment , BOOLEAN Wait ) ;
8343LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment , LONG Adjustment ,
8344                        BOOLEAN Wait ) 
8345{ LONG r = __VERIFIER_nondet_long() ;
8346
8347  {
8348  return (r);
8349}
8350}
8351  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
8352                                                                                        KIRQL NewIrql ) ;
8353void KfReleaseSpinLock(PKSPIN_LOCK SpinLock , KIRQL NewIrql ) 
8354{ 
8355
8356  {
8357  return;
8358}
8359}
8360  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
8361                                                BOOLEAN Wait ) ;
8362LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment , BOOLEAN Wait ) 
8363{ LONG l = __VERIFIER_nondet_long() ;
8364
8365  {
8366  setEventCalled = 1;
8367  return (l);
8368}
8369}
8370  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
8371                                                               KPROCESSOR_MODE WaitMode ,
8372                                                               BOOLEAN Alertable ,
8373                                                               PLARGE_INTEGER Timeout ) ;
8374NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason , KPROCESSOR_MODE WaitMode ,
8375                               BOOLEAN Alertable , PLARGE_INTEGER Timeout ) 
8376{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8377
8378  {
8379  if (s == MPR3) {
8380    if (setEventCalled == 1) {
8381      s = NP;
8382      setEventCalled = 0;
8383    } else {
8384      goto _L;
8385    }
8386  } else {
8387    _L: /* CIL Label */ 
8388    if (customIrp == 1) {
8389      s = NP;
8390      customIrp = 0;
8391    } else {
8392      if (s == MPR3) {
8393        {
8394        errorFn();
8395        }
8396      } else {
8397
8398      }
8399    }
8400  }
8401  if (__BLAST_NONDET___0 == 0) {
8402    goto switch_35_0;
8403  } else {
8404    {
8405    goto switch_35_default;
8406    if (0) {
8407      switch_35_0: /* CIL Label */ ;
8408      return (0L);
8409      switch_35_default: /* CIL Label */ ;
8410      return (-1073741823L);
8411    } else {
8412      switch_35_break: /* CIL Label */ ;
8413    }
8414    }
8415  }
8416}
8417}
8418  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
8419                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
8420PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes , PHYSICAL_ADDRESS HighestAcceptableAddress ) 
8421{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8422  int tmp ;
8423
8424  {
8425  if (__BLAST_NONDET___0 == 0) {
8426    goto switch_36_0;
8427  } else {
8428    if (__BLAST_NONDET___0 == 1) {
8429      goto switch_36_1;
8430    } else {
8431      if (0) {
8432        switch_36_0: /* CIL Label */ 
8433        {
8434        tmp = malloc(NumberOfBytes);
8435        }
8436        return (tmp);
8437        switch_36_1: /* CIL Label */ ;
8438        return ((void *)0);
8439      } else {
8440        switch_36_break: /* CIL Label */ ;
8441      }
8442    }
8443  }
8444  return ((void *)0);
8445}
8446}
8447  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
8448void MmFreeContiguousMemory(PVOID BaseAddress ) 
8449{ 
8450
8451  {
8452  return;
8453}
8454}
8455  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
8456                                                                   KPROCESSOR_MODE AccessMode ,
8457                                                                   MEMORY_CACHING_TYPE CacheType ,
8458                                                                   PVOID BaseAddress ,
8459                                                                   ULONG BugCheckOnFailure ,
8460                                                                   MM_PAGE_PRIORITY Priority ) ;
8461PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList , KPROCESSOR_MODE AccessMode ,
8462                                   MEMORY_CACHING_TYPE CacheType , PVOID BaseAddress ,
8463                                   ULONG BugCheckOnFailure , MM_PAGE_PRIORITY Priority ) 
8464{ 
8465
8466  {
8467  return ((void *)0);
8468}
8469}
8470  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
8471PVOID MmPageEntireDriver(PVOID AddressWithinSection ) 
8472{ 
8473
8474  {
8475  return ((void *)0);
8476}
8477}
8478  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
8479void MmResetDriverPaging(PVOID AddressWithinSection ) 
8480{ 
8481
8482  {
8483  return;
8484}
8485}
8486  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
8487void MmUnlockPages(PMDL MemoryDescriptorList ) 
8488{ 
8489
8490  {
8491  return;
8492}
8493}
8494  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
8495                                                                   ACCESS_MASK DesiredAccess ,
8496                                                                   POBJECT_TYPE ObjectType ,
8497                                                                   KPROCESSOR_MODE AccessMode ,
8498                                                                   PVOID *Object ,
8499                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
8500NTSTATUS ObReferenceObjectByHandle(HANDLE Handle , ACCESS_MASK DesiredAccess , POBJECT_TYPE ObjectType ,
8501                                   KPROCESSOR_MODE AccessMode , PVOID *Object , POBJECT_HANDLE_INFORMATION HandleInformation ) 
8502{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8503
8504  {
8505  if (__BLAST_NONDET___0 == 0) {
8506    goto switch_37_0;
8507  } else {
8508    {
8509    goto switch_37_default;
8510    if (0) {
8511      switch_37_0: /* CIL Label */ ;
8512      return (0L);
8513      switch_37_default: /* CIL Label */ ;
8514      return (-1073741823L);
8515    } else {
8516      switch_37_break: /* CIL Label */ ;
8517    }
8518    }
8519  }
8520}
8521}
8522  void ObfDereferenceObject(PVOID Object ) ;
8523void ObfDereferenceObject(PVOID Object ) 
8524{ 
8525
8526  {
8527  return;
8528}
8529}
8530  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
8531                                                      PIRP Irp ) ;
8532NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
8533{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8534  int compRetStatus ;
8535  NTSTATUS returnVal ;
8536  PVOID lcontext = __VERIFIER_nondet_pointer() ;
8537  NTSTATUS tmp ;
8538  NTSTATUS tmp___0 ;
8539
8540  {
8541  if (compRegistered) {
8542    if (routine == 0) {
8543      {
8544      tmp = HPCdrCompletion(DeviceObject, Irp, lcontext);
8545      compRetStatus = tmp;
8546      }
8547    } else {
8548      if (routine == 1) {
8549        {
8550        tmp___0 = CdAudioSignalCompletion(DeviceObject, Irp, lcontext);
8551        compRetStatus = tmp___0;
8552        }
8553      } else {
8554
8555      }
8556    }
8557    if ((long )compRetStatus == -1073741802L) {
8558      {
8559      stubMoreProcessingRequired();
8560      }
8561    } else {
8562
8563    }
8564  } else {
8565
8566  }
8567  if (__BLAST_NONDET___0 == 0) {
8568    goto switch_38_0;
8569  } else {
8570    if (__BLAST_NONDET___0 == 1) {
8571      goto switch_38_1;
8572    } else {
8573      {
8574      goto switch_38_default;
8575      if (0) {
8576        switch_38_0: /* CIL Label */ 
8577        returnVal = 0L;
8578        goto switch_38_break;
8579        switch_38_1: /* CIL Label */ 
8580        returnVal = -1073741823L;
8581        goto switch_38_break;
8582        switch_38_default: /* CIL Label */ 
8583        returnVal = 259L;
8584        goto switch_38_break;
8585      } else {
8586        switch_38_break: /* CIL Label */ ;
8587      }
8588      }
8589    }
8590  }
8591  if (s == NP) {
8592    s = IPC;
8593    lowerDriverReturn = returnVal;
8594  } else {
8595    if (s == MPR1) {
8596      if (returnVal == 259L) {
8597        s = MPR3;
8598        lowerDriverReturn = returnVal;
8599      } else {
8600        s = NP;
8601        lowerDriverReturn = returnVal;
8602      }
8603    } else {
8604      if (s == SKIP1) {
8605        s = SKIP2;
8606        lowerDriverReturn = returnVal;
8607      } else {
8608        {
8609        errorFn();
8610        }
8611      }
8612    }
8613  }
8614  return (returnVal);
8615}
8616}
8617  void PoStartNextPowerIrp(PIRP Irp ) ;
8618void PoStartNextPowerIrp(PIRP Irp ) 
8619{ 
8620
8621  {
8622  return;
8623}
8624}
8625  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
8626                                                              ULONG DesiredAccess ,
8627                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
8628                                                              HANDLE ProcessHandle ,
8629                                                              PCLIENT_ID ClientId ,
8630                                                              void (*StartRoutine)(PVOID StartContext ) ,
8631                                                              PVOID StartContext ) ;
8632NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle , ULONG DesiredAccess , POBJECT_ATTRIBUTES ObjectAttributes ,
8633                              HANDLE ProcessHandle , PCLIENT_ID ClientId , void (*StartRoutine)(PVOID StartContext ) ,
8634                              PVOID StartContext ) 
8635{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8636
8637  {
8638  if (__BLAST_NONDET___0 == 0) {
8639    goto switch_39_0;
8640  } else {
8641    {
8642    goto switch_39_default;
8643    if (0) {
8644      switch_39_0: /* CIL Label */ ;
8645      return (0L);
8646      switch_39_default: /* CIL Label */ ;
8647      return (-1073741823L);
8648    } else {
8649      switch_39_break: /* CIL Label */ ;
8650    }
8651    }
8652  }
8653}
8654}
8655  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
8656NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) 
8657{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8658
8659  {
8660  if (__BLAST_NONDET___0 == 0) {
8661    goto switch_40_0;
8662  } else {
8663    {
8664    goto switch_40_default;
8665    if (0) {
8666      switch_40_0: /* CIL Label */ ;
8667      return (0L);
8668      switch_40_default: /* CIL Label */ ;
8669      return (-1073741823L);
8670    } else {
8671      switch_40_break: /* CIL Label */ ;
8672    }
8673    }
8674  }
8675}
8676}
8677  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
8678                                                                                                      PANSI_STRING SourceString ,
8679                                                                                                      BOOLEAN AllocateDestinationString ) ;
8680NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
8681                                                                      PANSI_STRING SourceString ,
8682                                                                      BOOLEAN AllocateDestinationString ) 
8683{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8684
8685  {
8686  if (__BLAST_NONDET___0 == 0) {
8687    goto switch_41_0;
8688  } else {
8689    {
8690    goto switch_41_default;
8691    if (0) {
8692      switch_41_0: /* CIL Label */ ;
8693      return (0L);
8694      switch_41_default: /* CIL Label */ ;
8695      return (-1073741823L);
8696    } else {
8697      switch_41_break: /* CIL Label */ ;
8698    }
8699    }
8700  }
8701}
8702}
8703  SIZE_T RtlCompareMemory(void const   *Source1 ,
8704                                                                                        void const   *Source2 ,
8705                                                                                        SIZE_T Length ) ;
8706SIZE_T RtlCompareMemory(void const   *Source1 , void const   *Source2 ,
8707                                                        SIZE_T Length ) 
8708{ SIZE_T r = __VERIFIER_nondet_long() ;
8709
8710  {
8711  return (r);
8712}
8713}
8714  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
8715                                                                                          PUNICODE_STRING SourceString ) ;
8716void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
8717                                                          PUNICODE_STRING SourceString ) 
8718{ 
8719
8720  {
8721  return;
8722}
8723}
8724  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
8725                                                                                                PCWSTR Path ,
8726                                                                                                PCWSTR ValueName ) ;
8727NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
8728                                                                PCWSTR Path , PCWSTR ValueName ) 
8729{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8730
8731  {
8732  if (__BLAST_NONDET___0 == 0) {
8733    goto switch_42_0;
8734  } else {
8735    {
8736    goto switch_42_default;
8737    if (0) {
8738      switch_42_0: /* CIL Label */ ;
8739      return (0L);
8740      switch_42_default: /* CIL Label */ ;
8741      return (-1073741823L);
8742    } else {
8743      switch_42_break: /* CIL Label */ ;
8744    }
8745    }
8746  }
8747}
8748}
8749  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
8750void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) 
8751{ 
8752
8753  {
8754  return;
8755}
8756}
8757  void RtlInitString(PSTRING DestinationString ,
8758                                                                                   PCSZ SourceString ) ;
8759void RtlInitString(PSTRING DestinationString , PCSZ SourceString ) 
8760{ 
8761
8762  {
8763  return;
8764}
8765}
8766  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
8767                                                                                          PCWSTR SourceString ) ;
8768void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
8769                                                          PCWSTR SourceString ) 
8770{ 
8771
8772  {
8773  return;
8774}
8775}
8776  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
8777                                                                                                PCWSTR Path ,
8778                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
8779                                                                                                PVOID Context ,
8780                                                                                                PVOID Environment ) ;
8781NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
8782                                                                PCWSTR Path , PRTL_QUERY_REGISTRY_TABLE QueryTable ,
8783                                                                PVOID Context , PVOID Environment ) 
8784{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8785
8786  {
8787  if (__BLAST_NONDET___0 == 0) {
8788    goto switch_43_0;
8789  } else {
8790    {
8791    goto switch_43_default;
8792    if (0) {
8793      switch_43_0: /* CIL Label */ ;
8794      return (0L);
8795      switch_43_default: /* CIL Label */ ;
8796      return (-1073741823L);
8797    } else {
8798      switch_43_break: /* CIL Label */ ;
8799    }
8800    }
8801  }
8802}
8803}
8804  NTSTATUS ZwClose(HANDLE Handle ) ;
8805NTSTATUS ZwClose(HANDLE Handle ) 
8806{ int __BLAST_NONDET___0 = __VERIFIER_nondet_int() ;
8807
8808  {
8809  if (__BLAST_NONDET___0 == 0) {
8810    goto switch_44_0;
8811  } else {
8812    {
8813    goto switch_44_default;
8814    if (0) {
8815      switch_44_0: /* CIL Label */ ;
8816      return (0L);
8817      switch_44_default: /* CIL Label */ ;
8818      return (-1073741823L);
8819    } else {
8820      switch_44_break: /* CIL Label */ ;
8821    }
8822    }
8823  }
8824}
8825}