[FASTFAT] Uninit directory cache on last handle close.

CORE-14629
CORE-14557
This commit is contained in:
Pierre Schweitzer 2018-05-18 14:51:24 +02:00
parent 3c3ebe3320
commit a837694518
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
2 changed files with 14 additions and 0 deletions

View file

@ -48,6 +48,19 @@ VfatCloseFile(
}
else
{
if (pFcb->OpenHandleCount == 0 && BooleanFlagOn(pFcb->Flags, FCB_CACHE_INITIALIZED))
{
PFILE_OBJECT tmpFileObject;
tmpFileObject = pFcb->FileObject;
if (tmpFileObject != NULL)
{
pFcb->FileObject = NULL;
CcUninitializeCacheMap(tmpFileObject, NULL, NULL);
ClearFlag(pFcb->Flags, FCB_CACHE_INITIALIZED);
ObDereferenceObject(tmpFileObject);
}
}
#ifdef KDBG
pFcb->Flags |= FCB_CLOSED;
#endif

View file

@ -37,6 +37,7 @@ vfatFCBInitializeCacheFromVolume(
}
ASSERT(vfatFCBIsDirectory(fcb));
ASSERT(fcb->FileObject == NULL);
Acquired = FALSE;
if (!ExIsResourceAcquiredExclusive(&vcb->DirResource))