Andrew Eikum : oleaut32: Search inherited interfaces again in ITypeComp:: Bind.
Alexandre Julliard
julliard at winehq.org
Wed Nov 10 11:09:37 CST 2010
Module: wine
Branch: master
Commit: c0f120db5d6b72917dd9bb1e4630f2b6ff6960a6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0f120db5d6b72917dd9bb1e4630f2b6ff6960a6
Author: Andrew Eikum <aeikum at codeweavers.com>
Date: Tue Nov 9 16:04:10 2010 -0600
oleaut32: Search inherited interfaces again in ITypeComp::Bind.
---
dlls/oleaut32/tests/typelib.c | 14 ++++++++++++++
dlls/oleaut32/typelib.c | 4 +++-
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 016dbd0..ce40cb9 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -121,6 +121,7 @@ static void test_TypeComp(void)
static WCHAR wszClone[] = {'C','l','o','n','e',0};
static WCHAR wszclone[] = {'c','l','o','n','e',0};
static WCHAR wszJunk[] = {'J','u','n','k',0};
+ static WCHAR wszAddRef[] = {'A','d','d','R','e','f',0};
hr = LoadTypeLib(wszStdOle2, &pTypeLib);
ok_ole_success(hr, LoadTypeLib);
@@ -307,6 +308,19 @@ static void test_TypeComp(void)
ok(pTypeInfo == NULL, "pTypeInfo should have been NULL, was: %p\n", pTypeInfo);
ok(bindptr.lptcomp == NULL, "bindptr should have been NULL, was: %p\n", bindptr.lptcomp);
+ /* tests inherited members */
+ desckind = 0xdeadbeef;
+ bindptr.lpfuncdesc = NULL;
+ pTypeInfo = NULL;
+ ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszAddRef);
+ hr = ITypeComp_Bind(pTypeComp, wszAddRef, ulHash, 0, &pTypeInfo, &desckind, &bindptr);
+ ok_ole_success(hr, ITypeComp_Bind);
+ ok(desckind == DESCKIND_FUNCDESC, "desckind should have been DESCKIND_FUNCDESC, was: %d\n", desckind);
+ ok(pTypeInfo != NULL, "pTypeInfo should not have been NULL, was: %p\n", pTypeInfo);
+ ok(bindptr.lpfuncdesc != NULL, "bindptr should not have been NULL, was: %p\n", bindptr.lpfuncdesc);
+ ITypeInfo_ReleaseFuncDesc(pTypeInfo, bindptr.lpfuncdesc);
+ ITypeInfo_Release(pTypeInfo);
+
ITypeComp_Release(pTypeComp);
ITypeInfo_Release(pFontTypeInfo);
ITypeLib_Release(pTypeLib);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 0fb3cee..06c464d 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -7846,7 +7846,7 @@ static HRESULT WINAPI ITypeComp_fnBind(
ITypeInfoImpl *This = info_impl_from_ITypeComp(iface);
const TLBFuncDesc *pFDesc;
const TLBVarDesc *pVDesc;
- HRESULT hr = S_OK;
+ HRESULT hr = DISP_E_MEMBERNOTFOUND;
TRACE("(%p)->(%s, %x, 0x%x, %p, %p, %p)\n", This, debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr);
@@ -7908,6 +7908,8 @@ static HRESULT WINAPI ITypeComp_fnBind(
}
WARN("Could not search inherited interface!\n");
}
+ if (hr == DISP_E_MEMBERNOTFOUND)
+ hr = S_OK;
TRACE("did not find member with name %s, flags 0x%x\n", debugstr_w(szName), wFlags);
return hr;
}
More information about the wine-cvs
mailing list