From b17aa7813f22d93ecd81bda272f8d3ba52ad9c38 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 15 Sep 2008 08:50:14 -0500 Subject: [PATCH] imm32: Update CopyCompOffsetIMEtoClient to handle A->W and W->A conversions. --- dlls/imm32/imm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 602aeca26f..abcff551a1 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -1132,7 +1132,20 @@ static INT CopyCompClauseIMEtoClient(InputContextData *data, LPBYTE source, INT static INT CopyCompOffsetIMEtoClient(InputContextData *data, DWORD offset, LPBYTE ssource, BOOL unicode) { - return offset; + int rc; + + if (is_himc_ime_unicode(data) && !unicode) + { + rc = WideCharToMultiByte(CP_ACP, 0, (LPWSTR)ssource, offset, NULL, 0, NULL, NULL); + } + else if (!is_himc_ime_unicode(data) && unicode) + { + rc = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ssource, offset, NULL, 0); + } + else + rc = offset; + + return rc; } static LONG ImmGetCompositionStringT( HIMC hIMC, DWORD dwIndex, LPVOID lpBuf,