[PATCH v4 2/2] oleaut32: Retrieve funcdesc from TLB by memberid and invkind.
Porot Mo
porotmjp at gmail.com
Wed Jun 10 04:38:34 CDT 2020
This allows ITypeInfo::GetDllEntry() to search exact property
access functions which share same memberid.
Signed-off-by: Porot Mo <porotmjp at gmail.com>
---
v3: split tests and fix
v4: remove todo_wine
dlls/oleaut32/tests/typelib.c | 3 ---
dlls/oleaut32/typelib.c | 15 ++++++++++++++-
2 files changed, 14 insertions(+), 4 deletions(-)
-------------- next part --------------
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 8eb2665..b827666 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 */
@@ -1068,7 +1066,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);
ITypeInfo_Release(pTypeInfo);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index f8d7136..48de363 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){
dump_TypeInfo(This);
if (TRACE_ON(ole))
More information about the wine-devel
mailing list