Robert Shearman : oleaut32: ITypeComp_fnBind should do case-insensitive compares on the name passed in .

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jul 7 07:56:04 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: ef7b6e2740dd4a958bd66ec0c1e197a362ee0c63
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=ef7b6e2740dd4a958bd66ec0c1e197a362ee0c63

Author: Robert Shearman <rob at codeweavers.com>
Date:   Thu Jul  6 12:55:05 2006 +0100

oleaut32: ITypeComp_fnBind should do case-insensitive compares on the name passed in.

---

 dlls/oleaut32/tests/typelib.c |   13 +++++++++++++
 dlls/oleaut32/typelib.c       |    4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index 8aa7b0f..343b5d1 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -83,6 +83,7 @@ static void test_TypeComp(void)
     static WCHAR wszStdPicture[] = {'S','t','d','P','i','c','t','u','r','e',0};
     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};
 
     hr = LoadTypeLib(wszStdOle2, &pTypeLib);
     ok_ole_success(hr, LoadTypeLib);
@@ -245,6 +246,18 @@ static void test_TypeComp(void)
     ok(!pTypeInfo, "pTypeInfo should have been set to NULL\n");
     ok(!bindptr.lptcomp, "bindptr should have been set to NULL\n");
 
+    /* tests that the compare is case-insensitive */
+    ulHash = LHashValOfNameSys(SYS_WIN32, LOCALE_NEUTRAL, wszclone);
+    hr = ITypeComp_Bind(pTypeComp, wszclone, ulHash, 0, &pTypeInfo, &desckind, &bindptr);
+    ok_ole_success(hr, ITypeComp_Bind);
+
+    ok(desckind == DESCKIND_FUNCDESC,
+        "desckind should have been DESCKIND_FUNCDESC instead of %d\n",
+        desckind);
+    ok(bindptr.lpfuncdesc != NULL, "bindptr.lpfuncdesc should not have been set to NULL\n");
+    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 dedea02..080e25b 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -6544,7 +6544,7 @@ static HRESULT WINAPI ITypeComp_fnBind(
     *ppTInfo = NULL;
 
     for(pFDesc = This->funclist; pFDesc; pFDesc = pFDesc->next)
-        if (!strcmpW(pFDesc->Name, szName)) {
+        if (!strcmpiW(pFDesc->Name, szName)) {
             if (!wFlags || (pFDesc->funcdesc.invkind & wFlags))
                 break;
             else
@@ -6566,7 +6566,7 @@ static HRESULT WINAPI ITypeComp_fnBind(
         return S_OK;
     } else {
         for(pVDesc = This->varlist; pVDesc; pVDesc = pVDesc->next) {
-            if (!strcmpW(pVDesc->Name, szName)) {
+            if (!strcmpiW(pVDesc->Name, szName)) {
                 HRESULT hr = TLB_AllocAndInitVarDesc(&pVDesc->vardesc, &pBindPtr->lpvardesc);
                 if (FAILED(hr))
                     return hr;




More information about the wine-cvs mailing list