https://git.reactos.org/?p=reactos.git;a=commitdiff;h=719823179d7d6f5028f0e…
commit 719823179d7d6f5028f0e963bd4771fd3af0f659
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Aug 12 12:33:12 2021 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Aug 12 12:33:12 2021 +0900
[IMM32] Rewrite ImmGetProperty (#3896)
Implementing Japanese input... CORE-11700
---
dll/win32/imm32/imm.c | 53 ++++++++++++++++++++++++++++++++++-----------------
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c
index de6a0ded6f3..918b99502a9 100644
--- a/dll/win32/imm32/imm.c
+++ b/dll/win32/imm32/imm.c
@@ -3017,27 +3017,46 @@ BOOL WINAPI ImmGetOpenStatus(HIMC hIMC)
*/
DWORD WINAPI ImmGetProperty(HKL hKL, DWORD fdwIndex)
{
- DWORD rc = 0;
- ImmHkl *kbd;
+ IMEINFOEX ImeInfoEx;
+ LPIMEINFO pImeInfo;
+ DWORD dwValue;
+ PIMEDPI pImeDpi = NULL;
+
+ TRACE("(%p, %lu)\n", hKL, fdwIndex);
+
+ if (!ImmGetImeInfoEx(&ImeInfoEx, ImeInfoExKeyboardLayout, &hKL))
+ return FALSE;
- TRACE("(%p, %d)\n", hKL, fdwIndex);
- kbd = IMM_GetImmHkl(hKL);
+ if (fdwIndex == IGP_GETIMEVERSION)
+ return ImeInfoEx.dwImeWinVersion;
- if (kbd && kbd->hIME)
+ if (ImeInfoEx.fLoadFlag != 2)
{
- switch (fdwIndex)
- {
- case IGP_PROPERTY: rc = kbd->imeInfo.fdwProperty; break;
- case IGP_CONVERSION: rc = kbd->imeInfo.fdwConversionCaps; break;
- case IGP_SENTENCE: rc = kbd->imeInfo.fdwSentenceCaps; break;
- case IGP_SETCOMPSTR: rc = kbd->imeInfo.fdwSCSCaps; break;
- case IGP_SELECT: rc = kbd->imeInfo.fdwSelectCaps; break;
- case IGP_GETIMEVERSION: rc = IMEVER_0400; break;
- case IGP_UI: rc = 0; break;
- default: rc = 0;
- }
+ pImeDpi = ImmLockOrLoadImeDpi(hKL);
+ if (pImeDpi == NULL)
+ return FALSE;
+
+ pImeInfo = &pImeDpi->ImeInfo;
}
- return rc;
+ else
+ {
+ pImeInfo = &ImeInfoEx.ImeInfo;
+ }
+
+ switch (fdwIndex)
+ {
+ case IGP_PROPERTY: dwValue = pImeInfo->fdwProperty; break;
+ case IGP_CONVERSION: dwValue = pImeInfo->fdwConversionCaps; break;
+ case IGP_SENTENCE: dwValue = pImeInfo->fdwSentenceCaps; break;
+ case IGP_UI: dwValue = pImeInfo->fdwUICaps; break;
+ case IGP_SETCOMPSTR: dwValue = pImeInfo->fdwSCSCaps; break;
+ case IGP_SELECT: dwValue = pImeInfo->fdwSelectCaps; break;
+ default: dwValue = 0; break;
+ }
+
+ if (pImeDpi)
+ ImmUnlockImeDpi(pImeDpi);
+ return dwValue;
}
/***********************************************************************