From 3dde049f31efb63013be2b01f5a08d6457222dff Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Fri, 11 Apr 2008 10:58:42 -0500 Subject: [PATCH] imm32: All HIMCC in the InputContext should be initialized at creation. --- dlls/imm32/imm.c | 16 ++++++++++++++-- include/ddk/imm.h | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 3ff2228d02b..ff6398ccfc0 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -496,6 +496,8 @@ BOOL WINAPI ImmConfigureIMEW( HIMC WINAPI ImmCreateContext(void) { InputContextData *new_context; + LPGUIDELINE gl; + LPCANDIDATEINFO ci; new_context = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(InputContextData)); @@ -509,9 +511,19 @@ HIMC WINAPI ImmCreateContext(void) return 0; } - /* hCompStr is never NULL */ + /* the HIMCCs are never NULL */ new_context->IMC.hCompStr = ImmCreateBlankCompStr(); - new_context->IMC.hMsgBuf = ImmCreateIMCC(1); + new_context->IMC.hMsgBuf = ImmCreateIMCC(0); + new_context->IMC.hCandInfo = ImmCreateIMCC(sizeof(CANDIDATEINFO)); + ci = ImmLockIMCC(new_context->IMC.hCandInfo); + memset(ci,0,sizeof(CANDIDATEINFO)); + ci->dwSize = sizeof(CANDIDATEINFO); + ImmUnlockIMCC(new_context->IMC.hCandInfo); + new_context->IMC.hGuideLine = ImmCreateIMCC(sizeof(GUIDELINE)); + gl = ImmLockIMCC(new_context->IMC.hGuideLine); + memset(gl,0,sizeof(GUIDELINE)); + gl->dwSize = sizeof(GUIDELINE); + ImmUnlockIMCC(new_context->IMC.hGuideLine); /* Initialize the IME Private */ new_context->IMC.hPrivate = ImmCreateIMCC(new_context->immKbd->imeInfo.dwPrivateDataSize); diff --git a/include/ddk/imm.h b/include/ddk/imm.h index c492092fa99..ee10b273616 100644 --- a/include/ddk/imm.h +++ b/include/ddk/imm.h @@ -84,6 +84,24 @@ typedef struct tagCOMPOSITIONSTRING { DWORD dwPrivateOffset; } COMPOSITIONSTRING, *LPCOMPOSITIONSTRING; +typedef struct tagGUIDELINE { + DWORD dwSize; + DWORD dwLevel; + DWORD dwIndex; + DWORD dwStrLen; + DWORD dwStrOffset; + DWORD dwPrivateSize; + DWORD dwPrivateOffset; +} GUIDELINE, *LPGUIDELINE; + +typedef struct tagCANDIDATEINFO { + DWORD dwSize; + DWORD dwCount; + DWORD dwOffset[32]; + DWORD dwPrivateSize; + DWORD dwPrivateOffset; +} CANDIDATEINFO, *LPCANDIDATEINFO; + LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC); BOOL WINAPI ImmUnlockIMC(HIMC); DWORD WINAPI ImmGetIMCLockCount(HIMC);