Calling get_input_codepage involves doing quite a lot of things, and doing it for every message type, when it's not needed, is inneficient.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/message.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index b142d296f32..1c6f24713bf 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -602,7 +602,7 @@ BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping { char ch[2]; WCHAR wch[2]; - DWORD cp = get_input_codepage(); + DWORD cp;
wch[0] = wch[1] = 0; switch(message) @@ -616,6 +616,7 @@ BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping { struct wm_char_mapping_data *data = get_user_thread_info()->wmchar_data; BYTE low = LOBYTE(*wparam); + cp = get_input_codepage();
if (HIBYTE(*wparam)) { @@ -662,12 +663,14 @@ BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping case WM_SYSCHAR: case WM_SYSDEADCHAR: case WM_MENUCHAR: + cp = get_input_codepage(); ch[0] = LOBYTE(*wparam); ch[1] = HIBYTE(*wparam); MultiByteToWideChar( cp, 0, ch, 2, wch, 2 ); *wparam = MAKEWPARAM(wch[0], wch[1]); break; case WM_IME_CHAR: + cp = get_input_codepage(); ch[0] = HIBYTE(*wparam); ch[1] = LOBYTE(*wparam); if (ch[0]) MultiByteToWideChar( cp, 0, ch, 2, wch, 2 ); @@ -689,13 +692,14 @@ static void map_wparam_WtoA( MSG *msg, BOOL remove ) BYTE ch[4]; WCHAR wch[2]; DWORD len; - DWORD cp = get_input_codepage(); + DWORD cp;
switch(msg->message) { case WM_CHAR: if (!HIWORD(msg->wParam)) { + cp = get_input_codepage(); wch[0] = LOWORD(msg->wParam); ch[0] = ch[1] = 0; len = WideCharToMultiByte( cp, 0, wch, 1, (LPSTR)ch, 2, NULL, NULL ); @@ -723,6 +727,7 @@ static void map_wparam_WtoA( MSG *msg, BOOL remove ) case WM_SYSCHAR: case WM_SYSDEADCHAR: case WM_MENUCHAR: + cp = get_input_codepage(); wch[0] = LOWORD(msg->wParam); wch[1] = HIWORD(msg->wParam); ch[0] = ch[1] = 0; @@ -730,6 +735,7 @@ static void map_wparam_WtoA( MSG *msg, BOOL remove ) msg->wParam = MAKEWPARAM( ch[0] | (ch[1] << 8), 0 ); break; case WM_IME_CHAR: + cp = get_input_codepage(); wch[0] = LOWORD(msg->wParam); ch[0] = ch[1] = 0; len = WideCharToMultiByte( cp, 0, wch, 1, (LPSTR)ch, 2, NULL, NULL );
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=86407
Your paranoid android.
=== debiant2 (32 bit report) ===
user32: win.c:3079: Test succeeded inside todo block: Focus should be on child 000800FE, not 000800FE
=== debiant2 (32 bit Chinese:China report) ===
user32: clipboard.c:760: Test failed: 1: gle 5 clipboard.c:765: Test failed: 1.0: got 0000 instead of 0007 clipboard.c:805: Test failed: 1: gle 1418 clipboard.c:815: Test failed: 1: count 4 clipboard.c:818: Test failed: 1: gle 1418 clipboard.c:853: Test failed: 1.0: formats 00000000 have been rendered clipboard.c:858: Test failed: 1.0: formats 00000000 have been rendered clipboard.c:853: Test failed: 1.2: formats 00000000 have been rendered clipboard.c:858: Test failed: 1.2: formats 00000000 have been rendered clipboard.c:852: Test failed: 1: format 000d got data 00BD8850 clipboard.c:853: Test failed: 1.3: formats 00000000 have been rendered clipboard.c:858: Test failed: 1.3: formats 00000000 have been rendered win.c:3079: Test succeeded inside todo block: Focus should be on child 000800FE, not 000800FE
=== debiant2 (32 bit WoW report) ===
user32: win.c:3079: Test succeeded inside todo block: Focus should be on child 000800FE, not 000800FE
=== debiant2 (64 bit WoW report) ===
user32: win.c:3079: Test succeeded inside todo block: Focus should be on child 000800FE, not 000800FE