https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f027384e481678e9ec64b…
commit f027384e481678e9ec64b9d6525d3123e53f5de4
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Mar 28 20:31:31 2020 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Mar 28 20:33:43 2020 +0100
[KMTEST] Delete special-purpose driver services on unload. ROSTESTS-263
Based on a patch by Serge Gautherie.
---
modules/rostests/kmtests/kmtest/support.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/modules/rostests/kmtests/kmtest/support.c
b/modules/rostests/kmtests/kmtest/support.c
index 13bd66b323d..0f0ad64ce45 100644
--- a/modules/rostests/kmtests/kmtest/support.c
+++ b/modules/rostests/kmtests/kmtest/support.c
@@ -2,8 +2,9 @@
* PROJECT: ReactOS kernel-mode tests
* LICENSE: LGPL-2.1+ (
https://spdx.org/licenses/LGPL-2.1+)
* PURPOSE: Kernel-Mode Test Suite user-mode support routines
- * COPYRIGHT: Copyright 2011-2018 Thomas Faber <thomas.faber(a)reactos.org>
+ * COPYRIGHT: Copyright 2011-2020 Thomas Faber <thomas.faber(a)reactos.org>
* Copyright 2013 Nikolay Borisov <nib9(a)aber.ac.uk>
+ * Copyright 2018 Serge Gautherie
<reactos-git_serge_171003(a)gautherie.fr>
*/
#include <kmt_test.h>
@@ -149,19 +150,25 @@ KmtLoadDriver(
/**
* @name KmtUnloadDriver
*
- * Unload special-purpose driver (stop the service)
+ * Unload special-purpose driver (stop and delete the service)
*/
VOID
KmtUnloadDriver(VOID)
{
- DWORD Error = ERROR_SUCCESS;
+ DWORD Error;
Error = KmtStopService(TestServiceName, &TestServiceHandle);
if (Error)
{
- // TODO
- __debugbreak();
+ fprintf(stderr, "Failed to stop %ls service with error 0x%lx\n",
TestServiceName, Error);
+ }
+
+ Error = KmtDeleteService(TestServiceName, &TestServiceHandle);
+
+ if (Error)
+ {
+ fprintf(stderr, "Failed to delete %ls service with error 0x%lx\n",
TestServiceName, Error);
}
}