Aric Stewart aric@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.