From 73bb165ba5b7611689034b968405d92fae65a1fd Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Thu, 2 Jun 2016 13:29:46 -0500 Subject: [PATCH] winemac.drv: Correct sizes in COMPOSITIONSTRING structure when updating fields. Signed-off-by: Aric Stewart Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- dlls/winemac.drv/ime.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index 295c6ccb080..7681e8e9c87 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -178,11 +178,11 @@ static HIMCC updateCompStr(HIMCC old, LPCWSTR compstr, DWORD len, DWORD *flags) { needed_size += lpcs->dwCompReadAttrLen; needed_size += lpcs->dwCompReadClauseLen; - needed_size += lpcs->dwCompReadStrLen * sizeof(DWORD); + needed_size += lpcs->dwCompReadStrLen * sizeof(WCHAR); needed_size += lpcs->dwResultReadClauseLen; - needed_size += lpcs->dwResultReadStrLen * sizeof(DWORD); + needed_size += lpcs->dwResultReadStrLen * sizeof(WCHAR); needed_size += lpcs->dwResultClauseLen; - needed_size += lpcs->dwResultStrLen * sizeof(DWORD); + needed_size += lpcs->dwResultStrLen * sizeof(WCHAR); needed_size += lpcs->dwPrivateSize; } rc = ImmCreateIMCC(needed_size); @@ -271,6 +271,8 @@ static HIMCC updateCompStr(HIMCC old, LPCWSTR compstr, DWORD len, DWORD *flags) *(DWORD*)&newdata[current_offset] = len; current_offset += sizeof(DWORD); } + else + new_one->dwCompClauseLen = 0; /* CompStr */ new_one->dwCompStrLen = len; @@ -324,12 +326,12 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len) { needed_size += lpcs->dwCompReadAttrLen; needed_size += lpcs->dwCompReadClauseLen; - needed_size += lpcs->dwCompReadStrLen * sizeof(DWORD); + needed_size += lpcs->dwCompReadStrLen * sizeof(WCHAR); needed_size += lpcs->dwCompAttrLen; needed_size += lpcs->dwCompClauseLen; - needed_size += lpcs->dwCompStrLen * sizeof(DWORD); + needed_size += lpcs->dwCompStrLen * sizeof(WCHAR); needed_size += lpcs->dwResultReadClauseLen; - needed_size += lpcs->dwResultReadStrLen * sizeof(DWORD); + needed_size += lpcs->dwResultReadStrLen * sizeof(WCHAR); needed_size += lpcs->dwPrivateSize; } rc = ImmCreateIMCC(needed_size); @@ -411,6 +413,8 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len) *(DWORD*)&newdata[current_offset] = len; current_offset += sizeof(DWORD); } + else + new_one->dwResultClauseLen = 0; /* ResultStr */ new_one->dwResultStrLen = len;