https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f284f8a0c77e20f5fc85…
commit 8f284f8a0c77e20f5fc85f7750c72bb67133ad03
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Sep 1 10:10:09 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Sep 1 12:41:00 2018 +0200
[KMTESTS:CC] That wasn't meant to be committed
---
modules/rostests/kmtests/ntos_cc/CcMapData_drv.c | 5 ----
.../ntos_cc/{CcMapData_drv.c => CcPinRead_drv.c} | 2 +-
modules/rostests/kmtests/ntos_cc/CcPinRead_user.c | 34 ++++++++++++++++++++++
3 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
index e067124ee2..c7ed089ed5 100644
--- a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
+++ b/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
@@ -27,7 +27,6 @@ typedef struct _TEST_CONTEXT
ULONG Length;
} TEST_CONTEXT, *PTEST_CONTEXT;
-static BOOLEAN TestMap = FALSE;
static ULONG TestTestId = -1;
static PFILE_OBJECT TestFileObject;
static PDEVICE_OBJECT TestDeviceObject;
@@ -168,9 +167,7 @@ MapInAnotherThread(IN PVOID Context)
Ret = FALSE;
Offset.QuadPart = 0x1000;
KmtStartSeh();
- TestMap = TRUE;
Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT,
&Bcb, (PVOID *)&Buffer);
- TestMap = FALSE;
KmtEndSeh(STATUS_SUCCESS);
if (!skip(Ret == TRUE, "CcMapData failed\n"))
@@ -246,9 +243,7 @@ PerformTest(
Ret = FALSE;
Offset.QuadPart = 0x1000;
KmtStartSeh();
- TestMap = TRUE;
Ret = CcMapData(TestFileObject, &Offset,
FileSizes.FileSize.QuadPart - Offset.QuadPart, MAP_WAIT, &TestContext->Bcb,
&TestContext->Buffer);
- TestMap = FALSE;
KmtEndSeh(STATUS_SUCCESS);
if (!skip(Ret == TRUE, "CcMapData failed\n"))
diff --git a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
b/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
similarity index 99%
copy from modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
copy to modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
index e067124ee2..0d63e48572 100644
--- a/modules/rostests/kmtests/ntos_cc/CcMapData_drv.c
+++ b/modules/rostests/kmtests/ntos_cc/CcPinRead_drv.c
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS kernel-mode tests
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
- * PURPOSE: Test driver for CcMapData function
+ * PURPOSE: Test driver for CcPinRead function
* PROGRAMMER: Pierre Schweitzer <pierre(a)reactos.org>
*/
diff --git a/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c
b/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c
new file mode 100644
index 0000000000..c7a93a5d96
--- /dev/null
+++ b/modules/rostests/kmtests/ntos_cc/CcPinRead_user.c
@@ -0,0 +1,34 @@
+/*
+ * PROJECT: ReactOS kernel-mode tests
+ * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * PURPOSE: Kernel-Mode Test Suite CcPinRead test user-mode part
+ * PROGRAMMER: Pierre Schweitzer <pierre(a)reactos.org>
+ */
+
+#include <kmt_test.h>
+
+#define IOCTL_START_TEST 1
+#define IOCTL_FINISH_TEST 2
+
+START_TEST(CcPinRead)
+{
+ DWORD Ret;
+ ULONG TestId;
+
+ KmtLoadDriver(L"CcPinRead", FALSE);
+ KmtOpenDriver();
+
+ /* 3 tests for offset
+ * 1 test for BCB
+ */
+ for (TestId = 0; TestId < 4; ++TestId)
+ {
+ Ret = KmtSendUlongToDriver(IOCTL_START_TEST, TestId);
+ ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);
+ Ret = KmtSendUlongToDriver(IOCTL_FINISH_TEST, TestId);
+ ok(Ret == ERROR_SUCCESS, "KmtSendUlongToDriver failed: %lx\n", Ret);
+ }
+
+ KmtCloseDriver();
+ KmtUnloadDriver();
+}