+ if (Status == STATUS_VERIFY_REQUIRED)
+ {
+ PDEVICE_OBJECT DeviceToVerify;
+
+ DPRINT1 ("Media change detected!\n");
+
+ /* Find the device to verify and reset the thread field to empty value again. */
+ DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ());
+ IoSetDeviceToVerify (PsGetCurrentThread (), NULL);
+ Status = IoVerifyVolume (DeviceToVerify,
+ FALSE);
+
+ if (NT_SUCCESS(Status))
+ {
+ DPRINT1 ("Volume verification successful; Reissuing write request\n");
+ goto again;
+ }
+ }
+