mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[ADVAPI32] Take into account the service handler context when dispatching a control notification to a service. (Used e.g. by tcpsvcs.)
This commit is contained in:
parent
635aabb011
commit
91b50f9ccb
2 changed files with 14 additions and 9 deletions
|
@ -10,7 +10,7 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include <advapi32.h>
|
#include <advapi32.h>
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
WINE_DEFAULT_DEBUG_CHANNEL(advapi_service);
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include <advapi32.h>
|
#include <advapi32.h>
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
WINE_DEFAULT_DEBUG_CHANNEL(advapi_service);
|
||||||
|
|
||||||
|
|
||||||
/* TYPES *********************************************************************/
|
/* TYPES *********************************************************************/
|
||||||
|
@ -514,26 +514,31 @@ static DWORD
|
||||||
ScControlService(PACTIVE_SERVICE lpService,
|
ScControlService(PACTIVE_SERVICE lpService,
|
||||||
PSCM_CONTROL_PACKET ControlPacket)
|
PSCM_CONTROL_PACKET ControlPacket)
|
||||||
{
|
{
|
||||||
|
DWORD dwError;
|
||||||
|
|
||||||
if (lpService == NULL || ControlPacket == NULL)
|
if (lpService == NULL || ControlPacket == NULL)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
TRACE("ScControlService() called\n");
|
TRACE("ScControlService(Size: %lu, Service: '%S') called\n",
|
||||||
TRACE("Size: %lu\n", ControlPacket->dwSize);
|
ControlPacket->dwSize,
|
||||||
TRACE("Service: %S\n", (PWSTR)((PBYTE)ControlPacket + ControlPacket->dwServiceNameOffset));
|
(PWSTR)((ULONG_PTR)ControlPacket + ControlPacket->dwServiceNameOffset));
|
||||||
|
|
||||||
if (lpService->HandlerFunction)
|
if (lpService->HandlerFunction)
|
||||||
{
|
{
|
||||||
(lpService->HandlerFunction)(ControlPacket->dwControl);
|
(lpService->HandlerFunction)(ControlPacket->dwControl);
|
||||||
|
dwError = ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
else if (lpService->HandlerFunctionEx)
|
else if (lpService->HandlerFunctionEx)
|
||||||
{
|
{
|
||||||
/* FIXME: send correct params */
|
/* FIXME: Send correct 2nd and 3rd parameters */
|
||||||
(lpService->HandlerFunctionEx)(ControlPacket->dwControl, 0, NULL, NULL);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue