[KMTESTS:CC] Add tests for PIN_IF_BCB flag

This commit is contained in:
Pierre Schweitzer 2018-09-01 12:29:09 +02:00
parent 6937fa8f41
commit a4dc3c4963
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -178,6 +178,18 @@ PinInAnotherThread(IN PVOID Context)
CcUnpinData(Bcb);
}
KmtStartSeh();
Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_WAIT | PIN_IF_BCB, &Bcb, (PVOID *)&Buffer);
KmtEndSeh(STATUS_SUCCESS);
if (!skip(Ret == TRUE, "CcPinRead failed\n"))
{
ok_eq_pointer(Bcb, TestContext->Bcb);
ok_eq_pointer(Buffer, TestContext->Buffer);
CcUnpinData(Bcb);
}
return;
}
@ -242,6 +254,17 @@ PerformTest(
{
Ret = FALSE;
Offset.QuadPart = 0x1000;
/* Try enforce BCB first */
KmtStartSeh();
Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT | PIN_IF_BCB, &Bcb, (PVOID *)&Buffer);
KmtEndSeh(STATUS_SUCCESS);
ok(Ret == FALSE, "CcPinRead succeed\n");
if (Ret)
{
CcUnpinData(Bcb);
}
KmtStartSeh();
Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &TestContext->Bcb, &TestContext->Buffer);
KmtEndSeh(STATUS_SUCCESS);