https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1f446936572780cfb3d44…
commit 1f446936572780cfb3d44a6142c44fd104d148d5
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Jan 12 12:07:31 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Jan 12 12:07:31 2022 +0900
[NTUSER] Implement NtUserSetImeInfoEx (#4276)
- Modify NtUserSetImeInfoEx prototype.
- Add UserSetImeInfoEx helper function.
- Implement NtUserSetImeInfoEx function.
CORE-11700
---
win32ss/include/ntuser.h | 2 +-
win32ss/user/ntuser/ime.c | 57 ++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h
index 4519b3a35aa..a53f7012838 100644
--- a/win32ss/include/ntuser.h
+++ b/win32ss/include/ntuser.h
@@ -3186,7 +3186,7 @@ NtUserSetImeHotKey(
DWORD Unknown3,
DWORD Unknown4);
-DWORD
+BOOL
NTAPI
NtUserSetImeInfoEx(
PIMEINFOEX pImeInfoEx);
diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c
index ee79b14d60f..e6c6ff150c2 100644
--- a/win32ss/user/ntuser/ime.c
+++ b/win32ss/user/ntuser/ime.c
@@ -260,13 +260,60 @@ NtUserSetAppImeLevel(
return 0;
}
-DWORD
+BOOL FASTCALL UserSetImeInfoEx(LPVOID pUnknown, PIMEINFOEX pImeInfoEx)
+{
+ PKL pklHead, pkl;
+
+ pkl = pklHead = gspklBaseLayout;
+
+ do
+ {
+ if (pkl->hkl != pImeInfoEx->hkl)
+ {
+ pkl = pkl->pklNext;
+ continue;
+ }
+
+ if (!pkl->piiex)
+ return FALSE;
+
+ if (!pkl->piiex->fLoadFlag)
+ *pkl->piiex = *pImeInfoEx;
+
+ return TRUE;
+ } while (pkl != pklHead);
+
+ return FALSE;
+}
+
+BOOL
APIENTRY
-NtUserSetImeInfoEx(
- PIMEINFOEX pImeInfoEx)
+NtUserSetImeInfoEx(PIMEINFOEX pImeInfoEx)
{
- STUB;
- return 0;
+ BOOL ret = FALSE;
+ IMEINFOEX ImeInfoEx;
+
+ UserEnterExclusive();
+
+ if (!IS_IMM_MODE())
+ goto Quit;
+
+ _SEH2_TRY
+ {
+ ProbeForRead(pImeInfoEx, sizeof(*pImeInfoEx), 1);
+ ImeInfoEx = *pImeInfoEx;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ goto Quit;
+ }
+ _SEH2_END;
+
+ ret = UserSetImeInfoEx(NULL, &ImeInfoEx);
+
+Quit:
+ UserLeave();
+ return ret;
}
DWORD APIENTRY