From 0d480e9966426a3eac539e4bee0ebcd60fe510f5 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 11 Feb 2017 20:26:33 +0000 Subject: [PATCH] [FASTFAT] In case of an error while trying to verify the volume, only return STATUS_WRONG_VOLUME is raw mounts are allowed svn path=/trunk/; revision=73778 --- reactos/drivers/filesystems/fastfat/fsctl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/fsctl.c b/reactos/drivers/filesystems/fastfat/fsctl.c index ff222f502ad..bb455c032d5 100644 --- a/reactos/drivers/filesystems/fastfat/fsctl.c +++ b/reactos/drivers/filesystems/fastfat/fsctl.c @@ -622,11 +622,14 @@ VfatVerify( 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 @@ VfatVerify( 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))) {