Checking Flags in the Device Object
For each IRP requesting an I/O operation to/from removable media, a removable-media device driver must determine whether DO_VERIFY_VOLUME is already set in its DeviceObject->Flags. If this value is set, the driver must do the following:
For IRP_MJ_READ, IRP_MJ_WRITE, and IRP_MJ_DEVICE_CONTROL requests, check whether SL_OVERRIDE_VERIFY_VOLUME is set in the Flags member of the driver's IO_STACK_LOCATION structure. If it is, continue the requested operation.
Device control requests that return information about the logical structure of the underlying media have SL_OVERRIDE_VERIFY_VOLUME set in the I/O stack location's Flags member when an IFS mounts or remounts a removable-media volume.
Otherwise, the driver must refuse to carry out I/O requests for the corresponding drive, device, or partition while DO_VERIFY_VOLUME is set in its DeviceObject->Flags. A removable media driver must fail IRPs sent to the corresponding device as described in the preceding subsection, repeating both Steps 3 and 4 for each IRP until the FSD clears DO_VERIFY_VOLUME in the removable-media driver's DeviceObject->Flags.
If a removable-media device driver does not fail IRPs when DO_VERIFY_VOLUME is set and SL_OVERRIDE_VERIFY_VOLUME is not set for the preceding transfer requests, the file system can neither maintain the integrity of cached file data nor cause the user to be prompted to remount the media that holds an open file.