Trove passes hardcoded NULL with the size of 2 for strings and that causes access violation.
From: Paul Gofman pgofman@codeweavers.com
--- dlls/imm32/imm.c | 6 ++++++ dlls/imm32/tests/imm32.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 94de6c0f6d7..8c8504a092d 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -2539,6 +2539,9 @@ BOOL WINAPI ImmSetCompositionStringA( return FALSE;
if (!(ime = imc_select_ime( data ))) return FALSE; + if (!lpComp) dwCompLen = 0; + if (!lpRead) dwReadLen = 0; + if (!ime_is_unicode( ime )) return ime->pImeSetCompositionString( hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen );
comp_len = MultiByteToWideChar(CP_ACP, 0, lpComp, dwCompLen, NULL, 0); @@ -2596,6 +2599,9 @@ BOOL WINAPI ImmSetCompositionStringW( return FALSE;
if (!(ime = imc_select_ime( data ))) return FALSE; + if (!lpComp) dwCompLen = 0; + if (!lpRead) dwReadLen = 0; + if (ime_is_unicode( ime )) return ime->pImeSetCompositionString( hIMC, dwIndex, lpComp, dwCompLen, lpRead, dwReadLen );
comp_len = WideCharToMultiByte(CP_ACP, 0, lpComp, dwCompLen, NULL, 0, NULL, diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c index 7131bc2f6a5..db73463ef49 100644 --- a/dlls/imm32/tests/imm32.c +++ b/dlls/imm32/tests/imm32.c @@ -1085,12 +1085,24 @@ static void test_SCS_SETSTR(void) DWORD prop;
imc = ImmGetContext(hwnd); - ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL,0); + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL, 0); if (!ret) { win_skip("Composition isn't supported\n"); ImmReleaseContext(hwnd, imc); return; } + + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, NULL, 128, NULL, 128); + ok(ret, "got error %lu.\n", GetLastError()); + + alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20); + ok(!alen, "got %ld.\n", alen); + wlen = ImmGetCompositionStringW(imc, GCS_COMPSTR, wstring, 20); + ok(!wlen, "got %ld.\n", alen); + + ret = ImmSetCompositionStringW(imc, SCS_SETSTR, string, sizeof(string), NULL, 2); + ok(ret, "got error %lu.\n", GetLastError()); + msg_spy_flush_msgs();
alen = ImmGetCompositionStringA(imc, GCS_COMPSTR, cstring, 20);
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=143904
Your paranoid android.
=== w7pro64 (64 bit report) ===
imm32: imm32.c:7263: Test failed: default: 2 (spurious): got hkl FFFFFFFFE020047F, himc 0000000000240157, MSG_IME_UI msg WM_IME_SELECT, wparam 0, lparam 0xffffffffe020047f imm32.c:7263: Test failed: default: 3 (spurious): got hkl 0000000004090409, himc 000000000002012B, IME_SELECT select 0 imm32.c:7263: Test failed: default: 4 (spurious): got hkl 0000000004090409, himc 0000000000240157, IME_SELECT select 0
=== w11pro64_amd (64 bit report) ===
imm32: imm32.c:7258: Test failed: default: 0 (missing): hkl FFFFFFFFE020047F, himc 0000000000140197, IME_PROCESS_KEY vkey 0xd, lparam 0x1c0001 imm32.c:7258: Test failed: default: 1 (missing): hkl FFFFFFFFE020047F, himc 0000000000140197, IME_TO_ASCII_EX vkey 0xd, vsc 0x1c, flags 0 imm32.c:7263: Test failed: default: 0 (missing): hkl FFFFFFFFE020047F, himc 0000000000140197, IME_PROCESS_KEY vkey 0xd, lparam 0xffffffffc01c0001 imm32.c:7263: Test failed: default: 1 (missing): hkl FFFFFFFFE020047F, himc 0000000000140197, IME_TO_ASCII_EX vkey 0xd, vsc 0xc01c, flags 0 imm32.c:7222: Test failed: kbd_char_first: 1: got hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x1, lparam 0, comp L"", result L"" imm32.c:7222: Test failed: kbd_char_first: 2 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x1, lparam 0, comp L"", result L"" imm32.c:7222: Test failed: kbd_char_first: 3 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_IME_UI msg WM_IME_ENDCOMPOSITION, wparam 0x1, lparam 0 imm32.c:7224: Test failed: kbd_char_first: 1: got hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x2, lparam 0, comp L"", result L"" imm32.c:7224: Test failed: kbd_char_first: 2 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x2, lparam 0, comp L"", result L"" imm32.c:7224: Test failed: kbd_char_first: 3 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_IME_UI msg WM_IME_ENDCOMPOSITION, wparam 0x2, lparam 0 imm32.c:7235: Test failed: kbd_char_first: 1: got hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x2, lparam 0, comp L"", result L"" imm32.c:7235: Test failed: kbd_char_first: 2 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x2, lparam 0, comp L"", result L"" imm32.c:7235: Test failed: kbd_char_first: 3 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_IME_UI msg WM_IME_ENDCOMPOSITION, wparam 0x2, lparam 0 imm32.c:7247: Test failed: kbd_char_first: 1: got hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x1, lparam 0, comp L"", result L"" imm32.c:7247: Test failed: kbd_char_first: 2 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_TEST_WIN msg WM_IME_ENDCOMPOSITION, wparam 0x1, lparam 0, comp L"", result L"" imm32.c:7247: Test failed: kbd_char_first: 3 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, MSG_IME_UI msg WM_IME_ENDCOMPOSITION, wparam 0x1, lparam 0 imm32.c:7258: Test failed: kbd_char_first: 0 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, IME_PROCESS_KEY vkey 0xd, lparam 0x1c0001 imm32.c:7258: Test failed: kbd_char_first: 1 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, IME_TO_ASCII_EX vkey 0xd000d, vsc 0x1c, flags 0 imm32.c:7263: Test failed: kbd_char_first: 0 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, IME_PROCESS_KEY vkey 0xd, lparam 0xffffffffc01c0001 imm32.c:7263: Test failed: kbd_char_first: 1 (missing): hkl FFFFFFFFE020047F, himc 000000000011015F, IME_TO_ASCII_EX vkey 0xd, vsc 0xc01c, flags 0
This merge request was approved by Rémi Bernon.