wbemprox: Don't call CloseServiceHandle() with an invalid handle.
This commit is contained in:
parent
3e7f0e685b
commit
125f3151cb
|
@ -69,11 +69,11 @@ static HRESULT control_service( const WCHAR *name, DWORD control, VARIANT *retva
|
|||
goto done;
|
||||
}
|
||||
if (!ControlService( service, control, &status )) error = map_error( GetLastError() );
|
||||
CloseServiceHandle( service );
|
||||
|
||||
done:
|
||||
set_variant( VT_UI4, error, NULL, retval );
|
||||
CloseServiceHandle( service );
|
||||
CloseServiceHandle( manager );
|
||||
if (manager) CloseServiceHandle( manager );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -183,11 +183,11 @@ static HRESULT start_service( const WCHAR *name, VARIANT *retval )
|
|||
goto done;
|
||||
}
|
||||
if (!StartServiceW( service, 0, NULL )) error = map_error( GetLastError() );
|
||||
CloseServiceHandle( service );
|
||||
|
||||
done:
|
||||
set_variant( VT_UI4, error, NULL, retval );
|
||||
CloseServiceHandle( service );
|
||||
CloseServiceHandle( manager );
|
||||
if (manager) CloseServiceHandle( manager );
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue