[git] GpgOL - branch, master, updated. gpgol-1.2.0-69-gb5c358e
by Andre Heinecke
cvs at cvs.gnupg.org
Tue Oct 20 16:58:13 CEST 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, master has been updated
via b5c358e535504d391651bb411eee24fd9a29698c (commit)
via c66067e20be3f854b1a9ab68ad9d6f3fe54902ca (commit)
from 7016fec9aef7be53f164829f7c76e28c6a83e228 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b5c358e535504d391651bb411eee24fd9a29698c
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Tue Oct 20 16:53:18 2015 +0200
More logging and error checking in App Events
* src/application-events.cpp (ApplicationEvents::Invoke): Check
that parms is not NULL. Add more debug output.
--
According to the Windows Event log attached to gnupg-bug: 1837
gpgol caused a crash while handling 0xFBA7 (ItemLoad).
This should help to home in on such a crash. I doub't that
parms is NULL in the Invoke call but as you can never
know let's be more defensive with error checks.
diff --git a/src/application-events.cpp b/src/application-events.cpp
index 8b3b0c2..196e6ed 100644
--- a/src/application-events.cpp
+++ b/src/application-events.cpp
@@ -65,23 +65,26 @@ EVENT_SINK_INVOKE(ApplicationEvents)
LPDISPATCH mailItem;
LPDISPATCH mailEventSink;
/* The mailItem should be the first argument */
- if (parms->cArgs != 1 || parms->rgvarg[0].vt != VT_DISPATCH)
+ if (!parms || parms->cArgs != 1 ||
+ parms->rgvarg[0].vt != VT_DISPATCH)
{
log_error ("%s:%s: ItemLoad with unexpected Arguments.",
SRCNAME, __func__);
break;
}
+ log_debug ("%s:%s: ItemLoad event. Getting object.",
+ SRCNAME, __func__);
mailItem = get_object_by_id (parms->rgvarg[0].pdispVal,
IID_MailItem);
if (!mailItem)
{
- log_error ("%s:%s: ItemLoad event without mailitem.",
+ log_debug ("%s:%s: ItemLoad event without mailitem.",
SRCNAME, __func__);
break;
}
- log_oom ("%s:%s: Installing event sink on mailitem: %p",
- SRCNAME, __func__, mailItem);
+ log_debug ("%s:%s: Installing event sink on mailitem: %p",
+ SRCNAME, __func__, mailItem);
mailEventSink = install_MailItemEvents_sink (mailItem);
/* TODO figure out what we need to do with the event sink.
Does it need to be Released at some point? What happens
@@ -91,6 +94,11 @@ EVENT_SINK_INVOKE(ApplicationEvents)
log_error ("%s:%s: Failed to install MailItemEvents sink.",
SRCNAME, __func__);
}
+ else
+ {
+ log_debug ("%s:%s: MailItem event handler installed.",
+ SRCNAME, __func__);
+ }
mailItem->Release ();
break;
}
commit c66067e20be3f854b1a9ab68ad9d6f3fe54902ca
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Tue Oct 20 16:52:15 2015 +0200
Log UTC time instead of tick count.
* src/main.c (do_log): Log the current UTC time to allow
corellating debug output to Windows event logs.
diff --git a/src/main.c b/src/main.c
index f2a8cf5..5e3a05d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,6 +22,7 @@
#include <windows.h>
#include <wincrypt.h>
#include <ctype.h>
+#include <winnls.h>
#include "mymapi.h"
#include "mymapitags.h"
@@ -254,9 +255,26 @@ do_log (const char *fmt, va_list a, int w32err, int err,
return;
}
- fprintf (logfp, "%05lu/%lu/",
- ((unsigned long)GetTickCount () % 100000),
- (unsigned long)GetCurrentThreadId ());
+ char time_str[9];
+ SYSTEMTIME utc_time;
+ GetSystemTime (&utc_time);
+ if (GetTimeFormatA (LOCALE_INVARIANT,
+ TIME_FORCE24HOURFORMAT | LOCALE_USE_CP_ACP,
+ &utc_time,
+ "HH:mm:ss",
+ time_str,
+ 9))
+ {
+ fprintf (logfp, "%s/%lu/",
+ time_str,
+ (unsigned long)GetCurrentThreadId ());
+ }
+ else
+ {
+ fprintf (logfp, "unknown/%lu/",
+ (unsigned long)GetCurrentThreadId ());
+ }
+
if (err == 1)
fputs ("ERROR/", logfp);
vfprintf (logfp, fmt, a);
-----------------------------------------------------------------------
Summary of changes:
src/application-events.cpp | 16 ++++++++++++----
src/main.c | 24 +++++++++++++++++++++---
2 files changed, 33 insertions(+), 7 deletions(-)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list