diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index ff7defb3b26..5487632a832 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -107,6 +107,7 @@ static void test_TypeComp(void) static WCHAR wszOLE_COLOR[] = {'O','L','E','_','C','O','L','O','R',0}; 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}; hr = LoadTypeLib(wszStdOle2, &pTypeLib); ok_ole_success(hr, LoadTypeLib); @@ -282,6 +283,17 @@ static void test_TypeComp(void) ITypeInfo_ReleaseFuncDesc(pTypeInfo, bindptr.lpfuncdesc); ITypeInfo_Release(pTypeInfo); + /* tests non-existent members */ + desckind = 0xdeadbeef; + bindptr.lptcomp = (ITypeComp*)0xdeadbeef; + pTypeInfo = (ITypeInfo*)0xdeadbeef; + ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszJunk); + hr = ITypeComp_Bind(pTypeComp, wszJunk, ulHash, 0, &pTypeInfo, &desckind, &bindptr); + ok_ole_success(hr, ITypeComp_Bind); + ok(desckind == DESCKIND_NONE, "desckind should have been DESCKIND_NONE, was: %d\n", desckind); + 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); + ITypeComp_Release(pTypeComp); ITypeInfo_Release(pFontTypeInfo); ITypeLib_Release(pTypeLib); diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 7a56e934229..b310a4b7551 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7654,9 +7654,9 @@ static HRESULT WINAPI ITypeComp_fnBind( ITypeInfoImpl *This = info_impl_from_ITypeComp(iface); const TLBFuncDesc *pFDesc; const TLBVarDesc *pVDesc; - HRESULT hr = DISP_E_MEMBERNOTFOUND; + HRESULT hr = S_OK; - TRACE("(%s, %x, 0x%x, %p, %p, %p)\n", debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr); + TRACE("(%p)->(%s, %x, 0x%x, %p, %p, %p)\n", This, debugstr_w(szName), lHash, wFlags, ppTInfo, pDescKind, pBindPtr); *pDescKind = DESCKIND_NONE; pBindPtr->lpfuncdesc = NULL; @@ -7716,7 +7716,7 @@ static HRESULT WINAPI ITypeComp_fnBind( } WARN("Could not search inherited interface!\n"); } - WARN("did not find member with name %s, flags 0x%x!\n", debugstr_w(szName), wFlags); + TRACE("did not find member with name %s, flags 0x%x\n", debugstr_w(szName), wFlags); return hr; }