[ADVAPI32] OpenSCManagerA/W: Set the last error even in case of success

This fixes a failure in the QueryServiceConfig2 api test.
This commit is contained in:
Eric Kohl 2019-12-31 23:23:23 +01:00
parent 17864b49e3
commit 5d3fe05505

View file

@ -1989,10 +1989,10 @@ OpenSCManagerA(LPCSTR lpMachineName,
}
RpcEndExcept;
SetLastError(dwError);
if (dwError != ERROR_SUCCESS)
{
TRACE("ROpenSCManagerA() failed (Error %lu)\n", dwError);
SetLastError(dwError);
return NULL;
}
@ -2033,10 +2033,10 @@ OpenSCManagerW(LPCWSTR lpMachineName,
}
RpcEndExcept;
SetLastError(dwError);
if (dwError != ERROR_SUCCESS)
{
TRACE("ROpenSCManagerW() failed (Error %lu)\n", dwError);
SetLastError(dwError);
return NULL;
}