[1/4] advapi32: Simplify RegisterServiceCtrlHandlerExW.

Sebastian Lackner sebastian at fds-team.de
Wed Aug 17 02:35:30 CDT 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
 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;
 }
 
-- 
2.9.0



More information about the wine-patches mailing list