diff --git a/kmtests/CMakeLists.txt b/kmtests/CMakeLists.txt index 1426b7de93b..0a80c9665c5 100644 --- a/kmtests/CMakeLists.txt +++ b/kmtests/CMakeLists.txt @@ -36,9 +36,9 @@ add_library(kmtest_drv SHARED ${KMTEST_DRV_SOURCE}) set_module_type(kmtest_drv kernelmodedriver) target_link_libraries(kmtest_drv kmtest_printf ${PSEH_LIB}) add_importlibs(kmtest_drv ntoskrnl hal) -set_property(TARGET kmtest_drv PROPERTY COMPILE_DEFINITIONS KMT_KERNEL_MODE) +set_property(TARGET kmtest_drv PROPERTY COMPILE_DEFINITIONS KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1) -add_cd_file(TARGET kmtest_drv DESTINATION reactos/system32/drivers FOR all) +add_cd_file(TARGET kmtest_drv DESTINATION reactos/bin FOR all) add_library(kmtest_printf kmtest_drv/printf_stubs.c diff --git a/kmtests/example/CMakeLists.txt b/kmtests/example/CMakeLists.txt index 3ac0f80e170..f552d62e7a4 100644 --- a/kmtests/example/CMakeLists.txt +++ b/kmtests/example/CMakeLists.txt @@ -12,4 +12,4 @@ target_link_libraries(example_drv kmtest_printf ${PSEH_LIB}) add_importlibs(example_drv ntoskrnl hal) set_property(TARGET example_drv PROPERTY COMPILE_DEFINITIONS KMT_STANDALONE_DRIVER) -add_cd_file(TARGET example_drv DESTINATION reactos/system32/drivers FOR all) +add_cd_file(TARGET example_drv DESTINATION reactos/bin FOR all) diff --git a/kmtests/example/example_drv.rbuild b/kmtests/example/example_drv.rbuild index c6041e8aee2..e5460e7db8b 100644 --- a/kmtests/example/example_drv.rbuild +++ b/kmtests/example/example_drv.rbuild @@ -1,4 +1,4 @@ - + include ntoskrnl hal diff --git a/kmtests/kmtest.rbuild b/kmtests/kmtest.rbuild index 5626344bf2b..31e4bcbb041 100644 --- a/kmtests/kmtest.rbuild +++ b/kmtests/kmtest.rbuild @@ -1,4 +1,4 @@ - + include advapi32 diff --git a/kmtests/kmtest/kmtest.c b/kmtests/kmtest/kmtest.c index a71c4357285..3be6977f9aa 100644 --- a/kmtests/kmtest/kmtest.c +++ b/kmtests/kmtest/kmtest.c @@ -73,6 +73,33 @@ OutputError( LocalFree(Message); } +/** + * @name CompareTestNames + * + * strcmp that skips a leading '-' on either string if present + * + * @param Str1 + * @param Str2 + * @return see strcmp + */ +static +INT +CompareTestNames( + IN PCSTR Str1, + IN PCSTR Str2) +{ + if (*Str1 == '-') + ++Str1; + if (*Str2 == '-') + ++Str2; + while (*Str1 && *Str1 == *Str2) + { + ++Str1; + ++Str2; + } + return *Str1 - *Str2; +} + /** * @name ListTests * @@ -118,7 +145,7 @@ ListTests( } else { - int Result = strcmp(TestEntry->TestName, TestName); + INT Result = CompareTestNames(TestEntry->TestName, TestName); if (Result == 0) { diff --git a/kmtests/kmtest_drv.rbuild b/kmtests/kmtest_drv.rbuild index 51b109420e3..81550a3a7f2 100644 --- a/kmtests/kmtest_drv.rbuild +++ b/kmtests/kmtest_drv.rbuild @@ -1,10 +1,11 @@ - + include ntoskrnl hal pseh kmtest_printf + NTDDI_WS03SP1 kmtest_drv.c testlist.c diff --git a/kmtests/kmtest_drv/testlist.c b/kmtests/kmtest_drv/testlist.c index c5518a54ff6..48ff9e8fb12 100644 --- a/kmtests/kmtest_drv/testlist.c +++ b/kmtests/kmtest_drv/testlist.c @@ -27,13 +27,13 @@ KMT_TESTFUNC Test_ObCreate; const KMT_TEST TestList[] = { - { "Example", Test_Example }, { "ExHardError", Test_ExHardError }, { "-ExHardErrorInteractive", Test_ExHardErrorInteractive }, { "ExInterlocked", Test_ExInterlocked }, { "ExPools", Test_ExPools }, { "ExResource", Test_ExResource }, { "ExTimer", Test_ExTimer }, + { "Example", Test_Example }, { "FsRtlExpression", Test_FsRtlExpression }, { "IoDeviceInterface", Test_IoDeviceInterface }, { "IoIrp", Test_IoIrp }, diff --git a/kmtests/ntos_ex/ExInterlocked.c b/kmtests/ntos_ex/ExInterlocked.c index 7de1b517d05..19e57a99339 100644 --- a/kmtests/ntos_ex/ExInterlocked.c +++ b/kmtests/ntos_ex/ExInterlocked.c @@ -25,8 +25,6 @@ __declspec(dllimport) int __stdcall ExInterlockedDecrementLong(l __declspec(dllimport) int __stdcall Exi386InterlockedIncrementLong(long *); __declspec(dllimport) int __stdcall Exi386InterlockedDecrementLong(long *); -#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 #include #include @@ -213,7 +211,7 @@ TestInterlockedFunctional(VOID) PKSPIN_LOCK pSpinLock = &SpinLock; PROCESSOR_STATE OldState, NewState; - /* on x86, most of these are supported intrinsicly and don't need a spinlock! */ + /* on x86, most of these are supported intrinsically and don't need a spinlock! */ #if defined _M_IX86 || defined _M_AMD64 pSpinLock = NULL; #endif diff --git a/kmtests/ntos_ex/ExResource.c b/kmtests/ntos_ex/ExResource.c index cc017cb53c5..974e689f5d1 100644 --- a/kmtests/ntos_ex/ExResource.c +++ b/kmtests/ntos_ex/ExResource.c @@ -5,8 +5,6 @@ * PROGRAMMER: Thomas Faber */ -#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 #include #include #include diff --git a/kmtests/ntos_ke/KeApc.c b/kmtests/ntos_ke/KeApc.c index a361a180514..dc85887aab5 100644 --- a/kmtests/ntos_ke/KeApc.c +++ b/kmtests/ntos_ke/KeApc.c @@ -5,8 +5,6 @@ * PROGRAMMER: Thomas Faber */ -#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 #include #include diff --git a/kmtests/ntos_ke/KeDpc.c b/kmtests/ntos_ke/KeDpc.c index abf5441b6a6..5eacde6a834 100644 --- a/kmtests/ntos_ke/KeDpc.c +++ b/kmtests/ntos_ke/KeDpc.c @@ -30,8 +30,7 @@ DpcHandler( IN PVOID SystemArgument1, IN PVOID SystemArgument2) { - PKPCR Pcr = KeGetPcr(); - PKPRCB Prcb = Pcr->Prcb; + PKPRCB Prcb = KeGetCurrentPrcb(); ok_irql(DISPATCH_LEVEL); InterlockedIncrement(&DpcCount); @@ -58,7 +57,7 @@ DpcHandler( ok_eq_pointer(Dpc->SystemArgument1, SystemArgument1); ok_eq_pointer(Dpc->SystemArgument2, SystemArgument2); ok_eq_pointer(Dpc->DpcData, NULL); - + ok_eq_uint(Prcb->DpcRoutineActive, 1); /* this DPC is not in the list anymore, but it was at the head! */ ok_eq_pointer(Prcb->DpcData[DPC_NORMAL].DpcListHead.Flink, Dpc->DpcListEntry.Flink);