mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +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--;
|
pFcb->OpenHandleCount--;
|
||||||
DeviceExt->OpenHandleCount--;
|
DeviceExt->OpenHandleCount--;
|
||||||
|
|
||||||
if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) &&
|
if (!vfatFCBIsDirectory(pFcb) &&
|
||||||
FsRtlAreThereCurrentFileLocks(&pFcb->FileLock))
|
FsRtlAreThereCurrentFileLocks(&pFcb->FileLock))
|
||||||
{
|
{
|
||||||
/* remove all locks this process have on this file */
|
/* remove all locks this process have on this file */
|
||||||
|
@ -84,18 +84,26 @@ VfatCleanupFile(
|
||||||
if (pFcb->Flags & FCB_DELETE_PENDING &&
|
if (pFcb->Flags & FCB_DELETE_PENDING &&
|
||||||
pFcb->OpenHandleCount == 0)
|
pFcb->OpenHandleCount == 0)
|
||||||
{
|
{
|
||||||
PFILE_OBJECT tmpFileObject;
|
if (vfatFCBIsDirectory(pFcb) &&
|
||||||
tmpFileObject = pFcb->FileObject;
|
!VfatIsDirectoryEmpty(pFcb))
|
||||||
if (tmpFileObject != NULL)
|
|
||||||
{
|
{
|
||||||
pFcb->FileObject = NULL;
|
pFcb->Flags &= ~FCB_DELETE_PENDING;
|
||||||
CcUninitializeCacheMap(tmpFileObject, NULL, NULL);
|
|
||||||
ObDereferenceObject(tmpFileObject);
|
|
||||||
}
|
}
|
||||||
|
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.ValidDataLength.QuadPart = 0;
|
||||||
pFcb->RFCB.FileSize.QuadPart = 0;
|
pFcb->RFCB.FileSize.QuadPart = 0;
|
||||||
pFcb->RFCB.AllocationSize.QuadPart = 0;
|
pFcb->RFCB.AllocationSize.QuadPart = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Uninitialize the cache (should be done even if caching was never initialized) */
|
/* Uninitialize the cache (should be done even if caching was never initialized) */
|
||||||
|
|
Loading…
Reference in a new issue