mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 12:18:13 +00:00
[CDFS]
- Prevent an infinite loop in CdfsDeviceIoControl if the the verify request is successful but IoCallDriver keeps returning STATUS_VERIFY_REQUIRED svn path=/trunk/; revision=55057
This commit is contained in:
parent
1481da8a20
commit
a9d56f0a13
|
@ -154,6 +154,7 @@ CdfsDeviceIoControl (IN PDEVICE_OBJECT DeviceObject,
|
||||||
KEVENT Event;
|
KEVENT Event;
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
BOOLEAN LastChance = FALSE;
|
||||||
|
|
||||||
DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, "
|
DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, "
|
||||||
"InputBuffer %x, InputBufferSize %x, OutputBuffer %x, "
|
"InputBuffer %x, InputBufferSize %x, OutputBuffer %x, "
|
||||||
|
@ -208,21 +209,30 @@ again:
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT DeviceToVerify;
|
PDEVICE_OBJECT DeviceToVerify;
|
||||||
|
|
||||||
DPRINT1("STATUS_VERIFY_REQUIRED\n");
|
|
||||||
DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
|
DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
|
||||||
IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
|
IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
|
||||||
|
|
||||||
if (DeviceToVerify)
|
if (DeviceToVerify)
|
||||||
{
|
{
|
||||||
Status = IoVerifyVolume(DeviceToVerify, FALSE);
|
Status = IoVerifyVolume(DeviceToVerify, FALSE);
|
||||||
DPRINT1("IoVerifyVolume() returned (Status %lx)\n", Status);
|
DPRINT("IoVerifyVolume() returned (Status %lx)\n", Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status) && !LastChance)
|
||||||
{
|
{
|
||||||
DPRINT1("Volume verify succeeded; trying request again\n");
|
DPRINT1("Volume verify succeeded; trying request again\n");
|
||||||
|
LastChance = TRUE;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
else if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to read after successful verify, aborting\n");
|
||||||
|
Status = STATUS_DEVICE_NOT_READY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT1("IoVerifyVolume() failed (Status %lx)\n", Status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Returning Status %x\n", Status);
|
DPRINT("Returning Status %x\n", Status);
|
||||||
|
|
Loading…
Reference in a new issue