- Always try to uninitialize the file cache in VfatCleanupFile.
- Try to purge the file cache if the last handle is closed and deleting of the file was requested.
Modified: trunk/reactos/drivers/fs/vfat/cleanup.c

Modified: trunk/reactos/drivers/fs/vfat/cleanup.c
--- trunk/reactos/drivers/fs/vfat/cleanup.c	2005-01-25 20:53:37 UTC (rev 13275)
+++ trunk/reactos/drivers/fs/vfat/cleanup.c	2005-01-25 21:05:38 UTC (rev 13276)
@@ -46,16 +46,22 @@
 	 VfatUpdateEntry (pFcb);
        }
 
-     /* Uninitialize file cache if initialized for this file object. */
-     if (FileObject->PrivateCacheMap)
+     if (pFcb->Flags & FCB_DELETE_PENDING &&
+         pFcb->OpenHandleCount == 1)
        {
+#if 0
+         /* FIXME:
+	  *  CcPurgeCacheSection is unimplemented.
+	  */
+         CcPurgeCacheSection(FileObject->SectionObjectPointer, NULL, 0, FALSE);
+#endif
+       }
+     /* Uninitialize file cache if. */
 #ifdef USE_ROS_CC_AND_FS
-         CcRosReleaseFileCache (FileObject);
+     CcRosReleaseFileCache (FileObject);
 #else
-         CcUninitializeCacheMap (FileObject, NULL, NULL);
+     CcUninitializeCacheMap (FileObject, NULL, NULL);
 #endif
-       }
-
      pFcb->OpenHandleCount--;
      IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess);
     }