Robert Shearman : oleaut: ITypeInfo::
GetIDsOfNames should search inherited interfaces
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Mar 21 13:21:29 CST 2006
Module: wine
Branch: refs/heads/master
Commit: 4b19449b6b145880461fc133296fa26d9c1dc7c5
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=4b19449b6b145880461fc133296fa26d9c1dc7c5
Author: Robert Shearman <rob at codeweavers.com>
Date: Tue Mar 21 13:45:51 2006 +0000
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.
---
dlls/oleaut32/tests/typelib.c | 12 +++++++++++-
dlls/oleaut32/typelib.c | 11 +++++++----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 72021dd..1108496 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -227,13 +227,15 @@ 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);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index ede6de5..cfb17ba 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -4784,9 +4784,8 @@ static HRESULT WINAPI ITypeInfo_fnGetIDs
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++;
More information about the wine-cvs
mailing list