qmgr: Ignore errors when registering the service.

This commit is contained in:
Alexandre Julliard 2008-02-25 12:17:40 +01:00
parent e5bef99fbe
commit 84cf9caa75
1 changed files with 6 additions and 9 deletions

View File

@ -113,7 +113,6 @@ static HRESULT register_service(BOOL do_register)
static const WCHAR path[] = { 's','v','c','h','o','s','t','.','e','x','e',
' ','-','k',' ','n','e','t','s','v','c','s', 0 };
SC_HANDLE scm, service;
HRESULT hr = S_OK;
scm = OpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (!scm)
@ -129,14 +128,12 @@ static HRESULT register_service(BOOL do_register)
CloseServiceHandle(scm);
if (!service)
return SELFREG_E_CLASS;
if (!do_register)
hr = DeleteService(service) ? S_OK : SELFREG_E_CLASS;
CloseServiceHandle(service);
return hr;
if (service)
{
if (!do_register) DeleteService(service);
CloseServiceHandle(service);
}
return S_OK;
}
/* Use an INF file to register or unregister the DLL */