advapi32: Simplify RegisterServiceCtrlHandlerExW.

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-08-17 09:35:30 +02:00 committed by Alexandre Julliard
parent 46a974856f
commit f4590e91eb
1 changed files with 1 additions and 4 deletions

View File

@ -2360,7 +2360,6 @@ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW( LPCWSTR lpServiceNam
{
service_data *service;
SC_HANDLE hService = 0;
BOOL found = FALSE;
TRACE("%s %p %p\n", debugstr_w(lpServiceName), lpHandlerProc, lpContext);
@ -2370,12 +2369,10 @@ SERVICE_STATUS_HANDLE WINAPI RegisterServiceCtrlHandlerExW( LPCWSTR lpServiceNam
service->handler = lpHandlerProc;
service->context = lpContext;
hService = service->handle;
found = TRUE;
}
LeaveCriticalSection( &service_cs );
if (!found) SetLastError(ERROR_SERVICE_DOES_NOT_EXIST);
if (!hService) SetLastError( ERROR_SERVICE_DOES_NOT_EXIST );
return (SERVICE_STATUS_HANDLE)hService;
}