Added patch to implement _ismbckata and _mbctohira, moreover fix wrong return value of _ismbckata.

This commit is contained in:
Sebastian Lackner 2015-03-16 07:49:25 +01:00
parent ec4e719cd6
commit aa51a47238
5 changed files with 343 additions and 16 deletions

View File

@ -38,15 +38,17 @@ Wine. All those differences are also documented on the
Included bug fixes and improvements
===================================
**Bugfixes and features included in the next upcoming release [10]:**
**Bugfixes and features included in the next upcoming release [12]:**
* Add stub for PowerCreateRequest
* Fix caps lock state issues with multiple processes ([Wine Bug #35907](https://bugs.winehq.org/show_bug.cgi?id=35907))
* Fix multithreading issues with fullscreen clipping ([Wine Bug #38087](https://bugs.winehq.org/show_bug.cgi?id=38087))
* Fix wrong return values in _ismbckata
* Fix wrong return values of RtlFindActivationContextSectionString for NULL data
* Fix wrong version of ID3DXEffect interface for d3dx9_24
* Fix wrong version of ID3DXEffect interface for d3dx9_25
* GetMessage should remove already seen messages with higher priority ([Wine Bug #28884](https://bugs.winehq.org/show_bug.cgi?id=28884))
* Implement _ismbckata and _mbctohira ([Wine Bug #38226](https://bugs.winehq.org/show_bug.cgi?id=38226))
* Implement locking and synchronization of key states ([Wine Bug #31899](https://bugs.winehq.org/show_bug.cgi?id=31899))
* Invalidate key state cache globally after calling LL hooks ([Wine Bug #29871](https://bugs.winehq.org/show_bug.cgi?id=29871))
* Python PIP needs better NtQueryInformationJobObject stub

1
debian/changelog vendored
View File

@ -14,6 +14,7 @@ wine-staging (1.7.39) UNRELEASED; urgency=low
* Added patch to invalidate key state cache globally after calling LL hooks.
* Added patch to fix Wine Staging Bug #162 - Caesar III demo installer crashes.
* Added patch to fix wrong return values of RtlFindActivationContextSectionString for NULL data (by Mark Jansen).
* Added patch to implement _ismbckata and _mbctohira, moreover fix wrong return value of _ismbckata.
* Removed patch to avoid hardcoded values for sizeof(GUID) (accepted upstream).
* Removed patches for SLGetWindowsInformationDWORD (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 09 Mar 2015 16:52:35 +0100

View File

@ -0,0 +1,301 @@
From 42f254c0d72fe27cff614bf017e17ee93a95b478 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 16 Mar 2015 06:09:00 +0100
Subject: msvcrt: Implement _mbctokata and _mbctohira.
---
dlls/msvcr100/msvcr100.spec | 4 +-
dlls/msvcr110/msvcr110.spec | 4 +-
dlls/msvcr120/msvcr120.spec | 4 +-
dlls/msvcr70/msvcr70.spec | 4 +-
dlls/msvcr71/msvcr71.spec | 4 +-
dlls/msvcr80/msvcr80.spec | 4 +-
dlls/msvcr90/msvcr90.spec | 4 +-
dlls/msvcrt/mbcs.c | 24 +++++++++++-
dlls/msvcrt/msvcrt.spec | 4 +-
dlls/msvcrt/tests/string.c | 96 +++++++++++++++++++++++++++++++++++++++++++++
10 files changed, 134 insertions(+), 18 deletions(-)
diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index a7df4b5..b7d4945 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1082,9 +1082,9 @@
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
-@ stub _mbctohira(long)
+@ cdecl _mbctohira(long)
@ stub _mbctohira_l
-@ stub _mbctokata(long)
+@ cdecl _mbctokata(long)
@ stub _mbctokata_l
@ cdecl _mbctolower(long)
@ stub _mbctolower_l
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec
index f696aaf..c7222b9 100644
--- a/dlls/msvcr110/msvcr110.spec
+++ b/dlls/msvcr110/msvcr110.spec
@@ -1440,9 +1440,9 @@
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
-@ stub _mbctohira(long)
+@ cdecl _mbctohira(long)
@ stub _mbctohira_l
-@ stub _mbctokata(long)
+@ cdecl _mbctokata(long)
@ stub _mbctokata_l
@ cdecl _mbctolower(long)
@ stub _mbctolower_l
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 58e708d..c7df42f 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -1448,9 +1448,9 @@
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
-@ stub _mbctohira(long)
+@ cdecl _mbctohira(long)
@ stub _mbctohira_l
-@ stub _mbctokata(long)
+@ cdecl _mbctokata(long)
@ stub _mbctokata_l
@ cdecl _mbctolower(long)
@ stub _mbctolower_l
diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec
index fb47e78..c494ce0 100644
--- a/dlls/msvcr70/msvcr70.spec
+++ b/dlls/msvcr70/msvcr70.spec
@@ -423,8 +423,8 @@
@ cdecl _mbcjistojms(long)
@ cdecl _mbcjmstojis(long)
@ cdecl _mbclen(ptr)
-@ stub _mbctohira(long)
-@ stub _mbctokata(long)
+@ cdecl _mbctohira(long)
+@ cdecl _mbctokata(long)
@ cdecl _mbctolower(long)
@ cdecl _mbctombb(long)
@ cdecl _mbctoupper(long)
diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec
index 8b868db..f8a52f1 100644
--- a/dlls/msvcr71/msvcr71.spec
+++ b/dlls/msvcr71/msvcr71.spec
@@ -418,8 +418,8 @@
@ cdecl _mbcjistojms(long)
@ cdecl _mbcjmstojis(long)
@ cdecl _mbclen(ptr)
-@ stub _mbctohira(long)
-@ stub _mbctokata(long)
+@ cdecl _mbctohira(long)
+@ cdecl _mbctokata(long)
@ cdecl _mbctolower(long)
@ cdecl _mbctombb(long)
@ cdecl _mbctoupper(long)
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index 68e7097..8b40e2e 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -755,9 +755,9 @@
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
-@ stub _mbctohira(long)
+@ cdecl _mbctohira(long)
@ stub _mbctohira_l
-@ stub _mbctokata(long)
+@ cdecl _mbctokata(long)
@ stub _mbctokata_l
@ cdecl _mbctolower(long)
@ stub _mbctolower_l
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 2d88683..5c65b2f 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -732,9 +732,9 @@
@ stub _mbcjmstojis_l
@ cdecl _mbclen(ptr)
@ stub _mbclen_l
-@ stub _mbctohira(long)
+@ cdecl _mbctohira(long)
@ stub _mbctohira_l
-@ stub _mbctokata(long)
+@ cdecl _mbctokata(long)
@ stub _mbctokata_l
@ cdecl _mbctolower(long)
@ stub _mbctolower_l
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c
index d2c12d3..67727d3 100644
--- a/dlls/msvcrt/mbcs.c
+++ b/dlls/msvcrt/mbcs.c
@@ -1367,8 +1367,6 @@ int CDECL _ismbckata(unsigned int c)
/* FIXME: use lc_ctype when supported, not lc_all */
if(get_mbcinfo()->mbcodepage == 932)
{
- if(c < 256)
- return _ismbbkana(c);
/* Japanese/Katakana, CP 932 */
return (c >= 0x8340 && c <= 0x8396 && c != 0x837f);
}
@@ -1376,6 +1374,28 @@ int CDECL _ismbckata(unsigned int c)
}
/*********************************************************************
+ * _mbctohira(MSVCRT.@)
+ */
+unsigned int CDECL _mbctohira(unsigned int c)
+{
+ if(_ismbckata(c) && c < 0x8394)
+ return (c < 0x837f) ? (c - 0xa1) : (c - 0xa2);
+
+ return c;
+}
+
+/*********************************************************************
+ * _mbctohira(MSVCRT.@)
+ */
+unsigned int CDECL _mbctokata(unsigned int c)
+{
+ if(_ismbchira(c))
+ return (c < 0x82de) ? (c + 0xa1) : (c + 0xa2);
+
+ return c;
+}
+
+/*********************************************************************
* _ismbblead(MSVCRT.@)
*/
int CDECL _ismbblead(unsigned int c)
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index 6d9b4c3..1f2a8ce 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -698,9 +698,9 @@
# stub _mbcjmstojis_l(long ptr)
@ cdecl _mbclen(ptr)
# stub _mbclen_l(ptr ptr)
-@ stub _mbctohira(long)
+@ cdecl _mbctohira(long)
# stub _mbctohira_l(long ptr)
-@ stub _mbctokata(long)
+@ cdecl _mbctokata(long)
# stub _mbctokata_l(long ptr)
@ cdecl _mbctolower(long)
# stub _mbctolower_l(long ptr)
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c
index e2d53d4..4ba708e 100644
--- a/dlls/msvcrt/tests/string.c
+++ b/dlls/msvcrt/tests/string.c
@@ -2784,6 +2784,101 @@ static void test__wcsset_s(void)
ok(str[2] == 'b', "str[2] = %d\n", str[2]);
}
+static int is_hira(unsigned int c)
+{
+ if(_getmbcp() != 932)
+ return 0;
+ return (c >= 0x829f && c <= 0x82f1);
+}
+
+static int is_kata(unsigned int c)
+{
+ if(_getmbcp() != 932)
+ return 0;
+ return (c >= 0x8340 && c <= 0x8396 && c != 0x837f);
+}
+
+static unsigned int to_hira(unsigned int c)
+{
+ if(_getmbcp() != 932)
+ return c;
+ if(c < 0x8340 || c > 0x8393 || c == 0x837f)
+ return c;
+ return (c < 0x837f) ? (c - 0xa1) : (c - 0xa2);
+}
+
+static unsigned int to_kata(unsigned int c)
+{
+ if(_getmbcp() != 932)
+ return c;
+ if(c < 0x829f || c > 0x82f1)
+ return c;
+ return (c < 0x82de) ? (c + 0xa1) : (c + 0xa2);
+}
+
+
+static void test_kata_hira(void)
+{
+ unsigned int tests[] = { 0x0000, 0x0065, 0x00a0, 0x00a1, 0x00c0, 0x00df,
+ 0x00e0, 0x1000, 0x2000, 0x3000, 0x4000, 0x5000,
+ 0x6000, 0x7000, 0x8000, 0x829e, 0x829f, 0x82dd,
+ 0x82de, 0x82f1, 0x82f2, 0x833f, 0x8340, 0x835f,
+ 0x837e, 0x837f, 0x8380, 0x838b, 0x8393, 0x8394,
+ 0x8396, 0x8397, 0x9000, 0xa000, 0xb000, 0xc000,
+ 0xd000, 0xe000, 0xf000 };
+ unsigned int i, ret;
+ int val, prev_cp = _getmbcp();
+
+ /* set code page to non-japanese */
+ if(_setmbcp(1252)) {
+ win_skip("Failed to change codepage to 1252, skipping test\n");
+ return;
+ }
+
+ for(i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {
+
+ val = _ismbchira(tests[i]);
+ ok(!val, "_ismbchira returned %d for %x\n", val, tests[i]);
+
+ val = _ismbckata(tests[i]);
+ ok(!val, "_ismbckata returned %d for %x\n", val, tests[i]);
+
+ ret = _mbctohira(tests[i]);
+ ok(ret == tests[i], "_mbctohira returned %x for %x\n", ret, tests[i]);
+
+ ret = _mbctokata(tests[i]);
+ ok(ret == tests[i], "_mbctokata returned %x for %x\n", ret, tests[i]);
+ }
+
+ /* set code page to japanese */
+ if(_setmbcp(932)) {
+ win_skip("Failed to change codepage to 932, skipping test\n");
+ _setmbcp(prev_cp);
+ return;
+ }
+
+ for(i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) {
+
+ val = _ismbchira(tests[i]);
+ ok(val == is_hira(tests[i]),
+ "_ismbchira returned %d for %x\n", val, tests[i]);
+
+ val = _ismbckata(tests[i]);
+ ok(val == is_kata(tests[i]),
+ "_ismbckata returned %d for %x\n", val, tests[i]);
+
+ ret = _mbctohira(tests[i]);
+ ok(ret == to_hira(tests[i]),
+ "_mbctohira returned %x for %x\n", ret, tests[i]);
+
+ ret = _mbctokata(tests[i]);
+ ok(ret == to_kata(tests[i]),
+ "_mbctokata returned %x for %x\n", ret, tests[i]);
+ }
+
+ _setmbcp(prev_cp);
+}
+
START_TEST(string)
{
char mem[100];
@@ -2888,4 +2983,5 @@ START_TEST(string)
test_strxfrm();
test__strnset_s();
test__wcsset_s();
+ test_kata_hira();
}
--
2.3.2

View File

@ -0,0 +1,2 @@
Fixes: [38226] Implement _ismbckata and _mbctohira
Fixes: Fix wrong return values in _ismbckata

View File

@ -122,6 +122,7 @@ patch_enable_all ()
enable_mmdevapi_AEV_Stubs="$1"
enable_msctf_DllCanUnloadNow="$1"
enable_msvcp90_basic_string_wchar_dtor="$1"
enable_msvcrt_Kata_Hira="$1"
enable_msvcrt_atof_strtod="$1"
enable_msvfw32_Image_Size="$1"
enable_netprofm_IConnectionPoint="$1"
@ -417,6 +418,9 @@ patch_enable ()
msvcp90-basic_string_wchar_dtor)
enable_msvcp90_basic_string_wchar_dtor="$2"
;;
msvcrt-Kata_Hira)
enable_msvcrt_Kata_Hira="$2"
;;
msvcrt-atof_strtod)
enable_msvcrt_atof_strtod="$2"
;;
@ -2718,6 +2722,23 @@ if test "$enable_msvcp90_basic_string_wchar_dtor" -eq 1; then
) >> "$patchlist"
fi
# Patchset msvcrt-Kata_Hira
# |
# | This patchset fixes the following Wine bugs:
# | * [#38226] Implement _ismbckata and _mbctohira
# |
# | Modified files:
# | * dlls/msvcr100/msvcr100.spec, dlls/msvcr110/msvcr110.spec, dlls/msvcr120/msvcr120.spec, dlls/msvcr70/msvcr70.spec,
# | dlls/msvcr71/msvcr71.spec, dlls/msvcr80/msvcr80.spec, dlls/msvcr90/msvcr90.spec, dlls/msvcrt/mbcs.c,
# | dlls/msvcrt/msvcrt.spec, dlls/msvcrt/tests/string.c
# |
if test "$enable_msvcrt_Kata_Hira" -eq 1; then
patch_apply msvcrt-Kata_Hira/0001-msvcrt-Implement-_mbctokata-and-_mbctohira.patch
(
echo '+ { "Michael Müller", "msvcrt: Implement _mbctokata and _mbctohira.", 1 },';
) >> "$patchlist"
fi
# Patchset msvcrt-atof_strtod
# |
# | This patchset fixes the following Wine bugs:
@ -3580,21 +3601,6 @@ if test "$enable_server_CreateProcess_ACLs" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-OpenProcess
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c, server/process.h
# |
if test "$enable_server_OpenProcess" -eq 1; then
patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch
(
echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },';
) >> "$patchlist"
fi
# Patchset server-Misc_ACL
# |
# | This patchset fixes the following Wine bugs:
@ -3612,6 +3618,21 @@ if test "$enable_server_Misc_ACL" -eq 1; then
) >> "$patchlist"
fi
# Patchset server-OpenProcess
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c, server/process.h
# |
if test "$enable_server_OpenProcess" -eq 1; then
patch_apply server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch
(
echo '+ { "Michael Müller", "server: Return error when opening a terminating process.", 3 },';
) >> "$patchlist"
fi
# Patchset server-JobObjects
# |
# | This patchset fixes the following Wine bugs: