https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d52f937120b8e82838fb3e15ba3cf485d88e1d13

commit d52f937120b8e82838fb3e15ba3cf485d88e1d13
Author:     Jérôme Gardou <[email protected]>
AuthorDate: Thu Feb 4 10:46:31 2021 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Thu Feb 4 10:50:59 2021 +0100

    [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.
---
 modules/rostests/kmtests/ntos_mm/NtCreateSection_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/rostests/kmtests/ntos_mm/NtCreateSection_drv.c 
b/modules/rostests/kmtests/ntos_mm/NtCreateSection_drv.c
index a547207f211..29415465c95 100644
--- a/modules/rostests/kmtests/ntos_mm/NtCreateSection_drv.c
+++ b/modules/rostests/kmtests/ntos_mm/NtCreateSection_drv.c
@@ -256,7 +256,7 @@ TestIrpHandler(
         {
             DPRINT1("Init\n");
 
-            CcInitializeCacheMap(IoStack->FileObject, 
+            CcInitializeCacheMap(IoStack->FileObject,
                                  (PCC_FILE_SIZES)&Fcb->Header.AllocationSize,
                                  FALSE, &Callbacks, NULL);
         }
@@ -299,7 +299,7 @@ TestIrpHandler(
                     {
                         DPRINT1("Init\n");
                         
ok_eq_ulong(RtlCompareUnicodeString(&IoStack->FileObject->FileName, &InitOnRW, 
FALSE), 0);
-                        CcInitializeCacheMap(IoStack->FileObject, 
+                        CcInitializeCacheMap(IoStack->FileObject,
                                              
(PCC_FILE_SIZES)&Fcb->Header.AllocationSize,
                                              FALSE, &Callbacks, Fcb);
                     }
@@ -417,7 +417,7 @@ TestIrpHandler(
         {
             LARGE_INTEGER Zero = RTL_CONSTANT_LARGE_INTEGER(0LL);
 
-            if (CcIsFileCached(IoStack->FileObject))
+            if (IoStack->FileObject->SectionObjectPointer->DataSectionObject)
             {
                 CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
                 CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, 
FALSE);

Reply via email to