[git] GpgOL - branch, master, updated. gpgol-1.2.0-67-g7016fec

by Andre Heinecke cvs at cvs.gnupg.org
Fri Oct 16 14:11:10 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  7016fec9aef7be53f164829f7c76e28c6a83e228 (commit)
      from  db829bd34a6372a734f7ebe669f410cf5b7c9f96 (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 7016fec9aef7be53f164829f7c76e28c6a83e228
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Fri Oct 16 11:57:06 2015 +0200

    Add Tracepoints for issue 1837
    
    * src/gpgoladdin.cpp (GpgolRibbonExtender::GetCustomUI),
     src/ribbon-callbacks.cpp (getIcon): Add Tracepoints.
    
    --
    User kjathome reports seemingly random crashed in issue1837
    where at least outlook thinks that they happen in the getIcon
    and GetCustomUI callbacks. As this is both pretty static code
    I am clueless why they would crash randomly.
    
    This Trace output might give us a better idea. It should be
    reverted before a release.

diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index 2b59f51..74b7fcc 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -644,6 +644,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
 STDMETHODIMP
 GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
 {
+  TRACEPOINT
   char *buffer = NULL;
   const char *certManagerTTip =
     _("Start the Certificate Management Software");
@@ -681,14 +682,17 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
       "The combination of the signed message text and your signature is "
       "added below the plain text. "
       "The message will not be encrypted!");
+  TRACEPOINT
 
   log_debug ("%s:%s: GetCustomUI for id: %ls", SRCNAME, __func__, RibbonID);
 
   if (!RibbonXml)
     return E_POINTER;
 
+  TRACEPOINT
   if (!wcscmp (RibbonID, L"Microsoft.Outlook.Mail.Compose"))
     {
+      TRACEPOINT
       asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
@@ -781,6 +785,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
     }
   else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Mail.Read"))
     {
+      TRACEPOINT
       asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
@@ -854,6 +859,7 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
     }
   else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Explorer"))
     {
+      TRACEPOINT
       asprintf (&buffer,
         "<customUI xmlns=\"http://schemas.microsoft.com/office/2009/07/customui\">"
         " <ribbon>"
@@ -922,17 +928,23 @@ GpgolRibbonExtender::GetCustomUI (BSTR RibbonID, BSTR * RibbonXml)
         _("GpgOL"), _("Save and decrypt"),/*_("Decrypt"), */
         _("Save and decrypt"));
     }
+  TRACEPOINT
 
   if (buffer)
     {
+      TRACEPOINT
       wchar_t *wbuf = utf8_to_wchar2 (buffer, strlen(buffer));
       xfree (buffer);
+      TRACEPOINT
       *RibbonXml = SysAllocString (wbuf);
+      TRACEPOINT
       xfree (wbuf);
+      TRACEPOINT
     }
   else
     *RibbonXml = NULL;
 
+  TRACEPOINT
   return S_OK;
 }
 #endif /* MIME_SEND */
diff --git a/src/ribbon-callbacks.cpp b/src/ribbon-callbacks.cpp
index f08d168..dff6a74 100644
--- a/src/ribbon-callbacks.cpp
+++ b/src/ribbon-callbacks.cpp
@@ -875,6 +875,7 @@ do_reader_action (LPDISPATCH ctrl, int flags)
 HRESULT
 getIcon (int id, VARIANT* result)
 {
+  TRACEPOINT
   PICTDESC pdesc;
   LPDISPATCH pPict;
   HRESULT hr;
@@ -890,6 +891,7 @@ getIcon (int id, VARIANT* result)
   pdesc.cbSizeofstruct = sizeof pdesc;
   pdesc.picType = PICTYPE_BITMAP;
 
+  TRACEPOINT
   if (!result)
     {
       log_error ("getIcon called without result variant.");
@@ -904,6 +906,7 @@ getIcon (int id, VARIANT* result)
   GdiplusStartup (&gdiplusToken, &gdiplusStartupInput, NULL);
 
   /* Get the image from the resource file */
+  TRACEPOINT
   hResource = FindResource (glob_hinst, MAKEINTRESOURCE(id), RT_RCDATA);
   if (!hResource)
     {
@@ -912,10 +915,12 @@ getIcon (int id, VARIANT* result)
       return E_FAIL;
     }
 
+  TRACEPOINT
   imageSize = SizeofResource (glob_hinst, hResource);
   if (!imageSize)
     return E_FAIL;
 
+  TRACEPOINT
   pResourceData = LockResource (LoadResource(glob_hinst, hResource));
 
   if (!pResourceData)
@@ -925,36 +930,47 @@ getIcon (int id, VARIANT* result)
       return E_FAIL;
     }
 
+  TRACEPOINT
   hBuffer = GlobalAlloc (GMEM_MOVEABLE, imageSize);
 
+  TRACEPOINT
   if (hBuffer)
     {
       void* pBuffer = GlobalLock (hBuffer);
       if (pBuffer)
         {
+          TRACEPOINT
           IStream* pStream = NULL;
           CopyMemory (pBuffer, pResourceData, imageSize);
 
+          TRACEPOINT
           if (CreateStreamOnHGlobal (hBuffer, FALSE, &pStream) == S_OK)
             {
+              TRACEPOINT
               pbitmap = Gdiplus::Bitmap::FromStream (pStream);
               pStream->Release();
               if (!pbitmap || pbitmap->GetHBITMAP (0, &pdesc.bmp.hbitmap))
                 {
+                  TRACEPOINT
                   log_error ("%s:%s: failed to get PNG.",
                              SRCNAME, __func__);
                 }
             }
         }
+      TRACEPOINT
       GlobalUnlock (pBuffer);
     }
+  TRACEPOINT
   GlobalFree (hBuffer);
 
+  TRACEPOINT
   Gdiplus::GdiplusShutdown (gdiplusToken);
+  TRACEPOINT
 
   /* Wrap the image into an OLE object.  */
   hr = OleCreatePictureIndirect (&pdesc, IID_IPictureDisp,
                                  TRUE, (void **) &pPict);
+  TRACEPOINT
   if (hr != S_OK || !pPict)
     {
       log_error ("%s:%s: OleCreatePictureIndirect failed: hr=%#lx\n",
@@ -962,8 +978,10 @@ getIcon (int id, VARIANT* result)
       return -1;
     }
 
+  TRACEPOINT
   result->pdispVal = pPict;
   result->vt = VT_DISPATCH;
+  TRACEPOINT
 
   return S_OK;
 }

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

Summary of changes:
 src/gpgoladdin.cpp       | 12 ++++++++++++
 src/ribbon-callbacks.cpp | 18 ++++++++++++++++++
 2 files changed, 30 insertions(+)


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




More information about the Gnupg-commits mailing list