Don't check the share access for directories.
[reactos.git] / reactos / drivers / fs / vfat / cleanup.c
index 7b3a26a..c56f4fb 100644 (file)
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
  * FILE:             drivers/fs/vfat/cleanup.c
@@ -23,10 +22,10 @@ VfatCleanupFile(PVFAT_IRP_CONTEXT IrpContext)
 {
   PVFATFCB pFcb;
   PFILE_OBJECT FileObject = IrpContext->FileObject;
-  
+
   DPRINT("VfatCleanupFile(DeviceExt %x, FileObject %x)\n",
         IrpContext->DeviceExt, FileObject);
-  
+
   /* FIXME: handle file/directory deletion here */
   pFcb = (PVFATFCB) FileObject->FsContext;
   if (pFcb)
@@ -76,7 +75,10 @@ VfatCleanupFile(PVFAT_IRP_CONTEXT IrpContext)
      CcUninitializeCacheMap (FileObject, NULL, NULL);
 #endif
      pFcb->OpenHandleCount--;
-     IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
+     if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY))
+       {
+         IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
+       }
     }
   return STATUS_SUCCESS;
 }