[git] GpgOL - branch, master, updated. gpgol-2.3.2-2-g287eaa6

by Andre Heinecke cvs at cvs.gnupg.org
Tue Nov 13 10:57:50 CET 2018


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  287eaa69c04c8fbbf6f135c3f23f78cf15e77a9e (commit)
      from  42b022f076e6f131e01c966ee74b7bcf870b8025 (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 287eaa69c04c8fbbf6f135c3f23f78cf15e77a9e
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Tue Nov 13 10:56:58 2018 +0100

    Fix log_addins and use it to log all addins
    
    * src/mailitem-events.cpp (Read): call log_addins once.
    * src/oomhelp.cpp (log_addins): Fix by invoking directly.

diff --git a/src/mailitem-events.cpp b/src/mailitem-events.cpp
index 0bac718..b251229 100644
--- a/src/mailitem-events.cpp
+++ b/src/mailitem-events.cpp
@@ -106,6 +106,7 @@ MailItemEvents::~MailItemEvents()
 
 static bool propchangeWarnShown = false;
 static bool attachRemoveWarnShown = false;
+static bool addinsLogged = false;
 
 static DWORD WINAPI
 do_delayed_locate (LPVOID arg)
@@ -191,6 +192,13 @@ EVENT_SINK_INVOKE(MailItemEvents)
         {
           log_oom ("%s:%s: Read : %p",
                          SRCNAME, __func__, m_mail);
+          if (!addinsLogged)
+            {
+              // We do it here as this nearly always comes and we want to remove
+              // as much as possible from the startup time.
+              log_addins ();
+              addinsLogged = true;
+            }
           if (!m_mail->isCryptoMail ())
             {
               log_debug ("%s:%s: Non crypto mail %p opened. Updating sigstatus.",
diff --git a/src/oomhelp.cpp b/src/oomhelp.cpp
index ace525a..205eec5 100644
--- a/src/oomhelp.cpp
+++ b/src/oomhelp.cpp
@@ -2661,15 +2661,46 @@ log_addins ()
   int count = get_oom_int (addins, "Count");
   for (int i = 1; i <= count; i++)
     {
-      std::string item = std::string ("Item(") + std::to_string (i) + ")";
+      VARIANT aVariant[1];
+      VARIANT rVariant;
+
+      VariantInit (&rVariant);
+      DISPPARAMS dispparams;
+
+      dispparams.rgvarg = aVariant;
+      dispparams.rgvarg[0].vt = VT_INT;
+      dispparams.rgvarg[0].intVal = i;
+      dispparams.cArgs = 1;
+      dispparams.cNamedArgs = 0;
+
+      /* We need this instead of get_oom_object item(1) as usual becase
+         the item method accepts a string or an int. String would
+         be the ProgID and int is just the index. So Fun. */
+      if (invoke_oom_method_with_parms_type (addins, "Item", &rVariant,
+                                             &dispparams,
+                                             DISPATCH_METHOD |
+                                             DISPATCH_PROPERTYGET))
+        {
+          log_error ("%s:%s: Failed to invoke item func.",
+                     SRCNAME, __func__);
+          continue;
+        }
+
+      if (rVariant.vt != (VT_DISPATCH))
+        {
+          log_error ("%s:%s: Invalid ret val",
+                     SRCNAME, __func__);
+          continue;
+        }
 
-      LPDISPATCH addin = get_oom_object (addins, item.c_str ());
+      LPDISPATCH addin = rVariant.pdispVal;
 
       if (!addin)
         {
           TRACEPOINT;
           continue;
         }
+      memdbg_addRef (addin);
       bool connected = get_oom_bool (addin, "Connect");
       if (!connected)
         {

-----------------------------------------------------------------------

Summary of changes:
 src/mailitem-events.cpp |  8 ++++++++
 src/oomhelp.cpp         | 35 +++++++++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list