Aric Stewart : imm32: ImmDestroyContext cannot destroy the default context.

Alexandre Julliard julliard at winehq.org
Wed Apr 9 05:31:32 CDT 2008


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Tue Apr  8 13:26:05 2008 -0500

imm32: ImmDestroyContext cannot destroy the default context.

---

 dlls/imm32/imm.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
index 0995fb6..1ffe559 100644
--- a/dlls/imm32/imm.c
+++ b/dlls/imm32/imm.c
@@ -109,6 +109,8 @@ static const WCHAR szwWineIMCProperty[] = {'W','i','n','e','I','m','m','H','I','
 #define is_himc_ime_unicode(p)  (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE)
 #define is_kbd_ime_unicode(p)  (p->imeInfo.fdwProperty & IME_PROP_UNICODE)
 
+static BOOL IMM_DestroyContext(HIMC hIMC);
+
 static inline WCHAR *strdupAtoW( const char *str )
 {
     WCHAR *ret = NULL;
@@ -150,7 +152,7 @@ static void IMM_InitThreadData(void)
 static void IMM_FreeThreadData(void)
 {
     IMMThreadData* data = TlsGetValue(tlsIndex);
-    ImmDestroyContext(data->defaultContext);
+    IMM_DestroyContext(data->defaultContext);
     DestroyWindow(data->hwndDefault);
     HeapFree(GetProcessHeap(),0,data);
     TRACE("Thread Data Destroyed\n");
@@ -510,7 +512,7 @@ HIMC WINAPI ImmCreateContext(void)
     if (!new_context->immKbd->pImeSelect(new_context, TRUE))
     {
         TRACE("Selection of IME failed\n");
-        ImmDestroyContext(new_context);
+        IMM_DestroyContext(new_context);
         return 0;
     }
 
@@ -520,10 +522,7 @@ HIMC WINAPI ImmCreateContext(void)
     return (HIMC)new_context;
 }
 
-/***********************************************************************
- *		ImmDestroyContext (IMM32.@)
- */
-BOOL WINAPI ImmDestroyContext(HIMC hIMC)
+static BOOL IMM_DestroyContext(HIMC hIMC)
 {
     InputContextData *data = (InputContextData*)hIMC;
 
@@ -550,6 +549,17 @@ BOOL WINAPI ImmDestroyContext(HIMC hIMC)
 }
 
 /***********************************************************************
+ *		ImmDestroyContext (IMM32.@)
+ */
+BOOL WINAPI ImmDestroyContext(HIMC hIMC)
+{
+    if (hIMC != IMM_GetThreadData()->defaultContext)
+        return IMM_DestroyContext(hIMC);
+    else
+        return FALSE;
+}
+
+/***********************************************************************
  *		ImmDisableIME (IMM32.@)
  */
 BOOL WINAPI ImmDisableIME(DWORD idThread)




More information about the wine-cvs mailing list