Jacek Caban : imm32: Don't allow disabling other thread's IME by thread ID.
Alexandre Julliard
julliard at winehq.org
Tue Jul 12 16:45:37 CDT 2022
Module: wine
Branch: master
Commit: f4f589c421154d0fa05faa87fd845e4455aabc67
URL: https://gitlab.winehq.org/wine/wine/-/commit/f4f589c421154d0fa05faa87fd845e4455aabc67
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Jul 8 20:32:35 2022 +0200
imm32: Don't allow disabling other thread's IME by thread ID.
---
dlls/imm32/imm.c | 3 ++-
dlls/imm32/tests/imm32.c | 2 --
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index f809e771cf8..c5b5895bec8 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -1022,7 +1022,7 @@ BOOL WINAPI ImmDisableIME(DWORD idThread)
DestroyWindow(to_destroy);
}
}
- else
+ else if (!idThread || idThread == GetCurrentThreadId())
{
thread_data = IMM_GetThreadData(NULL, idThread);
if (!thread_data) return FALSE;
@@ -1033,6 +1033,7 @@ BOOL WINAPI ImmDisableIME(DWORD idThread)
if (to_destroy)
DestroyWindow(to_destroy);
}
+ else return FALSE;
return TRUE;
}
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index a7663376eee..c5409ce1708 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -2377,7 +2377,6 @@ static DWORD WINAPI check_not_disabled_ime_thread(void *arg)
hwnd = CreateWindowA("static", "static", 0, 0, 0, 0, 0, 0, 0, 0, 0);
ok(hwnd != NULL, "CreateWindow failed\n");
def = ImmGetDefaultIMEWnd(hwnd);
- todo_wine
ok(def != NULL, "ImmGetDefaultIMEWnd returned %p\n", def);
return 0;
}
@@ -2403,7 +2402,6 @@ static void test_ImmDisableIME(void)
thread = CreateThread(NULL, 0, check_not_disabled_ime_thread, event, 0, &tid);
ok(thread != NULL, "CreateThread failed\n");
r = ImmDisableIME(tid);
- todo_wine
ok(!r, "ImmDisableIME(tid) succeeded\n");
SetEvent(event);
WaitForSingleObject(thread, INFINITE);
More information about the wine-cvs
mailing list