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 SCSI CD-ROM devices handle additional public I/O control codes, along with those described in this section. See also Chapter 9 for more information about requirements for SCSI class drivers of mass-storage devices.
IOCTL_CDROM_GET_DRIVE_GEOMETRY returns information about the CDROM’s geometry (media type, number of cylinders, tracks per cylinder, sectors per track, and bytes per sector).
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location of the IRP indicates the size in bytes of the buffer, which must be >= sizeof(DISK_GEOMETRY).
The driver returns the DISK_GEOMETRY-type information in the buffer at Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the size in bytes of the returned data. The Status field is set to STATUS_SUCCESS or possibly to STATUS_UNRECOGNIZED_MEDIA, STATUS_INVALID_PARAMETER, STATUS_INFO_LENGTH_MISMATCH, or STATUS_BUFFER_TOO_SMALL.
Returns the table of contents of the media.
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location indicates the size in bytes of the buffer, which must be >= sizeof(CDROM_TOC).
The driver returns the CDROM_TOC data in the buffer at Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_NO_MEDIA_IN_DEVICE, STATUS_DEVICE_NOT_READY, STATUS_IO_TIMEOUT, STATUS_IO_DEVICE_ERROR, STATUS_DEVICE_BUSY, or STATUS_VERIFY_REQUIRED.
The driver determines whether a disc is multisession. It compares the first and last session and the starting track of the last session. If the first session is the same as the last, the disc is not multisession. If the disc is multisession, the driver stores session block addresses in the table of contents.
None
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_INVALID_DEVICE_REQUEST, STATUS_DEVICE_BUSY, STATUS_DEVICE_NOT_READY, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
This IOCTL is replaced by IOCTL_STORAGE_CHECK_VERIFY. The only difference between the two IOCTLs is the base code.
Determines whether the media has changed on a CD-ROM drive. (For more information about handling removable media, see the Kernel-Mode Driver Design Guide.)
Optionally, Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location of the IRP indicates the size in bytes of a buffer, which must be >= sizeof(ULONG). This field is zero if the optional buffer is not specified.
Optionally, Irp->AssociatedIrp.SystemBuffer points to a buffer to receive the media change count. The driver fills this buffer only if Parameters.DeviceIoControl.OutputBufferLength was nonzero and the return value is STATUS_SUCCESS. The media change count is a ULONG indicating how many times the media has changed since the driver started.
If the driver has no indication that the media has changed, the driver sets the Status field to STATUS_SUCCESS. In addition, if the optional media change buffer was specified, the driver returns the media change count in the buffer at Irp->AssociatedIrp.SystemBuffer and sets the Information field to sizeof(ULONG). If the optional media change buffer was not specified, the driver sets Information to zero.
If the driver detects that the media has changed and the volume is mounted (VPD_MOUNTED is set in the VPB), it must: set Information to zero, set Status to STATUS_VERIFY_REQUIRED, set the DO_VERIFY_VOLUME flag in the DeviceObject, and call IoCompleteRequest with the input IRP.
If the driver detects that the media has changed, but the volume is not mounted, the driver must not set the DO_VERIFY_VOLUME bit. The driver should set Status to STATUS_IO_DEVICE_ERROR, set Information to zero, and call IoCompleteRequest with the IRP.
If the driver detects an error such as STATUS_BUFFER_TOO_SMALL, STATUS_INSUFFICIENT_RESOURCES, or a device error, it sets Information to zero and sets the appropriate error value in the Status field.
The driver determines the current audio playback mode.
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location indicates the size in bytes of the buffer, which must be >= sizeof(CDROM_AUDIO_CONTROL).
The driver returns the CDROM_AUDIO_CONTROL data in the buffer at Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_DEVICE_NOT_READY, STATUS_IO_DEVICE_ERROR, STATUS_IO_TIMEOUT, STATUS_INSUFFICIENT_RESOURCES, STATUS_VERIFY_REQUIRED, or STATUS_INVALID_DEVICE_REQUEST.
The driver determines the current volume for each of its device’s audio ports.
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location indicates the size in bytes of the buffer, which must be >= sizeof(CDROM_VOLUME_CONTROL).
The driver returns the CDROM_VOLUME_CONTROL data in the buffer at Irp->AssociatedIrp.SystemBuffer.
The Information field is set to sizeof(CDROM_VOLUME_CONTROL) when the Status field is set to STATUS_SUCCESS. Otherwise, the Information field is set to zero, and the Status field possibly can be set to STATUS_BUFFER_TOO_SMALL, STATUS_DEVICE_NOT_READY, STATUS_IO_DEVICE_ERROR, STATUS_VERIFY_REQUIRED, or STATUS_IO_TIMEOUT.
The driver resets the volume for its device’s audio ports.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the CDROM_VOLUME_CONTROL value(s) to be set. Parameters.DeviceIoControl.InputBufferLength in the I/O stack location indicates the size in bytes of the buffer, which must be >= sizeof(CDROM_VOLUME_CONTROL).
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_DEVICE_NOT_READY, STATUS_IO_TIMEOUT, STATUS_IO_DEVICE_ERROR, STATUS_VERIFY_REQUIRED, or STATUS_INVALID_DEVICE_REQUEST.
Plays the specified range of the media.
The buffer at Irp->AssociatedIrp.System buffer contains the starting and ending MSF values. Parameters.DeviceIoControl.InputBufferLength in the I/O stack location indicates the size in bytes of the buffer, which must be >= sizeof(CDROM_PLAY_AUDIO_MSF).
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_INVALID_DEVICE_REQUEST, STATUS_BUFFER_TOO_SMALL, STATUS_DEVICE_NOT_READY, STATUS_IO_DEVICE_ERROR, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
Moves the heads to the specified MSF on the media.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the CDROM_SEEK_AUDIO_MSF specification. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer.
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_INVALID_DEVICE_REQUEST, STATUS_IO_DEVICE_ERROR, STATUS_NO_MEDIA_IN_DEVICE, STATUS_DEVICE_NOT_READY, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
Ends audio play.
None
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_INVALID_DEVICE_REQUEST if audio is not currently playing, STATUS_IO_DEVICE_ERROR, STATUS_NO_MEDIA_IN_DEVICE, STATUS_DEVICE_NOT_READY, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
Suspends audio play.
None
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_INVALID_DEVICE_REQUEST if audio is not currently playing, STATUS_IO_DEVICE_ERROR, STATUS_NO_MEDIA_IN_DEVICE, STATUS_DEVICE_NOT_READY, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
Resumes a suspended audio operation.
None
None
The Information field is set to zero. The Status field is set to STATUS_SUCCESS or possibly to STATUS_INVALID_DEVICE_REQUEST if audio is not currently suspended, STATUS_IO_DEVICE_ERROR, STATUS_NO_MEDIA_IN_DEVICE, STATUS_DEVICE_NOT_READY, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
Returns the current position, media catalog, and ISRC track data.
Parameters.DeviceIoControl.OutputBufferLength in the I/O stack location indicates the size in bytes of the buffer, which must be >= sizeof(SUB_Q_CHANNEL_DATA).
The driver returns the SUB_Q_CHANNEL_DATA information in the buffer at Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_IO_DEVICE_ERROR, STATUS_INSUFFICIENT_RESOURCES, STATUS_INVALID_DEVICE_REQUEST, STATUS_NO_MEDIA_IN_DEVICE, STATUS_DEVICE_NOT_READY, STATUS_IO_TIME_OUT, or STATUS_VERIFY_REQUIRED.
This IOCTL is replaced by IOCTL_STORAGE_FIND_NEW_DEVICES. The only difference between the two IOCTLs is the base code.
Determines whether another device that the driver supports has just been connected to the I/O bus. If such a device is found, the driver sets up any necessary system objects and resources to handle I/O requests for its new device. It also initializes the device on receipt of this request dynamically: that is, without requiring the machine to be rebooted. Such a driver is assumed to support devices connected on a dynamically configurable I/O bus.
None
None
The Information field is set to zero. The Status field can be set to STATUS_SUCCESS or to any value returned by the driver’s (re)initialization code.
Reads data from the CD-ROM in raw mode.
If the IOCTL is from user mode, Irp->AssociatedIrp.SystemBuffer contains a structure that specifies the starting disk offset, the sector count, and the track mode (XA or CDDA) for the read. Parameters.DeviceIoControl.InputBufferLength specifies the size in bytes of the structure, which must be >= sizeof(RAW_READ_INFO). Parameters.DeviceIoControl.OutputBufferLength specifies the size of the buffer to be read, which must be >= sizeof(SectorCount * RAW_SECTOR_SIZE).
If the IOCTL is from kernel mode, Parameters.DeviceIoControl.Type3InputBuffer contains a structure that specifies the starting disk offset, the sector count, and the track mode (XA or CDDA) for the read. Parameters.DeviceIoControl.OutputBufferLength specifies the size of the buffer to be read, which must be >= sizeof(SectorCount * RAW_SECTOR_SIZE).
The driver writes the requested bytes directly (using DMA or PIO) to the buffer described by the MDL at Irp->MdlAddress.
If the read is successful, the driver sets Status to STATUS_SUCCESS and Information to the number of bytes transferred. If the read is not successful, the driver sets Information to zero and Status to possibly STATUS_INVALID_PARAMETER, STATUS_INSUFFICIENT_RESOURCES, or STATUS_INVALID_DEVICE_REQUEST.
None. This I/O control code has been replaced by IOCTL_DeviceType_LOAD_MEDIA, described in Chapter 9.