ReactOS 0.4.15-dev-5667-ged97270
cdrom.h
Go to the documentation of this file.
1/*++
2
3Copyright (C) Microsoft Corporation. All rights reserved.
4
5Module Name:
6
7 cdrom.h
8
9Abstract:
10
11 Main header file for cdrom.sys.
12 This contains structure and function declarations as well as constant values.
13
14Author:
15
16Environment:
17
18 kernel mode only
19
20Notes:
21
22
23Revision History:
24
25--*/
26
27#ifndef __CDROM_H__
28#define __CDROM_H__
29
30#pragma warning(push)
31#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union
32#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int
33#pragma warning(disable:4152) // nonstandard extension, function/data pointer conversion in expression
34
35#include "wdf.h"
36#include "ntddmmc.h"
37#include "ntddcdvd.h"
38#include "ntddcdrm.h"
39#include "ntdddisk.h"
40#include "ntddtape.h"
41#include "ntddscsi.h"
42#include "ntddvol.h"
43#include "specstrings.h"
44#include "cdromp.h"
45
46// Set component ID for DbgPrintEx calls
47#ifndef DEBUG_COMP_ID
48 #define DEBUG_COMP_ID DPFLTR_CDROM_ID
49#endif
50
51// Include initguid.h so GUID_CONSOLE_DISPLAY_STATE is declared
52#include <initguid.h>
53
54// Include header file and setup GUID for tracing
55#include <storswtr.h>
56#define WPP_GUID_CDROM (A4196372, C3C4, 42d5, 87BF, 7EDB2E9BCC27)
57#ifndef WPP_CONTROL_GUIDS
58 #define WPP_CONTROL_GUIDS WPP_CONTROL_GUIDS_NORMAL_FLAGS(WPP_GUID_CDROM)
59#endif
60
61#ifdef __REACTOS__
62#include <pseh/pseh2.h>
63#endif
64
65#ifdef __REACTOS__
66#undef MdlMappingNoExecute
67#define MdlMappingNoExecute 0
68#define NonPagedPoolNx NonPagedPool
69#define NonPagedPoolNxCacheAligned NonPagedPoolCacheAligned
70#undef POOL_NX_ALLOCATION
71#define POOL_NX_ALLOCATION 0
72#endif
73
74// This prototype is needed because, although NTIFS.H is now shipping with
75// the WDK, can't include both it and the other headers we already use.
79NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
82 );
83
84//
85//
87
88#define CDROM_HACK_DEC_RRD (0x00000001)
89#define CDROM_HACK_FUJITSU_FMCD_10x (0x00000002)
90//#define CDROM_HACK_HITACHI_1750 (0x00000004) -- obsolete
91#define CDROM_HACK_HITACHI_GD_2000 (0x00000008)
92#define CDROM_HACK_TOSHIBA_SD_W1101 (0x00000010)
93//#define CDROM_HACK_TOSHIBA_XM_3xx (0x00000020) -- obsolete
94//#define CDROM_HACK_NEC_CDDA (0x00000040) -- obsolete
95//#define CDROM_HACK_PLEXTOR_CDDA (0x00000080) -- obsolete
96#define CDROM_HACK_BAD_GET_CONFIG_SUPPORT (0x00000100)
97//#define CDROM_HACK_FORCE_READ_CD_DETECTION (0x00000200) -- obsolete
98//#define CDROM_HACK_READ_CD_SUPPORTED (0x00000400) -- obsolete
99#define CDROM_HACK_BAD_TYPE_ONE_GET_CONFIG (0x00000800)
100#define CDROM_HACK_BAD_VENDOR_PROFILES (0x00001000)
101#define CDROM_HACK_MSFT_VIRTUAL_ODD (0x00002000)
102#define CDROM_HACK_LOCKED_PAGES (0x80000000) // not a valid flag to save
103
104#define CDROM_HACK_VALID_FLAGS (0x00003fff)
105#define CDROM_HACK_INVALID_FLAGS (~CDROM_HACK_VALID_FLAGS)
106
107
108// A 64k buffer to be written takes the following amount of time:
109// 1x CD == 75 sectors/sec == 0.4266667 seconds == 4266667 100ns units
110// 4x CD == 300 sectors/sec == 0.1066667 seconds == 1066667 100ns units
111// 10x CD == 300 sectors/sec == 0.0426667 seconds == 426667 100ns units
112// 1x DVD == 676 sectors/sec == 0.0473373 seconds == 473373 100ns units
113// 16x DVD == 10,816 sectors/sec == 0.0029586 seconds == 29586 100ns units
114// 1x HDDVD == 2,230 sectors/sec == 0.0143498 seconds == 143498 100ns units
115#define WRITE_RETRY_DELAY_CD_1x ((LONGLONG)4266667)
116#define WRITE_RETRY_DELAY_CD_4x ((LONGLONG)1066667)
117#define WRITE_RETRY_DELAY_CD_10x ((LONGLONG) 426667)
118#define WRITE_RETRY_DELAY_DVD_1x ((LONGLONG) 473373)
119#define WRITE_RETRY_DELAY_DVD_4x ((LONGLONG) 118343)
120#define WRITE_RETRY_DELAY_DVD_16x ((LONGLONG) 29586)
121#define WRITE_RETRY_DELAY_HDDVD_1x ((LONGLONG) 143498)
122
123//
124#define MAXIMUM_RETRIES 4
125
126#define CDROM_GET_CONFIGURATION_TIMEOUT (0x4)
127#define CDROM_READ_DISC_INFORMATION_TIMEOUT (0x4)
128#define CDROM_TEST_UNIT_READY_TIMEOUT (0x14)
129#define CDROM_GET_PERFORMANCE_TIMEOUT (0x14)
130#define CDROM_READ_CAPACITY_TIMEOUT (0x14)
131
132#define START_UNIT_TIMEOUT (60 * 4)
133
134// Used to detect the loss of the autorun irp.
135#define MEDIA_CHANGE_TIMEOUT_TIME 300
136
137// Indicates whether is is safe to send StartUnit commands
138// to this device. It will only be off for some removeable devices.
139#define DEV_SAFE_START_UNIT 0x00000004
140
141// Indicates that the device is connected to a backup power supply
142// and hence write-through and synch cache requests may be ignored
143#define DEV_POWER_PROTECTED 0x00000010
144
145// The following CDROM_SPECIAL_ flags are set in ScanForSpecialFlags
146// in the Device Extension
147
148// Never Spin Up/Down the drive (may not handle properly)
149#define CDROM_SPECIAL_DISABLE_SPIN_DOWN 0x00000001
150//#define CDROM_SPECIAL_DISABLE_SPIN_UP 0x00000002
151
152// Don't bother to lock the queue when powering down
153// (used mostly to send a quick stop to a cdrom to abort audio playback)
154//#define CDROM_SPECIAL_NO_QUEUE_LOCK 0x00000008
155
156// Disable write cache due to known bugs
157#define CDROM_SPECIAL_DISABLE_WRITE_CACHE 0x00000010
158
159// Used to indicate that this request shouldn't invoke any power type operations
160// like spinning up the drive.
161
162#define SRB_CLASS_FLAGS_LOW_PRIORITY 0x10000000
163
164// Used to indicate that an SRB is the result of a paging operation.
165#define SRB_CLASS_FLAGS_PAGING 0x40000000
166
167typedef struct _ERROR_RECOVERY_DATA {
172
173// A compile-time check of the 30,000 limit not overflowing ULONG size...
174// Note that it is not expected that a release (FRE) driver will normally
175// have such a large history, instead using the compression function.
176#define CDROM_INTERPRET_SENSE_INFO2_MAXIMUM_HISTORY_COUNT 30000
177C_ASSERT( (MAXULONG - sizeof(SRB_HISTORY)) / 30000 >= sizeof(SRB_HISTORY_ITEM) );
178
179// Intended to reuse a defined IOCTL code that not seen in Optical stack and does not require input parameter.
180// This fake IOCTL is used used for MCN process sync-ed with serial queue.
181#define IOCTL_MCN_SYNC_FAKE_IOCTL IOCTL_DISK_UPDATE_DRIVE_SIZE
182
183/*++////////////////////////////////////////////////////////////////////////////
184
185PCDROM_ERROR_HANDLER()
186
187Routine Description:
188
189 This routine is a callback into the driver to handle errors. The queue
190 shall not be unfrozen when this error handler is called, even though the
191 SRB flags may mark the queue as having been frozen due to this SRB.
192
193Irql:
194
195 This routine will be called at KIRQL <= DISPATCH_LEVEL
196
197Arguments:
198
199 DeviceObject is the device object the error occurred on.
200
201 Srb is the Srb that was being processed when the error occurred.
202
203 Status may be overwritten by the routine if it decides that the error
204 was benign, or otherwise wishes to change the returned status code
205 for this command
206
207 Retry may be overwritten to specify that this command should or should
208 not be retried (if the callee supports retrying commands)
209
210Return Value:
211
212 status
213
214--*/
215struct _CDROM_DEVICE_EXTENSION; // *PCDROM_DEVICE_EXTENSION;
216typedef struct _CDROM_DEVICE_EXTENSION
219
220typedef
223 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
227 );
228
229// CdRom driver extension
234
236
237#define CDROM_FLAG_WINPE_MODE 0x00000001
238
240
241#define CdromMmcUpdateComplete 0
242#define CdromMmcUpdateRequired 1
243#define CdromMmcUpdateStarted 2
244
245typedef struct _CDROM_MMC_EXTENSION {
246
247 BOOLEAN IsMmc; // mmc device
248 BOOLEAN IsAACS; // aacs compatible device
249 BOOLEAN IsWriter; // the drive is a writer or not
250 BOOLEAN WriteAllowed; // currently allow write request or not
251
252 BOOLEAN IsCssDvd; // A CSS protected DVD or CPPM-protected DVDAudio media in Drive.
253 BOOLEAN StreamingReadSupported; // the drive supports streaming for reads
254 BOOLEAN StreamingWriteSupported; // the drive supports streaming for writes
255
257
258 // The feature number defines the level and form of
259 // validation that needs to be performed on Io requests
262
268 PGET_CONFIGURATION_HEADER CapabilitiesBuffer;
271
274
276
278
279 // Information about the data that we need to read/write
287
288 // A pointer to the SRB history item to be filled upon completion
290
292
293// Many commands get double-buffered. Since the max
294// transfer size is typically 64k, most of these requests
295// can be handled with a single pre-allocated buffer.
297
298 _Field_range_(4*1024, 64*1024) ULONG ScratchBufferSize; // 0x1000..0x10000 (4k..64k)
299 _Field_size_bytes_(ScratchBufferSize) PVOID ScratchBuffer; // used to get data for clients
300
301 PMDL ScratchBufferMdl; // used to get data for clients
302
303 WDFREQUEST ScratchRequest;
307
308 // This MDL is used to performed the request whose required transfer size is bigger than adaptor's max.
311
312 // For debugging, set/clear this field when using the scratch buffer/request
316
317 // Stuff for asynchronous retrying of the transfer.
319
320 // Read Write context
322
324
325// Context structure for the IOCTL work item
327
328 WDFREQUEST OriginalRequest;
329
331
332// Context structure for the read/write work item
334
335 WDFREQUEST OriginalRequest;
336
338
339typedef struct _CDROM_DATA {
340
342
343 // hack flags for ScanForSpecial routines
345
346 // the error handling routines need to be per-device, not per-driver....
348
349 // Indicates whether an audio play operation is currently being performed.
350 // Only thing this does is prevent reads and toc requests while playing audio.
352
353 // indicate we need to pick a default dvd region for the user if we can
355
356 // The well known name link for this device.
358
359 // We need to distinguish between the two...
362
363 // Indicates that this is a DEC RRD cdrom.
364 // This drive requires software to fix responses from the faulty firmware
366
367 // Storage for the error recovery page. This is used as the method
368 // to switch block sizes for some drive-specific error recovery routines.
369 // ERROR_RECOVERY_DATA recoveryData; //obsolete along with error process for TOSHIBA_XM_3xx
370
371 // Indicates that the device is in exclusive mode and only
372 // the requests from the exclusive owner will be processed.
373 WDFFILEOBJECT ExclusiveOwner;
374
375 // Caller name of the owner, if the device is in exclusive mode.
377
378 // Indicates that the device speed should be set to
379 // default value on the next media change.
381
382 // How long to wait between retries if a READ/WRITE irp
383 // gets a LWIP (2/4/7, 2/4/8)?
385
386 // Cached Device Type information. Maybe FILE_DEVICE_CD_ROM or FILE_DEVICE_DVD
387 // CommonExtension.DevInfo->DeviceType maybe FILE_DEVICE_CD_ROM when this field is FILE_DEVICE_DVD
389
390 _Field_size_bytes_(CachedInquiryDataByteCount)
391 PINQUIRYDATA CachedInquiryData;
393
395
396
397typedef struct _CDROM_POWER_OPTIONS {
404
405// this is a private enum, but must be kept here
406// to properly compile size of CDROM_DEVICE_EXTENSION
407typedef enum {
416
417// this is a private enum, but must be kept here
418// to properly compile size of CDROM_DEVICE_EXTENSION
419typedef enum {
426
427// this is a private structure, but must be kept here
428// to properly compile size of CDROM_DEVICE_EXTENSION
429typedef struct _CDROM_POWER_CONTEXT {
430
432
434 LARGE_INTEGER Step1CompleteTime; // for SYNC CACHE in power down case
436
437 union {
439 CDROM_POWER_UP_STATE PowerUp; // currently not used.
440 } PowerChangeState;
441
443
444 WDFREQUEST PowerRequest;
445
448
451
453
454// device extension structure
456
457 // Version control field
459
460 // structure size
462
463 // the structure is fully ready to use
465
466 // the device is active
468
469 // the device is surprise removed.
471
472 // Back pointer to device object
473 WDFDEVICE Device;
474
475 // Save IoTarget here, do not retrieve anytime.
476 WDFIOTARGET IoTarget;
477
478 // Additional WDF queue for serial I/O processing
480
481 // A separate queue for all the create file requests in sync with device
482 // removal
483 WDFQUEUE CreateQueue;
484
485 //Main timer of driver, will do Mcn work. (once per second)
486 WDFTIMER MainTimer;
487
488 // Pointer to the initialization data for this driver. This is more
489 // efficient than constantly getting the driver extension.
491
492 // WDM device information
494
495 // Pointer to the physical device object we attached to
497
498 // FILE_DEVICE_CD_ROM -- 2
500
501 // The name of the object
503
504 // System device number
506
507 // Values for the flags are below.
509
510 // Flags for special behaviour required by different hardware,
511 // such as never spinning down or disabling advanced features such as write cache
513
514 // Add default Srb Flags.
516
517 // Request timeout in seconds;
519
520 //The SCSI address of the device.
522
523 // Buffer for drive parameters returned in IO device control.
525
526 // Log2 of sector size
528
529 // Length of partition in bytes
531
532 // Number of bytes before start of partition
534
535 // Interface name string returned by IoRegisterDeviceInterface.
537
538 // Device capabilities
540
541 // SCSI port driver capabilities
543
544 // Device power properties
546
547 // Request Sense Buffer
549
550 // Total number of SCSI protocol errors on the device.
552
553 // Lock count for removable media.
557
560
561 // Indicates that the necessary data structures for media change
562 // detection have been initialized.
564
565 // Contains necessary data structures for ZPODD support.
567
568 // File system context. Used for kernel-mode requests to disable autorun.
570
571 // Count of media changes. This field is only valid for the root partition
572 // (ie. if PhysicalDevice == NULL).
574
575 // Storage for a release queue request.
579 WDFMEMORY ReleaseQueueInputMemory; //This is a wrapper of ReleaseQueueSrb
582
583 // Context structure for power operations. Since we can only have
584 // one D irp at any time in the stack we don't need to worry about
585 // allocating multiple of these structures.
588
589#if (NTDDI_VERSION >= NTDDI_WIN8)
592#endif
593
594 // Lock for Shutdown/Flush operations that need to stop/start the queue
596
597 // device specific data area
599
600 // scratch buffer related fields.
602
603 // Hold new private data that only classpnp should modify
604 // in this structure.
606
607 // Work item for async reads and writes and its context
608 WDFWORKITEM ReadWriteWorkItem;
610
611 // Auxiliary WDF object for processing ioctl requests that need to go down
612 // to the port driver.
613 WDFWORKITEM IoctlWorkItem;
615
617
619
620// a type definition for functions to be called after synchronization
621typedef
624 _In_ WDFDEVICE Device,
625 _In_ WDFREQUEST Request
626 );
627
629
632
633 WDFREQUEST OriginalRequest;
634
638
639
641
642 // Used to send down an incoming IOCTL in the original context
646
647 //
648 // Used for READ/WRITE requests.
649 // The reason why kernel primitives are used for the spinlock and
650 // the timer instead of WDF object is there is a race condition
651 // between the cancel callback and the timer routine.
652 // Because of this, the timer and the spin lock need to be associated
653 // per request rather than using shared memory in the device extension
654 // and it is possible for the WDF object initialization to fail whereas
655 // the kernel primitives initialize provided memory. Initializing the
656 // kernel primitives will never fail. Since READ/WRITE is a critical
657 // code path, it is not desired for READs or WRITEs to fail due to
658 // an allocation failure that can be avoided and because it is not
659 // uncommon to see a failure during a READ or WRITE that may not
660 // occur upon a retry.
661 //
667
669
671
672// Define context structure for asynchronous completions.
674 WDFDEVICE Device;
677
678
679//
680#define SCSI_CDROM_TIMEOUT 10
681#define SCSI_CHANGER_BONUS_TIMEOUT 10
682
683//
684// This value is used as the upper limit for all commands CDROM sends down
685// to device, unless the default timeout value is overriden by registry value
686// "TimeOutValue" and it is larger than this value.
687//
688#define SCSI_CDROM_OPC_TIMEOUT 260
689
690#define HITACHI_MODE_DATA_SIZE 12
691#define MODE_DATA_SIZE 64
692
693#define RAW_SECTOR_SIZE 2352
694#define COOKED_SECTOR_SIZE 2048
695
696#define CDROM_SRB_LIST_SIZE 4
697
698#define PLAY_ACTIVE(x) (x->DeviceAdditionalData.PlayActive)
699
700#define MSF_TO_LBA(Minutes,Seconds,Frames) \
701 (ULONG)((60 * 75 * (Minutes)) + (75 * (Seconds)) + ((Frames) - 150))
702
703// Sector types for READ_CD
704
705#define ANY_SECTOR 0
706#define CD_DA_SECTOR 1
707#define YELLOW_MODE1_SECTOR 2
708#define YELLOW_MODE2_SECTOR 3
709#define FORM2_MODE1_SECTOR 4
710#define FORM2_MODE2_SECTOR 5
711
712#define MAX_COPY_PROTECT_AGID 4
713
714#ifdef ExAllocatePool
715 #undef ExAllocatePool
716 #define ExAllocatePool #assert(FALSE)
717#endif
718
719// memory allocation tags
720// Sc?? - Mass storage driver tags
721// ScC<number> - Class driver misc allocations
722// ScC? - CdRom
723
724#define CDROM_TAG_AUTORUN_DISABLE 'ACcS' // "ScCA" - Autorun disable functionality
725#define CDROM_TAG_MEDIA_CHANGE_DETECTION 'aCcS' // "ScCa" - Media change detection
726
727#define CDROM_TAG_SCRATCH 'BCcS' // "ScSB" - Scratch buffer (usually 64k)
728#define CDROM_TAG_GET_CONFIG 'CCcS' // "ScCC" - Ioctl GET_CONFIGURATION
729#define CDROM_TAG_COMPLETION_CONTEXT 'cCcS' // "ScCc" - Context of completion routine
730#define CDROM_TAG_DESCRIPTOR 'DCcS' // "ScCD" - Adaptor & Device descriptor buffer
731#define CDROM_TAG_DISC_INFO 'dCcS' // "ScCd" - Disc information
732#define CDROM_TAG_SYNC_EVENT 'eCcS' // "ScCe" - Request sync event
733#define CDROM_TAG_FEATURE 'FCcS' // "ScCF" - Feature descriptor
734#define CDROM_TAG_GESN 'GCcS' // "ScCG" - GESN buffer
735#define CDROM_TAG_SENSE_INFO 'ICcS' // "ScCI" - Sense info buffers
736#define CDROM_TAG_INQUIRY 'iCcS' // "ScCi" - Cached inquiry buffer
737#define CDROM_TAG_MODE_DATA 'MCcS' // "ScCM" - Mode data buffer
738#define CDROM_TAG_STREAM 'OCCS' // "SCCO" - Set stream buffer
739#define CDROM_TAG_NOTIFICATION 'oCcS' // "ScCo" - Device Notification buffer
740#define CDROM_TAG_PLAY_ACTIVE 'pCcS' // "ScCp" - Play active checks
741#define CDROM_TAG_REGISTRY 'rCcS' // "ScCr" - Registry string
742#define CDROM_TAG_SRB 'SCcS' // "ScCS" - Srb allocation
743#define CDROM_TAG_STRINGS 'sCcS' // "ScCs" - Assorted string data
744#define CDROM_TAG_UPDATE_CAP 'UCcS' // "ScCU" - Update capacity path
745#define CDROM_TAG_ZERO_POWER_ODD 'ZCcS' // "ScCZ" - Zero Power ODD
746
747#define DVD_TAG_READ_KEY 'uCcS' // "ScCu" - Read buffer for dvd key
748#define DVD_TAG_RPC2_CHECK 'VCcS' // "ScCV" - Read buffer for dvd/rpc2 check
749#define DVD_TAG_DVD_REGION 'vCcS' // "ScCv" - Read buffer for rpc2 check
750#define DVD_TAG_SECURITY 'XCcS' // "ScCX" - Security descriptor
751
752
753// registry keys and data entry names.
754#define CDROM_SUBKEY_NAME (L"CdRom") // store new settings here
755#define CDROM_READ_CD_NAME (L"ReadCD") // READ_CD support previously detected
756#define CDROM_NON_MMC_DRIVE_NAME (L"NonMmc") // MMC commands hang
757#define CDROM_TYPE_ONE_GET_CONFIG_NAME (L"NoTypeOneGetConfig") // Type One Get Config commands not supported
758#define CDROM_NON_MMC_VENDOR_SPECIFIC_PROFILE (L"NonMmcVendorSpecificProfile") // GET_CONFIG returns vendor specific header
759 // profiles that are not per spec (length divisible by 4)
760#define DVD_DEFAULT_REGION (L"DefaultDvdRegion") // this is init. by the dvd class installer
761#define DVD_MAX_REGION 8
762
763// AACS defines
764#define AACS_MKB_PACK_SIZE 0x8000 // does not include header
765
766//enumeration of device interfaces need to be registered.
767typedef enum {
768 CdRomDeviceInterface = 0, // CdRomClassGuid
769 MountedDeviceInterface // MOUNTDEV_MOUNTED_DEVICE_GUID
771
772
773typedef
776 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
778 );
779
780// Rountines Definition
781
782#define FREE_POOL(_PoolPtr) \
783 if (_PoolPtr != NULL) { \
784 ExFreePool(_PoolPtr); \
785 _PoolPtr = NULL; \
786 }
787
788#define EXCLUSIVE_MODE(_CdData) (_CdData->ExclusiveOwner != NULL)
789#define EXCLUSIVE_OWNER(_CdData, _FileObject) (_CdData->ExclusiveOwner == _FileObject)
790
791#define IS_SCSIOP_READ(opCode) \
792 ((opCode == SCSIOP_READ6) || \
793 (opCode == SCSIOP_READ) || \
794 (opCode == SCSIOP_READ12) || \
795 (opCode == SCSIOP_READ16))
796
797#define IS_SCSIOP_WRITE(opCode) \
798 ((opCode == SCSIOP_WRITE6) || \
799 (opCode == SCSIOP_WRITE) || \
800 (opCode == SCSIOP_WRITE12) || \
801 (opCode == SCSIOP_WRITE16))
802
803#define IS_SCSIOP_READWRITE(opCode) (IS_SCSIOP_READ(opCode) || IS_SCSIOP_WRITE(opCode))
804
805// Bit Flag Macros
806#define SET_FLAG(Flags, Bit) ((Flags) |= (Bit))
807#define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit))
808#define TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0)
809
810FORCEINLINE // __REACTOS__
813{
814 if (((Ch >= '0') && (Ch <= '9')) ||
815 (((Ch|0x20) >= 'a') && ((Ch|0x20) <= 'z')) ||
816 (strchr(" .,:;_-", Ch) != NULL))
817 {
818 return TRUE;
819 }
820 return FALSE;
821}
822
823// could be #define, but this allows typechecking
824FORCEINLINE // __REACTOS__
827 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
829 )
830{
831 UNREFERENCED_PARAMETER(DeviceExtension);
834 );
835}
836
837FORCEINLINE // __REACTOS__
838VOID
840 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
842 )
843{
844#ifndef DEBUG
845 UNREFERENCED_PARAMETER(DeviceExtension);
846#endif
849 NT_ASSERT(Srb->SenseInfoBuffer != DeviceExtension->SenseData);
850
855 return;
856}
857
858// Standard driver entry function
859DRIVER_INITIALIZE DriverEntry;
860
861// Driver Event callbacks
862EVT_WDF_DRIVER_DEVICE_ADD DriverEvtDeviceAdd;
863
864EVT_WDF_OBJECT_CONTEXT_CLEANUP DriverEvtCleanup;
865
866// Device Event callbacks
867
868EVT_WDF_OBJECT_CONTEXT_CLEANUP DeviceEvtCleanup;
869
870EVT_WDF_FILE_CLOSE DeviceEvtFileClose;
871
872EVT_WDF_IO_IN_CALLER_CONTEXT DeviceEvtIoInCallerContext;
873
874EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT DeviceEvtSelfManagedIoInit;
875
876EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP DeviceEvtSelfManagedIoCleanup;
877
878EVT_WDF_DEVICE_D0_ENTRY DeviceEvtD0Entry;
879
880EVT_WDF_DEVICE_D0_EXIT DeviceEvtD0Exit;
881
882EVT_WDF_DEVICE_SURPRISE_REMOVAL DeviceEvtSurpriseRemoval;
883
884// Create Queue Event callbacks
885
886EVT_WDF_IO_QUEUE_IO_DEFAULT CreateQueueEvtIoDefault;
887
888// Sequential Queue Event callbacks
889
890// We do not use KMDF annotation for the following function, because it handles
891// both read and write requests and there is no single annotation for that.
892VOID
893NTAPI /* ReactOS Change: GCC Does not support STDCALL by default */
895 _In_ WDFQUEUE Queue,
896 _In_ WDFREQUEST Request,
897 _In_ size_t Length
898 );
899
900EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL SequentialQueueEvtIoDeviceControl;
901
902EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE SequentialQueueEvtCanceledOnQueue;
903
904// Miscellaneous request callbacks
905
906EVT_WDF_OBJECT_CONTEXT_CLEANUP RequestEvtCleanup;
907
908EVT_WDFDEVICE_WDM_IRP_PREPROCESS RequestProcessShutdownFlush;
909
910EVT_WDFDEVICE_WDM_IRP_PREPROCESS RequestProcessSetPower;
911
912
913// helper functions
914
917DeviceClaimRelease(
918 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
920 );
921
923VOID
924DeviceReleaseMcnResources(
925 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
926 );
927
930DeviceRetrieveDescriptor(
931 _In_ WDFDEVICE Device,
934 );
935
937VOID
938DeviceRetrieveHackFlagsFromRegistry(
939 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
940 );
941
943VOID
944DeviceHackFlagsScan(
945 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
947 );
948
951StringsAreMatched(
952 _In_opt_z_ PCHAR StringToMatch,
954 );
955
957VOID
958DeviceGetParameter(
959 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
962 _Inout_ PULONG ParameterValue // also default value
963 );
964
967DeviceSetParameter(
968 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
972 );
973
975ULONG
976DeviceGetTimeOutValueFromRegistry();
977
979VOID
980ScanForSpecialHandler(
981 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
983 );
984
987DeviceSendSrbSynchronously(
988 _In_ WDFDEVICE Device,
994 );
995
998 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
999 _In_ WDFREQUEST Request, // get IRP MJ code, IoControlCode from it (or attached original request)
1001 _In_ ULONG RetriedCount,
1004 LONGLONG* RetryIntervalIn100ns
1005 );
1006
1007VOID
1009 _In_ WDFREQUEST Request
1010 );
1011
1012VOID
1014 _In_ WDFREQUEST Request
1015 );
1016
1017VOID
1019 _In_ WDFREQUEST Request
1020 );
1021
1022BOOLEAN
1024 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1025 _In_ ULONG RetriedCount,
1028 LONGLONG* RetryIntervalIn100ns
1029 );
1030
1031
1032VOID
1034 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1035 _In_ const GUID* Guid,
1037 _In_opt_ PVOID ExtraData
1038 );
1039
1040VOID
1042 _In_ WDFDEVICE Device
1043 );
1044
1045EVT_WDF_REQUEST_COMPLETION_ROUTINE DeviceAsynchronousCompletion;
1046
1047VOID
1049 _In_ WDFDEVICE Device
1050 );
1051
1052EVT_WDF_REQUEST_COMPLETION_ROUTINE DeviceReleaseQueueCompletion;
1053
1054VOID
1056 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1057 );
1058
1061DeviceCacheDeviceInquiryData(
1062 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1063 );
1064
1067DeviceCacheGetConfigurationData(
1068 _In_ WDFDEVICE Device
1069 );
1070
1072PVOID
1073DeviceFindFeaturePage(
1077 );
1078
1080VOID
1081DevicePrintAllFeaturePages(
1084 );
1085
1088DeviceSetRawReadInfo(
1089 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1090 );
1091
1094MediaReadCapacity(
1095 _In_ WDFDEVICE Device
1096 );
1097
1099VOID
1100MediaReadCapacityDataInterpret(
1101 _In_ WDFDEVICE Device,
1103 );
1104
1107DeviceInitReleaseQueueContext(
1108 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1109 );
1110
1113DeviceInitPowerContext(
1114 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1115 );
1116
1119DeviceCreateWellKnownName(
1120 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1121 );
1122
1125DeviceInitializeDvd(
1126 _In_ WDFDEVICE Device
1127 );
1128
1130VOID
1131DevicePickDvdRegion(
1132 _In_ WDFDEVICE Device
1133 );
1134
1137DeviceRegisterInterface(
1138 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1140 );
1141
1144DeviceSendPowerDownProcessRequest(
1145 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1148 );
1149
1151VOID
1152DeviceScanForSpecial(
1153 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1156 );
1157
1160DeviceInitializeHotplugInfo(
1161 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1162 );
1163
1166 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1170 );
1171
1174 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1178 );
1179
1181
1184DeviceInitializeMediaChangeDetection(
1185 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1186 );
1187
1188VOID
1190 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1193 );
1194
1196VOID
1197DeviceSendDelayedMediaChangeNotifications(
1198 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1199 );
1200
1203 _In_ WDFDEVICE Device,
1204 _In_ WDFREQUEST Request
1205 );
1206
1209DeviceCleanupProtectedLocks(
1210 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1212 );
1213
1216DeviceCleanupDisableMcn(
1217 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1219 );
1220
1223DeviceUnlockExclusive(
1224 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1225 _In_ WDFFILEOBJECT FileObject,
1227 );
1228
1231RequestProcessSerializedIoctl(
1232 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1233 _In_ WDFREQUEST Request
1234 );
1235
1238 _In_ WDFREQUEST Request,
1239 _Out_ PBOOLEAN IsBlocked
1240 );
1241
1244DeviceSendRequestSynchronously(
1245 _In_ WDFDEVICE Device,
1246 _In_ WDFREQUEST Request,
1248 );
1249
1250VOID
1252 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1255 );
1256
1258
1259// MMC Update functions
1260
1261BOOLEAN
1263 _In_ WDFDEVICE Device
1264 );
1265
1266// Helper functions
1267
1269VOID
1270DeviceEnableMediaChangeDetection(
1271 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1274 );
1275
1277VOID
1278DeviceDisableMediaChangeDetection(
1279 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1281 );
1282
1285 _In_ WDFREQUEST Request,
1287 );
1288
1290BOOLEAN
1291DeviceIsPlayActive(
1292 _In_ WDFDEVICE Device
1293 );
1294
1297 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1298 _In_ WDFREQUEST Request,
1300 _Out_ size_t * DataLength
1301 );
1302
1305 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1306 _In_ WDFREQUEST Request,
1308 _Out_ size_t * DataLength
1309 );
1310
1312ULONG
1313DeviceRetrieveModeSenseUsingScratch(
1314 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1319 );
1320
1322PVOID
1323ModeSenseFindSpecificPage(
1324 _In_reads_bytes_(Length) PCHAR ModeSenseBuffer,
1325 _In_ size_t Length,
1328 );
1329
1332PerformEjectionControl(
1333 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1334 _In_ WDFREQUEST Request,
1337 );
1338
1340VOID
1341DeviceDisableMainTimer(
1342 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1343 );
1344
1347DeviceEnableMainTimer(
1348 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1349 );
1350
1352
1353VOID
1355 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1356 );
1357
1360RequestSetupMcnRequest(
1361 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1363 );
1364
1366BOOLEAN
1367RequestSendMcnRequest(
1368 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1369 );
1370
1372BOOLEAN
1373RequestPostWorkMcnRequest(
1374 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1375 );
1376
1379PowerContextReuseRequest(
1380 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1381 );
1382
1385PowerContextBeginUse(
1386 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1387 );
1388
1391PowerContextEndUse(
1392 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1393 );
1394
1395POWER_SETTING_CALLBACK DevicePowerSettingCallback;
1396
1397// Zero Power ODD functions
1398
1401DeviceInitializeZPODD(
1402 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1403 );
1404
1406VOID
1407DeviceReleaseZPODDResources(
1408 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1409 );
1410
1413 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1415 );
1416
1418BOOLEAN
1419DeviceZPODDIsInHomePosition(
1420 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1421 );
1422
1424VOID
1425DeviceMarkActive(
1426 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1429 );
1430
1431// common routines for specific IOCTL process
1432
1435DvdStartSessionReadKey(
1436 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1438 _In_opt_ WDFREQUEST OriginalRequest,
1444 );
1445
1448ReadDvdStructure(
1449 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1450 _In_opt_ WDFREQUEST OriginalRequest,
1452 _In_ size_t InputBufferLength,
1454 _In_ size_t OutputBufferLength,
1455 _Out_ size_t * DataLength
1456 );
1457
1460ReadQChannel(
1461 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1462 _In_opt_ WDFREQUEST OriginalRequest,
1464 _In_ size_t InputBufferLength,
1466 _In_ size_t OutputBufferLength,
1467 _Out_ size_t * DataLength
1468 );
1469
1472DvdSendKey(
1473 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1474 _In_opt_ WDFREQUEST OriginalRequest,
1476 _In_ size_t InputBufferLength,
1477 _Out_ size_t * DataLength
1478 );
1479
1480
1481#ifndef SIZEOF_ARRAY
1482 #define SIZEOF_ARRAY(ar) (sizeof(ar)/sizeof((ar)[0]))
1483#endif // !defined(SIZEOF_ARRAY)
1484
1485
1486// 100us to seconds
1487#define UNIT_100NS_PER_SECOND (10*1000*1000)
1488#define SECONDS_TO_100NS_UNITS(x) (((LONGLONG)x) * UNIT_100NS_PER_SECOND)
1489
1490//
1491// Bit Flag Macros
1492//
1493#define SET_FLAG(Flags, Bit) ((Flags) |= (Bit))
1494#define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit))
1495#define TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0)
1496
1497//
1498// neat little hacks to count number of bits set efficiently
1499//
1501 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
1503 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
1505 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
1507 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
1509 { ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; }
1510
1511
1512FORCEINLINE // __REACTOS__
1513BOOLEAN
1516 )
1517{
1518#pragma prefast(push)
1519#pragma prefast(disable: 28175, "there is no other way to check if there is volume mounted")
1520 return (DeviceObject->Vpb != NULL) &&
1521 ((DeviceObject->Vpb->Flags & VPB_MOUNTED) != 0);
1522#pragma prefast(pop)
1523}
1524
1525
1528ConvertSectorsPerSecondTo100nsUnitsFor64kWrite(
1529 _In_range_(1,0xFFFFFFFF) ULONG SectorsPerSecond // zero would cause divide-by-zero
1530 )
1531{
1532 // 64k write
1533 // ---------------- == time per 64k write
1534 // sectors/second
1535 //
1536 // (32 / N) == seconds
1537 // (32 / N) * (1,000,000,000) == nanoseconds
1538 // (32 / N) * (1,000,000,000) / 100 == 100ns increments
1539 // (32 * 10,000,000) / N == 100ns increments
1540 //
1541 // 320,000,000 / N == 100ns increments
1542 // And this is safe to run in kernel-mode (no floats)
1543 //
1544
1545 // this assert ensures that we _never_ can return a value
1546 // larger than the maximum allowed.
1548
1549 return 320000000 / SectorsPerSecond;
1550}
1551
1552FORCEINLINE // __REACTOS__
1553UCHAR
1555 _In_ WDFREQUEST Request
1556 )
1557{
1558 PIRP irp = NULL;
1559 PIO_STACK_LOCATION currentStack = NULL;
1560
1561 irp = WdfRequestWdmGetIrp(Request);
1562 currentStack = IoGetCurrentIrpStackLocation(irp);
1563
1564 return currentStack->Flags;
1565}
1566
1567FORCEINLINE // __REACTOS__
1568ULONG
1570 _In_ ULONG TimeOutValue,
1571 _In_ ULONG Times
1572 )
1573{
1574 ULONG value = 0;
1575
1576 if (TimeOutValue > SCSI_CDROM_OPC_TIMEOUT)
1577 {
1578 // if time out value is specified by user in registry, and is
1579 // bigger than OPC time out, it should be big enough
1580 value = TimeOutValue;
1581 }
1582 else
1583 {
1584 // otherwise, OPC time out value should be the upper limit
1585 value = min(TimeOutValue * Times, SCSI_CDROM_OPC_TIMEOUT);
1586 }
1587
1588 return value;
1589}
1590
1591VOID
1593 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1594 _In_ WDFREQUEST Request,
1597 );
1598
1601 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension,
1602 _In_ WDFREQUEST Request,
1603 _In_ WDFIOTARGET IoTarget,
1605 _Out_opt_ PBOOLEAN RequestSent
1606 );
1607
1608EVT_WDF_REQUEST_COMPLETION_ROUTINE RequestDummyCompletionRoutine;
1609
1610VOID
1612 _In_ WDFREQUEST Request,
1613 _In_ PCDROM_DEVICE_EXTENSION DeviceExtension
1614 );
1615
1616EVT_WDF_WORKITEM IoctlWorkItemRoutine;
1617
1619
1620#pragma warning(pop) // un-sets any local warning changes
1621
1622#endif // __CDROMP_H__
1623
1624
#define _X(x)
Definition: CPath.cpp:42
unsigned char BOOLEAN
char * strchr(const char *String, int ch)
Definition: utclib.c:501
#define VOID
Definition: acefi.h:82
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:672
LONG NTSTATUS
Definition: precomp.h:26
unsigned int ULONG32
Definition: basetsd.h:125
_In_ ULONG const Usable
Definition: cdrom.h:1084
EVT_WDF_IO_QUEUE_IO_DEFAULT CreateQueueEvtIoDefault
Definition: cdrom.h:886
CDROM_POWER_UP_STATE
Definition: cdrom.h:419
@ PowerUpDeviceOn
Definition: cdrom.h:422
@ PowerUpDeviceUnlocked
Definition: cdrom.h:424
@ PowerUpDeviceStarted
Definition: cdrom.h:423
@ PowerUpDeviceInitial
Definition: cdrom.h:420
@ PowerUpDeviceLocked
Definition: cdrom.h:421
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989
_In_opt_ PWSTR _In_ PWSTR ParameterName
Definition: cdrom.h:961
NTSTATUS RequestSynchronizeProcessWithSerialQueue(_In_ WDFDEVICE Device, _In_ WDFREQUEST Request)
Definition: cdrom.c:3893
EVT_WDF_TIMER DeviceMainTimerTickHandler
Definition: cdrom.h:1351
NTSTATUS RequestIsIoctlBlockedByExclusiveAccess(_In_ WDFREQUEST Request, _Out_ PBOOLEAN IsBlocked)
Definition: cdrom.c:4058
_In_ size_t _In_ UCHAR _In_ BOOLEAN Use6Byte
Definition: cdrom.h:1328
struct _CDROM_POWER_CONTEXT CDROM_POWER_CONTEXT
NTSTATUS DeviceErrorHandlerForMmc(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _Inout_ PNTSTATUS Status, _Inout_ PBOOLEAN Retry)
Definition: sense.c:87
struct _CDROM_DATA * PCDROM_DATA
struct _CDROM_DEVICE_EXTENSION * PCDROM_DEVICE_EXTENSION
Definition: cdrom.h:218
FORCEINLINE BOOLEAN PORT_ALLOCATED_SENSE(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
Definition: cdrom.h:826
_In_ WDFFILEOBJECT _In_ BOOLEAN IgnorePreviousMediaChanges
Definition: cdrom.h:1227
BOOLEAN DeviceIsMmcUpdateRequired(_In_ WDFDEVICE Device)
Definition: cdrom.c:4180
struct _CDROM_READ_WRITE_CONTEXT CDROM_READ_WRITE_CONTEXT
VOID(* PCDROM_SCAN_FOR_SPECIAL_HANDLER)(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ ULONG_PTR Data)
Definition: cdrom.h:775
FORCEINLINE BOOLEAN ValidChar(UCHAR Ch)
Definition: cdrom.h:812
_In_ size_t _In_ UCHAR PageMode
Definition: cdrom.h:1326
struct _CDROM_IOCTL_CONTEXT * PCDROM_IOCTL_CONTEXT
FORCEINLINE ULONG CountOfSetBitsULong64(ULONG64 _X)
Definition: cdrom.h:1506
VOID DeviceReleaseQueue(_In_ WDFDEVICE Device)
Definition: common.c:1179
struct _CDROM_POWER_CONTEXT * PCDROM_POWER_CONTEXT
BOOLEAN RequestSenseInfoInterpretForScratchBuffer(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
Definition: sense.c:2564
FORCEINLINE VOID FREE_PORT_ALLOCATED_SENSE_BUFFER(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
Definition: cdrom.h:839
EVT_WDFDEVICE_WDM_IRP_PREPROCESS RequestProcessSetPower
Definition: cdrom.h:910
struct _COMPLETION_CONTEXT COMPLETION_CONTEXT
FORCEINLINE ULONG CountOfSetBitsULong32(ULONG32 _X)
Definition: cdrom.h:1504
SYNC_HANDLER * PSYNC_HANDLER
Definition: cdrom.h:628
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID BufferAddress
Definition: cdrom.h:990
EVT_WDF_WORKITEM IoctlWorkItemRoutine
Definition: cdrom.h:1616
_In_ BOOLEAN _In_ BOOLEAN SetIdleTimeout
Definition: cdrom.h:1429
EVT_WDF_WORKITEM ReadWriteWorkItemRoutine
Definition: cdrom.h:1618
POWER_SETTING_CALLBACK DevicePowerSettingCallback
Definition: cdrom.h:1395
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: cdrom.h:932
VOID RequestSetupMcnSyncIrp(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension)
Definition: autorun.c:2749
EVT_WDF_DEVICE_SELF_MANAGED_IO_CLEANUP DeviceEvtSelfManagedIoCleanup
Definition: cdrom.h:876
DRIVER_INITIALIZE DriverEntry
Definition: cdrom.h:859
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN _In_opt_ WDFREQUEST OriginalRequest
Definition: cdrom.h:994
FORCEINLINE BOOLEAN IsVolumeMounted(_In_ PDEVICE_OBJECT DeviceObject)
Definition: cdrom.h:1514
EVT_WDF_FILE_CLOSE DeviceEvtFileClose
Definition: cdrom.h:870
_In_ PFILE_OBJECT_CONTEXT FileObjectContext
Definition: cdrom.h:1212
NTSTATUS RequestSetContextFields(_In_ WDFREQUEST Request, _In_ PSYNC_HANDLER Handler)
Definition: common.c:2748
_In_ BOOLEAN UseGesn
Definition: cdrom.h:1363
EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL SequentialQueueEvtIoDeviceControl
Definition: cdrom.h:900
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: cdrom.h:963
_In_ BOOLEAN Release
Definition: cdrom.h:920
struct _CDROM_MMC_EXTENSION * PCDROM_MMC_EXTENSION
VOID RequestProcessInternalDeviceControl(_In_ WDFREQUEST Request, _In_ PCDROM_DEVICE_EXTENSION DeviceExtension)
Definition: cdrom.c:3154
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN WriteToDevice
Definition: cdrom.h:992
EVT_WDF_OBJECT_CONTEXT_CLEANUP DeviceEvtCleanup
Definition: cdrom.h:868
_In_ ULONG_PTR Data
Definition: cdrom.h:947
struct _CDROM_SCRATCH_READ_WRITE_CONTEXT CDROM_SCRATCH_READ_WRITE_CONTEXT
struct _CDROM_SCRATCH_READ_WRITE_CONTEXT * PCDROM_SCRATCH_READ_WRITE_CONTEXT
EVT_WDF_DEVICE_D0_ENTRY DeviceEvtD0Entry
Definition: cdrom.h:878
NTSTATUS RequestSend(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDFIOTARGET IoTarget, _In_ ULONG Flags, _Out_opt_ PBOOLEAN RequestSent)
Definition: common.c:3793
FORCEINLINE ULONG SectorsPerSecond
Definition: cdrom.h:1531
CDROM_SCAN_FOR_SPECIAL_INFO CdromHackItems[]
Definition: data.c:44
NTSTATUS RequestDuidGetDeviceIdProperty(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDF_REQUEST_PARAMETERS RequestParameters, _Out_ size_t *DataLength)
Definition: common.c:2797
EVT_WDF_OBJECT_CONTEXT_CLEANUP RequestEvtCleanup
Definition: cdrom.h:906
NTSTATUS SYNC_HANDLER(_In_ WDFDEVICE Device, _In_ WDFREQUEST Request)
Definition: cdrom.h:623
FORCEINLINE UCHAR RequestGetCurrentStackLocationFlags(_In_ WDFREQUEST Request)
Definition: cdrom.h:1554
_In_ CDROM_SCAN_FOR_SPECIAL_INFO DeviceList[]
Definition: cdrom.h:1154
EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT DeviceEvtSelfManagedIoInit
Definition: cdrom.h:874
struct _COMPLETION_CONTEXT * PCOMPLETION_CONTEXT
enum CDROM_DEVICE_INTERFACES * PCDROM_DEVICE_INTERFACES
_In_ PREAD_CAPACITY_DATA ReadCapacityBuffer
Definition: cdrom.h:1103
FORCEINLINE ULONG CountOfSetBitsULong(ULONG _X)
Definition: cdrom.h:1502
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1444
EVT_WDF_REQUEST_COMPLETION_ROUTINE DeviceAsynchronousCompletion
Definition: cdrom.h:1045
EVT_WDF_DRIVER_DEVICE_ADD DriverEvtDeviceAdd
Definition: cdrom.h:862
EVT_WDF_REQUEST_COMPLETION_ROUTINE RequestDummyCompletionRoutine
Definition: cdrom.h:1608
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
Definition: cdrom.h:1156
struct _CDROM_POWER_OPTIONS * PCDROM_POWER_OPTIONS
_In_ ULONG _In_ UCHAR PageCode
Definition: cdrom.h:1317
_In_opt_ PWSTR SubkeyName
Definition: cdrom.h:960
struct _CDROM_DRIVER_EXTENSION * PCDROM_DRIVER_EXTENSION
VOID RequestCompletion(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ NTSTATUS Status, _In_ ULONG_PTR Information)
Definition: common.c:3439
VOID DeviceSetMediaChangeStateEx(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ MEDIA_CHANGE_DETECTION_STATE NewState, _Inout_opt_ PMEDIA_CHANGE_DETECTION_STATE OldState)
Definition: autorun.c:751
EVT_WDF_IO_IN_CALLER_CONTEXT DeviceEvtIoInCallerContext
Definition: cdrom.h:872
BOOLEAN RequestSenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
Definition: sense.c:2467
EVT_WDF_DEVICE_SURPRISE_REMOVAL DeviceEvtSurpriseRemoval
Definition: cdrom.h:882
VOID DevicePerfIncrementErrorCount(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension)
Definition: common.c:1378
_In_ ULONG const _In_ FEATURE_NUMBER const Feature
Definition: cdrom.h:1077
EVT_WDF_REQUEST_COMPLETION_ROUTINE DeviceReleaseQueueCompletion
Definition: cdrom.h:1052
_In_z_ PCHAR TargetString
Definition: cdrom.h:954
FORCEINLINE ULONG CountOfSetBitsUlongPtr(ULONG_PTR _X)
Definition: cdrom.h:1508
NTSTATUS DeviceZPODDGetPowerupReason(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _Out_ PSTORAGE_IDLE_POWERUP_REASON PowerupReason)
Definition: zpodd.c:608
VOID RequestSetSentTime(_In_ WDFREQUEST Request)
Definition: common.c:79
IO_COMPLETION_ROUTINE RequestAsynchronousIrpCompletion
Definition: cdrom.h:1257
EVT_WDF_IO_QUEUE_IO_CANCELED_ON_QUEUE SequentialQueueEvtCanceledOnQueue
Definition: cdrom.h:902
#define TEST_FLAG(Flags, Bit)
Definition: cdrom.h:1495
#define CLEAR_FLAG(Flags, Bit)
Definition: cdrom.h:1494
struct _CDROM_READ_WRITE_CONTEXT * PCDROM_READ_WRITE_CONTEXT
_In_ WDFREQUEST _In_ BOOLEAN RequestFormated
Definition: cdrom.h:1248
NTSTATUS RequestDuidGetDeviceProperty(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ WDF_REQUEST_PARAMETERS RequestParameters, _Out_ size_t *DataLength)
Definition: common.c:2888
#define SCSI_CDROM_OPC_TIMEOUT
Definition: cdrom.h:688
EVT_WDF_OBJECT_CONTEXT_CLEANUP DriverEvtCleanup
Definition: cdrom.h:864
VOID NTAPI SequentialQueueEvtIoReadWrite(_In_ WDFQUEUE Queue, _In_ WDFREQUEST Request, _In_ size_t Length)
Definition: cdrom.c:3215
VOID RequestSetReceivedTime(_In_ WDFREQUEST Request)
Definition: common.c:64
FORCEINLINE ULONG CountOfSetBitsUChar(UCHAR _X)
Definition: cdrom.h:1500
struct _ERROR_RECOVERY_DATA ERROR_RECOVERY_DATA
_In_ WDFREQUEST _In_ MEDIA_LOCK_TYPE LockType
Definition: cdrom.h:1335
_In_ BOOLEAN IsActive
Definition: cdrom.h:1427
struct _CDROM_POWER_OPTIONS CDROM_POWER_OPTIONS
struct _CDROM_REQUEST_CONTEXT * PCDROM_REQUEST_CONTEXT
struct _CDROM_IOCTL_CONTEXT CDROM_IOCTL_CONTEXT
CDROM_POWER_DOWN_STATE
Definition: cdrom.h:407
@ PowerDownDeviceUnlocked
Definition: cdrom.h:414
@ PowerDownDeviceStopped
Definition: cdrom.h:412
@ PowerDownDeviceQuiesced
Definition: cdrom.h:410
@ PowerDownDeviceOff
Definition: cdrom.h:413
@ PowerDownDeviceInitial
Definition: cdrom.h:408
@ PowerDownDeviceLocked
Definition: cdrom.h:409
@ PowerDownDeviceFlushed
Definition: cdrom.h:411
VOID DeviceSendNotification(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ const GUID *Guid, _In_ ULONG ExtraDataSize, _In_opt_ PVOID ExtraData)
Definition: common.c:799
struct _CDROM_DEVICE_EXTENSION CDROM_DEVICE_EXTENSION
Definition: cdrom.h:216
struct _ERROR_RECOVERY_DATA * PERROR_RECOVERY_DATA
VOID DeviceSendIoctlAsynchronously(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ ULONG IoControlCode, _In_ PDEVICE_OBJECT TargetDeviceObject)
Definition: common.c:1030
_In_ ULONG _In_ UCHAR _In_ UCHAR PageControl
Definition: cdrom.h:1319
_In_ ULONG_PTR HackFlags
Definition: cdrom.h:983
VOID(* PCDROM_ERROR_HANDLER)(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _Inout_ PNTSTATUS Status, _Inout_ PBOOLEAN Retry)
Definition: cdrom.h:222
EVT_WDFDEVICE_WDM_IRP_PREPROCESS RequestProcessShutdownFlush
Definition: cdrom.h:908
struct _CDROM_MMC_EXTENSION CDROM_MMC_EXTENSION
CDROM_DEVICE_INTERFACES
Definition: cdrom.h:767
@ CdRomDeviceInterface
Definition: cdrom.h:768
@ MountedDeviceInterface
Definition: cdrom.h:769
NTSTATUS DeviceErrorHandlerForHitachiGD2000(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _Inout_ PNTSTATUS Status, _Inout_ PBOOLEAN Retry)
Definition: sense.c:361
VOID RequestClearSendTime(_In_ WDFREQUEST Request)
Definition: common.c:111
struct _CDROM_REQUEST_CONTEXT CDROM_REQUEST_CONTEXT
EVT_WDF_DEVICE_D0_EXIT DeviceEvtD0Exit
Definition: cdrom.h:880
struct _CDROM_DRIVER_EXTENSION CDROM_DRIVER_EXTENSION
FORCEINLINE ULONG TimeOutValueGetCapValue(_In_ ULONG TimeOutValue, _In_ ULONG Times)
Definition: cdrom.h:1569
struct _CDROM_DATA CDROM_DATA
VOID DeviceSendStartUnit(_In_ WDFDEVICE Device)
Definition: common.c:877
EVT_WDF_WORKITEM DeviceRestoreDefaultSpeed
Definition: cdrom.h:1180
#define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS
Definition: cdromp.h:50
enum _MEDIA_CHANGE_DETECTION_STATE * PMEDIA_CHANGE_DETECTION_STATE
enum _MEDIA_CHANGE_DETECTION_STATE MEDIA_CHANGE_DETECTION_STATE
MEDIA_LOCK_TYPE
Definition: cdromp.h:288
Definition: bufpool.h:45
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
_In_ const GUID _In_ ULONG ExtraDataSize
Definition: classpnp.h:1430
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DEVICE_TYPE
Definition: guid.c:10
_In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_PARAMETERS RequestParameters
Definition: ioctl.h:138
#define SRB_FLAGS_FREE_SENSE_BUFFER
Definition: srb.h:406
#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE
Definition: srb.h:413
#define _IRQL_requires_max_(irql)
Definition: driverspecs.h:230
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
#define APC_LEVEL
Definition: env_spec_w32.h:695
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1674
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
FxIrp * irp
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define C_ASSERT(e)
Definition: intsafe.h:73
unsigned __int64 ULONG64
Definition: imports.h:198
* PNTSTATUS
Definition: strlen.c:14
#define min(a, b)
Definition: monoChain.cc:55
#define _Field_size_bytes_(size)
Definition: ms_sal.h:600
#define _Out_opt_
Definition: ms_sal.h:346
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define _Inout_
Definition: ms_sal.h:378
#define _In_z_
Definition: ms_sal.h:313
#define _In_opt_z_
Definition: ms_sal.h:314
#define _Outptr_
Definition: ms_sal.h:427
#define _Deref_out_range_(lb, ub)
Definition: ms_sal.h:575
#define _Ret_range_(lb, ub)
Definition: ms_sal.h:573
#define _Inout_opt_
Definition: ms_sal.h:379
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
#define _In_range_(lb, ub)
Definition: ms_sal.h:571
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define CDROM_EXCLUSIVE_CALLER_LENGTH
Definition: ntddcdrm.h:402
enum _FEATURE_NUMBER FEATURE_NUMBER
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
* PSTORAGE_DESCRIPTOR_HEADER
Definition: ntddstor.h:560
* PSTORAGE_DEVICE_DESCRIPTOR
Definition: ntddstor.h:576
enum _STORAGE_PROPERTY_ID * PSTORAGE_PROPERTY_ID
* PSTORAGE_ADAPTER_DESCRIPTOR
Definition: ntddstor.h:599
BOOLEAN NTAPI PsIsThreadTerminating(IN PETHREAD Thread)
Definition: thread.c:868
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
#define Ch(x, y, z)
Definition: sha2.c:141
ULONG_PTR HackFlags
Definition: cdrom.h:344
_Field_size_bytes_(CachedInquiryDataByteCount) PINQUIRYDATA CachedInquiryData
UNICODE_STRING WellKnownName
Definition: cdrom.h:357
CDROM_MMC_EXTENSION Mmc
Definition: cdrom.h:341
DEVICE_TYPE DriveDeviceType
Definition: cdrom.h:388
BOOLEAN PlayActive
Definition: cdrom.h:351
ULONG PickDvdRegion
Definition: cdrom.h:354
ULONG MaxPageAlignedTransferBytes
Definition: cdrom.h:360
ULONG MaxUnalignedTransferBytes
Definition: cdrom.h:361
PCDROM_ERROR_HANDLER ErrorHandler
Definition: cdrom.h:347
LONGLONG ReadWriteRetryDelay100nsUnits
Definition: cdrom.h:384
ULONG CachedInquiryDataByteCount
Definition: cdrom.h:392
BOOLEAN RestoreDefaults
Definition: cdrom.h:380
WDFFILEOBJECT ExclusiveOwner
Definition: cdrom.h:373
BOOLEAN IsDecRrd
Definition: cdrom.h:365
WDFIOTARGET IoTarget
Definition: cdrom.h:476
CDROM_SCRATCH_CONTEXT ScratchContext
Definition: cdrom.h:601
BOOLEAN ReleaseQueueInProgress
Definition: cdrom.h:581
PSTORAGE_ADAPTER_DESCRIPTOR AdapterDescriptor
Definition: cdrom.h:542
ULONG ScanForSpecialFlags
Definition: cdrom.h:512
PDEVICE_OBJECT DeviceObject
Definition: cdrom.h:493
WDFTIMER MainTimer
Definition: cdrom.h:486
WDFWAITLOCK EjectSynchronizationLock
Definition: cdrom.h:559
PZERO_POWER_ODD_INFO ZeroPowerODDInfo
Definition: cdrom.h:566
WDFWORKITEM IoctlWorkItem
Definition: cdrom.h:613
CDROM_READ_WRITE_CONTEXT ReadWriteWorkItemContext
Definition: cdrom.h:609
WDFQUEUE ManualVolumeReadyQueue
Definition: cdrom.h:591
WDFMEMORY ReleaseQueueInputMemory
Definition: cdrom.h:579
BOOLEAN ReleaseQueueNeeded
Definition: cdrom.h:580
PCDROM_PRIVATE_FDO_DATA PrivateFdoData
Definition: cdrom.h:605
WDFWORKITEM ReadWriteWorkItem
Definition: cdrom.h:608
WDFSPINLOCK ReleaseQueueSpinLock
Definition: cdrom.h:576
LARGE_INTEGER StartingOffset
Definition: cdrom.h:533
PSTORAGE_DEVICE_DESCRIPTOR DeviceDescriptor
Definition: cdrom.h:539
KEVENT EjectSynchronizationEvent
Definition: cdrom.h:558
UNICODE_STRING DeviceName
Definition: cdrom.h:502
DEVICE_TYPE DeviceType
Definition: cdrom.h:499
CDROM_POWER_CONTEXT PowerContext
Definition: cdrom.h:586
CDROM_IOCTL_CONTEXT IoctlWorkItemContext
Definition: cdrom.h:614
WDFQUEUE CreateQueue
Definition: cdrom.h:483
WDFQUEUE SerialIOQueue
Definition: cdrom.h:479
WDFREQUEST ReleaseQueueRequest
Definition: cdrom.h:577
LARGE_INTEGER PartitionLength
Definition: cdrom.h:530
DISK_GEOMETRY DiskGeometry
Definition: cdrom.h:524
WDFWAITLOCK ShutdownFlushWaitLock
Definition: cdrom.h:595
SCSI_REQUEST_BLOCK ReleaseQueueSrb
Definition: cdrom.h:578
PDEVICE_OBJECT LowerPdo
Definition: cdrom.h:496
BOOLEAN PowerDownInProgress
Definition: cdrom.h:587
BOOLEAN IsVolumeOnlinePending
Definition: cdrom.h:590
BOOLEAN SurpriseRemoved
Definition: cdrom.h:470
BOOLEAN IsInitialized
Definition: cdrom.h:464
PMEDIA_CHANGE_DETECTION_INFO MediaChangeDetectionInfo
Definition: cdrom.h:563
WDFDEVICE Device
Definition: cdrom.h:473
FILE_OBJECT_CONTEXT KernelModeMcnContext
Definition: cdrom.h:569
PSENSE_DATA SenseData
Definition: cdrom.h:548
PCDROM_DRIVER_EXTENSION DriverExtension
Definition: cdrom.h:490
UNICODE_STRING MountedDeviceInterfaceName
Definition: cdrom.h:536
SCSI_ADDRESS ScsiAddress
Definition: cdrom.h:521
CDROM_DATA DeviceAdditionalData
Definition: cdrom.h:598
PDEVICE_POWER_DESCRIPTOR PowerDescriptor
Definition: cdrom.h:545
PDRIVER_OBJECT DriverObject
Definition: cdrom.h:232
WDFREQUEST OriginalRequest
Definition: cdrom.h:328
BOOLEAN ReadCdSubCode
Definition: cdrom.h:273
BOOLEAN WriteAllowed
Definition: cdrom.h:250
FEATURE_NUMBER ValidationSchema
Definition: cdrom.h:260
BOOLEAN ReadCdC2Pointers
Definition: cdrom.h:272
SCSI_REQUEST_BLOCK CapabilitiesSrb
Definition: cdrom.h:263
BOOLEAN StreamingReadSupported
Definition: cdrom.h:253
BOOLEAN IsCssDvd
Definition: cdrom.h:252
ULONG CapabilitiesBufferSize
Definition: cdrom.h:269
SENSE_DATA CapabilitiesSenseData
Definition: cdrom.h:266
WDFREQUEST CapabilitiesRequest
Definition: cdrom.h:265
_Field_size_bytes_(CapabilitiesBufferSize) PGET_CONFIGURATION_HEADER CapabilitiesBuffer
PMDL CapabilitiesMdl
Definition: cdrom.h:270
BOOLEAN StreamingWriteSupported
Definition: cdrom.h:254
PIRP CapabilitiesIrp
Definition: cdrom.h:264
BOOLEAN IsWriter
Definition: cdrom.h:249
BOOLEAN IsAACS
Definition: cdrom.h:248
LARGE_INTEGER CompleteTime
Definition: cdrom.h:435
LARGE_INTEGER StartTime
Definition: cdrom.h:433
WDFREQUEST PowerRequest
Definition: cdrom.h:444
LARGE_INTEGER Step1CompleteTime
Definition: cdrom.h:434
LONGLONG RetryIntervalIn100ns
Definition: cdrom.h:450
CDROM_POWER_OPTIONS Options
Definition: cdrom.h:442
SCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:446
CDROM_POWER_UP_STATE PowerUp
Definition: cdrom.h:439
SENSE_DATA SenseData
Definition: cdrom.h:447
CDROM_POWER_DOWN_STATE PowerDown
Definition: cdrom.h:438
ULONG HandleSpinDown
Definition: cdrom.h:400
ULONG HandleSpinUp
Definition: cdrom.h:401
WDFREQUEST OriginalRequest
Definition: cdrom.h:335
WDFREQUEST OriginalRequest
Definition: cdrom.h:633
PCDROM_DEVICE_EXTENSION DeviceExtension
Definition: cdrom.h:631
KSPIN_LOCK ReadWriteCancelSpinLock
Definition: cdrom.h:662
BOOLEAN SyncRequired
Definition: cdrom.h:643
LARGE_INTEGER TimeReceived
Definition: cdrom.h:635
BOOLEAN ReadWriteIsCompleted
Definition: cdrom.h:665
KTIMER ReadWriteTimer
Definition: cdrom.h:663
LARGE_INTEGER TimeSentDownLasttTime
Definition: cdrom.h:637
BOOLEAN ReadWriteRetryInitialized
Definition: cdrom.h:666
PSYNC_HANDLER SyncCallback
Definition: cdrom.h:645
LARGE_INTEGER TimeSentDownFirstTime
Definition: cdrom.h:636
BOOLEAN PartialMdlIsBuilt
Definition: cdrom.h:310
_Field_range_(4 *1024, 64 *1024) ULONG ScratchBufferSize
PCSTR ScratchInUseFileName
Definition: cdrom.h:314
ULONG ScratchInUseLineNumber
Definition: cdrom.h:315
PSCSI_REQUEST_BLOCK ScratchSrb
Definition: cdrom.h:304
PSENSE_DATA ScratchSense
Definition: cdrom.h:305
CDROM_SCRATCH_READ_WRITE_CONTEXT ScratchReadWriteContext
Definition: cdrom.h:321
WDFREQUEST ScratchRequest
Definition: cdrom.h:303
PSRB_HISTORY ScratchHistory
Definition: cdrom.h:306
PSRB_HISTORY_ITEM SrbHistoryItem
Definition: cdrom.h:289
LARGE_INTEGER StartingOffset
Definition: cdrom.h:285
WDFDEVICE Device
Definition: cdrom.h:674
SCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:675
MODE_READ_RECOVERY_PAGE ReadRecoveryPage
Definition: cdrom.h:170
MODE_PARAMETER_BLOCK BlockDescriptor
Definition: cdrom.h:169
MODE_PARAMETER_HEADER Header
Definition: cdrom.h:168
Definition: ketypes.h:687
UCHAR SenseInfoBufferLength
Definition: srb.h:259
PVOID SenseInfoBuffer
Definition: srb.h:264
ULONG SrbFlags
Definition: srb.h:260
uint16_t * PWSTR
Definition: typedefs.h:56
#define MAXULONG
Definition: typedefs.h:251
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
Definition: pdh_main.c:94
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIOTARGET * IoTarget
Definition: wdfiotarget.h:368
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:762
#define WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(_contexttype, _castingfunction)
Definition: wdfobject.h:350
EVT_WDF_REQUEST_COMPLETION_ROUTINE * PFN_WDF_REQUEST_COMPLETION_ROUTINE
Definition: wdfrequest.h:313
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:895
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
#define FORCEINLINE
Definition: wdftypes.h:67
#define NTKERNELAPI
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define VPB_MOUNTED
Definition: iotypes.h:1807
#define NT_ASSERT
Definition: rtlfuncs.h:3310
unsigned char UCHAR
Definition: xmlstorage.h:181