https://git.reactos.org/?p=reactos.git;a=commitdiff;h=262e5bfef1fc853e2c3c71...
commit 262e5bfef1fc853e2c3c71cbf046cff75fae415f Author: Pierre Schweitzer pierre@reactos.org AuthorDate: Fri Aug 31 23:07:46 2018 +0200 Commit: Pierre Schweitzer pierre@reactos.org CommitDate: Fri Aug 31 23:07:46 2018 +0200
[KMTESTS:CC] Extended previous test to show an overlap is enough --- modules/rostests/kmtests/ntos_cc/CcMapData_drv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c index 7cf442e628..415eb148a3 100644 --- a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c +++ b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c @@ -24,6 +24,7 @@ typedef struct _TEST_CONTEXT { PVOID Bcb; PVOID Buffer; + ULONG Length; } TEST_CONTEXT, *PTEST_CONTEXT;
static BOOLEAN TestMap = FALSE; @@ -162,12 +163,13 @@ MapInAnotherThread(IN PVOID Context) ok(TestContext != NULL, "Called in invalid context!\n"); ok(TestContext->Bcb != NULL, "Called in invalid context!\n"); ok(TestContext->Buffer != NULL, "Called in invalid context!\n"); + ok(TestContext->Length != 0, "Called in invalid context!\n");
Ret = FALSE; Offset.QuadPart = 0x1000; KmtStartSeh(); TestMap = TRUE; - Ret = CcMapData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, MAP_WAIT, &Bcb, (PVOID *)&Buffer); + Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT, &Bcb, (PVOID *)&Buffer); TestMap = FALSE; KmtEndSeh(STATUS_SUCCESS);
@@ -253,6 +255,11 @@ PerformTest( { PKTHREAD ThreadHandle;
+ TestContext->Length = FileSizes.FileSize.QuadPart - Offset.QuadPart; + ThreadHandle = KmtStartThread(MapInAnotherThread, TestContext); + KmtFinishThread(ThreadHandle, NULL); + + TestContext->Length = FileSizes.FileSize.QuadPart - 2 * Offset.QuadPart; ThreadHandle = KmtStartThread(MapInAnotherThread, TestContext); KmtFinishThread(ThreadHandle, NULL);