Index: cleanup.c =================================================================== --- drivers/filesystems/fastfat/cleanup.c (revision 66919) +++ drivers/filesystems/fastfat/cleanup.c (working copy) @@ -93,12 +93,31 @@ ObDereferenceObject(tmpFileObject); } - CcPurgeCacheSection(FileObject->SectionObjectPointer, NULL, 0, FALSE); + pFcb->RFCB.ValidDataLength.QuadPart = 0; + pFcb->RFCB.FileSize.QuadPart = 0; + pFcb->RFCB.AllocationSize.QuadPart = 0; } /* Uninitialize the cache (should be done even if caching was never initialized) */ CcUninitializeCacheMap(FileObject, &pFcb->RFCB.FileSize, NULL); + if (pFcb->Flags & FCB_DELETE_PENDING && + pFcb->OpenHandleCount == 0) + { + VfatDelEntry(DeviceExt, pFcb, NULL); + + FsRtlNotifyFullReportChange(DeviceExt->NotifySync, + &(DeviceExt->NotifyList), + (PSTRING)&pFcb->PathNameU, + pFcb->PathNameU.Length - pFcb->LongNameU.Length, + NULL, + NULL, + ((*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) ? + FILE_NOTIFY_CHANGE_DIR_NAME : FILE_NOTIFY_CHANGE_FILE_NAME), + FILE_ACTION_REMOVED, + NULL); + } + if (pFcb->OpenHandleCount != 0) { IoRemoveShareAccess(FileObject, &pFcb->FCBShareAccess); Index: close.c =================================================================== --- drivers/filesystems/fastfat/close.c (revision 66919) +++ drivers/filesystems/fastfat/close.c (working copy) @@ -46,29 +46,6 @@ } else { - if (FileObject->DeletePending) - { - if (pFcb->Flags & FCB_DELETE_PENDING) - { - VfatDelEntry(DeviceExt, pFcb, NULL); - - FsRtlNotifyFullReportChange(DeviceExt->NotifySync, - &(DeviceExt->NotifyList), - (PSTRING)&pFcb->PathNameU, - pFcb->PathNameU.Length - pFcb->LongNameU.Length, - NULL, - NULL, - ((*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) ? - FILE_NOTIFY_CHANGE_DIR_NAME : FILE_NOTIFY_CHANGE_FILE_NAME), - FILE_ACTION_REMOVED, - NULL); - } - else - { - Status = STATUS_DELETE_PENDING; - } - } - vfatReleaseFCB(DeviceExt, pFcb); }