IOCTL_STORAGE_MCN_CONTROL IOCTL (ntddstor.h)
Temporarily enables or disables delivery of the custom PnP events GUID_IO_MEDIA_ARRIVAL and GUID_IO_MEDIA_REMOVAL on a removable-media device. This, in turn, enables or disables media change detection (AutoPlay) for the device if the caller has opened the device with FILE_READ_ATTRIBUTES access and if the device has AutoPlay enabled in the registry. The caller must not open the device for read or write access or the IOCTL operation will fail. This IOCTL has no effect on the AutoPlay setting in the registry.
A driver for such a removable-media device must do the following:
- Keep a count of disable requests, per physical device, in the device object extension.
- When called with this IOCTL, if the flag to disable media change detection is set, increment the count; if the flag is clear, decrement the count.
- Set the media change event for the device when the media state is changed only if the disable request count is zero.
Major code
Input buffer
The buffer at Irp->AssociatedIrp.SystemBuffer contains a Boolean value, with TRUE indicating that the driver should disable media change detection.
Input buffer length
The length of a Boolean.
Output buffer
None.
Output buffer length
None.
Status block
The Information field is set to zero. The Status field is set to STATUS_SUCCESS, or possibly to STATUS_BUFFER_TOO_SMALL, STATUS_INVALID_PARAMETER, or STATUS_INVALID_DEVICE_STATE.
Requirements
Requirement | Value |
---|---|
Header | ntddstor.h (include Ntddstor.h) |