mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 16:31:07 +08:00
[KMTESTS:MM] Truncate file cache on uninitialize to avoid leaking a reference.
ROSTESTS-266
This commit is contained in:
@@ -416,10 +416,12 @@ TestIrpHandler(
|
||||
if (IoStack->FileObject->SectionObjectPointer != NULL &&
|
||||
IoStack->FileObject->SectionObjectPointer->SharedCacheMap != NULL)
|
||||
{
|
||||
LARGE_INTEGER Zero = RTL_CONSTANT_LARGE_INTEGER(0LL);
|
||||
|
||||
CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
|
||||
CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE);
|
||||
KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
|
||||
CcUninitializeCacheMap(IoStack->FileObject, NULL, &CacheUninitEvent);
|
||||
CcUninitializeCacheMap(IoStack->FileObject, &Zero, &CacheUninitEvent);
|
||||
KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
|
||||
}
|
||||
ExFreePoolWithTag(Fcb, 'FwrI');
|
||||
|
||||
Reference in New Issue
Block a user