[FASTFAT]
[reactos.git] / reactos / drivers / filesystems / fastfat / close.c
index b91b85b..54a1280 100644 (file)
@@ -75,12 +75,18 @@ VfatCloseFile(
     FileObject->FsContext2 = NULL;
     FileObject->FsContext = NULL;
     FileObject->SectionObjectPointer = NULL;
+    DeviceExt->OpenHandleCount--;
 
     if (pCcb)
     {
         vfatDestroyCCB(pCcb);
     }
 
+    if (DeviceExt->OpenHandleCount == 0)
+    {
+        VfatCheckForDismount(DeviceExt, FALSE);
+    }
+
     return Status;
 }