Intends to replace: https://gitlab.winehq.org/wine/wine-staging/-/blob/master/patches/winex11-im...
This patch has been in proton for almost 2 years now, never realized the same code existed upstream, lol
-- v2: win32u/tests: Add test for multi-thread NotifyIME. winex11: Ensure initialized thread data in X11DRV_get_ic.
From: Etaash Mathamsetty 45927311+Etaash-mathamsetty@users.noreply.github.com
--- dlls/winex11.drv/xim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index ef09356fbb0..4c93c73cc23 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -509,7 +509,7 @@ XIC X11DRV_get_ic( HWND hwnd ) XIC ret;
if (!(data = get_win_data( hwnd ))) return 0; - x11drv_thread_data()->last_xic_hwnd = hwnd; + x11drv_init_thread_data()->last_xic_hwnd = hwnd; if (!(ret = data->xic) && (xim = x11drv_thread_data()->xim)) ret = data->xic = xic_create( xim, hwnd, data->whole_window ); release_win_data( data );
From: Etaash Mathamsetty 45927311+Etaash-mathamsetty@users.noreply.github.com
--- dlls/win32u/tests/win32u.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/win32u/tests/win32u.c b/dlls/win32u/tests/win32u.c index acbc5bc3034..41b39f03714 100644 --- a/dlls/win32u/tests/win32u.c +++ b/dlls/win32u/tests/win32u.c @@ -2862,6 +2862,33 @@ static void test_NtUserRegisterWindowMessage(void) ok( !wcscmp( buf, L"#0xabc" ), "buf = %s\n", debugstr_w(buf) ); }
+static CALLBACK DWORD test_NtUserNotifyIMEStatus_thread(void *user_data) +{ + HWND hwnd = user_data; + + /* validate that the user driver does not crash */ + NtUserNotifyIMEStatus(hwnd, 0); + + return 0; +} + +static void test_NtUserNotifyIMEStatus(void) +{ + HWND hwnd; + HANDLE thread; + + winetest_push_context("notifyime"); + + hwnd = CreateWindowW( L"static", L"static", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL | WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, NULL, 0 ); + thread = CreateThread( NULL, 0, test_NtUserNotifyIMEStatus_thread, hwnd, 0, NULL ); + + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + DestroyWindow(hwnd); + + winetest_pop_context(); +} + START_TEST(win32u) { char **argv; @@ -2891,6 +2918,7 @@ START_TEST(win32u) return; }
+ test_NtUserNotifyIMEStatus(); test_NtUserEnumDisplayDevices(); test_window_props(); test_class();
On Tue Jun 17 01:44:39 2025 +0000, Etaash Mathamsetty wrote:
Yes, will do
added test
Is that really what the application is doing?
On Tue Jun 17 04:15:27 2025 +0000, Elizabeth Figura wrote:
Is that really what the application is doing?
Probably not, but it was the easiest way that i could come up with that crashes winex11 but won't crash windows. Maybe the application is doing this exact thing though, I'll have to check