(try 3) [1/4] imm32: Move thread data from TLSEntry to an internal list
Alexandre Julliard
julliard at winehq.org
Tue Sep 24 13:42:21 CDT 2013
Aric Stewart <aric at codeweavers.com> writes:
> @@ -443,6 +473,28 @@ static InputContextData* get_imc_data(HIMC hIMC)
> return data;
> }
>
> +static BOOL ensure_default_imc(IMMThreadData** thread_data)
> +{
> + if (!(*thread_data)->defaultContext)
> + {
> + HIMC defaultContext;
> + LeaveCriticalSection(&threaddata_cs);
> + defaultContext = ImmCreateContext();
> + *thread_data = IMM_GetThreadData(0);
> + if (!(*thread_data))
> + {
> + IMM_DestroyContext(defaultContext);
> + return FALSE;
> + }
> +
> + if ((*thread_data)->defaultContext) /* someone beat us */
> + IMM_DestroyContext(defaultContext);
> + else
> + (*thread_data)->defaultContext = defaultContext;
> + }
> + return TRUE;
> +}
That's fairly inelegant, try to find a better way.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list