diff options
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() |