[PATCH 1/4] advapi32: Don't call CloseServiceHandle() with an invalid handle.
Huw Davies
huw at codeweavers.com
Thu Jul 16 05:56:05 CDT 2015
---
This series avoids calling CloseServiceHandle() if we know we have
an invalid handle. The function will cope, but it involves a
round-trip to services.exe and results in a raised exception.
dlls/advapi32/security.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index c2ce1e1..b632577 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -431,8 +431,10 @@ static inline DWORD get_security_service( LPWSTR full_service_name, DWORD access
err = SERV_OpenSCManagerW( NULL, NULL, access, (SC_HANDLE *)&manager );
if (err == ERROR_SUCCESS)
+ {
err = SERV_OpenServiceW( manager, full_service_name, access, (SC_HANDLE *)service );
- CloseServiceHandle( manager );
+ CloseServiceHandle( manager );
+ }
return err;
}
--
1.8.0
More information about the wine-patches
mailing list