[SERVICES] Merge ScmControlService() and ScmSendStartCommand() together (#7392)

In addition:

- Acquire ControlServiceCriticalSection just before doing the pipe
  operations, and release it just after.

- SAL2-annotate ScmControlService().

- Re-order the ScmControlService() parameters in a more natural way
  (image comm pipe, service name, control code; then: arguments for
  the control command).

- Improve some DPRINTs.
This commit is contained in:
Hermès Bélusca-Maïto 2018-02-25 17:57:54 +01:00
parent 38f21f93e9
commit 0f7b021fe6
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 101 additions and 257 deletions

View file

@ -1187,8 +1187,8 @@ RControlService(
/* Send control code to the service */
dwError = ScmControlService(lpService->lpImage->hControlPipe,
lpService->lpServiceName,
(SERVICE_STATUS_HANDLE)lpService,
dwControl);
dwControl,
(SERVICE_STATUS_HANDLE)lpService);
/* Return service status information */
RtlCopyMemory(lpServiceStatus,
@ -1626,8 +1626,8 @@ ScmStopThread(PVOID pParam)
DPRINT("Stopping the dispatcher thread for service %S\n", lpService->lpServiceName);
ScmControlService(lpService->lpImage->hControlPipe,
L"",
(SERVICE_STATUS_HANDLE)lpService,
SERVICE_CONTROL_STOP);
SERVICE_CONTROL_STOP,
(SERVICE_STATUS_HANDLE)lpService);
}
/* Lock the service database exclusively */