mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 15:22:21 +00:00
[KMTESTS:MM] Properly clean up files
This fixes driver unloading on Windows. ROSTESTS-266
This commit is contained in:
parent
02b0ca08e4
commit
c79e5dc476
1 changed files with 7 additions and 4 deletions
|
@ -413,13 +413,16 @@ TestIrpHandler(
|
|||
{
|
||||
Fcb = IoStack->FileObject->FsContext;
|
||||
ok(Fcb != NULL, "Null pointer!\n");
|
||||
if (IoStack->FileObject->SectionObjectPointer != NULL &&
|
||||
IoStack->FileObject->SectionObjectPointer->SharedCacheMap != NULL)
|
||||
if (IoStack->FileObject->SectionObjectPointer != NULL)
|
||||
{
|
||||
LARGE_INTEGER Zero = RTL_CONSTANT_LARGE_INTEGER(0LL);
|
||||
|
||||
CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
|
||||
CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE);
|
||||
if (CcIsFileCached(IoStack->FileObject))
|
||||
{
|
||||
CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
|
||||
CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE);
|
||||
}
|
||||
|
||||
KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
|
||||
CcUninitializeCacheMap(IoStack->FileObject, &Zero, &CacheUninitEvent);
|
||||
KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue