imm32: Don't allow disabling other thread's IME by thread ID.

This commit is contained in:
Jacek Caban 2022-07-08 20:32:35 +02:00 committed by Alexandre Julliard
parent 0e763f72a6
commit f4f589c421
2 changed files with 2 additions and 3 deletions

View file

@ -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;
}

View file

@ -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);