From ef7b6e2740dd4a958bd66ec0c1e197a362ee0c63 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 6 Jul 2006 12:55:05 +0100 Subject: [PATCH] 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 8aa7b0f48c9..343b5d1c681 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 dedea021e76..080e25b3e5e 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;