PDEVICE_OBJECT
IoGetDeviceToVerify(
IN PETHREAD Thread
);
IoGetDeviceToVerify returns a pointer to the device object, representing a removable-media device, that is the target of the given thread’s I/O request.
IoGetDeviceToVerify returns a pointer to the device object representing a device on which the media should be verified, or it returns NULL.
In general, highest-level drivers, particularly file systems, are most likely to call this routine.
An underlying removable-media device driver is responsible for notifying higher-level drivers, particularly the file system, when the media appears to have changed since the last access to the target device. For more information about handling removable media, see the Kernel-Mode Driver Design Guide.
Callers of IoGetDeviceToVerify must be running at IRQL PASSIVE_LEVEL.
IoIsErrorUserInduced, IoSetHardErrorOrVerifyDevice, PsGetCurrentThread