Author: ion
Date: Sun Jul 2 10:15:52 2006
New Revision: 22765
URL:
http://svn.reactos.org/svn/reactos?rev=22765&view=rev
Log:
- 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.
Modified:
trunk/reactos/ntoskrnl/io/iomgr/volume.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/volume.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/volume.c Sun Jul 2 10:15:52 2006
@@ -479,6 +479,15 @@
}
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 @@
if (!DeviceIsLocked)
{
/* Lock it ourselves */
- DPRINT1("Waiting\n");
Status = KeWaitForSingleObject(&DeviceObject->
DeviceLock,
Executive,
@@ -531,6 +539,19 @@
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 */