* Sync up to trunk head (r65394).
[reactos.git] / drivers / filesystems / fastfat / cleanup.c
index f9bde77..6d64ee1 100644 (file)
@@ -38,7 +38,6 @@ VfatCleanupFile(
     if (pFcb->Flags & FCB_IS_VOLUME)
     {
         pFcb->OpenHandleCount--;
-        DeviceExt->OpenHandleCount--;
 
         if (pFcb->OpenHandleCount != 0)
         {
@@ -111,6 +110,11 @@ VfatCleanupFile(
         ExReleaseResourceLite(&pFcb->MainResource);
     }
 
+    if (DeviceExt->Flags & VCB_DISMOUNT_PENDING)
+    {
+        VfatCheckForDismount(DeviceExt, FALSE);
+    }
+
     return STATUS_SUCCESS;
 }