Commit 8d5d4136 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Enable IsDialogMessageA() ASCII to Unicode mapping only when the user…

user32: Enable IsDialogMessageA() ASCII to Unicode mapping only when the user default lang ID is CJK. Using GetSystemMetrics(SM_DBCSENABLED) may incorrectly enable ASCII to Unicode mapping in mixed locale environments. For example, when UserDefaultLCID is French(040c) but SystemDefaultLCID is Japanese(0411). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55655
parent b000b659
...@@ -807,6 +807,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetMessageA( MSG *msg, HWND hwnd, UINT first, UINT ...@@ -807,6 +807,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetMessageA( MSG *msg, HWND hwnd, UINT first, UINT
return (msg->message != WM_QUIT); return (msg->message != WM_QUIT);
} }
static BOOL is_cjk(void)
{
int lang_id = PRIMARYLANGID(GetUserDefaultLangID());
if (lang_id == LANG_CHINESE || lang_id == LANG_JAPANESE || lang_id == LANG_KOREAN)
return TRUE;
return FALSE;
}
/*********************************************************************** /***********************************************************************
* IsDialogMessageA (USER32.@) * IsDialogMessageA (USER32.@)
...@@ -817,7 +825,7 @@ BOOL WINAPI IsDialogMessageA( HWND hwndDlg, LPMSG pmsg ) ...@@ -817,7 +825,7 @@ BOOL WINAPI IsDialogMessageA( HWND hwndDlg, LPMSG pmsg )
enum wm_char_mapping mapping; enum wm_char_mapping mapping;
MSG msg = *pmsg; MSG msg = *pmsg;
mapping = GetSystemMetrics( SM_DBCSENABLED ) ? WMCHAR_MAP_ISDIALOGMESSAGE : WMCHAR_MAP_NOMAPPING; mapping = is_cjk() ? WMCHAR_MAP_ISDIALOGMESSAGE : WMCHAR_MAP_NOMAPPING;
if (!map_wparam_AtoW( msg.message, &msg.wParam, mapping )) if (!map_wparam_AtoW( msg.message, &msg.wParam, mapping ))
return TRUE; return TRUE;
return IsDialogMessageW( hwndDlg, &msg ); return IsDialogMessageW( hwndDlg, &msg );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment