Fcb = ExAllocatePool(NonPagedPool, sizeof(TEST_FCB));
if (!skip(Fcb != NULL, "ExAllocatePool failed\n"))
{
+ BOOLEAN PinAccess = (TestId != 4);
+
RtlZeroMemory(Fcb, sizeof(TEST_FCB));
ExInitializeFastMutex(&Fcb->HeaderMutex);
FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
TestFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
KmtStartSeh();
- CcInitializeCacheMap(TestFileObject, &FileSizes, TRUE, &Callbacks, NULL);
+ CcInitializeCacheMap(TestFileObject, &FileSizes, PinAccess, &Callbacks, NULL);
KmtEndSeh(STATUS_SUCCESS);
if (!skip(CcIsFileCached(TestFileObject) == TRUE, "CcInitializeCacheMap failed\n"))
ExFreePool(TestContext);
}
}
+ else if (TestId == 4)
+ {
+ Ret = FALSE;
+ Offset.QuadPart = 0x1000;
+ KmtStartSeh();
+ Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &Bcb, (PVOID *)&Buffer);
+ KmtEndSeh(STATUS_SUCCESS);
+
+ if (!skip(Ret == TRUE, "CcPinRead failed\n"))
+ {
+ ok_eq_ulong(Buffer[0x2000 / sizeof(ULONG)], 0);
+
+ CcUnpinData(Bcb);
+ }
+ }
}
}
}
/* 3 tests for offset
* 1 test for BCB
+ * 1 test for pinning access
*/
- for (TestId = 0; TestId < 4; ++TestId)
+ for (TestId = 0; TestId < 5; ++TestId)
{
Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId);
ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);