https://git.reactos.org/?p=reactos.git;a=commitdiff;h=91b50f9ccb530e9544a22…
commit 91b50f9ccb530e9544a224df0f0a3e5630441ab6
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 25 18:53:05 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Feb 26 00:36:57 2018 +0100
[ADVAPI32] Take into account the service handler context when dispatching a control
notification to a service. (Used e.g. by tcpsvcs.)
---
dll/win32/advapi32/service/scm.c | 2 +-
dll/win32/advapi32/service/sctrl.c | 21 +++++++++++++--------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/dll/win32/advapi32/service/scm.c b/dll/win32/advapi32/service/scm.c
index ec1b84cb20..5a20508f69 100644
--- a/dll/win32/advapi32/service/scm.c
+++ b/dll/win32/advapi32/service/scm.c
@@ -10,7 +10,7 @@
/* INCLUDES ******************************************************************/
#include <advapi32.h>
-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 fe2469732f..5afa8dfc14 100644
--- a/dll/win32/advapi32/service/sctrl.c
+++ b/dll/win32/advapi32/service/sctrl.c
@@ -12,7 +12,7 @@
/* INCLUDES ******************************************************************/
#include <advapi32.h>
-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;
}