Commit 48ef66e9 authored by Porot Mo's avatar Porot Mo Committed by Alexandre Julliard

oleaut32: Match funcdesc using both memberid and invkind.

Property access functions can share the same memberid. Signed-off-by: 's avatarPorot Mo <porotmjp@gmail.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3b7c6420
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment