Condividi tramite


CD-ROM I/O control codes

All public I/O control codes for drivers of CD-ROM devices use buffered I/O. Consequently, the input or output data for these requests is at Irp->AssociatedIrp.SystemBuffer.

Class drivers for CD-ROM devices handle additional public I/O control codes, along with those described in this section. For more information about requirements for storage class drivers, see General Storage I/O Control Codes.

I/O control code Description
IOCTL_CDROM_CHECK_VERIFY This IOCTL is replaced by IOCTL_STORAGE_CHECK_VERIFY. The only difference between the two IOCTLs is the base value.
IOCTL_CDROM_CLOSE_DOOR This I/O control code has been replaced by IOCTL_STORAGE_LOAD_MEDIA.
IOCTL_CDROM_ENABLE_STREAMING Enables or disables CDROM streaming mode on a per-handle basis for raw read and write requests. To perform this operation, call the DeviceIoControl function and specify the IOCTL_CDROM_ENABLE_STREAMING I/O control request as the dwIoControlCode parameter.
IOCTL_CDROM_EXCLUSIVE_ACCESS Instructs the CD-ROM class driver to export the access state of a CD-ROM device, lock a CD-ROM device for exclusive access, and unlock a CD-ROM device for exclusive access.
IOCTL_CDROM_FIND_NEW_DEVICES This IOCTL is replaced by IOCTL_STORAGE_FIND_NEW_DEVICES. The only difference between the two IOCTLs is the base value.
IOCTL_CDROM_GET_CONFIGURATION Requests feature and profile information from a CD-ROM device.
IOCTL_CDROM_GET_DRIVE_GEOMETRY Returns information about the CD-ROM's geometry (media type, number of cylinders, tracks per cylinder, sectors per track, and bytes per sector).
IOCTL_CDROM_GET_DRIVE_GEOMETRY_EX Returns information about a CD-ROM's geometry (media type, number of cylinders, tracks per cylinder, sectors per track, and bytes per sector).
IOCTL_CDROM_GET_INQUIRY_DATA Returns the SCSI inquiry data for the CD-ROM device. This IOCTL can be used when a device has been exclusively locked with IOCTL_CDROM_EXCLUSIVE_ACCESS.
IOCTL_CDROM_GET_LAST_SESSION Queries the device for the first complete session number, the last complete session number, and the last complete session starting address.
IOCTL_CDROM_GET_PERFORMANCE Retrieves the supported speeds from the device. The IOCTL_CDROM_GET_PERFORMANCE I/O control request is a wrapper over the MMC command, GET PERFORMANCE.
IOCTL_CDROM_LOAD_MEDIA Draws a protruding CDROM tray back into the drive.
IOCTL_CDROM_RAW_READ Reads data from the CD-ROM in raw mode.
IOCTL_CDROM_READ_Q_CHANNEL Returns the current position (obsolete), media catalog, or ISRC track data.
IOCTL_CDROM_READ_TOC Obsolete. Returns the table of contents of the media.
IOCTL_CDROM_READ_TOC_EX Queries the target device for the table of contents (TOC), the program memory area (PMA), and the absolute time in pregroove (ATIP).
IOCTL_CDROM_SEND_OPC_INFORMATION Used in file systems and other implementations that want to perform the Optimum Power Calibration (OPC) procedure in advance, so that the first streaming write does not have to wait for the procedure to finish.
IOCTL_CDROM_SET_SPEED Sets the spindle speed of the CD-ROM drive.

Media playback control

Beginning with Windows Vista, CDROM class drivers do not use these IOCTLs. Prior to Windows Vista, these IOCTLs were used for audio playback on older CD-ROM drives that supported direct audio output in hardware.

Client applications should use the Media Control Interface (MCI) API rather than issuing these IOCTLs.

I/O control code Description
IOCTL_CDROM_GET_CONTROL Determines the current audio playback mode.
IOCTL_CDROM_GET_VOLUME Determines the current volume for each of its device's audio ports.
IOCTL_CDROM_PAUSE_AUDIO Suspends audio play.
IOCTL_CDROM_PLAY_AUDIO_MSF Plays the specified range of the media.
IOCTL_CDROM_READ_Q_CHANNEL Returns the current position (obsolete), media catalog, or ISRC track data.
IOCTL_CDROM_RESUME_AUDIO Resumes a suspended audio operation.
IOCTL_CDROM_SEEK_AUDIO_MSF Moves the heads to the specified MSF on the media.
IOCTL_CDROM_SET_VOLUME Resets the volume for its device's audio ports.
IOCTL_CDROM_STOP_AUDIO Ends audio play.