mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:23:03 +00:00
[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
This commit is contained in:
parent
90905aac47
commit
0d480e9966
1 changed files with 6 additions and 2 deletions
|
@ -622,11 +622,14 @@ VfatVerify(
|
||||||
FATINFO FatInfo;
|
FATINFO FatInfo;
|
||||||
BOOLEAN RecognizedFS;
|
BOOLEAN RecognizedFS;
|
||||||
PDEVICE_EXTENSION DeviceExt;
|
PDEVICE_EXTENSION DeviceExt;
|
||||||
|
BOOLEAN AllowRaw;
|
||||||
|
|
||||||
DPRINT("VfatVerify(IrpContext %p)\n", IrpContext);
|
DPRINT("VfatVerify(IrpContext %p)\n", IrpContext);
|
||||||
|
|
||||||
DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
|
DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
|
||||||
DeviceExt = DeviceToVerify->DeviceExtension;
|
DeviceExt = DeviceToVerify->DeviceExtension;
|
||||||
|
AllowRaw = BooleanFlagOn(IrpContext->Stack->Flags, SL_ALLOW_RAW_MOUNT);
|
||||||
|
|
||||||
Status = VfatBlockDeviceIoControl(DeviceExt->StorageDevice,
|
Status = VfatBlockDeviceIoControl(DeviceExt->StorageDevice,
|
||||||
IOCTL_DISK_CHECK_VERIFY,
|
IOCTL_DISK_CHECK_VERIFY,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -637,14 +640,15 @@ VfatVerify(
|
||||||
if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
|
if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
|
||||||
{
|
{
|
||||||
DPRINT("VfatBlockDeviceIoControl() failed (Status %lx)\n", Status);
|
DPRINT("VfatBlockDeviceIoControl() failed (Status %lx)\n", Status);
|
||||||
Status = STATUS_WRONG_VOLUME;
|
Status = (AllowRaw ? STATUS_WRONG_VOLUME : Status);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Status = VfatHasFileSystem(DeviceExt->StorageDevice, &RecognizedFS, &FatInfo, TRUE);
|
Status = VfatHasFileSystem(DeviceExt->StorageDevice, &RecognizedFS, &FatInfo, TRUE);
|
||||||
if (!NT_SUCCESS(Status) || RecognizedFS == FALSE)
|
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)))
|
else if (sizeof(FATINFO) == RtlCompareMemory(&FatInfo, &DeviceExt->FatInfo, sizeof(FATINFO)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue