Author: pschweitzer
Date: Sat Feb 11 20:26:33 2017
New Revision: 73778

URL: http://svn.reactos.org/svn/reactos?rev=73778&view=rev
Log:
[FASTFAT]
In case of an error while trying to verify the volume, only return 
STATUS_WRONG_VOLUME is raw mounts are allowed

Modified:
    trunk/reactos/drivers/filesystems/fastfat/fsctl.c

Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfat/fsctl.c?rev=73778&r1=73777&r2=73778&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fsctl.c   [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c   [iso-8859-1] Sat Feb 11 
20:26:33 2017
@@ -622,11 +622,14 @@
     FATINFO FatInfo;
     BOOLEAN RecognizedFS;
     PDEVICE_EXTENSION DeviceExt;
+    BOOLEAN AllowRaw;
 
     DPRINT("VfatVerify(IrpContext %p)\n", IrpContext);
 
     DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
     DeviceExt = DeviceToVerify->DeviceExtension;
+    AllowRaw = BooleanFlagOn(IrpContext->Stack->Flags, SL_ALLOW_RAW_MOUNT);
+
     Status = VfatBlockDeviceIoControl(DeviceExt->StorageDevice,
                                       IOCTL_DISK_CHECK_VERIFY,
                                       NULL,
@@ -637,14 +640,15 @@
     if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
     {
         DPRINT("VfatBlockDeviceIoControl() failed (Status %lx)\n", Status);
-        Status = STATUS_WRONG_VOLUME;
+        Status = (AllowRaw ? STATUS_WRONG_VOLUME : Status);
     }
     else
     {
         Status = VfatHasFileSystem(DeviceExt->StorageDevice, &RecognizedFS, 
&FatInfo, TRUE);
         if (!NT_SUCCESS(Status) || RecognizedFS == FALSE)
         {
-            Status = STATUS_WRONG_VOLUME;
+            if (NT_SUCCESS(Status) || AllowRaw)
+                Status = STATUS_WRONG_VOLUME;
         }
         else if (sizeof(FATINFO) == RtlCompareMemory(&FatInfo, 
&DeviceExt->FatInfo, sizeof(FATINFO)))
         {


Reply via email to