From: Iain Patterson Date: Sun, 31 Aug 2014 15:08:56 +0000 (+0100) Subject: Terminate the correct process. X-Git-Tag: v2.24~1 X-Git-Url: http://git.iain.cx/?p=nssm.git;a=commitdiff_plain;h=2e11a962a07ff5d4a75b9e1c0ac2c4e6d7c1ba4f Terminate the correct process. We were calling TerminateProcess() on the service process handle in instead of the handle passed to kill_process(). Thanks Sam Townsend. --- diff --git a/process.cpp b/process.cpp index daeeea7..624111c 100644 --- a/process.cpp +++ b/process.cpp @@ -180,7 +180,7 @@ int kill_process(nssm_service_t *service, HANDLE process_handle, unsigned long p /* We tried being nice. Time for extreme prejudice. */ if (service->stop_method & NSSM_STOP_METHOD_TERMINATE) { - return TerminateProcess(service->process_handle, exitcode); + return TerminateProcess(process_handle, exitcode); } return 0;