{
IrpContext->Flags |= IRPCONTEXT_PENDINGRETURNED;
}
+ else
+ {
+ IrpContext->Flags &= ~IRPCONTEXT_PENDINGRETURNED;
+ }
if (!NT_SUCCESS(Irp->IoStatus.Status))
{
IrpContext->Irp->IoStatus.Status = Irp->IoStatus.Status;
KEVENT event;
NTSTATUS Status;
+again:
KeInitializeEvent (&event, NotificationEvent, FALSE);
DPRINT ("VfatReadDisk(pDeviceObject %p, Offset %I64x, Length %d, Buffer %p)\n",
Status = IoStatus.Status;
}
+ 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 read request\n");
+ goto again;
+ }
+ }
+
if (!NT_SUCCESS (Status))
{
DPRINT ("IO failed!!! VfatReadDisk : Error code: %x\n", Status);
Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset;
+again:
Irp = IoAllocateIrp(IrpContext->DeviceExt->StorageDevice->StackSize, TRUE);
if (Irp == NULL)
{
Status = IrpContext->Irp->IoStatus.Status;
}
+ 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 read request\n");
+ goto again;
+ }
+ }
+
DPRINT("%x\n", Status);
return Status;
}
Buffer = (PCHAR)MmGetMdlVirtualAddress(IrpContext->Irp->MdlAddress) + BufferOffset;
+again:
DPRINT ("Building asynchronous FSD Request...\n");
Irp = IoAllocateIrp(IrpContext->DeviceExt->StorageDevice->StackSize, TRUE);
if (Irp == NULL)
Status = IrpContext->Irp->IoStatus.Status;
}
+ 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;
+ }
+ }
+
return Status;
}
InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize,
OutputBufferSize ? *OutputBufferSize : 0);
+again:
KeInitializeEvent (&Event, NotificationEvent, FALSE);
DPRINT("Building device I/O control request ...\n");
Status = IoStatus.Status;
}
+
+ 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 IOCTL request\n");
+ goto again;
+ }
+ }
if (OutputBufferSize)
{