[USP10_WINETEST] Sync with Wine Staging 2.9. CORE-13362
[reactos.git] / rostests / kmtests / ntos_mm / NtCreateSection_drv.c
index 8869308..dbbe7c9 100644 (file)
@@ -404,7 +404,8 @@ TestIrpHandler(
     {
         Fcb = IoStack->FileObject->FsContext;
         ok(Fcb != NULL, "Null pointer!\n");
     {
         Fcb = IoStack->FileObject->FsContext;
         ok(Fcb != NULL, "Null pointer!\n");
-        if (IoStack->FileObject->PrivateCacheMap != NULL)
+        if (IoStack->FileObject->SectionObjectPointer != NULL &&
+            IoStack->FileObject->SectionObjectPointer->SharedCacheMap != NULL)
         {
             CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
             CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE);
         {
             CcFlushCache(&Fcb->SectionObjectPointers, NULL, 0, NULL);
             CcPurgeCacheSection(&Fcb->SectionObjectPointers, NULL, 0, FALSE);
@@ -472,17 +473,30 @@ TestIrpHandler(
             }
             else
             {
             }
             else
             {
+                ULONG TestSize = 0;
+
                 ok(EOFInfo != NULL, "Null pointer!\n");
                 ok(Fcb != NULL, "Null pointer!\n");
                 ok_bool_false(IoStack->Parameters.SetFile.AdvanceOnly, "AdvanceOnly set!\n");
                 ok(EOFInfo->EndOfFile.QuadPart > Fcb->Header.AllocationSize.QuadPart, "New size smaller\n");
 
                 ok(EOFInfo != NULL, "Null pointer!\n");
                 ok(Fcb != NULL, "Null pointer!\n");
                 ok_bool_false(IoStack->Parameters.SetFile.AdvanceOnly, "AdvanceOnly set!\n");
                 ok(EOFInfo->EndOfFile.QuadPart > Fcb->Header.AllocationSize.QuadPart, "New size smaller\n");
 
+                if (Fcb->Header.AllocationSize.QuadPart != 0)
+                {
+                    TestSize = 512;
+                }
+
                 Fcb->Header.AllocationSize.QuadPart = EOFInfo->EndOfFile.QuadPart;
                 Fcb->Header.AllocationSize.QuadPart = EOFInfo->EndOfFile.QuadPart;
+                ok_eq_ulong(Fcb->Header.FileSize.QuadPart, TestSize);
+                ok_eq_ulong(Fcb->Header.ValidDataLength.QuadPart, TestSize);
+
                 if (CcIsFileCached(IoStack->FileObject))
                 {
                     CcSetFileSizes(IoStack->FileObject, (PCC_FILE_SIZES)(&(Fcb->Header.AllocationSize)));
                 }
 
                 if (CcIsFileCached(IoStack->FileObject))
                 {
                     CcSetFileSizes(IoStack->FileObject, (PCC_FILE_SIZES)(&(Fcb->Header.AllocationSize)));
                 }
 
+                ok_eq_ulong(Fcb->Header.FileSize.QuadPart, TestSize);
+                ok_eq_ulong(Fcb->Header.ValidDataLength.QuadPart, TestSize);
+
                 Status = STATUS_SUCCESS;
             }
         }
                 Status = STATUS_SUCCESS;
             }
         }