Commit 0c620a58 authored by Peter Eisentraut's avatar Peter Eisentraut

Improve error messages after LoadLibrary()

Move the file name to a format parameter to ease translatability.  Add
error code where missing.  Make the wording consistent.
parent e894c618
...@@ -1518,8 +1518,8 @@ pg_SSPI_recvauth(Port *port) ...@@ -1518,8 +1518,8 @@ pg_SSPI_recvauth(Port *port)
secur32 = LoadLibrary("SECUR32.DLL"); secur32 = LoadLibrary("SECUR32.DLL");
if (secur32 == NULL) if (secur32 == NULL)
ereport(ERROR, ereport(ERROR,
(errmsg_internal("could not load secur32.dll: error code %lu", (errmsg("could not load library \"%s\": error code %lu",
GetLastError()))); "SECUR32.DLL", GetLastError())));
_QuerySecurityContextToken = (QUERY_SECURITY_CONTEXT_TOKEN_FN) _QuerySecurityContextToken = (QUERY_SECURITY_CONTEXT_TOKEN_FN)
GetProcAddress(secur32, "QuerySecurityContextToken"); GetProcAddress(secur32, "QuerySecurityContextToken");
...@@ -2517,7 +2517,8 @@ InitializeLDAPConnection(Port *port, LDAP **ldap) ...@@ -2517,7 +2517,8 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
* wldap32, but check anyway * wldap32, but check anyway
*/ */
ereport(LOG, ereport(LOG,
(errmsg("could not load wldap32.dll"))); (errmsg("could not load library \"%s\": error code %lu",
"WLDAP32.DLL", GetLastError())));
ldap_unbind(*ldap); ldap_unbind(*ldap);
return STATUS_ERROR; return STATUS_ERROR;
} }
......
...@@ -61,8 +61,8 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo) ...@@ -61,8 +61,8 @@ CreateRestrictedProcess(char *cmd, PROCESS_INFORMATION *processInfo)
Advapi32Handle = LoadLibrary("ADVAPI32.DLL"); Advapi32Handle = LoadLibrary("ADVAPI32.DLL");
if (Advapi32Handle == NULL) if (Advapi32Handle == NULL)
{ {
pg_log_error("could not load advapi32.dll: error code %lu", pg_log_error("could not load library \"%s\": error code %lu",
GetLastError()); "ADVAPI32.DLL", GetLastError());
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment