https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ce0650d37dd3c22acb7e84fc989a911828833a5d
commit ce0650d37dd3c22acb7e84fc989a911828833a5d Author: Pierre Schweitzer <pie...@reactos.org> AuthorDate: Sat Oct 13 19:15:48 2018 +0200 Commit: Pierre Schweitzer <pie...@reactos.org> CommitDate: Sat Oct 13 19:15:48 2018 +0200 [KMTESTS:CC] Add more tests for CcPinMappedData() --- .../rostests/kmtests/ntos_cc/CcPinMappedData_drv.c | 30 ++++++++++++++++++++++ .../kmtests/ntos_cc/CcPinMappedData_user.c | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/modules/rostests/kmtests/ntos_cc/CcPinMappedData_drv.c b/modules/rostests/kmtests/ntos_cc/CcPinMappedData_drv.c index 89b348fe71..1a41bf144f 100644 --- a/modules/rostests/kmtests/ntos_cc/CcPinMappedData_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcPinMappedData_drv.c @@ -353,6 +353,36 @@ PerformTest( ExFreePool(TestContext); } } + else if (TestId == 3) + { + Ret = FALSE; + Offset.QuadPart = 0; + KmtStartSeh(); + Ret = CcMapData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, MAP_WAIT, &Bcb, (PVOID *)&Buffer); + KmtEndSeh(STATUS_SUCCESS); + + if (!skip(Ret == TRUE, "CcMapData failed\n")) + { + Ret = FALSE; + PinBcb = Bcb; + ok_eq_ulong(Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE); + + KmtStartSeh(); + Ret = CcPinMappedData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_IF_BCB, &PinBcb); + KmtEndSeh(STATUS_SUCCESS); + + if (!skip(Ret == FALSE, "CcPinMappedData succeed\n")) + { + ok_eq_pointer(Bcb, PinBcb); + } + else + { + Bcb = PinBcb; + } + + CcUnpinData(Bcb); + } + } } } } diff --git a/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c b/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c index 14bc2aa5e9..21fe904bb9 100644 --- a/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c +++ b/modules/rostests/kmtests/ntos_cc/CcPinMappedData_user.c @@ -19,7 +19,7 @@ START_TEST(CcPinMappedData) KmtOpenDriver(); /* 1 basic test */ - for (TestId = 0; TestId < 3; ++TestId) + for (TestId = 0; TestId < 4; ++TestId) { Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId); ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);