Commit 1b997a99 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

imm32: When updating a NULL HIMCC with NULL just return NULL. Handle the NULL…

imm32: When updating a NULL HIMCC with NULL just return NULL. Handle the NULL HIMCC for the compstr when doing a ImmNotifyIME for a reset.
parent bb8471be
...@@ -240,6 +240,9 @@ static HIMCC updateCompStr(HIMCC old, LPWSTR compstr, DWORD len) ...@@ -240,6 +240,9 @@ static HIMCC updateCompStr(HIMCC old, LPWSTR compstr, DWORD len)
TRACE("%s, %i\n",debugstr_wn(compstr,len),len); TRACE("%s, %i\n",debugstr_wn(compstr,len),len);
if (old == NULL && compstr == NULL && len == 0)
return NULL;
if (old != NULL) if (old != NULL)
{ {
olddata = ImmLockIMCC(old); olddata = ImmLockIMCC(old);
...@@ -373,6 +376,9 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len) ...@@ -373,6 +376,9 @@ static HIMCC updateResultStr(HIMCC old, LPWSTR resultstr, DWORD len)
TRACE("%s, %i\n",debugstr_wn(resultstr,len),len); TRACE("%s, %i\n",debugstr_wn(resultstr,len),len);
if (old == NULL && resultstr == NULL && len == 0)
return NULL;
if (old != NULL) if (old != NULL)
{ {
olddata = ImmLockIMCC(old); olddata = ImmLockIMCC(old);
...@@ -1419,7 +1425,7 @@ BOOL WINAPI ImmNotifyIME( ...@@ -1419,7 +1425,7 @@ BOOL WINAPI ImmNotifyIME(
pX11DRV_ForceXIMReset(root_context->IMC.hWnd); pX11DRV_ForceXIMReset(root_context->IMC.hWnd);
{ {
HIMCC newCompStr; HIMCC newCompStr;
DWORD cplen; DWORD cplen = 0;
LPWSTR cpstr; LPWSTR cpstr;
LPCOMPOSITIONSTRING cs = NULL; LPCOMPOSITIONSTRING cs = NULL;
LPBYTE cdata = NULL; LPBYTE cdata = NULL;
...@@ -1429,11 +1435,14 @@ BOOL WINAPI ImmNotifyIME( ...@@ -1429,11 +1435,14 @@ BOOL WINAPI ImmNotifyIME(
ImmDestroyIMCC(root_context->IMC.hCompStr); ImmDestroyIMCC(root_context->IMC.hCompStr);
root_context->IMC.hCompStr = newCompStr; root_context->IMC.hCompStr = newCompStr;
if (root_context->IMC.hCompStr)
{
cdata = ImmLockIMCC(root_context->IMC.hCompStr); cdata = ImmLockIMCC(root_context->IMC.hCompStr);
cs = (LPCOMPOSITIONSTRING)cdata; cs = (LPCOMPOSITIONSTRING)cdata;
cplen = cs->dwCompStrLen; cplen = cs->dwCompStrLen;
cpstr = (LPWSTR)&(cdata[cs->dwCompStrOffset]); cpstr = (LPWSTR)&(cdata[cs->dwCompStrOffset]);
ImmUnlockIMCC(root_context->IMC.hCompStr); ImmUnlockIMCC(root_context->IMC.hCompStr);
}
if (cplen > 0) if (cplen > 0)
{ {
WCHAR param = cpstr[0]; WCHAR param = cpstr[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment