- Use IoIsErrorUserInoduced to check if we couldn't mount the device because it was not actually inserted, was unrocognized, write-protected, etc... and completely break out of the mounting procedure if so.

- Also use FsRtlIsTotalDeviceFailure to check if the error was a fatal device error (like a CRC error) and abandon mounting in this case as well.

svn path=/trunk/; revision=22765
This commit is contained in:
Alex Ionescu 2006-07-02 06:15:52 +00:00
parent 23be4d46c6
commit ff429eb9f3

View file

@ -479,6 +479,15 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
}
else
{
/* Check if we failed because of the user */
if ((IoIsErrorUserInduced(Status)) &&
(IoStatusBlock.Information == 1))
{
/* Break out and fail */
break;
}
/* Otherwise, check if we need to load the FS driver */
if (Status == STATUS_FS_DRIVER_REQUIRED)
{
/* We need to release the lock */
@ -497,7 +506,6 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
if (!DeviceIsLocked)
{
/* Lock it ourselves */
DPRINT1("Waiting\n");
Status = KeWaitForSingleObject(&DeviceObject->
DeviceLock,
Executive,
@ -531,6 +539,19 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
LocalList.Flink = FsList->Flink;
ListEntry = &LocalList;
}
/*
* Check if we failed with any other error then an unrecognized
* volume, and if this request doesn't allow mounting the raw
* file system.
*/
if (!(AllowRawMount) &&
(Status != STATUS_UNRECOGNIZED_VOLUME) &&
(FsRtlIsTotalDeviceFailure(Status)))
{
/* Break out and give up */
break;
}
}
/* Go to the next FS entry */