xmlsecurity/source/xmlsec/errorcallback.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit dcbfa4be9bd95ad035770190abc625b64efd462f
Author: Tor Lillqvist <t...@collabora.com>
Date:   Thu Nov 24 11:55:53 2016 +0200

    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

diff --git a/xmlsecurity/source/xmlsec/errorcallback.cxx 
b/xmlsecurity/source/xmlsec/errorcallback.cxx
index fbc0f88..dc817db 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()
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to