Commit 60b996ad authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

imm32: Don't use functions that use graphics driver in THREAD_DETACH/PROCESS_DETACH.

parent 72922cd1
......@@ -270,7 +270,6 @@ static void IMM_FreeThreadData(void)
list_remove(&data->entry);
LeaveCriticalSection(&threaddata_cs);
IMM_DestroyContext(data->defaultContext);
DestroyWindow(data->hwndDefault);
HeapFree(GetProcessHeap(),0,data);
TRACE("Thread Data Destroyed\n");
return;
......
......@@ -782,10 +782,29 @@ static void test_ImmGetDescription(void)
UnloadKeyboardLayout(hkl);
}
static LRESULT (WINAPI *old_imm_wnd_proc)(HWND, UINT, WPARAM, LPARAM);
static LRESULT WINAPI imm_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
ok(msg != WM_DESTROY, "got WM_DESTROY message\n");
return old_imm_wnd_proc(hwnd, msg, wparam, lparam);
}
static HWND thread_ime_wnd;
static DWORD WINAPI test_ImmGetDefaultIMEWnd_thread(void *arg)
{
CreateWindowA("static", "static", WS_POPUP, 0, 0, 1, 1, NULL, NULL, NULL, NULL);
thread_ime_wnd = ImmGetDefaultIMEWnd(0);
ok(thread_ime_wnd != 0, "ImmGetDefaultIMEWnd returned NULL\n");
old_imm_wnd_proc = (void*)SetWindowLongPtrW(thread_ime_wnd, GWLP_WNDPROC, (LONG_PTR)imm_wnd_proc);
return 0;
}
static void test_ImmDefaultHwnd(void)
{
HIMC imc1, imc2, imc3;
HWND def1, def3;
HANDLE thread;
HWND hwnd;
hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test",
......@@ -813,6 +832,11 @@ static void test_ImmDefaultHwnd(void)
ok(imc1 == imc3, "IME context should not change\n");
ImmSetOpenStatus(imc2, FALSE);
thread = CreateThread(NULL, 0, test_ImmGetDefaultIMEWnd_thread, NULL, 0, NULL);
WaitForSingleObject(thread, INFINITE);
ok(thread_ime_wnd != def1, "thread_ime_wnd == def1\n");
ok(!IsWindow(thread_ime_wnd), "thread_ime_wnd was not destroyed\n");
ImmReleaseContext(hwnd, imc1);
ImmReleaseContext(hwnd, imc3);
ImmDestroyContext(imc2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment