Module: wine Branch: master Commit: f4590e91ebd1530dd04e81a9d724ce06cd1df2a1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f4590e91ebd1530dd04e81a9d7... Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Wed Aug 17 09:35:30 2016 +0200 advapi32: Simplify RegisterServiceCtrlHandlerExW. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/service.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index 86bd713..ccca721 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -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; }