kernel32: Allow CompareStringEx NORM_LINGUISTIC_CASING flag.

This commit is contained in:
Erich E. Hoover 2014-04-16 13:55:13 -06:00 committed by Alexandre Julliard
parent 4b949510fb
commit b0935ab811
2 changed files with 9 additions and 7 deletions

View File

@ -2985,6 +2985,10 @@ INT WINAPI CompareStringW(LCID lcid, DWORD flags,
INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
LPCWSTR str2, INT len2, LPNLSVERSIONINFO version, LPVOID reserved, LPARAM lParam)
{
DWORD supported_flags = NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|SORT_STRINGSORT
|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP;
DWORD semistub_flags = NORM_LINGUISTIC_CASING|0x10000000;
/* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */
INT ret;
if (version) FIXME("unexpected version parameter\n");
@ -2997,16 +3001,14 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
return 0;
}
if( flags & ~(NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|
SORT_STRINGSORT|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP|0x10000000) )
if (flags & ~(supported_flags|semistub_flags))
{
SetLastError(ERROR_INVALID_FLAGS);
return 0;
}
/* this style is related to diacritics in Arabic, Japanese, and Hebrew */
if (flags & 0x10000000)
WARN("Ignoring unknown flags 0x10000000\n");
if (flags & semistub_flags)
FIXME("semi-stub behavor for flag(s) 0x%x\n", flags & semistub_flags);
if (len1 < 0) len1 = strlenW(str1);
if (len2 < 0) len2 = strlenW(str2);

View File

@ -1543,7 +1543,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 13 */
"tr-TR", NORM_LINGUISTIC_CASING,
{'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
{'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE
},
{ /* 14 */
"tr-TR", NORM_LINGUISTIC_CASING,
@ -1593,7 +1593,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 25 */
"tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
{'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE
{'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, FALSE
},
{ /* 26 */
"tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,