(try 6)[1/5] imm32: Move thread data from TLSEntry to an internal list

Alexandre Julliard julliard at winehq.org
Wed Feb 25 01:57:48 CST 2015


Aric Stewart <aric at codeweavers.com> writes:

> @@ -1512,11 +1589,15 @@ BOOL WINAPI ImmGetConversionStatus(
>   */
>  HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
>  {
> -    if (IMM_GetThreadData()->hwndDefault == NULL)
> -        IMM_GetThreadData()->hwndDefault = CreateWindowExW( WS_EX_TOOLWINDOW,
> +    HWND ret;
> +    IMMThreadData* thread_data = IMM_GetThreadData(0);
> +    if (thread_data->hwndDefault == NULL)
> +        thread_data->hwndDefault = CreateWindowExW( WS_EX_TOOLWINDOW,
>                      szwIME, NULL, WS_POPUP, 0, 0, 1, 1, 0, 0, 0, 0);
> -    TRACE("Default is %p\n",IMM_GetThreadData()->hwndDefault);
> -    return IMM_GetThreadData()->hwndDefault;
> +    ret = thread_data->hwndDefault;
> +    LeaveCriticalSection(&threaddata_cs);
> +    TRACE("Default is %p\n",ret);
> +    return ret;

You can't create a window while holding the critical section, this will
cause deadlocks.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list