https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8cdfc245b361337007a53…
commit 8cdfc245b361337007a53e8c9a6f52549e90bfad
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Feb 10 15:18:44 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Thu Feb 10 15:18:44 2022 +0900
[IMM32] Implement ImmWINNLSGetEnableStatus
CORE-11700
---
dll/win32/imm32/imm.c | 17 ++++++++++++++++-
dll/win32/imm32/imm32.spec | 2 +-
dll/win32/imm32/precomp.h | 1 +
dll/win32/imm32/utils.c | 8 ++++++++
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c
index dc0d19ecf1f..d0ecbd2103c 100644
--- a/dll/win32/imm32/imm.c
+++ b/dll/win32/imm32/imm.c
@@ -1176,7 +1176,7 @@ BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL fActive)
}
else
{
- hIMC = Imm32GetContextEx(hWnd, TRUE);
+ hIMC = Imm32GetContextEx(hWnd, 1);
pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC);
if (pIC)
{
@@ -1221,6 +1221,21 @@ BOOL WINAPI ImmSetActiveContext(HWND hWnd, HIMC hIMC, BOOL
fActive)
return TRUE;
}
+/***********************************************************************
+ * ImmWINNLSGetEnableStatus (IMM32.@)
+ */
+
+BOOL WINAPI ImmWINNLSGetEnableStatus(HWND hWnd)
+{
+ if (!Imm32IsSystemJapaneseOrKorean())
+ {
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+ }
+
+ return !!Imm32GetContextEx(hWnd, 2);
+}
+
/***********************************************************************
* ImmSetActiveContextConsoleIME(IMM32.@)
*/
diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec
index 59fb8f37956..eb1fa8046f1 100644
--- a/dll/win32/imm32/imm32.spec
+++ b/dll/win32/imm32/imm32.spec
@@ -115,5 +115,5 @@
@ stdcall ImmUnregisterWordA(long str long str)
@ stdcall ImmUnregisterWordW(long wstr long wstr)
@ stdcall -stub ImmWINNLSEnableIME(ptr long)
-@ stdcall -stub ImmWINNLSGetEnableStatus(ptr)
+@ stdcall ImmWINNLSGetEnableStatus(ptr)
@ stdcall ImmWINNLSGetIMEHotkey(ptr)
diff --git a/dll/win32/imm32/precomp.h b/dll/win32/imm32/precomp.h
index 533fa714d0e..1d5319dc340 100644
--- a/dll/win32/imm32/precomp.h
+++ b/dll/win32/imm32/precomp.h
@@ -94,6 +94,7 @@ LONG APIENTRY IchAnsiFromWide(LONG cchWide, LPCWSTR pchWide, UINT
uCodePage);
PIMEDPI APIENTRY ImmLockOrLoadImeDpi(HKL hKL);
LPINPUTCONTEXT APIENTRY Imm32LockIMCEx(HIMC hIMC, BOOL fSelect);
BOOL APIENTRY Imm32ReleaseIME(HKL hKL);
+BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID);
static inline BOOL Imm32IsCrossThreadAccess(HIMC hIMC)
{
diff --git a/dll/win32/imm32/utils.c b/dll/win32/imm32/utils.c
index 29c2c3adfeb..86be064c251 100644
--- a/dll/win32/imm32/utils.c
+++ b/dll/win32/imm32/utils.c
@@ -41,6 +41,14 @@ Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT
cchBuff)
return S_OK;
}
+BOOL APIENTRY Imm32IsSystemJapaneseOrKorean(VOID)
+{
+ LCID lcid = GetSystemDefaultLCID();
+ LANGID LangID = LANGIDFROMLCID(lcid);
+ WORD wPrimary = PRIMARYLANGID(LangID);
+ return (wPrimary == LANG_JAPANESE || wPrimary == LANG_KOREAN);
+}
+
BOOL WINAPI Imm32IsImcAnsi(HIMC hIMC)
{
BOOL ret;