https://git.reactos.org/?p=reactos.git;a=commitdiff;h=04a192fa3075bd53f0318…
commit 04a192fa3075bd53f031898bec2271f94cfb1379
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Sep 1 21:26:24 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Sep 1 21:27:24 2018 +0200
[KMTESTS:CC] Add more tests crossing CcPinRead and CcMapData
---
modules/rostests/kmtests/ntos_cc/CcMapData_drv.c | 34 ++++++++++++++++++++++++
modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c | 24 +++++++++++++++++
2 files changed, 58 insertions(+)
diff --git a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
index 6624b10e70..0d84f21c31 100644
--- a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
+++ b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
@@ -178,6 +178,40 @@ MapInAnotherThread(IN PVOID Context)
CcUnpinData(Bcb);
}
+ KmtStartSeh();
+ Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, 0, &Bcb,
(PVOID *)&Buffer);
+ KmtEndSeh(STATUS_SUCCESS);
+
+ if (!skip(Ret == TRUE, "CcPinRead failed\n"))
+ {
+ ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
+ ok_eq_pointer(Buffer, TestContext->Buffer);
+
+ CcUnpinData(Bcb);
+ }
+
+ KmtStartSeh();
+ Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_IF_BCB,
&Bcb, (PVOID *)&Buffer);
+ KmtEndSeh(STATUS_SUCCESS);
+ ok(Ret == FALSE, "CcPinRead succeed\n");
+
+ if (Ret)
+ {
+ CcUnpinData(Bcb);
+ }
+
+ KmtStartSeh();
+ Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_EXCLUSIVE,
&Bcb, (PVOID *)&Buffer);
+ KmtEndSeh(STATUS_SUCCESS);
+
+ if (!skip(Ret == TRUE, "CcPinRead failed\n"))
+ {
+ ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
+ ok_eq_pointer(Buffer, TestContext->Buffer);
+
+ CcUnpinData(Bcb);
+ }
+
return;
}
diff --git a/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
b/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
index ecaceb38fb..68e666c1b3 100644
--- a/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
+++ b/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
@@ -202,6 +202,18 @@ PinInAnotherThread(IN PVOID Context)
CcUnpinData(Bcb);
}
+ KmtStartSeh();
+ Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT,
&Bcb, (PVOID *)&Buffer);
+ KmtEndSeh(STATUS_SUCCESS);
+
+ if (!skip(Ret == TRUE, "CcMapData failed\n"))
+ {
+ ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
+ ok_eq_pointer(Buffer, TestContext->Buffer);
+
+ CcUnpinData(Bcb);
+ }
+
return;
}
@@ -237,6 +249,18 @@ PinInAnotherThreadExclusive(IN PVOID Context)
CcUnpinData(Bcb);
}
+ KmtStartSeh();
+ Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, 0, &Bcb,
(PVOID *)&Buffer);
+ KmtEndSeh(STATUS_SUCCESS);
+
+ if (!skip(Ret == TRUE, "CcMapData failed\n"))
+ {
+ ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
+ ok_eq_pointer(Buffer, TestContext->Buffer);
+
+ CcUnpinData(Bcb);
+ }
+
return;
}