mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[KMTESTS:CC] Add a test for pinning without access
This commit is contained in:
parent
f96f1224a7
commit
38487d63d8
2 changed files with 20 additions and 2 deletions
|
@ -217,6 +217,8 @@ PerformTest(
|
|||
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);
|
||||
|
@ -225,7 +227,7 @@ PerformTest(
|
|||
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"))
|
||||
|
@ -300,6 +302,21 @@ PerformTest(
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,8 +20,9 @@ START_TEST(CcPinRead)
|
|||
|
||||
/* 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);
|
||||
|
|
Loading…
Reference in a new issue