Commit 8f1e00a1 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

imm32: Fix ImmAssociateContextEx parameter handling.

parent 73d4d172
...@@ -516,30 +516,30 @@ static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam) ...@@ -516,30 +516,30 @@ static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
*/ */
BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags) BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags)
{ {
TRACE("(%p, %p, %d): stub\n", hWnd, hIMC, dwFlags); TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
if (!IMM_GetThreadData()->defaultContext) if (!IMM_GetThreadData()->defaultContext)
IMM_GetThreadData()->defaultContext = ImmCreateContext(); IMM_GetThreadData()->defaultContext = ImmCreateContext();
if (dwFlags == IACE_DEFAULT) if (!hWnd) return FALSE;
switch (dwFlags)
{ {
case 0:
ImmAssociateContext(hWnd,hIMC);
return TRUE;
case IACE_DEFAULT:
ImmAssociateContext(hWnd,IMM_GetThreadData()->defaultContext); ImmAssociateContext(hWnd,IMM_GetThreadData()->defaultContext);
return TRUE; return TRUE;
} case IACE_IGNORENOCONTEXT:
else if (dwFlags == IACE_IGNORENOCONTEXT)
{
if (GetPropW(hWnd,szwWineIMCProperty)) if (GetPropW(hWnd,szwWineIMCProperty))
ImmAssociateContext(hWnd,hIMC); ImmAssociateContext(hWnd,hIMC);
return TRUE; return TRUE;
} case IACE_CHILDREN:
else if (dwFlags == IACE_CHILDREN)
{
EnumChildWindows(hWnd,_ImmAssociateContextExEnumProc,(LPARAM)hIMC); EnumChildWindows(hWnd,_ImmAssociateContextExEnumProc,(LPARAM)hIMC);
return TRUE; return TRUE;
} default:
else FIXME("Unknown dwFlags 0x%x\n",dwFlags);
{
ERR("Unknown dwFlags 0x%x\n",dwFlags);
return FALSE; return FALSE;
} }
} }
......
...@@ -330,20 +330,20 @@ static void test_ImmAssociateContextEx(void) ...@@ -330,20 +330,20 @@ static void test_ImmAssociateContextEx(void)
rc = pImmAssociateContextEx(NULL, NULL, 0); rc = pImmAssociateContextEx(NULL, NULL, 0);
ok(!rc, "ImmAssociateContextEx succeeded\n"); ok(!rc, "ImmAssociateContextEx succeeded\n");
rc = pImmAssociateContextEx(hwnd, NULL, 0); rc = pImmAssociateContextEx(hwnd, NULL, 0);
todo_wine ok(rc, "ImmAssociateContextEx failed\n"); ok(rc, "ImmAssociateContextEx failed\n");
rc = pImmAssociateContextEx(NULL, imc, 0); rc = pImmAssociateContextEx(NULL, imc, 0);
ok(!rc, "ImmAssociateContextEx succeeded\n"); ok(!rc, "ImmAssociateContextEx succeeded\n");
rc = pImmAssociateContextEx(hwnd, imc, 0); rc = pImmAssociateContextEx(hwnd, imc, 0);
todo_wine ok(rc, "ImmAssociateContextEx failed\n"); ok(rc, "ImmAssociateContextEx failed\n");
retimc = ImmGetContext(hwnd); retimc = ImmGetContext(hwnd);
ok(retimc == imc, "handles should be the same\n"); ok(retimc == imc, "handles should be the same\n");
ImmReleaseContext(hwnd,retimc); ImmReleaseContext(hwnd,retimc);
rc = pImmAssociateContextEx(hwnd, newimc, 0); rc = pImmAssociateContextEx(hwnd, newimc, 0);
todo_wine ok(rc, "ImmAssociateContextEx failed\n"); ok(rc, "ImmAssociateContextEx failed\n");
retimc = ImmGetContext(hwnd); retimc = ImmGetContext(hwnd);
todo_wine ok(retimc == newimc, "handles should be the same\n"); ok(retimc == newimc, "handles should be the same\n");
ImmReleaseContext(hwnd,retimc); ImmReleaseContext(hwnd,retimc);
rc = pImmAssociateContextEx(hwnd, NULL, IACE_DEFAULT); rc = pImmAssociateContextEx(hwnd, NULL, IACE_DEFAULT);
......
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