Rémi Bernon (@rbernon) commented about dlls/imm32/ime.c:
{
TRANSMSG msg = {.message = ime_set_composition_status( himc, TRUE )};
if (msg.message == WM_IME_STARTCOMPOSITION) msgs->TransMsg[count++] = msg;
}
if (compstr->dwResultStrOffset)
if (compstr->dwResultStrLen) { const WCHAR *result = (WCHAR *)((BYTE *)compstr + compstr->dwResultStrOffset); TRANSMSG msg = {.message = WM_IME_COMPOSITION, .wParam = result[0], .lParam = GCS_RESULTSTR};
if (compstr->dwResultClauseOffset) msg.lParam |= GCS_RESULTCLAUSE;
if (compstr->dwResultClauseLen) msg.lParam |= GCS_RESULTCLAUSE; msgs->TransMsg[count++] = msg; } if (compstr->dwCompStrOffset)
Shouldn't this be changed to dwCompStrLen as well to match the if on line [564](https://gitlab.winehq.org/wine/wine/-/merge_requests/7827/diffs?commit_id=74...) (and [588](https://gitlab.winehq.org/wine/wine/-/merge_requests/7827/diffs?commit_id=74...) changed to an else)?
Otherwise if dwCompStrOffset > 0 and dwCompStrLen == 0 we could send an (empty) WM_IME_COMPOSITION message outside of WM_IME_STARTCOMPOSITION/WM_IME_STARTCOMPOSITION? It's purely hypothetical as I don't think it's possible, but I think it's good to keep the conditions consistent.