diff --git a/dll/win32/advapi32/service/scm.c b/dll/win32/advapi32/service/scm.c index ec1b84cb20a..5a20508f697 100644 --- a/dll/win32/advapi32/service/scm.c +++ b/dll/win32/advapi32/service/scm.c @@ -10,7 +10,7 @@ /* INCLUDES ******************************************************************/ #include -WINE_DEFAULT_DEBUG_CHANNEL(advapi); +WINE_DEFAULT_DEBUG_CHANNEL(advapi_service); /* FUNCTIONS *****************************************************************/ diff --git a/dll/win32/advapi32/service/sctrl.c b/dll/win32/advapi32/service/sctrl.c index fe2469732fe..5afa8dfc143 100644 --- a/dll/win32/advapi32/service/sctrl.c +++ b/dll/win32/advapi32/service/sctrl.c @@ -12,7 +12,7 @@ /* INCLUDES ******************************************************************/ #include -WINE_DEFAULT_DEBUG_CHANNEL(advapi); +WINE_DEFAULT_DEBUG_CHANNEL(advapi_service); /* TYPES *********************************************************************/ @@ -514,26 +514,31 @@ static DWORD ScControlService(PACTIVE_SERVICE lpService, PSCM_CONTROL_PACKET ControlPacket) { + DWORD dwError; + if (lpService == NULL || ControlPacket == NULL) return ERROR_INVALID_PARAMETER; - TRACE("ScControlService() called\n"); - TRACE("Size: %lu\n", ControlPacket->dwSize); - TRACE("Service: %S\n", (PWSTR)((PBYTE)ControlPacket + ControlPacket->dwServiceNameOffset)); + TRACE("ScControlService(Size: %lu, Service: '%S') called\n", + ControlPacket->dwSize, + (PWSTR)((ULONG_PTR)ControlPacket + ControlPacket->dwServiceNameOffset)); if (lpService->HandlerFunction) { (lpService->HandlerFunction)(ControlPacket->dwControl); + dwError = ERROR_SUCCESS; } else if (lpService->HandlerFunctionEx) { - /* FIXME: send correct params */ - (lpService->HandlerFunctionEx)(ControlPacket->dwControl, 0, NULL, NULL); + /* FIXME: Send correct 2nd and 3rd parameters */ + dwError = (lpService->HandlerFunctionEx)(ControlPacket->dwControl, + 0, NULL, + lpService->HandlerContext); } - TRACE("ScControlService() done\n"); + TRACE("ScControlService() done (error %lu)\n", dwError); - return ERROR_SUCCESS; + return dwError; }