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:
parent
46a974856f
commit
f4590e91eb
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue