diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 37f67152f5f..5738fb791ee 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -2051,24 +2051,18 @@ INT WINAPI StrFromTimeIntervalW(LPWSTR lpszStr, UINT cchMax, DWORD dwMS, BOOL WINAPI StrIsIntlEqualA(BOOL bCase, LPCSTR lpszStr, LPCSTR lpszComp, int iLen) { - DWORD dwFlags = LOCALE_USE_CP_ACP; - int iRet; + DWORD dwFlags; TRACE("(%d,%s,%s,%d)\n", bCase, debugstr_a(lpszStr), debugstr_a(lpszComp), iLen); - /* FIXME: These flags are undocumented and unknown by our CompareString. - * We need defines for them. + /* FIXME: This flag is undocumented and unknown by our CompareString. + * We need a define for it. */ - dwFlags |= bCase ? 0x10000000 : 0x10000001; + dwFlags = 0x10000000; + if (!bCase) dwFlags |= NORM_IGNORECASE; - iRet = CompareStringA(GetThreadLocale(), - dwFlags, lpszStr, iLen, lpszComp, iLen); - - if (!iRet) - iRet = CompareStringA(2048, dwFlags, lpszStr, iLen, lpszComp, iLen); - - return iRet == 2 ? TRUE : FALSE; + return (CompareStringA(GetThreadLocale(), dwFlags, lpszStr, iLen, lpszComp, iLen) == CSTR_EQUAL); } /************************************************************************* @@ -2080,23 +2074,17 @@ BOOL WINAPI StrIsIntlEqualW(BOOL bCase, LPCWSTR lpszStr, LPCWSTR lpszComp, int iLen) { DWORD dwFlags; - int iRet; TRACE("(%d,%s,%s,%d)\n", bCase, debugstr_w(lpszStr),debugstr_w(lpszComp), iLen); - /* FIXME: These flags are undocumented and unknown by our CompareString. - * We need defines for them. + /* FIXME: This flag is undocumented and unknown by our CompareString. + * We need a define for it. */ - dwFlags = bCase ? 0x10000000 : 0x10000001; + dwFlags = 0x10000000; + if (!bCase) dwFlags |= NORM_IGNORECASE; - iRet = CompareStringW(GetThreadLocale(), - dwFlags, lpszStr, iLen, lpszComp, iLen); - - if (!iRet) - iRet = CompareStringW(2048, dwFlags, lpszStr, iLen, lpszComp, iLen); - - return iRet == 2 ? TRUE : FALSE; + return (CompareStringW(GetThreadLocale(), dwFlags, lpszStr, iLen, lpszComp, iLen) == CSTR_EQUAL); } /************************************************************************* diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index ff269a21058..00efdadd629 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -558,16 +558,10 @@ void test_StrCmpA(void) ok(!ChrCmpIA('b', 'B'), "ChrCmpIA is not case-insensitive\n"); ok(ChrCmpIA('a', 'z'), "ChrCmpIA believes that a == z!\n"); - todo_wine - { - ok(StrIsIntlEqualA(FALSE, str1, str2, 5), "StrIsIntlEqualA(FALSE,...) isn't case-insensitive\n"); - } + ok(StrIsIntlEqualA(FALSE, str1, str2, 5), "StrIsIntlEqualA(FALSE,...) isn't case-insensitive\n"); ok(!StrIsIntlEqualA(TRUE, str1, str2, 5), "StrIsIntlEqualA(TRUE,...) isn't case-sensitive\n"); - todo_wine - { - ok(IntlStrEqWorkerA(FALSE, str1, str2, 5), "IntlStrEqWorkerA(FALSE,...) isn't case-insensitive\n"); - } + ok(IntlStrEqWorkerA(FALSE, str1, str2, 5), "IntlStrEqWorkerA(FALSE,...) isn't case-insensitive\n"); ok(!IntlStrEqWorkerA(TRUE, str1, str2, 5), "IntlStrEqWorkerA(TRUE,...) isn't case-sensitive\n"); }