services: Pass a process argument to send_control function.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-03-16 04:32:34 +01:00 committed by Alexandre Julliard
parent 7e2176459d
commit fa593d4d87
1 changed files with 7 additions and 7 deletions

View File

@ -1035,25 +1035,25 @@ BOOL process_send_command(struct process_entry *process, const void *data, DWORD
} }
/****************************************************************************** /******************************************************************************
* service_send_control * process_send_control
*/ */
static BOOL service_send_control(struct service_entry *service, DWORD dwControl, DWORD *result) static BOOL process_send_control(struct process_entry *process, const WCHAR *name, DWORD dwControl, DWORD *result)
{ {
service_start_info *ssi; service_start_info *ssi;
DWORD len; DWORD len;
BOOL r; BOOL r;
/* calculate how much space we need to send the startup info */ /* calculate how much space we need to send the startup info */
len = strlenW(service->name) + 1; len = strlenW(name) + 1;
ssi = HeapAlloc(GetProcessHeap(),0,FIELD_OFFSET(service_start_info, data[len])); ssi = HeapAlloc(GetProcessHeap(),0,FIELD_OFFSET(service_start_info, data[len]));
ssi->cmd = WINESERV_SENDCONTROL; ssi->cmd = WINESERV_SENDCONTROL;
ssi->control = dwControl; ssi->control = dwControl;
ssi->total_size = FIELD_OFFSET(service_start_info, data[len]); ssi->total_size = FIELD_OFFSET(service_start_info, data[len]);
ssi->name_size = strlenW(service->name) + 1; ssi->name_size = strlenW(name) + 1;
strcpyW( ssi->data, service->name ); strcpyW(ssi->data, name);
r = process_send_command(service->process, ssi, ssi->total_size, result); r = process_send_command(process, ssi, ssi->total_size, result);
HeapFree( GetProcessHeap(), 0, ssi ); HeapFree( GetProcessHeap(), 0, ssi );
return r; return r;
} }
@ -1176,7 +1176,7 @@ DWORD __cdecl svcctl_ControlService(
if (ret != WAIT_OBJECT_0) if (ret != WAIT_OBJECT_0)
return ERROR_SERVICE_REQUEST_TIMEOUT; return ERROR_SERVICE_REQUEST_TIMEOUT;
service_send_control(service->service_entry, dwControl, &result); process_send_control(service->service_entry->process, service->service_entry->name, dwControl, &result);
if (lpServiceStatus) if (lpServiceStatus)
{ {