Module: wine Branch: master Commit: a45a07e4747162d1b1b0ea5c4c8c00b3c1a005ae URL: http://source.winehq.org/git/wine.git/?a=commit;h=a45a07e4747162d1b1b0ea5c4c...
Author: ByeongSik Jeon bsjeon@hanmail.net Date: Fri May 2 12:50:58 2008 +0900
imm32: Updated implementation of the ImmGetCandidateListCount{A|W}.
---
dlls/imm32/imm.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 590bccc..f382f2b 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -829,9 +829,30 @@ done: DWORD WINAPI ImmGetCandidateListCountA( HIMC hIMC, LPDWORD lpdwListCount) { - FIXME("(%p, %p): stub\n", hIMC, lpdwListCount); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + InputContextData *data = (InputContextData *)hIMC; + LPCANDIDATEINFO candinfo; + DWORD ret, count; + + TRACE("%p, %p\n", hIMC, lpdwListCount); + + if (!data || !lpdwListCount || !data->IMC.hCandInfo) + return 0; + + candinfo = ImmLockIMCC(data->IMC.hCandInfo); + + *lpdwListCount = count = candinfo->dwCount; + + if ( !is_himc_ime_unicode(data) ) + ret = candinfo->dwSize; + else + { + ret = sizeof(CANDIDATEINFO); + while ( count-- ) + ret += ImmGetCandidateListA(hIMC, count, NULL, 0); + } + + ImmUnlockIMCC(data->IMC.hCandInfo); + return ret; }
/*********************************************************************** @@ -840,9 +861,30 @@ DWORD WINAPI ImmGetCandidateListCountA( DWORD WINAPI ImmGetCandidateListCountW( HIMC hIMC, LPDWORD lpdwListCount) { - FIXME("(%p, %p): stub\n", hIMC, lpdwListCount); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + InputContextData *data = (InputContextData *)hIMC; + LPCANDIDATEINFO candinfo; + DWORD ret, count; + + TRACE("%p, %p\n", hIMC, lpdwListCount); + + if (!data || !lpdwListCount || !data->IMC.hCandInfo) + return 0; + + candinfo = ImmLockIMCC(data->IMC.hCandInfo); + + *lpdwListCount = count = candinfo->dwCount; + + if ( is_himc_ime_unicode(data) ) + ret = candinfo->dwSize; + else + { + ret = sizeof(CANDIDATEINFO); + while ( count-- ) + ret += ImmGetCandidateListW(hIMC, count, NULL, 0); + } + + ImmUnlockIMCC(data->IMC.hCandInfo); + return ret; }
/***********************************************************************