Kusanagi Kouichi : winex11: Destroy the handle to the composition string after it is cancelled.

Kusanagi Kouichi slash at ma.neweb.ne.jp
Fri Apr 25 12:13:45 CDT 2008


On Fri, Apr 25, 2008 at 09:36:36AM -0500, Aric Stewart wrote:
> Comming in a bit late on this one, (missed the patch submission)
> 
> I do not think this is correct as far as i know hCompStr should never be 
> NULL. Much of our code depends on that not being NULL.
> 
> I would recommend using ImeCreateBlankCompStr instead. (something like 
> below)
> 
> diff --git a/dlls/winex11.drv/ime.c b/dlls/winex11.drv/ime.c
> index f50549f..8fa6f6f 100644
> --- a/dlls/winex11.drv/ime.c
> +++ b/dlls/winex11.drv/ime.c
> @@ -778,7 +778,7 @@ BOOL WINAPI NotifyIME(HIMC hIMC, DWORD dwAction, 
> DWORD dwInd
>                       if (lpIMC->hCompStr)
>                       {
>                           ImmDestroyIMCC(lpIMC->hCompStr);
> -                        lpIMC->hCompStr = NULL;
> +                        lpIMC->hCompStr = ImeCreateBlankCompStr();
>                       }
> 
>                       myPrivate = 
> (LPIMEPRIVATE)ImmLockIMCC(lpIMC->hPrivate);
> 
> -aric

Then, are these also wrong? updateCompStr returns NULL if NULL or 0 is given.
   748	                        newCompStr = updateCompStr(lpIMC->hCompStr, NULL, 0);
   749	                        ImmDestroyIMCC(lpIMC->hCompStr);
   750	                        lpIMC->hCompStr = newCompStr;

   897	            newCompStr = updateCompStr(lpIMC->hCompStr, NULL, 0);
   898	            ImmDestroyIMCC(lpIMC->hCompStr);
   899	            lpIMC->hCompStr = newCompStr;



More information about the wine-devel mailing list