From c0f120db5d6b72917dd9bb1e4630f2b6ff6960a6 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 9 Nov 2010 16:04:10 -0600 Subject: [PATCH] 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 deletion(-) diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index 016dbd06daf..ce40cb924e0 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 0fb3cee370b..06c464d801d 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; } -- 2.11.4.GIT