[FASTFAT]
[reactos.git] / reactos / drivers / filesystems / fastfat / fsctl.c
index bb455c0..06bb80d 100644 (file)
@@ -623,19 +623,28 @@ VfatVerify(
     BOOLEAN RecognizedFS;
     PDEVICE_EXTENSION DeviceExt;
     BOOLEAN AllowRaw;
+    PVPB Vpb;
+    ULONG ChangeCount, BufSize = sizeof(ChangeCount);
 
     DPRINT("VfatVerify(IrpContext %p)\n", IrpContext);
 
     DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
     DeviceExt = DeviceToVerify->DeviceExtension;
+    Vpb = IrpContext->Stack->Parameters.VerifyVolume.Vpb;
     AllowRaw = BooleanFlagOn(IrpContext->Stack->Flags, SL_ALLOW_RAW_MOUNT);
 
+    if (!BooleanFlagOn(Vpb->RealDevice->Flags, DO_VERIFY_VOLUME))
+    {
+        DPRINT("Already verified\n");
+        return STATUS_SUCCESS;
+    }
+
     Status = VfatBlockDeviceIoControl(DeviceExt->StorageDevice,
                                       IOCTL_DISK_CHECK_VERIFY,
                                       NULL,
                                       0,
-                                      NULL,
-                                      0,
+                                      &ChangeCount,
+                                      &BufSize,
                                       TRUE);
     if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
     {
@@ -671,7 +680,7 @@ VfatVerify(
         }
     }
 
-    IrpContext->Stack->Parameters.VerifyVolume.Vpb->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
+    Vpb->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
 
     return Status;
 }