Andrew Eikum : oleaut32: Don't fail if member is missing in ITypeComp::Bind .

Alexandre Julliard julliard at winehq.org
Mon Jul 19 11:05:35 CDT 2010


Module: wine
Branch: master
Commit: 3173305e887775624d46f7cc65283723886930c0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3173305e887775624d46f7cc65283723886930c0

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Fri Jul 16 12:27:27 2010 -0500

oleaut32: Don't fail if member is missing in ITypeComp::Bind.

---

 dlls/oleaut32/tests/typelib.c |   12 ++++++++++++
 dlls/oleaut32/typelib.c       |    6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index ff7defb..5487632 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 7a56e93..b310a4b 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;
 }
 




More information about the wine-cvs mailing list