mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[KMTESTS:CC] Add tests showing our CcMapData/CcPinRead raise invalid status
This commit is contained in:
parent
4d48b88bfb
commit
01c73317cc
4 changed files with 90 additions and 2 deletions
|
@ -326,6 +326,49 @@ PerformTest(
|
|||
ExFreePool(TestContext);
|
||||
}
|
||||
}
|
||||
else if (TestId == 4)
|
||||
{
|
||||
/* Map after EOF */
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000;
|
||||
|
||||
KmtStartSeh();
|
||||
Ret = CcMapData(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
if (!skip(Ret == TRUE, "CcMapData failed\n"))
|
||||
{
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
|
||||
/* Map a VACB after EOF */
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000 + VACB_MAPPING_GRANULARITY;
|
||||
|
||||
KmtStartSeh();
|
||||
Ret = CcMapData(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_ACCESS_VIOLATION);
|
||||
ok(Ret == FALSE, "CcMapData succeed\n");
|
||||
|
||||
if (Ret)
|
||||
{
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
|
||||
/* Map more than a VACB */
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = 0x0;
|
||||
|
||||
KmtStartSeh();
|
||||
Ret = CcMapData(TestFileObject, &Offset, 0x1000 + VACB_MAPPING_GRANULARITY, 0, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
ok(Ret == FALSE, "CcMapData succeed\n");
|
||||
|
||||
if (Ret)
|
||||
{
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,8 +20,9 @@ START_TEST(CcMapData)
|
|||
|
||||
/* 3 tests for offset
|
||||
* 1 test for BCB
|
||||
* 1 test for length/offset
|
||||
*/
|
||||
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);
|
||||
|
|
|
@ -477,6 +477,49 @@ PerformTest(
|
|||
CcUnpinData(Bcb);
|
||||
}
|
||||
}
|
||||
else if (TestId == 5)
|
||||
{
|
||||
/* Pin after EOF */
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000;
|
||||
|
||||
KmtStartSeh();
|
||||
Ret = CcPinRead(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
|
||||
if (!skip(Ret == TRUE, "CcPinRead failed\n"))
|
||||
{
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
|
||||
/* Pin a VACB after EOF */
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000 + VACB_MAPPING_GRANULARITY;
|
||||
|
||||
KmtStartSeh();
|
||||
Ret = CcPinRead(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_ACCESS_VIOLATION);
|
||||
ok(Ret == FALSE, "CcPinRead succeed\n");
|
||||
|
||||
if (Ret)
|
||||
{
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
|
||||
/* Pin more than a VACB */
|
||||
Ret = FALSE;
|
||||
Offset.QuadPart = 0x0;
|
||||
|
||||
KmtStartSeh();
|
||||
Ret = CcPinRead(TestFileObject, &Offset, 0x1000 + VACB_MAPPING_GRANULARITY, 0, &Bcb, (PVOID *)&Buffer);
|
||||
KmtEndSeh(STATUS_SUCCESS);
|
||||
ok(Ret == FALSE, "CcPinRead succeed\n");
|
||||
|
||||
if (Ret)
|
||||
{
|
||||
CcUnpinData(Bcb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,9 @@ START_TEST(CcPinRead)
|
|||
/* 3 tests for offset
|
||||
* 1 test for BCB
|
||||
* 1 test for pinning access
|
||||
* 1 test for length/offset
|
||||
*/
|
||||
for (TestId = 0; TestId < 5; ++TestId)
|
||||
for (TestId = 0; TestId < 6; ++TestId)
|
||||
{
|
||||
Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId);
|
||||
ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);
|
||||
|
|
Loading…
Reference in a new issue