mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[KMTESTS:CC] Add more tests for CcPinMappedData()
This commit is contained in:
parent
45231fbbc5
commit
991db73e37
2 changed files with 47 additions and 3 deletions
|
@ -150,7 +150,7 @@ PerformTest(
|
|||
ULONG TestId,
|
||||
PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
PVOID Bcb, PinBcb;
|
||||
PVOID Bcb, PinBcb, NewBcb;
|
||||
BOOLEAN Ret;
|
||||
PULONG Buffer;
|
||||
PTEST_FCB Fcb;
|
||||
|
@ -184,7 +184,7 @@ PerformTest(
|
|||
if (TestId == 0)
|
||||
{
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = TestId * 0x1000;
|
||||
Offset.QuadPart = 0;
|
||||
KmtStartSeh();
|
||||
Ret = CcMapData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, MAP_WAIT, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
@ -211,6 +211,50 @@ PerformTest(
|
|||
CcUnpinData(Bcb);
|
||||
}
|
||||
}
|
||||
else if (TestId == 1)
|
||||
{
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = 0;
|
||||
KmtStartSeh();
|
||||
Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &PinBcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
if (!skip(Ret == TRUE, "CcPinRead failed\n"))
|
||||
{
|
||||
ok(*(PUSHORT)PinBcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)PinBcb);
|
||||
ok_eq_ulong(Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE);
|
||||
|
||||
Ret = FALSE;
|
||||
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"))
|
||||
{
|
||||
ok(Bcb != PinBcb, "Returned same BCB!\n");
|
||||
|
||||
Ret = FALSE;
|
||||
NewBcb = Bcb;
|
||||
KmtStartSeh();
|
||||
Ret = CcPinMappedData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &NewBcb);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
if (!skip(Ret == TRUE, "CcPinMappedData failed\n"))
|
||||
{
|
||||
ok(Bcb != NewBcb, "Returned same BCB!\n");
|
||||
ok_eq_pointer(NewBcb, PinBcb);
|
||||
ok(*(PUSHORT)NewBcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)NewBcb);
|
||||
|
||||
/* Previous BCB isn't valid anymore! */
|
||||
Bcb = NewBcb;
|
||||
}
|
||||
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
|
||||
CcUnpinData(PinBcb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ START_TEST(CcPinMappedData)
|
|||
KmtOpenDriver();
|
||||
|
||||
/* 1 basic test */
|
||||
for (TestId = 0; TestId < 1; ++TestId)
|
||||
for (TestId = 0; TestId < 2; ++TestId)
|
||||
{
|
||||
Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId);
|
||||
ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);
|
||||
|
|
Loading…
Reference in a new issue