[KMTESTS:MM] Truncate file cache on uninitialize to avoid leaking a reference.
authorPierre Schweitzer <pierre@reactos.org>
Thu, 22 Mar 2018 21:34:21 +0000 (22:34 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 22 Mar 2018 21:35:19 +0000 (22:35 +0100)
ROSTESTS-266

modules/rostests/kmtests/ntos_mm/NtCreateSection_drv.c

index 5642ea5..45f20b5 100644 (file)
@@ -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');