Porot Mo : oleaut32: Match funcdesc using both memberid and invkind.

Alexandre Julliard julliard at winehq.org
Thu Jun 11 15:26:45 CDT 2020


Module: wine
Branch: master
Commit: 48ef66e9e31bc260937dfc43a72dc56772cfd1ab
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=48ef66e9e31bc260937dfc43a72dc56772cfd1ab

Author: Porot Mo <porotmjp at gmail.com>
Date:   Thu Jun 11 09:03:08 2020 +0100

oleaut32: Match funcdesc using both memberid and invkind.

Property access functions can share the same memberid.

Signed-off-by: Porot Mo <porotmjp at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/tests/typelib.c |  3 ---
 dlls/oleaut32/typelib.c       | 15 ++++++++++++++-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index c095d8ea0f..a8cb966f33 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -1050,11 +1050,9 @@ static void test_TypeInfo(void)
 
     /* correct memberid -- wrong invkind */
     hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x60000000, INVOKE_FUNC, &bstrDllName, &bstrName, &ordinal);
-todo_wine
     ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
 
     hr = ITypeInfo_GetDllEntry(pTypeInfo, 0x60000000, INVOKE_PROPERTYPUTREF, &bstrDllName, &bstrName, &ordinal);
-todo_wine
     ok(hr == TYPE_E_ELEMENTNOTFOUND, "ITypeInfo_GetDllEntry should have returned TYPE_E_ELEMENTNOTFOUND instead of 0x%08x\n", hr);
 
     /* correct memberid -- correct invkind */
@@ -1069,7 +1067,6 @@ todo_wine
     ok_ole_success(hr, ITypeInfo_GetDllEntry);
     ok(!lstrcmpW(bstrDllName, wszTestDll), "got %s\n", wine_dbgstr_w(bstrDllName));
     ok(bstrName == NULL, "got %s\n", wine_dbgstr_w(bstrName));
-todo_wine
     ok(ordinal == 2, "got ordinal: %04x\n", ordinal);
     SysFreeString(bstrDllName);
 
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index ab421fec90..01bb16efbc 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -1701,6 +1701,19 @@ static inline TLBFuncDesc *TLB_get_funcdesc_by_memberid(ITypeInfoImpl *typeinfo,
     return NULL;
 }
 
+static inline TLBFuncDesc *TLB_get_funcdesc_by_memberid_invkind(ITypeInfoImpl *typeinfo, MEMBERID memid, INVOKEKIND invkind)
+{
+    int i;
+
+    for (i = 0; i < typeinfo->typeattr.cFuncs; ++i)
+    {
+        if (typeinfo->funcdescs[i].funcdesc.memid == memid && typeinfo->funcdescs[i].funcdesc.invkind == invkind)
+            return &typeinfo->funcdescs[i];
+    }
+
+    return NULL;
+}
+
 static inline TLBVarDesc *TLB_get_vardesc_by_memberid(ITypeInfoImpl *typeinfo, MEMBERID memid)
 {
     int i;
@@ -7804,7 +7817,7 @@ static HRESULT WINAPI ITypeInfo_fnGetDllEntry( ITypeInfo2 *iface, MEMBERID memid
     if (This->typeattr.typekind != TKIND_MODULE)
         return TYPE_E_BADMODULEKIND;
 
-    pFDesc = TLB_get_funcdesc_by_memberid(This, memid);
+    pFDesc = TLB_get_funcdesc_by_memberid_invkind(This, memid, invKind);
     if (!pFDesc) return TYPE_E_ELEMENTNOTFOUND;
 
     dump_TypeInfo(This);




More information about the wine-cvs mailing list