Removed linguistic casing patches (accepted upstream).

This commit is contained in:
Erich E. Hoover 2014-04-17 12:56:29 -06:00
parent f9eebd5599
commit f5ef032c89
6 changed files with 3 additions and 374 deletions

4
debian/changelog vendored
View File

@ -1,7 +1,7 @@
wine-compholio (1.7.16-1) UNRELEASED; urgency=low
* Split Arial replacement into two patches.
* Remove dynamic unwind patches (accepted upstream).
* Update the linguistic casing patches to print a FIXME that the flags are not fully supported.
* Removed dynamic unwind patches (accepted upstream).
* Removed linguistic casing patches (accepted upstream).
-- Erich E. Hoover <erich.e.hoover@gmail.com> Sat, 05 Apr 2014 17:38:41 -0600
wine-compholio (1.7.16-1) unstable; urgency=low

View File

@ -1,244 +0,0 @@
From 091f3c0d303ee4e7b2f44d1f28dc876bc845d471 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 5 Apr 2014 14:25:59 -0600
Subject: kernel32/tests: Add a variety of tests for CompareStringEx.
---
dlls/kernel32/tests/locale.c | 200 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 200 insertions(+)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index 9abe53e..fc071a7 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -88,6 +88,8 @@ static INT (WINAPI *pIdnToUnicode)(DWORD, LPCWSTR, INT, LPWSTR, INT);
static INT (WINAPI *pGetLocaleInfoEx)(LPCWSTR, LCTYPE, LPWSTR, INT);
static BOOL (WINAPI *pIsValidLocaleName)(LPCWSTR);
static INT (WINAPI *pCompareStringOrdinal)(const WCHAR *, INT, const WCHAR *, INT, BOOL);
+static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT,
+ LPNLSVERSIONINFO, LPVOID, LPARAM);
static void InitFunctionPointers(void)
{
@@ -108,6 +110,7 @@ static void InitFunctionPointers(void)
pGetLocaleInfoEx = (void*)GetProcAddress(hKernel32, "GetLocaleInfoEx");
pIsValidLocaleName = (void*)GetProcAddress(hKernel32, "IsValidLocaleName");
pCompareStringOrdinal = (void*)GetProcAddress(hKernel32, "CompareStringOrdinal");
+ pCompareStringEx = (void*)GetProcAddress(hKernel32, "CompareStringEx");
}
#define eq(received, expected, label, type) \
@@ -1472,6 +1475,202 @@ static void test_CompareStringA(void)
"ret %d, error %d, expected value %d\n", ret, GetLastError(), CSTR_EQUAL);
}
+struct comparestringex_test {
+ const char *locale;
+ DWORD flags;
+ const WCHAR first[2];
+ const WCHAR second[2];
+ INT ret;
+ INT broken;
+ BOOL todo;
+};
+
+static const struct comparestringex_test comparestringex_tests[] = {
+ /* default behavior */
+ { /* 0 */
+ "tr-TR", 0,
+ {'i',0}, {'I',0}, CSTR_LESS_THAN, -1, FALSE
+ },
+ { /* 1 */
+ "tr-TR", 0,
+ {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE
+ },
+ { /* 2 */
+ "tr-TR", 0,
+ {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE
+ },
+ { /* 3 */
+ "tr-TR", 0,
+ {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 4 */
+ "tr-TR", 0,
+ {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE
+ },
+ { /* 5 */
+ "tr-TR", 0,
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ },
+ /* with NORM_IGNORECASE */
+ { /* 6 */
+ "tr-TR", NORM_IGNORECASE,
+ {'i',0}, {'I',0}, CSTR_EQUAL, -1, FALSE
+ },
+ { /* 7 */
+ "tr-TR", NORM_IGNORECASE,
+ {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 8 */
+ "tr-TR", NORM_IGNORECASE,
+ {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE
+ },
+ { /* 9 */
+ "tr-TR", NORM_IGNORECASE,
+ {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 10 */
+ "tr-TR", NORM_IGNORECASE,
+ {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE
+ },
+ { /* 11 */
+ "tr-TR", NORM_IGNORECASE,
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ },
+ /* with NORM_LINGUISTIC_CASING */
+ { /* 12 */
+ "tr-TR", NORM_LINGUISTIC_CASING,
+ {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ },
+ { /* 13 */
+ "tr-TR", NORM_LINGUISTIC_CASING,
+ {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 14 */
+ "tr-TR", NORM_LINGUISTIC_CASING,
+ {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ },
+ { /* 15 */
+ "tr-TR", NORM_LINGUISTIC_CASING,
+ {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 16 */
+ "tr-TR", NORM_LINGUISTIC_CASING,
+ {'I',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ },
+ { /* 17 */
+ "tr-TR", NORM_LINGUISTIC_CASING,
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ },
+ /* with LINGUISTIC_IGNORECASE */
+ { /* 18 */
+ "tr-TR", LINGUISTIC_IGNORECASE,
+ {'i',0}, {'I',0}, CSTR_EQUAL, -1, TRUE
+ },
+ { /* 19 */
+ "tr-TR", LINGUISTIC_IGNORECASE,
+ {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 20 */
+ "tr-TR", LINGUISTIC_IGNORECASE,
+ {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 21 */
+ "tr-TR", LINGUISTIC_IGNORECASE,
+ {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 22 */
+ "tr-TR", LINGUISTIC_IGNORECASE,
+ {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 23 */
+ "tr-TR", LINGUISTIC_IGNORECASE,
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ },
+ /* with NORM_LINGUISTIC_CASING | NORM_IGNORECASE */
+ { /* 24 */
+ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
+ {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_EQUAL, TRUE
+ },
+ { /* 25 */
+ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
+ {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE
+ },
+ { /* 26 */
+ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
+ {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ },
+ { /* 27 */
+ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
+ {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 28 */
+ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
+ {'I',0}, {0x131,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE
+ },
+ { /* 29 */
+ "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE,
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE
+ },
+ /* with NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE */
+ { /* 30 */
+ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
+ {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_EQUAL, TRUE
+ },
+ { /* 31 */
+ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
+ {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE
+ },
+ { /* 32 */
+ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
+ {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ },
+ { /* 33 */
+ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
+ {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ },
+ { /* 34 */
+ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
+ {'I',0}, {0x131,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE
+ },
+ { /* 35 */
+ "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE,
+ {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE
+ }
+};
+
+static void test_CompareStringEx(void)
+{
+ const char *op[] = {"ERROR", "CSTR_LESS_THAN", "CSTR_EQUAL", "CSTR_GREATER_THAN"};
+ WCHAR locale[6];
+ INT ret, i;
+
+ /* CompareStringEx is only available on Vista+ */
+ if (!pCompareStringEx)
+ {
+ win_skip("CompareStringEx not supported\n");
+ return;
+ }
+
+ for (i = 0; i < sizeof(comparestringex_tests)/sizeof(comparestringex_tests[0]); i++)
+ {
+ const struct comparestringex_test *e = &comparestringex_tests[i];
+
+ MultiByteToWideChar(CP_ACP, 0, e->locale, -1, locale, sizeof(locale)/sizeof(WCHAR));
+ ret = pCompareStringEx(locale, e->flags, e->first, -1, e->second, -1, NULL, NULL, 0);
+ if (e->todo)
+ {
+ todo_wine ok(ret == e->ret || broken(ret == e->broken),
+ "%d: got %s, expected %s\n", i, op[ret], op[e->ret]);
+ }
+ else
+ {
+ ok(ret == e->ret || broken(ret == e->broken),
+ "%d: got %s, expected %s\n", i, op[ret], op[e->ret]);
+ }
+ }
+
+}
+
static void test_LCMapStringA(void)
{
int ret, ret2;
@@ -3642,6 +3841,7 @@ START_TEST(locale)
test_GetCurrencyFormatA(); /* Also tests the W version */
test_GetNumberFormatA(); /* Also tests the W version */
test_CompareStringA();
+ test_CompareStringEx();
test_LCMapStringA();
test_LCMapStringW();
test_LCMapStringEx();
--
1.7.9.5

View File

@ -1,70 +0,0 @@
From f1072f15073550d6d67844a1a26998db440b0c45 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 5 Apr 2014 14:27:45 -0600
Subject: kernel32: Allow CompareStringEx NORM_LINGUISTIC_CASING flag.
---
dlls/kernel32/locale.c | 12 +++++++-----
dlls/kernel32/tests/locale.c | 4 ++--
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index c1d89b7..9597895 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -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);
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index fc071a7..d3c77d0 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -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,
--
1.7.9.5

View File

@ -1,53 +0,0 @@
From a1c17bf8b5f54fdeb8b6ef25816478144b3c9aa8 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 5 Apr 2014 14:27:53 -0600
Subject: kernel32: Allow CompareStringEx LINGUISTIC_IGNORECASE flag.
---
dlls/kernel32/locale.c | 2 +-
dlls/kernel32/tests/locale.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c
index 9597895..eca0e39 100644
--- a/dlls/kernel32/locale.c
+++ b/dlls/kernel32/locale.c
@@ -2987,7 +2987,7 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1,
{
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;
+ DWORD semistub_flags = NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000;
/* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */
INT ret;
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c
index d3c77d0..597de37 100644
--- a/dlls/kernel32/tests/locale.c
+++ b/dlls/kernel32/tests/locale.c
@@ -1568,11 +1568,11 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 19 */
"tr-TR", LINGUISTIC_IGNORECASE,
- {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE
+ {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE
},
{ /* 20 */
"tr-TR", LINGUISTIC_IGNORECASE,
- {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, TRUE
+ {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE
},
{ /* 21 */
"tr-TR", LINGUISTIC_IGNORECASE,
@@ -1580,7 +1580,7 @@ static const struct comparestringex_test comparestringex_tests[] = {
},
{ /* 22 */
"tr-TR", LINGUISTIC_IGNORECASE,
- {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, TRUE
+ {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE
},
{ /* 23 */
"tr-TR", LINGUISTIC_IGNORECASE,
--
1.7.9.5

View File

@ -1,3 +0,0 @@
Revision: 2
Author: Erich E. Hoover
Title: Allow string comparison with linguistic casing.

View File

@ -37,7 +37,7 @@ diff --git a/libs/wine/config.c b/libs/wine/config.c
index a273502..5fa0cd5 100644
--- a/libs/wine/config.c
+++ b/libs/wine/config.c
@@ -478,6 +478,37 @@ const char *wine_get_version(void)
@@ -478,6 +478,36 @@ const char *wine_get_version(void)
return PACKAGE_VERSION;
}
@ -48,7 +48,6 @@ index a273502..5fa0cd5 100644
+} wine_patch_data[] = {
+ { "8a366b6d-8ad6-4581-8aa9-66a03590a57b:2", "Erich E. Hoover", "Implement SIO_ADDRESS_LIST_CHANGE." },
+ { "92938b89-506b-430a-ba50-32de8b286e56:2", "Erich E. Hoover", "Store and return security attributes with extended file attributes." },
+ { "9cb0f665-bf7c-485f-89cc-554adcdf8880:2", "Erich E. Hoover", "Allow string comparison with linguistic casing." },
+ { "5d6bb7b5-ec88-4ed3-907d-9ad2173a2f88:1", "Sebastian Lackner", "Enable/disable windows when they are (un)mapped by foreign applications." },
+ { "94186fff-6dbf-44d0-8eb1-2463d1608a0f:1", "Sebastian Lackner", "Update gl_drawable for embedded windows." },
+ { "cbe240e8-2c58-430a-b61c-7fbb9d0e1e11:1", "Sebastian Lackner", "Change return value of stub SetNamedPipeHandleState to TRUE." },