[KMTESTS:NTOS_MM] Purge & flush cache when there is a data section object.

Those purge & flush the mapped sections too. That's what fastfat_new & other FS drivers do.
This commit is contained in:
Jérôme Gardou 2021-02-04 10:46:31 +01:00
parent 111e40039e
commit d52f937120

View file

@ -256,7 +256,7 @@ TestIrpHandler(
{ {
DPRINT1("Init\n"); DPRINT1("Init\n");
CcInitializeCacheMap(IoStack->FileObject, CcInitializeCacheMap(IoStack->FileObject,
(PCC_FILE_SIZES)&Fcb->Header.AllocationSize, (PCC_FILE_SIZES)&Fcb->Header.AllocationSize,
FALSE, &Callbacks, NULL); FALSE, &Callbacks, NULL);
} }
@ -299,7 +299,7 @@ TestIrpHandler(
{ {
DPRINT1("Init\n"); DPRINT1("Init\n");
ok_eq_ulong(RtlCompareUnicodeString(&IoStack->FileObject->FileName, &InitOnRW, FALSE), 0); ok_eq_ulong(RtlCompareUnicodeString(&IoStack->FileObject->FileName, &InitOnRW, FALSE), 0);
CcInitializeCacheMap(IoStack->FileObject, CcInitializeCacheMap(IoStack->FileObject,
(PCC_FILE_SIZES)&Fcb->Header.AllocationSize, (PCC_FILE_SIZES)&Fcb->Header.AllocationSize,
FALSE, &Callbacks, Fcb); FALSE, &Callbacks, Fcb);
} }
@ -417,7 +417,7 @@ TestIrpHandler(
{ {
LARGE_INTEGER Zero = RTL_CONSTANT_LARGE_INTEGER(0LL); LARGE_INTEGER Zero = RTL_CONSTANT_LARGE_INTEGER(0LL);
if (CcIsFileCached(IoStack->FileObject)) if (IoStack->FileObject->SectionObjectPointer->DataSectionObject)
{ {
CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL); CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE); CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE);