The following summarizes the I/O control codes for sound device drivers. The Status field of the I/O status block also can be set to STATUS_CANCELLED for any asynchronous device I/O control request.
Returns information about the capabilities of the device, such as how many channels the wave input or output device has, which formats it supports, and the driver’s version.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer.
The driver returns as much WAVEOUTCAPSW or WAVEINCAPSW data as the buffer’s size permits to the buffer at Irp->AssociatedIrp.SystemBuffer.
Always returns STATUS_SUCCESS in the Status field and the size in bytes of the returned data in the Information field.
Determines whether the device supports the specified format.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the PCMWAVEFORMAT value to be tested. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer.
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_NOT_SUPPORTED if the device does not support the specified wave format or if the input buffer is not sizeof(PCMWAVEFORMAT).
Sets the format for a subsequent IOCTL_WAVE_PLAY request to the device. If the wave output device is opened but this request has not been received, the driver plays the wave output data at a device-specific default rate. If wave output is currently being played when this request is received, the interval until the new format takes effect is undefined.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the PCMWAVEFORMAT value to be set. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer.
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_NOT_SUPPORTED if the device does not support the specified wave format or if the input buffer is not sizeof(PCMWAVEFORMAT).
Determines the current state of the target device object.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes (a ULONG) of the buffer.
The driver returns a constant indicating the current state, one of WAVE_DD_IDLE (for the wave input device), WAVE_DD_STOPPED, WAVE_DD_PLAYING (for the wave output device), or WAVE_DD_RECORDING (for the wave input device) to the buffer at
Irp->AssociatedIrp.SystemBuffer.
When Status is set to STATUS_SUCCESS, the Information field is set to sizeof(ULONG). Otherwise, Status can be set to STATUS_BUFFER_TOO_SMALL.
Sets the target device to the specified state.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the state specification, one of the constants WAVE_DD_STOP (suspends input or output, but completes recording of at least one buffer from the wave input device), WAVE_DD_RESET (cancels all input or output and sets the position to zero, but may complete outstanding read/write requests for the wave input/output devices), WAVE_DD_PLAY (for the wave output device), or WAVE_DD_RECORD (for the wave input device). Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(ULONG).
None
When the Status field is set to STATUS_SUCCESS, the Information field is set to zero, as it is for every other possible Status value, which can be STATUS_BUFFER_TOO_SMALL, STATUS_PENDING if the wave output state cannot be set immediately, or STATUS_DEVICE_BUSY if a previously submitted request to set the wave output state is still pending.
Determines the number of sound samples and bytes processed.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_POSITION).
The driver returns the position information to the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned when the Status field is set to STATUS_SUCCESS. Otherwise, the Information field is set to zero when the Status field is set to STATUS_BUFFER_TOO_SMALL.
Determines the current volume of the wave output device, or returns the maximum value possible (WAVE_DD_MAX_VOLUME) if the device does not support volume control.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_VOLUME).
The driver returns the volume information to the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_NOT_SUPPORTED if the target device object is not wave output.
Sets the volume of the wave output device if it supports volume control.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the volume to be set. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_VOLUME).
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_NOT_SUPPORTED if the device hardware does not support volume setting, or STATUS_INVALID_PARAMETER if the target device object is not wave output.
Determines the current pitch setting of the wave output device if the device supports pitch control.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_PITCH).
The driver returns the current pitch setting to the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_NOT_SUPPORTED if the device does not support pitch control, or STATUS_INVALID_PARAMETER if the target device object is not wave output.
Sets the pitch of the wave output device for a subsequent IOCTL_WAVE_PLAY request if the device supports pitch control.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the pitch to be set. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_PITCH).
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_NOT_SUPPORTED, or STATUS_INVALID_PARAMETER.
Determines the current playback rate of the wave output device if the device supports playback-rate control.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_PLAYBACK_RATE).
The driver returns the playback-rate information to the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned when the Status field is set to STATUS_SUCCESS. Otherwise, the Information field is set to zero, and the Status field can be set to STATUS_BUFFER_TOO_SMALL, STATUS_NOT_SUPPORTED if the device does not support playback-rate control, or STATUS_INVALID_PARAMETER if the target device object is not wave output.
Sets the playback rate of the wave output device if the device supports playback-rate control.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the playback rate to be set. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(WAVE_DD_PLAYBACK_RATE).
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_NOT_SUPPORTED, or STATUS_INVALID_PARAMETER.
Sets the wave input device to “low priority mode,” that is, temporarily suspends recording if the adapter supports the operation. This request occurs when the wave input device object has already been opened (see the IRP_MJ_CREATE description in Section 5.1) and a second application gets a handle for the wave input device or for another device object that shares the same hardware. To satisfy this request, the driver suspends recording until the second application releases its handle (see the IRP_MJ_CLOSE description in Section 5.1). Supporting this I/O control request allows multimedia applications to use the hardware while voice input is being used to detect voice commands.
None
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_INVALID_PARAMETER if the target device object is not wave input or to STATUS_DEVICE_BUSY if low priority mode is already in effect or the device is busy for some other reason.
None. This IOCTL is obsolete.
None. This IOCTL is obsolete.
None. This IOCTL is obsolete.
Returns information about the capabilities of the device, such as how many voices and notes the output device has and whether it has volume control, or the manufacture and product identification of a MIDI input device, as well as the driver version number.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer.
The driver returns as much MIDIOUTCAPSW or MIDIINCAPSW data as the buffer’s size permits to the buffer at Irp->AssociatedIrp.SystemBuffer.
Always returns STATUS_SUCCESS in the Status field and the size in bytes of the returned data in the Information field.
Determines the current state of the target device object.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes (a ULONG) of the buffer.
The driver returns a constant indicating the current state, one of MIDI_DD_IDLE, MIDI_DD_STOPPED, MIDI_DD_PLAYING (for the MIDI output device), or MIDI_DD_RECORDING (for the MIDI input device) to the buffer at Irp->AssociatedIrp.SystemBuffer.
The Status field is set to STATUS_SUCCESS, and the Information field is set to sizeof(ULONG).
Sets the target device to the specified state.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the state specification, one of the constants MIDI_DD_STOP (suspend playing or recording), MIDI_DD_RESET (stop playing and cancel outstanding requests for the MIDI output device), MIDI_DD_PLAY (for the MIDI output device), or MIDI_DD_RECORD (for the MIDI input device). Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes (a ULONG) of the buffer.
None
When the Status field is set to STATUS_SUCCESS, the Information field is set to zero, as it is for every other possible Status value, which can be STATUS_PENDING or STATUS_DEVICE_BUSY if another state-change operation is not yet complete.
If the MIDI output device supports volume control, the driver returns the current volume setting of the device.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(MIDI_DD_VOLUME).
The driver returns the volume information in the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the amount of returned data. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_NOT_SUPPORTED.
If the MIDI output device supports volume control, the driver sets the volume of the device.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the volume to be set. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(MIDI_DD_VOLUME).
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_NOT_SUPPORTED.
Preloads the specified bank of patches (zero for the default patch bank) if the device’s internal synthesizer cannot keep all patches loaded simultaneously.
Parameters.DeviceIoControl.InputBufferLength indicates the size in
bytes, which must be >= sizeof(MIDI_DD_CACHE_PATCHES), of the buffer at
Irp->AssociatedIrp.SystemBuffer.
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_NOT_SUPPORTED.
Preloads the specified bank of key-based percussion patches (zero for the default drum patch bank) if the device’s internal synthesizer cannot keep all percussion patches loaded simultaneously.
Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes, which must be >= sizeof(MIDI_DD_CACHE_DRUM_PATCHES), of the buffer at Irp->AssociatedIrp.SystemBuffer.
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_NOT_SUPPORTED.
Transfers data from the calling user-mode thread’s buffer to the device.
The driver’s I/O stack location in the IRP has a pointer to the user buffer at Parameters.DeviceIoControl.Type3InputBuffer. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer.
None
The Information field is set to zero. The Status field can be set to STATUS_SUCCESS or to STATUS_DEVICE_BUSY if the MIDI output device is currently playing.
None. This IOCTL is obsolete.
Returns information about the capabilities of the MMAux (sound) device.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer.
The driver returns as much AUXCAPSW data as the buffer’s size permits to the buffer at Irp->AssociatedIrp.SystemBuffer.
Always returns STATUS_SUCCESS in the Status field and the size in bytes of the returned data in the Information field.
Determines the current volume of the MMAux device, or returns the maximum value possible (AUX_DD_MAX_VOLUME) if the device does not support volume control.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(AUX_DD_VOLUME).
The driver returns the volume information to the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_NOT_SUPPORTED if the target device object is not the MMAux device.
Sets the volume of the MMAux device if it supports volume control.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the volume to be set. Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(AUX_DD_VOLUME).
None
The Information field is set to zero. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_NOT_SUPPORTED if the device hardware does not support volume setting, or STATUS_INVALID_PARAMETER if the target device object is not the MMAux device.
Returns the configuration information defined by:
The output will contain the following data in the order listed here:
None
The driver returns the current configuration data to the buffer at Irp->AssociatedIrp.SystemBuffer. Note that if the buffer supplied by the caller is too small for the amount of available configuration data, the driver can return as much data as will fit and then indicate buffer overflow in the status block. The first member of the MIXER_DD_CONFIGURATION_DATA structure, cbSize, is the total configuration data available. This can be read in order to determine the correct amount of data to request.
The driver returns the amount of configuration data in the output buffer in the Information field. The Status field is either set to STATUS_SUCCESS or possibly STATUS_BUFFER_OVERFLOW if the output buffer is smaller than the amount of available configuration data.
Returns the control data for the control line whose id is specified in the MIXER_DD_READ_DATA structure supplied as input.
The buffer at Irp->AssociatedIrp.SystemBuffer specifies the control id for which data is to be read. The Parameters.DeviceIoControl.InputLength indicates the size in bytes of the input buffer, which must be >= sizeof(MIXER_DD_READ_DATA).
The driver returns the control data at Irp->AssociatedIrp.SystemBuffer.
The Status field either is set to STATUS_SUCCESS or STATUS_BUFFER_TOO_SMALL. The Information field contains the number of bytes returned.
Returns the line data for the line id specified in the MIXER_DD_READ_DATA structure supplied as input. The data is returned in the format described by the MIXER_DD_LINE_DATA structure. Only the MIXERLINE_LINEF_ACTIVE flag changes. If the driver sets the MIXERLINE_LINEF_DISCONNECTED flag, the line should be ignored by applications.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the line id for which data is to be read. The Parameters.DeviceIoControl.InputLength indicates the size in bytes of the input buffer, which must be >= sizeof(MIXER_DD_READ_DATA).
The driver returns line data to the buffer at Irp->AssociatedIrp.SystemBuffer.
The Status field is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL. The Information field is set to the number of bytes of returned data.
The caller should supply the same buffer for input and to receive the output. The driver will keep track of which changes have been reflected to the application by reading the CurrentLogicalTime member. The driver increments this member for each change.
Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(MIXER_DD_REQUEST_NOTIFY). The Irp->AssociatedIrp.SystemBuffer will be a buffer of type MIXER_DD_REQUEST_NOTIFY.
The driver returns changes in the buffer at Irp->AssociatedIrp.SystemBuffer. This buffer should be the same buffer supplied as input and must be >= sizeof(MIXER_DD_REQUEST_NOTIFY).
The Status field is set to STATUS_SUCCESS, or possibly one of the following: STATUS_BUFFER_TOO_SMALL if the supplied buffer is < sizeof(MIXER_DD_REQUEST_NOTIFY), to STATUS_PENDING, or to STATUS_INVALID_PARAMETER if the time field in the input buffer is invalid.
Returns the actual volume of the MMAux device when its current value does not match the requested setting, provided that the device supports volume control. This request is usually asynchronous. It is completed as soon as the volume of the Aux device differs from the values that were set.
Parameters.DeviceIoControl.OutputBufferLength indicates the size in bytes of the buffer, which must be >= sizeof(AUX_DD_VOLUME).
The driver returns the current volume setting to the buffer at
Irp->AssociatedIrp.SystemBuffer.
The Information field is set to the number of bytes returned. The Status field either is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_INSUFFICIENT_RESOURCES, or STATUS_NOT_SUPPORTED if the hardware does not support volume setting.