mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[FASTFAT]
- Cancel deletion of a directory if it is not empty when its last handle is closed CORE-6931 svn path=/trunk/; revision=72195
This commit is contained in:
parent
d2ae65c710
commit
3b70374248
1 changed files with 18 additions and 10 deletions
|
@ -66,7 +66,7 @@ VfatCleanupFile(
|
|||
pFcb->OpenHandleCount--;
|
||||
DeviceExt->OpenHandleCount--;
|
||||
|
||||
if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||
if (!vfatFCBIsDirectory(pFcb) &&
|
||||
FsRtlAreThereCurrentFileLocks(&pFcb->FileLock))
|
||||
{
|
||||
/* remove all locks this process have on this file */
|
||||
|
@ -84,18 +84,26 @@ VfatCleanupFile(
|
|||
if (pFcb->Flags & FCB_DELETE_PENDING &&
|
||||
pFcb->OpenHandleCount == 0)
|
||||
{
|
||||
PFILE_OBJECT tmpFileObject;
|
||||
tmpFileObject = pFcb->FileObject;
|
||||
if (tmpFileObject != NULL)
|
||||
if (vfatFCBIsDirectory(pFcb) &&
|
||||
!VfatIsDirectoryEmpty(pFcb))
|
||||
{
|
||||
pFcb->FileObject = NULL;
|
||||
CcUninitializeCacheMap(tmpFileObject, NULL, NULL);
|
||||
ObDereferenceObject(tmpFileObject);
|
||||
pFcb->Flags &= ~FCB_DELETE_PENDING;
|
||||
}
|
||||
else
|
||||
{
|
||||
PFILE_OBJECT tmpFileObject;
|
||||
tmpFileObject = pFcb->FileObject;
|
||||
if (tmpFileObject != NULL)
|
||||
{
|
||||
pFcb->FileObject = NULL;
|
||||
CcUninitializeCacheMap(tmpFileObject, NULL, NULL);
|
||||
ObDereferenceObject(tmpFileObject);
|
||||
}
|
||||
|
||||
pFcb->RFCB.ValidDataLength.QuadPart = 0;
|
||||
pFcb->RFCB.FileSize.QuadPart = 0;
|
||||
pFcb->RFCB.AllocationSize.QuadPart = 0;
|
||||
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) */
|
||||
|
|
Loading…
Reference in a new issue