diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-11-24 11:55:53 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-11-24 11:57:21 +0200 |
commit | dcbfa4be9bd95ad035770190abc625b64efd462f (patch) | |
tree | 6f64e3b84038d74d6a000516dba5d4323c93bb5a /xmlsecurity | |
parent | f9fee44d1b49d859f9ee6ab22cc34c758aac71f0 (diff) |
Show also the message for the last Windows error in our own error handler
That is what the default libxmlsec error handler
xmlSecMSCryptoErrorsDefaultCallback() does. Why show less information
in our own handler?
Change-Id: Ibc9f9b5066536d0f5cabbf2bda6d1fa14eca5613
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/errorcallback.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx b/xmlsecurity/source/xmlsec/errorcallback.cxx index fbc0f88bacc3..dc817db1e0bd 100644 --- a/xmlsecurity/source/xmlsec/errorcallback.cxx +++ b/xmlsecurity/source/xmlsec/errorcallback.cxx @@ -21,6 +21,12 @@ #include "xmlsec-wrapper.h" +#ifdef _WIN32 +#include <prewin.h> +#include <postwin.h> +#include "comphelper/windowserrorstring.hxx" +#endif + extern "C" void errorCallback(const char* file, int line, @@ -33,7 +39,13 @@ void errorCallback(const char* file, const char* pErrorObject = errorObject ? errorObject : ""; const char* pErrorSubject = errorSubject ? errorSubject : ""; const char* pMsg = msg ? msg : ""; - SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'"); + OUString systemErrorString; + +#ifdef _WIN32 + systemErrorString = " " + WindowsErrorString(GetLastError()); +#endif + + SAL_WARN("xmlsecurity.xmlsec", file << ":" << line << ": " << func << "() '" << pErrorObject << "' '" << pErrorSubject << "' " << reason << " '" << pMsg << "'" << systemErrorString); } void setErrorRecorder() |