Commit 4b19449b authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

oleaut: ITypeInfo::GetIDsOfNames should search inherited interfaces

regardless of what type they are. Add a test for this and dump type infos created with CreateDispTypeInfo.
parent 130a0e4f
......@@ -227,12 +227,14 @@ static void test_CreateDispTypeInfo(void)
TYPEATTR *pTypeAttr;
HREFTYPE href;
FUNCDESC *pFuncDesc;
MEMBERID memid;
static const WCHAR func1[] = {'f','u','n','c','1',0};
static const WCHAR func2[] = {'f','u','n','c','2',0};
static const WCHAR func3[] = {'f','u','n','c','3',0};
static const WCHAR parm1[] = {'p','a','r','m','1',0};
static const WCHAR parm2[] = {'p','a','r','m','2',0};
OLECHAR *name = (OLECHAR *)func1;
ifdata.pmethdata = methdata;
ifdata.cMembers = sizeof(methdata) / sizeof(methdata[0]);
......@@ -293,6 +295,9 @@ static void test_CreateDispTypeInfo(void)
hr = ITypeInfo_GetRefTypeOfImplType(pTypeInfo, 0, &href);
ok(hr == S_OK, "hr %08lx\n", hr);
todo_wine {
ok(href == 0, "href = 0x%lx\n", href);
}
hr = ITypeInfo_GetRefTypeInfo(pTypeInfo, href, &pTI2);
ok(hr == S_OK, "hr %08lx\n", hr);
hr = ITypeInfo_GetTypeAttr(pTI2, &pTypeAttr);
......@@ -351,6 +356,11 @@ static void test_CreateDispTypeInfo(void)
ok(pFuncDesc->elemdescFunc.tdesc.vt == VT_I4, "ret vt %x\n", pFuncDesc->elemdescFunc.tdesc.vt);
ITypeInfo_ReleaseFuncDesc(pTI2, pFuncDesc);
/* test GetIDsOfNames on a coclass to see if it searches its interfaces */
hr = ITypeInfo_GetIDsOfNames(pTypeInfo, &name, 1, &memid);
ok(hr == S_OK, "hr 0x%08lx\n", hr);
ok(memid == 0x123, "memid 0x%08lx\n", memid);
ITypeInfo_Release(pTI2);
ITypeInfo_Release(pTypeInfo);
......
......@@ -4784,9 +4784,8 @@ static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames( ITypeInfo2 *iface,
return ret;
}
}
/* not found, see if this is and interface with an inheritance */
if(This->TypeAttr.cImplTypes &&
(This->TypeAttr.typekind==TKIND_INTERFACE || This->TypeAttr.typekind==TKIND_DISPATCH)) {
/* not found, see if it can be found in an inherited interface */
if(This->TypeAttr.cImplTypes) {
/* recursive search */
ITypeInfo *pTInfo;
ret=ITypeInfo_GetRefTypeInfo(iface,
......@@ -6338,7 +6337,7 @@ HRESULT WINAPI CreateDispTypeInfo(
int param, func;
TLBFuncDesc **ppFuncDesc;
TRACE_(typelib)("\n");
TRACE("\n");
pTypeLibImpl = TypeLibImpl_Constructor();
if (!pTypeLibImpl) return E_FAIL;
......@@ -6394,6 +6393,8 @@ HRESULT WINAPI CreateDispTypeInfo(
ppFuncDesc = &(*ppFuncDesc)->next;
}
dump_TypeInfo(pTIIface);
pTypeLibImpl->pTypeInfo = pTIIface;
pTypeLibImpl->TypeInfoCount++;
......@@ -6423,6 +6424,8 @@ HRESULT WINAPI CreateDispTypeInfo(
pTIClass->reflist->reference = 1;
pTIClass->reflist->pImpTLInfo = TLB_REF_INTERNAL;
dump_TypeInfo(pTIClass);
pTIIface->next = pTIClass;
pTypeLibImpl->TypeInfoCount++;
......
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