Jacek Caban (@jacek) commented about dlls/imm32/imm.c:
if (!User32InitializeImmEntryTable( IMM_INIT_MAGIC )) return FALSE; break; case DLL_THREAD_ATTACH:
NtUserGetThreadInfo()->default_imc = (UINT_PTR)NtUserCreateInputContext( 0 );
Another solution would be to call get_default_input_context from NtUserBuildHimcList to make sure it's initialized. It would save an extra server call for each new thread. Lazy initialization would not be enough for non-current threads, so we may need something like this if it's important.