[PATCH v3] ole32: Return IUnknown from GITCF_CreateInstance if requested

Alex Henrie alexhenrie24 at gmail.com
Tue Jul 10 04:08:04 CDT 2018


From: Huw Davies <huw at codeweavers.com>

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
Without this patch, ArcMap.exe (part of ArcGIS Desktop 10.6) crashes
shortly after starting.
---
 dlls/ole32/git.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/git.c b/dlls/ole32/git.c
index f7a0460154..8683f3592a 100644
--- a/dlls/ole32/git.c
+++ b/dlls/ole32/git.c
@@ -122,9 +122,14 @@ StdGlobalInterfaceTable_QueryInterface(IGlobalInterfaceTable* iface,
   /* Do we implement that interface? */
   if (IsEqualIID(&IID_IUnknown, riid) ||
       IsEqualIID(&IID_IGlobalInterfaceTable, riid))
+  {
     *ppvObject = iface;
+  }
   else
+  {
+    FIXME("(%s), not supported.\n", debugstr_guid(riid));
     return E_NOINTERFACE;
+  }
 
   /* Now inc the refcount */
   IGlobalInterfaceTable_AddRef(iface);
@@ -314,13 +319,10 @@ static HRESULT WINAPI
 GITCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnk,
                      REFIID riid, LPVOID *ppv)
 {
-  if (IsEqualIID(riid,&IID_IGlobalInterfaceTable)) {
-    IGlobalInterfaceTable *git = get_std_git();
-    return IGlobalInterfaceTable_QueryInterface(git, riid, ppv);
-  }
-
-  FIXME("(%s), not supported.\n",debugstr_guid(riid));
-  return E_NOINTERFACE;
+  IGlobalInterfaceTable *git = get_std_git();
+  HRESULT hr = IGlobalInterfaceTable_QueryInterface(git, riid, ppv);
+  IGlobalInterfaceTable_Release(git);
+  return hr;
 }
 
 static HRESULT WINAPI GITCF_LockServer(LPCLASSFACTORY iface, BOOL fLock)
-- 
2.18.0




More information about the wine-devel mailing list