[FASTFAT]
[reactos.git] / reactos / drivers / filesystems / fastfat / close.c
index 4e8ce3f..54a1280 100644 (file)
@@ -41,7 +41,7 @@ VfatCloseFile(
 
     if (pFcb->Flags & FCB_IS_VOLUME)
     {
-        DPRINT1("Volume\n");
+        DPRINT("Volume\n");
         FileObject->FsContext2 = NULL;
     }
     else
@@ -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;
 }