ImmReleaseContext() function implementation

Aric Stewart aric at codeweavers.com
Tue Oct 5 07:01:53 CDT 2010


I do not believe this is correct.

You would be destroying the context every time it is released and that 
is clearly not what we want to be doing ass ImmGetContext and 
ImmReleaseContext as a pair are called over and over again in a typical 
application.

-aric

On 10/4/10 1:25 PM, Mikhail Gorbunov wrote:
> This patch implements (with a basic sanity check) a behaviour of
> ImmReleaseContext()
> function as described in msdn and in the way ImmGetContext() has already been
> impleneted.
>
>  From 56f78bcd9584350b456ca0b0514a357b7ee8cdfd Mon Sep 17 00:00:00 2001
> From: Mikhail Gorbunov<mikhail.gorbunov at gmail.com>
> Date: Mon, 4 Oct 2010 21:47:17 +0400
> Subject: [PATCH] ImmReleaseContext() function implementation
>
> ---
>   dlls/imm32/imm.c |   24 ++++++++++++++++++------
>   1 files changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c
> index 28f482c..87b4c14 100644
> --- a/dlls/imm32/imm.c
> +++ b/dlls/imm32/imm.c
> @@ -2009,13 +2009,25 @@ BOOL WINAPI ImmRegisterWordW(
>    */
>   BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
>   {
> -  static int shown = 0;
> +    TRACE("(%p, %p)\n", hWnd, hIMC);
>
> -  if (!shown) {
> -     FIXME("(%p, %p): stub\n", hWnd, hIMC);
> -     shown = 1;
> -  }
> -  return TRUE;
> +    if (hIMC)
> +    {
> +        InputContextData *data = hIMC;
> +
> +        if (data->IMC.hWnd != hWnd)
> +        {
> +             FIXME("(%p, %p): data->IMC.hWnd = %p :: err\n",
> +                   hWnd, hIMC, data->IMC.hWnd);
> +             return TRUE;
> +        }
> +        else
> +        {
> +            return ImmDestroyContext(hIMC);
> +        }
> +    }
> +    else
> +        return TRUE;
>   }
>
>   /***********************************************************************



More information about the wine-devel mailing list