André Hentschel : imm32: Fix ImmAssociateContextEx parameter handling.

Alexandre Julliard julliard at winehq.org
Thu Apr 29 14:45:07 CDT 2010


Module: wine
Branch: master
Commit: 8f1e00a17b3798fc4cd42f062a0eccb002529ea3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8f1e00a17b3798fc4cd42f062a0eccb002529ea3

Author: André Hentschel <nerv at dawncrow.de>
Date:   Wed Apr 28 17:23:12 2010 +0200

imm32: Fix ImmAssociateContextEx parameter handling.

---

 dlls/imm32/imm.c         |   24 ++++++++++++------------
 dlls/imm32/tests/imm32.c |    8 ++++----
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 2a85b70..c708b83 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -516,30 +516,30 @@ static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam)
  */
 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)
         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);
         return TRUE;
-    }
-    else if (dwFlags == IACE_IGNORENOCONTEXT)
-    {
+    case IACE_IGNORENOCONTEXT:
         if (GetPropW(hWnd,szwWineIMCProperty))
             ImmAssociateContext(hWnd,hIMC);
         return TRUE;
-    }
-    else if (dwFlags == IACE_CHILDREN)
-    {
+    case IACE_CHILDREN:
         EnumChildWindows(hWnd,_ImmAssociateContextExEnumProc,(LPARAM)hIMC);
         return TRUE;
-    }
-    else
-    {
-        ERR("Unknown dwFlags 0x%x\n",dwFlags);
+    default:
+        FIXME("Unknown dwFlags 0x%x\n",dwFlags);
         return FALSE;
     }
 }
diff --git a/dlls/imm32/tests/imm32.c b/dlls/imm32/tests/imm32.c
index 2d25e53..c68a17a 100644
--- a/dlls/imm32/tests/imm32.c
+++ b/dlls/imm32/tests/imm32.c
@@ -330,20 +330,20 @@ static void test_ImmAssociateContextEx(void)
         rc = pImmAssociateContextEx(NULL, NULL, 0);
         ok(!rc, "ImmAssociateContextEx succeeded\n");
         rc = pImmAssociateContextEx(hwnd, NULL, 0);
-        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+        ok(rc, "ImmAssociateContextEx failed\n");
         rc = pImmAssociateContextEx(NULL, imc, 0);
         ok(!rc, "ImmAssociateContextEx succeeded\n");
 
         rc = pImmAssociateContextEx(hwnd, imc, 0);
-        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+        ok(rc, "ImmAssociateContextEx failed\n");
         retimc = ImmGetContext(hwnd);
         ok(retimc == imc, "handles should be the same\n");
         ImmReleaseContext(hwnd,retimc);
 
         rc = pImmAssociateContextEx(hwnd, newimc, 0);
-        todo_wine ok(rc, "ImmAssociateContextEx failed\n");
+        ok(rc, "ImmAssociateContextEx failed\n");
         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);
 
         rc = pImmAssociateContextEx(hwnd, NULL, IACE_DEFAULT);




More information about the wine-cvs mailing list