Showing error 25

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.BUG.i.cil.c
Line in file: 2835
Project: SV-COMP 2012
Tools: Manual Work
Entered: 2012-11-19 13:47:39 UTC


Source:

   1/* Generated by CIL v. 1.3.6 */
   2/* print_CIL_Input is true */
   3
   4#pragma pack(push,8)
   5#pragma pack(pop)
   6typedef unsigned short wchar_t;
   7typedef unsigned long ULONG_PTR;
   8typedef unsigned long *PULONG_PTR;
   9typedef ULONG_PTR SIZE_T;
  10typedef void *PVOID;
  11typedef char CHAR;
  12typedef short SHORT;
  13typedef long LONG;
  14typedef wchar_t WCHAR;
  15typedef WCHAR *PWSTR;
  16typedef WCHAR const   *PCWSTR;
  17typedef CHAR *PCHAR;
  18typedef LONG *PLONG;
  19typedef unsigned char UCHAR;
  20typedef unsigned short USHORT;
  21typedef unsigned long ULONG;
  22typedef UCHAR *PUCHAR;
  23typedef ULONG *PULONG;
  24typedef void *HANDLE;
  25typedef HANDLE *PHANDLE;
  26typedef char CCHAR;
  27typedef short CSHORT;
  28typedef ULONG LCID;
  29typedef LONG NTSTATUS;
  30typedef long long LONGLONG;
  31typedef unsigned long long ULONGLONG;
  32struct __anonstruct____missing_field_name_1 {
  33   ULONG LowPart ;
  34   LONG HighPart ;
  35};
  36struct __anonstruct_u_2 {
  37   ULONG LowPart ;
  38   LONG HighPart ;
  39};
  40union _LARGE_INTEGER {
  41   struct __anonstruct____missing_field_name_1 __annonCompField1 ;
  42   struct __anonstruct_u_2 u ;
  43   LONGLONG QuadPart ;
  44};
  45typedef union _LARGE_INTEGER LARGE_INTEGER;
  46typedef LARGE_INTEGER *PLARGE_INTEGER;
  47struct __anonstruct____missing_field_name_3 {
  48   ULONG LowPart ;
  49   ULONG HighPart ;
  50};
  51struct __anonstruct_u_4 {
  52   ULONG LowPart ;
  53   ULONG HighPart ;
  54};
  55union _ULARGE_INTEGER {
  56   struct __anonstruct____missing_field_name_3 __annonCompField2 ;
  57   struct __anonstruct_u_4 u ;
  58   ULONGLONG QuadPart ;
  59};
  60typedef union _ULARGE_INTEGER ULARGE_INTEGER;
  61struct _LUID {
  62   ULONG LowPart ;
  63   LONG HighPart ;
  64};
  65typedef struct _LUID LUID;
  66typedef LARGE_INTEGER PHYSICAL_ADDRESS;
  67enum _EVENT_TYPE {
  68    NotificationEvent = 0,
  69    SynchronizationEvent = 1
  70} ;
  71typedef enum _EVENT_TYPE EVENT_TYPE;
  72typedef char const   *PCSZ;
  73struct _STRING {
  74   USHORT Length ;
  75   USHORT MaximumLength ;
  76   PCHAR Buffer ;
  77};
  78typedef struct _STRING STRING;
  79typedef STRING *PSTRING;
  80typedef PSTRING PANSI_STRING;
  81struct _UNICODE_STRING {
  82   USHORT Length ;
  83   USHORT MaximumLength ;
  84   PWSTR Buffer ;
  85};
  86typedef struct _UNICODE_STRING UNICODE_STRING;
  87typedef UNICODE_STRING *PUNICODE_STRING;
  88typedef UCHAR BOOLEAN;
  89struct _LIST_ENTRY {
  90   struct _LIST_ENTRY *Flink ;
  91   struct _LIST_ENTRY *Blink ;
  92};
  93typedef struct _LIST_ENTRY LIST_ENTRY;
  94typedef struct _LIST_ENTRY *PLIST_ENTRY;
  95struct _OBJECT_ATTRIBUTES {
  96   ULONG Length ;
  97   HANDLE RootDirectory ;
  98   PUNICODE_STRING ObjectName ;
  99   ULONG Attributes ;
 100   PVOID SecurityDescriptor ;
 101   PVOID SecurityQualityOfService ;
 102};
 103typedef struct _OBJECT_ATTRIBUTES OBJECT_ATTRIBUTES;
 104typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
 105struct _GUID {
 106   unsigned long Data1 ;
 107   unsigned short Data2 ;
 108   unsigned short Data3 ;
 109   unsigned char Data4[8] ;
 110};
 111typedef struct _GUID GUID;
 112typedef unsigned int size_t;
 113typedef UCHAR KIRQL;
 114struct _KTHREAD;
 115typedef struct _KTHREAD *PKTHREAD;
 116struct _ETHREAD;
 117typedef struct _ETHREAD *PETHREAD;
 118struct _EPROCESS;
 119typedef struct _EPROCESS *PEPROCESS;
 120struct _IO_TIMER;
 121typedef struct _IO_TIMER *PIO_TIMER;
 122struct _OBJECT_TYPE;
 123typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 124typedef CCHAR KPROCESSOR_MODE;
 125struct _KAPC;
 126struct _KAPC;
 127typedef void (*PKNORMAL_ROUTINE)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 );
 128struct _KAPC {
 129   CSHORT Type ;
 130   CSHORT Size ;
 131   ULONG Spare0 ;
 132   struct _KTHREAD *Thread ;
 133   LIST_ENTRY ApcListEntry ;
 134   void (*KernelRoutine)(struct _KAPC *Apc , PKNORMAL_ROUTINE *NormalRoutine , PVOID *NormalContext ,
 135                         PVOID *SystemArgument1 , PVOID *SystemArgument2 ) ;
 136   void (*RundownRoutine)(struct _KAPC *Apc ) ;
 137   void (*NormalRoutine)(PVOID NormalContext , PVOID SystemArgument1 , PVOID SystemArgument2 ) ;
 138   PVOID NormalContext ;
 139   PVOID SystemArgument1 ;
 140   PVOID SystemArgument2 ;
 141   CCHAR ApcStateIndex ;
 142   KPROCESSOR_MODE ApcMode ;
 143   BOOLEAN Inserted ;
 144};
 145typedef struct _KAPC KAPC;
 146struct _KDPC;
 147struct _KDPC;
 148struct _KDPC {
 149   CSHORT Type ;
 150   UCHAR Number ;
 151   UCHAR Importance ;
 152   LIST_ENTRY DpcListEntry ;
 153   void (*DeferredRoutine)(struct _KDPC *Dpc , PVOID DeferredContext , PVOID SystemArgument1 ,
 154                           PVOID SystemArgument2 ) ;
 155   PVOID DeferredContext ;
 156   PVOID SystemArgument1 ;
 157   PVOID SystemArgument2 ;
 158   PULONG_PTR Lock ;
 159};
 160typedef struct _KDPC KDPC;
 161typedef struct _KDPC *PKDPC;
 162typedef struct _KDPC *PRKDPC;
 163struct _MDL {
 164   struct _MDL *Next ;
 165   CSHORT Size ;
 166   CSHORT MdlFlags ;
 167   struct _EPROCESS *Process ;
 168   PVOID MappedSystemVa ;
 169   PVOID StartVa ;
 170   ULONG ByteCount ;
 171   ULONG ByteOffset ;
 172};
 173typedef struct _MDL MDL;
 174typedef struct _MDL *PMDL;
 175typedef PVOID PACCESS_TOKEN;
 176typedef PVOID PSECURITY_DESCRIPTOR;
 177typedef ULONG ACCESS_MASK;
 178#pragma pack(push,4)
 179struct _LUID_AND_ATTRIBUTES {
 180   LUID Luid ;
 181   ULONG Attributes ;
 182};
 183typedef struct _LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES;
 184#pragma pack(pop)
 185struct _PRIVILEGE_SET {
 186   ULONG PrivilegeCount ;
 187   ULONG Control ;
 188   LUID_AND_ATTRIBUTES Privilege[1] ;
 189};
 190typedef struct _PRIVILEGE_SET PRIVILEGE_SET;
 191enum _SECURITY_IMPERSONATION_LEVEL {
 192    SecurityAnonymous = 0,
 193    SecurityIdentification = 1,
 194    SecurityImpersonation = 2,
 195    SecurityDelegation = 3
 196} ;
 197typedef enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL;
 198typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE;
 199struct _SECURITY_QUALITY_OF_SERVICE {
 200   ULONG Length ;
 201   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 202   SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode ;
 203   BOOLEAN EffectiveOnly ;
 204};
 205typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE;
 206typedef ULONG SECURITY_INFORMATION;
 207typedef LONG KPRIORITY;
 208typedef ULONG_PTR KSPIN_LOCK;
 209typedef KSPIN_LOCK *PKSPIN_LOCK;
 210struct _RTL_QUERY_REGISTRY_TABLE {
 211   NTSTATUS (*QueryRoutine)(PWSTR ValueName , ULONG ValueType ,
 212                                                            PVOID ValueData , ULONG ValueLength ,
 213                                                            PVOID Context , PVOID EntryContext ) ;
 214   ULONG Flags ;
 215   PWSTR Name ;
 216   PVOID EntryContext ;
 217   ULONG DefaultType ;
 218   PVOID DefaultData ;
 219   ULONG DefaultLength ;
 220};
 221typedef struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE;
 222typedef struct _RTL_QUERY_REGISTRY_TABLE *PRTL_QUERY_REGISTRY_TABLE;
 223union __anonunion____missing_field_name_6 {
 224   NTSTATUS Status ;
 225   PVOID Pointer ;
 226};
 227struct _IO_STATUS_BLOCK {
 228   union __anonunion____missing_field_name_6 __annonCompField4 ;
 229   ULONG_PTR Information ;
 230};
 231typedef struct _IO_STATUS_BLOCK IO_STATUS_BLOCK;
 232typedef struct _IO_STATUS_BLOCK *PIO_STATUS_BLOCK;
 233enum _FILE_INFORMATION_CLASS {
 234    FileDirectoryInformation = 1,
 235    FileFullDirectoryInformation = 2,
 236    FileBothDirectoryInformation = 3,
 237    FileBasicInformation = 4,
 238    FileStandardInformation = 5,
 239    FileInternalInformation = 6,
 240    FileEaInformation = 7,
 241    FileAccessInformation = 8,
 242    FileNameInformation = 9,
 243    FileRenameInformation = 10,
 244    FileLinkInformation = 11,
 245    FileNamesInformation = 12,
 246    FileDispositionInformation = 13,
 247    FilePositionInformation = 14,
 248    FileFullEaInformation = 15,
 249    FileModeInformation = 16,
 250    FileAlignmentInformation = 17,
 251    FileAllInformation = 18,
 252    FileAllocationInformation = 19,
 253    FileEndOfFileInformation = 20,
 254    FileAlternateNameInformation = 21,
 255    FileStreamInformation = 22,
 256    FilePipeInformation = 23,
 257    FilePipeLocalInformation = 24,
 258    FilePipeRemoteInformation = 25,
 259    FileMailslotQueryInformation = 26,
 260    FileMailslotSetInformation = 27,
 261    FileCompressionInformation = 28,
 262    FileObjectIdInformation = 29,
 263    FileCompletionInformation = 30,
 264    FileMoveClusterInformation = 31,
 265    FileQuotaInformation = 32,
 266    FileReparsePointInformation = 33,
 267    FileNetworkOpenInformation = 34,
 268    FileAttributeTagInformation = 35,
 269    FileTrackingInformation = 36,
 270    FileMaximumInformation = 37
 271} ;
 272typedef enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS;
 273struct _FILE_BASIC_INFORMATION {
 274   LARGE_INTEGER CreationTime ;
 275   LARGE_INTEGER LastAccessTime ;
 276   LARGE_INTEGER LastWriteTime ;
 277   LARGE_INTEGER ChangeTime ;
 278   ULONG FileAttributes ;
 279};
 280typedef struct _FILE_BASIC_INFORMATION *PFILE_BASIC_INFORMATION;
 281struct _FILE_STANDARD_INFORMATION {
 282   LARGE_INTEGER AllocationSize ;
 283   LARGE_INTEGER EndOfFile ;
 284   ULONG NumberOfLinks ;
 285   BOOLEAN DeletePending ;
 286   BOOLEAN Directory ;
 287};
 288typedef struct _FILE_STANDARD_INFORMATION *PFILE_STANDARD_INFORMATION;
 289struct _FILE_NETWORK_OPEN_INFORMATION {
 290   LARGE_INTEGER CreationTime ;
 291   LARGE_INTEGER LastAccessTime ;
 292   LARGE_INTEGER LastWriteTime ;
 293   LARGE_INTEGER ChangeTime ;
 294   LARGE_INTEGER AllocationSize ;
 295   LARGE_INTEGER EndOfFile ;
 296   ULONG FileAttributes ;
 297};
 298typedef struct _FILE_NETWORK_OPEN_INFORMATION *PFILE_NETWORK_OPEN_INFORMATION;
 299enum _FSINFOCLASS {
 300    FileFsVolumeInformation = 1,
 301    FileFsLabelInformation = 2,
 302    FileFsSizeInformation = 3,
 303    FileFsDeviceInformation = 4,
 304    FileFsAttributeInformation = 5,
 305    FileFsControlInformation = 6,
 306    FileFsFullSizeInformation = 7,
 307    FileFsObjectIdInformation = 8,
 308    FileFsMaximumInformation = 9
 309} ;
 310typedef enum _FSINFOCLASS FS_INFORMATION_CLASS;
 311enum _INTERFACE_TYPE {
 312    InterfaceTypeUndefined = -1,
 313    Internal = 0,
 314    Isa = 1,
 315    Eisa = 2,
 316    MicroChannel = 3,
 317    TurboChannel = 4,
 318    PCIBus = 5,
 319    VMEBus = 6,
 320    NuBus = 7,
 321    PCMCIABus = 8,
 322    CBus = 9,
 323    MPIBus = 10,
 324    MPSABus = 11,
 325    ProcessorInternal = 12,
 326    InternalPowerBus = 13,
 327    PNPISABus = 14,
 328    PNPBus = 15,
 329    MaximumInterfaceType = 16
 330} ;
 331typedef enum _INTERFACE_TYPE INTERFACE_TYPE;
 332typedef enum _INTERFACE_TYPE *PINTERFACE_TYPE;
 333struct _KEY_VALUE_FULL_INFORMATION {
 334   ULONG TitleIndex ;
 335   ULONG Type ;
 336   ULONG DataOffset ;
 337   ULONG DataLength ;
 338   ULONG NameLength ;
 339   WCHAR Name[1] ;
 340};
 341typedef struct _KEY_VALUE_FULL_INFORMATION *PKEY_VALUE_FULL_INFORMATION;
 342struct _CLIENT_ID {
 343   HANDLE UniqueProcess ;
 344   HANDLE UniqueThread ;
 345};
 346typedef struct _CLIENT_ID CLIENT_ID;
 347typedef CLIENT_ID *PCLIENT_ID;
 348enum _SYSTEM_POWER_STATE {
 349    PowerSystemUnspecified = 0,
 350    PowerSystemWorking = 1,
 351    PowerSystemSleeping1 = 2,
 352    PowerSystemSleeping2 = 3,
 353    PowerSystemSleeping3 = 4,
 354    PowerSystemHibernate = 5,
 355    PowerSystemShutdown = 6,
 356    PowerSystemMaximum = 7
 357} ;
 358typedef enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE;
 359enum __anonenum_POWER_ACTION_11 {
 360    PowerActionNone = 0,
 361    PowerActionReserved = 1,
 362    PowerActionSleep = 2,
 363    PowerActionHibernate = 3,
 364    PowerActionShutdown = 4,
 365    PowerActionShutdownReset = 5,
 366    PowerActionShutdownOff = 6,
 367    PowerActionWarmEject = 7
 368} ;
 369typedef enum __anonenum_POWER_ACTION_11 POWER_ACTION;
 370enum _DEVICE_POWER_STATE {
 371    PowerDeviceUnspecified = 0,
 372    PowerDeviceD0 = 1,
 373    PowerDeviceD1 = 2,
 374    PowerDeviceD2 = 3,
 375    PowerDeviceD3 = 4,
 376    PowerDeviceMaximum = 5
 377} ;
 378typedef enum _DEVICE_POWER_STATE DEVICE_POWER_STATE;
 379union _POWER_STATE {
 380   SYSTEM_POWER_STATE SystemState ;
 381   DEVICE_POWER_STATE DeviceState ;
 382};
 383typedef union _POWER_STATE POWER_STATE;
 384enum _POWER_STATE_TYPE {
 385    SystemPowerState = 0,
 386    DevicePowerState = 1
 387} ;
 388typedef enum _POWER_STATE_TYPE POWER_STATE_TYPE;
 389typedef PVOID PASSIGNED_RESOURCE;
 390#pragma pack(push,4)
 391struct __anonstruct_Generic_16 {
 392   PHYSICAL_ADDRESS Start ;
 393   ULONG Length ;
 394};
 395struct __anonstruct_Port_17 {
 396   PHYSICAL_ADDRESS Start ;
 397   ULONG Length ;
 398};
 399struct __anonstruct_Interrupt_18 {
 400   ULONG Level ;
 401   ULONG Vector ;
 402   ULONG Affinity ;
 403};
 404struct __anonstruct_Memory_19 {
 405   PHYSICAL_ADDRESS Start ;
 406   ULONG Length ;
 407};
 408struct __anonstruct_Dma_20 {
 409   ULONG Channel ;
 410   ULONG Port ;
 411   ULONG Reserved1 ;
 412};
 413struct __anonstruct_DevicePrivate_21 {
 414   ULONG Data[3] ;
 415};
 416struct __anonstruct_BusNumber_22 {
 417   ULONG Start ;
 418   ULONG Length ;
 419   ULONG Reserved ;
 420};
 421struct __anonstruct_DeviceSpecificData_23 {
 422   ULONG DataSize ;
 423   ULONG Reserved1 ;
 424   ULONG Reserved2 ;
 425};
 426union __anonunion_u_15 {
 427   struct __anonstruct_Generic_16 Generic ;
 428   struct __anonstruct_Port_17 Port ;
 429   struct __anonstruct_Interrupt_18 Interrupt ;
 430   struct __anonstruct_Memory_19 Memory ;
 431   struct __anonstruct_Dma_20 Dma ;
 432   struct __anonstruct_DevicePrivate_21 DevicePrivate ;
 433   struct __anonstruct_BusNumber_22 BusNumber ;
 434   struct __anonstruct_DeviceSpecificData_23 DeviceSpecificData ;
 435};
 436struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
 437   UCHAR Type ;
 438   UCHAR ShareDisposition ;
 439   USHORT Flags ;
 440   union __anonunion_u_15 u ;
 441};
 442typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR;
 443#pragma pack(pop)
 444struct _CM_PARTIAL_RESOURCE_LIST {
 445   USHORT Version ;
 446   USHORT Revision ;
 447   ULONG Count ;
 448   CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1] ;
 449};
 450typedef struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST;
 451struct _CM_FULL_RESOURCE_DESCRIPTOR {
 452   INTERFACE_TYPE InterfaceType ;
 453   ULONG BusNumber ;
 454   CM_PARTIAL_RESOURCE_LIST PartialResourceList ;
 455};
 456typedef struct _CM_FULL_RESOURCE_DESCRIPTOR CM_FULL_RESOURCE_DESCRIPTOR;
 457struct _CM_RESOURCE_LIST {
 458   ULONG Count ;
 459   CM_FULL_RESOURCE_DESCRIPTOR List[1] ;
 460};
 461typedef struct _CM_RESOURCE_LIST *PCM_RESOURCE_LIST;
 462#pragma pack(push,1)
 463#pragma pack(pop)
 464struct __anonstruct_Port_25 {
 465   ULONG Length ;
 466   ULONG Alignment ;
 467   PHYSICAL_ADDRESS MinimumAddress ;
 468   PHYSICAL_ADDRESS MaximumAddress ;
 469};
 470struct __anonstruct_Memory_26 {
 471   ULONG Length ;
 472   ULONG Alignment ;
 473   PHYSICAL_ADDRESS MinimumAddress ;
 474   PHYSICAL_ADDRESS MaximumAddress ;
 475};
 476struct __anonstruct_Interrupt_27 {
 477   ULONG MinimumVector ;
 478   ULONG MaximumVector ;
 479};
 480struct __anonstruct_Dma_28 {
 481   ULONG MinimumChannel ;
 482   ULONG MaximumChannel ;
 483};
 484struct __anonstruct_Generic_29 {
 485   ULONG Length ;
 486   ULONG Alignment ;
 487   PHYSICAL_ADDRESS MinimumAddress ;
 488   PHYSICAL_ADDRESS MaximumAddress ;
 489};
 490struct __anonstruct_DevicePrivate_30 {
 491   ULONG Data[3] ;
 492};
 493struct __anonstruct_BusNumber_31 {
 494   ULONG Length ;
 495   ULONG MinBusNumber ;
 496   ULONG MaxBusNumber ;
 497   ULONG Reserved ;
 498};
 499struct __anonstruct_AssignedResource_32 {
 500   PASSIGNED_RESOURCE AssignedResource ;
 501};
 502struct __anonstruct_SubAllocateFrom_33 {
 503   UCHAR Type ;
 504   UCHAR Reserved[3] ;
 505   PASSIGNED_RESOURCE AssignedResource ;
 506   PHYSICAL_ADDRESS Transformation ;
 507};
 508struct __anonstruct_ConfigData_34 {
 509   ULONG Priority ;
 510   ULONG Reserved1 ;
 511   ULONG Reserved2 ;
 512};
 513union __anonunion_u_24 {
 514   struct __anonstruct_Port_25 Port ;
 515   struct __anonstruct_Memory_26 Memory ;
 516   struct __anonstruct_Interrupt_27 Interrupt ;
 517   struct __anonstruct_Dma_28 Dma ;
 518   struct __anonstruct_Generic_29 Generic ;
 519   struct __anonstruct_DevicePrivate_30 DevicePrivate ;
 520   struct __anonstruct_BusNumber_31 BusNumber ;
 521   struct __anonstruct_AssignedResource_32 AssignedResource ;
 522   struct __anonstruct_SubAllocateFrom_33 SubAllocateFrom ;
 523   struct __anonstruct_ConfigData_34 ConfigData ;
 524};
 525struct _IO_RESOURCE_DESCRIPTOR {
 526   UCHAR Option ;
 527   UCHAR Type ;
 528   UCHAR ShareDisposition ;
 529   UCHAR Spare1 ;
 530   USHORT Flags ;
 531   USHORT Spare2 ;
 532   union __anonunion_u_24 u ;
 533};
 534typedef struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR;
 535struct _IO_RESOURCE_LIST {
 536   USHORT Version ;
 537   USHORT Revision ;
 538   ULONG Count ;
 539   IO_RESOURCE_DESCRIPTOR Descriptors[1] ;
 540};
 541typedef struct _IO_RESOURCE_LIST IO_RESOURCE_LIST;
 542struct _IO_RESOURCE_REQUIREMENTS_LIST {
 543   ULONG ListSize ;
 544   INTERFACE_TYPE InterfaceType ;
 545   ULONG BusNumber ;
 546   ULONG SlotNumber ;
 547   ULONG Reserved[3] ;
 548   ULONG AlternativeLists ;
 549   IO_RESOURCE_LIST List[1] ;
 550};
 551typedef struct _IO_RESOURCE_REQUIREMENTS_LIST *PIO_RESOURCE_REQUIREMENTS_LIST;
 552enum _CONFIGURATION_TYPE {
 553    ArcSystem = 0,
 554    CentralProcessor = 1,
 555    FloatingPointProcessor = 2,
 556    PrimaryIcache = 3,
 557    PrimaryDcache = 4,
 558    SecondaryIcache = 5,
 559    SecondaryDcache = 6,
 560    SecondaryCache = 7,
 561    EisaAdapter = 8,
 562    TcAdapter = 9,
 563    ScsiAdapter = 10,
 564    DtiAdapter = 11,
 565    MultiFunctionAdapter = 12,
 566    DiskController = 13,
 567    TapeController = 14,
 568    CdromController = 15,
 569    WormController = 16,
 570    SerialController = 17,
 571    NetworkController = 18,
 572    DisplayController = 19,
 573    ParallelController = 20,
 574    PointerController = 21,
 575    KeyboardController = 22,
 576    AudioController = 23,
 577    OtherController = 24,
 578    DiskPeripheral = 25,
 579    FloppyDiskPeripheral = 26,
 580    TapePeripheral = 27,
 581    ModemPeripheral = 28,
 582    MonitorPeripheral = 29,
 583    PrinterPeripheral = 30,
 584    PointerPeripheral = 31,
 585    KeyboardPeripheral = 32,
 586    TerminalPeripheral = 33,
 587    OtherPeripheral = 34,
 588    LinePeripheral = 35,
 589    NetworkPeripheral = 36,
 590    SystemMemory = 37,
 591    DockingInformation = 38,
 592    RealModeIrqRoutingTable = 39,
 593    MaximumType = 40
 594} ;
 595typedef enum _CONFIGURATION_TYPE CONFIGURATION_TYPE;
 596typedef enum _CONFIGURATION_TYPE *PCONFIGURATION_TYPE;
 597enum _KWAIT_REASON {
 598    Executive = 0,
 599    FreePage = 1,
 600    PageIn = 2,
 601    PoolAllocation = 3,
 602    DelayExecution = 4,
 603    Suspended = 5,
 604    UserRequest = 6,
 605    WrExecutive = 7,
 606    WrFreePage = 8,
 607    WrPageIn = 9,
 608    WrPoolAllocation = 10,
 609    WrDelayExecution = 11,
 610    WrSuspended = 12,
 611    WrUserRequest = 13,
 612    WrEventPair = 14,
 613    WrQueue = 15,
 614    WrLpcReceive = 16,
 615    WrLpcReply = 17,
 616    WrVirtualMemory = 18,
 617    WrPageOut = 19,
 618    WrRendezvous = 20,
 619    Spare2 = 21,
 620    Spare3 = 22,
 621    Spare4 = 23,
 622    Spare5 = 24,
 623    Spare6 = 25,
 624    WrKernel = 26,
 625    MaximumWaitReason = 27
 626} ;
 627typedef enum _KWAIT_REASON KWAIT_REASON;
 628struct _DISPATCHER_HEADER {
 629   UCHAR Type ;
 630   UCHAR Absolute ;
 631   UCHAR Size ;
 632   UCHAR Inserted ;
 633   LONG SignalState ;
 634   LIST_ENTRY WaitListHead ;
 635};
 636typedef struct _DISPATCHER_HEADER DISPATCHER_HEADER;
 637struct _KDEVICE_QUEUE {
 638   CSHORT Type ;
 639   CSHORT Size ;
 640   LIST_ENTRY DeviceListHead ;
 641   KSPIN_LOCK Lock ;
 642   BOOLEAN Busy ;
 643};
 644typedef struct _KDEVICE_QUEUE KDEVICE_QUEUE;
 645struct _KDEVICE_QUEUE_ENTRY {
 646   LIST_ENTRY DeviceListEntry ;
 647   ULONG SortKey ;
 648   BOOLEAN Inserted ;
 649};
 650typedef struct _KDEVICE_QUEUE_ENTRY KDEVICE_QUEUE_ENTRY;
 651struct _KEVENT {
 652   DISPATCHER_HEADER Header ;
 653};
 654typedef struct _KEVENT KEVENT;
 655typedef struct _KEVENT *PKEVENT;
 656typedef struct _KEVENT *PRKEVENT;
 657struct _KSEMAPHORE {
 658   DISPATCHER_HEADER Header ;
 659   LONG Limit ;
 660};
 661typedef struct _KSEMAPHORE *PKSEMAPHORE;
 662typedef struct _KSEMAPHORE *PRKSEMAPHORE;
 663struct _KTIMER {
 664   DISPATCHER_HEADER Header ;
 665   ULARGE_INTEGER DueTime ;
 666   LIST_ENTRY TimerListEntry ;
 667   struct _KDPC *Dpc ;
 668   LONG Period ;
 669};
 670typedef struct _KTIMER *PKTIMER;
 671enum _MEMORY_CACHING_TYPE {
 672    MmNonCached = 0,
 673    MmCached = 1,
 674    MmWriteCombined = 2,
 675    MmHardwareCoherentCached = 3,
 676    MmNonCachedUnordered = 4,
 677    MmUSWCCached = 5,
 678    MmMaximumCacheType = 6
 679} ;
 680typedef enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE;
 681enum _POOL_TYPE {
 682    NonPagedPool = 0,
 683    PagedPool = 1,
 684    NonPagedPoolMustSucceed = 2,
 685    DontUseThisType = 3,
 686    NonPagedPoolCacheAligned = 4,
 687    PagedPoolCacheAligned = 5,
 688    NonPagedPoolCacheAlignedMustS = 6,
 689    MaxPoolType = 7,
 690    NonPagedPoolSession = 32,
 691    PagedPoolSession = 33,
 692    NonPagedPoolMustSucceedSession = 34,
 693    DontUseThisTypeSession = 35,
 694    NonPagedPoolCacheAlignedSession = 36,
 695    PagedPoolCacheAlignedSession = 37,
 696    NonPagedPoolCacheAlignedMustSSession = 38
 697} ;
 698typedef enum _POOL_TYPE POOL_TYPE;
 699struct _FAST_MUTEX {
 700   LONG Count ;
 701   PKTHREAD Owner ;
 702   ULONG Contention ;
 703   KEVENT Event ;
 704   ULONG OldIrql ;
 705};
 706typedef struct _FAST_MUTEX *PFAST_MUTEX;
 707typedef ULONG_PTR ERESOURCE_THREAD;
 708union __anonunion____missing_field_name_38 {
 709   LONG OwnerCount ;
 710   ULONG TableSize ;
 711};
 712struct _OWNER_ENTRY {
 713   ERESOURCE_THREAD OwnerThread ;
 714   union __anonunion____missing_field_name_38 __annonCompField10 ;
 715};
 716typedef struct _OWNER_ENTRY OWNER_ENTRY;
 717typedef struct _OWNER_ENTRY *POWNER_ENTRY;
 718union __anonunion____missing_field_name_39 {
 719   PVOID Address ;
 720   ULONG_PTR CreatorBackTraceIndex ;
 721};
 722struct _ERESOURCE {
 723   LIST_ENTRY SystemResourcesList ;
 724   POWNER_ENTRY OwnerTable ;
 725   SHORT ActiveCount ;
 726   USHORT Flag ;
 727   PKSEMAPHORE SharedWaiters ;
 728   PKEVENT ExclusiveWaiters ;
 729   OWNER_ENTRY OwnerThreads[2] ;
 730   ULONG ContentionCount ;
 731   USHORT NumberOfSharedWaiters ;
 732   USHORT NumberOfExclusiveWaiters ;
 733   union __anonunion____missing_field_name_39 __annonCompField11 ;
 734   KSPIN_LOCK SpinLock ;
 735};
 736enum _MM_PAGE_PRIORITY {
 737    LowPagePriority = 0,
 738    NormalPagePriority = 16,
 739    HighPagePriority = 32
 740} ;
 741typedef enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY;
 742struct _DRIVER_OBJECT;
 743struct _DRIVER_OBJECT;
 744struct _SECURITY_SUBJECT_CONTEXT {
 745   PACCESS_TOKEN ClientToken ;
 746   SECURITY_IMPERSONATION_LEVEL ImpersonationLevel ;
 747   PACCESS_TOKEN PrimaryToken ;
 748   PVOID ProcessAuditId ;
 749};
 750typedef struct _SECURITY_SUBJECT_CONTEXT SECURITY_SUBJECT_CONTEXT;
 751struct _INITIAL_PRIVILEGE_SET {
 752   ULONG PrivilegeCount ;
 753   ULONG Control ;
 754   LUID_AND_ATTRIBUTES Privilege[3] ;
 755};
 756typedef struct _INITIAL_PRIVILEGE_SET INITIAL_PRIVILEGE_SET;
 757union __anonunion_Privileges_40 {
 758   INITIAL_PRIVILEGE_SET InitialPrivilegeSet ;
 759   PRIVILEGE_SET PrivilegeSet ;
 760};
 761struct _ACCESS_STATE {
 762   LUID OperationID ;
 763   BOOLEAN SecurityEvaluated ;
 764   BOOLEAN GenerateAudit ;
 765   BOOLEAN GenerateOnClose ;
 766   BOOLEAN PrivilegesAllocated ;
 767   ULONG Flags ;
 768   ACCESS_MASK RemainingDesiredAccess ;
 769   ACCESS_MASK PreviouslyGrantedAccess ;
 770   ACCESS_MASK OriginalDesiredAccess ;
 771   SECURITY_SUBJECT_CONTEXT SubjectSecurityContext ;
 772   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 773   PVOID AuxData ;
 774   union __anonunion_Privileges_40 Privileges ;
 775   BOOLEAN AuditPrivileges ;
 776   UNICODE_STRING ObjectName ;
 777   UNICODE_STRING ObjectTypeName ;
 778};
 779typedef struct _ACCESS_STATE *PACCESS_STATE;
 780struct _DEVICE_OBJECT;
 781struct _DEVICE_OBJECT;
 782struct _DRIVER_OBJECT;
 783struct _FILE_OBJECT;
 784struct _FILE_OBJECT;
 785struct _IRP;
 786struct _IRP;
 787struct _SCSI_REQUEST_BLOCK;
 788struct _SCSI_REQUEST_BLOCK;
 789typedef NTSTATUS (*PDRIVER_DISPATCH)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp );
 790struct _COMPRESSED_DATA_INFO;
 791struct _FAST_IO_DISPATCH {
 792   ULONG SizeOfFastIoDispatch ;
 793   BOOLEAN (*FastIoCheckIfPossible)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 794                                    ULONG Length , BOOLEAN Wait , ULONG LockKey ,
 795                                    BOOLEAN CheckForReadOperation , PIO_STATUS_BLOCK IoStatus ,
 796                                    struct _DEVICE_OBJECT *DeviceObject ) ;
 797   BOOLEAN (*FastIoRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 798                         ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 799                         PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 800   BOOLEAN (*FastIoWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 801                          ULONG Length , BOOLEAN Wait , ULONG LockKey , PVOID Buffer ,
 802                          PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 803   BOOLEAN (*FastIoQueryBasicInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 804                                   PFILE_BASIC_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 805                                   struct _DEVICE_OBJECT *DeviceObject ) ;
 806   BOOLEAN (*FastIoQueryStandardInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 807                                      PFILE_STANDARD_INFORMATION Buffer , PIO_STATUS_BLOCK IoStatus ,
 808                                      struct _DEVICE_OBJECT *DeviceObject ) ;
 809   BOOLEAN (*FastIoLock)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 810                         PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 811                         BOOLEAN FailImmediately , BOOLEAN ExclusiveLock , PIO_STATUS_BLOCK IoStatus ,
 812                         struct _DEVICE_OBJECT *DeviceObject ) ;
 813   BOOLEAN (*FastIoUnlockSingle)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 814                                 PLARGE_INTEGER Length , PEPROCESS ProcessId , ULONG Key ,
 815                                 PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 816   BOOLEAN (*FastIoUnlockAll)(struct _FILE_OBJECT *FileObject , PEPROCESS ProcessId ,
 817                              PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 818   BOOLEAN (*FastIoUnlockAllByKey)(struct _FILE_OBJECT *FileObject , PVOID ProcessId ,
 819                                   ULONG Key , PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 820   BOOLEAN (*FastIoDeviceControl)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 821                                  PVOID InputBuffer , ULONG InputBufferLength , PVOID OutputBuffer ,
 822                                  ULONG OutputBufferLength , ULONG IoControlCode ,
 823                                  PIO_STATUS_BLOCK IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 824   void (*AcquireFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 825   void (*ReleaseFileForNtCreateSection)(struct _FILE_OBJECT *FileObject ) ;
 826   void (*FastIoDetachDevice)(struct _DEVICE_OBJECT *SourceDevice , struct _DEVICE_OBJECT *TargetDevice ) ;
 827   BOOLEAN (*FastIoQueryNetworkOpenInfo)(struct _FILE_OBJECT *FileObject , BOOLEAN Wait ,
 828                                         struct _FILE_NETWORK_OPEN_INFORMATION *Buffer ,
 829                                         struct _IO_STATUS_BLOCK *IoStatus , struct _DEVICE_OBJECT *DeviceObject ) ;
 830   NTSTATUS (*AcquireForModWrite)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER EndingOffset ,
 831                                  struct _ERESOURCE **ResourceToRelease , struct _DEVICE_OBJECT *DeviceObject ) ;
 832   BOOLEAN (*MdlRead)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 833                      ULONG Length , ULONG LockKey , PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus ,
 834                      struct _DEVICE_OBJECT *DeviceObject ) ;
 835   BOOLEAN (*MdlReadComplete)(struct _FILE_OBJECT *FileObject , PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 836   BOOLEAN (*PrepareMdlWrite)(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 (*MdlWriteComplete)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 840                               PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 841   BOOLEAN (*FastIoReadCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 842                                   ULONG Length , ULONG LockKey , PVOID Buffer , PMDL *MdlChain ,
 843                                   PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 844                                   ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 845   BOOLEAN (*FastIoWriteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 846                                    ULONG Length , ULONG LockKey , PVOID Buffer ,
 847                                    PMDL *MdlChain , PIO_STATUS_BLOCK IoStatus , struct _COMPRESSED_DATA_INFO *CompressedDataInfo ,
 848                                    ULONG CompressedDataInfoLength , struct _DEVICE_OBJECT *DeviceObject ) ;
 849   BOOLEAN (*MdlReadCompleteCompressed)(struct _FILE_OBJECT *FileObject , PMDL MdlChain ,
 850                                        struct _DEVICE_OBJECT *DeviceObject ) ;
 851   BOOLEAN (*MdlWriteCompleteCompressed)(struct _FILE_OBJECT *FileObject , PLARGE_INTEGER FileOffset ,
 852                                         PMDL MdlChain , struct _DEVICE_OBJECT *DeviceObject ) ;
 853   BOOLEAN (*FastIoQueryOpen)(struct _IRP *Irp , PFILE_NETWORK_OPEN_INFORMATION NetworkInformation ,
 854                              struct _DEVICE_OBJECT *DeviceObject ) ;
 855   NTSTATUS (*ReleaseForModWrite)(struct _FILE_OBJECT *FileObject , struct _ERESOURCE *ResourceToRelease ,
 856                                  struct _DEVICE_OBJECT *DeviceObject ) ;
 857   NTSTATUS (*AcquireForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 858   NTSTATUS (*ReleaseForCcFlush)(struct _FILE_OBJECT *FileObject , struct _DEVICE_OBJECT *DeviceObject ) ;
 859};
 860typedef struct _FAST_IO_DISPATCH *PFAST_IO_DISPATCH;
 861enum _IO_ALLOCATION_ACTION {
 862    KeepObject = 1,
 863    DeallocateObject = 2,
 864    DeallocateObjectKeepRegisters = 3
 865} ;
 866typedef enum _IO_ALLOCATION_ACTION IO_ALLOCATION_ACTION;
 867struct _IO_SECURITY_CONTEXT {
 868   PSECURITY_QUALITY_OF_SERVICE SecurityQos ;
 869   PACCESS_STATE AccessState ;
 870   ACCESS_MASK DesiredAccess ;
 871   ULONG FullCreateOptions ;
 872};
 873typedef struct _IO_SECURITY_CONTEXT *PIO_SECURITY_CONTEXT;
 874struct _VPB {
 875   CSHORT Type ;
 876   CSHORT Size ;
 877   USHORT Flags ;
 878   USHORT VolumeLabelLength ;
 879   struct _DEVICE_OBJECT *DeviceObject ;
 880   struct _DEVICE_OBJECT *RealDevice ;
 881   ULONG SerialNumber ;
 882   ULONG ReferenceCount ;
 883   WCHAR VolumeLabel[(32U * sizeof(WCHAR )) / sizeof(WCHAR )] ;
 884};
 885typedef struct _VPB *PVPB;
 886struct _WAIT_CONTEXT_BLOCK {
 887   KDEVICE_QUEUE_ENTRY WaitQueueEntry ;
 888   IO_ALLOCATION_ACTION (*DeviceRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ,
 889                                         PVOID MapRegisterBase , PVOID Context ) ;
 890   PVOID DeviceContext ;
 891   ULONG NumberOfMapRegisters ;
 892   PVOID DeviceObject ;
 893   PVOID CurrentIrp ;
 894   PKDPC BufferChainingDpc ;
 895};
 896typedef struct _WAIT_CONTEXT_BLOCK WAIT_CONTEXT_BLOCK;
 897union __anonunion_Queue_43 {
 898   LIST_ENTRY ListEntry ;
 899   WAIT_CONTEXT_BLOCK Wcb ;
 900};
 901struct _DEVOBJ_EXTENSION;
 902struct _DEVICE_OBJECT {
 903   CSHORT Type ;
 904   USHORT Size ;
 905   LONG ReferenceCount ;
 906   struct _DRIVER_OBJECT *DriverObject ;
 907   struct _DEVICE_OBJECT *NextDevice ;
 908   struct _DEVICE_OBJECT *AttachedDevice ;
 909   struct _IRP *CurrentIrp ;
 910   PIO_TIMER Timer ;
 911   ULONG Flags ;
 912   ULONG Characteristics ;
 913   PVPB Vpb ;
 914   PVOID DeviceExtension ;
 915   ULONG DeviceType ;
 916   CCHAR StackSize ;
 917   union __anonunion_Queue_43 Queue ;
 918   ULONG AlignmentRequirement ;
 919   KDEVICE_QUEUE DeviceQueue ;
 920   KDPC Dpc ;
 921   ULONG ActiveThreadCount ;
 922   PSECURITY_DESCRIPTOR SecurityDescriptor ;
 923   KEVENT DeviceLock ;
 924   USHORT SectorSize ;
 925   USHORT Spare1 ;
 926   struct _DEVOBJ_EXTENSION *DeviceObjectExtension ;
 927   PVOID Reserved ;
 928};
 929typedef struct _DEVICE_OBJECT DEVICE_OBJECT;
 930typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
 931struct _DEVOBJ_EXTENSION {
 932   CSHORT Type ;
 933   USHORT Size ;
 934   PDEVICE_OBJECT DeviceObject ;
 935};
 936struct _DRIVER_EXTENSION {
 937   struct _DRIVER_OBJECT *DriverObject ;
 938   NTSTATUS (*AddDevice)(struct _DRIVER_OBJECT *DriverObject , struct _DEVICE_OBJECT *PhysicalDeviceObject ) ;
 939   ULONG Count ;
 940   UNICODE_STRING ServiceKeyName ;
 941};
 942typedef struct _DRIVER_EXTENSION *PDRIVER_EXTENSION;
 943struct _DRIVER_OBJECT {
 944   CSHORT Type ;
 945   CSHORT Size ;
 946   PDEVICE_OBJECT DeviceObject ;
 947   ULONG Flags ;
 948   PVOID DriverStart ;
 949   ULONG DriverSize ;
 950   PVOID DriverSection ;
 951   PDRIVER_EXTENSION DriverExtension ;
 952   UNICODE_STRING DriverName ;
 953   PUNICODE_STRING HardwareDatabase ;
 954   PFAST_IO_DISPATCH FastIoDispatch ;
 955   NTSTATUS (*DriverInit)(struct _DRIVER_OBJECT *DriverObject , PUNICODE_STRING RegistryPath ) ;
 956   void (*DriverStartIo)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
 957   void (*DriverUnload)(struct _DRIVER_OBJECT *DriverObject ) ;
 958   PDRIVER_DISPATCH MajorFunction[28] ;
 959};
 960typedef struct _DRIVER_OBJECT DRIVER_OBJECT;
 961typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
 962struct _SECTION_OBJECT_POINTERS {
 963   PVOID DataSectionObject ;
 964   PVOID SharedCacheMap ;
 965   PVOID ImageSectionObject ;
 966};
 967typedef struct _SECTION_OBJECT_POINTERS SECTION_OBJECT_POINTERS;
 968typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS;
 969struct _IO_COMPLETION_CONTEXT {
 970   PVOID Port ;
 971   PVOID Key ;
 972};
 973typedef struct _IO_COMPLETION_CONTEXT *PIO_COMPLETION_CONTEXT;
 974struct _FILE_OBJECT {
 975   CSHORT Type ;
 976   CSHORT Size ;
 977   PDEVICE_OBJECT DeviceObject ;
 978   PVPB Vpb ;
 979   PVOID FsContext ;
 980   PVOID FsContext2 ;
 981   PSECTION_OBJECT_POINTERS SectionObjectPointer ;
 982   PVOID PrivateCacheMap ;
 983   NTSTATUS FinalStatus ;
 984   struct _FILE_OBJECT *RelatedFileObject ;
 985   BOOLEAN LockOperation ;
 986   BOOLEAN DeletePending ;
 987   BOOLEAN ReadAccess ;
 988   BOOLEAN WriteAccess ;
 989   BOOLEAN DeleteAccess ;
 990   BOOLEAN SharedRead ;
 991   BOOLEAN SharedWrite ;
 992   BOOLEAN SharedDelete ;
 993   ULONG Flags ;
 994   UNICODE_STRING FileName ;
 995   LARGE_INTEGER CurrentByteOffset ;
 996   ULONG Waiters ;
 997   ULONG Busy ;
 998   PVOID LastLock ;
 999   KEVENT Lock ;
1000   KEVENT Event ;
1001   PIO_COMPLETION_CONTEXT CompletionContext ;
1002};
1003typedef struct _FILE_OBJECT *PFILE_OBJECT;
1004union __anonunion_AssociatedIrp_44 {
1005   struct _IRP *MasterIrp ;
1006   LONG IrpCount ;
1007   PVOID SystemBuffer ;
1008};
1009struct __anonstruct_AsynchronousParameters_46 {
1010   void (*UserApcRoutine)(PVOID ApcContext , PIO_STATUS_BLOCK IoStatusBlock ,
1011                                                          ULONG Reserved ) ;
1012   PVOID UserApcContext ;
1013};
1014union __anonunion_Overlay_45 {
1015   struct __anonstruct_AsynchronousParameters_46 AsynchronousParameters ;
1016   LARGE_INTEGER AllocationSize ;
1017};
1018struct __anonstruct____missing_field_name_50 {
1019   PVOID DriverContext[4] ;
1020};
1021union __anonunion____missing_field_name_49 {
1022   KDEVICE_QUEUE_ENTRY DeviceQueueEntry ;
1023   struct __anonstruct____missing_field_name_50 __annonCompField14 ;
1024};
1025struct _IO_STACK_LOCATION;
1026union __anonunion____missing_field_name_52 {
1027   struct _IO_STACK_LOCATION *CurrentStackLocation ;
1028   ULONG PacketType ;
1029};
1030struct __anonstruct____missing_field_name_51 {
1031   LIST_ENTRY ListEntry ;
1032   union __anonunion____missing_field_name_52 __annonCompField16 ;
1033};
1034struct __anonstruct_Overlay_48 {
1035   union __anonunion____missing_field_name_49 __annonCompField15 ;
1036   PETHREAD Thread ;
1037   PCHAR AuxiliaryBuffer ;
1038   struct __anonstruct____missing_field_name_51 __annonCompField17 ;
1039   PFILE_OBJECT OriginalFileObject ;
1040};
1041union __anonunion_Tail_47 {
1042   struct __anonstruct_Overlay_48 Overlay ;
1043   KAPC Apc ;
1044   PVOID CompletionKey ;
1045};
1046struct _IRP {
1047   CSHORT Type ;
1048   USHORT Size ;
1049   PMDL MdlAddress ;
1050   ULONG Flags ;
1051   union __anonunion_AssociatedIrp_44 AssociatedIrp ;
1052   LIST_ENTRY ThreadListEntry ;
1053   IO_STATUS_BLOCK IoStatus ;
1054   KPROCESSOR_MODE RequestorMode ;
1055   BOOLEAN PendingReturned ;
1056   CHAR StackCount ;
1057   CHAR CurrentLocation ;
1058   BOOLEAN Cancel ;
1059   KIRQL CancelIrql ;
1060   CCHAR ApcEnvironment ;
1061   UCHAR AllocationFlags ;
1062   PIO_STATUS_BLOCK UserIosb ;
1063   PKEVENT UserEvent ;
1064   union __anonunion_Overlay_45 Overlay ;
1065   void (*CancelRoutine)(struct _DEVICE_OBJECT *DeviceObject , struct _IRP *Irp ) ;
1066   PVOID UserBuffer ;
1067   union __anonunion_Tail_47 Tail ;
1068};
1069typedef struct _IRP IRP;
1070typedef struct _IRP *PIRP;
1071enum _DEVICE_RELATION_TYPE {
1072    BusRelations = 0,
1073    EjectionRelations = 1,
1074    PowerRelations = 2,
1075    RemovalRelations = 3,
1076    TargetDeviceRelation = 4
1077} ;
1078typedef enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE;
1079enum _DEVICE_USAGE_NOTIFICATION_TYPE {
1080    DeviceUsageTypeUndefined = 0,
1081    DeviceUsageTypePaging = 1,
1082    DeviceUsageTypeHibernation = 2,
1083    DeviceUsageTypeDumpFile = 3
1084} ;
1085typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE;
1086struct _INTERFACE {
1087   USHORT Size ;
1088   USHORT Version ;
1089   PVOID Context ;
1090   void (*InterfaceReference)(PVOID Context ) ;
1091   void (*InterfaceDereference)(PVOID Context ) ;
1092};
1093typedef struct _INTERFACE *PINTERFACE;
1094struct _DEVICE_CAPABILITIES {
1095   USHORT Size ;
1096   USHORT Version ;
1097   ULONG DeviceD1 : 1 ;
1098   ULONG DeviceD2 : 1 ;
1099   ULONG LockSupported : 1 ;
1100   ULONG EjectSupported : 1 ;
1101   ULONG Removable : 1 ;
1102   ULONG DockDevice : 1 ;
1103   ULONG UniqueID : 1 ;
1104   ULONG SilentInstall : 1 ;
1105   ULONG RawDeviceOK : 1 ;
1106   ULONG SurpriseRemovalOK : 1 ;
1107   ULONG WakeFromD0 : 1 ;
1108   ULONG WakeFromD1 : 1 ;
1109   ULONG WakeFromD2 : 1 ;
1110   ULONG WakeFromD3 : 1 ;
1111   ULONG HardwareDisabled : 1 ;
1112   ULONG NonDynamic : 1 ;
1113   ULONG WarmEjectSupported : 1 ;
1114   ULONG Reserved : 15 ;
1115   ULONG Address ;
1116   ULONG UINumber ;
1117   DEVICE_POWER_STATE DeviceState[7] ;
1118   SYSTEM_POWER_STATE SystemWake ;
1119   DEVICE_POWER_STATE DeviceWake ;
1120   ULONG D1Latency ;
1121   ULONG D2Latency ;
1122   ULONG D3Latency ;
1123};
1124typedef struct _DEVICE_CAPABILITIES *PDEVICE_CAPABILITIES;
1125struct _POWER_SEQUENCE {
1126   ULONG SequenceD1 ;
1127   ULONG SequenceD2 ;
1128   ULONG SequenceD3 ;
1129};
1130typedef struct _POWER_SEQUENCE *PPOWER_SEQUENCE;
1131enum __anonenum_BUS_QUERY_ID_TYPE_53 {
1132    BusQueryDeviceID = 0,
1133    BusQueryHardwareIDs = 1,
1134    BusQueryCompatibleIDs = 2,
1135    BusQueryInstanceID = 3,
1136    BusQueryDeviceSerialNumber = 4
1137} ;
1138typedef enum __anonenum_BUS_QUERY_ID_TYPE_53 BUS_QUERY_ID_TYPE;
1139enum __anonenum_DEVICE_TEXT_TYPE_54 {
1140    DeviceTextDescription = 0,
1141    DeviceTextLocationInformation = 1
1142} ;
1143typedef enum __anonenum_DEVICE_TEXT_TYPE_54 DEVICE_TEXT_TYPE;
1144#pragma pack(push,4)
1145struct __anonstruct_Create_56 {
1146   PIO_SECURITY_CONTEXT SecurityContext ;
1147   ULONG Options ;
1148   USHORT FileAttributes ;
1149   USHORT ShareAccess ;
1150   ULONG EaLength ;
1151};
1152struct __anonstruct_Read_57 {
1153   ULONG Length ;
1154   ULONG Key ;
1155   LARGE_INTEGER ByteOffset ;
1156};
1157struct __anonstruct_Write_58 {
1158   ULONG Length ;
1159   ULONG Key ;
1160   LARGE_INTEGER ByteOffset ;
1161};
1162struct __anonstruct_QueryFile_59 {
1163   ULONG Length ;
1164   FILE_INFORMATION_CLASS FileInformationClass ;
1165};
1166struct __anonstruct____missing_field_name_62 {
1167   BOOLEAN ReplaceIfExists ;
1168   BOOLEAN AdvanceOnly ;
1169};
1170union __anonunion____missing_field_name_61 {
1171   struct __anonstruct____missing_field_name_62 __annonCompField18 ;
1172   ULONG ClusterCount ;
1173   HANDLE DeleteHandle ;
1174};
1175struct __anonstruct_SetFile_60 {
1176   ULONG Length ;
1177   FILE_INFORMATION_CLASS FileInformationClass ;
1178   PFILE_OBJECT FileObject ;
1179   union __anonunion____missing_field_name_61 __annonCompField19 ;
1180};
1181struct __anonstruct_QueryVolume_63 {
1182   ULONG Length ;
1183   FS_INFORMATION_CLASS FsInformationClass ;
1184};
1185struct __anonstruct_DeviceIoControl_64 {
1186   ULONG OutputBufferLength ;
1187   ULONG InputBufferLength ;
1188   ULONG IoControlCode ;
1189   PVOID Type3InputBuffer ;
1190};
1191struct __anonstruct_QuerySecurity_65 {
1192   SECURITY_INFORMATION SecurityInformation ;
1193   ULONG Length ;
1194};
1195struct __anonstruct_SetSecurity_66 {
1196   SECURITY_INFORMATION SecurityInformation ;
1197   PSECURITY_DESCRIPTOR SecurityDescriptor ;
1198};
1199struct __anonstruct_MountVolume_67 {
1200   PVPB Vpb ;
1201   PDEVICE_OBJECT DeviceObject ;
1202};
1203struct __anonstruct_VerifyVolume_68 {
1204   PVPB Vpb ;
1205   PDEVICE_OBJECT DeviceObject ;
1206};
1207struct __anonstruct_Scsi_69 {
1208   struct _SCSI_REQUEST_BLOCK *Srb ;
1209};
1210struct __anonstruct_QueryDeviceRelations_70 {
1211   DEVICE_RELATION_TYPE Type ;
1212};
1213struct __anonstruct_QueryInterface_71 {
1214   GUID const   *InterfaceType ;
1215   USHORT Size ;
1216   USHORT Version ;
1217   PINTERFACE Interface ;
1218   PVOID InterfaceSpecificData ;
1219};
1220struct __anonstruct_DeviceCapabilities_72 {
1221   PDEVICE_CAPABILITIES Capabilities ;
1222};
1223struct __anonstruct_FilterResourceRequirements_73 {
1224   PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList ;
1225};
1226struct __anonstruct_ReadWriteConfig_74 {
1227   ULONG WhichSpace ;
1228   PVOID Buffer ;
1229   ULONG Offset ;
1230   ULONG Length ;
1231};
1232struct __anonstruct_SetLock_75 {
1233   BOOLEAN Lock ;
1234};
1235struct __anonstruct_QueryId_76 {
1236   BUS_QUERY_ID_TYPE IdType ;
1237};
1238struct __anonstruct_QueryDeviceText_77 {
1239   DEVICE_TEXT_TYPE DeviceTextType ;
1240   LCID LocaleId ;
1241};
1242struct __anonstruct_UsageNotification_78 {
1243   BOOLEAN InPath ;
1244   BOOLEAN Reserved[3] ;
1245   DEVICE_USAGE_NOTIFICATION_TYPE Type ;
1246};
1247struct __anonstruct_WaitWake_79 {
1248   SYSTEM_POWER_STATE PowerState ;
1249};
1250struct __anonstruct_PowerSequence_80 {
1251   PPOWER_SEQUENCE PowerSequence ;
1252};
1253struct __anonstruct_Power_81 {
1254   ULONG SystemContext ;
1255   POWER_STATE_TYPE Type ;
1256   POWER_STATE State ;
1257   POWER_ACTION ShutdownType ;
1258};
1259struct __anonstruct_StartDevice_82 {
1260   PCM_RESOURCE_LIST AllocatedResources ;
1261   PCM_RESOURCE_LIST AllocatedResourcesTranslated ;
1262};
1263struct __anonstruct_WMI_83 {
1264   ULONG_PTR ProviderId ;
1265   PVOID DataPath ;
1266   ULONG BufferSize ;
1267   PVOID Buffer ;
1268};
1269struct __anonstruct_Others_84 {
1270   PVOID Argument1 ;
1271   PVOID Argument2 ;
1272   PVOID Argument3 ;
1273   PVOID Argument4 ;
1274};
1275union __anonunion_Parameters_55 {
1276   struct __anonstruct_Create_56 Create ;
1277   struct __anonstruct_Read_57 Read ;
1278   struct __anonstruct_Write_58 Write ;
1279   struct __anonstruct_QueryFile_59 QueryFile ;
1280   struct __anonstruct_SetFile_60 SetFile ;
1281   struct __anonstruct_QueryVolume_63 QueryVolume ;
1282   struct __anonstruct_DeviceIoControl_64 DeviceIoControl ;
1283   struct __anonstruct_QuerySecurity_65 QuerySecurity ;
1284   struct __anonstruct_SetSecurity_66 SetSecurity ;
1285   struct __anonstruct_MountVolume_67 MountVolume ;
1286   struct __anonstruct_VerifyVolume_68 VerifyVolume ;
1287   struct __anonstruct_Scsi_69 Scsi ;
1288   struct __anonstruct_QueryDeviceRelations_70 QueryDeviceRelations ;
1289   struct __anonstruct_QueryInterface_71 QueryInterface ;
1290   struct __anonstruct_DeviceCapabilities_72 DeviceCapabilities ;
1291   struct __anonstruct_FilterResourceRequirements_73 FilterResourceRequirements ;
1292   struct __anonstruct_ReadWriteConfig_74 ReadWriteConfig ;
1293   struct __anonstruct_SetLock_75 SetLock ;
1294   struct __anonstruct_QueryId_76 QueryId ;
1295   struct __anonstruct_QueryDeviceText_77 QueryDeviceText ;
1296   struct __anonstruct_UsageNotification_78 UsageNotification ;
1297   struct __anonstruct_WaitWake_79 WaitWake ;
1298   struct __anonstruct_PowerSequence_80 PowerSequence ;
1299   struct __anonstruct_Power_81 Power ;
1300   struct __anonstruct_StartDevice_82 StartDevice ;
1301   struct __anonstruct_WMI_83 WMI ;
1302   struct __anonstruct_Others_84 Others ;
1303};
1304struct _IO_STACK_LOCATION {
1305   UCHAR MajorFunction ;
1306   UCHAR MinorFunction ;
1307   UCHAR Flags ;
1308   UCHAR Control ;
1309   union __anonunion_Parameters_55 Parameters ;
1310   PDEVICE_OBJECT DeviceObject ;
1311   PFILE_OBJECT FileObject ;
1312   NTSTATUS (*CompletionRoutine)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
1313   PVOID Context ;
1314};
1315typedef struct _IO_STACK_LOCATION IO_STACK_LOCATION;
1316typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION;
1317#pragma pack(pop)
1318struct _CONFIGURATION_INFORMATION {
1319   ULONG DiskCount ;
1320   ULONG FloppyCount ;
1321   ULONG CdRomCount ;
1322   ULONG TapeCount ;
1323   ULONG ScsiPortCount ;
1324   ULONG SerialCount ;
1325   ULONG ParallelCount ;
1326   BOOLEAN AtDiskPrimaryAddressClaimed ;
1327   BOOLEAN AtDiskSecondaryAddressClaimed ;
1328   ULONG Version ;
1329   ULONG MediumChangerCount ;
1330};
1331typedef struct _CONFIGURATION_INFORMATION CONFIGURATION_INFORMATION;
1332typedef struct _CONFIGURATION_INFORMATION *PCONFIGURATION_INFORMATION;
1333struct _OBJECT_HANDLE_INFORMATION {
1334   ULONG HandleAttributes ;
1335   ACCESS_MASK GrantedAccess ;
1336};
1337typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
1338struct _SCSI_PASS_THROUGH {
1339   USHORT Length ;
1340   UCHAR ScsiStatus ;
1341   UCHAR PathId ;
1342   UCHAR TargetId ;
1343   UCHAR Lun ;
1344   UCHAR CdbLength ;
1345   UCHAR SenseInfoLength ;
1346   UCHAR DataIn ;
1347   ULONG DataTransferLength ;
1348   ULONG TimeOutValue ;
1349   ULONG_PTR DataBufferOffset ;
1350   ULONG SenseInfoOffset ;
1351   UCHAR Cdb[16] ;
1352};
1353typedef struct _SCSI_PASS_THROUGH SCSI_PASS_THROUGH;
1354typedef struct _SCSI_PASS_THROUGH *PSCSI_PASS_THROUGH;
1355struct _TRACK_DATA {
1356   UCHAR Reserved ;
1357   UCHAR Control : 4 ;
1358   UCHAR Adr : 4 ;
1359   UCHAR TrackNumber ;
1360   UCHAR Reserved1 ;
1361   UCHAR Address[4] ;
1362};
1363typedef struct _TRACK_DATA TRACK_DATA;
1364struct _CDROM_TOC {
1365   UCHAR Length[2] ;
1366   UCHAR FirstTrack ;
1367   UCHAR LastTrack ;
1368   TRACK_DATA TrackData[100] ;
1369};
1370typedef struct _CDROM_TOC CDROM_TOC;
1371typedef struct _CDROM_TOC *PCDROM_TOC;
1372struct _CDROM_PLAY_AUDIO_MSF {
1373   UCHAR StartingM ;
1374   UCHAR StartingS ;
1375   UCHAR StartingF ;
1376   UCHAR EndingM ;
1377   UCHAR EndingS ;
1378   UCHAR EndingF ;
1379};
1380typedef struct _CDROM_PLAY_AUDIO_MSF CDROM_PLAY_AUDIO_MSF;
1381typedef struct _CDROM_PLAY_AUDIO_MSF *PCDROM_PLAY_AUDIO_MSF;
1382struct _CDROM_SEEK_AUDIO_MSF {
1383   UCHAR M ;
1384   UCHAR S ;
1385   UCHAR F ;
1386};
1387typedef struct _CDROM_SEEK_AUDIO_MSF CDROM_SEEK_AUDIO_MSF;
1388typedef struct _CDROM_SEEK_AUDIO_MSF *PCDROM_SEEK_AUDIO_MSF;
1389struct _CDROM_SUB_Q_DATA_FORMAT {
1390   UCHAR Format ;
1391   UCHAR Track ;
1392};
1393struct _SUB_Q_HEADER {
1394   UCHAR Reserved ;
1395   UCHAR AudioStatus ;
1396   UCHAR DataLength[2] ;
1397};
1398typedef struct _SUB_Q_HEADER SUB_Q_HEADER;
1399struct _SUB_Q_CURRENT_POSITION {
1400   SUB_Q_HEADER Header ;
1401   UCHAR FormatCode ;
1402   UCHAR Control : 4 ;
1403   UCHAR ADR : 4 ;
1404   UCHAR TrackNumber ;
1405   UCHAR IndexNumber ;
1406   UCHAR AbsoluteAddress[4] ;
1407   UCHAR TrackRelativeAddress[4] ;
1408};
1409typedef struct _SUB_Q_CURRENT_POSITION SUB_Q_CURRENT_POSITION;
1410typedef struct _SUB_Q_CURRENT_POSITION *PSUB_Q_CURRENT_POSITION;
1411struct _SUB_Q_MEDIA_CATALOG_NUMBER {
1412   SUB_Q_HEADER Header ;
1413   UCHAR FormatCode ;
1414   UCHAR Reserved[3] ;
1415   UCHAR Reserved1 : 7 ;
1416   UCHAR Mcval : 1 ;
1417   UCHAR MediaCatalog[15] ;
1418};
1419typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER SUB_Q_MEDIA_CATALOG_NUMBER;
1420struct _SUB_Q_TRACK_ISRC {
1421   SUB_Q_HEADER Header ;
1422   UCHAR FormatCode ;
1423   UCHAR Reserved0 ;
1424   UCHAR Track ;
1425   UCHAR Reserved1 ;
1426   UCHAR Reserved2 : 7 ;
1427   UCHAR Tcval : 1 ;
1428   UCHAR TrackIsrc[15] ;
1429};
1430typedef struct _SUB_Q_TRACK_ISRC SUB_Q_TRACK_ISRC;
1431union _SUB_Q_CHANNEL_DATA {
1432   SUB_Q_CURRENT_POSITION CurrentPosition ;
1433   SUB_Q_MEDIA_CATALOG_NUMBER MediaCatalog ;
1434   SUB_Q_TRACK_ISRC TrackIsrc ;
1435};
1436typedef union _SUB_Q_CHANNEL_DATA SUB_Q_CHANNEL_DATA;
1437#pragma pack(push,8)
1438#pragma pack(pop)
1439union __anonunion____missing_field_name_116 {
1440   ULONG InternalStatus ;
1441   ULONG QueueSortKey ;
1442};
1443struct _SCSI_REQUEST_BLOCK {
1444   USHORT Length ;
1445   UCHAR Function ;
1446   UCHAR SrbStatus ;
1447   UCHAR ScsiStatus ;
1448   UCHAR PathId ;
1449   UCHAR TargetId ;
1450   UCHAR Lun ;
1451   UCHAR QueueTag ;
1452   UCHAR QueueAction ;
1453   UCHAR CdbLength ;
1454   UCHAR SenseInfoBufferLength ;
1455   ULONG SrbFlags ;
1456   ULONG DataTransferLength ;
1457   ULONG TimeOutValue ;
1458   PVOID DataBuffer ;
1459   PVOID SenseInfoBuffer ;
1460   struct _SCSI_REQUEST_BLOCK *NextSrb ;
1461   PVOID OriginalRequest ;
1462   PVOID SrbExtension ;
1463   union __anonunion____missing_field_name_116 __annonCompField21 ;
1464   UCHAR Cdb[16] ;
1465};
1466struct _CDB6GENERIC {
1467   UCHAR OperationCode ;
1468   UCHAR Immediate : 1 ;
1469   UCHAR CommandUniqueBits : 4 ;
1470   UCHAR LogicalUnitNumber : 3 ;
1471   UCHAR CommandUniqueBytes[3] ;
1472   UCHAR Link : 1 ;
1473   UCHAR Flag : 1 ;
1474   UCHAR Reserved : 4 ;
1475   UCHAR VendorUnique : 2 ;
1476};
1477struct _CDB6READWRITE {
1478   UCHAR OperationCode ;
1479   UCHAR LogicalBlockMsb1 : 5 ;
1480   UCHAR LogicalUnitNumber : 3 ;
1481   UCHAR LogicalBlockMsb0 ;
1482   UCHAR LogicalBlockLsb ;
1483   UCHAR TransferBlocks ;
1484   UCHAR Control ;
1485};
1486struct _CDB6INQUIRY {
1487   UCHAR OperationCode ;
1488   UCHAR Reserved1 : 5 ;
1489   UCHAR LogicalUnitNumber : 3 ;
1490   UCHAR PageCode ;
1491   UCHAR IReserved ;
1492   UCHAR AllocationLength ;
1493   UCHAR Control ;
1494};
1495struct _CDB6VERIFY {
1496   UCHAR OperationCode ;
1497   UCHAR Fixed : 1 ;
1498   UCHAR ByteCompare : 1 ;
1499   UCHAR Immediate : 1 ;
1500   UCHAR Reserved : 2 ;
1501   UCHAR LogicalUnitNumber : 3 ;
1502   UCHAR VerificationLength[3] ;
1503   UCHAR Control ;
1504};
1505struct _CDB6FORMAT {
1506   UCHAR OperationCode ;
1507   UCHAR FormatControl : 5 ;
1508   UCHAR LogicalUnitNumber : 3 ;
1509   UCHAR FReserved1 ;
1510   UCHAR InterleaveMsb ;
1511   UCHAR InterleaveLsb ;
1512   UCHAR FReserved2 ;
1513};
1514struct _CDB10 {
1515   UCHAR OperationCode ;
1516   UCHAR RelativeAddress : 1 ;
1517   UCHAR Reserved1 : 2 ;
1518   UCHAR ForceUnitAccess : 1 ;
1519   UCHAR DisablePageOut : 1 ;
1520   UCHAR LogicalUnitNumber : 3 ;
1521   UCHAR LogicalBlockByte0 ;
1522   UCHAR LogicalBlockByte1 ;
1523   UCHAR LogicalBlockByte2 ;
1524   UCHAR LogicalBlockByte3 ;
1525   UCHAR Reserved2 ;
1526   UCHAR TransferBlocksMsb ;
1527   UCHAR TransferBlocksLsb ;
1528   UCHAR Control ;
1529};
1530struct _CDB12 {
1531   UCHAR OperationCode ;
1532   UCHAR RelativeAddress : 1 ;
1533   UCHAR Reserved1 : 2 ;
1534   UCHAR ForceUnitAccess : 1 ;
1535   UCHAR DisablePageOut : 1 ;
1536   UCHAR LogicalUnitNumber : 3 ;
1537   UCHAR LogicalBlock[4] ;
1538   UCHAR TransferLength[4] ;
1539   UCHAR Reserved2 ;
1540   UCHAR Control ;
1541};
1542struct _PAUSE_RESUME {
1543   UCHAR OperationCode ;
1544   UCHAR Reserved1 : 5 ;
1545   UCHAR LogicalUnitNumber : 3 ;
1546   UCHAR Reserved2[6] ;
1547   UCHAR Action ;
1548   UCHAR Control ;
1549};
1550struct _READ_TOC {
1551   UCHAR OperationCode ;
1552   UCHAR Reserved0 : 1 ;
1553   UCHAR Msf : 1 ;
1554   UCHAR Reserved1 : 3 ;
1555   UCHAR LogicalUnitNumber : 3 ;
1556   UCHAR Format2 : 4 ;
1557   UCHAR Reserved2 : 4 ;
1558   UCHAR Reserved3[3] ;
1559   UCHAR StartingTrack ;
1560   UCHAR AllocationLength[2] ;
1561   UCHAR Control : 6 ;
1562   UCHAR Format : 2 ;
1563};
1564struct _READ_DISK_INFORMATION {
1565   UCHAR OperationCode ;
1566   UCHAR Reserved1 : 5 ;
1567   UCHAR Lun : 3 ;
1568   UCHAR Reserved2[5] ;
1569   UCHAR AllocationLength[2] ;
1570   UCHAR Control ;
1571};
1572struct _READ_TRACK_INFORMATION {
1573   UCHAR OperationCode ;
1574   UCHAR Track : 1 ;
1575   UCHAR Reserved1 : 3 ;
1576   UCHAR Reserved2 : 1 ;
1577   UCHAR Lun : 3 ;
1578   UCHAR BlockAddress[4] ;
1579   UCHAR Reserved3 ;
1580   UCHAR AllocationLength[2] ;
1581   UCHAR Control ;
1582};
1583struct _READ_HEADER {
1584   UCHAR OperationCode ;
1585   UCHAR Reserved1 : 1 ;
1586   UCHAR Msf : 1 ;
1587   UCHAR Reserved2 : 3 ;
1588   UCHAR Lun : 3 ;
1589   UCHAR LogicalBlockAddress[4] ;
1590   UCHAR Reserved3 ;
1591   UCHAR AllocationLength[2] ;
1592   UCHAR Control ;
1593};
1594struct _PLAY_AUDIO {
1595   UCHAR OperationCode ;
1596   UCHAR Reserved1 : 5 ;
1597   UCHAR LogicalUnitNumber : 3 ;
1598   UCHAR StartingBlockAddress[4] ;
1599   UCHAR Reserved2 ;
1600   UCHAR PlayLength[2] ;
1601   UCHAR Control ;
1602};
1603struct _PLAY_AUDIO_MSF {
1604   UCHAR OperationCode ;
1605   UCHAR Reserved1 : 5 ;
1606   UCHAR LogicalUnitNumber : 3 ;
1607   UCHAR Reserved2 ;
1608   UCHAR StartingM ;
1609   UCHAR StartingS ;
1610   UCHAR StartingF ;
1611   UCHAR EndingM ;
1612   UCHAR EndingS ;
1613   UCHAR EndingF ;
1614   UCHAR Control ;
1615};
1616struct _LBA {
1617   UCHAR StartingBlockAddress[4] ;
1618   UCHAR PlayLength[4] ;
1619};
1620struct _MSF {
1621   UCHAR Reserved1 ;
1622   UCHAR StartingM ;
1623   UCHAR StartingS ;
1624   UCHAR StartingF ;
1625   UCHAR EndingM ;
1626   UCHAR EndingS ;
1627   UCHAR EndingF ;
1628   UCHAR Reserved2 ;
1629};
1630union __anonunion____missing_field_name_117 {
1631   struct _LBA LBA ;
1632   struct _MSF MSF ;
1633};
1634struct _PLAY_CD {
1635   UCHAR OperationCode ;
1636   UCHAR Reserved1 : 1 ;
1637   UCHAR CMSF : 1 ;
1638   UCHAR ExpectedSectorType : 3 ;
1639   UCHAR Lun : 3 ;
1640   union __anonunion____missing_field_name_117 __annonCompField22 ;
1641   UCHAR Audio : 1 ;
1642   UCHAR Composite : 1 ;
1643   UCHAR Port1 : 1 ;
1644   UCHAR Port2 : 1 ;
1645   UCHAR Reserved2 : 3 ;
1646   UCHAR Speed : 1 ;
1647   UCHAR Control ;
1648};
1649struct _SCAN_CD {
1650   UCHAR OperationCode ;
1651   UCHAR RelativeAddress : 1 ;
1652   UCHAR Reserved1 : 3 ;
1653   UCHAR Direct : 1 ;
1654   UCHAR Lun : 3 ;
1655   UCHAR StartingAddress[4] ;
1656   UCHAR Reserved2[3] ;
1657   UCHAR Reserved3 : 6 ;
1658   UCHAR Type : 2 ;
1659   UCHAR Reserved4 ;
1660   UCHAR Control ;
1661};
1662struct _STOP_PLAY_SCAN {
1663   UCHAR OperationCode ;
1664   UCHAR Reserved1 : 5 ;
1665   UCHAR Lun : 3 ;
1666   UCHAR Reserved2[7] ;
1667   UCHAR Control ;
1668};
1669struct _SUBCHANNEL {
1670   UCHAR OperationCode ;
1671   UCHAR Reserved0 : 1 ;
1672   UCHAR Msf : 1 ;
1673   UCHAR Reserved1 : 3 ;
1674   UCHAR LogicalUnitNumber : 3 ;
1675   UCHAR Reserved2 : 6 ;
1676   UCHAR SubQ : 1 ;
1677   UCHAR Reserved3 : 1 ;
1678   UCHAR Format ;
1679   UCHAR Reserved4[2] ;
1680   UCHAR TrackNumber ;
1681   UCHAR AllocationLength[2] ;
1682   UCHAR Control ;
1683};
1684struct _READ_CD {
1685   UCHAR OperationCode ;
1686   UCHAR RelativeAddress : 1 ;
1687   UCHAR Reserved0 : 1 ;
1688   UCHAR ExpectedSectorType : 3 ;
1689   UCHAR Lun : 3 ;
1690   UCHAR StartingLBA[4] ;
1691   UCHAR TransferBlocks[3] ;
1692   UCHAR Reserved2 : 1 ;
1693   UCHAR ErrorFlags : 2 ;
1694   UCHAR IncludeEDC : 1 ;
1695   UCHAR IncludeUserData : 1 ;
1696   UCHAR HeaderCode : 2 ;
1697   UCHAR IncludeSyncData : 1 ;
1698   UCHAR SubChannelSelection : 3 ;
1699   UCHAR Reserved3 : 5 ;
1700   UCHAR Control ;
1701};
1702struct _READ_CD_MSF {
1703   UCHAR OperationCode ;
1704   UCHAR RelativeAddress : 1 ;
1705   UCHAR Reserved1 : 1 ;
1706   UCHAR ExpectedSectorType : 3 ;
1707   UCHAR Lun : 3 ;
1708   UCHAR Reserved2 ;
1709   UCHAR StartingM ;
1710   UCHAR StartingS ;
1711   UCHAR StartingF ;
1712   UCHAR EndingM ;
1713   UCHAR EndingS ;
1714   UCHAR EndingF ;
1715   UCHAR Reserved3 ;
1716   UCHAR Reserved4 : 1 ;
1717   UCHAR ErrorFlags : 2 ;
1718   UCHAR IncludeEDC : 1 ;
1719   UCHAR IncludeUserData : 1 ;
1720   UCHAR HeaderCode : 2 ;
1721   UCHAR IncludeSyncData : 1 ;
1722   UCHAR SubChannelSelection : 3 ;
1723   UCHAR Reserved5 : 5 ;
1724   UCHAR Control ;
1725};
1726struct _PLXTR_READ_CDDA {
1727   UCHAR OperationCode ;
1728   UCHAR Reserved0 : 5 ;
1729   UCHAR LogicalUnitNumber : 3 ;
1730   UCHAR LogicalBlockByte0 ;
1731   UCHAR LogicalBlockByte1 ;
1732   UCHAR LogicalBlockByte2 ;
1733   UCHAR LogicalBlockByte3 ;
1734   UCHAR TransferBlockByte0 ;
1735   UCHAR TransferBlockByte1 ;
1736   UCHAR TransferBlockByte2 ;
1737   UCHAR TransferBlockByte3 ;
1738   UCHAR SubCode ;
1739   UCHAR Control ;
1740};
1741struct _NEC_READ_CDDA {
1742   UCHAR OperationCode ;
1743   UCHAR Reserved0 ;
1744   UCHAR LogicalBlockByte0 ;
1745   UCHAR LogicalBlockByte1 ;
1746   UCHAR LogicalBlockByte2 ;
1747   UCHAR LogicalBlockByte3 ;
1748   UCHAR Reserved1 ;
1749   UCHAR TransferBlockByte0 ;
1750   UCHAR TransferBlockByte1 ;
1751   UCHAR Control ;
1752};
1753struct _MODE_SENSE {
1754   UCHAR OperationCode ;
1755   UCHAR Reserved1 : 3 ;
1756   UCHAR Dbd : 1 ;
1757   UCHAR Reserved2 : 1 ;
1758   UCHAR LogicalUnitNumber : 3 ;
1759   UCHAR PageCode : 6 ;
1760   UCHAR Pc : 2 ;
1761   UCHAR Reserved3 ;
1762   UCHAR AllocationLength ;
1763   UCHAR Control ;
1764};
1765struct _MODE_SENSE10 {
1766   UCHAR OperationCode ;
1767   UCHAR Reserved1 : 3 ;
1768   UCHAR Dbd : 1 ;
1769   UCHAR Reserved2 : 1 ;
1770   UCHAR LogicalUnitNumber : 3 ;
1771   UCHAR PageCode : 6 ;
1772   UCHAR Pc : 2 ;
1773   UCHAR Reserved3[4] ;
1774   UCHAR AllocationLength[2] ;
1775   UCHAR Control ;
1776};
1777struct _MODE_SELECT {
1778   UCHAR OperationCode ;
1779   UCHAR SPBit : 1 ;
1780   UCHAR Reserved1 : 3 ;
1781   UCHAR PFBit : 1 ;
1782   UCHAR LogicalUnitNumber : 3 ;
1783   UCHAR Reserved2[2] ;
1784   UCHAR ParameterListLength ;
1785   UCHAR Control ;
1786};
1787struct _MODE_SELECT10 {
1788   UCHAR OperationCode ;
1789   UCHAR SPBit : 1 ;
1790   UCHAR Reserved1 : 3 ;
1791   UCHAR PFBit : 1 ;
1792   UCHAR LogicalUnitNumber : 3 ;
1793   UCHAR Reserved2[5] ;
1794   UCHAR ParameterListLength[2] ;
1795   UCHAR Control ;
1796};
1797struct _LOCATE {
1798   UCHAR OperationCode ;
1799   UCHAR Immediate : 1 ;
1800   UCHAR CPBit : 1 ;
1801   UCHAR BTBit : 1 ;
1802   UCHAR Reserved1 : 2 ;
1803   UCHAR LogicalUnitNumber : 3 ;
1804   UCHAR Reserved3 ;
1805   UCHAR LogicalBlockAddress[4] ;
1806   UCHAR Reserved4 ;
1807   UCHAR Partition ;
1808   UCHAR Control ;
1809};
1810struct _LOGSENSE {
1811   UCHAR OperationCode ;
1812   UCHAR SPBit : 1 ;
1813   UCHAR PPCBit : 1 ;
1814   UCHAR Reserved1 : 3 ;
1815   UCHAR LogicalUnitNumber : 3 ;
1816   UCHAR PageCode : 6 ;
1817   UCHAR PCBit : 2 ;
1818   UCHAR Reserved2 ;
1819   UCHAR Reserved3 ;
1820   UCHAR ParameterPointer[2] ;
1821   UCHAR AllocationLength[2] ;
1822   UCHAR Control ;
1823};
1824struct _LOGSELECT {
1825   UCHAR OperationCode ;
1826   UCHAR SPBit : 1 ;
1827   UCHAR PCRBit : 1 ;
1828   UCHAR Reserved1 : 3 ;
1829   UCHAR LogicalUnitNumber : 3 ;
1830   UCHAR Reserved : 6 ;
1831   UCHAR PCBit : 2 ;
1832   UCHAR Reserved2[4] ;
1833   UCHAR ParameterListLength[2] ;
1834   UCHAR Control ;
1835};
1836struct _PRINT {
1837   UCHAR OperationCode ;
1838   UCHAR Reserved : 5 ;
1839   UCHAR LogicalUnitNumber : 3 ;
1840   UCHAR TransferLength[3] ;
1841   UCHAR Control ;
1842};
1843struct _SEEK {
1844   UCHAR OperationCode ;
1845   UCHAR Reserved1 : 5 ;
1846   UCHAR LogicalUnitNumber : 3 ;
1847   UCHAR LogicalBlockAddress[4] ;
1848   UCHAR Reserved2[3] ;
1849   UCHAR Control ;
1850};
1851struct _ERASE {
1852   UCHAR OperationCode ;
1853   UCHAR Long : 1 ;
1854   UCHAR Immediate : 1 ;
1855   UCHAR Reserved1 : 3 ;
1856   UCHAR LogicalUnitNumber : 3 ;
1857   UCHAR Reserved2[3] ;
1858   UCHAR Control ;
1859};
1860struct _START_STOP {
1861   UCHAR OperationCode ;
1862   UCHAR Immediate : 1 ;
1863   UCHAR Reserved1 : 4 ;
1864   UCHAR LogicalUnitNumber : 3 ;
1865   UCHAR Reserved2[2] ;
1866   UCHAR Start : 1 ;
1867   UCHAR LoadEject : 1 ;
1868   UCHAR Reserved3 : 6 ;
1869   UCHAR Control ;
1870};
1871struct _MEDIA_REMOVAL {
1872   UCHAR OperationCode ;
1873   UCHAR Reserved1 : 5 ;
1874   UCHAR LogicalUnitNumber : 3 ;
1875   UCHAR Reserved2[2] ;
1876   UCHAR Prevent : 1 ;
1877   UCHAR Persistant : 1 ;
1878   UCHAR Reserved3 : 6 ;
1879   UCHAR Control ;
1880};
1881struct _SEEK_BLOCK {
1882   UCHAR OperationCode ;
1883   UCHAR Immediate : 1 ;
1884   UCHAR Reserved1 : 7 ;
1885   UCHAR BlockAddress[3] ;
1886   UCHAR Link : 1 ;
1887   UCHAR Flag : 1 ;
1888   UCHAR Reserved2 : 4 ;
1889   UCHAR VendorUnique : 2 ;
1890};
1891struct _REQUEST_BLOCK_ADDRESS {
1892   UCHAR OperationCode ;
1893   UCHAR Reserved1[3] ;
1894   UCHAR AllocationLength ;
1895   UCHAR Link : 1 ;
1896   UCHAR Flag : 1 ;
1897   UCHAR Reserved2 : 4 ;
1898   UCHAR VendorUnique : 2 ;
1899};
1900struct _PARTITION {
1901   UCHAR OperationCode ;
1902   UCHAR Immediate : 1 ;
1903   UCHAR Sel : 1 ;
1904   UCHAR PartitionSelect : 6 ;
1905   UCHAR Reserved1[3] ;
1906   UCHAR Control ;
1907};
1908struct _WRITE_TAPE_MARKS {
1909   UCHAR OperationCode ;
1910   UCHAR Immediate : 1 ;
1911   UCHAR WriteSetMarks : 1 ;
1912   UCHAR Reserved : 3 ;
1913   UCHAR LogicalUnitNumber : 3 ;
1914   UCHAR TransferLength[3] ;
1915   UCHAR Control ;
1916};
1917struct __anonstruct_Fields_119 {
1918   UCHAR Link : 1 ;
1919   UCHAR Flag : 1 ;
1920   UCHAR Reserved : 4 ;
1921   UCHAR VendorUnique : 2 ;
1922};
1923union __anonunion_Byte6_118 {
1924   UCHAR value ;
1925   struct __anonstruct_Fields_119 Fields ;
1926};
1927struct _SPACE_TAPE_MARKS {
1928   UCHAR OperationCode ;
1929   UCHAR Code : 3 ;
1930   UCHAR Reserved : 2 ;
1931   UCHAR LogicalUnitNumber : 3 ;
1932   UCHAR NumMarksMSB ;
1933   UCHAR NumMarks ;
1934   UCHAR NumMarksLSB ;
1935   union __anonunion_Byte6_118 Byte6 ;
1936};
1937struct _READ_POSITION {
1938   UCHAR Operation ;
1939   UCHAR BlockType : 1 ;
1940   UCHAR Reserved1 : 4 ;
1941   UCHAR Lun : 3 ;
1942   UCHAR Reserved2[7] ;
1943   UCHAR Control ;
1944};
1945struct _CDB6READWRITETAPE {
1946   UCHAR OperationCode ;
1947   UCHAR VendorSpecific : 5 ;
1948   UCHAR Reserved : 3 ;
1949   UCHAR TransferLenMSB ;
1950   UCHAR TransferLen ;
1951   UCHAR TransferLenLSB ;
1952   UCHAR Link : 1 ;
1953   UCHAR Flag : 1 ;
1954   UCHAR Reserved1 : 4 ;
1955   UCHAR VendorUnique : 2 ;
1956};
1957struct _INIT_ELEMENT_STATUS {
1958   UCHAR OperationCode ;
1959   UCHAR Reserved1 : 5 ;
1960   UCHAR LogicalUnitNubmer : 3 ;
1961   UCHAR Reserved2[3] ;
1962   UCHAR Reserved3 : 7 ;
1963   UCHAR NoBarCode : 1 ;
1964};
1965struct _INITIALIZE_ELEMENT_RANGE {
1966   UCHAR OperationCode ;
1967   UCHAR Range : 1 ;
1968   UCHAR Reserved1 : 4 ;
1969   UCHAR LogicalUnitNubmer : 3 ;
1970   UCHAR FirstElementAddress[2] ;
1971   UCHAR Reserved2[2] ;
1972   UCHAR NumberOfElements[2] ;
1973   UCHAR Reserved3 ;
1974   UCHAR Reserved4 : 7 ;
1975   UCHAR NoBarCode : 1 ;
1976};
1977struct _POSITION_TO_ELEMENT {
1978   UCHAR OperationCode ;
1979   UCHAR Reserved1 : 5 ;
1980   UCHAR LogicalUnitNumber : 3 ;
1981   UCHAR TransportElementAddress[2] ;
1982   UCHAR DestinationElementAddress[2] ;
1983   UCHAR Reserved2[2] ;
1984   UCHAR Flip : 1 ;
1985   UCHAR Reserved3 : 7 ;
1986   UCHAR Control ;
1987};
1988struct _MOVE_MEDIUM {
1989   UCHAR OperationCode ;
1990   UCHAR Reserved1 : 5 ;
1991   UCHAR LogicalUnitNumber : 3 ;
1992   UCHAR TransportElementAddress[2] ;
1993   UCHAR SourceElementAddress[2] ;
1994   UCHAR DestinationElementAddress[2] ;
1995   UCHAR Reserved2[2] ;
1996   UCHAR Flip : 1 ;
1997   UCHAR Reserved3 : 7 ;
1998   UCHAR Control ;
1999};
2000struct _EXCHANGE_MEDIUM {
2001   UCHAR OperationCode ;
2002   UCHAR Reserved1 : 5 ;
2003   UCHAR LogicalUnitNumber : 3 ;
2004   UCHAR TransportElementAddress[2] ;
2005   UCHAR SourceElementAddress[2] ;
2006   UCHAR Destination1ElementAddress[2] ;
2007   UCHAR Destination2ElementAddress[2] ;
2008   UCHAR Flip1 : 1 ;
2009   UCHAR Flip2 : 1 ;
2010   UCHAR Reserved3 : 6 ;
2011   UCHAR Control ;
2012};
2013struct _READ_ELEMENT_STATUS {
2014   UCHAR OperationCode ;
2015   UCHAR ElementType : 4 ;
2016   UCHAR VolTag : 1 ;
2017   UCHAR LogicalUnitNumber : 3 ;
2018   UCHAR StartingElementAddress[2] ;
2019   UCHAR NumberOfElements[2] ;
2020   UCHAR Reserved1 ;
2021   UCHAR AllocationLength[3] ;
2022   UCHAR Reserved2 ;
2023   UCHAR Control ;
2024};
2025struct _SEND_VOLUME_TAG {
2026   UCHAR OperationCode ;
2027   UCHAR ElementType : 4 ;
2028   UCHAR Reserved1 : 1 ;
2029   UCHAR LogicalUnitNumber : 3 ;
2030   UCHAR StartingElementAddress[2] ;
2031   UCHAR Reserved2 ;
2032   UCHAR ActionCode : 5 ;
2033   UCHAR Reserved3 : 3 ;
2034   UCHAR Reserved4[2] ;
2035   UCHAR ParameterListLength[2] ;
2036   UCHAR Reserved5 ;
2037   UCHAR Control ;
2038};
2039struct _REQUEST_VOLUME_ELEMENT_ADDRESS {
2040   UCHAR OperationCode ;
2041   UCHAR ElementType : 4 ;
2042   UCHAR VolTag : 1 ;
2043   UCHAR LogicalUnitNumber : 3 ;
2044   UCHAR StartingElementAddress[2] ;
2045   UCHAR NumberElements[2] ;
2046   UCHAR Reserved1 ;
2047   UCHAR AllocationLength[3] ;
2048   UCHAR Reserved2 ;
2049   UCHAR Control ;
2050};
2051struct _LOAD_UNLOAD {
2052   UCHAR OperationCode ;
2053   UCHAR Immediate : 1 ;
2054   UCHAR Reserved1 : 4 ;
2055   UCHAR Lun : 3 ;
2056   UCHAR Reserved2[2] ;
2057   UCHAR Start : 1 ;
2058   UCHAR LoadEject : 1 ;
2059   UCHAR Reserved3 : 6 ;
2060   UCHAR Reserved4[3] ;
2061   UCHAR Slot ;
2062   UCHAR Reserved5[3] ;
2063};
2064struct _MECH_STATUS {
2065   UCHAR OperationCode ;
2066   UCHAR Reserved : 5 ;
2067   UCHAR Lun : 3 ;
2068   UCHAR Reserved1[6] ;
2069   UCHAR AllocationLength[2] ;
2070   UCHAR Reserved2[1] ;
2071   UCHAR Control ;
2072};
2073struct _SYNCHRONIZE_CACHE10 {
2074   UCHAR OperationCode ;
2075   UCHAR RelAddr : 1 ;
2076   UCHAR Immediate : 1 ;
2077   UCHAR Reserved : 3 ;
2078   UCHAR Lun : 3 ;
2079   UCHAR LogicalBlockAddress[4] ;
2080   UCHAR Reserved2 ;
2081   UCHAR BlockCount[2] ;
2082   UCHAR Control ;
2083};
2084struct _GET_EVENT_STATUS_NOTIFICATION {
2085   UCHAR OperationCode ;
2086   UCHAR Immediate : 1 ;
2087   UCHAR Reserved : 4 ;
2088   UCHAR Lun : 3 ;
2089   UCHAR Reserved2[2] ;
2090   UCHAR NotificationClassRequest ;
2091   UCHAR Reserved3[2] ;
2092   UCHAR EventListLength[2] ;
2093   UCHAR Control ;
2094};
2095struct _READ_DVD_STRUCTURE {
2096   UCHAR OperationCode ;
2097   UCHAR Reserved1 : 5 ;
2098   UCHAR Lun : 3 ;
2099   UCHAR RMDBlockNumber[4] ;
2100   UCHAR LayerNumber ;
2101   UCHAR Format ;
2102   UCHAR AllocationLength[2] ;
2103   UCHAR Reserved3 : 6 ;
2104   UCHAR AGID : 2 ;
2105   UCHAR Control ;
2106};
2107struct _SEND_KEY {
2108   UCHAR OperationCode ;
2109   UCHAR Reserved1 : 5 ;
2110   UCHAR Lun : 3 ;
2111   UCHAR Reserved2[6] ;
2112   UCHAR ParameterListLength[2] ;
2113   UCHAR KeyFormat : 6 ;
2114   UCHAR AGID : 2 ;
2115   UCHAR Control ;
2116};
2117struct _REPORT_KEY {
2118   UCHAR OperationCode ;
2119   UCHAR Reserved1 : 5 ;
2120   UCHAR Lun : 3 ;
2121   UCHAR LogicalBlockAddress[4] ;
2122   UCHAR Reserved2[2] ;
2123   UCHAR AllocationLength[2] ;
2124   UCHAR KeyFormat : 6 ;
2125   UCHAR AGID : 2 ;
2126   UCHAR Control ;
2127};
2128struct _SET_READ_AHEAD {
2129   UCHAR OperationCode ;
2130   UCHAR Reserved1 : 5 ;
2131   UCHAR Lun : 3 ;
2132   UCHAR TriggerLBA[4] ;
2133   UCHAR ReadAheadLBA[4] ;
2134   UCHAR Reserved2 ;
2135   UCHAR Control ;
2136};
2137struct _READ_FORMATTED_CAPACITIES {
2138   UCHAR OperationCode ;
2139   UCHAR Reserved1 : 5 ;
2140   UCHAR Lun : 3 ;
2141   UCHAR Reserved2[5] ;
2142   UCHAR AllocationLength[2] ;
2143   UCHAR Control ;
2144};
2145struct _REPORT_LUNS {
2146   UCHAR OperationCode ;
2147   UCHAR Reserved1[5] ;
2148   UCHAR AllocationLength[4] ;
2149   UCHAR Reserved2[1] ;
2150   UCHAR Control ;
2151};
2152union _CDB {
2153   struct _CDB6GENERIC CDB6GENERIC ;
2154   struct _CDB6GENERIC *PCDB6GENERIC ;
2155   struct _CDB6READWRITE CDB6READWRITE ;
2156   struct _CDB6READWRITE *PCDB6READWRITE ;
2157   struct _CDB6INQUIRY CDB6INQUIRY ;
2158   struct _CDB6INQUIRY *PCDB6INQUIRY ;
2159   struct _CDB6VERIFY CDB6VERIFY ;
2160   struct _CDB6VERIFY *PCDB6VERIFY ;
2161   struct _CDB6FORMAT CDB6FORMAT ;
2162   struct _CDB6FORMAT *PCDB6FORMAT ;
2163   struct _CDB10 CDB10 ;
2164   struct _CDB10 *PCDB10 ;
2165   struct _CDB12 CDB12 ;
2166   struct _CDB12 *PCDB12 ;
2167   struct _PAUSE_RESUME PAUSE_RESUME ;
2168   struct _PAUSE_RESUME *PPAUSE_RESUME ;
2169   struct _READ_TOC READ_TOC ;
2170   struct _READ_TOC *PREAD_TOC ;
2171   struct _READ_DISK_INFORMATION READ_DISK_INFORMATION ;
2172   struct _READ_DISK_INFORMATION *PREAD_DISK_INFORMATION ;
2173   struct _READ_TRACK_INFORMATION READ_TRACK_INFORMATION ;
2174   struct _READ_TRACK_INFORMATION *PREAD_TRACK_INFORMATION ;
2175   struct _READ_HEADER READ_HEADER ;
2176   struct _READ_HEADER *PREAD_HEADER ;
2177   struct _PLAY_AUDIO PLAY_AUDIO ;
2178   struct _PLAY_AUDIO *PPLAY_AUDIO ;
2179   struct _PLAY_AUDIO_MSF PLAY_AUDIO_MSF ;
2180   struct _PLAY_AUDIO_MSF *PPLAY_AUDIO_MSF ;
2181   struct _PLAY_CD PLAY_CD ;
2182   struct _PLAY_CD *PPLAY_CD ;
2183   struct _SCAN_CD SCAN_CD ;
2184   struct _SCAN_CD *PSCAN_CD ;
2185   struct _STOP_PLAY_SCAN STOP_PLAY_SCAN ;
2186   struct _STOP_PLAY_SCAN *PSTOP_PLAY_SCAN ;
2187   struct _SUBCHANNEL SUBCHANNEL ;
2188   struct _SUBCHANNEL *PSUBCHANNEL ;
2189   struct _READ_CD READ_CD ;
2190   struct _READ_CD *PREAD_CD ;
2191   struct _READ_CD_MSF READ_CD_MSF ;
2192   struct _READ_CD_MSF *PREAD_CD_MSF ;
2193   struct _PLXTR_READ_CDDA PLXTR_READ_CDDA ;
2194   struct _PLXTR_READ_CDDA *PPLXTR_READ_CDDA ;
2195   struct _NEC_READ_CDDA NEC_READ_CDDA ;
2196   struct _NEC_READ_CDDA *PNEC_READ_CDDA ;
2197   struct _MODE_SENSE MODE_SENSE ;
2198   struct _MODE_SENSE *PMODE_SENSE ;
2199   struct _MODE_SENSE10 MODE_SENSE10 ;
2200   struct _MODE_SENSE10 *PMODE_SENSE10 ;
2201   struct _MODE_SELECT MODE_SELECT ;
2202   struct _MODE_SELECT *PMODE_SELECT ;
2203   struct _MODE_SELECT10 MODE_SELECT10 ;
2204   struct _MODE_SELECT10 *PMODE_SELECT10 ;
2205   struct _LOCATE LOCATE ;
2206   struct _LOCATE *PLOCATE ;
2207   struct _LOGSENSE LOGSENSE ;
2208   struct _LOGSENSE *PLOGSENSE ;
2209   struct _LOGSELECT LOGSELECT ;
2210   struct _LOGSELECT *PLOGSELECT ;
2211   struct _PRINT PRINT ;
2212   struct _PRINT *PPRINT ;
2213   struct _SEEK SEEK ;
2214   struct _SEEK *PSEEK ;
2215   struct _ERASE ERASE ;
2216   struct _ERASE *PERASE ;
2217   struct _START_STOP START_STOP ;
2218   struct _START_STOP *PSTART_STOP ;
2219   struct _MEDIA_REMOVAL MEDIA_REMOVAL ;
2220   struct _MEDIA_REMOVAL *PMEDIA_REMOVAL ;
2221   struct _SEEK_BLOCK SEEK_BLOCK ;
2222   struct _SEEK_BLOCK *PSEEK_BLOCK ;
2223   struct _REQUEST_BLOCK_ADDRESS REQUEST_BLOCK_ADDRESS ;
2224   struct _REQUEST_BLOCK_ADDRESS *PREQUEST_BLOCK_ADDRESS ;
2225   struct _PARTITION PARTITION ;
2226   struct _PARTITION *PPARTITION ;
2227   struct _WRITE_TAPE_MARKS WRITE_TAPE_MARKS ;
2228   struct _WRITE_TAPE_MARKS *PWRITE_TAPE_MARKS ;
2229   struct _SPACE_TAPE_MARKS SPACE_TAPE_MARKS ;
2230   struct _SPACE_TAPE_MARKS *PSPACE_TAPE_MARKS ;
2231   struct _READ_POSITION READ_POSITION ;
2232   struct _READ_POSITION *PREAD_POSITION ;
2233   struct _CDB6READWRITETAPE CDB6READWRITETAPE ;
2234   struct _CDB6READWRITETAPE *PCDB6READWRITETAPE ;
2235   struct _INIT_ELEMENT_STATUS INIT_ELEMENT_STATUS ;
2236   struct _INIT_ELEMENT_STATUS *PINIT_ELEMENT_STATUS ;
2237   struct _INITIALIZE_ELEMENT_RANGE INITIALIZE_ELEMENT_RANGE ;
2238   struct _INITIALIZE_ELEMENT_RANGE *PINITIALIZE_ELEMENT_RANGE ;
2239   struct _POSITION_TO_ELEMENT POSITION_TO_ELEMENT ;
2240   struct _POSITION_TO_ELEMENT *PPOSITION_TO_ELEMENT ;
2241   struct _MOVE_MEDIUM MOVE_MEDIUM ;
2242   struct _MOVE_MEDIUM *PMOVE_MEDIUM ;
2243   struct _EXCHANGE_MEDIUM EXCHANGE_MEDIUM ;
2244   struct _EXCHANGE_MEDIUM *PEXCHANGE_MEDIUM ;
2245   struct _READ_ELEMENT_STATUS READ_ELEMENT_STATUS ;
2246   struct _READ_ELEMENT_STATUS *PREAD_ELEMENT_STATUS ;
2247   struct _SEND_VOLUME_TAG SEND_VOLUME_TAG ;
2248   struct _SEND_VOLUME_TAG *PSEND_VOLUME_TAG ;
2249   struct _REQUEST_VOLUME_ELEMENT_ADDRESS REQUEST_VOLUME_ELEMENT_ADDRESS ;
2250   struct _REQUEST_VOLUME_ELEMENT_ADDRESS *PREQUEST_VOLUME_ELEMENT_ADDRESS ;
2251   struct _LOAD_UNLOAD LOAD_UNLOAD ;
2252   struct _LOAD_UNLOAD *PLOAD_UNLOAD ;
2253   struct _MECH_STATUS MECH_STATUS ;
2254   struct _MECH_STATUS *PMECH_STATUS ;
2255   struct _SYNCHRONIZE_CACHE10 SYNCHRONIZE_CACHE10 ;
2256   struct _SYNCHRONIZE_CACHE10 *PSYNCHRONIZE_CACHE10 ;
2257   struct _GET_EVENT_STATUS_NOTIFICATION GET_EVENT_STATUS_NOTIFICATION ;
2258   struct _GET_EVENT_STATUS_NOTIFICATION *PGET_EVENT_STATUS_NOTIFICATION ;
2259   struct _READ_DVD_STRUCTURE READ_DVD_STRUCTURE ;
2260   struct _READ_DVD_STRUCTURE *PREAD_DVD_STRUCTURE ;
2261   struct _SEND_KEY SEND_KEY ;
2262   struct _SEND_KEY *PSEND_KEY ;
2263   struct _REPORT_KEY REPORT_KEY ;
2264   struct _REPORT_KEY *PREPORT_KEY ;
2265   struct _SET_READ_AHEAD SET_READ_AHEAD ;
2266   struct _SET_READ_AHEAD *PSET_READ_AHEAD ;
2267   struct _READ_FORMATTED_CAPACITIES READ_FORMATTED_CAPACITIES ;
2268   struct _READ_FORMATTED_CAPACITIES *PREAD_FORMATTED_CAPACITIES ;
2269   struct _REPORT_LUNS REPORT_LUNS ;
2270   struct _REPORT_LUNS *PREPORT_LUNS ;
2271   ULONG AsUlong[4] ;
2272   UCHAR AsByte[16] ;
2273};
2274typedef union _CDB *PCDB;
2275#pragma pack(1)
2276#pragma pack()
2277struct _INQUIRYDATA {
2278   UCHAR DeviceType : 5 ;
2279   UCHAR DeviceTypeQualifier : 3 ;
2280   UCHAR DeviceTypeModifier : 7 ;
2281   UCHAR RemovableMedia : 1 ;
2282   UCHAR Versions ;
2283   UCHAR ResponseDataFormat : 4 ;
2284   UCHAR HiSupport : 1 ;
2285   UCHAR NormACA : 1 ;
2286   UCHAR ReservedBit : 1 ;
2287   UCHAR AERC : 1 ;
2288   UCHAR AdditionalLength ;
2289   UCHAR Reserved[2] ;
2290   UCHAR SoftReset : 1 ;
2291   UCHAR CommandQueue : 1 ;
2292   UCHAR Reserved2 : 1 ;
2293   UCHAR LinkedCommands : 1 ;
2294   UCHAR Synchronous : 1 ;
2295   UCHAR Wide16Bit : 1 ;
2296   UCHAR Wide32Bit : 1 ;
2297   UCHAR RelativeAddressing : 1 ;
2298   UCHAR VendorId[8] ;
2299   UCHAR ProductId[16] ;
2300   UCHAR ProductRevisionLevel[4] ;
2301   UCHAR VendorSpecific[20] ;
2302   UCHAR Reserved3[40] ;
2303};
2304typedef struct _INQUIRYDATA *PINQUIRYDATA;
2305struct _READ_CAPACITY_DATA {
2306   ULONG LogicalBlockAddress ;
2307   ULONG BytesPerBlock ;
2308};
2309typedef struct _READ_CAPACITY_DATA READ_CAPACITY_DATA;
2310typedef struct _READ_CAPACITY_DATA *PREAD_CAPACITY_DATA;
2311struct _CD_DEVICE_EXTENSION {
2312   PDEVICE_OBJECT TargetDeviceObject ;
2313   PDEVICE_OBJECT TargetPdo ;
2314   PDEVICE_OBJECT DeviceObject ;
2315   ULONG PagingPathCount ;
2316   KEVENT PagingPathCountEvent ;
2317   PRKDPC Dpc ;
2318   PKTIMER Timer ;
2319   LONG Sync ;
2320   UCHAR Active ;
2321   UCHAR Paused ;
2322   UCHAR PausedM ;
2323   UCHAR PausedS ;
2324   UCHAR PausedF ;
2325   UCHAR LastEndM ;
2326   UCHAR LastEndS ;
2327   UCHAR LastEndF ;
2328   BOOLEAN PlayActive ;
2329};
2330typedef struct _CD_DEVICE_EXTENSION CD_DEVICE_EXTENSION;
2331typedef struct _CD_DEVICE_EXTENSION *PCD_DEVICE_EXTENSION;
2332struct _NEC_READ_TOC {
2333   UCHAR OperationCode ;
2334   UCHAR Type : 2 ;
2335   UCHAR Reserved1 : 6 ;
2336   UCHAR TrackNumber ;
2337   UCHAR Reserved2[6] ;
2338   UCHAR Control ;
2339};
2340struct _NEC_PLAY_AUDIO {
2341   UCHAR OperationCode ;
2342   UCHAR PlayMode : 3 ;
2343   UCHAR Reserved1 : 5 ;
2344   UCHAR Minute ;
2345   UCHAR Second ;
2346   UCHAR Frame ;
2347   UCHAR Reserved2[4] ;
2348   UCHAR Control ;
2349};
2350struct _NEC_SEEK_AUDIO {
2351   UCHAR OperationCode ;
2352   UCHAR Play : 1 ;
2353   UCHAR Reserved1 : 7 ;
2354   UCHAR Minute ;
2355   UCHAR Second ;
2356   UCHAR Frame ;
2357   UCHAR Reserved2[4] ;
2358   UCHAR Control ;
2359};
2360struct _NEC_PAUSE_AUDIO {
2361   UCHAR OperationCode ;
2362   UCHAR Reserved1[8] ;
2363   UCHAR Control ;
2364};
2365struct _NEC_READ_Q_CHANNEL {
2366   UCHAR OperationCode ;
2367   UCHAR TransferSize : 5 ;
2368   UCHAR Reserved1 : 3 ;
2369   UCHAR Reserved2[7] ;
2370   UCHAR Control ;
2371};
2372struct _NEC_EJECT {
2373   UCHAR OperationCode ;
2374   UCHAR Immediate : 1 ;
2375   UCHAR Reserved1 : 7 ;
2376   UCHAR Reserved2[7] ;
2377   UCHAR Control ;
2378};
2379union _NEC_CDB {
2380   struct _NEC_READ_TOC NEC_READ_TOC ;
2381   struct _NEC_READ_TOC *PNEC_READ_TOC ;
2382   struct _NEC_PLAY_AUDIO NEC_PLAY_AUDIO ;
2383   struct _NEC_PLAY_AUDIO *PNEC_PLAY_AUDIO ;
2384   struct _NEC_SEEK_AUDIO NEC_SEEK_AUDIO ;
2385   struct _NEC_SEEK_AUDIO *PNEC_SEEK_AUDIO ;
2386   struct _NEC_PAUSE_AUDIO NEC_PAUSE_AUDIO ;
2387   struct _NEC_PAUSE_AUDIO *PNEC_PAUSE_AUDIO ;
2388   struct _NEC_READ_Q_CHANNEL NEC_READ_Q_CHANNEL ;
2389   struct _NEC_READ_Q_CHANNEL *PNEC_READ_Q_CHANNEL ;
2390   struct _NEC_EJECT NEC_EJECT ;
2391   struct _NEC_EJECT *PNEC_EJECT ;
2392};
2393typedef union _NEC_CDB *PNEC_CDB;
2394struct _PNR_START_STOP {
2395   UCHAR OperationCode ;
2396   UCHAR Immediate : 1 ;
2397   UCHAR Reserved1 : 4 ;
2398   UCHAR Lun : 3 ;
2399   UCHAR Reserved2 : 7 ;
2400   UCHAR PCF : 1 ;
2401   UCHAR Reserved3 ;
2402   UCHAR Start : 1 ;
2403   UCHAR Eject : 1 ;
2404   UCHAR Reserved4 : 6 ;
2405   UCHAR Link : 1 ;
2406   UCHAR Flag : 1 ;
2407   UCHAR Reserved5 : 4 ;
2408   UCHAR Vendor : 2 ;
2409};
2410struct _PNR_READ_TOC {
2411   UCHAR OperationCode ;
2412   UCHAR Reserved1 : 5 ;
2413   UCHAR Lun : 3 ;
2414   UCHAR Reserved2[3] ;
2415   UCHAR TrackNumber ;
2416   UCHAR Reserved3 ;
2417   UCHAR AssignedLength[2] ;
2418   UCHAR Link : 1 ;
2419   UCHAR Flag : 1 ;
2420   UCHAR Reserved4 : 4 ;
2421   UCHAR Type : 2 ;
2422};
2423struct _PNR_PLAY_AUDIO {
2424   UCHAR OperationCode ;
2425   UCHAR PlayMode : 4 ;
2426   UCHAR StopAddr : 1 ;
2427   UCHAR Lun : 3 ;
2428   UCHAR Reserved1 ;
2429   UCHAR Minute ;
2430   UCHAR Second ;
2431   UCHAR Frame ;
2432   UCHAR Reserved2[3] ;
2433   UCHAR Link : 1 ;
2434   UCHAR Flag : 1 ;
2435   UCHAR Reserved3 : 4 ;
2436   UCHAR Type : 2 ;
2437};
2438struct _PNR_SEEK_AUDIO {
2439   UCHAR OperationCode ;
2440   UCHAR PlayMode : 4 ;
2441   UCHAR PlayBack : 1 ;
2442   UCHAR Lun : 3 ;
2443   UCHAR Reserved1 ;
2444   UCHAR Minute ;
2445   UCHAR Second ;
2446   UCHAR Frame ;
2447   UCHAR Reserved2[3] ;
2448   UCHAR Link : 1 ;
2449   UCHAR Flag : 1 ;
2450   UCHAR Reserved3 : 4 ;
2451   UCHAR Type : 2 ;
2452};
2453struct _PNR_PAUSE_AUDIO {
2454   UCHAR OperationCode ;
2455   UCHAR Reserved1 : 4 ;
2456   UCHAR Pause : 1 ;
2457   UCHAR Lun : 3 ;
2458   UCHAR Reserved2[7] ;
2459   UCHAR Link : 1 ;
2460   UCHAR Flag : 1 ;
2461   UCHAR Reserved3 : 4 ;
2462   UCHAR Reserved4 : 2 ;
2463};
2464struct _PNR_AUDIO_STATUS {
2465   UCHAR OperationCode ;
2466   UCHAR Reserved1 : 4 ;
2467   UCHAR Reserved2 : 1 ;
2468   UCHAR Lun : 3 ;
2469   UCHAR Reserved3[6] ;
2470   UCHAR AssignedLength ;
2471   UCHAR Link : 1 ;
2472   UCHAR Flag : 1 ;
2473   UCHAR Reserved4 : 4 ;
2474   UCHAR Reserved5 : 2 ;
2475};
2476struct _PNR_READ_Q_CHANNEL {
2477   UCHAR OperationCode ;
2478   UCHAR Reserved1 : 4 ;
2479   UCHAR Reserved2 : 1 ;
2480   UCHAR Lun : 3 ;
2481   UCHAR Reserved3[6] ;
2482   UCHAR AssignedLength ;
2483   UCHAR Link : 1 ;
2484   UCHAR Flag : 1 ;
2485   UCHAR Reserved4 : 4 ;
2486   UCHAR Reserved5 : 2 ;
2487};
2488struct _PNR_EJECT {
2489   UCHAR OperationCode ;
2490   UCHAR Immediate : 1 ;
2491   UCHAR Reserved1 : 4 ;
2492   UCHAR Lun : 3 ;
2493   UCHAR Reserved2[7] ;
2494   UCHAR Link : 1 ;
2495   UCHAR Flag : 1 ;
2496   UCHAR Reserved4 : 4 ;
2497   UCHAR Reserved5 : 2 ;
2498};
2499struct _PNR_READ_STATUS {
2500   UCHAR OperationCode ;
2501   UCHAR Reserved1 : 4 ;
2502   UCHAR Lun : 3 ;
2503   UCHAR PageCode : 5 ;
2504   UCHAR PCField : 1 ;
2505   UCHAR Reserved2[5] ;
2506   UCHAR AllocationLengthMsb ;
2507   UCHAR AllocationLengthLsb ;
2508   UCHAR Link : 1 ;
2509   UCHAR Flag : 1 ;
2510   UCHAR Reserved3 : 4 ;
2511   UCHAR Reserved4 : 2 ;
2512};
2513union _PIONEER_CDB {
2514   struct _PNR_START_STOP PNR_START_STOP ;
2515   struct _PNR_START_STOP *PPNR_START_STOP ;
2516   struct _PNR_READ_TOC PNR_READ_TOC ;
2517   struct _PNR_READ_TOC *PPNR_READ_TOC ;
2518   struct _PNR_PLAY_AUDIO PNR_PLAY_AUDIO ;
2519   struct _PNR_PLAY_AUDIO *PPNR_PLAY_AUDIO ;
2520   struct _PNR_SEEK_AUDIO PNR_SEEK_AUDIO ;
2521   struct _PNR_SEEK_AUDIO *PPNR_SEEK_AUDIO ;
2522   struct _PNR_PAUSE_AUDIO PNR_PAUSE_AUDIO ;
2523   struct _PNR_PAUSE_AUDIO *PPNR_PAUSE_AUDIO ;
2524   struct _PNR_AUDIO_STATUS PNR_AUDIO_STATUS ;
2525   struct _PNR_AUDIO_STATUS *PPNR_AUDIO_STATUS ;
2526   struct _PNR_READ_Q_CHANNEL PNR_READ_Q_CHANNEL ;
2527   struct _PNR_READ_Q_CHANNEL *PPNR_READ_Q_CHANNEL ;
2528   struct _PNR_EJECT PNR_EJECT ;
2529   struct _PNR_EJECT *PPNR_EJECT ;
2530   struct _PNR_READ_STATUS PNR_READ_STATUS ;
2531   struct _PNR_READ_STATUS *PPNR_READ_STATUS ;
2532};
2533typedef union _PIONEER_CDB *PPNR_CDB;
2534struct _READ_DISC_INFO {
2535   UCHAR OperationCode ;
2536   UCHAR Reserved : 5 ;
2537   UCHAR LogicalUnitNumber : 3 ;
2538   UCHAR Reserved1[7] ;
2539   UCHAR AllocationLength[2] ;
2540   UCHAR Link : 1 ;
2541   UCHAR Flag : 1 ;
2542   UCHAR Reserved2 : 4 ;
2543   UCHAR VendorUniqueBits : 2 ;
2544};
2545struct __anonstruct_PLAY_AUDIO_127 {
2546   UCHAR OperationCode ;
2547   UCHAR Immediate : 1 ;
2548   UCHAR Right : 1 ;
2549   UCHAR Left : 1 ;
2550   UCHAR Reserved : 2 ;
2551   UCHAR Lun : 3 ;
2552   UCHAR StartingM ;
2553   UCHAR StartingS ;
2554   UCHAR StartingF ;
2555   UCHAR Reserved1[2] ;
2556   UCHAR EndingM ;
2557   UCHAR EndingS ;
2558   UCHAR EndingF ;
2559   UCHAR Reserved2 ;
2560   UCHAR Link : 1 ;
2561   UCHAR Flag : 1 ;
2562   UCHAR Reserved3 : 4 ;
2563   UCHAR VendorUniqueBits : 2 ;
2564};
2565struct _PAUSE {
2566   UCHAR OperationCode ;
2567   UCHAR Reserved : 5 ;
2568   UCHAR Lun : 3 ;
2569   UCHAR Reserved1[9] ;
2570   UCHAR Link : 1 ;
2571   UCHAR Flag : 1 ;
2572   UCHAR Reserved2 : 4 ;
2573   UCHAR VendorUnqiueBits : 2 ;
2574};
2575struct _EJECT {
2576   UCHAR OperationCode ;
2577   UCHAR Reserved : 5 ;
2578   UCHAR Lun : 3 ;
2579   UCHAR Reserved1[8] ;
2580   UCHAR Eject : 1 ;
2581   UCHAR Mode : 1 ;
2582   UCHAR Reserved2 : 6 ;
2583   UCHAR Link : 1 ;
2584   UCHAR Flag : 1 ;
2585   UCHAR Reserved3 : 4 ;
2586   UCHAR VendorUnqiueBits : 2 ;
2587};
2588struct _AUDIO_STATUS {
2589   UCHAR OperationCode ;
2590   UCHAR Reserved : 5 ;
2591   UCHAR Lun : 3 ;
2592   UCHAR Reserved1[9] ;
2593   UCHAR Link : 1 ;
2594   UCHAR Flag : 1 ;
2595   UCHAR Reserved2 : 4 ;
2596   UCHAR VendorUnqiueBits : 2 ;
2597};
2598struct _STOP_PLAY {
2599   UCHAR OperationCode ;
2600   UCHAR Reserved[11] ;
2601};
2602union _HITACHICDB {
2603   struct _READ_DISC_INFO READ_DISC_INFO ;
2604   struct _READ_DISC_INFO *PREAD_DISC_INFO ;
2605   struct __anonstruct_PLAY_AUDIO_127 PLAY_AUDIO ;
2606   struct __anonstruct_PLAY_AUDIO_127 *PPLAY_AUDIO ;
2607   struct _PAUSE PAUSE_AUDIO ;
2608   struct _PAUSE *PPAUSE_AUDIO ;
2609   struct _EJECT EJECT ;
2610   struct _EJECT *PEJECT ;
2611   struct _AUDIO_STATUS AUDIO_STATUS ;
2612   struct _AUDIO_STATUS *PAUDIO_STATUS ;
2613   struct _STOP_PLAY STOP_PLAY ;
2614   struct _STOP_PLAY *PSTOP_PLAY ;
2615};
2616typedef union _HITACHICDB *PHITACHICDB;
2617#pragma pack(push,8)
2618#pragma pack(pop)
2619struct _KAPC;
2620struct _KDPC;
2621#pragma pack(push,4)
2622#pragma pack(pop)
2623#pragma pack(push,4)
2624#pragma pack(pop)
2625#pragma pack(push,1)
2626#pragma pack(pop)
2627struct _DRIVER_OBJECT;
2628struct _DEVICE_OBJECT;
2629struct _DRIVER_OBJECT;
2630struct _FILE_OBJECT;
2631struct _IRP;
2632struct _SCSI_REQUEST_BLOCK;
2633#pragma pack(push,4)
2634#pragma pack(pop)
2635#pragma once
2636#pragma once
2637#pragma once
2638#pragma once
2639#pragma warning(push)
2640#pragma warning(disable:4035)
2641#pragma warning(pop)
2642#pragma once
2643extern void *memcpy(void * , void const   * , size_t  ) ;
2644extern int memcmp(void const   * , void const   * ,
2645                                                size_t  ) ;
2646extern void *memset(void * , int  , size_t  ) ;
2647#pragma warning(disable:4103)
2648#pragma warning(disable:4103)
2649  NTSTATUS RtlQueryRegistryValues(ULONG RelativeTo ,
2650                                                                                                PCWSTR Path ,
2651                                                                                                PRTL_QUERY_REGISTRY_TABLE QueryTable ,
2652                                                                                                PVOID Context ,
2653                                                                                                PVOID Environment ) ;
2654extern   NTSTATUS RtlWriteRegistryValue(ULONG RelativeTo ,
2655                                                                                                      PCWSTR Path ,
2656                                                                                                      PCWSTR ValueName ,
2657                                                                                                      ULONG ValueType ,
2658                                                                                                      PVOID ValueData ,
2659                                                                                                      ULONG ValueLength ) ;
2660  NTSTATUS RtlDeleteRegistryValue(ULONG RelativeTo ,
2661                                                                                                PCWSTR Path ,
2662                                                                                                PCWSTR ValueName ) ;
2663  void RtlInitString(PSTRING DestinationString ,
2664                                                                                   PCSZ SourceString ) ;
2665  void RtlInitUnicodeString(PUNICODE_STRING DestinationString ,
2666                                                                                          PCWSTR SourceString ) ;
2667  NTSTATUS RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString ,
2668                                                                                                      PANSI_STRING SourceString ,
2669                                                                                                      BOOLEAN AllocateDestinationString ) ;
2670  void RtlCopyUnicodeString(PUNICODE_STRING DestinationString ,
2671                                                                                          PUNICODE_STRING SourceString ) ;
2672  void RtlFreeUnicodeString(PUNICODE_STRING UnicodeString ) ;
2673  SIZE_T RtlCompareMemory(void const   *Source1 ,
2674                                                                                        void const   *Source2 ,
2675                                                                                        SIZE_T Length ) ;
2676#pragma warning(push)
2677#pragma warning(disable:4035)
2678#pragma warning(pop)
2679extern   LONG InterlockedIncrement(PLONG Addend ) ;
2680extern   LONG InterlockedDecrement(PLONG Addend ) ;
2681#pragma warning(disable:4035)
2682#pragma warning(push)
2683#pragma warning(disable:4164)
2684#pragma function(_enable)
2685#pragma function(_disable)
2686#pragma warning(pop)
2687#pragma warning(disable:4103)
2688#pragma warning(disable:4103)
2689#pragma warning(disable:4103)
2690#pragma warning(disable:4103)
2691  void KeInitializeEvent(PRKEVENT Event , EVENT_TYPE Type ,
2692                                                       BOOLEAN State ) ;
2693  LONG KeSetEvent(PRKEVENT Event , KPRIORITY Increment ,
2694                                                BOOLEAN Wait ) ;
2695  void KeInitializeSemaphore(PRKSEMAPHORE Semaphore ,
2696                                                           LONG Count , LONG Limit ) ;
2697  LONG KeReleaseSemaphore(PRKSEMAPHORE Semaphore , KPRIORITY Increment ,
2698                                                        LONG Adjustment , BOOLEAN Wait ) ;
2699  NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode ,
2700                                                                BOOLEAN Alertable ,
2701                                                                PLARGE_INTEGER Interval ) ;
2702  NTSTATUS KeWaitForSingleObject(PVOID Object , KWAIT_REASON WaitReason ,
2703                                                               KPROCESSOR_MODE WaitMode ,
2704                                                               BOOLEAN Alertable ,
2705                                                               PLARGE_INTEGER Timeout ) ;
2706  void KeInitializeSpinLock(PKSPIN_LOCK SpinLock ) ;
2707  void KfReleaseSpinLock(PKSPIN_LOCK SpinLock ,
2708                                                                                        KIRQL NewIrql ) ;
2709  PVOID ExAllocatePoolWithTag(POOL_TYPE PoolType ,
2710                                                                                            SIZE_T NumberOfBytes ,
2711                                                                                            ULONG Tag ) ;
2712  void ExFreePool(PVOID P ) ;
2713  void ExAcquireFastMutex(PFAST_MUTEX FastMutex ) ;
2714  void ExReleaseFastMutex(PFAST_MUTEX FastMutex ) ;
2715  PLIST_ENTRY ExfInterlockedInsertHeadList(PLIST_ENTRY ListHead ,
2716                                                                                                          PLIST_ENTRY ListEntry ,
2717                                                                                                          PKSPIN_LOCK Lock ) ;
2718  PLIST_ENTRY ExfInterlockedInsertTailList(PLIST_ENTRY ListHead ,
2719                                                                                                          PLIST_ENTRY ListEntry ,
2720                                                                                                          PKSPIN_LOCK Lock ) ;
2721  PLIST_ENTRY ExfInterlockedRemoveHeadList(PLIST_ENTRY ListHead ,
2722                                                                                                          PKSPIN_LOCK Lock ) ;
2723  void MmUnlockPages(PMDL MemoryDescriptorList ) ;
2724  PVOID MmMapLockedPagesSpecifyCache(PMDL MemoryDescriptorList ,
2725                                                                   KPROCESSOR_MODE AccessMode ,
2726                                                                   MEMORY_CACHING_TYPE CacheType ,
2727                                                                   PVOID BaseAddress ,
2728                                                                   ULONG BugCheckOnFailure ,
2729                                                                   MM_PAGE_PRIORITY Priority ) ;
2730  PVOID MmAllocateContiguousMemory(SIZE_T NumberOfBytes ,
2731                                                                 PHYSICAL_ADDRESS HighestAcceptableAddress ) ;
2732  void MmFreeContiguousMemory(PVOID BaseAddress ) ;
2733extern   PVOID MmLockPagableDataSection(PVOID AddressWithinSection ) ;
2734  void MmResetDriverPaging(PVOID AddressWithinSection ) ;
2735  PVOID MmPageEntireDriver(PVOID AddressWithinSection ) ;
2736  NTSTATUS PsCreateSystemThread(PHANDLE ThreadHandle ,
2737                                                              ULONG DesiredAccess ,
2738                                                              POBJECT_ATTRIBUTES ObjectAttributes ,
2739                                                              HANDLE ProcessHandle ,
2740                                                              PCLIENT_ID ClientId ,
2741                                                              void (*StartRoutine)(PVOID StartContext ) ,
2742                                                              PVOID StartContext ) ;
2743  NTSTATUS PsTerminateSystemThread(NTSTATUS ExitStatus ) ;
2744#pragma warning(disable:4103)
2745#pragma warning(disable:4103)
2746  PMDL IoAllocateMdl(PVOID VirtualAddress , ULONG Length ,
2747                                                   BOOLEAN SecondaryBuffer , BOOLEAN ChargeQuota ,
2748                                                   PIRP Irp ) ;
2749  PDEVICE_OBJECT IoAttachDeviceToDeviceStack(PDEVICE_OBJECT SourceDevice ,
2750                                                                           PDEVICE_OBJECT TargetDevice ) ;
2751  PIRP IoBuildAsynchronousFsdRequest(ULONG MajorFunction ,
2752                                                                   PDEVICE_OBJECT DeviceObject ,
2753                                                                   PVOID Buffer ,
2754                                                                   ULONG Length ,
2755                                                                   PLARGE_INTEGER StartingOffset ,
2756                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
2757  PIRP IoBuildDeviceIoControlRequest(ULONG IoControlCode ,
2758                                                                   PDEVICE_OBJECT DeviceObject ,
2759                                                                   PVOID InputBuffer ,
2760                                                                   ULONG InputBufferLength ,
2761                                                                   PVOID OutputBuffer ,
2762                                                                   ULONG OutputBufferLength ,
2763                                                                   BOOLEAN InternalDeviceIoControl ,
2764                                                                   PKEVENT Event ,
2765                                                                   PIO_STATUS_BLOCK IoStatusBlock ) ;
2766  NTSTATUS IofCallDriver(PDEVICE_OBJECT DeviceObject ,
2767                                                                                        PIRP Irp ) ;
2768  void IofCompleteRequest(PIRP Irp ,
2769                                                                                         CCHAR PriorityBoost ) ;
2770  NTSTATUS IoCreateDevice(PDRIVER_OBJECT DriverObject ,
2771                                                        ULONG DeviceExtensionSize ,
2772                                                        PUNICODE_STRING DeviceName ,
2773                                                        ULONG DeviceType , ULONG DeviceCharacteristics ,
2774                                                        BOOLEAN Exclusive , PDEVICE_OBJECT *DeviceObject ) ;
2775  NTSTATUS IoCreateSymbolicLink(PUNICODE_STRING SymbolicLinkName ,
2776                                                              PUNICODE_STRING DeviceName ) ;
2777  void IoDeleteDevice(PDEVICE_OBJECT DeviceObject ) ;
2778  NTSTATUS IoDeleteSymbolicLink(PUNICODE_STRING SymbolicLinkName ) ;
2779  void IoDetachDevice(PDEVICE_OBJECT TargetDevice ) ;
2780  void IoFreeIrp(PIRP Irp ) ;
2781  void IoFreeMdl(PMDL Mdl ) ;
2782  PCONFIGURATION_INFORMATION IoGetConfigurationInformation(void) ;
2783  NTSTATUS IoQueryDeviceDescription(PINTERFACE_TYPE BusType ,
2784                                                                  PULONG BusNumber ,
2785                                                                  PCONFIGURATION_TYPE ControllerType ,
2786                                                                  PULONG ControllerNumber ,
2787                                                                  PCONFIGURATION_TYPE PeripheralType ,
2788                                                                  PULONG PeripheralNumber ,
2789                                                                  NTSTATUS (*CalloutRoutine)(PVOID Context ,
2790                                                                                             PUNICODE_STRING PathName ,
2791                                                                                             INTERFACE_TYPE BusType ,
2792                                                                                             ULONG BusNumber ,
2793                                                                                             PKEY_VALUE_FULL_INFORMATION *BusInformation ,
2794                                                                                             CONFIGURATION_TYPE ControllerType ,
2795                                                                                             ULONG ControllerNumber ,
2796                                                                                             PKEY_VALUE_FULL_INFORMATION *ControllerInformation ,
2797                                                                                             CONFIGURATION_TYPE PeripheralType ,
2798                                                                                             ULONG PeripheralNumber ,
2799                                                                                             PKEY_VALUE_FULL_INFORMATION *PeripheralInformation ) ,
2800                                                                  PVOID Context ) ;
2801  void IoReleaseCancelSpinLock(KIRQL Irql ) ;
2802  void IoSetHardErrorOrVerifyDevice(PIRP Irp , PDEVICE_OBJECT DeviceObject ) ;
2803extern   NTSTATUS IoOpenDeviceRegistryKey(PDEVICE_OBJECT DeviceObject ,
2804                                                                        ULONG DevInstKeyType ,
2805                                                                        ACCESS_MASK DesiredAccess ,
2806                                                                        PHANDLE DevInstRegKey ) ;
2807  NTSTATUS IoRegisterDeviceInterface(PDEVICE_OBJECT PhysicalDeviceObject ,
2808                                                                                                   GUID const   *InterfaceClassGuid ,
2809                                                                                                   PUNICODE_STRING ReferenceString ,
2810                                                                                                   PUNICODE_STRING SymbolicLinkName ) ;
2811  NTSTATUS IoSetDeviceInterfaceState(PUNICODE_STRING SymbolicLinkName ,
2812                                                                   BOOLEAN Enable ) ;
2813#pragma warning(disable:4200)
2814#pragma warning(default:4200)
2815  NTSTATUS PoCallDriver(PDEVICE_OBJECT DeviceObject ,
2816                                                      PIRP Irp ) ;
2817  void PoStartNextPowerIrp(PIRP Irp ) ;
2818  NTSTATUS ObReferenceObjectByHandle(HANDLE Handle ,
2819                                                                   ACCESS_MASK DesiredAccess ,
2820                                                                   POBJECT_TYPE ObjectType ,
2821                                                                   KPROCESSOR_MODE AccessMode ,
2822                                                                   PVOID *Object ,
2823                                                                   POBJECT_HANDLE_INFORMATION HandleInformation ) ;
2824  void ObfDereferenceObject(PVOID Object ) ;
2825  NTSTATUS ZwClose(HANDLE Handle ) ;
2826#pragma once
2827#pragma once
2828#pragma warning(disable:4200)
2829#pragma warning(default:4200)
2830int __BLAST_NONDET  ;
2831void errorFn(void) 
2832{ 
2833
2834  {
2835  ERROR: 
2836  goto ERROR;
2837}
2838}
2839int s  ;
2840int UNLOADED  ;
2841int NP  ;
2842int DC  ;
2843int SKIP1  ;
2844int SKIP2  ;
2845int MPR1  ;
2846int MPR3  ;
2847int IPC  ;
2848int pended  ;
2849NTSTATUS (*compFptr)(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context )  ;
2850int compRegistered  ;
2851int lowerDriverReturn  ;
2852int setEventCalled  ;
2853int customIrp  ;
2854int routine  ;
2855int myStatus  ;
2856int myIrp_PendingReturned  ;
2857void _BLAST_init(void) 
2858{ 
2859
2860  {
2861  UNLOADED = 0;
2862  NP = 1;
2863  DC = 2;
2864  SKIP1 = 3;
2865  SKIP2 = 4;
2866  MPR1 = 5;
2867  MPR3 = 6;
2868  IPC = 7;
2869  s = UNLOADED;
2870  pended = 0;
2871  compFptr = 0;
2872  compRegistered = 0;
2873  lowerDriverReturn = 0;
2874  setEventCalled = 0;
2875  customIrp = 0;
2876  return;
2877}
2878}
2879NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) ;
2880NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2881NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2882NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2883BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) ;
2884BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) ;
2885NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2886NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2887NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2888NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) ;
2889NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2890NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2891NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2892NTSTATUS CdAudioAtapiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2893NTSTATUS CdAudioHPCdrDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2894void HpCdrProcessLastSession(PCDROM_TOC Toc ) ;
2895NTSTATUS HPCdrCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PVOID Context ) ;
2896NTSTATUS CdAudioPower(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2897NTSTATUS CdAudioForwardIrpSynchronous(PDEVICE_OBJECT DeviceObject , PIRP Irp ) ;
2898void CdAudioUnload(PDRIVER_OBJECT DriverObject ) ;
2899#pragma alloc_text(INIT,DriverEntry)
2900#pragma alloc_text(PAGECDNC,CdAudioNECDeviceControl)
2901#pragma alloc_text(PAGECDOT,CdAudioHitachiSendPauseCommand)
2902#pragma alloc_text(PAGECDOT,CdAudioHitachiDeviceControl)
2903#pragma alloc_text(PAGECDOT,CdAudioDenonDeviceControl)
2904#pragma alloc_text(PAGECDNC,CdAudio435DeviceControl)
2905#pragma alloc_text(PAGECDNC,CdAudio535DeviceControl)
2906#pragma alloc_text(PAGECDOT,CdAudioPioneerDeviceControl)
2907#pragma alloc_text(PAGECDNC,CdAudioPan533DeviceControl)
2908#pragma alloc_text(PAGECDOT,CdAudioAtapiDeviceControl)
2909#pragma alloc_text(PAGECDOT,CdAudioLionOpticsDeviceControl)
2910#pragma alloc_text(PAGECDOT,CdAudioHPCdrDeviceControl)
2911#pragma alloc_text(PAGECDOT,HpCdrProcessLastSession)
2912#pragma alloc_text(PAGECDOT,HPCdrCompletion)
2913NTSTATUS SendSrbSynchronous(PCD_DEVICE_EXTENSION Extension , PSCSI_PASS_THROUGH Srb ,
2914                            PVOID Buffer , ULONG BufferLength ) 
2915{ ULONG ioctl ;
2916  KEVENT event ;
2917  PIRP irp ;
2918  IO_STATUS_BLOCK ioStatus ;
2919  NTSTATUS status ;
2920
2921  {
2922  irp = (void *)0;
2923  Srb->Length = sizeof(SCSI_PASS_THROUGH );
2924  Srb->SenseInfoLength = 0;
2925  Srb->SenseInfoOffset = 0;
2926  if (Buffer) {
2927    Srb->DataIn = 1;
2928    Srb->DataTransferLength = BufferLength;
2929    Srb->DataBufferOffset = (unsigned long )Buffer;
2930    ioctl = ((4 << 16) | (3 << 14)) | (1029 << 2);
2931  } else {
2932    Srb->DataIn = 0;
2933    Srb->DataTransferLength = 0;
2934    Srb->DataBufferOffset = 0;
2935    ioctl = ((4 << 16) | (3 << 14)) | (1025 << 2);
2936  }
2937  {
2938/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
2939  }
2940  if (! irp) {
2941    return (-1073741670L);
2942  } else {
2943
2944  }
2945  if (status == 259L) {
2946    {
2947    KeWaitForSingleObject(& event, 0, 0, 0, (void *)0);
2948    status = ioStatus.__annonCompField4.Status;
2949    }
2950  } else {
2951
2952  }
2953  return (status);
2954}
2955}
2956NTSTATUS CdAudioAddDevice(PDRIVER_OBJECT DriverObject , PDEVICE_OBJECT PhysicalDeviceObject ) 
2957{ NTSTATUS status ;
2958  PDEVICE_OBJECT deviceObject ;
2959  PCD_DEVICE_EXTENSION extension ;
2960  ULONG regActive ;
2961  HANDLE deviceParameterHandle ;
2962  RTL_QUERY_REGISTRY_TABLE queryTable[2] ;
2963
2964  {
2965  {
2966  regActive = 255;
2967  status = IoOpenDeviceRegistryKey(PhysicalDeviceObject, 2, 131097L, & deviceParameterHandle);
2968  }
2969  if (! (status >= 0L)) {
2970    regActive = 255;
2971    goto AddDeviceEndRegistry;
2972  } else {
2973
2974  }
2975  {
2976  memset(& queryTable, 0, sizeof(queryTable));
2977  queryTable[0].Flags = 36;
2978  queryTable[0].Name = "M\000a\000p\000T\000y\000p\000e\000";
2979  queryTable[0].EntryContext = & regActive;
2980  queryTable[0].DefaultType = 4;
2981  queryTable[0].DefaultData = (void *)0;
2982  queryTable[0].DefaultLength = 0;
2983  status = RtlQueryRegistryValues(1073741824, (WCHAR *)deviceParameterHandle, queryTable,
2984                                  (void *)0, (void *)0);
2985  }
2986  if (! (status >= 0L)) {
2987    regActive = 255;
2988  } else {
2989    if (regActive > 10UL) {
2990      regActive = 255;
2991    } else {
2992
2993    }
2994  }
2995  {
2996  ZwClose(deviceParameterHandle);
2997  }
2998  AddDeviceEndRegistry: 
2999  if (regActive > 10UL) {
3000    if (regActive != 255UL) {
3001      regActive = 255;
3002    } else {
3003
3004    }
3005  } else {
3006
3007  }
3008  if (regActive == 0UL) {
3009    return (0L);
3010  } else {
3011
3012  }
3013  if (regActive == 8) {
3014    goto switch_0_8;
3015  } else {
3016    if (regActive == 9) {
3017      goto switch_0_9;
3018    } else {
3019      if (regActive == 10) {
3020        goto switch_0_10;
3021      } else {
3022        if (regActive == 4) {
3023          goto switch_0_4;
3024        } else {
3025          if (regActive == 6) {
3026            goto switch_0_6;
3027          } else {
3028            if (regActive == 5) {
3029              goto switch_0_5;
3030            } else {
3031              if (regActive == 2) {
3032                goto switch_0_2;
3033              } else {
3034                if (regActive == 3) {
3035                  goto switch_0_3;
3036                } else {
3037                  if (regActive == 1) {
3038                    goto switch_0_1;
3039                  } else {
3040                    if (regActive == 7) {
3041                      goto switch_0_7;
3042                    } else {
3043                      if (regActive == 255) {
3044                        goto switch_0_255;
3045                      } else {
3046                        {
3047                        goto switch_0_default;
3048                        if (0) {
3049                          switch_0_8: /* CIL Label */ 
3050                          {
3051                          MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl));
3052                          }
3053                          goto switch_0_break;
3054                          switch_0_9: /* CIL Label */ ;
3055                          switch_0_10: /* CIL Label */ 
3056                          {
3057                          MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl));
3058                          }
3059                          goto switch_0_break;
3060                          switch_0_4: /* CIL Label */ 
3061                          {
3062                          MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl));
3063                          }
3064                          goto switch_0_break;
3065                          switch_0_6: /* CIL Label */ ;
3066                          switch_0_5: /* CIL Label */ 
3067                          {
3068                          MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3069                          }
3070                          goto switch_0_break;
3071                          switch_0_2: /* CIL Label */ 
3072                          {
3073                          MmLockPagableDataSection((void *)(& CdAudio535DeviceControl));
3074                          }
3075                          goto switch_0_break;
3076                          switch_0_3: /* CIL Label */ 
3077                          {
3078                          MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3079                          }
3080                          goto switch_0_break;
3081                          switch_0_1: /* CIL Label */ 
3082                          {
3083                          MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3084                          }
3085                          goto switch_0_break;
3086                          switch_0_7: /* CIL Label */ 
3087                          {
3088                          MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl));
3089                          }
3090                          goto switch_0_break;
3091                          switch_0_255: /* CIL Label */ ;
3092                          switch_0_default: /* CIL Label */ ;
3093                          goto switch_0_break;
3094                        } else {
3095                          switch_0_break: /* CIL Label */ ;
3096                        }
3097                        }
3098                      }
3099                    }
3100                  }
3101                }
3102              }
3103            }
3104          }
3105        }
3106      }
3107    }
3108  }
3109  {
3110  status = IoCreateDevice(DriverObject, sizeof(CD_DEVICE_EXTENSION ), (void *)0, 2,
3111                          0, 0, & deviceObject);
3112  }
3113  if (! (status >= 0L)) {
3114    return (status);
3115  } else {
3116
3117  }
3118  deviceObject->Flags |= 16UL;
3119  if (deviceObject->Flags & 16384UL) {
3120
3121  } else {
3122    deviceObject->Flags |= 8192UL;
3123  }
3124  {
3125  extension = deviceObject->DeviceExtension;
3126  memset(extension, 0, sizeof(CD_DEVICE_EXTENSION ));
3127  extension->TargetDeviceObject = IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject);
3128  }
3129  if (! extension->TargetDeviceObject) {
3130    {
3131/*     IoDeleteDevice(deviceObject); */ /* INLINED */
3132    }
3133    return (-1073741810L);
3134  } else {
3135
3136  }
3137  {
3138/*   KeInitializeEvent(& extension->PagingPathCountEvent, 1, 1); */ /* INLINED */
3139  extension->Active = (unsigned char )regActive;
3140  extension->DeviceObject = deviceObject;
3141  extension->TargetPdo = PhysicalDeviceObject;
3142  deviceObject->Flags &= 4294967167UL;
3143  }
3144  return (0L);
3145}
3146}
3147NTSTATUS CdAudioSignalCompletion(PDEVICE_OBJECT DeviceObject , PIRP Irp , PKEVENT Event ) 
3148{ 
3149
3150  {
3151  {
3152  KeSetEvent(Event, 0, 0);
3153  }
3154  return (-1073741802L);
3155}
3156}
3157NTSTATUS CdAudioStartDevice(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3158{ PCD_DEVICE_EXTENSION deviceExtension ;
3159  NTSTATUS status ;
3160  SCSI_PASS_THROUGH srb ;
3161  PCDB cdb ;
3162  PUCHAR inquiryDataPtr ;
3163  UCHAR attempt ;
3164  PVOID tmp ;
3165  UCHAR tmp___0 ;
3166  BOOLEAN tmp___1 ;
3167  int tmp___2 ;
3168  int tmp___3 ;
3169  int tmp___4 ;
3170  int tmp___5 ;
3171  int tmp___6 ;
3172  int tmp___7 ;
3173  int tmp___8 ;
3174  int tmp___9 ;
3175  int tmp___10 ;
3176  int tmp___11 ;
3177  int tmp___12 ;
3178  int tmp___13 ;
3179  int tmp___14 ;
3180  int tmp___15 ;
3181  HANDLE deviceParameterHandle ;
3182  ULONG keyValue ;
3183
3184  {
3185  {
3186  deviceExtension = DeviceObject->DeviceExtension;
3187  status = CdAudioForwardIrpSynchronous(DeviceObject, Irp);
3188  }
3189  if (! (status >= 0L)) {
3190    return (status);
3191  } else {
3192
3193  }
3194  deviceExtension->Paused = 0;
3195  deviceExtension->PausedM = 0;
3196  deviceExtension->PausedS = 0;
3197  deviceExtension->PausedF = 0;
3198  deviceExtension->LastEndM = 0;
3199  deviceExtension->LastEndS = 0;
3200  deviceExtension->LastEndF = 0;
3201  if ((int )deviceExtension->Active == 255) {
3202    {
3203    cdb = (union _CDB *)(srb.Cdb);
3204    inquiryDataPtr = (void *)0;
3205    attempt = 0;
3206    tmp = ExAllocatePoolWithTag(4, 36, 541156419UL);
3207    inquiryDataPtr = (UCHAR *)tmp;
3208    }
3209    if (! inquiryDataPtr) {
3210      deviceExtension->Active = 0;
3211      return (0L);
3212    } else {
3213
3214    }
3215    status = -1073741823L;
3216    {
3217    while (1) {
3218      while_1_continue: /* CIL Label */ ;
3219      if (! (status >= 0L)) {
3220        tmp___0 = attempt;
3221        attempt = (UCHAR )((int )attempt + 1);
3222        if (tmp___0 < 4) {
3223
3224        } else {
3225          goto while_1_break;
3226        }
3227      } else {
3228        goto while_1_break;
3229      }
3230      {
3231      memset(& srb, 0, sizeof(SCSI_PASS_THROUGH ));
3232      memset(inquiryDataPtr, 0, 36);
3233      cdb->CDB6INQUIRY.OperationCode = 18;
3234      cdb->CDB6INQUIRY.AllocationLength = 36;
3235      srb.CdbLength = 6;
3236      srb.TimeOutValue = 10;
3237      status = SendSrbSynchronous(deviceExtension, & srb, inquiryDataPtr, 36);
3238      }
3239    }
3240    while_1_break: /* CIL Label */ ;
3241    }
3242    if (! (status >= 0L)) {
3243      {
3244/*       ExFreePool(inquiryDataPtr); */ /* INLINED */
3245      deviceExtension->Active = 0;
3246      }
3247      return (0L);
3248    } else {
3249
3250    }
3251    {
3252    deviceExtension->Active = 0;
3253    tmp___2 = memcmp(inquiryDataPtr + 8, "NEC     ", 8);
3254    }
3255    if (tmp___2) {
3256
3257    } else {
3258      {
3259      tmp___1 = NecSupportNeeded(inquiryDataPtr);
3260      }
3261      if (tmp___1) {
3262        {
3263        MmLockPagableDataSection((void *)(& CdAudioNECDeviceControl));
3264        deviceExtension->Active = 8;
3265        }
3266      } else {
3267
3268      }
3269    }
3270    {
3271    tmp___3 = memcmp(inquiryDataPtr + 8, "PIONEER ", 8);
3272    }
3273    if (tmp___3) {
3274
3275    } else {
3276      {
3277      tmp___4 = memcmp(inquiryDataPtr + 16, "CD-ROM DRM-600", 15);
3278      }
3279      if (tmp___4) {
3280
3281      } else {
3282        {
3283        MmLockPagableDataSection((void *)(& CdAudioPioneerDeviceControl));
3284        deviceExtension->Active = 9;
3285        }
3286      }
3287    }
3288    if ((int )*(inquiryDataPtr + 8) == 68) {
3289      if ((int )*(inquiryDataPtr + 9) == 69) {
3290        if ((int )*(inquiryDataPtr + 10) == 78) {
3291          if ((int )*(inquiryDataPtr + 16) == 68) {
3292            if ((int )*(inquiryDataPtr + 17) == 82) {
3293              if ((int )*(inquiryDataPtr + 18) == 68) {
3294                if ((int )*(inquiryDataPtr + 20) == 50) {
3295                  if ((int )*(inquiryDataPtr + 21) == 53) {
3296                    if ((int )*(inquiryDataPtr + 22) == 88) {
3297                      {
3298                      MmLockPagableDataSection((void *)(& CdAudioDenonDeviceControl));
3299                      deviceExtension->Active = 4;
3300                      }
3301                    } else {
3302
3303                    }
3304                  } else {
3305
3306                  }
3307                } else {
3308
3309                }
3310              } else {
3311
3312              }
3313            } else {
3314
3315            }
3316          } else {
3317
3318          }
3319        } else {
3320
3321        }
3322      } else {
3323
3324      }
3325    } else {
3326
3327    }
3328    {
3329    tmp___5 = memcmp(inquiryDataPtr + 8, "CHINON", 6);
3330    }
3331    if (tmp___5) {
3332
3333    } else {
3334      if ((int )*(inquiryDataPtr + 27) == 53) {
3335        if ((int )*(inquiryDataPtr + 28) == 51) {
3336          if ((int )*(inquiryDataPtr + 29) == 53) {
3337            if ((int )*(inquiryDataPtr + 32) == 81) {
3338              {
3339              MmLockPagableDataSection((void *)(& CdAudio535DeviceControl));
3340              deviceExtension->Active = 2;
3341              }
3342            } else {
3343
3344            }
3345          } else {
3346
3347          }
3348        } else {
3349
3350        }
3351      } else {
3352
3353      }
3354      if ((int )*(inquiryDataPtr + 27) == 52) {
3355        if ((int )*(inquiryDataPtr + 28) == 51) {
3356          if ((int )*(inquiryDataPtr + 29) == 53) {
3357            goto _L;
3358          } else {
3359            if ((int )*(inquiryDataPtr + 29) == 49) {
3360              _L: /* CIL Label */ 
3361              if ((int )*(inquiryDataPtr + 32) == 77) {
3362                {
3363                MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3364                deviceExtension->Active = 3;
3365                }
3366              } else {
3367                if ((int )*(inquiryDataPtr + 32) == 78) {
3368                  {
3369                  MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3370                  deviceExtension->Active = 3;
3371                  }
3372                } else {
3373                  if ((int )*(inquiryDataPtr + 32) == 83) {
3374                    {
3375                    MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3376                    deviceExtension->Active = 3;
3377                    }
3378                  } else {
3379                    if ((int )*(inquiryDataPtr + 32) == 85) {
3380                      {
3381                      MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3382                      deviceExtension->Active = 3;
3383                      }
3384                    } else {
3385                      if ((int )*(inquiryDataPtr + 32) == 72) {
3386                        {
3387                        MmLockPagableDataSection((void *)(& CdAudio435DeviceControl));
3388                        deviceExtension->Active = 3;
3389                        }
3390                      } else {
3391
3392                      }
3393                    }
3394                  }
3395                }
3396              }
3397            } else {
3398
3399            }
3400          }
3401        } else {
3402
3403        }
3404      } else {
3405
3406      }
3407    }
3408    {
3409    tmp___6 = memcmp(inquiryDataPtr + 8, "HITACHI ", 8);
3410    }
3411    if (tmp___6) {
3412
3413    } else {
3414      {
3415      tmp___7 = memcmp(inquiryDataPtr + 16, "CDR-3650/1650S  ", 16);
3416      }
3417      if (tmp___7) {
3418        {
3419        tmp___8 = memcmp(inquiryDataPtr + 16, "CDR-1750S       ", 16);
3420        }
3421        if (tmp___8) {
3422
3423        } else {
3424          {
3425          MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3426          deviceExtension->Active = 6;
3427          }
3428        }
3429      } else {
3430        {
3431        MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3432        deviceExtension->Active = 6;
3433        }
3434      }
3435    }
3436    {
3437    tmp___9 = memcmp(inquiryDataPtr + 8, "WEARNES ", 8);
3438    }
3439    if (tmp___9) {
3440      _L___0: /* CIL Label */ 
3441      {
3442      tmp___11 = memcmp(inquiryDataPtr + 8, "OTI     ", 8);
3443      }
3444      if (tmp___11) {
3445
3446      } else {
3447        {
3448        tmp___12 = memcmp(inquiryDataPtr + 16, "DOLPHIN ", 8);
3449        }
3450        if (tmp___12) {
3451
3452        } else {
3453          {
3454          MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3455          deviceExtension->Active = 1;
3456          *(inquiryDataPtr + 25) = (unsigned char)0;
3457          }
3458        }
3459      }
3460    } else {
3461      {
3462      tmp___10 = memcmp(inquiryDataPtr + 16, "RUB", 3);
3463      }
3464      if (tmp___10) {
3465        goto _L___0;
3466      } else {
3467        {
3468        MmLockPagableDataSection((void *)(& CdAudioAtapiDeviceControl));
3469        deviceExtension->Active = 1;
3470        *(inquiryDataPtr + 25) = (unsigned char)0;
3471        }
3472      }
3473    }
3474    {
3475    tmp___13 = memcmp(inquiryDataPtr + 8, "FUJITSU ", 8);
3476    }
3477    if (tmp___13) {
3478
3479    } else {
3480      if ((int )*(inquiryDataPtr + 16) == 67) {
3481        if ((int )*(inquiryDataPtr + 17) == 68) {
3482          if ((int )*(inquiryDataPtr + 18) == 82) {
3483            if ((int )*(inquiryDataPtr + 20) == 51) {
3484              if ((int )*(inquiryDataPtr + 21) == 54) {
3485                if ((int )*(inquiryDataPtr + 22) == 53) {
3486                  if ((int )*(inquiryDataPtr + 23) == 48) {
3487                    {
3488                    MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3489                    deviceExtension->Active = 6;
3490                    *(inquiryDataPtr + 25) = (unsigned char)0;
3491                    }
3492                  } else {
3493                    goto _L___6;
3494                  }
3495                } else {
3496                  goto _L___6;
3497                }
3498              } else {
3499                goto _L___6;
3500              }
3501            } else {
3502              goto _L___6;
3503            }
3504          } else {
3505            goto _L___6;
3506          }
3507        } else {
3508          goto _L___6;
3509        }
3510      } else {
3511        _L___6: /* CIL Label */ 
3512        if ((int )*(inquiryDataPtr + 16) == 70) {
3513          if ((int )*(inquiryDataPtr + 17) == 77) {
3514            if ((int )*(inquiryDataPtr + 18) == 67) {
3515              if ((int )*(inquiryDataPtr + 21) == 49) {
3516                if ((int )*(inquiryDataPtr + 22) == 48) {
3517                  if ((int )*(inquiryDataPtr + 23) == 49) {
3518                    {
3519                    MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3520                    deviceExtension->Active = 5;
3521                    *(inquiryDataPtr + 25) = (unsigned char)0;
3522                    }
3523                  } else {
3524                    if ((int )*(inquiryDataPtr + 23) == 50) {
3525                      {
3526                      MmLockPagableDataSection((void *)(& CdAudioHitachiDeviceControl));
3527                      deviceExtension->Active = 5;
3528                      *(inquiryDataPtr + 25) = (unsigned char)0;
3529                      }
3530                    } else {
3531
3532                    }
3533                  }
3534                } else {
3535
3536                }
3537              } else {
3538
3539              }
3540            } else {
3541
3542            }
3543          } else {
3544
3545          }
3546        } else {
3547
3548        }
3549      }
3550    }
3551    {
3552    tmp___14 = memcmp(inquiryDataPtr + 8, "HP      ", 8);
3553    }
3554    if (tmp___14) {
3555
3556    } else {
3557      {
3558      tmp___15 = memcmp(inquiryDataPtr + 16, "C4324/C4325", 11);
3559      }
3560      if (tmp___15) {
3561
3562      } else {
3563        {
3564        MmLockPagableDataSection((void *)(& CdAudioHPCdrDeviceControl));
3565        deviceExtension->Active = 7;
3566        }
3567      }
3568    }
3569    {
3570/*     ExFreePool(inquiryDataPtr); */ /* INLINED */
3571    }
3572  } else {
3573
3574  }
3575  {
3576  keyValue = (unsigned long )deviceExtension->Active;
3577  status = IoOpenDeviceRegistryKey(deviceExtension->TargetPdo, 2, 131078L, & deviceParameterHandle);
3578  }
3579  if (! (status >= 0L)) {
3580    return (0L);
3581  } else {
3582
3583  }
3584  {
3585  status = RtlWriteRegistryValue(1073741824, (WCHAR *)deviceParameterHandle, "M\000a\000p\000T\000y\000p\000e\000",
3586                                 4, & keyValue, sizeof(keyValue));
3587  }
3588  if (! (status >= 0L)) {
3589
3590  } else {
3591
3592  }
3593  {
3594  ZwClose(deviceParameterHandle);
3595  }
3596  return (0L);
3597}
3598}
3599NTSTATUS CdAudioPnp(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3600{ PIO_STACK_LOCATION irpSp ;
3601  NTSTATUS status ;
3602  BOOLEAN setPagable ;
3603  PCD_DEVICE_EXTENSION deviceExtension ;
3604  NTSTATUS tmp ;
3605  NTSTATUS tmp___0 ;
3606
3607  {
3608  irpSp = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
3609  status = -1073741637L;
3610  if (irpSp->MinorFunction == 0) {
3611    goto switch_2_0;
3612  } else {
3613    if (irpSp->MinorFunction == 22) {
3614      goto switch_2_22;
3615    } else {
3616      {
3617      goto switch_2_default;
3618      if (0) {
3619        switch_2_0: /* CIL Label */ 
3620        {
3621        status = CdAudioStartDevice(DeviceObject, Irp);
3622        Irp->IoStatus.__annonCompField4.Status = status;
3623        myStatus = status;
3624        IofCompleteRequest(Irp, 0);
3625        }
3626        return (status);
3627        switch_2_22: /* CIL Label */ ;
3628        if ((int )irpSp->Parameters.UsageNotification.Type != 1) {
3629          {
3630          tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
3631          }
3632          return (tmp);
3633        } else {
3634
3635        }
3636        {
3637        deviceExtension = DeviceObject->DeviceExtension;
3638        status = KeWaitForSingleObject(& deviceExtension->PagingPathCountEvent, 0,
3639                                       0, 0, (void *)0);
3640        setPagable = 0;
3641        }
3642        if (! irpSp->Parameters.UsageNotification.InPath) {
3643          if (deviceExtension->PagingPathCount == 1UL) {
3644            if (DeviceObject->Flags & 16384UL) {
3645
3646            } else {
3647              DeviceObject->Flags |= 8192UL;
3648              setPagable = 1;
3649            }
3650          } else {
3651
3652          }
3653        } else {
3654
3655        }
3656        {
3657        status = CdAudioForwardIrpSynchronous(DeviceObject, Irp);
3658        }
3659        if (status >= 0L) {
3660          if (irpSp->Parameters.UsageNotification.InPath) {
3661            {
3662            InterlockedIncrement(& deviceExtension->PagingPathCount);
3663            }
3664          } else {
3665            {
3666            InterlockedDecrement(& deviceExtension->PagingPathCount);
3667            }
3668          }
3669          if (irpSp->Parameters.UsageNotification.InPath) {
3670            if (deviceExtension->PagingPathCount == 1UL) {
3671              DeviceObject->Flags &= 4294959103UL;
3672            } else {
3673
3674            }
3675          } else {
3676
3677          }
3678        } else {
3679          if ((int )setPagable == 1) {
3680            DeviceObject->Flags &= 4294959103UL;
3681            setPagable = 0;
3682          } else {
3683
3684          }
3685        }
3686        {
3687        KeSetEvent(& deviceExtension->PagingPathCountEvent, 0, 0);
3688        IofCompleteRequest(Irp, 0);
3689        }
3690        return (status);
3691        goto switch_2_break;
3692        switch_2_default: /* CIL Label */ 
3693        {
3694        tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp);
3695        }
3696        return (tmp___0);
3697      } else {
3698        switch_2_break: /* CIL Label */ ;
3699      }
3700      }
3701    }
3702  }
3703  return (0L);
3704}
3705}
3706NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject , PUNICODE_STRING RegistryPath ) 
3707{ ULONG i ;
3708
3709  {
3710  DriverObject->MajorFunction[i] = & CdAudioSendToNextDriver;
3711  DriverObject->MajorFunction[3] = & CdAudioReadWrite;
3712  DriverObject->MajorFunction[4] = & CdAudioReadWrite;
3713  DriverObject->MajorFunction[14] = & CdAudioDeviceControl;
3714  DriverObject->MajorFunction[27] = & CdAudioPnp;
3715  DriverObject->MajorFunction[22] = & CdAudioPower;
3716  (DriverObject->DriverExtension)->AddDevice = & CdAudioAddDevice;
3717  DriverObject->DriverUnload = & CdAudioUnload;
3718  return (0L);
3719}
3720}
3721BOOLEAN NecSupportNeeded(PUCHAR InquiryData ) 
3722{ PINQUIRYDATA inquiryData ;
3723  ULONG i ;
3724  PUCHAR badDriveList[12] ;
3725  SIZE_T tmp ;
3726
3727  {
3728  {
3729  inquiryData = (struct _INQUIRYDATA *)InquiryData;
3730  badDriveList[0] = "CD-ROM DRIVE:80 ";
3731  badDriveList[1] = "CD-ROM DRIVE:82 ";
3732  badDriveList[2] = "CD-ROM DRIVE:83 ";
3733  badDriveList[3] = "CD-ROM DRIVE:84 ";
3734  badDriveList[4] = "CD-ROM DRIVE:841";
3735  badDriveList[5] = "CD-ROM DRIVE:38 ";
3736  badDriveList[6] = "CD-ROM DRIVE 4 M";
3737  badDriveList[7] = "CD-ROM DRIVE:500";
3738  badDriveList[8] = "CD-ROM DRIVE:400";
3739  badDriveList[9] = "CD-ROM DRIVE:401";
3740  badDriveList[10] = "CD-ROM DRIVE:501";
3741  badDriveList[11] = "CD-ROM DRIVE:900";
3742  tmp = RtlCompareMemory(inquiryData->ProductId, badDriveList[i], 16);
3743  }
3744  if (tmp == 16UL) {
3745    return (1);
3746  } else {
3747
3748  }
3749  return (0);
3750}
3751}
3752NTSTATUS CdAudioReadWrite(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3753{ PCD_DEVICE_EXTENSION deviceExtension ;
3754  NTSTATUS tmp ;
3755
3756  {
3757  deviceExtension = DeviceObject->DeviceExtension;
3758  if (deviceExtension->PlayActive) {
3759    {
3760    Irp->IoStatus.__annonCompField4.Status = -2147483631L;
3761    myStatus = -2147483631L;
3762    IofCompleteRequest(Irp, 0);
3763    }
3764    return (-2147483631L);
3765  } else {
3766
3767  }
3768  {
3769  tmp = CdAudioSendToNextDriver(DeviceObject, Irp);
3770  }
3771  return (tmp);
3772}
3773}
3774NTSTATUS CdAudioDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3775{ PCD_DEVICE_EXTENSION deviceExtension ;
3776  NTSTATUS status ;
3777
3778  {
3779  deviceExtension = DeviceObject->DeviceExtension;
3780  if (deviceExtension->Active == 2) {
3781    goto switch_3_2;
3782  } else {
3783    if (deviceExtension->Active == 3) {
3784      goto switch_3_3;
3785    } else {
3786      if (deviceExtension->Active == 1) {
3787        goto switch_3_1;
3788      } else {
3789        if (deviceExtension->Active == 7) {
3790          goto switch_3_7;
3791        } else {
3792          {
3793          goto switch_3_default;
3794          if (0) {
3795            switch_3_2: /* CIL Label */ 
3796            {
3797            status = CdAudio535DeviceControl(DeviceObject, Irp);
3798            }
3799            goto switch_3_break;
3800            switch_3_3: /* CIL Label */ 
3801            {
3802            status = CdAudio435DeviceControl(DeviceObject, Irp);
3803            }
3804            goto switch_3_break;
3805            switch_3_1: /* CIL Label */ 
3806            {
3807            status = CdAudioAtapiDeviceControl(DeviceObject, Irp);
3808            }
3809            goto switch_3_break;
3810            switch_3_7: /* CIL Label */ 
3811            {
3812            status = CdAudioHPCdrDeviceControl(DeviceObject, Irp);
3813            }
3814            goto switch_3_break;
3815            switch_3_default: /* CIL Label */ 
3816            {
3817            deviceExtension->Active = 0;
3818            status = CdAudioSendToNextDriver(DeviceObject, Irp);
3819            }
3820          } else {
3821            switch_3_break: /* CIL Label */ ;
3822          }
3823          }
3824        }
3825      }
3826    }
3827  }
3828  return (status);
3829}
3830}
3831NTSTATUS CdAudioSendToNextDriver(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3832{ PCD_DEVICE_EXTENSION deviceExtension ;
3833  NTSTATUS tmp ;
3834
3835  {
3836  deviceExtension = DeviceObject->DeviceExtension;
3837  if (s == NP) {
3838    s = SKIP1;
3839  } else {
3840    {
3841    errorFn();
3842    }
3843  }
3844  {
3845  Irp->CurrentLocation = (CHAR )((int )Irp->CurrentLocation + 1);
3846  Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation += 1;
3847  tmp = IofCallDriver(deviceExtension->TargetDeviceObject, Irp);
3848  }
3849  return (tmp);
3850}
3851}
3852BOOLEAN CdAudioIsPlayActive(PDEVICE_OBJECT DeviceObject ) 
3853{ PCD_DEVICE_EXTENSION deviceExtension ;
3854  PIRP irp_CdAudioIsPlayActive ;
3855  IO_STATUS_BLOCK ioStatus ;
3856  KEVENT event ;
3857  NTSTATUS status ;
3858  PSUB_Q_CURRENT_POSITION currentBuffer ;
3859  BOOLEAN returnValue ;
3860  PVOID tmp ;
3861
3862  {
3863  deviceExtension = DeviceObject->DeviceExtension;
3864  if (! deviceExtension->PlayActive) {
3865    return (0);
3866  } else {
3867
3868  }
3869  {
3870  tmp = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ), 541156419UL);
3871  currentBuffer = tmp;
3872  }
3873  if ((unsigned int )currentBuffer == (unsigned int )((void *)0)) {
3874    return (0);
3875  } else {
3876
3877  }
3878  {
3879  ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Format = 1;
3880  ((struct _CDROM_SUB_Q_DATA_FORMAT *)currentBuffer)->Track = 0;
3881/*   KeInitializeEvent(& event, 0, 0); */ /* INLINED */
3882  }
3883  if ((unsigned int )irp_CdAudioIsPlayActive == (unsigned int )((void *)0)) {
3884    {
3885/*     ExFreePool(currentBuffer); */ /* INLINED */
3886    }
3887    return (0);
3888  } else {
3889
3890  }
3891  if (status == 259L) {
3892    {
3893    KeWaitForSingleObject(& event, 5, 0, 0, (void *)0);
3894    status = ioStatus.__annonCompField4.Status;
3895    }
3896  } else {
3897
3898  }
3899  if (! (status >= 0L)) {
3900    {
3901/*     ExFreePool(currentBuffer); */ /* INLINED */
3902    }
3903    return (0);
3904  } else {
3905
3906  }
3907  if ((int )currentBuffer->Header.AudioStatus == 17) {
3908    returnValue = 1;
3909  } else {
3910    returnValue = 0;
3911    deviceExtension->PlayActive = 0;
3912  }
3913  {
3914/*   ExFreePool(currentBuffer); */ /* INLINED */
3915  }
3916  return (returnValue);
3917}
3918}
3919NTSTATUS CdAudioNECDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
3920{ PIO_STACK_LOCATION currentIrpStack ;
3921  PCD_DEVICE_EXTENSION deviceExtension ;
3922  PCDROM_TOC cdaudioDataOut ;
3923  SCSI_PASS_THROUGH srb ;
3924  PNEC_CDB cdb ;
3925  NTSTATUS status ;
3926  ULONG i ;
3927  ULONG bytesTransfered ;
3928  PUCHAR Toc ;
3929  ULONG retryCount ;
3930  ULONG address ;
3931  LARGE_INTEGER delay ;
3932  BOOLEAN tmp ;
3933  PVOID tmp___0 ;
3934  BOOLEAN tmp___1 ;
3935  PVOID tmp___2 ;
3936  ULONG tracksToReturn ;
3937  ULONG tracksOnCd ;
3938  ULONG tracksInBuffer ;
3939  ULONG dataLength ;
3940  NTSTATUS tmp___3 ;
3941  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
3942  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
3943  PSUB_Q_CURRENT_POSITION userPtr ;
3944  PUCHAR SubQPtr ;
3945  PVOID tmp___4 ;
3946  ULONG tmp___5 ;
3947  NTSTATUS tmp___6 ;
3948
3949  {
3950  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
3951  deviceExtension = DeviceObject->DeviceExtension;
3952  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
3953  cdb = (union _NEC_CDB *)(srb.Cdb);
3954  retryCount = 0;
3955  NECRestart: 
3956  {
3957  memset(cdb, 0, 12);
3958  }
3959  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
3960    goto switch_4_exp_0;
3961  } else {
3962    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
3963      goto switch_4_exp_1;
3964    } else {
3965      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
3966        goto switch_4_exp_2;
3967      } else {
3968        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
3969          goto switch_4_exp_3;
3970        } else {
3971          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
3972            goto switch_4_exp_4;
3973          } else {
3974            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
3975              goto switch_4_exp_5;
3976            } else {
3977              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
3978                goto switch_4_exp_6;
3979              } else {
3980                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
3981                  goto switch_4_exp_7;
3982                } else {
3983                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
3984                    goto switch_4_exp_8;
3985                  } else {
3986                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
3987                      goto switch_4_exp_9;
3988                    } else {
3989                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
3990                        goto switch_4_exp_10;
3991                      } else {
3992                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
3993                          goto switch_4_exp_11;
3994                        } else {
3995                          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
3996                            goto switch_4_exp_12;
3997                          } else {
3998                            {
3999                            goto switch_4_default;
4000                            if (0) {
4001                              switch_4_exp_0: /* CIL Label */ ;
4002                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) {
4003                                status = -1073741789L;
4004                                Irp->IoStatus.Information = 0;
4005                                goto switch_4_break;
4006                              } else {
4007
4008                              }
4009                              {
4010                              tmp = CdAudioIsPlayActive(DeviceObject);
4011                              }
4012                              if (tmp) {
4013                                Irp->IoStatus.Information = 0;
4014                                status = -2147483631L;
4015                                goto switch_4_break;
4016                              } else {
4017
4018                              }
4019                              {
4020                              tmp___0 = ExAllocatePoolWithTag(4, 1022, 541156419UL);
4021                              Toc = (UCHAR *)tmp___0;
4022                              }
4023                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4024                                status = -1073741670L;
4025                                Irp->IoStatus.Information = 0;
4026                                goto SetStatusAndReturn;
4027                              } else {
4028
4029                              }
4030                              {
4031                              memset(Toc, 0, 1022);
4032                              srb.CdbLength = 10;
4033                              cdb->NEC_READ_TOC.OperationCode = 222;
4034                              cdb->NEC_READ_TOC.Type = 3;
4035                              cdb->NEC_READ_TOC.TrackNumber = 176;
4036                              srb.TimeOutValue = 10;
4037                              status = SendSrbSynchronous(deviceExtension, & srb,
4038                                                          Toc, 1022);
4039                              }
4040                              if (! (status >= 0L)) {
4041                                if (status != -1073741764L) {
4042                                  {
4043/*                                   ExFreePool(Toc); */ /* INLINED */
4044                                  Irp->IoStatus.Information = 0;
4045                                  }
4046                                  goto SetStatusAndReturn;
4047                                } else {
4048                                  status = 0L;
4049                                }
4050                              } else {
4051                                status = 0L;
4052                              }
4053                              {
4054                              bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]);
4055                              Irp->IoStatus.Information = bytesTransfered;
4056                              memset(cdaudioDataOut, 0, bytesTransfered);
4057                              cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8);
4058                              cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL);
4059                              }
4060                              if (*((ULONG *)(Toc + 14)) == 0UL) {
4061                                {
4062/*                                 ExFreePool(Toc); */ /* INLINED */
4063                                }
4064                                goto switch_4_break;
4065                              } else {
4066
4067                              }
4068                              {
4069                              cdaudioDataOut->FirstTrack = 1;
4070                              cdaudioDataOut->LastTrack = 2;
4071                              cdaudioDataOut->TrackData[0].Reserved = 0;
4072                              cdaudioDataOut->TrackData[0].Control = (((int )*(Toc + 2) & 15) << 4) | ((int )*(Toc + 2) >> 4);
4073                              cdaudioDataOut->TrackData[0].TrackNumber = 1;
4074                              cdaudioDataOut->TrackData[0].Reserved1 = 0;
4075                              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));
4076                              cdaudioDataOut->TrackData[0].Address[0] = (unsigned char )(address >> 24);
4077                              cdaudioDataOut->TrackData[0].Address[1] = (unsigned char )(address >> 16);
4078                              cdaudioDataOut->TrackData[0].Address[2] = (unsigned char )(address >> 8);
4079                              cdaudioDataOut->TrackData[0].Address[3] = (unsigned char )address;
4080/*                               ExFreePool(Toc); */ /* INLINED */
4081                              }
4082                              goto switch_4_break;
4083                              switch_4_exp_1: /* CIL Label */ 
4084                              {
4085                              tmp___1 = CdAudioIsPlayActive(DeviceObject);
4086                              }
4087                              if (tmp___1) {
4088                                status = -2147483631L;
4089                                Irp->IoStatus.Information = 0;
4090                                goto switch_4_break;
4091                              } else {
4092
4093                              }
4094                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
4095                                status = -1073741789L;
4096                                Irp->IoStatus.Information = 0;
4097                                goto switch_4_break;
4098                              } else {
4099
4100                              }
4101                              {
4102                              tmp___2 = ExAllocatePoolWithTag(4, 1022, 541156419UL);
4103                              Toc = (UCHAR *)tmp___2;
4104                              }
4105                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4106                                status = -1073741670L;
4107                                Irp->IoStatus.Information = 0;
4108                                goto SetStatusAndReturn;
4109                              } else {
4110
4111                              }
4112                              {
4113                              memset(Toc, 0, 1022);
4114                              srb.CdbLength = 10;
4115                              cdb->NEC_READ_TOC.OperationCode = 222;
4116                              cdb->NEC_READ_TOC.Type = 3;
4117                              srb.TimeOutValue = 10;
4118                              status = SendSrbSynchronous(deviceExtension, & srb,
4119                                                          Toc, 1022);
4120                              }
4121                              if (! (status >= 0L)) {
4122                                if (status != -1073741764L) {
4123                                  if (status != -1073741764L) {
4124                                    {
4125                                    Irp->IoStatus.Information = 0;
4126/*                                     ExFreePool(Toc); */ /* INLINED */
4127                                    }
4128                                    goto SetStatusAndReturn;
4129                                  } else {
4130
4131                                  }
4132                                } else {
4133                                  status = 0L;
4134                                }
4135                              } else {
4136                                status = 0L;
4137                              }
4138                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
4139                                bytesTransfered = sizeof(CDROM_TOC );
4140                              } else {
4141                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
4142                              }
4143                              cdaudioDataOut->FirstTrack = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15);
4144                              cdaudioDataOut->LastTrack = (((int )*(Toc + 19) & 240) >> 4) * 10 + ((int )*(Toc + 19) & 15);
4145                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
4146                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
4147                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
4148                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
4149                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
4150                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
4151                              if (tracksInBuffer < tracksOnCd) {
4152                                tracksToReturn = tracksInBuffer;
4153                              } else {
4154                                tracksToReturn = tracksOnCd;
4155                              }
4156                              i = 0;
4157                              {
4158                              while (1) {
4159                                while_5_continue: /* CIL Label */ ;
4160                                if (i < tracksToReturn) {
4161
4162                                } else {
4163                                  goto while_5_break;
4164                                }
4165                                cdaudioDataOut->TrackData[i].Reserved = 0;
4166                                cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 10UL + 32UL)) & 15) << 4) | ((int )*(Toc + (i * 10UL + 32UL)) >> 4);
4167                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
4168                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
4169                                cdaudioDataOut->TrackData[i].Address[0] = 0;
4170                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 10UL + 39UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 39UL)) & 15);
4171                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 10UL + 40UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 40UL)) & 15);
4172                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 10UL + 41UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 10UL + 41UL)) & 15);
4173                                i += 1UL;
4174                              }
4175                              while_5_break: /* CIL Label */ ;
4176                              }
4177                              if (tracksInBuffer > tracksOnCd) {
4178                                cdaudioDataOut->TrackData[i].Reserved = 0;
4179                                cdaudioDataOut->TrackData[i].Control = 16;
4180                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
4181                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
4182                                cdaudioDataOut->TrackData[i].Address[0] = 0;
4183                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 29) & 240) >> 4) * 10 + ((int )*(Toc + 29) & 15);
4184                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 30) & 240) >> 4) * 10 + ((int )*(Toc + 30) & 15);
4185                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 31) & 240) >> 4) * 10 + ((int )*(Toc + 31) & 15);
4186                                i += 1UL;
4187                              } else {
4188
4189                              }
4190                              {
4191                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
4192/*                               ExFreePool(Toc); */ /* INLINED */
4193                              }
4194                              goto switch_4_break;
4195                              switch_4_exp_2: /* CIL Label */ 
4196                              {
4197                              deviceExtension->PlayActive = 0;
4198                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
4199                              }
4200                              return (tmp___3);
4201                              goto switch_4_break;
4202                              switch_4_exp_3: /* CIL Label */ 
4203                              inputBuffer = Irp->AssociatedIrp.SystemBuffer;
4204                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
4205                                status = -1073741820L;
4206                                Irp->IoStatus.Information = 0;
4207                                goto switch_4_break;
4208                              } else {
4209
4210                              }
4211                              {
4212                              srb.CdbLength = 10;
4213                              srb.TimeOutValue = 10;
4214                              cdb->NEC_PLAY_AUDIO.OperationCode = 216;
4215                              cdb->NEC_PLAY_AUDIO.PlayMode = 1;
4216                              cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
4217                              cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
4218                              cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
4219                              cdb->NEC_PLAY_AUDIO.Control = 64;
4220                              status = SendSrbSynchronous(deviceExtension, & srb,
4221                                                          (void *)0, 0);
4222                              }
4223                              if (status >= 0L) {
4224                                {
4225                                deviceExtension->PlayActive = 1;
4226                                memset(cdb, 0, 12);
4227                                cdb->NEC_PLAY_AUDIO.OperationCode = 217;
4228                                cdb->NEC_PLAY_AUDIO.PlayMode = 3;
4229                                cdb->NEC_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
4230                                cdb->NEC_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
4231                                cdb->NEC_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
4232                                cdb->NEC_PLAY_AUDIO.Control = 64;
4233                                status = SendSrbSynchronous(deviceExtension, & srb,
4234                                                            (void *)0, 0);
4235                                }
4236                              } else {
4237
4238                              }
4239                              goto switch_4_break;
4240                              switch_4_exp_4: /* CIL Label */ 
4241                              inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
4242                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
4243                                status = -1073741820L;
4244                                Irp->IoStatus.Information = 0;
4245                                goto switch_4_break;
4246                              } else {
4247
4248                              }
4249                              {
4250                              srb.CdbLength = 10;
4251                              srb.TimeOutValue = 10;
4252                              cdb->NEC_SEEK_AUDIO.OperationCode = 216;
4253                              cdb->NEC_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
4254                              cdb->NEC_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
4255                              cdb->NEC_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
4256                              cdb->NEC_SEEK_AUDIO.Control = 64;
4257                              status = SendSrbSynchronous(deviceExtension, & srb,
4258                                                          (void *)0, 0);
4259                              }
4260                              goto switch_4_break;
4261                              switch_4_exp_5: /* CIL Label */ 
4262                              {
4263                              deviceExtension->PlayActive = 0;
4264                              srb.CdbLength = 10;
4265                              srb.TimeOutValue = 10;
4266                              cdb->NEC_PAUSE_AUDIO.OperationCode = 218;
4267                              status = SendSrbSynchronous(deviceExtension, & srb,
4268                                                          (void *)0, 0);
4269                              }
4270                              goto switch_4_break;
4271                              switch_4_exp_6: /* CIL Label */ 
4272                              {
4273                              srb.CdbLength = 10;
4274                              srb.TimeOutValue = 10;
4275                              cdb->NEC_PLAY_AUDIO.OperationCode = 217;
4276                              cdb->NEC_PLAY_AUDIO.PlayMode = 3;
4277                              cdb->NEC_PLAY_AUDIO.Control = 192;
4278                              status = SendSrbSynchronous(deviceExtension, & srb,
4279                                                          (void *)0, 0);
4280                              }
4281                              goto switch_4_break;
4282                              switch_4_exp_7: /* CIL Label */ 
4283                              {
4284                              userPtr = Irp->AssociatedIrp.SystemBuffer;
4285                              tmp___4 = ExAllocatePoolWithTag(4, 10, 541156419UL);
4286                              SubQPtr = tmp___4;
4287                              }
4288                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
4289                                status = -1073741789L;
4290                                Irp->IoStatus.Information = 0;
4291                                if (SubQPtr) {
4292                                  {
4293/*                                   ExFreePool(SubQPtr); */ /* INLINED */
4294                                  }
4295                                } else {
4296
4297                                }
4298                                goto switch_4_break;
4299                              } else {
4300
4301                              }
4302                              if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
4303                                status = -1073741670L;
4304                                Irp->IoStatus.Information = 0;
4305                                goto SetStatusAndReturn;
4306                              } else {
4307
4308                              }
4309                              {
4310                              memset(SubQPtr, 0, 10);
4311                              }
4312                              if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
4313                                {
4314/*                                 ExFreePool(SubQPtr); */ /* INLINED */
4315                                status = -1073741823L;
4316                                Irp->IoStatus.Information = 0;
4317                                }
4318                                goto SetStatusAndReturn;
4319                              } else {
4320
4321                              }
4322                              NECSeek: 
4323                              {
4324                              srb.CdbLength = 10;
4325                              srb.TimeOutValue = 10;
4326                              cdb->NEC_READ_Q_CHANNEL.OperationCode = 221;
4327                              cdb->NEC_READ_Q_CHANNEL.TransferSize = 10;
4328                              status = SendSrbSynchronous(deviceExtension, & srb,
4329                                                          SubQPtr, 10);
4330                              }
4331                              if (status >= 0L) {
4332                                goto _L;
4333                              } else {
4334                                if (status == -1073741764L) {
4335                                  _L: /* CIL Label */ 
4336                                  userPtr->Header.Reserved = 0;
4337                                  if ((int )*(SubQPtr + 0) == 0) {
4338                                    userPtr->Header.AudioStatus = 17;
4339                                  } else {
4340                                    if ((int )*(SubQPtr + 0) == 1) {
4341                                      userPtr->Header.AudioStatus = 18;
4342                                      deviceExtension->PlayActive = 0;
4343                                    } else {
4344                                      if ((int )*(SubQPtr + 0) == 2) {
4345                                        userPtr->Header.AudioStatus = 18;
4346                                        deviceExtension->PlayActive = 0;
4347                                      } else {
4348                                        if ((int )*(SubQPtr + 0) == 3) {
4349                                          userPtr->Header.AudioStatus = 19;
4350                                          deviceExtension->PlayActive = 0;
4351                                        } else {
4352                                          deviceExtension->PlayActive = 0;
4353                                        }
4354                                      }
4355                                    }
4356                                  }
4357                                  userPtr->Header.DataLength[0] = 0;
4358                                  userPtr->Header.DataLength[0] = 12;
4359                                  userPtr->FormatCode = 1;
4360                                  userPtr->Control = (int )*(SubQPtr + 1) & 15;
4361                                  userPtr->ADR = 0;
4362                                  userPtr->TrackNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15);
4363                                  userPtr->IndexNumber = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15);
4364                                  userPtr->AbsoluteAddress[0] = 0;
4365                                  userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
4366                                  userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15);
4367                                  userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr + 9) & 15);
4368                                  userPtr->TrackRelativeAddress[0] = 0;
4369                                  userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15);
4370                                  userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15);
4371                                  userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
4372                                  Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
4373                                  if ((int )userPtr->TrackNumber > 100) {
4374                                    {
4375                                    delay.QuadPart = -5000000;
4376                                    KeDelayExecutionThread(0, 0, & delay);
4377                                    tmp___5 = retryCount;
4378                                    retryCount += 1UL;
4379                                    }
4380                                    if (tmp___5 < 4UL) {
4381                                      goto NECSeek;
4382                                    } else {
4383                                      Irp->IoStatus.Information = 0;
4384                                      status = -1073741434L;
4385                                    }
4386                                  } else {
4387                                    status = 0L;
4388                                  }
4389                                } else {
4390                                  {
4391                                  memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4392                                  Irp->IoStatus.Information = 0;
4393                                  }
4394                                }
4395                              }
4396                              {
4397/*                               ExFreePool(SubQPtr); */ /* INLINED */
4398                              }
4399                              goto switch_4_break;
4400                              switch_4_exp_8: /* CIL Label */ 
4401                              {
4402                              deviceExtension->PlayActive = 0;
4403                              srb.CdbLength = 10;
4404                              srb.TimeOutValue = 10;
4405                              cdb->NEC_EJECT.OperationCode = 220;
4406                              status = SendSrbSynchronous(deviceExtension, & srb,
4407                                                          (void *)0, 0);
4408                              Irp->IoStatus.Information = 0;
4409                              }
4410                              goto switch_4_break;
4411                              switch_4_exp_9: /* CIL Label */ ;
4412                              switch_4_exp_10: /* CIL Label */ ;
4413                              switch_4_exp_11: /* CIL Label */ 
4414                              Irp->IoStatus.Information = 0;
4415                              status = -1073741808L;
4416                              goto switch_4_break;
4417                              switch_4_exp_12: /* CIL Label */ 
4418                              {
4419                              CdAudioIsPlayActive(DeviceObject);
4420                              }
4421                              switch_4_default: /* CIL Label */ 
4422                              {
4423                              tmp___6 = CdAudioSendToNextDriver(DeviceObject, Irp);
4424                              }
4425                              return (tmp___6);
4426                              goto switch_4_break;
4427                            } else {
4428                              switch_4_break: /* CIL Label */ ;
4429                            }
4430                            }
4431                          }
4432                        }
4433                      }
4434                    }
4435                  }
4436                }
4437              }
4438            }
4439          }
4440        }
4441      }
4442    }
4443  }
4444  SetStatusAndReturn: 
4445  if (status == -2147483626L) {
4446    if ((int )currentIrpStack->Flags & 2) {
4447      status = -1073741435L;
4448      goto NECRestart;
4449    } else {
4450
4451    }
4452    {
4453/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
4454    Irp->IoStatus.Information = 0;
4455    }
4456  } else {
4457
4458  }
4459  {
4460  Irp->IoStatus.__annonCompField4.Status = status;
4461  myStatus = status;
4462  IofCompleteRequest(Irp, 0);
4463  }
4464  return (status);
4465}
4466}
4467NTSTATUS CdAudioPioneerDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
4468{ PIO_STACK_LOCATION currentIrpStack ;
4469  PCD_DEVICE_EXTENSION deviceExtension ;
4470  PCDROM_TOC cdaudioDataOut ;
4471  SCSI_PASS_THROUGH srb ;
4472  PPNR_CDB cdb ;
4473  PCDB scsiCdb ;
4474  NTSTATUS status ;
4475  ULONG i ;
4476  ULONG retry ;
4477  PUCHAR Toc ;
4478  BOOLEAN tmp ;
4479  PVOID tmp___0 ;
4480  ULONG tracksToReturn ;
4481  ULONG tracksOnCd ;
4482  ULONG tracksInBuffer ;
4483  ULONG dataLength ;
4484  NTSTATUS tmp___1 ;
4485  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
4486  ULONG tmp___2 ;
4487  ULONG tmp___3 ;
4488  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
4489  ULONG tmp___4 ;
4490  PSUB_Q_CURRENT_POSITION userPtr ;
4491  PUCHAR SubQPtr ;
4492  PVOID tmp___5 ;
4493  ULONG tmp___6 ;
4494  ULONG tmp___7 ;
4495  NTSTATUS tmp___8 ;
4496
4497  {
4498  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
4499  deviceExtension = DeviceObject->DeviceExtension;
4500  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
4501  cdb = (union _PIONEER_CDB *)(srb.Cdb);
4502  scsiCdb = (union _CDB *)(srb.Cdb);
4503  PioneerRestart: 
4504  {
4505  memset(cdb, 0, 12);
4506  }
4507  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
4508    goto switch_6_exp_13;
4509  } else {
4510    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
4511      goto switch_6_exp_14;
4512    } else {
4513      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
4514        goto switch_6_exp_15;
4515      } else {
4516        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
4517          goto switch_6_exp_16;
4518        } else {
4519          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
4520            goto switch_6_exp_17;
4521          } else {
4522            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
4523              goto switch_6_exp_18;
4524            } else {
4525              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
4526                goto switch_6_exp_19;
4527              } else {
4528                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
4529                  goto switch_6_exp_20;
4530                } else {
4531                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
4532                    goto switch_6_exp_21;
4533                  } else {
4534                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
4535                      goto switch_6_exp_22;
4536                    } else {
4537                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
4538                        goto switch_6_exp_23;
4539                      } else {
4540                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
4541                          goto switch_6_exp_24;
4542                        } else {
4543                          {
4544                          goto switch_6_default;
4545                          if (0) {
4546                            switch_6_exp_13: /* CIL Label */ ;
4547                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
4548                              status = -1073741789L;
4549                              Irp->IoStatus.Information = 0;
4550                              goto switch_6_break;
4551                            } else {
4552
4553                            }
4554                            {
4555                            tmp = CdAudioIsPlayActive(DeviceObject);
4556                            }
4557                            if (tmp) {
4558                              status = -2147483631L;
4559                              Irp->IoStatus.Information = 0;
4560                              goto switch_6_break;
4561                            } else {
4562
4563                            }
4564                            {
4565                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
4566                                                            541156419UL);
4567                            Toc = (UCHAR *)tmp___0;
4568                            }
4569                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
4570                              status = -1073741670L;
4571                              Irp->IoStatus.Information = 0;
4572                              goto SetStatusAndReturn;
4573                            } else {
4574
4575                            }
4576                            {
4577                            memset(Toc, 0, sizeof(CDROM_TOC ));
4578                            }
4579                            if ((int )deviceExtension->Active == 9) {
4580                              cdb->PNR_START_STOP.Immediate = 1;
4581                            } else {
4582                              cdb->PNR_START_STOP.Immediate = 0;
4583                            }
4584                            {
4585                            cdb->PNR_START_STOP.OperationCode = 27;
4586                            cdb->PNR_START_STOP.Start = 1;
4587                            srb.CdbLength = 6;
4588                            srb.TimeOutValue = 10;
4589                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4590                                                        0);
4591                            }
4592                            if (! (status >= 0L)) {
4593                              {
4594/*                               ExFreePool(Toc); */ /* INLINED */
4595                              Irp->IoStatus.Information = 0;
4596                              }
4597                              goto SetStatusAndReturn;
4598                            } else {
4599
4600                            }
4601                            {
4602                            memset(cdb, 0, 12);
4603                            srb.CdbLength = 10;
4604                            cdb->PNR_READ_TOC.OperationCode = 193;
4605                            cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4606                            cdb->PNR_READ_TOC.Type = 0;
4607                            srb.TimeOutValue = 10;
4608                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
4609                                                        4);
4610                            }
4611                            if (! (status >= 0L)) {
4612                              {
4613/*                               ExFreePool(Toc); */ /* INLINED */
4614                              Irp->IoStatus.Information = 0;
4615                              }
4616                              goto SetStatusAndReturn;
4617                            } else {
4618
4619                            }
4620                            cdaudioDataOut->FirstTrack = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15);
4621                            cdaudioDataOut->LastTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4622                            tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
4623                            dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
4624                            cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
4625                            cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
4626                            tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
4627                            tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
4628                            if (tracksInBuffer < tracksOnCd) {
4629                              tracksToReturn = tracksInBuffer;
4630                            } else {
4631                              tracksToReturn = tracksOnCd;
4632                            }
4633                            i = 0;
4634                            {
4635                            while (1) {
4636                              while_7_continue: /* CIL Label */ ;
4637                              if (i < tracksToReturn) {
4638
4639                              } else {
4640                                goto while_7_break;
4641                              }
4642                              {
4643                              memset(cdb, 0, 12);
4644                              cdb->PNR_READ_TOC.OperationCode = 193;
4645                              cdb->PNR_READ_TOC.TrackNumber = (unsigned char )(((i + (ULONG )cdaudioDataOut->FirstTrack) / 10UL << 4) + (i + (ULONG )cdaudioDataOut->FirstTrack) % 10UL);
4646                              cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4647                              cdb->PNR_READ_TOC.Type = 2;
4648                              srb.TimeOutValue = 10;
4649                              status = SendSrbSynchronous(deviceExtension, & srb,
4650                                                          Toc, 4);
4651                              }
4652                              if (! (status >= 0L)) {
4653                                {
4654/*                                 ExFreePool(Toc); */ /* INLINED */
4655                                Irp->IoStatus.Information = 0;
4656                                }
4657                                goto SetStatusAndReturn;
4658                              } else {
4659
4660                              }
4661                              cdaudioDataOut->TrackData[i].Reserved = 0;
4662                              cdaudioDataOut->TrackData[i].Control = *(Toc + 0);
4663                              cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
4664                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
4665                              cdaudioDataOut->TrackData[i].Address[0] = 0;
4666                              cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4667                              cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
4668                              cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
4669                              i += 1UL;
4670                            }
4671                            while_7_break: /* CIL Label */ ;
4672                            }
4673                            if (tracksInBuffer > tracksOnCd) {
4674                              {
4675                              memset(cdb, 0, 12);
4676                              cdb->PNR_READ_TOC.OperationCode = 193;
4677                              cdb->PNR_READ_TOC.AssignedLength[1] = 4;
4678                              cdb->PNR_READ_TOC.Type = 1;
4679                              srb.TimeOutValue = 10;
4680                              status = SendSrbSynchronous(deviceExtension, & srb,
4681                                                          Toc, 4);
4682                              }
4683                              if (! (status >= 0L)) {
4684                                {
4685/*                                 ExFreePool(Toc); */ /* INLINED */
4686                                Irp->IoStatus.Information = 0;
4687                                }
4688                                goto SetStatusAndReturn;
4689                              } else {
4690
4691                              }
4692                              cdaudioDataOut->TrackData[i].Reserved = 0;
4693                              cdaudioDataOut->TrackData[i].Control = 16;
4694                              cdaudioDataOut->TrackData[i].TrackNumber = 170;
4695                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
4696                              cdaudioDataOut->TrackData[i].Address[0] = 0;
4697                              cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 0) & 240) >> 4) * 10 + ((int )*(Toc + 0) & 15);
4698                              cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
4699                              cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
4700                              i += 1UL;
4701                            } else {
4702
4703                            }
4704                            {
4705                            Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
4706/*                             ExFreePool(Toc); */ /* INLINED */
4707                            }
4708                            goto switch_6_break;
4709                            switch_6_exp_14: /* CIL Label */ 
4710                            {
4711                            deviceExtension->PlayActive = 0;
4712                            tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp);
4713                            }
4714                            return (tmp___1);
4715                            goto switch_6_break;
4716                            switch_6_exp_15: /* CIL Label */ 
4717                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
4718                            Irp->IoStatus.Information = 0;
4719                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
4720                              status = -1073741820L;
4721                              goto switch_6_break;
4722                            } else {
4723
4724                            }
4725                            retry = 5;
4726                            {
4727                            while (1) {
4728                              while_8_continue: /* CIL Label */ ;
4729                              {
4730                              srb.CdbLength = 10;
4731                              srb.TimeOutValue = 10;
4732                              cdb->PNR_SEEK_AUDIO.OperationCode = 200;
4733                              cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
4734                              cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
4735                              cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
4736                              cdb->PNR_SEEK_AUDIO.Type = 1;
4737                              status = SendSrbSynchronous(deviceExtension, & srb,
4738                                                          (void *)0, 0);
4739                              }
4740                              if (! (status >= 0L)) {
4741                                tmp___2 = retry;
4742                                retry -= 1UL;
4743                                if (tmp___2 > 0UL) {
4744
4745                                } else {
4746                                  goto while_8_break;
4747                                }
4748                              } else {
4749                                goto while_8_break;
4750                              }
4751                            }
4752                            while_8_break: /* CIL Label */ ;
4753                            }
4754                            if (status >= 0L) {
4755                              {
4756                              memset(cdb, 0, 12);
4757                              retry = 5;
4758                              }
4759                              {
4760                              while (1) {
4761                                while_9_continue: /* CIL Label */ ;
4762                                {
4763                                srb.CdbLength = 10;
4764                                srb.TimeOutValue = 10;
4765                                cdb->PNR_PLAY_AUDIO.OperationCode = 201;
4766                                cdb->PNR_PLAY_AUDIO.StopAddr = 1;
4767                                cdb->PNR_PLAY_AUDIO.Minute = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
4768                                cdb->PNR_PLAY_AUDIO.Second = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
4769                                cdb->PNR_PLAY_AUDIO.Frame = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
4770                                cdb->PNR_PLAY_AUDIO.Type = 1;
4771                                status = SendSrbSynchronous(deviceExtension, & srb,
4772                                                            (void *)0, 0);
4773                                }
4774                                if (! (status >= 0L)) {
4775                                  tmp___3 = retry;
4776                                  retry -= 1UL;
4777                                  if (tmp___3 > 0UL) {
4778
4779                                  } else {
4780                                    goto while_9_break;
4781                                  }
4782                                } else {
4783                                  goto while_9_break;
4784                                }
4785                              }
4786                              while_9_break: /* CIL Label */ ;
4787                              }
4788                              if (status >= 0L) {
4789                                deviceExtension->PlayActive = 1;
4790                              } else {
4791
4792                              }
4793                            } else {
4794
4795                            }
4796                            goto switch_6_break;
4797                            switch_6_exp_16: /* CIL Label */ 
4798                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
4799                            Irp->IoStatus.Information = 0;
4800                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
4801                              status = -1073741820L;
4802                              goto switch_6_break;
4803                            } else {
4804
4805                            }
4806                            retry = 5;
4807                            {
4808                            while (1) {
4809                              while_10_continue: /* CIL Label */ ;
4810                              {
4811                              srb.CdbLength = 10;
4812                              srb.TimeOutValue = 10;
4813                              cdb->PNR_SEEK_AUDIO.OperationCode = 200;
4814                              cdb->PNR_SEEK_AUDIO.Minute = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
4815                              cdb->PNR_SEEK_AUDIO.Second = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
4816                              cdb->PNR_SEEK_AUDIO.Frame = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
4817                              cdb->PNR_SEEK_AUDIO.Type = 1;
4818                              status = SendSrbSynchronous(deviceExtension, & srb,
4819                                                          (void *)0, 0);
4820                              }
4821                              if (! (status >= 0L)) {
4822                                tmp___4 = retry;
4823                                retry -= 1UL;
4824                                if (tmp___4 > 0UL) {
4825
4826                                } else {
4827                                  goto while_10_break;
4828                                }
4829                              } else {
4830                                goto while_10_break;
4831                              }
4832                            }
4833                            while_10_break: /* CIL Label */ ;
4834                            }
4835                            goto switch_6_break;
4836                            switch_6_exp_17: /* CIL Label */ 
4837                            {
4838                            Irp->IoStatus.Information = 0;
4839                            deviceExtension->PlayActive = 0;
4840                            srb.CdbLength = 10;
4841                            srb.TimeOutValue = 10;
4842                            cdb->PNR_PAUSE_AUDIO.OperationCode = 202;
4843                            cdb->PNR_PAUSE_AUDIO.Pause = 1;
4844                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4845                                                        0);
4846                            }
4847                            goto switch_6_break;
4848                            switch_6_exp_18: /* CIL Label */ 
4849                            {
4850                            Irp->IoStatus.Information = 0;
4851                            srb.CdbLength = 10;
4852                            srb.TimeOutValue = 10;
4853                            cdb->PNR_PAUSE_AUDIO.OperationCode = 202;
4854                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
4855                                                        0);
4856                            }
4857                            goto switch_6_break;
4858                            switch_6_exp_19: /* CIL Label */ 
4859                            {
4860                            userPtr = Irp->AssociatedIrp.SystemBuffer;
4861                            tmp___5 = ExAllocatePoolWithTag(4, 9, 541156419UL);
4862                            SubQPtr = tmp___5;
4863                            }
4864                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
4865                              status = -1073741789L;
4866                              Irp->IoStatus.Information = 0;
4867                              if (SubQPtr) {
4868                                {
4869/*                                 ExFreePool(SubQPtr); */ /* INLINED */
4870                                }
4871                              } else {
4872
4873                              }
4874                              goto switch_6_break;
4875                            } else {
4876
4877                            }
4878                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
4879                              {
4880                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4881                              status = -1073741670L;
4882                              Irp->IoStatus.Information = 0;
4883                              }
4884                              goto SetStatusAndReturn;
4885                            } else {
4886
4887                            }
4888                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
4889                              {
4890/*                               ExFreePool(SubQPtr); */ /* INLINED */
4891                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
4892                              Irp->IoStatus.Information = 0;
4893                              status = -1073741808L;
4894                              }
4895                              goto SetStatusAndReturn;
4896                            } else {
4897
4898                            }
4899                            retry = 5;
4900                            {
4901                            while (1) {
4902                              while_11_continue: /* CIL Label */ ;
4903                              {
4904                              srb.CdbLength = 10;
4905                              srb.TimeOutValue = 10;
4906                              cdb->PNR_AUDIO_STATUS.OperationCode = 204;
4907                              cdb->PNR_AUDIO_STATUS.AssignedLength = 6;
4908                              status = SendSrbSynchronous(deviceExtension, & srb,
4909                                                          SubQPtr, 6);
4910                              }
4911                              if (! (status >= 0L)) {
4912                                tmp___6 = retry;
4913                                retry -= 1UL;
4914                                if (tmp___6 > 0UL) {
4915                                  if (status != -1073741661L) {
4916
4917                                  } else {
4918                                    goto while_11_break;
4919                                  }
4920                                } else {
4921                                  goto while_11_break;
4922                                }
4923                              } else {
4924                                goto while_11_break;
4925                              }
4926                            }
4927                            while_11_break: /* CIL Label */ ;
4928                            }
4929                            if (status >= 0L) {
4930                              userPtr->Header.Reserved = 0;
4931                              if ((int )*(SubQPtr + 0) == 0) {
4932                                userPtr->Header.AudioStatus = 17;
4933                              } else {
4934                                if ((int )*(SubQPtr + 0) == 1) {
4935                                  deviceExtension->PlayActive = 0;
4936                                  userPtr->Header.AudioStatus = 18;
4937                                } else {
4938                                  if ((int )*(SubQPtr + 0) == 2) {
4939                                    deviceExtension->PlayActive = 0;
4940                                    userPtr->Header.AudioStatus = 18;
4941                                  } else {
4942                                    if ((int )*(SubQPtr + 0) == 3) {
4943                                      userPtr->Header.AudioStatus = 19;
4944                                      deviceExtension->PlayActive = 0;
4945                                    } else {
4946                                      deviceExtension->PlayActive = 0;
4947                                    }
4948                                  }
4949                                }
4950                              }
4951                            } else {
4952                              {
4953/*                               ExFreePool(SubQPtr); */ /* INLINED */
4954                              Irp->IoStatus.Information = 0;
4955                              }
4956                              goto SetStatusAndReturn;
4957                            }
4958                            {
4959                            memset(cdb, 0, 12);
4960                            retry = 5;
4961                            }
4962                            {
4963                            while (1) {
4964                              while_12_continue: /* CIL Label */ ;
4965                              {
4966                              srb.CdbLength = 10;
4967                              srb.TimeOutValue = 10;
4968                              cdb->PNR_READ_Q_CHANNEL.OperationCode = 194;
4969                              cdb->PNR_READ_Q_CHANNEL.AssignedLength = 9;
4970                              status = SendSrbSynchronous(deviceExtension, & srb,
4971                                                          SubQPtr, 9);
4972                              }
4973                              if (! (status >= 0L)) {
4974                                tmp___7 = retry;
4975                                retry -= 1UL;
4976                                if (tmp___7 > 0UL) {
4977
4978                                } else {
4979                                  goto while_12_break;
4980                                }
4981                              } else {
4982                                goto while_12_break;
4983                              }
4984                            }
4985                            while_12_break: /* CIL Label */ ;
4986                            }
4987                            if (status >= 0L) {
4988                              userPtr->Header.DataLength[0] = 0;
4989                              userPtr->Header.DataLength[0] = 12;
4990                              userPtr->FormatCode = 1;
4991                              userPtr->Control = (int )*(SubQPtr + 0) & 15;
4992                              userPtr->ADR = 0;
4993                              userPtr->TrackNumber = (((int )*(SubQPtr + 1) & 240) >> 4) * 10 + ((int )*(SubQPtr + 1) & 15);
4994                              userPtr->IndexNumber = (((int )*(SubQPtr + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr + 2) & 15);
4995                              userPtr->AbsoluteAddress[0] = 0;
4996                              userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
4997                              userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
4998                              userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr + 8) & 15);
4999                              userPtr->TrackRelativeAddress[0] = 0;
5000                              userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr + 3) & 15);
5001                              userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr + 4) & 15);
5002                              userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr + 5) & 15);
5003                              Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
5004                            } else {
5005                              Irp->IoStatus.Information = 0;
5006                            }
5007                            {
5008/*                             ExFreePool(SubQPtr); */ /* INLINED */
5009                            }
5010                            goto switch_6_break;
5011                            switch_6_exp_20: /* CIL Label */ 
5012                            Irp->IoStatus.Information = 0;
5013                            deviceExtension->PlayActive = 0;
5014                            if ((int )deviceExtension->Active == 9) {
5015                              srb.CdbLength = 10;
5016                              srb.TimeOutValue = 10;
5017                              cdb->PNR_EJECT.OperationCode = 192;
5018                              cdb->PNR_EJECT.Immediate = 1;
5019                            } else {
5020                              srb.CdbLength = 6;
5021                              scsiCdb->START_STOP.OperationCode = 27;
5022                              scsiCdb->START_STOP.LoadEject = 1;
5023                              scsiCdb->START_STOP.Start = 0;
5024                            }
5025                            {
5026                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
5027                                                        0);
5028                            }
5029                            goto switch_6_break;
5030                            switch_6_exp_21: /* CIL Label */ ;
5031                            switch_6_exp_22: /* CIL Label */ ;
5032                            switch_6_exp_23: /* CIL Label */ 
5033                            Irp->IoStatus.Information = 0;
5034                            status = -1073741808L;
5035                            goto switch_6_break;
5036                            switch_6_exp_24: /* CIL Label */ 
5037                            {
5038                            CdAudioIsPlayActive(DeviceObject);
5039                            }
5040                            switch_6_default: /* CIL Label */ 
5041                            {
5042                            tmp___8 = CdAudioSendToNextDriver(DeviceObject, Irp);
5043                            }
5044                            return (tmp___8);
5045                            goto switch_6_break;
5046                          } else {
5047                            switch_6_break: /* CIL Label */ ;
5048                          }
5049                          }
5050                        }
5051                      }
5052                    }
5053                  }
5054                }
5055              }
5056            }
5057          }
5058        }
5059      }
5060    }
5061  }
5062  SetStatusAndReturn: 
5063  if (status == -2147483626L) {
5064    if ((int )currentIrpStack->Flags & 2) {
5065      status = -1073741435L;
5066      goto PioneerRestart;
5067    } else {
5068
5069    }
5070    {
5071/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
5072    Irp->IoStatus.Information = 0;
5073    }
5074  } else {
5075
5076  }
5077  {
5078  Irp->IoStatus.__annonCompField4.Status = status;
5079  myStatus = status;
5080  IofCompleteRequest(Irp, 0);
5081  }
5082  return (status);
5083}
5084}
5085NTSTATUS CdAudioDenonDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
5086{ PIO_STACK_LOCATION currentIrpStack ;
5087  PCD_DEVICE_EXTENSION deviceExtension ;
5088  PCDROM_TOC cdaudioDataOut ;
5089  SCSI_PASS_THROUGH srb ;
5090  PCDB cdb ;
5091  NTSTATUS status ;
5092  ULONG i ;
5093  ULONG bytesTransfered ;
5094  PUCHAR Toc ;
5095  BOOLEAN tmp ;
5096  PVOID tmp___0 ;
5097  ULONG tracksToReturn ;
5098  ULONG tracksOnCd ;
5099  ULONG tracksInBuffer ;
5100  ULONG dataLength ;
5101  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
5102  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
5103  PUCHAR SubQPtr ;
5104  PVOID tmp___1 ;
5105  PSUB_Q_CURRENT_POSITION userPtr ;
5106  PUCHAR SubQPtr___0 ;
5107  PVOID tmp___2 ;
5108  NTSTATUS tmp___3 ;
5109
5110  {
5111  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
5112  deviceExtension = DeviceObject->DeviceExtension;
5113  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
5114  cdb = (union _CDB *)(srb.Cdb);
5115  DenonRestart: 
5116  {
5117  memset(cdb, 0, 12);
5118  }
5119  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
5120    goto switch_13_exp_25;
5121  } else {
5122    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
5123      goto switch_13_exp_26;
5124    } else {
5125      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
5126        goto switch_13_exp_27;
5127      } else {
5128        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
5129          goto switch_13_exp_28;
5130        } else {
5131          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
5132            goto switch_13_exp_29;
5133          } else {
5134            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
5135              goto switch_13_exp_30;
5136            } else {
5137              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
5138                goto switch_13_exp_31;
5139              } else {
5140                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
5141                  goto switch_13_exp_32;
5142                } else {
5143                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
5144                    goto switch_13_exp_33;
5145                  } else {
5146                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
5147                      goto switch_13_exp_34;
5148                    } else {
5149                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
5150                        goto switch_13_exp_35;
5151                      } else {
5152                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
5153                          goto switch_13_exp_36;
5154                        } else {
5155                          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
5156                            goto switch_13_exp_37;
5157                          } else {
5158                            {
5159                            goto switch_13_default;
5160                            if (0) {
5161                              switch_13_exp_25: /* CIL Label */ 
5162                              status = -1073741808L;
5163                              Irp->IoStatus.Information = 0;
5164                              goto switch_13_break;
5165                              switch_13_exp_26: /* CIL Label */ ;
5166                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
5167                                status = -1073741789L;
5168                                Irp->IoStatus.Information = 0;
5169                                goto switch_13_break;
5170                              } else {
5171
5172                              }
5173                              {
5174                              tmp = CdAudioIsPlayActive(DeviceObject);
5175                              }
5176                              if (tmp) {
5177                                status = -2147483631L;
5178                                Irp->IoStatus.Information = 0;
5179                                goto switch_13_break;
5180                              } else {
5181
5182                              }
5183                              {
5184                              tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
5185                                                              541156419UL);
5186                              Toc = (UCHAR *)tmp___0;
5187                              }
5188                              if ((unsigned int )Toc == (unsigned int )((void *)0)) {
5189                                status = -1073741670L;
5190                                Irp->IoStatus.Information = 0;
5191                                goto SetStatusAndReturn;
5192                              } else {
5193
5194                              }
5195                              {
5196                              memset(Toc, 0, sizeof(CDROM_TOC ));
5197                              cdb->CDB6GENERIC.OperationCode = 233;
5198                              srb.TimeOutValue = 10;
5199                              srb.CdbLength = 6;
5200                              status = SendSrbSynchronous(deviceExtension, & srb,
5201                                                          Toc, sizeof(CDROM_TOC ));
5202                              }
5203                              if (! (status >= 0L)) {
5204                                if (status != -1073741764L) {
5205                                  if (status != -1073741764L) {
5206                                    {
5207/*                                     ExFreePool(Toc); */ /* INLINED */
5208                                    Irp->IoStatus.Information = 0;
5209                                    }
5210                                    goto SetStatusAndReturn;
5211                                  } else {
5212
5213                                  }
5214                                } else {
5215
5216                                }
5217                              } else {
5218
5219                              }
5220                              status = 0L;
5221                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > srb.DataTransferLength) {
5222                                bytesTransfered = srb.DataTransferLength;
5223                              } else {
5224                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5225                              }
5226                              cdaudioDataOut->FirstTrack = (((int )*(Toc + 1) & 240) >> 4) * 10 + ((int )*(Toc + 1) & 15);
5227                              cdaudioDataOut->LastTrack = (((int )*(Toc + 5) & 240) >> 4) * 10 + ((int )*(Toc + 5) & 15);
5228                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5229                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
5230                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
5231                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
5232                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5233                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
5234                              if (tracksInBuffer < tracksOnCd) {
5235                                tracksToReturn = tracksInBuffer;
5236                              } else {
5237                                tracksToReturn = tracksOnCd;
5238                              }
5239                              i = 0;
5240                              {
5241                              while (1) {
5242                                while_14_continue: /* CIL Label */ ;
5243                                if (i < tracksToReturn) {
5244
5245                                } else {
5246                                  goto while_14_break;
5247                                }
5248                                cdaudioDataOut->TrackData[i].Reserved = 0;
5249                                cdaudioDataOut->TrackData[i].Control = *(Toc + (i * 4UL + 12UL));
5250                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5251                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5252                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5253                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + (i * 4UL + 13UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 13UL)) & 15);
5254                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + (i * 4UL + 14UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 14UL)) & 15);
5255                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + (i * 4UL + 15UL)) & 240) >> 4) * 10 + ((int )*(Toc + (i * 4UL + 15UL)) & 15);
5256                                i += 1UL;
5257                              }
5258                              while_14_break: /* CIL Label */ ;
5259                              }
5260                              if (tracksInBuffer > tracksOnCd) {
5261                                cdaudioDataOut->TrackData[i].Reserved = 0;
5262                                cdaudioDataOut->TrackData[i].Control = 0;
5263                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5264                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5265                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5266                                cdaudioDataOut->TrackData[i].Address[1] = (((int )*(Toc + 9) & 240) >> 4) * 10 + ((int )*(Toc + 9) & 15);
5267                                cdaudioDataOut->TrackData[i].Address[2] = (((int )*(Toc + 10) & 240) >> 4) * 10 + ((int )*(Toc + 10) & 15);
5268                                cdaudioDataOut->TrackData[i].Address[3] = (((int )*(Toc + 11) & 240) >> 4) * 10 + ((int )*(Toc + 11) & 15);
5269                                i += 1UL;
5270                              } else {
5271
5272                              }
5273                              {
5274                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5275                              deviceExtension->Paused = 0;
5276                              deviceExtension->PausedM = 0;
5277                              deviceExtension->PausedS = 0;
5278                              deviceExtension->PausedF = 0;
5279                              deviceExtension->LastEndM = 0;
5280                              deviceExtension->LastEndS = 0;
5281                              deviceExtension->LastEndF = 0;
5282/*                               ExFreePool(Toc); */ /* INLINED */
5283                              }
5284                              goto switch_13_break;
5285                              switch_13_exp_27: /* CIL Label */ ;
5286                              switch_13_exp_28: /* CIL Label */ 
5287                              {
5288                              inputBuffer = Irp->AssociatedIrp.SystemBuffer;
5289                              Irp->IoStatus.Information = 0;
5290                              deviceExtension->PlayActive = 0;
5291                              srb.CdbLength = 6;
5292                              srb.TimeOutValue = 10;
5293                              cdb->CDB6GENERIC.OperationCode = 231;
5294                              status = SendSrbSynchronous(deviceExtension, & srb,
5295                                                          (void *)0, 0);
5296                              }
5297                              if (status >= 0L) {
5298                                deviceExtension->Paused = 0;
5299                                deviceExtension->PausedM = 0;
5300                                deviceExtension->PausedS = 0;
5301                                deviceExtension->PausedF = 0;
5302                                deviceExtension->LastEndM = 0;
5303                                deviceExtension->LastEndS = 0;
5304                                deviceExtension->LastEndF = 0;
5305                              } else {
5306
5307                              }
5308                              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
5309                                goto SetStatusAndReturn;
5310                              } else {
5311
5312                              }
5313                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
5314                                status = -1073741820L;
5315                                goto switch_13_break;
5316                              } else {
5317
5318                              }
5319                              {
5320                              srb.CdbLength = 10;
5321                              srb.TimeOutValue = 10;
5322                              cdb->CDB10.OperationCode = 34;
5323                              cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer->StartingM / 10 << 4) + (int )inputBuffer->StartingM % 10;
5324                              cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer->StartingS / 10 << 4) + (int )inputBuffer->StartingS % 10;
5325                              cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer->StartingF / 10 << 4) + (int )inputBuffer->StartingF % 10;
5326                              cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
5327                              cdb->CDB10.Reserved2 = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
5328                              cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
5329                              status = SendSrbSynchronous(deviceExtension, & srb,
5330                                                          (void *)0, 0);
5331                              }
5332                              if (status >= 0L) {
5333                                deviceExtension->PlayActive = 1;
5334                                deviceExtension->Paused = 0;
5335                                deviceExtension->LastEndM = ((int )inputBuffer->EndingM / 10 << 4) + (int )inputBuffer->EndingM % 10;
5336                                deviceExtension->LastEndS = ((int )inputBuffer->EndingS / 10 << 4) + (int )inputBuffer->EndingS % 10;
5337                                deviceExtension->LastEndF = ((int )inputBuffer->EndingF / 10 << 4) + (int )inputBuffer->EndingF % 10;
5338                              } else {
5339                                if (status == -1073741808L) {
5340                                  status = -1073741803L;
5341                                } else {
5342
5343                                }
5344                              }
5345                              goto switch_13_break;
5346                              switch_13_exp_29: /* CIL Label */ 
5347                              inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
5348                              Irp->IoStatus.Information = 0;
5349                              if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
5350                                status = -1073741820L;
5351                                goto switch_13_break;
5352                              } else {
5353
5354                              }
5355                              {
5356                              srb.CdbLength = 10;
5357                              srb.TimeOutValue = 10;
5358                              cdb->CDB10.OperationCode = 34;
5359                              cdb->CDB10.LogicalBlockByte0 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5360                              cdb->CDB10.LogicalBlockByte1 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5361                              cdb->CDB10.LogicalBlockByte2 = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5362                              cdb->CDB10.LogicalBlockByte3 = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5363                              cdb->CDB10.Reserved2 = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5364                              cdb->CDB10.TransferBlocksMsb = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5365                              status = SendSrbSynchronous(deviceExtension, & srb,
5366                                                          (void *)0, 0);
5367                              }
5368                              if (status >= 0L) {
5369                                deviceExtension->Paused = 1;
5370                                deviceExtension->PausedM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5371                                deviceExtension->PausedS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5372                                deviceExtension->PausedF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5373                                deviceExtension->LastEndM = ((int )inputBuffer___0->M / 10 << 4) + (int )inputBuffer___0->M % 10;
5374                                deviceExtension->LastEndS = ((int )inputBuffer___0->S / 10 << 4) + (int )inputBuffer___0->S % 10;
5375                                deviceExtension->LastEndF = ((int )inputBuffer___0->F / 10 << 4) + (int )inputBuffer___0->F % 10;
5376                              } else {
5377                                if (status == -1073741808L) {
5378                                  status = -1073741803L;
5379                                } else {
5380
5381                                }
5382                              }
5383                              goto switch_13_break;
5384                              switch_13_exp_30: /* CIL Label */ 
5385                              {
5386                              tmp___1 = ExAllocatePoolWithTag(4, 10, 541156419UL);
5387                              SubQPtr = tmp___1;
5388                              Irp->IoStatus.Information = 0;
5389                              deviceExtension->PlayActive = 0;
5390                              }
5391                              if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
5392                                status = -1073741670L;
5393                                goto SetStatusAndReturn;
5394                              } else {
5395
5396                              }
5397                              if ((int )deviceExtension->Paused == 1) {
5398                                {
5399/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5400                                status = 0L;
5401                                }
5402                                goto SetStatusAndReturn;
5403                              } else {
5404
5405                              }
5406                              {
5407                              srb.CdbLength = 6;
5408                              srb.TimeOutValue = 10;
5409                              cdb->CDB6GENERIC.OperationCode = 235;
5410                              cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10;
5411                              status = SendSrbSynchronous(deviceExtension, & srb,
5412                                                          SubQPtr, 10);
5413                              }
5414                              if (! (status >= 0L)) {
5415                                {
5416/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5417                                }
5418                                goto SetStatusAndReturn;
5419                              } else {
5420
5421                              }
5422                              {
5423                              deviceExtension->PausedM = *(SubQPtr + 7);
5424                              deviceExtension->PausedS = *(SubQPtr + 8);
5425                              deviceExtension->PausedF = *(SubQPtr + 9);
5426                              memset(cdb, 0, 12);
5427                              srb.CdbLength = 6;
5428                              srb.TimeOutValue = 10;
5429                              cdb->CDB6GENERIC.OperationCode = 231;
5430                              status = SendSrbSynchronous(deviceExtension, & srb,
5431                                                          (void *)0, 0);
5432                              }
5433                              if (! (status >= 0L)) {
5434                                {
5435/*                                 ExFreePool(SubQPtr); */ /* INLINED */
5436                                }
5437                                goto SetStatusAndReturn;
5438                              } else {
5439
5440                              }
5441                              {
5442                              deviceExtension->Paused = 1;
5443                              deviceExtension->PausedM = *(SubQPtr + 7);
5444                              deviceExtension->PausedS = *(SubQPtr + 8);
5445                              deviceExtension->PausedF = *(SubQPtr + 9);
5446/*                               ExFreePool(SubQPtr); */ /* INLINED */
5447                              }
5448                              goto switch_13_break;
5449                              switch_13_exp_31: /* CIL Label */ 
5450                              Irp->IoStatus.Information = 0;
5451                              if ((int )deviceExtension->Paused == 0) {
5452                                status = -1073741823L;
5453                                goto SetStatusAndReturn;
5454                              } else {
5455
5456                              }
5457                              {
5458                              srb.CdbLength = 10;
5459                              srb.TimeOutValue = 10;
5460                              cdb->CDB10.OperationCode = 34;
5461                              cdb->CDB10.LogicalBlockByte0 = deviceExtension->PausedM;
5462                              cdb->CDB10.LogicalBlockByte1 = deviceExtension->PausedS;
5463                              cdb->CDB10.LogicalBlockByte2 = deviceExtension->PausedF;
5464                              cdb->CDB10.LogicalBlockByte3 = deviceExtension->LastEndM;
5465                              cdb->CDB10.Reserved2 = deviceExtension->LastEndS;
5466                              cdb->CDB10.TransferBlocksMsb = deviceExtension->LastEndF;
5467                              status = SendSrbSynchronous(deviceExtension, & srb,
5468                                                          (void *)0, 0);
5469                              }
5470                              if (status >= 0L) {
5471                                deviceExtension->Paused = 0;
5472                              } else {
5473
5474                              }
5475                              goto switch_13_break;
5476                              switch_13_exp_32: /* CIL Label */ 
5477                              {
5478                              userPtr = Irp->AssociatedIrp.SystemBuffer;
5479                              tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
5480                                                              541156419UL);
5481                              SubQPtr___0 = tmp___2;
5482                              }
5483                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
5484                                status = -1073741789L;
5485                                Irp->IoStatus.Information = 0;
5486                                if (SubQPtr___0) {
5487                                  {
5488/*                                   ExFreePool(SubQPtr___0); */ /* INLINED */
5489                                  }
5490                                } else {
5491
5492                                }
5493                                goto switch_13_break;
5494                              } else {
5495
5496                              }
5497                              if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) {
5498                                {
5499                                memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
5500                                status = -1073741670L;
5501                                Irp->IoStatus.Information = 0;
5502                                }
5503                                goto SetStatusAndReturn;
5504                              } else {
5505
5506                              }
5507                              if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
5508                                {
5509/*                                 ExFreePool(SubQPtr___0); */ /* INLINED */
5510                                memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
5511                                status = -1073741823L;
5512                                Irp->IoStatus.Information = 0;
5513                                }
5514                                goto SetStatusAndReturn;
5515                              } else {
5516
5517                              }
5518                              {
5519                              srb.CdbLength = 6;
5520                              srb.TimeOutValue = 10;
5521                              cdb->CDB6GENERIC.OperationCode = 235;
5522                              cdb->CDB6GENERIC.CommandUniqueBytes[2] = 10;
5523                              status = SendSrbSynchronous(deviceExtension, & srb,
5524                                                          SubQPtr___0, 10);
5525                              }
5526                              if (status >= 0L) {
5527                                userPtr->Header.Reserved = 0;
5528                                if ((int )deviceExtension->Paused == 1) {
5529                                  deviceExtension->PlayActive = 0;
5530                                  userPtr->Header.AudioStatus = 18;
5531                                } else {
5532                                  if ((int )*(SubQPtr___0 + 0) == 1) {
5533                                    userPtr->Header.AudioStatus = 17;
5534                                  } else {
5535                                    if ((int )*(SubQPtr___0 + 0) == 0) {
5536                                      userPtr->Header.AudioStatus = 19;
5537                                      deviceExtension->PlayActive = 0;
5538                                    } else {
5539                                      deviceExtension->PlayActive = 0;
5540                                    }
5541                                  }
5542                                }
5543                                userPtr->Header.DataLength[0] = 0;
5544                                userPtr->Header.DataLength[0] = 12;
5545                                userPtr->FormatCode = 1;
5546                                userPtr->Control = *(SubQPtr___0 + 1);
5547                                userPtr->ADR = 0;
5548                                userPtr->TrackNumber = (((int )*(SubQPtr___0 + 2) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 2) & 15);
5549                                userPtr->IndexNumber = (((int )*(SubQPtr___0 + 3) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 3) & 15);
5550                                userPtr->AbsoluteAddress[0] = 0;
5551                                userPtr->AbsoluteAddress[1] = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15);
5552                                userPtr->AbsoluteAddress[2] = (((int )*(SubQPtr___0 + 8) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 8) & 15);
5553                                userPtr->AbsoluteAddress[3] = (((int )*(SubQPtr___0 + 9) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 9) & 15);
5554                                userPtr->TrackRelativeAddress[0] = 0;
5555                                userPtr->TrackRelativeAddress[1] = (((int )*(SubQPtr___0 + 4) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 4) & 15);
5556                                userPtr->TrackRelativeAddress[2] = (((int )*(SubQPtr___0 + 5) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 5) & 15);
5557                                userPtr->TrackRelativeAddress[3] = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15);
5558                                Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
5559                              } else {
5560                                Irp->IoStatus.Information = 0;
5561                              }
5562                              {
5563/*                               ExFreePool(SubQPtr___0); */ /* INLINED */
5564                              }
5565                              goto switch_13_break;
5566                              switch_13_exp_33: /* CIL Label */ 
5567                              {
5568                              Irp->IoStatus.Information = 0;
5569                              deviceExtension->PlayActive = 0;
5570                              srb.CdbLength = 6;
5571                              srb.TimeOutValue = 10;
5572                              cdb->CDB6GENERIC.OperationCode = 230;
5573                              status = SendSrbSynchronous(deviceExtension, & srb,
5574                                                          (void *)0, 0);
5575                              }
5576                              goto switch_13_break;
5577                              switch_13_exp_34: /* CIL Label */ ;
5578                              switch_13_exp_35: /* CIL Label */ ;
5579                              switch_13_exp_36: /* CIL Label */ 
5580                              Irp->IoStatus.Information = 0;
5581                              status = -1073741808L;
5582                              goto switch_13_break;
5583                              switch_13_exp_37: /* CIL Label */ 
5584                              {
5585                              CdAudioIsPlayActive(DeviceObject);
5586                              }
5587                              switch_13_default: /* CIL Label */ 
5588                              {
5589                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
5590                              }
5591                              return (tmp___3);
5592                              goto switch_13_break;
5593                            } else {
5594                              switch_13_break: /* CIL Label */ ;
5595                            }
5596                            }
5597                          }
5598                        }
5599                      }
5600                    }
5601                  }
5602                }
5603              }
5604            }
5605          }
5606        }
5607      }
5608    }
5609  }
5610  SetStatusAndReturn: 
5611  if (status == -2147483626L) {
5612    if ((int )currentIrpStack->Flags & 2) {
5613      status = -1073741435L;
5614      goto DenonRestart;
5615    } else {
5616
5617    }
5618    {
5619/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
5620    Irp->IoStatus.Information = 0;
5621    }
5622  } else {
5623
5624  }
5625  {
5626  Irp->IoStatus.__annonCompField4.Status = status;
5627  myStatus = status;
5628  IofCompleteRequest(Irp, 0);
5629  }
5630  return (status);
5631}
5632}
5633NTSTATUS CdAudioHitachiSendPauseCommand(PDEVICE_OBJECT DeviceObject ) 
5634{ PCD_DEVICE_EXTENSION deviceExtension ;
5635  SCSI_PASS_THROUGH srb ;
5636  PHITACHICDB cdb ;
5637  NTSTATUS status ;
5638  PUCHAR PausePos ;
5639  PVOID tmp ;
5640
5641  {
5642  {
5643  deviceExtension = DeviceObject->DeviceExtension;
5644  cdb = (union _HITACHICDB *)(srb.Cdb);
5645  tmp = ExAllocatePoolWithTag(4, 3, 541156419UL);
5646  PausePos = (UCHAR *)tmp;
5647  }
5648  if ((unsigned int )PausePos == (unsigned int )((void *)0)) {
5649    return (-1073741670L);
5650  } else {
5651
5652  }
5653  {
5654  memset(PausePos, 0, 3);
5655  memset(cdb, 0, 12);
5656  srb.CdbLength = 12;
5657  srb.TimeOutValue = 10;
5658  cdb->PAUSE_AUDIO.OperationCode = 225;
5659  status = SendSrbSynchronous(deviceExtension, & srb, PausePos, 3);
5660/*   ExFreePool(PausePos); */ /* INLINED */
5661  }
5662  return (status);
5663}
5664}
5665NTSTATUS CdAudioHitachiDeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
5666{ PIO_STACK_LOCATION currentIrpStack ;
5667  PCD_DEVICE_EXTENSION deviceExtension ;
5668  PCDROM_TOC cdaudioDataOut ;
5669  SCSI_PASS_THROUGH srb ;
5670  PHITACHICDB cdb ;
5671  NTSTATUS status ;
5672  ULONG i ;
5673  ULONG bytesTransfered ;
5674  PUCHAR Toc ;
5675  BOOLEAN tmp ;
5676  PVOID tmp___0 ;
5677  ULONG tracksToReturn ;
5678  ULONG tracksOnCd ;
5679  ULONG tracksInBuffer ;
5680  ULONG dataLength ;
5681  ULONG tracksToReturn___0 ;
5682  ULONG tracksOnCd___0 ;
5683  ULONG tracksInBuffer___0 ;
5684  ULONG dataLength___0 ;
5685  NTSTATUS tmp___1 ;
5686  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
5687  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
5688  PUCHAR PausePos ;
5689  PVOID tmp___2 ;
5690  PSUB_Q_CURRENT_POSITION userPtr ;
5691  PUCHAR SubQPtr ;
5692  PVOID tmp___3 ;
5693  PUCHAR EjectStatus ;
5694  PVOID tmp___4 ;
5695  NTSTATUS tmp___5 ;
5696
5697  {
5698  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
5699  deviceExtension = DeviceObject->DeviceExtension;
5700  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
5701  cdb = (union _HITACHICDB *)(srb.Cdb);
5702  HitachiRestart: 
5703  {
5704  memset(cdb, 0, 12);
5705  }
5706  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
5707    goto switch_15_exp_38;
5708  } else {
5709    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
5710      goto switch_15_exp_39;
5711    } else {
5712      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
5713        goto switch_15_exp_40;
5714      } else {
5715        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
5716          goto switch_15_exp_41;
5717        } else {
5718          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
5719            goto switch_15_exp_42;
5720          } else {
5721            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
5722              goto switch_15_exp_43;
5723            } else {
5724              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
5725                goto switch_15_exp_44;
5726              } else {
5727                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
5728                  goto switch_15_exp_45;
5729                } else {
5730                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
5731                    goto switch_15_exp_46;
5732                  } else {
5733                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
5734                      goto switch_15_exp_47;
5735                    } else {
5736                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
5737                        goto switch_15_exp_48;
5738                      } else {
5739                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
5740                          goto switch_15_exp_49;
5741                        } else {
5742                          {
5743                          goto switch_15_default;
5744                          if (0) {
5745                            switch_15_exp_38: /* CIL Label */ ;
5746                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
5747                              status = -1073741789L;
5748                              Irp->IoStatus.Information = 0;
5749                              goto switch_15_break;
5750                            } else {
5751
5752                            }
5753                            {
5754                            tmp = CdAudioIsPlayActive(DeviceObject);
5755                            }
5756                            if (tmp) {
5757                              status = -2147483631L;
5758                              Irp->IoStatus.Information = 0;
5759                              goto switch_15_break;
5760                            } else {
5761
5762                            }
5763                            {
5764                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
5765                                                            541156419UL);
5766                            Toc = (UCHAR *)tmp___0;
5767                            }
5768                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
5769                              status = -1073741670L;
5770                              Irp->IoStatus.Information = 0;
5771                              goto SetStatusAndReturn;
5772                            } else {
5773
5774                            }
5775                            {
5776                            memset(Toc, 0, sizeof(CDROM_TOC ));
5777                            srb.CdbLength = 12;
5778                            }
5779                            if ((int )deviceExtension->Active == 5) {
5780                              cdb->READ_DISC_INFO.OperationCode = 227;
5781                            } else {
5782                              cdb->READ_DISC_INFO.OperationCode = 232;
5783                            }
5784                            {
5785                            cdb->READ_DISC_INFO.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8;
5786                            cdb->READ_DISC_INFO.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U;
5787                            srb.TimeOutValue = 10;
5788                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
5789                                                        sizeof(CDROM_TOC ));
5790                            }
5791                            if (! (status >= 0L)) {
5792                              if (status != -1073741764L) {
5793                                if (status != -1073741764L) {
5794                                  {
5795/*                                   ExFreePool(Toc); */ /* INLINED */
5796                                  Irp->IoStatus.Information = 0;
5797                                  }
5798                                  goto SetStatusAndReturn;
5799                                } else {
5800
5801                                }
5802                              } else {
5803                                status = 0L;
5804                              }
5805                            } else {
5806                              status = 0L;
5807                            }
5808                            if ((int )deviceExtension->Active == 6) {
5809                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
5810                                bytesTransfered = sizeof(CDROM_TOC );
5811                              } else {
5812                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5813                              }
5814                              cdaudioDataOut->FirstTrack = *(Toc + 2);
5815                              cdaudioDataOut->LastTrack = *(Toc + 3);
5816                              tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5817                              dataLength = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd])) - 2UL;
5818                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength >> 8);
5819                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength & 255UL);
5820                              tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5821                              tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
5822                              if (tracksInBuffer < tracksOnCd) {
5823                                tracksToReturn = tracksInBuffer;
5824                              } else {
5825                                tracksToReturn = tracksOnCd;
5826                              }
5827                              i = 0;
5828                              {
5829                              while (1) {
5830                                while_16_continue: /* CIL Label */ ;
5831                                if (i < tracksToReturn) {
5832
5833                                } else {
5834                                  goto while_16_break;
5835                                }
5836                                cdaudioDataOut->TrackData[i].Reserved = 0;
5837                                cdaudioDataOut->TrackData[i].Control = (((int )*(Toc + (i * 4UL + 8UL)) & 15) << 4) | ((int )*(Toc + (i * 4UL + 8UL)) >> 4);
5838                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5839                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5840                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5841                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + (i * 4UL + 9UL));
5842                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 4UL + 10UL));
5843                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 4UL + 11UL));
5844                                i += 1UL;
5845                              }
5846                              while_16_break: /* CIL Label */ ;
5847                              }
5848                              if (tracksInBuffer > tracksOnCd) {
5849                                cdaudioDataOut->TrackData[i].Reserved = 0;
5850                                cdaudioDataOut->TrackData[i].Control = 16;
5851                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5852                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5853                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5854                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 5);
5855                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 6);
5856                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 7);
5857                                i += 1UL;
5858                              } else {
5859
5860                              }
5861                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5862                              deviceExtension->Paused = 0;
5863                              deviceExtension->PausedM = 0;
5864                              deviceExtension->PausedS = 0;
5865                              deviceExtension->PausedF = 0;
5866                              deviceExtension->LastEndM = 0;
5867                              deviceExtension->LastEndS = 0;
5868                              deviceExtension->LastEndF = 0;
5869                            } else {
5870                              if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
5871                                bytesTransfered = sizeof(CDROM_TOC );
5872                              } else {
5873                                bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
5874                              }
5875                              cdaudioDataOut->FirstTrack = *(Toc + 1);
5876                              cdaudioDataOut->LastTrack = *(Toc + 2);
5877                              tracksOnCd___0 = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
5878                              dataLength___0 = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[tracksOnCd___0])) - 2UL;
5879                              cdaudioDataOut->Length[0] = (unsigned char )(dataLength___0 >> 8);
5880                              cdaudioDataOut->Length[1] = (unsigned char )(dataLength___0 & 255UL);
5881                              tracksInBuffer___0 = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
5882                              tracksInBuffer___0 /= (ULONG )sizeof(TRACK_DATA );
5883                              if (tracksInBuffer___0 < tracksOnCd___0) {
5884                                tracksToReturn___0 = tracksInBuffer___0;
5885                              } else {
5886                                tracksToReturn___0 = tracksOnCd___0;
5887                              }
5888                              i = 0;
5889                              {
5890                              while (1) {
5891                                while_17_continue: /* CIL Label */ ;
5892                                if (i < tracksToReturn___0) {
5893
5894                                } else {
5895                                  goto while_17_break;
5896                                }
5897                                cdaudioDataOut->TrackData[i].Reserved = 0;
5898                                if ((int )*(Toc + (i * 3UL + 6UL)) & 128) {
5899                                  cdaudioDataOut->TrackData[i].Control = 4;
5900                                } else {
5901                                  cdaudioDataOut->TrackData[i].Control = 0;
5902                                }
5903                                cdaudioDataOut->TrackData[i].Adr = 0;
5904                                cdaudioDataOut->TrackData[i].TrackNumber = (unsigned char )(i + (ULONG )cdaudioDataOut->FirstTrack);
5905                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5906                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5907                                cdaudioDataOut->TrackData[i].Address[1] = (int )*(Toc + (i * 3UL + 6UL)) & 127;
5908                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + (i * 3UL + 7UL));
5909                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + (i * 3UL + 8UL));
5910                                i += 1UL;
5911                              }
5912                              while_17_break: /* CIL Label */ ;
5913                              }
5914                              if (tracksInBuffer___0 > tracksOnCd___0) {
5915                                cdaudioDataOut->TrackData[i].Reserved = 0;
5916                                cdaudioDataOut->TrackData[i].Control = 16;
5917                                cdaudioDataOut->TrackData[i].TrackNumber = 170;
5918                                cdaudioDataOut->TrackData[i].Reserved1 = 0;
5919                                cdaudioDataOut->TrackData[i].Address[0] = 0;
5920                                cdaudioDataOut->TrackData[i].Address[1] = *(Toc + 3);
5921                                cdaudioDataOut->TrackData[i].Address[2] = *(Toc + 4);
5922                                cdaudioDataOut->TrackData[i].Address[3] = *(Toc + 5);
5923                                i += 1UL;
5924                              } else {
5925
5926                              }
5927                              Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
5928                            }
5929                            {
5930/*                             ExFreePool(Toc); */ /* INLINED */
5931                            }
5932                            goto switch_15_break;
5933                            switch_15_exp_39: /* CIL Label */ 
5934                            {
5935                            deviceExtension->PlayActive = 0;
5936                            Irp->IoStatus.Information = 0;
5937                            CdAudioHitachiSendPauseCommand(DeviceObject);
5938                            deviceExtension->Paused = 0;
5939                            deviceExtension->PausedM = 0;
5940                            deviceExtension->PausedS = 0;
5941                            deviceExtension->PausedF = 0;
5942                            deviceExtension->LastEndM = 0;
5943                            deviceExtension->LastEndS = 0;
5944                            deviceExtension->LastEndF = 0;
5945                            tmp___1 = CdAudioSendToNextDriver(DeviceObject, Irp);
5946                            }
5947                            return (tmp___1);
5948                            goto switch_15_break;
5949                            switch_15_exp_40: /* CIL Label */ 
5950                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
5951                            Irp->IoStatus.Information = 0;
5952                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
5953                              status = -1073741820L;
5954                              goto switch_15_break;
5955                            } else {
5956
5957                            }
5958                            {
5959                            CdAudioHitachiSendPauseCommand(DeviceObject);
5960                            srb.CdbLength = 12;
5961                            srb.TimeOutValue = 10;
5962                            cdb->PLAY_AUDIO.OperationCode = 224;
5963                            cdb->PLAY_AUDIO.Immediate = 1;
5964                            cdb->PLAY_AUDIO.StartingM = inputBuffer->StartingM;
5965                            cdb->PLAY_AUDIO.StartingS = inputBuffer->StartingS;
5966                            cdb->PLAY_AUDIO.StartingF = inputBuffer->StartingF;
5967                            cdb->PLAY_AUDIO.EndingM = inputBuffer->EndingM;
5968                            cdb->PLAY_AUDIO.EndingS = inputBuffer->EndingS;
5969                            cdb->PLAY_AUDIO.EndingF = inputBuffer->EndingF;
5970                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
5971                                                        0);
5972                            }
5973                            if (status >= 0L) {
5974                              deviceExtension->PlayActive = 1;
5975                              deviceExtension->Paused = 0;
5976                              deviceExtension->PausedM = inputBuffer->StartingM;
5977                              deviceExtension->PausedS = inputBuffer->StartingS;
5978                              deviceExtension->PausedF = inputBuffer->StartingF;
5979                              deviceExtension->LastEndM = inputBuffer->EndingM;
5980                              deviceExtension->LastEndS = inputBuffer->EndingS;
5981                              deviceExtension->LastEndF = inputBuffer->EndingF;
5982                            } else {
5983
5984                            }
5985                            goto switch_15_break;
5986                            switch_15_exp_41: /* CIL Label */ 
5987                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
5988                            Irp->IoStatus.Information = 0;
5989                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
5990                              status = -1073741820L;
5991                              goto switch_15_break;
5992                            } else {
5993
5994                            }
5995                            {
5996                            CdAudioHitachiSendPauseCommand(DeviceObject);
5997                            srb.CdbLength = 12;
5998                            srb.TimeOutValue = 10;
5999                            cdb->PLAY_AUDIO.OperationCode = 224;
6000                            cdb->PLAY_AUDIO.Immediate = 1;
6001                            cdb->PLAY_AUDIO.StartingM = inputBuffer___0->M;
6002                            cdb->PLAY_AUDIO.StartingS = inputBuffer___0->S;
6003                            cdb->PLAY_AUDIO.StartingF = inputBuffer___0->F;
6004                            cdb->PLAY_AUDIO.EndingM = inputBuffer___0->M;
6005                            cdb->PLAY_AUDIO.EndingS = inputBuffer___0->S;
6006                            cdb->PLAY_AUDIO.EndingF = inputBuffer___0->F;
6007                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6008                                                        0);
6009                            }
6010                            if (status >= 0L) {
6011                              deviceExtension->PausedM = inputBuffer___0->M;
6012                              deviceExtension->PausedS = inputBuffer___0->S;
6013                              deviceExtension->PausedF = inputBuffer___0->F;
6014                              deviceExtension->LastEndM = inputBuffer___0->M;
6015                              deviceExtension->LastEndS = inputBuffer___0->S;
6016                              deviceExtension->LastEndF = inputBuffer___0->F;
6017                            } else {
6018
6019                            }
6020                            goto switch_15_break;
6021                            switch_15_exp_42: /* CIL Label */ 
6022                            {
6023                            tmp___2 = ExAllocatePoolWithTag(4, 3, 541156419UL);
6024                            PausePos = tmp___2;
6025                            Irp->IoStatus.Information = 0;
6026                            }
6027                            if ((unsigned int )PausePos == (unsigned int )((void *)0)) {
6028                              status = -1073741670L;
6029                              goto SetStatusAndReturn;
6030                            } else {
6031
6032                            }
6033                            {
6034                            deviceExtension->PlayActive = 0;
6035                            memset(PausePos, 0, 3);
6036                            srb.CdbLength = 12;
6037                            srb.TimeOutValue = 10;
6038                            cdb->PAUSE_AUDIO.OperationCode = 225;
6039                            status = SendSrbSynchronous(deviceExtension, & srb, PausePos,
6040                                                        3);
6041                            deviceExtension->Paused = 1;
6042                            deviceExtension->PausedM = *(PausePos + 0);
6043                            deviceExtension->PausedS = *(PausePos + 1);
6044                            deviceExtension->PausedF = *(PausePos + 2);
6045/*                             ExFreePool(PausePos); */ /* INLINED */
6046                            }
6047                            goto switch_15_break;
6048                            switch_15_exp_43: /* CIL Label */ 
6049                            {
6050                            Irp->IoStatus.Information = 0;
6051                            CdAudioHitachiSendPauseCommand(DeviceObject);
6052                            srb.CdbLength = 12;
6053                            srb.TimeOutValue = 10;
6054                            cdb->PLAY_AUDIO.OperationCode = 224;
6055                            cdb->PLAY_AUDIO.Immediate = 1;
6056                            cdb->PLAY_AUDIO.StartingM = deviceExtension->PausedM;
6057                            cdb->PLAY_AUDIO.StartingS = deviceExtension->PausedS;
6058                            cdb->PLAY_AUDIO.StartingF = deviceExtension->PausedF;
6059                            cdb->PLAY_AUDIO.EndingM = deviceExtension->LastEndM;
6060                            cdb->PLAY_AUDIO.EndingS = deviceExtension->LastEndS;
6061                            cdb->PLAY_AUDIO.EndingF = deviceExtension->LastEndF;
6062                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6063                                                        0);
6064                            }
6065                            if (status >= 0L) {
6066                              deviceExtension->Paused = 0;
6067                            } else {
6068
6069                            }
6070                            goto switch_15_break;
6071                            switch_15_exp_44: /* CIL Label */ 
6072                            {
6073                            userPtr = Irp->AssociatedIrp.SystemBuffer;
6074                            tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
6075                                                            541156419UL);
6076                            SubQPtr = tmp___3;
6077                            }
6078                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
6079                              status = -1073741789L;
6080                              Irp->IoStatus.Information = 0;
6081                              if (SubQPtr) {
6082                                {
6083/*                                 ExFreePool(SubQPtr); */ /* INLINED */
6084                                }
6085                              } else {
6086
6087                              }
6088                              goto switch_15_break;
6089                            } else {
6090
6091                            }
6092                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
6093                              status = -1073741670L;
6094                              Irp->IoStatus.Information = 0;
6095                              goto SetStatusAndReturn;
6096                            } else {
6097
6098                            }
6099                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
6100                              {
6101/*                               ExFreePool(SubQPtr); */ /* INLINED */
6102                              status = -1073741823L;
6103                              Irp->IoStatus.Information = 0;
6104                              }
6105                              goto SetStatusAndReturn;
6106                            } else {
6107
6108                            }
6109                            srb.CdbLength = 12;
6110                            srb.TimeOutValue = 10;
6111                            cdb->AUDIO_STATUS.OperationCode = 229;
6112                            Retry: 
6113                            {
6114                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
6115                                                        sizeof(SUB_Q_CHANNEL_DATA ));
6116                            }
6117                            if (status >= 0L) {
6118                              goto _L;
6119                            } else {
6120                              if (status == -1073741764L) {
6121                                _L: /* CIL Label */ 
6122                                if (((int )*(SubQPtr + 1) & 15) != 1) {
6123                                  goto Retry;
6124                                } else {
6125
6126                                }
6127                                userPtr->Header.Reserved = 0;
6128                                if ((int )deviceExtension->Paused == 1) {
6129                                  deviceExtension->PlayActive = 0;
6130                                  userPtr->Header.AudioStatus = 18;
6131                                } else {
6132                                  if ((int )*(SubQPtr + 0) == 1) {
6133                                    userPtr->Header.AudioStatus = 17;
6134                                  } else {
6135                                    if ((int )*(SubQPtr + 0) == 0) {
6136                                      userPtr->Header.AudioStatus = 19;
6137                                      deviceExtension->PlayActive = 0;
6138                                    } else {
6139                                      deviceExtension->PlayActive = 0;
6140                                    }
6141                                  }
6142                                }
6143                                userPtr->Header.DataLength[0] = 0;
6144                                userPtr->Header.DataLength[0] = 12;
6145                                userPtr->FormatCode = 1;
6146                                userPtr->Control = ((int )*(SubQPtr + 1) & 240) >> 4;
6147                                userPtr->ADR = (int )*(SubQPtr + 1) & 15;
6148                                userPtr->TrackNumber = *(SubQPtr + 2);
6149                                userPtr->IndexNumber = *(SubQPtr + 3);
6150                                userPtr->AbsoluteAddress[0] = 0;
6151                                userPtr->AbsoluteAddress[1] = *(SubQPtr + 8);
6152                                userPtr->AbsoluteAddress[2] = *(SubQPtr + 9);
6153                                userPtr->AbsoluteAddress[3] = *(SubQPtr + 10);
6154                                userPtr->TrackRelativeAddress[0] = 0;
6155                                userPtr->TrackRelativeAddress[1] = *(SubQPtr + 4);
6156                                userPtr->TrackRelativeAddress[2] = *(SubQPtr + 5);
6157                                userPtr->TrackRelativeAddress[3] = *(SubQPtr + 6);
6158                                Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
6159                                status = 0L;
6160                              } else {
6161                                Irp->IoStatus.Information = 0;
6162                              }
6163                            }
6164                            {
6165/*                             ExFreePool(SubQPtr); */ /* INLINED */
6166                            }
6167                            goto switch_15_break;
6168                            switch_15_exp_45: /* CIL Label */ 
6169                            {
6170                            tmp___4 = ExAllocatePoolWithTag(4, 1, 541156419UL);
6171                            EjectStatus = tmp___4;
6172                            Irp->IoStatus.Information = 0;
6173                            }
6174                            if ((unsigned int )EjectStatus == (unsigned int )((void *)0)) {
6175                              status = -1073741670L;
6176                              goto SetStatusAndReturn;
6177                            } else {
6178
6179                            }
6180                            {
6181                            deviceExtension->PlayActive = 0;
6182                            srb.CdbLength = 12;
6183                            srb.TimeOutValue = 10;
6184                            cdb->EJECT.OperationCode = 228;
6185                            cdb->EJECT.Eject = 1;
6186                            status = SendSrbSynchronous(deviceExtension, & srb, EjectStatus,
6187                                                        1);
6188                            }
6189                            if (status >= 0L) {
6190                              deviceExtension->Paused = 0;
6191                              deviceExtension->PausedM = 0;
6192                              deviceExtension->PausedS = 0;
6193                              deviceExtension->PausedF = 0;
6194                              deviceExtension->LastEndM = 0;
6195                              deviceExtension->LastEndS = 0;
6196                              deviceExtension->LastEndF = 0;
6197                            } else {
6198
6199                            }
6200                            {
6201/*                             ExFreePool(EjectStatus); */ /* INLINED */
6202                            }
6203                            goto switch_15_break;
6204                            switch_15_exp_46: /* CIL Label */ ;
6205                            switch_15_exp_47: /* CIL Label */ ;
6206                            switch_15_exp_48: /* CIL Label */ 
6207                            Irp->IoStatus.Information = 0;
6208                            status = -1073741808L;
6209                            goto switch_15_break;
6210                            switch_15_exp_49: /* CIL Label */ 
6211                            {
6212                            CdAudioIsPlayActive(DeviceObject);
6213                            }
6214                            switch_15_default: /* CIL Label */ 
6215                            {
6216                            tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp);
6217                            }
6218                            return (tmp___5);
6219                            goto switch_15_break;
6220                          } else {
6221                            switch_15_break: /* CIL Label */ ;
6222                          }
6223                          }
6224                        }
6225                      }
6226                    }
6227                  }
6228                }
6229              }
6230            }
6231          }
6232        }
6233      }
6234    }
6235  }
6236  SetStatusAndReturn: 
6237  if (status == -2147483626L) {
6238    if ((int )currentIrpStack->Flags & 2) {
6239      status = -1073741435L;
6240      goto HitachiRestart;
6241    } else {
6242
6243    }
6244    {
6245/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
6246    Irp->IoStatus.Information = 0;
6247    }
6248  } else {
6249
6250  }
6251  {
6252  Irp->IoStatus.__annonCompField4.Status = status;
6253  myStatus = status;
6254  IofCompleteRequest(Irp, 0);
6255  }
6256  return (status);
6257}
6258}
6259NTSTATUS CdAudio535DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
6260{ PIO_STACK_LOCATION currentIrpStack ;
6261  PCD_DEVICE_EXTENSION deviceExtension ;
6262  PCDROM_TOC cdaudioDataOut ;
6263  SCSI_PASS_THROUGH srb ;
6264  PREAD_CAPACITY_DATA lastSession ;
6265  PCDB cdb ;
6266  NTSTATUS status ;
6267  ULONG i ;
6268  ULONG bytesTransfered ;
6269  PUCHAR Toc ;
6270  ULONG destblock ;
6271  BOOLEAN tmp ;
6272  PVOID tmp___0 ;
6273  BOOLEAN tmp___1 ;
6274  PVOID tmp___2 ;
6275  ULONG tracksToReturn ;
6276  ULONG tracksOnCd ;
6277  ULONG tracksInBuffer ;
6278  PSUB_Q_CURRENT_POSITION userPtr ;
6279  PUCHAR SubQPtr ;
6280  PVOID tmp___3 ;
6281  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
6282  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
6283  NTSTATUS tmp___4 ;
6284
6285  {
6286  {
6287  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
6288  deviceExtension = DeviceObject->DeviceExtension;
6289  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
6290  cdb = (union _CDB *)(srb.Cdb);
6291  memset(cdb, 0, 12);
6292  }
6293  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (14 << 2))) {
6294    goto switch_18_exp_50;
6295  } else {
6296    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
6297      goto switch_18_exp_51;
6298    } else {
6299      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
6300        goto switch_18_exp_52;
6301      } else {
6302        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
6303          goto switch_18_exp_53;
6304        } else {
6305          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
6306            goto switch_18_exp_54;
6307          } else {
6308            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
6309              goto switch_18_exp_55;
6310            } else {
6311              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
6312                goto switch_18_exp_56;
6313              } else {
6314                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
6315                  goto switch_18_exp_57;
6316                } else {
6317                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
6318                    goto switch_18_exp_58;
6319                  } else {
6320                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
6321                      goto switch_18_exp_59;
6322                    } else {
6323                      {
6324                      goto switch_18_default;
6325                      if (0) {
6326                        switch_18_exp_50: /* CIL Label */ 
6327                        {
6328                        tmp = CdAudioIsPlayActive(DeviceObject);
6329                        }
6330                        if (tmp) {
6331                          status = -2147483631L;
6332                          Irp->IoStatus.Information = 0;
6333                          goto switch_18_break;
6334                        } else {
6335
6336                        }
6337                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[1]))) {
6338                          status = -1073741789L;
6339                          Irp->IoStatus.Information = 0;
6340                          goto switch_18_break;
6341                        } else {
6342
6343                        }
6344                        {
6345                        tmp___0 = ExAllocatePoolWithTag(4, sizeof(READ_CAPACITY_DATA ),
6346                                                        541156419UL);
6347                        lastSession = tmp___0;
6348                        }
6349                        if ((unsigned int )lastSession == (unsigned int )((void *)0)) {
6350                          status = -1073741670L;
6351                          Irp->IoStatus.Information = 0;
6352                          goto SetStatusAndReturn;
6353                        } else {
6354
6355                        }
6356                        {
6357                        memset(lastSession, 0, sizeof(READ_CAPACITY_DATA ));
6358                        srb.CdbLength = 10;
6359                        cdb->CDB10.OperationCode = 38;
6360                        srb.TimeOutValue = 10;
6361                        status = SendSrbSynchronous(deviceExtension, & srb, lastSession,
6362                                                    sizeof(READ_CAPACITY_DATA ));
6363                        }
6364                        if (! (status >= 0L)) {
6365                          {
6366/*                           ExFreePool(lastSession); */ /* INLINED */
6367                          Irp->IoStatus.Information = 0;
6368                          }
6369                          goto SetStatusAndReturn;
6370                        } else {
6371                          status = 0L;
6372                        }
6373                        {
6374                        bytesTransfered = (long )(& ((CDROM_TOC *)0)->TrackData[1]);
6375                        Irp->IoStatus.Information = bytesTransfered;
6376                        memset(cdaudioDataOut, 0, bytesTransfered);
6377                        cdaudioDataOut->Length[0] = (unsigned char )((bytesTransfered - 2UL) >> 8);
6378                        cdaudioDataOut->Length[1] = (unsigned char )((bytesTransfered - 2UL) & 255UL);
6379                        }
6380                        if (lastSession->LogicalBlockAddress == 0UL) {
6381                          {
6382/*                           ExFreePool(lastSession); */ /* INLINED */
6383                          }
6384                          goto switch_18_break;
6385                        } else {
6386
6387                        }
6388                        {
6389                        cdaudioDataOut->FirstTrack = 1;
6390                        cdaudioDataOut->LastTrack = 2;
6391                        *((ULONG *)(& cdaudioDataOut->TrackData[0].Address[0])) = lastSession->LogicalBlockAddress;
6392/*                         ExFreePool(lastSession); */ /* INLINED */
6393                        }
6394                        goto switch_18_break;
6395                        switch_18_exp_51: /* CIL Label */ ;
6396                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
6397                          status = -1073741789L;
6398                          Irp->IoStatus.Information = 0;
6399                          goto switch_18_break;
6400                        } else {
6401
6402                        }
6403                        {
6404                        tmp___1 = CdAudioIsPlayActive(DeviceObject);
6405                        }
6406                        if (tmp___1) {
6407                          status = -2147483631L;
6408                          Irp->IoStatus.Information = 0;
6409                          goto switch_18_break;
6410                        } else {
6411
6412                        }
6413                        {
6414                        tmp___2 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ), 541156419UL);
6415                        Toc = (UCHAR *)tmp___2;
6416                        }
6417                        if ((unsigned int )Toc == (unsigned int )((void *)0)) {
6418                          status = -1073741670L;
6419                          Irp->IoStatus.Information = 0;
6420                          goto SetStatusAndReturn;
6421                        } else {
6422
6423                        }
6424                        {
6425                        memset(Toc, 0, sizeof(CDROM_TOC ));
6426                        cdb->CDB10.OperationCode = 67;
6427                        cdb->CDB10.Reserved1 = 1;
6428                        cdb->CDB10.TransferBlocksMsb = sizeof(CDROM_TOC ) >> 8;
6429                        cdb->CDB10.TransferBlocksLsb = sizeof(CDROM_TOC ) & 255U;
6430                        srb.TimeOutValue = 10;
6431                        srb.CdbLength = 10;
6432                        status = SendSrbSynchronous(deviceExtension, & srb, Toc, sizeof(CDROM_TOC ));
6433                        }
6434                        if (! (status >= 0L)) {
6435                          if (status != -1073741764L) {
6436                            if (status != -1073741764L) {
6437                              {
6438/*                               ExFreePool(Toc); */ /* INLINED */
6439                              Irp->IoStatus.Information = 0;
6440                              }
6441                              goto SetStatusAndReturn;
6442                            } else {
6443
6444                            }
6445                          } else {
6446                            status = 0L;
6447                          }
6448                        } else {
6449                          status = 0L;
6450                        }
6451                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
6452                          bytesTransfered = sizeof(CDROM_TOC );
6453                        } else {
6454                          bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
6455                        }
6456                        cdaudioDataOut->Length[0] = *(Toc + 0);
6457                        cdaudioDataOut->Length[1] = *(Toc + 1);
6458                        cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
6459                        cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
6460                        tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
6461                        tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
6462                        tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
6463                        if (tracksInBuffer < tracksOnCd) {
6464                          tracksToReturn = tracksInBuffer;
6465                        } else {
6466                          tracksToReturn = tracksOnCd;
6467                        }
6468                        i = 0;
6469                        {
6470                        while (1) {
6471                          while_19_continue: /* CIL Label */ ;
6472                          if (i < tracksToReturn) {
6473
6474                          } else {
6475                            goto while_19_break;
6476                          }
6477                          cdaudioDataOut->TrackData[i].Reserved = 0;
6478                          cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6479                          cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15);
6480                          cdaudioDataOut->TrackData[i].Reserved1 = 0;
6481                          cdaudioDataOut->TrackData[i].Address[0] = 0;
6482                          cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6483                          cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6484                          cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6485                          i += 1UL;
6486                        }
6487                        while_19_break: /* CIL Label */ ;
6488                        }
6489                        if (tracksInBuffer > tracksOnCd) {
6490                          cdaudioDataOut->TrackData[i].Reserved = 0;
6491                          cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6492                          cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL));
6493                          cdaudioDataOut->TrackData[i].Reserved1 = 0;
6494                          cdaudioDataOut->TrackData[i].Address[0] = 0;
6495                          cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6496                          cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6497                          cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6498                          i += 1UL;
6499                        } else {
6500
6501                        }
6502                        {
6503                        Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
6504/*                         ExFreePool(Toc); */ /* INLINED */
6505                        }
6506                        goto switch_18_break;
6507                        switch_18_exp_52: /* CIL Label */ 
6508                        {
6509                        userPtr = Irp->AssociatedIrp.SystemBuffer;
6510                        tmp___3 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CURRENT_POSITION ),
6511                                                        541156419UL);
6512                        SubQPtr = tmp___3;
6513                        }
6514                        if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
6515                          status = -1073741789L;
6516                          Irp->IoStatus.Information = 0;
6517                          if (SubQPtr) {
6518                            {
6519/*                             ExFreePool(SubQPtr); */ /* INLINED */
6520                            }
6521                          } else {
6522
6523                          }
6524                          goto switch_18_break;
6525                        } else {
6526
6527                        }
6528                        if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
6529                          {
6530                          memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
6531                          status = -1073741670L;
6532                          Irp->IoStatus.Information = 0;
6533                          }
6534                          goto SetStatusAndReturn;
6535                        } else {
6536
6537                        }
6538                        if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
6539                          {
6540/*                           ExFreePool(SubQPtr); */ /* INLINED */
6541                          memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
6542                          status = -1073741823L;
6543                          Irp->IoStatus.Information = 0;
6544                          }
6545                          goto SetStatusAndReturn;
6546                        } else {
6547
6548                        }
6549                        {
6550                        srb.CdbLength = 10;
6551                        srb.TimeOutValue = 10;
6552                        cdb->SUBCHANNEL.OperationCode = 66;
6553                        cdb->SUBCHANNEL.Msf = 1;
6554                        cdb->SUBCHANNEL.SubQ = 1;
6555                        cdb->SUBCHANNEL.Format = 1;
6556                        cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CURRENT_POSITION );
6557                        status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
6558                                                    sizeof(SUB_Q_CURRENT_POSITION ));
6559                        }
6560                        if (status >= 0L) {
6561                          if ((int )*(SubQPtr + 1) == 17) {
6562                            deviceExtension->PlayActive = 1;
6563                          } else {
6564                            deviceExtension->PlayActive = 0;
6565                          }
6566                          userPtr->Header.Reserved = 0;
6567                          userPtr->Header.AudioStatus = *(SubQPtr + 1);
6568                          userPtr->Header.DataLength[0] = 0;
6569                          userPtr->Header.DataLength[1] = 12;
6570                          userPtr->FormatCode = 1;
6571                          userPtr->Control = *(SubQPtr + 5);
6572                          userPtr->ADR = 0;
6573                          userPtr->TrackNumber = (((int )*(SubQPtr + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr + 6) & 15);
6574                          userPtr->IndexNumber = (((int )*(SubQPtr + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr + 7) & 15);
6575                          userPtr->AbsoluteAddress[0] = 0;
6576                          userPtr->AbsoluteAddress[1] = *(SubQPtr + 9);
6577                          userPtr->AbsoluteAddress[2] = *(SubQPtr + 10);
6578                          userPtr->AbsoluteAddress[3] = *(SubQPtr + 11);
6579                          userPtr->TrackRelativeAddress[0] = 0;
6580                          userPtr->TrackRelativeAddress[1] = *(SubQPtr + 13);
6581                          userPtr->TrackRelativeAddress[2] = *(SubQPtr + 14);
6582                          userPtr->TrackRelativeAddress[3] = *(SubQPtr + 15);
6583                          Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
6584                        } else {
6585                          Irp->IoStatus.Information = 0;
6586                        }
6587                        {
6588/*                         ExFreePool(SubQPtr); */ /* INLINED */
6589                        }
6590                        goto switch_18_break;
6591                        switch_18_exp_53: /* CIL Label */ 
6592                        inputBuffer = Irp->AssociatedIrp.SystemBuffer;
6593                        Irp->IoStatus.Information = 0;
6594                        if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
6595                          status = -1073741820L;
6596                          goto switch_18_break;
6597                        } else {
6598
6599                        }
6600                        if ((int )inputBuffer->StartingM == (int )inputBuffer->EndingM) {
6601                          if ((int )inputBuffer->StartingS == (int )inputBuffer->EndingS) {
6602                            if ((int )inputBuffer->StartingF == (int )inputBuffer->EndingF) {
6603                              cdb->PAUSE_RESUME.OperationCode = 75;
6604                              cdb->PAUSE_RESUME.Action = 0;
6605                            } else {
6606                              goto _L___0;
6607                            }
6608                          } else {
6609                            goto _L___0;
6610                          }
6611                        } else {
6612                          _L___0: /* CIL Label */ 
6613                          cdb->PLAY_AUDIO_MSF.OperationCode = 71;
6614                          cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM;
6615                          cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS;
6616                          cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF;
6617                          cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM;
6618                          cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS;
6619                          cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF;
6620                        }
6621                        {
6622                        srb.CdbLength = 10;
6623                        srb.TimeOutValue = 10;
6624                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6625                                                    0);
6626                        }
6627                        if (status >= 0L) {
6628                          if ((int )cdb->PLAY_AUDIO_MSF.OperationCode == 71) {
6629                            deviceExtension->PlayActive = 1;
6630                          } else {
6631
6632                          }
6633                        } else {
6634
6635                        }
6636                        goto switch_18_break;
6637                        switch_18_exp_54: /* CIL Label */ 
6638                        inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
6639                        Irp->IoStatus.Information = 0;
6640                        if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
6641                          status = -1073741820L;
6642                          goto switch_18_break;
6643                        } else {
6644
6645                        }
6646                        {
6647                        destblock = (((unsigned long )inputBuffer___0->M * 60UL + (unsigned long )inputBuffer___0->S) * 75UL + (unsigned long )inputBuffer___0->F) - 150UL;
6648                        srb.CdbLength = 10;
6649                        srb.TimeOutValue = 10;
6650                        cdb->SEEK.OperationCode = 43;
6651                        cdb->SEEK.LogicalBlockAddress[0] = (int )((unsigned char )(destblock >> 24)) & 255;
6652                        cdb->SEEK.LogicalBlockAddress[1] = (int )((unsigned char )(destblock >> 16)) & 255;
6653                        cdb->SEEK.LogicalBlockAddress[2] = (int )((unsigned char )(destblock >> 8)) & 255;
6654                        cdb->SEEK.LogicalBlockAddress[3] = (unsigned char )(destblock & 255UL);
6655                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6656                                                    0);
6657                        }
6658                        if (! (status >= 0L)) {
6659
6660                        } else {
6661
6662                        }
6663                        goto switch_18_break;
6664                        switch_18_exp_55: /* CIL Label */ 
6665                        {
6666                        Irp->IoStatus.Information = 0;
6667                        deviceExtension->PlayActive = 0;
6668                        srb.CdbLength = 10;
6669                        srb.TimeOutValue = 10;
6670                        cdb->CDB10.OperationCode = 192;
6671                        status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6672                                                    0);
6673                        }
6674                        goto switch_18_break;
6675                        switch_18_exp_56: /* CIL Label */ ;
6676                        switch_18_exp_57: /* CIL Label */ ;
6677                        switch_18_exp_58: /* CIL Label */ 
6678                        Irp->IoStatus.Information = 0;
6679                        status = -1073741808L;
6680                        goto switch_18_break;
6681                        switch_18_exp_59: /* CIL Label */ 
6682                        {
6683                        CdAudioIsPlayActive(DeviceObject);
6684                        }
6685                        switch_18_default: /* CIL Label */ 
6686                        {
6687                        tmp___4 = CdAudioSendToNextDriver(DeviceObject, Irp);
6688                        }
6689                        return (tmp___4);
6690                        goto switch_18_break;
6691                      } else {
6692                        switch_18_break: /* CIL Label */ ;
6693                      }
6694                      }
6695                    }
6696                  }
6697                }
6698              }
6699            }
6700          }
6701        }
6702      }
6703    }
6704  }
6705  SetStatusAndReturn: 
6706  if (status == -2147483626L) {
6707    {
6708/*     IoSetHardErrorOrVerifyDevice(Irp, deviceExtension->TargetDeviceObject); */ /* INLINED */
6709    Irp->IoStatus.Information = 0;
6710    }
6711  } else {
6712
6713  }
6714  {
6715  Irp->IoStatus.__annonCompField4.Status = status;
6716  myStatus = status;
6717  IofCompleteRequest(Irp, 0);
6718  }
6719  return (status);
6720}
6721}
6722NTSTATUS CdAudio435DeviceControl(PDEVICE_OBJECT DeviceObject , PIRP Irp ) 
6723{ PIO_STACK_LOCATION currentIrpStack ;
6724  PCD_DEVICE_EXTENSION deviceExtension ;
6725  PCDROM_TOC cdaudioDataOut ;
6726  SCSI_PASS_THROUGH srb ;
6727  PCDB cdb ;
6728  NTSTATUS status ;
6729  ULONG i ;
6730  ULONG bytesTransfered ;
6731  PUCHAR Toc ;
6732  BOOLEAN tmp ;
6733  PVOID tmp___0 ;
6734  ULONG tracksToReturn ;
6735  ULONG tracksOnCd ;
6736  ULONG tracksInBuffer ;
6737  PCDROM_PLAY_AUDIO_MSF inputBuffer ;
6738  PCDROM_SEEK_AUDIO_MSF inputBuffer___0 ;
6739  PUCHAR SubQPtr ;
6740  PVOID tmp___1 ;
6741  PSUB_Q_CURRENT_POSITION userPtr ;
6742  PUCHAR SubQPtr___0 ;
6743  PVOID tmp___2 ;
6744  NTSTATUS tmp___3 ;
6745  BOOLEAN tmp___4 ;
6746  NTSTATUS tmp___5 ;
6747
6748  {
6749  {
6750  currentIrpStack = Irp->Tail.Overlay.__annonCompField17.__annonCompField16.CurrentStackLocation;
6751  deviceExtension = DeviceObject->DeviceExtension;
6752  cdaudioDataOut = Irp->AssociatedIrp.SystemBuffer;
6753  cdb = (union _CDB *)(srb.Cdb);
6754  memset(cdb, 0, 12);
6755  }
6756  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == ((2 << 16) | (1 << 14))) {
6757    goto switch_20_exp_60;
6758  } else {
6759    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (6 << 2))) {
6760      goto switch_20_exp_61;
6761    } else {
6762      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (2 << 2))) {
6763        goto switch_20_exp_62;
6764      } else {
6765        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (1 << 2))) {
6766          goto switch_20_exp_63;
6767        } else {
6768          if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (3 << 2))) {
6769            goto switch_20_exp_64;
6770          } else {
6771            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (4 << 2))) {
6772              goto switch_20_exp_65;
6773            } else {
6774              if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (11 << 2))) {
6775                goto switch_20_exp_66;
6776              } else {
6777                if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (514 << 2))) {
6778                  goto switch_20_exp_67;
6779                } else {
6780                  if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (13 << 2))) {
6781                    goto switch_20_exp_68;
6782                  } else {
6783                    if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (5 << 2))) {
6784                      goto switch_20_exp_69;
6785                    } else {
6786                      if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (10 << 2))) {
6787                        goto switch_20_exp_70;
6788                      } else {
6789                        if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (((2 << 16) | (1 << 14)) | (512 << 2))) {
6790                          goto switch_20_exp_71;
6791                        } else {
6792                          {
6793                          goto switch_20_default;
6794                          if (0) {
6795                            switch_20_exp_60: /* CIL Label */ ;
6796                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]))) {
6797                              status = -1073741789L;
6798                              Irp->IoStatus.Information = 0;
6799                              goto switch_20_break;
6800                            } else {
6801
6802                            }
6803                            {
6804                            tmp = CdAudioIsPlayActive(DeviceObject);
6805                            }
6806                            if (tmp) {
6807                              status = -2147483631L;
6808                              Irp->IoStatus.Information = 0;
6809                              goto switch_20_break;
6810                            } else {
6811
6812                            }
6813                            {
6814                            tmp___0 = ExAllocatePoolWithTag(4, sizeof(CDROM_TOC ),
6815                                                            541156419UL);
6816                            Toc = (UCHAR *)tmp___0;
6817                            }
6818                            if ((unsigned int )Toc == (unsigned int )((void *)0)) {
6819                              status = -1073741670L;
6820                              Irp->IoStatus.Information = 0;
6821                              goto SetStatusAndReturn;
6822                            } else {
6823
6824                            }
6825                            {
6826                            memset(Toc, 0, sizeof(CDROM_TOC ));
6827                            cdb->READ_TOC.OperationCode = 67;
6828                            cdb->READ_TOC.Msf = 1;
6829                            cdb->READ_TOC.AllocationLength[0] = sizeof(CDROM_TOC ) >> 8;
6830                            cdb->READ_TOC.AllocationLength[1] = sizeof(CDROM_TOC ) & 255U;
6831                            srb.TimeOutValue = 10;
6832                            srb.CdbLength = 10;
6833                            status = SendSrbSynchronous(deviceExtension, & srb, Toc,
6834                                                        sizeof(CDROM_TOC ));
6835                            }
6836                            if (! (status >= 0L)) {
6837                              if (status != -1073741764L) {
6838                                if (status != -1073741764L) {
6839                                  {
6840/*                                   ExFreePool(Toc); */ /* INLINED */
6841                                  Irp->IoStatus.Information = 0;
6842                                  }
6843                                  goto SetStatusAndReturn;
6844                                } else {
6845
6846                                }
6847                              } else {
6848                                status = 0L;
6849                              }
6850                            } else {
6851                              status = 0L;
6852                            }
6853                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength > (ULONG )sizeof(CDROM_TOC )) {
6854                              bytesTransfered = sizeof(CDROM_TOC );
6855                            } else {
6856                              bytesTransfered = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength;
6857                            }
6858                            cdaudioDataOut->Length[0] = *(Toc + 0);
6859                            cdaudioDataOut->Length[1] = *(Toc + 1);
6860                            cdaudioDataOut->FirstTrack = (((int )*(Toc + 2) & 240) >> 4) * 10 + ((int )*(Toc + 2) & 15);
6861                            cdaudioDataOut->LastTrack = (((int )*(Toc + 3) & 240) >> 4) * 10 + ((int )*(Toc + 3) & 15);
6862                            tracksOnCd = ((int )cdaudioDataOut->LastTrack - (int )cdaudioDataOut->FirstTrack) + 1;
6863                            tracksInBuffer = currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength - (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[0]));
6864                            tracksInBuffer /= (ULONG )sizeof(TRACK_DATA );
6865                            if (tracksInBuffer < tracksOnCd) {
6866                              tracksToReturn = tracksInBuffer;
6867                            } else {
6868                              tracksToReturn = tracksOnCd;
6869                            }
6870                            i = 0;
6871                            {
6872                            while (1) {
6873                              while_21_continue: /* CIL Label */ ;
6874                              if (i < tracksToReturn) {
6875
6876                              } else {
6877                                goto while_21_break;
6878                              }
6879                              cdaudioDataOut->TrackData[i].Reserved = 0;
6880                              cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6881                              cdaudioDataOut->TrackData[i].TrackNumber = (((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 240) >> 4) * 10 + ((int )*(Toc + ((i * 8UL + 4UL) + 2UL)) & 15);
6882                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
6883                              cdaudioDataOut->TrackData[i].Address[0] = 0;
6884                              cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6885                              cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6886                              cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6887                              i += 1UL;
6888                            }
6889                            while_21_break: /* CIL Label */ ;
6890                            }
6891                            if (tracksInBuffer > tracksOnCd) {
6892                              cdaudioDataOut->TrackData[i].Reserved = 0;
6893                              cdaudioDataOut->TrackData[i].Control = *(Toc + ((i * 8UL + 4UL) + 1UL));
6894                              cdaudioDataOut->TrackData[i].TrackNumber = *(Toc + ((i * 8UL + 4UL) + 2UL));
6895                              cdaudioDataOut->TrackData[i].Reserved1 = 0;
6896                              cdaudioDataOut->TrackData[i].Address[0] = 0;
6897                              cdaudioDataOut->TrackData[i].Address[1] = *(Toc + ((i * 8UL + 4UL) + 5UL));
6898                              cdaudioDataOut->TrackData[i].Address[2] = *(Toc + ((i * 8UL + 4UL) + 6UL));
6899                              cdaudioDataOut->TrackData[i].Address[3] = *(Toc + ((i * 8UL + 4UL) + 7UL));
6900                              i += 1UL;
6901                            } else {
6902
6903                            }
6904                            {
6905                            Irp->IoStatus.Information = (unsigned long )((long )(& ((CDROM_TOC *)0)->TrackData[i]));
6906                            deviceExtension->Paused = 0;
6907                            deviceExtension->PausedM = 0;
6908                            deviceExtension->PausedS = 0;
6909                            deviceExtension->PausedF = 0;
6910                            deviceExtension->LastEndM = 0;
6911                            deviceExtension->LastEndS = 0;
6912                            deviceExtension->LastEndF = 0;
6913/*                             ExFreePool(Toc); */ /* INLINED */
6914                            }
6915                            goto switch_20_break;
6916                            switch_20_exp_61: /* CIL Label */ ;
6917                            switch_20_exp_62: /* CIL Label */ 
6918                            {
6919                            inputBuffer = Irp->AssociatedIrp.SystemBuffer;
6920                            Irp->IoStatus.Information = 0;
6921                            srb.CdbLength = 10;
6922                            srb.TimeOutValue = 10;
6923                            cdb->CDB10.OperationCode = 198;
6924                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6925                                                        0);
6926                            }
6927                            if (status >= 0L) {
6928                              deviceExtension->PlayActive = 0;
6929                              deviceExtension->Paused = 0;
6930                              deviceExtension->PausedM = 0;
6931                              deviceExtension->PausedS = 0;
6932                              deviceExtension->PausedF = 0;
6933                              deviceExtension->LastEndM = 0;
6934                              deviceExtension->LastEndS = 0;
6935                              deviceExtension->LastEndF = 0;
6936                            } else {
6937
6938                            }
6939                            if (currentIrpStack->Parameters.DeviceIoControl.IoControlCode == (ULONG )(((2 << 16) | (1 << 14)) | (2 << 2))) {
6940                              goto SetStatusAndReturn;
6941                            } else {
6942
6943                            }
6944                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_PLAY_AUDIO_MSF )) {
6945                              status = -1073741820L;
6946                              goto switch_20_break;
6947                            } else {
6948
6949                            }
6950                            {
6951                            srb.CdbLength = 10;
6952                            srb.TimeOutValue = 10;
6953                            cdb->PLAY_AUDIO_MSF.OperationCode = 71;
6954                            cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer->StartingM;
6955                            cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer->StartingS;
6956                            cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer->StartingF;
6957                            cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer->EndingM;
6958                            cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer->EndingS;
6959                            cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer->EndingF;
6960                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6961                                                        0);
6962                            }
6963                            if (status >= 0L) {
6964                              deviceExtension->PlayActive = 1;
6965                              deviceExtension->Paused = 0;
6966                              deviceExtension->LastEndM = inputBuffer->EndingM;
6967                              deviceExtension->LastEndS = inputBuffer->EndingS;
6968                              deviceExtension->LastEndF = inputBuffer->EndingF;
6969                            } else {
6970
6971                            }
6972                            goto switch_20_break;
6973                            switch_20_exp_63: /* CIL Label */ 
6974                            inputBuffer___0 = Irp->AssociatedIrp.SystemBuffer;
6975                            Irp->IoStatus.Information = 0;
6976                            if (currentIrpStack->Parameters.DeviceIoControl.InputBufferLength < (ULONG )sizeof(CDROM_SEEK_AUDIO_MSF )) {
6977                              status = -1073741820L;
6978                              goto switch_20_break;
6979                            } else {
6980
6981                            }
6982                            {
6983                            srb.CdbLength = 10;
6984                            srb.TimeOutValue = 10;
6985                            cdb->CDB10.OperationCode = 71;
6986                            cdb->PLAY_AUDIO_MSF.StartingM = inputBuffer___0->M;
6987                            cdb->PLAY_AUDIO_MSF.StartingS = inputBuffer___0->S;
6988                            cdb->PLAY_AUDIO_MSF.StartingF = inputBuffer___0->F;
6989                            cdb->PLAY_AUDIO_MSF.EndingM = inputBuffer___0->M;
6990                            cdb->PLAY_AUDIO_MSF.EndingS = inputBuffer___0->S;
6991                            cdb->PLAY_AUDIO_MSF.EndingF = inputBuffer___0->F;
6992                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
6993                                                        0);
6994                            }
6995                            if (status >= 0L) {
6996                              deviceExtension->Paused = 1;
6997                              deviceExtension->PausedM = inputBuffer___0->M;
6998                              deviceExtension->PausedS = inputBuffer___0->S;
6999                              deviceExtension->PausedF = inputBuffer___0->F;
7000                              deviceExtension->LastEndM = inputBuffer___0->M;
7001                              deviceExtension->LastEndS = inputBuffer___0->S;
7002                              deviceExtension->LastEndF = inputBuffer___0->F;
7003                            } else {
7004                              if (status == -1073741808L) {
7005                                status = -1073741803L;
7006                              } else {
7007
7008                              }
7009                            }
7010                            goto switch_20_break;
7011                            switch_20_exp_64: /* CIL Label */ 
7012                            {
7013                            tmp___1 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
7014                                                            541156419UL);
7015                            SubQPtr = tmp___1;
7016                            Irp->IoStatus.Information = 0;
7017                            }
7018                            if ((unsigned int )SubQPtr == (unsigned int )((void *)0)) {
7019                              status = -1073741670L;
7020                              goto SetStatusAndReturn;
7021                            } else {
7022
7023                            }
7024                            if ((int )deviceExtension->Paused == 1) {
7025                              {
7026/*                               ExFreePool(SubQPtr); */ /* INLINED */
7027                              status = 0L;
7028                              }
7029                              goto SetStatusAndReturn;
7030                            } else {
7031
7032                            }
7033                            {
7034                            srb.CdbLength = 10;
7035                            srb.TimeOutValue = 10;
7036                            cdb->SUBCHANNEL.OperationCode = 66;
7037                            cdb->SUBCHANNEL.Msf = 1;
7038                            cdb->SUBCHANNEL.SubQ = 1;
7039                            cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA );
7040                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr,
7041                                                        sizeof(SUB_Q_CHANNEL_DATA ));
7042                            }
7043                            if (! (status >= 0L)) {
7044                              {
7045/*                               ExFreePool(SubQPtr); */ /* INLINED */
7046                              }
7047                              goto SetStatusAndReturn;
7048                            } else {
7049
7050                            }
7051                            {
7052                            deviceExtension->PausedM = *(SubQPtr + 9);
7053                            deviceExtension->PausedS = *(SubQPtr + 10);
7054                            deviceExtension->PausedF = *(SubQPtr + 11);
7055                            memset(cdb, 0, 12);
7056                            srb.CdbLength = 10;
7057                            srb.TimeOutValue = 10;
7058                            cdb->CDB10.OperationCode = 198;
7059                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7060                                                        0);
7061                            }
7062                            if (! (status >= 0L)) {
7063                              {
7064/*                               ExFreePool(SubQPtr); */ /* INLINED */
7065                              }
7066                              goto SetStatusAndReturn;
7067                            } else {
7068
7069                            }
7070                            {
7071                            deviceExtension->PlayActive = 0;
7072                            deviceExtension->Paused = 1;
7073                            deviceExtension->PausedM = *(SubQPtr + 9);
7074                            deviceExtension->PausedS = *(SubQPtr + 10);
7075                            deviceExtension->PausedF = *(SubQPtr + 11);
7076/*                             ExFreePool(SubQPtr); */ /* INLINED */
7077                            }
7078                            goto switch_20_break;
7079                            switch_20_exp_65: /* CIL Label */ 
7080                            Irp->IoStatus.Information = 0;
7081                            if ((int )deviceExtension->Paused == 0) {
7082                              status = -1073741823L;
7083                              goto SetStatusAndReturn;
7084                            } else {
7085
7086                            }
7087                            {
7088                            srb.CdbLength = 10;
7089                            srb.TimeOutValue = 10;
7090                            cdb->PLAY_AUDIO_MSF.OperationCode = 71;
7091                            cdb->PLAY_AUDIO_MSF.StartingM = deviceExtension->PausedM;
7092                            cdb->PLAY_AUDIO_MSF.StartingS = deviceExtension->PausedS;
7093                            cdb->PLAY_AUDIO_MSF.StartingF = deviceExtension->PausedF;
7094                            cdb->PLAY_AUDIO_MSF.EndingM = deviceExtension->LastEndM;
7095                            cdb->PLAY_AUDIO_MSF.EndingS = deviceExtension->LastEndS;
7096                            cdb->PLAY_AUDIO_MSF.EndingF = deviceExtension->LastEndF;
7097                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7098                                                        0);
7099                            }
7100                            if (status >= 0L) {
7101                              deviceExtension->PlayActive = 1;
7102                              deviceExtension->Paused = 0;
7103                            } else {
7104
7105                            }
7106                            goto switch_20_break;
7107                            switch_20_exp_66: /* CIL Label */ 
7108                            {
7109                            userPtr = Irp->AssociatedIrp.SystemBuffer;
7110                            tmp___2 = ExAllocatePoolWithTag(4, sizeof(SUB_Q_CHANNEL_DATA ),
7111                                                            541156419UL);
7112                            SubQPtr___0 = tmp___2;
7113                            }
7114                            if (currentIrpStack->Parameters.DeviceIoControl.OutputBufferLength < (ULONG )sizeof(SUB_Q_CURRENT_POSITION )) {
7115                              status = -1073741789L;
7116                              Irp->IoStatus.Information = 0;
7117                              if (SubQPtr___0) {
7118                                {
7119/*                                 ExFreePool(SubQPtr___0); */ /* INLINED */
7120                                }
7121                              } else {
7122
7123                              }
7124                              goto switch_20_break;
7125                            } else {
7126
7127                            }
7128                            if ((unsigned int )SubQPtr___0 == (unsigned int )((void *)0)) {
7129                              {
7130                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
7131                              status = -1073741670L;
7132                              Irp->IoStatus.Information = 0;
7133                              }
7134                              goto SetStatusAndReturn;
7135                            } else {
7136
7137                            }
7138                            if ((int )((struct _CDROM_SUB_Q_DATA_FORMAT *)userPtr)->Format != 1) {
7139                              {
7140/*                               ExFreePool(SubQPtr___0); */ /* INLINED */
7141                              memset(userPtr, 0, sizeof(SUB_Q_CURRENT_POSITION ));
7142                              status = -1073741823L;
7143                              Irp->IoStatus.Information = 0;
7144                              }
7145                              goto SetStatusAndReturn;
7146                            } else {
7147
7148                            }
7149                            {
7150                            srb.CdbLength = 10;
7151                            srb.TimeOutValue = 10;
7152                            cdb->SUBCHANNEL.OperationCode = 66;
7153                            cdb->SUBCHANNEL.Msf = 1;
7154                            cdb->SUBCHANNEL.SubQ = 1;
7155                            cdb->SUBCHANNEL.AllocationLength[1] = sizeof(SUB_Q_CHANNEL_DATA );
7156                            status = SendSrbSynchronous(deviceExtension, & srb, SubQPtr___0,
7157                                                        sizeof(SUB_Q_CHANNEL_DATA ));
7158                            }
7159                            if (status >= 0L) {
7160                              userPtr->Header.Reserved = 0;
7161                              if ((int )deviceExtension->Paused == 1) {
7162                                deviceExtension->PlayActive = 0;
7163                                userPtr->Header.AudioStatus = 18;
7164                              } else {
7165                                if ((int )*(SubQPtr___0 + 1) == 17) {
7166                                  deviceExtension->PlayActive = 1;
7167                                  userPtr->Header.AudioStatus = 17;
7168                                } else {
7169                                  deviceExtension->PlayActive = 0;
7170                                  userPtr->Header.AudioStatus = 19;
7171                                }
7172                              }
7173                              userPtr->Header.DataLength[0] = 0;
7174                              userPtr->Header.DataLength[1] = 12;
7175                              userPtr->FormatCode = 1;
7176                              userPtr->Control = *(SubQPtr___0 + 5);
7177                              userPtr->ADR = 0;
7178                              userPtr->TrackNumber = (((int )*(SubQPtr___0 + 6) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 6) & 15);
7179                              userPtr->IndexNumber = (((int )*(SubQPtr___0 + 7) & 240) >> 4) * 10 + ((int )*(SubQPtr___0 + 7) & 15);
7180                              userPtr->AbsoluteAddress[0] = 0;
7181                              userPtr->AbsoluteAddress[1] = *(SubQPtr___0 + 9);
7182                              userPtr->AbsoluteAddress[2] = *(SubQPtr___0 + 10);
7183                              userPtr->AbsoluteAddress[3] = *(SubQPtr___0 + 11);
7184                              userPtr->TrackRelativeAddress[0] = 0;
7185                              userPtr->TrackRelativeAddress[1] = *(SubQPtr___0 + 13);
7186                              userPtr->TrackRelativeAddress[2] = *(SubQPtr___0 + 14);
7187                              userPtr->TrackRelativeAddress[3] = *(SubQPtr___0 + 15);
7188                              Irp->IoStatus.Information = sizeof(SUB_Q_CURRENT_POSITION );
7189                            } else {
7190                              Irp->IoStatus.Information = 0;
7191                            }
7192                            {
7193/*                             ExFreePool(SubQPtr___0); */ /* INLINED */
7194                            }
7195                            goto switch_20_break;
7196                            switch_20_exp_67: /* CIL Label */ 
7197                            {
7198                            Irp->IoStatus.Information = 0;
7199                            srb.CdbLength = 10;
7200                            srb.TimeOutValue = 10;
7201                            cdb->CDB10.OperationCode = 192;
7202                            status = SendSrbSynchronous(deviceExtension, & srb, (void *)0,
7203                                                        0);
7204                            deviceExtension->Paused = 0;
7205                            deviceExtension->PausedM = 0;
7206                            deviceExtension->PausedS = 0;
7207                            deviceExtension->PausedF = 0;
7208                            deviceExtension->LastEndM = 0;
7209                            deviceExtension->LastEndS = 0;
7210                            deviceExtension->LastEndF = 0;
7211                            }
7212                            goto switch_20_break;
7213                            switch_20_exp_68: /* CIL Label */ ;
7214                            switch_20_exp_69: /* CIL Label */ ;
7215                            switch_20_exp_70: /* CIL Label */ 
7216                            Irp->IoStatus.Information = 0;
7217                            status = -1073741808L;
7218                            goto switch_20_break;
7219                            switch_20_exp_71: /* CIL Label */ 
7220                            {
7221                            tmp___4 = CdAudioIsPlayActive(DeviceObject);
7222                            }
7223                            if ((int )tmp___4 == 1) {
7224                              deviceExtension->PlayActive = 1;
7225                              status = 0L;
7226                              Irp->IoStatus.Information = 0;
7227                              goto SetStatusAndReturn;
7228                            } else {
7229                              {
7230                              deviceExtension->PlayActive = 0;
7231                              tmp___3 = CdAudioSendToNextDriver(DeviceObject, Irp);
7232                              }
7233                              return (tmp___3);
7234                            }
7235                            goto switch_20_break;
7236                            switch_20_default: /* CIL Label */ 
7237                            {
7238                            tmp___5 = CdAudioSendToNextDriver(DeviceObject, Irp);
7239                            }
7240                            return (tmp___5);
7241                            goto switch_20_break;
7242                          } else {