From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/tests/Makefile.in | 2 +- dlls/user32/tests/input.c | 12 ++---------- dlls/user32/tests/msg.c | 13 ++----------- 3 files changed, 5 insertions(+), 22 deletions(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index dd101d69f3c..344a3b66d2b 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = user32.dll -IMPORTS = user32 gdi32 advapi32 hid +IMPORTS = user32 gdi32 advapi32 hid imm32
C_SRCS = \ broadcast.c \ diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index 0d003c6cc21..f508ed69b74 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -55,6 +55,7 @@ #include "winnls.h" #include "winreg.h" #include "ddk/hidsdi.h" +#include "imm.h"
#include "wine/test.h"
@@ -1188,8 +1189,6 @@ static void test_Input_unicode(void) WNDCLASSW wclass; HANDLE hInstance = GetModuleHandleW(NULL); HHOOK hook; - HMODULE hModuleImm32; - BOOL (WINAPI *pImmDisableIME)(DWORD); BOOL us_kbd = (GetKeyboardLayout(0) == (HKL)(ULONG_PTR)0x04090409); if (!us_kbd) { @@ -1212,14 +1211,7 @@ static void test_Input_unicode(void) return; }
- hModuleImm32 = LoadLibraryA("imm32.dll"); - if (hModuleImm32) { - pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME"); - if (pImmDisableIME) - pImmDisableIME(0); - } - pImmDisableIME = NULL; - FreeLibrary(hModuleImm32); + ImmDisableIME(0);
/* create the test window that will receive the keystrokes */ hWndTest = CreateWindowW(wclass.lpszClassName, windowNameW, diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 2705914d5e5..9f8522d4ac8 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -32,6 +32,7 @@ #include "winnls.h" #include "dbt.h" #include "commctrl.h" +#include "imm.h"
#include "wine/test.h"
@@ -18794,8 +18795,6 @@ START_TEST(msg) char **test_argv; BOOL ret; BOOL (WINAPI *pIsWinEventHookInstalled)(DWORD)= 0;/*GetProcAddress(user32, "IsWinEventHookInstalled");*/ - HMODULE hModuleImm32; - BOOL (WINAPI *pImmDisableIME)(DWORD); int argc;
argc = winetest_get_mainargs( &test_argv ); @@ -18810,15 +18809,7 @@ START_TEST(msg)
InitializeCriticalSection( &sequence_cs ); init_procs(); - - hModuleImm32 = LoadLibraryA("imm32.dll"); - if (hModuleImm32) { - pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME"); - if (pImmDisableIME) - pImmDisableIME(0); - } - pImmDisableIME = NULL; - FreeLibrary(hModuleImm32); + ImmDisableIME(0);
if (!RegisterWindowClasses()) assert(0);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121402
Your paranoid android.
=== w10pro64 (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally
=== w7u_2qxl (32 bit report) ===
user32: input.c:746: Test failed: 0 (a4/0): 00 from 00 -> 80 unexpected input.c:746: Test failed: 0 (a4/0): 41 from 01 -> 00 unexpected
=== w7u_el (32 bit report) ===
user32: input.c:2404: Test failed: Spurious WM_INPUT messages
=== w8 (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally
=== w1064_tsign (64 bit report) ===
user32: msg.c:12863: Test failed: coords not changed: (101 101) (101 101) msg.c:12881: Test failed: coords not changed: (101 101) (101 101)
=== w10pro64_ar (64 bit report) ===
user32: msg.c:12863: Test failed: coords not changed: (101 101) (101 101) msg.c:12881: Test failed: coords not changed: (101 101) (101 101)
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:12863: Test failed: coords not changed: (101 101) (101 101) msg.c:12881: Test failed: coords not changed: (101 101) (101 101)
=== w8 (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064v1809 (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064 (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w1064_tsign (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64 (32 bit report) ===
user32: sysparams.c:2490: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2501: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w10pro64 (testbot log) ===
WineRunTask.pl:error: The previous 1 run(s) terminated abnormally
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/tests/msg.c | 218 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 9f8522d4ac8..42026b7a889 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12105,6 +12105,218 @@ static LRESULT CALLBACK edit_hook_proc(HWND hwnd, UINT message, WPARAM wParam, L return ret; }
+static const struct message edit_wm_ime_composition_seq[] = +{ + {WM_IME_STARTCOMPOSITION, sent}, + {WM_IME_COMPOSITION, sent | wparam, 'W'}, + {WM_IME_CHAR, sent | wparam | defwinproc, 'W'}, + {WM_IME_CHAR, sent | wparam | defwinproc, 'i'}, + {WM_IME_CHAR, sent | wparam | defwinproc, 'n'}, + {WM_IME_CHAR, sent | wparam | defwinproc, 'e'}, + {WM_IME_ENDCOMPOSITION, sent}, + {WM_CHAR, sent | wparam, 'W'}, + {WM_CHAR, sent | wparam, 'i'}, + {WM_CHAR, sent | wparam, 'n'}, + {WM_CHAR, sent | wparam, 'e'}, + {0} +}; + +static const struct message edit_wm_ime_char_seq[] = +{ + {WM_IME_CHAR, sent | wparam, '0'}, + {WM_CHAR, sent | wparam, '0'}, + {0} +}; + +static const struct message edit_eimes_getcompstratonce_seq[] = +{ + {WM_IME_STARTCOMPOSITION, sent}, + {WM_IME_COMPOSITION, sent | wparam, 'W'}, + {WM_IME_ENDCOMPOSITION, sent}, + {0} +}; + +static LRESULT CALLBACK edit_ime_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA); + static LONG defwndproc_counter = 0; + struct recvd_message msg = {0}; + LRESULT ret; + + msg.message = message; + msg.flags = sent | wparam; + if (defwndproc_counter) + msg.flags |= defwinproc; + msg.wParam = wParam; + + if (message < 0xc000 && + message != WM_GETTEXTLENGTH && + message != WM_GETTEXT && + message != WM_GETFONT && + message != WM_GETICON && + message != WM_IME_SETCONTEXT && + message != WM_IME_NOTIFY && + message != WM_CTLCOLOREDIT && + message != WM_PAINT && + message != WM_ERASEBKGND && + message != WM_NCHITTEST && + message != WM_SETCURSOR && + message != WM_MOUSEMOVE && + message != WM_MOUSEACTIVATE && + message != WM_KEYUP && + (message < EM_GETSEL || message > EM_GETIMESTATUS)) + { + add_message(&msg); + } + + defwndproc_counter++; + if (IsWindowUnicode(hwnd)) + ret = CallWindowProcW(oldproc, hwnd, message, wParam, lParam); + else + ret = CallWindowProcA(oldproc, hwnd, message, wParam, lParam); + defwndproc_counter--; + + return ret; +} + +static DWORD WINAPI test_edit_ime_messages(void *unused_arg) +{ + WNDPROC old_proc; + LRESULT lr; + HIMC himc; + HWND hwnd; + BOOL ret; + MSG msg; + + hwnd = CreateWindowA(WC_EDITA, "Test", WS_POPUP | WS_VISIBLE, 10, 10, 300, 300, NULL, NULL, + NULL, NULL); + ok(hwnd != NULL, "CreateWindowA failed.\n"); + + /* Test EM_{GET|SET}IMESTATUS */ + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); + + /* Note that EM_SETIMESTATUS always return 1, which is contrary to what MSDN says about + * returning the previous LPARAM value */ + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_CANCELCOMPSTRINFOCUS); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == EIMES_CANCELCOMPSTRINFOCUS, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_COMPLETECOMPSTRKILLFOCUS); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == EIMES_COMPLETECOMPSTRKILLFOCUS, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE + | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == (EIMES_GETCOMPSTRATONCE | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS), + "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); + + /* Invalid EM_{GET|SET}IMESTATUS status types and flags */ + lr = SendMessageA(hwnd, EM_GETIMESTATUS, 0, 0); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING + 1, 0); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, 0, EIMES_GETCOMPSTRATONCE); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING + 1, EIMES_GETCOMPSTRATONCE); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0xFFFFFFFF); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == 0xFFFF, "Got unexpected lr %#Ix.\n", lr); + + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); + + /* Test IME messages when EIMES_GETCOMPSTRATONCE is not set */ + old_proc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)edit_ime_subclass_proc); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)old_proc); + + himc = ImmGetContext(hwnd); + ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0); + ok(ret, "ImmSetCompositionStringA failed.\n"); + flush_sequence(); + ret = ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + ok(ret, "ImmNotifyIME failed.\n"); + /* Note that the following message loop is necessary to get the WM_CHAR messages because they + * are posted. Same for the later message loops in this function. */ + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(edit_wm_ime_composition_seq, "WM_IME_COMPOSITION", TRUE); + + /* Test that WM_IME_CHAR is passed to DefWindowProc() to get WM_CHAR */ + flush_sequence(); + SendMessageA(hwnd, WM_IME_CHAR, '0', 1); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", TRUE); + + /* Test IME messages when EIMES_GETCOMPSTRATONCE is set */ + lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); + todo_wine + ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); + lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); + todo_wine + ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr); + + ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0); + ok(ret, "ImmSetCompositionStringA failed.\n"); + flush_sequence(); + ret = ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); + ok(ret, "ImmNotifyIME failed.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(edit_eimes_getcompstratonce_seq, + "WM_IME_COMPOSITION with EIMES_GETCOMPSTRATONCE", TRUE); + + /* Test that WM_IME_CHAR is passed to DefWindowProc() to get WM_CHAR with EIMES_GETCOMPSTRATONCE */ + flush_sequence(); + SendMessageA(hwnd, WM_IME_CHAR, '0', 1); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", TRUE); + + ImmReleaseContext(hwnd, himc); + DestroyWindow(hwnd); + return 0; +} + static void subclass_edit(void) { WNDCLASSA cls; @@ -12124,6 +12336,7 @@ static void test_edit_messages(void) { HWND hwnd, parent; DWORD dlg_code; + HANDLE thread;
subclass_edit(); log_all_parent_messages++; @@ -12215,6 +12428,11 @@ static void test_edit_messages(void) DestroyWindow(parent);
log_all_parent_messages--; + + /* Test IME messages in another thread because IME is disabled in the current thread */ + thread = CreateThread(NULL, 0, test_edit_ime_messages, NULL, 0, NULL); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); }
/**************************** End of Edit test ******************************/
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121403
Your paranoid android.
=== w1064_tsign (32 bit report) ===
user32: msg.c:13081: Test failed: coords not changed: (101 101) (101 101) msg.c:13099: Test failed: coords not changed: (101 101) (101 101)
=== w1064 (64 bit report) ===
user32: msg.c:13081: Test failed: coords not changed: (101 101) (101 101) msg.c:13099: Test failed: coords not changed: (101 101) (101 101)
=== w10pro64_en_AE_u8 (64 bit report) ===
user32: msg.c:13081: Test failed: coords not changed: (101 101) (101 101) msg.c:13099: Test failed: coords not changed: (101 101) (101 101)
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:13081: Test failed: coords not changed: (101 101) (101 101) msg.c:13099: Test failed: coords not changed: (101 101) (101 101)
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/edit.c | 10 +++++++++- dlls/user32/tests/msg.c | 10 ---------- 2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 496d5e7287f..7bfe18e952e 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -21,7 +21,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * TODO: - * - EM_GETIMESTATUS, EM_SETIMESTATUS + * - EM_GETIMESTATUS * - EN_ALIGN_LTR_EC * - EN_ALIGN_RTL_EC * - ES_OEMCONVERT @@ -138,6 +138,7 @@ typedef struct */ UINT composition_len; /* length of composition, 0 == no composition */ int composition_start; /* the character position for the composition */ + UINT ime_status; /* IME status flag */ /* * Uniscribe Data */ @@ -4928,6 +4929,13 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B result = EDIT_EM_CharFromPos(es, (short)LOWORD(lParam), (short)HIWORD(lParam)); break;
+ case EM_SETIMESTATUS: + if (wParam == EMSIS_COMPOSITIONSTRING) + es->ime_status = lParam & 0xFFFF; + + result = 1; + break; + /* End of the EM_ messages which were in numerical order; what order * are these in? vaguely alphabetical? */ diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 42026b7a889..dcfeb329abc 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12199,21 +12199,18 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) /* Note that EM_SETIMESTATUS always return 1, which is contrary to what MSDN says about * returning the previous LPARAM value */ lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); todo_wine ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_CANCELCOMPSTRINFOCUS); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); todo_wine ok(lr == EIMES_CANCELCOMPSTRINFOCUS, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_COMPLETECOMPSTRKILLFOCUS); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); todo_wine @@ -12221,7 +12218,6 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg)
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); todo_wine @@ -12229,7 +12225,6 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); @@ -12244,26 +12239,22 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, 0, EIMES_GETCOMPSTRATONCE); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING + 1, EIMES_GETCOMPSTRATONCE); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0xFFFFFFFF); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); todo_wine ok(lr == 0xFFFF, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); ok(lr == 0, "Got unexpected lr %#Ix.\n", lr); @@ -12291,7 +12282,6 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg)
/* Test IME messages when EIMES_GETCOMPSTRATONCE is set */ lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); todo_wine
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121404
Your paranoid android.
=== w10pro64_en_AE_u8 (64 bit report) ===
user32: msg.c:13071: Test failed: coords not changed: (101 101) (101 101) msg.c:13089: Test failed: coords not changed: (101 101) (101 101)
From: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/edit.c | 5 ++++- dlls/user32/tests/msg.c | 8 -------- 2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 7bfe18e952e..bee158586b9 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * * TODO: - * - EM_GETIMESTATUS * - EN_ALIGN_LTR_EC * - EN_ALIGN_RTL_EC * - ES_OEMCONVERT @@ -4936,6 +4935,10 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B result = 1; break;
+ case EM_GETIMESTATUS: + result = wParam == EMSIS_COMPOSITIONSTRING ? es->ime_status : 1; + break; + /* End of the EM_ messages which were in numerical order; what order * are these in? vaguely alphabetical? */ diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index dcfeb329abc..adda16a0f3b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12201,26 +12201,22 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_CANCELCOMPSTRINFOCUS); ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == EIMES_CANCELCOMPSTRINFOCUS, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_COMPLETECOMPSTRKILLFOCUS); ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == EIMES_COMPLETECOMPSTRKILLFOCUS, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS); ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == (EIMES_GETCOMPSTRATONCE | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS), "Got unexpected lr %#Ix.\n", lr);
@@ -12231,11 +12227,9 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg)
/* Invalid EM_{GET|SET}IMESTATUS status types and flags */ lr = SendMessageA(hwnd, EM_GETIMESTATUS, 0, 0); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING + 1, 0); - todo_wine ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, 0, EIMES_GETCOMPSTRATONCE); @@ -12251,7 +12245,6 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0xFFFFFFFF); ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == 0xFFFF, "Got unexpected lr %#Ix.\n", lr);
lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); @@ -12284,7 +12277,6 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); ok(lr == 1, "Got unexpected lr %#Ix.\n", lr); lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0); - todo_wine ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr);
ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121405
Your paranoid android.
=== w10pro64_ar (64 bit report) ===
user32: msg.c:13063: Test failed: coords not changed: (101 101) (101 101) msg.c:13081: Test failed: coords not changed: (101 101) (101 101)
=== w10pro64_zh_CN (64 bit report) ===
user32: msg.c:13063: Test failed: coords not changed: (101 101) (101 101) msg.c:13081: Test failed: coords not changed: (101 101) (101 101)
From: Zhiyi Zhang zzhang@codeweavers.com
So that WM_IME_CHAR will be converted to WM_CHAR in DefWindowProcA/W().
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/edit.c | 14 -------------- dlls/user32/tests/msg.c | 4 ++-- 2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index bee158586b9..6593ee6dce2 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -4976,20 +4976,6 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B } break;
- case WM_IME_CHAR: - if (!unicode) - { - WCHAR charW; - CHAR strng[2]; - - strng[0] = wParam >> 8; - strng[1] = wParam & 0xff; - if (strng[0]) MultiByteToWideChar(CP_ACP, 0, strng, 2, &charW, 1); - else MultiByteToWideChar(CP_ACP, 0, &strng[1], 1, &charW, 1); - result = EDIT_WM_Char(es, charW); - break; - } - /* fall through */ case WM_CHAR: { WCHAR charW; diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index adda16a0f3b..2d43c1ad1aa 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -12271,7 +12271,7 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) flush_sequence(); SendMessageA(hwnd, WM_IME_CHAR, '0', 1); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", TRUE); + ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", FALSE);
/* Test IME messages when EIMES_GETCOMPSTRATONCE is set */ lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE); @@ -12292,7 +12292,7 @@ static DWORD WINAPI test_edit_ime_messages(void *unused_arg) flush_sequence(); SendMessageA(hwnd, WM_IME_CHAR, '0', 1); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", TRUE); + ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", FALSE);
ImmReleaseContext(hwnd, himc); DestroyWindow(hwnd);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121406
Your paranoid android.
=== w10pro64 (32 bit report) ===
user32: msg.c:13063: Test failed: coords not changed: (101 101) (101 101) msg.c:13081: Test failed: coords not changed: (101 101) (101 101)
From: Zhiyi Zhang zzhang@codeweavers.com
If EIMES_GETCOMPSTRATONCE is not set, WM_IME_COMPOSITION with LPARAM set to GCS_RESULTSTR should be passed to the default window procedure according to MSDN.
Fix some windows based on edit control not being able to input Chinese.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/edit.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 6593ee6dce2..49cf2751f0a 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -5198,6 +5198,12 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B break;
case WM_IME_COMPOSITION: + if (lParam & GCS_RESULTSTR && !(es->ime_status & EIMES_GETCOMPSTRATONCE)) + { + DefWindowProcT(hwnd, msg, wParam, lParam, unicode); + break; + } + EDIT_ImeComposition(hwnd, lParam, es); break;
This merge request was approved by Nikolay Sivov.