ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
August 2021
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
16 participants
93 discussions
Start a n
N
ew thread
[reactos] 01/01: [IMM32] Implement ImmWINNLSGetIMEHotkey (#3919)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d78e9fbb45dea42d08758…
commit d78e9fbb45dea42d08758c061283647d1cd9f9cd Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 21 07:24:12 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 21 07:24:12 2021 +0900 [IMM32] Implement ImmWINNLSGetIMEHotkey (#3919) - Implement ImmWINNLSGetIMEHotkey function. - Modify imm32.spec. CORE-11700 --- dll/win32/imm32/imm.c | 9 +++++++++ dll/win32/imm32/imm32.spec | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 055f8d3c865..675f4d0c648 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -5100,6 +5100,15 @@ Quit: return NtUserGetImeInfoEx(pImeInfoEx, SearchType); } +/*********************************************************************** + * ImmWINNLSGetIMEHotkey (IMM32.@) + */ +UINT WINAPI ImmWINNLSGetIMEHotkey(HWND hwndIme) +{ + TRACE("(%p)\n", hwndIme); + return 0; /* This is correct. This function of Windows just returns zero. */ +} + BOOL WINAPI User32InitializeImmEntryTable(DWORD); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec index e5d9cfa72fb..7ff287d3657 100644 --- a/dll/win32/imm32/imm32.spec +++ b/dll/win32/imm32/imm32.spec @@ -112,4 +112,4 @@ @ stdcall ImmUnregisterWordW(long wstr long wstr) @ stdcall -stub ImmWINNLSEnableIME(ptr long) @ stdcall -stub ImmWINNLSGetEnableStatus(ptr) -@ stub ImmWINNLSGetIMEHotkey +@ stdcall ImmWINNLSGetIMEHotkey(ptr)
3 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] Rewrite ImmProcessKey (#3917)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1d0587fc27eb575026dbf…
commit 1d0587fc27eb575026dbf0a575bc16289f872de9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 21 07:22:43 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 21 07:22:43 2021 +0900 [IMM32] Rewrite ImmProcessKey (#3917) - Rewrite ImmProcessKey function. - Modify win32ss/include/imetable.h. - Modify ImmProcessKey prototype. CORE-1170 --- dll/win32/imm32/imm.c | 95 +++++++++++++++++++++++++++++++--------------- sdk/include/psdk/imm.h | 2 +- win32ss/include/imetable.h | 2 +- win32ss/include/ntuser.h | 4 +- 4 files changed, 68 insertions(+), 35 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index bb12ff791c5..055f8d3c865 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm); #define IMM_INIT_MAGIC 0x19650412 #define IMM_INVALID_CANDFORM ULONG_MAX - +#define INVALID_HOTKEY_ID 0xFFFFFFFF #define MAX_CANDIDATEFORM 4 #define LANGID_CHINESE_SIMPLIFIED MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED) @@ -4870,47 +4870,80 @@ Quit: * ImmProcessKey(IMM32.@) * ( Undocumented, called from user32.dll ) */ -BOOL WINAPI ImmProcessKey(HWND hwnd, HKL hKL, UINT vKey, LPARAM lKeyData, DWORD unknown) +DWORD WINAPI ImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID) { - InputContextData *data; - HIMC imc = ImmGetContext(hwnd); - BYTE state[256]; - - TRACE("%p %p %x %x %x\n",hwnd, hKL, vKey, (UINT)lKeyData, unknown); + DWORD ret = 0; + HIMC hIMC; + PIMEDPI pImeDpi; + LPINPUTCONTEXTDX pIC; + BYTE KeyState[256]; + UINT vk; + BOOL bUseIme = TRUE, bSkipThisKey = FALSE, bLowWordOnly = FALSE; - if (imc) - data = (InputContextData *)imc; - else - return FALSE; + TRACE("(%p, %p, 0x%X, %p, 0x%lX)\n", hWnd, hKL, vKey, lParam, dwHotKeyID); - /* Make sure we are inputting to the correct keyboard */ - if (data->immKbd->hkl != hKL) + hIMC = ImmGetContext(hWnd); + pImeDpi = ImmLockImeDpi(hKL); + if (pImeDpi) { - ImmHkl *new_hkl = IMM_GetImmHkl(hKL); - if (new_hkl) + pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC); + if (pIC) { - data->immKbd->pImeSelect(imc, FALSE); - data->immKbd->uSelected--; - data->immKbd = new_hkl; - data->immKbd->pImeSelect(imc, TRUE); - data->immKbd->uSelected++; + if (LOBYTE(vKey) == VK_PACKET && + !(pImeDpi->ImeInfo.fdwProperty & IME_PROP_ACCEPT_WIDE_VKEY)) + { + if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) + { + bLowWordOnly = TRUE; + } + else + { + bUseIme = FALSE; + if (pIC->fOpen) + bSkipThisKey = TRUE; + } + } + + if (bUseIme) + { + if (GetKeyboardState(KeyState)) + { + vk = (bLowWordOnly ? LOWORD(vKey) : vKey); + if (pImeDpi->ImeProcessKey(hIMC, vk, lParam, KeyState)) + { + pIC->bNeedsTrans = TRUE; + pIC->nVKey = vKey; + ret |= IPHK_PROCESSBYIME; + } + } + } + else if (bSkipThisKey) + { + ret |= IPHK_SKIPTHISKEY; + } + + ImmUnlockIMC(hIMC); } - else - return FALSE; + + ImmUnlockImeDpi(pImeDpi); } - if (!data->immKbd->hIME || !data->immKbd->pImeProcessKey) - return FALSE; + if (dwHotKeyID != INVALID_HOTKEY_ID) + { + if (Imm32ProcessHotKey(hWnd, hIMC, hKL, dwHotKeyID)) + { + if (vKey != VK_KANJI || dwHotKeyID != IME_JHOTKEY_CLOSE_OPEN) + ret |= IPHK_HOTKEY; + } + } - GetKeyboardState(state); - if (data->immKbd->pImeProcessKey(imc, vKey, lKeyData, state)) + if (ret & IPHK_PROCESSBYIME) { - data->lastVK = vKey; - return TRUE; + FIXME("TODO: We have to do something here.\n"); } - data->lastVK = VK_PROCESSKEY; - return FALSE; + ImmReleaseContext(hWnd, hIMC); + return ret; } /*********************************************************************** @@ -4959,7 +4992,7 @@ ImmGetHotKey(IN DWORD dwHotKey, OUT LPUINT lpuVKey, OUT LPHKL lphKL) { - TRACE("%lx, %p, %p, %p\n", dwHotKey, lpuModifiers, lpuVKey, lphKL); + TRACE("(0x%lX, %p, %p, %p)\n", dwHotKey, lpuModifiers, lpuVKey, lphKL); if (lpuModifiers && lpuVKey) return NtUserGetImeHotKey(dwHotKey, lpuModifiers, lpuVKey, lphKL); return FALSE; diff --git a/sdk/include/psdk/imm.h b/sdk/include/psdk/imm.h index 7fc769ee1eb..f28b8e69f3c 100644 --- a/sdk/include/psdk/imm.h +++ b/sdk/include/psdk/imm.h @@ -856,7 +856,7 @@ BOOL WINAPI ImmIsUIMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM); BOOL WINAPI ImmNotifyIME(_In_ HIMC, _In_ DWORD, _In_ DWORD, _In_ DWORD); -BOOL WINAPI ImmProcessKey(HWND, HKL, UINT, LPARAM, DWORD); +DWORD WINAPI ImmProcessKey(HWND, HKL, UINT, LPARAM, DWORD); BOOL WINAPI diff --git a/win32ss/include/imetable.h b/win32ss/include/imetable.h index 0574fce48f0..96d18de18b4 100644 --- a/win32ss/include/imetable.h +++ b/win32ss/include/imetable.h @@ -8,8 +8,8 @@ DEFINE_IME_ENTRY(UINT, ImeEnumRegisterWord, (LPVOID lpfnEnumProc, LPCVOID lpszRe DEFINE_IME_ENTRY(BOOL, ImeConfigure, (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID lpData), FALSE) DEFINE_IME_ENTRY(BOOL, ImeDestroy, (UINT uReserved), FALSE) DEFINE_IME_ENTRY(LRESULT, ImeEscape, (HIMC hIMC, UINT uEscape, LPVOID lpData), FALSE) -DEFINE_IME_ENTRY(BOOL, ImeSelect, (HIMC hIMC, BOOL fSelect), FALSE) DEFINE_IME_ENTRY(BOOL, ImeProcessKey, (HIMC hIMC, UINT uVirKey, DWORD lParam, CONST LPBYTE lpbKeyState), FALSE) +DEFINE_IME_ENTRY(BOOL, ImeSelect, (HIMC hIMC, BOOL fSelect), FALSE) DEFINE_IME_ENTRY(BOOL, ImeSetActiveContext, (HIMC hIMC, BOOL fFlag), FALSE) DEFINE_IME_ENTRY(UINT, ImeToAsciiEx, (UINT uVirKey, UINT uScanCode, CONST LPBYTE lpbKeyState, LPTRANSMSGLIST lpTransMsgList, UINT fuState, HIMC hIMC), FALSE) DEFINE_IME_ENTRY(BOOL, NotifyIME, (HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue), FALSE) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index a4d3b95e985..71c9f3a6f43 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1259,8 +1259,8 @@ C_ASSERT(offsetof(IMEDPI, ImeEnumRegisterWord) == 0x68); C_ASSERT(offsetof(IMEDPI, ImeConfigure) == 0x6c); C_ASSERT(offsetof(IMEDPI, ImeDestroy) == 0x70); C_ASSERT(offsetof(IMEDPI, ImeEscape) == 0x74); -C_ASSERT(offsetof(IMEDPI, ImeSelect) == 0x78); -C_ASSERT(offsetof(IMEDPI, ImeProcessKey) == 0x7c); +C_ASSERT(offsetof(IMEDPI, ImeProcessKey) == 0x78); +C_ASSERT(offsetof(IMEDPI, ImeSelect) == 0x7c); C_ASSERT(offsetof(IMEDPI, ImeSetActiveContext) == 0x80); C_ASSERT(offsetof(IMEDPI, ImeToAsciiEx) == 0x84); C_ASSERT(offsetof(IMEDPI, NotifyIME) == 0x88);
3 years, 4 months
1
0
0
0
[reactos] 01/01: [INCLUDE] Move WM_IME_SYSTEM from ntuser.h to undocuser.h (#3920)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c59c185d1c64e2a19e3eb…
commit c59c185d1c64e2a19e3eb9ba4addcd933cc5f397 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Aug 19 08:18:20 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Aug 19 08:18:20 2021 +0900 [INCLUDE] Move WM_IME_SYSTEM from ntuser.h to undocuser.h (#3920) CORE-11700 --- dll/win32/imm32/imm.c | 1 + sdk/include/reactos/undocuser.h | 1 + win32ss/include/ntuser.h | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index b6c2051d1fa..bb12ff791c5 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -31,6 +31,7 @@ #include <ndk/rtlfuncs.h> #include "../../../win32ss/include/ntuser.h" #include "../../../win32ss/include/ntwin32.h" +#include <undocuser.h> #include <imm32_undoc.h> #include <strsafe.h> diff --git a/sdk/include/reactos/undocuser.h b/sdk/include/reactos/undocuser.h index 5d02b3a213b..b706c0f6660 100644 --- a/sdk/include/reactos/undocuser.h +++ b/sdk/include/reactos/undocuser.h @@ -56,6 +56,7 @@ extern "C" { #define WM_DRAGLOOP 0x0000022D #define WM_DRAGSELECT 0x0000022E #define WM_DRAGMOVE 0x0000022F +#define WM_IME_SYSTEM 0x00000287 #define WM_POPUPSYSTEMMENU 0x00000313 #define WM_UAHINIT 0x0000031b #define WM_CBT 0x000003FF // ReactOS only. diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index f1832446f5c..a4d3b95e985 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -7,8 +7,6 @@ struct _DESKTOP; struct _WND; struct tagPOPUPMENU; -#define WM_IME_SYSTEM 0x287 - #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */ #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
3 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER][INCLUDE] s/TransMsg[1]/TransMsg[ANYSIZE_ARRAY]/
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1f792413f02f2a1246b4f…
commit 1f792413f02f2a1246b4fb0b75c6389312fe1c45 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 18 19:59:35 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 18 19:59:35 2021 +0900 [NTUSER][INCLUDE] s/TransMsg[1]/TransMsg[ANYSIZE_ARRAY]/ CORE-11700 --- win32ss/include/ntuser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 56a55ca8fa3..f1832446f5c 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1221,7 +1221,7 @@ typedef struct tagTRANSMSG typedef struct tagTRANSMSGLIST { UINT uMsgCount; - TRANSMSG TransMsg[1]; + TRANSMSG TransMsg[ANYSIZE_ARRAY]; } TRANSMSGLIST, *PTRANSMSGLIST, *LPTRANSMSGLIST; #define DEFINE_IME_ENTRY(type, name, params, extended) typedef type (WINAPI *FN_##name) params;
3 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER][INCLUDE] Trivial formatting of TRANSMSG and TRANSMSGLIST
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d83be2e6b67d42855d9d4…
commit d83be2e6b67d42855d9d431f3cc3f1d482cacc08 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 18 19:56:47 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 18 19:56:47 2021 +0900 [NTUSER][INCLUDE] Trivial formatting of TRANSMSG and TRANSMSGLIST CORE-11700 --- win32ss/include/ntuser.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 782af6d0df4..56a55ca8fa3 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1211,13 +1211,15 @@ typedef struct _IMEWND PIMEUI pimeui; } IMEWND, *PIMEWND; -typedef struct tagTRANSMSG { +typedef struct tagTRANSMSG +{ UINT message; WPARAM wParam; LPARAM lParam; } TRANSMSG, *PTRANSMSG, *LPTRANSMSG; -typedef struct tagTRANSMSGLIST { +typedef struct tagTRANSMSGLIST +{ UINT uMsgCount; TRANSMSG TransMsg[1]; } TRANSMSGLIST, *PTRANSMSGLIST, *LPTRANSMSGLIST;
3 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] s/0x400/_WIN32_WINNT_NT4/
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a8049cb39713444c60ec…
commit 9a8049cb39713444c60ec912d333c061cd0225f1 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 18 19:53:14 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 18 19:53:14 2021 +0900 [IMM32] s/0x400/_WIN32_WINNT_NT4/ Don't use magic numbers. CORE-11700 --- dll/win32/imm32/imm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index a2e16e46bf6..b6c2051d1fa 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -4649,7 +4649,7 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC) RtlCopyMemory(pTrans, pMsgs, cbTrans); #ifdef IMP_SUPPORT - if (GetWin32ClientInfo()->dwExpWinVer < 0x400) /* old version (3.x)? */ + if (GetWin32ClientInfo()->dwExpWinVer < _WIN32_WINNT_NT4) /* old version (3.x)? */ { LANGID LangID = LANGIDFROMLCID(GetSystemDefaultLCID()); WORD wLang = PRIMARYLANGID(LangID); @@ -4700,7 +4700,7 @@ Imm32PostMessages(HWND hwnd, HIMC hIMC, DWORD dwCount, LPTRANSMSG lpTransMsg) ImmUnlockClientImc(pClientImc); #ifdef IMP_SUPPORT - if (GetWin32ClientInfo()->dwExpWinVer < 0x400) /* old version (3.x)? */ + if (GetWin32ClientInfo()->dwExpWinVer < _WIN32_WINNT_NT4) /* old version (3.x)? */ { LANGID LangID = LANGIDFROMLCID(GetSystemDefaultLCID()); WORD Lang = PRIMARYLANGID(LangID);
3 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32_APITEST] s/0x287/WM_IME_SYSTEM/
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=747797fdc2b95715badbe…
commit 747797fdc2b95715badbed7d651f7a23e37b81e6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 18 19:48:18 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 18 19:48:45 2021 +0900 [IMM32_APITEST] s/0x287/WM_IME_SYSTEM/ Don't use magic number. CORE-11700 --- modules/rostests/apitests/imm32/ImmIsUIMessage.c | 2 +- modules/rostests/apitests/imm32/precomp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/rostests/apitests/imm32/ImmIsUIMessage.c b/modules/rostests/apitests/imm32/ImmIsUIMessage.c index 73c645645e2..e6937f4fe71 100644 --- a/modules/rostests/apitests/imm32/ImmIsUIMessage.c +++ b/modules/rostests/apitests/imm32/ImmIsUIMessage.c @@ -18,7 +18,7 @@ START_TEST(ImmIsUIMessage) { case WM_IME_STARTCOMPOSITION: case WM_IME_ENDCOMPOSITION: case WM_IME_COMPOSITION: case WM_IME_SETCONTEXT: case WM_IME_NOTIFY: - case WM_IME_COMPOSITIONFULL: case WM_IME_SELECT: case 0x287: + case WM_IME_COMPOSITIONFULL: case WM_IME_SELECT: case WM_IME_SYSTEM: ok_int(ret, TRUE); break; default: diff --git a/modules/rostests/apitests/imm32/precomp.h b/modules/rostests/apitests/imm32/precomp.h index aaa4172e358..f68c9347047 100644 --- a/modules/rostests/apitests/imm32/precomp.h +++ b/modules/rostests/apitests/imm32/precomp.h @@ -9,6 +9,7 @@ #include <ndk/umtypes.h> #include <ndk/pstypes.h> #include "../../../win32ss/include/ntuser.h" +#include <undocuser.h> #include <imm32_undoc.h> #include <ndk/rtlfuncs.h> #include <wine/test.h>
3 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] ImmGenerateMessage and ImmTranslateMessage (#3914)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4bc74edc34cb20fff0c7…
commit f4bc74edc34cb20fff0c72f1ab706b2e0841ad0a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 18 08:42:12 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Aug 18 08:42:12 2021 +0900 [IMM32] ImmGenerateMessage and ImmTranslateMessage (#3914) - Rewrite `ImmGenerateMessage` and `ImmTranslateMessage` functions. - Rename `INPUTCONTEXTDX.bHasVKey` as `bNeedsTrans`. - Move `TRANSMSG` structure into `ntuser.h`. - Add `TRANSMSGLIST` structure into `ntuser.h`. - Add `UNDETERMINESTRUCT` structure to `ddk/imm.h`. - Modify `NtUserGetAppImeLevel` prototype. CORE-11700 --- dll/win32/imm32/imm.c | 551 +++++++++++++++++++++++++++++-------- dll/win32/imm32/imm32.spec | 2 +- sdk/include/reactos/wine/ddk/imm.h | 22 +- win32ss/include/imetable.h | 2 +- win32ss/include/ntuser.h | 14 +- win32ss/user/ntuser/ime.c | 3 +- 6 files changed, 472 insertions(+), 122 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 01e656c454b..a2e16e46bf6 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -1,22 +1,13 @@ /* - * IMM32 library - * - * Copyright 1998 Patrik Stridvall - * Copyright 2002, 2003, 2007 CodeWeavers, Aric Stewart - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * PROJECT: ReactOS IMM32 + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: Implementing Far-Eastern languages input + * COPYRIGHT: Copyright 1998 Patrik Stridvall + * Copyright 2002, 2003, 2007 CodeWeavers, Aric Stewart + * Copyright 2017 James Tabor <james.tabor(a)reactos.org> + * Copyright 2018 Amine Khaldi <amine.khaldi(a)reactos.org> + * Copyright 2020 Oleg Dubinskiy <oleg.dubinskij2013(a)yandex.ua> + * Copyright 2020-2021 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ #include <stdarg.h> @@ -48,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm); #define IMM_INIT_MAGIC 0x19650412 #define IMM_INVALID_CANDFORM ULONG_MAX +#define MAX_CANDIDATEFORM 4 + #define LANGID_CHINESE_SIMPLIFIED MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED) #define LANGID_CHINESE_TRADITIONAL MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL) #define LANGID_JAPANESE MAKELANGID(LANG_JAPANESE, SUBLANG_DEFAULT) @@ -199,7 +192,7 @@ static BOOL APIENTRY Imm32InquireIme(PIMEDPI pImeDpi) DWORD dwSysInfoFlags = 0; // TODO: ??? LPIMEINFO pImeInfo = &pImeDpi->ImeInfo; - // TODO: NtUserGetThreadState(THREADSTATE_UNKNOWN16); + // TODO: NtUserGetThreadState(16); if (!IS_IME_HKL(pImeDpi->hKL)) { @@ -342,6 +335,199 @@ Failed: return FALSE; } +#ifdef IMP_SUPPORT /* 3.x support */ +static DWORD APIENTRY +ImpJTransCompA(LPINPUTCONTEXTDX pIC, LPCOMPOSITIONSTRING pCS, + const TRANSMSG *pSrc, LPTRANSMSG pDest) +{ + // FIXME + *pDest = *pSrc; + return 1; +} + +static DWORD APIENTRY +ImpJTransCompW(LPINPUTCONTEXTDX pIC, LPCOMPOSITIONSTRING pCS, + const TRANSMSG *pSrc, LPTRANSMSG pDest) +{ + // FIXME + *pDest = *pSrc; + return 1; +} + +typedef LRESULT (WINAPI *FN_SendMessage)(HWND, UINT, WPARAM, LPARAM); + +static DWORD APIENTRY +ImpJTrans(DWORD dwCount, LPTRANSMSG pTrans, LPINPUTCONTEXTDX pIC, + LPCOMPOSITIONSTRING pCS, BOOL bAnsi) +{ + DWORD ret = 0; + HWND hWnd, hwndDefIME; + LPTRANSMSG pTempList, pEntry, pNext; + DWORD dwIndex, iCandForm, dwNumber, cbTempList; + HGLOBAL hGlobal; + CANDIDATEFORM CandForm; + FN_SendMessage pSendMessage; + + hWnd = pIC->hWnd; + hwndDefIME = ImmGetDefaultIMEWnd(hWnd); + pSendMessage = (IsWindowUnicode(hWnd) ? SendMessageW : SendMessageA); + + // clone the message list + cbTempList = (dwCount + 1) * sizeof(TRANSMSG); + pTempList = Imm32HeapAlloc(HEAP_ZERO_MEMORY, cbTempList); + if (pTempList == NULL) + return 0; + RtlCopyMemory(pTempList, pTrans, dwCount * sizeof(TRANSMSG)); + + if (pIC->dwUIFlags & 0x2) + { + // find WM_IME_ENDCOMPOSITION + pEntry = pTempList; + for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pEntry) + { + if (pEntry->message == WM_IME_ENDCOMPOSITION) + break; + } + + if (pEntry->message == WM_IME_ENDCOMPOSITION) // if found + { + // move WM_IME_ENDCOMPOSITION to the end of the list + for (pNext = pEntry + 1; pNext->message != 0; ++pEntry, ++pNext) + *pEntry = *pNext; + + pEntry->message = WM_IME_ENDCOMPOSITION; + pEntry->wParam = 0; + pEntry->lParam = 0; + } + } + + for (pEntry = pTempList; pEntry->message != 0; ++pEntry) + { + switch (pEntry->message) + { + case WM_IME_STARTCOMPOSITION: + if (!(pIC->dwUIFlags & 0x2)) + { + // send IR_OPENCONVERT + if (pIC->cfCompForm.dwStyle != CFS_DEFAULT) + pSendMessage(hWnd, WM_IME_REPORT, IR_OPENCONVERT, 0); + + goto DoDefault; + } + break; + + case WM_IME_ENDCOMPOSITION: + if (pIC->dwUIFlags & 0x2) + { + // send IR_UNDETERMINE + hGlobal = GlobalAlloc(GHND | GMEM_SHARE, sizeof(UNDETERMINESTRUCT)); + if (hGlobal) + { + pSendMessage(hWnd, WM_IME_REPORT, IR_UNDETERMINE, (LPARAM)hGlobal); + GlobalFree(hGlobal); + } + } + else + { + // send IR_CLOSECONVERT + if (pIC->cfCompForm.dwStyle != CFS_DEFAULT) + pSendMessage(hWnd, WM_IME_REPORT, IR_CLOSECONVERT, 0); + + goto DoDefault; + } + break; + + case WM_IME_COMPOSITION: + if (bAnsi) + dwNumber = ImpJTransCompA(pIC, pCS, pEntry, pTrans); + else + dwNumber = ImpJTransCompW(pIC, pCS, pEntry, pTrans); + + ret += dwNumber; + pTrans += dwNumber; + + // send IR_CHANGECONVERT + if (!(pIC->dwUIFlags & 0x2)) + { + if (pIC->cfCompForm.dwStyle != CFS_DEFAULT) + pSendMessage(hWnd, WM_IME_REPORT, IR_CHANGECONVERT, 0); + } + break; + + case WM_IME_NOTIFY: + if (pEntry->wParam == IMN_OPENCANDIDATE) + { + if (IsWindow(hWnd) && (pIC->dwUIFlags & 0x2)) + { + // send IMC_SETCANDIDATEPOS + for (iCandForm = 0; iCandForm < MAX_CANDIDATEFORM; ++iCandForm) + { + if (!(pEntry->lParam & (1 << iCandForm))) + continue; + + CandForm.dwIndex = iCandForm; + CandForm.dwStyle = CFS_EXCLUDE; + CandForm.ptCurrentPos = pIC->cfCompForm.ptCurrentPos; + CandForm.rcArea = pIC->cfCompForm.rcArea; + pSendMessage(hwndDefIME, WM_IME_CONTROL, IMC_SETCANDIDATEPOS, + (LPARAM)&CandForm); + } + } + } + + if (!(pIC->dwUIFlags & 0x2)) + goto DoDefault; + + // send a WM_IME_NOTIFY notification to the default ime window + pSendMessage(hwndDefIME, pEntry->message, pEntry->wParam, pEntry->lParam); + break; + +DoDefault: + default: + // default processing + *pTrans++ = *pEntry; + ++ret; + break; + } + } + + HeapFree(g_hImm32Heap, 0, pTempList); + return ret; +} + +static DWORD APIENTRY +ImpKTrans(DWORD dwCount, LPTRANSMSG pEntries, LPINPUTCONTEXTDX pIC, + LPCOMPOSITIONSTRING pCS, BOOL bAnsi) +{ + return dwCount; // FIXME +} + +static DWORD APIENTRY +ImpTrans(DWORD dwCount, LPTRANSMSG pEntries, HIMC hIMC, BOOL bAnsi, WORD wLang) +{ + BOOL ret = FALSE; + LPINPUTCONTEXTDX pIC; + LPCOMPOSITIONSTRING pCS; + + pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC); + if (pIC == NULL) + return 0; + + pCS = ImmLockIMCC(pIC->hCompStr); + if (pCS) + { + if (wLang == LANG_JAPANESE) + ret = ImpJTrans(dwCount, pEntries, pIC, pCS, bAnsi); + else if (wLang == LANG_KOREAN) + ret = ImpKTrans(dwCount, pEntries, pIC, pCS, bAnsi); + ImmUnlockIMCC(pIC->hCompStr); + } + + ImmUnlockIMC(hIMC); + return ret; +} +#endif /* def IMP_SUPPORT */ + static PIMEDPI APIENTRY Ime32LoadImeDpi(HKL hKL, BOOL bLock) { IMEINFOEX ImeInfoEx; @@ -547,12 +733,6 @@ typedef struct tagInputContextData #define WINE_IMC_VALID_MAGIC 0x56434D49 -typedef struct _tagTRANSMSG { - UINT message; - WPARAM wParam; - LPARAM lParam; -} TRANSMSG, *LPTRANSMSG; - typedef struct _tagIMMThreadData { struct list entry; DWORD threadID; @@ -721,26 +901,6 @@ static ImmHkl *IMM_GetImmHkl(HKL hkl) } #undef LOAD_FUNCPTR -/* for posting messages as the IME */ -static void ImmInternalPostIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam) -{ - HWND target = GetFocus(); - if (!target) - PostMessageW(data->IMC.hWnd,msg,wParam,lParam); - else - PostMessageW(target, msg, wParam, lParam); -} - -/* for sending messages as the IME */ -static void ImmInternalSendIMEMessage(InputContextData *data, UINT msg, WPARAM wParam, LPARAM lParam) -{ - HWND target = GetFocus(); - if (!target) - SendMessageW(data->IMC.hWnd,msg,wParam,lParam); - else - SendMessageW(target, msg, wParam, lParam); -} - static InputContextData* get_imc_data(HIMC hIMC) { InputContextData *data = (InputContextData *)hIMC; @@ -980,7 +1140,10 @@ HIMC WINAPI ImmCreateContext(void) } RtlInitializeCriticalSection(&pClientImc->cs); - pClientImc->unknown = NtUserGetThreadState(THREADSTATE_UNKNOWN13); + + // FIXME: NtUserGetThreadState and enum ThreadStateRoutines are broken. + pClientImc->unknown = NtUserGetThreadState(13); + return hIMC; } @@ -1654,7 +1817,9 @@ PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc) return NULL; RtlInitializeCriticalSection(&pClientImc->cs); - pClientImc->unknown = NtUserGetThreadState(THREADSTATE_UNKNOWN13); + + // FIXME: NtUserGetThreadState and enum ThreadStateRoutines are broken. + pClientImc->unknown = NtUserGetThreadState(13); if (!NtUserUpdateInputContext(hImc, 0, pClientImc)) { @@ -2655,8 +2820,9 @@ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd) if (!g_psi || !(g_psi->dwSRVIFlags & SRVINFO_IMM32)) return NULL; + // FIXME: NtUserGetThreadState and enum ThreadStateRoutines are broken. if (hWnd == NULL) - return (HWND)NtUserGetThreadState(THREADSTATE_ACTIVEWINDOW); + return (HWND)NtUserGetThreadState(3); return (HWND)NtUserQueryWindow(hWnd, QUERY_WINDOW_DEFAULT_IME); } @@ -3189,7 +3355,7 @@ UINT WINAPI ImmGetVirtualKey(HWND hWnd) if (!pIC) return ret; - if (pIC->bHasVKey) + if (pIC->bNeedsTrans) ret = pIC->nVKey; ImmUnlockIMC(hIMC); @@ -3510,7 +3676,6 @@ LRESULT WINAPI ImmRequestMessageW(HIMC hIMC, WPARAM wParam, LPARAM lParam) BOOL WINAPI ImmSetCandidateWindow( HIMC hIMC, LPCANDIDATEFORM lpCandidate) { -#define MAX_CANDIDATEFORM 4 HWND hWnd; LPINPUTCONTEXT pIC; @@ -3534,7 +3699,6 @@ BOOL WINAPI ImmSetCandidateWindow( Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETCANDIDATEPOS, IMN_SETCANDIDATEPOS, (1 << lpCandidate->dwIndex)); return TRUE; -#undef MAX_CANDIDATEFORM } static VOID APIENTRY WideToAnsiLogFont(const LOGFONTW *plfW, LPLOGFONTA plfA) @@ -4444,38 +4608,136 @@ DWORD WINAPI ImmGetIMCCSize(HIMCC imcc) */ BOOL WINAPI ImmGenerateMessage(HIMC hIMC) { - InputContextData *data = get_imc_data(hIMC); + PCLIENTIMC pClientImc; + LPINPUTCONTEXT pIC; + LPTRANSMSG pMsgs, pTrans = NULL, pItem; + HWND hWnd; + DWORD dwIndex, dwCount, cbTrans; + HIMCC hMsgBuf = NULL; + BOOL bAnsi; - if (!data) - { - SetLastError(ERROR_INVALID_HANDLE); + TRACE("(%p)\n", hIMC); + + if (Imm32IsCrossThreadAccess(hIMC)) return FALSE; + + pClientImc = ImmLockClientImc(hIMC); + if (pClientImc == NULL) + return FALSE; + + bAnsi = !(pClientImc->dwFlags & CLIENTIMC_WIDE); + ImmUnlockClientImc(pClientImc); + + pIC = ImmLockIMC(hIMC); + if (pIC == NULL) + return FALSE; + + dwCount = pIC->dwNumMsgBuf; + if (dwCount == 0) + goto Quit; + + hMsgBuf = pIC->hMsgBuf; + pMsgs = ImmLockIMCC(hMsgBuf); + if (pMsgs == NULL) + goto Quit; + + cbTrans = dwCount * sizeof(TRANSMSG); + pTrans = Imm32HeapAlloc(0, cbTrans); + if (pTrans == NULL) + goto Quit; + + RtlCopyMemory(pTrans, pMsgs, cbTrans); + +#ifdef IMP_SUPPORT + if (GetWin32ClientInfo()->dwExpWinVer < 0x400) /* old version (3.x)? */ + { + LANGID LangID = LANGIDFROMLCID(GetSystemDefaultLCID()); + WORD wLang = PRIMARYLANGID(LangID); + + /* translate the messages if Japanese or Korean */ + if (wLang == LANG_JAPANESE || + (wLang == LANG_KOREAN && NtUserGetAppImeLevel(pIC->hWnd) == 3)) + { + dwCount = ImpTrans(dwCount, pTrans, hIMC, bAnsi, wLang); + } } +#endif - TRACE("%i messages queued\n",data->IMC.dwNumMsgBuf); - if (data->IMC.dwNumMsgBuf > 0) + /* send them */ + hWnd = pIC->hWnd; + pItem = pTrans; + for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pItem) { - LPTRANSMSG lpTransMsg; - HIMCC hMsgBuf; - DWORD i, dwNumMsgBuf; + if (bAnsi) + SendMessageA(hWnd, pItem->message, pItem->wParam, pItem->lParam); + else + SendMessageW(hWnd, pItem->message, pItem->wParam, pItem->lParam); + } + +Quit: + if (pTrans) + HeapFree(g_hImm32Heap, 0, pTrans); + if (hMsgBuf) + ImmUnlockIMCC(hMsgBuf); + pIC->dwNumMsgBuf = 0; /* done */ + ImmUnlockIMC(hIMC); + return TRUE; +} + +static VOID APIENTRY +Imm32PostMessages(HWND hwnd, HIMC hIMC, DWORD dwCount, LPTRANSMSG lpTransMsg) +{ + DWORD dwIndex; + PCLIENTIMC pClientImc; + LPTRANSMSG pNewTransMsg = lpTransMsg, pItem; + BOOL bAnsi; - /* We are going to detach our hMsgBuff so that if processing messages - generates new messages they go into a new buffer */ - hMsgBuf = data->IMC.hMsgBuf; - dwNumMsgBuf = data->IMC.dwNumMsgBuf; + pClientImc = ImmLockClientImc(hIMC); + if (pClientImc == NULL) + return; - data->IMC.hMsgBuf = ImmCreateIMCC(0); - data->IMC.dwNumMsgBuf = 0; + bAnsi = !(pClientImc->dwFlags & CLIENTIMC_WIDE); + ImmUnlockClientImc(pClientImc); - lpTransMsg = ImmLockIMCC(hMsgBuf); - for (i = 0; i < dwNumMsgBuf; i++) - ImmInternalSendIMEMessage(data, lpTransMsg[i].message, lpTransMsg[i].wParam, lpTransMsg[i].lParam); +#ifdef IMP_SUPPORT + if (GetWin32ClientInfo()->dwExpWinVer < 0x400) /* old version (3.x)? */ + { + LANGID LangID = LANGIDFROMLCID(GetSystemDefaultLCID()); + WORD Lang = PRIMARYLANGID(LangID); - ImmUnlockIMCC(hMsgBuf); - ImmDestroyIMCC(hMsgBuf); + /* translate the messages if Japanese or Korean */ + if (Lang == LANG_JAPANESE || + (Lang == LANG_KOREAN && NtUserGetAppImeLevel(hwnd) == 3)) + { + DWORD cbTransMsg = dwCount * sizeof(TRANSMSG); + pNewTransMsg = Imm32HeapAlloc(0, cbTransMsg); + if (pNewTransMsg) + { + RtlCopyMemory(pNewTransMsg, lpTransMsg, cbTransMsg); + dwCount = ImpTrans(dwCount, pNewTransMsg, hIMC, bAnsi, Lang); + } + else + { + pNewTransMsg = lpTransMsg; + } + } } +#endif - return TRUE; + /* post them */ + pItem = pNewTransMsg; + for (dwIndex = 0; dwIndex < dwCount; ++dwIndex, ++pItem) + { + if (bAnsi) + PostMessageA(hwnd, pItem->message, pItem->wParam, pItem->lParam); + else + PostMessageW(hwnd, pItem->message, pItem->wParam, pItem->lParam); + } + +#ifdef IMP_SUPPORT + if (pNewTransMsg && pNewTransMsg != lpTransMsg) + HeapFree(g_hImm32Heap, 0, pNewTransMsg); +#endif } /*********************************************************************** @@ -4484,62 +4746,123 @@ BOOL WINAPI ImmGenerateMessage(HIMC hIMC) */ BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyData) { - InputContextData *data; - HIMC imc = ImmGetContext(hwnd); - BYTE state[256]; - UINT scancode; - LPVOID list = 0; - UINT msg_count; - UINT uVirtKey; - static const DWORD list_count = 10; +#define MSG_COUNT 0x100 + BOOL ret = FALSE; + INT kret; + LPINPUTCONTEXTDX pIC; + PIMEDPI pImeDpi = NULL; + LPTRANSMSGLIST pList = NULL; + LPTRANSMSG pTransMsg; + BYTE abKeyState[256]; + HIMC hIMC; + HKL hKL; + UINT vk; + DWORD dwThreadId, dwCount, cbList; + WCHAR wch; + WORD wChar; - TRACE("%p %x %x %x\n",hwnd, msg, (UINT)wParam, (UINT)lKeyData); + TRACE("(%p, 0x%X, %p, %p)\n", hwnd, msg, wParam, lKeyData); - if (imc) - data = (InputContextData *)imc; - else - return FALSE; + /* filter the message */ + switch (msg) + { + case WM_KEYDOWN: case WM_KEYUP: case WM_SYSKEYDOWN: case WM_SYSKEYUP: + break; + default: + return FALSE; + } - if (!data->immKbd->hIME || !data->immKbd->pImeToAsciiEx) + hIMC = ImmGetContext(hwnd); + pIC = (LPINPUTCONTEXTDX)ImmLockIMC(hIMC); + if (pIC == NULL) + { + ImmReleaseContext(hwnd, hIMC); return FALSE; + } - GetKeyboardState(state); - scancode = lKeyData >> 0x10 & 0xff; - - list = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, list_count * sizeof(TRANSMSG) + sizeof(DWORD)); - ((DWORD*)list)[0] = list_count; - - if (data->immKbd->imeInfo.fdwProperty & IME_PROP_KBD_CHAR_FIRST) + if (!pIC->bNeedsTrans) /* is translation needed? */ { - WCHAR chr; + /* directly post them */ + dwCount = pIC->dwNumMsgBuf; + if (dwCount == 0) + goto Quit; - if (!is_himc_ime_unicode(data)) - ToAscii(data->lastVK, scancode, state, &chr, 0); - else - ToUnicodeEx(data->lastVK, scancode, state, &chr, 1, 0, GetKeyboardLayout(0)); - uVirtKey = MAKELONG(data->lastVK,chr); + pTransMsg = ImmLockIMCC(pIC->hMsgBuf); + if (pTransMsg) + { + Imm32PostMessages(hwnd, hIMC, dwCount, pTransMsg); + ImmUnlockIMCC(pIC->hMsgBuf); + ret = TRUE; + } + pIC->dwNumMsgBuf = 0; /* done */ + goto Quit; } - else - uVirtKey = data->lastVK; + pIC->bNeedsTrans = FALSE; /* clear the flag */ - msg_count = data->immKbd->pImeToAsciiEx(uVirtKey, scancode, state, list, 0, imc); - TRACE("%i messages generated\n",msg_count); - if (msg_count && msg_count <= list_count) - { - UINT i; - LPTRANSMSG msgs = (LPTRANSMSG)((LPBYTE)list + sizeof(DWORD)); + dwThreadId = GetWindowThreadProcessId(hwnd, NULL); + hKL = GetKeyboardLayout(dwThreadId); + pImeDpi = ImmLockImeDpi(hKL); + if (pImeDpi == NULL) + goto Quit; - for (i = 0; i < msg_count; i++) - ImmInternalPostIMEMessage(data, msgs[i].message, msgs[i].wParam, msgs[i].lParam); + if (!GetKeyboardState(abKeyState)) /* get keyboard ON/OFF status */ + goto Quit; + + /* convert a virtual key if IME_PROP_KBD_CHAR_FIRST */ + vk = pIC->nVKey; + if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_KBD_CHAR_FIRST) + { + if (pImeDpi->ImeInfo.fdwProperty & IME_PROP_UNICODE) + { + wch = 0; + kret = ToUnicode(vk, HIWORD(lKeyData), abKeyState, &wch, 1, 0); + if (kret == 1) + vk = MAKELONG(LOBYTE(vk), wch); + } + else + { + wChar = 0; + kret = ToAsciiEx(vk, HIWORD(lKeyData), abKeyState, &wChar, 0, hKL); + if (kret > 0) + vk = MAKEWORD(vk, wChar); + } } - else if (msg_count > list_count) - ImmGenerateMessage(imc); - HeapFree(GetProcessHeap(),0,list); + /* allocate a list */ + cbList = offsetof(TRANSMSGLIST, TransMsg) + MSG_COUNT * sizeof(TRANSMSG); + pList = Imm32HeapAlloc(0, cbList); + if (!pList) + goto Quit; - data->lastVK = VK_PROCESSKEY; + /* use IME conversion engine and convert the list */ + pList->uMsgCount = MSG_COUNT; + kret = pImeDpi->ImeToAsciiEx(vk, HIWORD(lKeyData), abKeyState, pList, 0, hIMC); + if (kret <= 0) + goto Quit; - return (msg_count > 0); + /* post them */ + if (kret <= MSG_COUNT) + { + Imm32PostMessages(hwnd, hIMC, kret, pList->TransMsg); + ret = TRUE; + } + else + { + pTransMsg = ImmLockIMCC(pIC->hMsgBuf); + if (pTransMsg == NULL) + goto Quit; + Imm32PostMessages(hwnd, hIMC, kret, pTransMsg); + ImmUnlockIMCC(pIC->hMsgBuf); + } + +Quit: + if (pList) + HeapFree(g_hImm32Heap, 0, pList); + ImmUnlockImeDpi(pImeDpi); + ImmUnlockIMC(hIMC); + ImmReleaseContext(hwnd, hIMC); + return ret; +#undef MSG_COUNT } /*********************************************************************** diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec index bca6da02f8a..e5d9cfa72fb 100644 --- a/dll/win32/imm32/imm32.spec +++ b/dll/win32/imm32/imm32.spec @@ -103,7 +103,7 @@ @ stdcall ImmShowSoftKeyboard(ptr long) @ stdcall ImmSimulateHotKey(ptr long) @ stdcall -stub ImmSystemHandler(ptr long long) -@ stdcall ImmTranslateMessage(ptr long long long) +@ stdcall ImmTranslateMessage(ptr long ptr ptr) @ stdcall ImmUnlockClientImc(ptr) @ stdcall ImmUnlockIMC(ptr) @ stdcall ImmUnlockIMCC(ptr) diff --git a/sdk/include/reactos/wine/ddk/imm.h b/sdk/include/reactos/wine/ddk/imm.h index 81d665dc7dc..f5b45fc6d1a 100644 --- a/sdk/include/reactos/wine/ddk/imm.h +++ b/sdk/include/reactos/wine/ddk/imm.h @@ -91,7 +91,7 @@ typedef struct INPUTCONTEXTDX /* unconfirmed */ { INPUTCONTEXT; UINT nVKey; - BOOL bHasVKey; + BOOL bNeedsTrans; DWORD dwUnknownCat; DWORD dwUIFlags; DWORD dwUnknownDog; @@ -101,7 +101,7 @@ typedef struct INPUTCONTEXTDX /* unconfirmed */ #ifndef _WIN64 C_ASSERT(offsetof(INPUTCONTEXTDX, nVKey) == 0x140); -C_ASSERT(offsetof(INPUTCONTEXTDX, bHasVKey) == 0x144); +C_ASSERT(offsetof(INPUTCONTEXTDX, bNeedsTrans) == 0x144); C_ASSERT(offsetof(INPUTCONTEXTDX, dwUIFlags) == 0x14c); #endif @@ -131,6 +131,24 @@ C_ASSERT(offsetof(INPUTCONTEXTDX, dwUIFlags) == 0x14c); #define IR_STRINGEX 0x180 #define IR_MODEINFO 0x190 +// for IR_UNDETERMINE +typedef struct tagUNDETERMINESTRUCT +{ + DWORD dwSize; + UINT uDefIMESize; + UINT uDefIMEPos; + UINT uUndetTextLen; + UINT uUndetTextPos; + UINT uUndetAttrPos; + UINT uCursorPos; + UINT uDeltaStart; + UINT uDetermineTextLen; + UINT uDetermineTextPos; + UINT uDetermineDelimPos; + UINT uYomiTextLen; + UINT uYomiTextPos; + UINT uYomiDelimPos; +} UNDETERMINESTRUCT, *PUNDETERMINESTRUCT, *LPUNDETERMINESTRUCT; LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC); diff --git a/win32ss/include/imetable.h b/win32ss/include/imetable.h index 1b47380e954..0574fce48f0 100644 --- a/win32ss/include/imetable.h +++ b/win32ss/include/imetable.h @@ -11,7 +11,7 @@ DEFINE_IME_ENTRY(LRESULT, ImeEscape, (HIMC hIMC, UINT uEscape, LPVOID lpData), F DEFINE_IME_ENTRY(BOOL, ImeSelect, (HIMC hIMC, BOOL fSelect), FALSE) DEFINE_IME_ENTRY(BOOL, ImeProcessKey, (HIMC hIMC, UINT uVirKey, DWORD lParam, CONST LPBYTE lpbKeyState), FALSE) DEFINE_IME_ENTRY(BOOL, ImeSetActiveContext, (HIMC hIMC, BOOL fFlag), FALSE) -DEFINE_IME_ENTRY(UINT, ImeToAsciiEx, (UINT uVirKey, UINT uScanCode, CONST LPBYTE lpbKeyState, /*FIXME: LPTRANSMSGLIST*/ LPVOID lpTransMsgList, UINT fuState, HIMC hIMC), FALSE) +DEFINE_IME_ENTRY(UINT, ImeToAsciiEx, (UINT uVirKey, UINT uScanCode, CONST LPBYTE lpbKeyState, LPTRANSMSGLIST lpTransMsgList, UINT fuState, HIMC hIMC), FALSE) DEFINE_IME_ENTRY(BOOL, NotifyIME, (HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD dwValue), FALSE) DEFINE_IME_ENTRY(BOOL, ImeSetCompositionString, (HIMC hIMC, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen), FALSE) DEFINE_IME_ENTRY(DWORD, ImeGetImeMenuItems, (HIMC hIMC, DWORD dwFlags, DWORD dwType, LPIMEMENUITEMINFOW lpImeParentMenu, LPIMEMENUITEMINFOW lpImeMenu, DWORD dwSize), FALSE) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 3147acfac6f..782af6d0df4 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1211,6 +1211,17 @@ typedef struct _IMEWND PIMEUI pimeui; } IMEWND, *PIMEWND; +typedef struct tagTRANSMSG { + UINT message; + WPARAM wParam; + LPARAM lParam; +} TRANSMSG, *PTRANSMSG, *LPTRANSMSG; + +typedef struct tagTRANSMSGLIST { + UINT uMsgCount; + TRANSMSG TransMsg[1]; +} TRANSMSGLIST, *PTRANSMSGLIST, *LPTRANSMSGLIST; + #define DEFINE_IME_ENTRY(type, name, params, extended) typedef type (WINAPI *FN_##name) params; #include "imetable.h" #undef DEFINE_IME_ENTRY @@ -2203,8 +2214,7 @@ NtUserGetAncestor( DWORD NTAPI -NtUserGetAppImeLevel( - DWORD dwUnknown1); +NtUserGetAppImeLevel(HWND hWnd); SHORT NTAPI diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index cac0d64b662..031dc09ec64 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -95,8 +95,7 @@ NtUserDisableThreadIme( DWORD APIENTRY -NtUserGetAppImeLevel( - DWORD dwUnknown1) +NtUserGetAppImeLevel(HWND hWnd) { STUB; return 0;
3 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] Refactor Part 2
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=db8dd3b35e83cb797547a…
commit db8dd3b35e83cb797547a7f2499cebe9ac0fc54b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Aug 16 15:45:11 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Aug 16 15:45:11 2021 +0900 [IMM32] Refactor Part 2 Simplify the IMM32 code by deleting middle functions. CORE-11700 --- dll/win32/imm32/imm.c | 88 +++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 70 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 7b0b415f74f..01e656c454b 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -119,49 +119,13 @@ static LPSTR APIENTRY Imm32AnsiFromWide(LPCWSTR pszW) return pszA; } -static DWORD_PTR APIENTRY Imm32QueryWindow(HWND hWnd, DWORD Index) -{ - return NtUserQueryWindow(hWnd, Index); -} - -static DWORD APIENTRY -Imm32UpdateInputContext(HIMC hIMC, DWORD Unknown1, PCLIENTIMC pClientImc) -{ - return NtUserUpdateInputContext(hIMC, Unknown1, pClientImc); -} - -static DWORD APIENTRY Imm32QueryInputContext(HIMC hIMC, DWORD dwUnknown2) -{ - return NtUserQueryInputContext(hIMC, dwUnknown2); -} - static inline BOOL Imm32IsCrossThreadAccess(HIMC hIMC) { - DWORD dwImeThreadId = Imm32QueryInputContext(hIMC, 1); + DWORD dwImeThreadId = NtUserQueryInputContext(hIMC, 1); DWORD dwThreadId = GetCurrentThreadId(); return (dwImeThreadId != dwThreadId); } -static DWORD APIENTRY Imm32NotifyIMEStatus(HWND hwnd, HIMC hIMC, DWORD dwConversion) -{ - return NtUserNotifyIMEStatus(hwnd, hIMC, dwConversion); -} - -static HIMC APIENTRY Imm32CreateInputContext(PCLIENTIMC pClientImc) -{ - return NtUserCreateInputContext(pClientImc); -} - -static BOOL APIENTRY Imm32DestroyInputContext(HIMC hIMC) -{ - return NtUserDestroyInputContext(hIMC); -} - -DWORD_PTR APIENTRY Imm32GetThreadState(DWORD Routine) -{ - return NtUserGetThreadState(Routine); -} - static VOID APIENTRY Imm32FreeImeDpi(PIMEDPI pImeDpi, BOOL bDestroy) { if (pImeDpi->hInst == NULL) @@ -182,7 +146,7 @@ Imm32NotifyAction(HIMC hIMC, HWND hwnd, DWORD dwAction, DWORD_PTR dwIndex, DWORD if (dwAction) { - dwLayout = Imm32QueryInputContext(hIMC, 1); + dwLayout = NtUserQueryInputContext(hIMC, 1); if (dwLayout) { /* find keyboard layout and lock it */ @@ -228,11 +192,6 @@ static BOOL Imm32GetSystemLibraryPath(LPWSTR pszPath, DWORD cchPath, LPCWSTR psz return TRUE; } -DWORD APIENTRY Imm32SetImeOwnerWindow(PIMEINFOEX pImeInfoEx, BOOL fFlag) -{ - return NtUserSetImeOwnerWindow(pImeInfoEx, fFlag); -} - static BOOL APIENTRY Imm32InquireIme(PIMEDPI pImeDpi) { WCHAR szUIClass[64]; @@ -240,7 +199,7 @@ static BOOL APIENTRY Imm32InquireIme(PIMEDPI pImeDpi) DWORD dwSysInfoFlags = 0; // TODO: ??? LPIMEINFO pImeInfo = &pImeDpi->ImeInfo; - // TODO: Imm32GetThreadState(THREADSTATE_UNKNOWN16); + // TODO: NtUserGetThreadState(THREADSTATE_UNKNOWN16); if (!IS_IME_HKL(pImeDpi->hKL)) { @@ -374,7 +333,7 @@ static BOOL APIENTRY Imm32LoadImeInfo(PIMEINFOEX pImeInfoEx, PIMEDPI pImeDpi) if (pImeInfoEx->fLoadFlag) return TRUE; - Imm32SetImeOwnerWindow(pImeInfoEx, TRUE); + NtUserSetImeOwnerWindow(pImeInfoEx, TRUE); return TRUE; Failed: @@ -1013,7 +972,7 @@ HIMC WINAPI ImmCreateContext(void) if (pClientImc == NULL) return NULL; - hIMC = Imm32CreateInputContext(pClientImc); + hIMC = NtUserCreateInputContext(pClientImc); if (hIMC == NULL) { HeapFree(g_hImm32Heap, 0, pClientImc); @@ -1021,7 +980,7 @@ HIMC WINAPI ImmCreateContext(void) } RtlInitializeCriticalSection(&pClientImc->cs); - pClientImc->unknown = Imm32GetThreadState(THREADSTATE_UNKNOWN13); + pClientImc->unknown = NtUserGetThreadState(THREADSTATE_UNKNOWN13); return hIMC; } @@ -1055,7 +1014,7 @@ BOOL APIENTRY Imm32CleanupContext(HIMC hIMC, HKL hKL, BOOL bKeep) pClientImc->dwFlags |= CLIENTIMC_UNKNOWN1; ImmUnlockClientImc(pClientImc); if (!bKeep) - return Imm32DestroyInputContext(hIMC); + return NtUserDestroyInputContext(hIMC); return TRUE; } @@ -1100,7 +1059,7 @@ BOOL APIENTRY Imm32CleanupContext(HIMC hIMC, HKL hKL, BOOL bKeep) ImmUnlockClientImc(pClientImc); if (!bKeep) - return Imm32DestroyInputContext(hIMC); + return NtUserDestroyInputContext(hIMC); return TRUE; } @@ -1415,12 +1374,6 @@ static PCLIENTIMC APIENTRY Imm32GetClientImcCache(void) return NULL; } -static NTSTATUS APIENTRY -Imm32BuildHimcList(DWORD dwThreadId, DWORD dwCount, HIMC *phList, LPDWORD pdwCount) -{ - return NtUserBuildHimcList(dwThreadId, dwCount, phList, pdwCount); -} - static DWORD APIENTRY Imm32AllocAndBuildHimcList(DWORD dwThreadId, HIMC **pphList) { #define INITIAL_COUNT 0x40 @@ -1433,7 +1386,7 @@ static DWORD APIENTRY Imm32AllocAndBuildHimcList(DWORD dwThreadId, HIMC **pphLis if (phNewList == NULL) return 0; - Status = Imm32BuildHimcList(dwThreadId, dwCount, phNewList, &dwCount); + Status = NtUserBuildHimcList(dwThreadId, dwCount, phNewList, &dwCount); while (Status == STATUS_BUFFER_TOO_SMALL) { HeapFree(g_hImm32Heap, 0, phNewList); @@ -1444,7 +1397,7 @@ static DWORD APIENTRY Imm32AllocAndBuildHimcList(DWORD dwThreadId, HIMC **pphLis if (phNewList == NULL) return 0; - Status = Imm32BuildHimcList(dwThreadId, dwCount, phNewList, &dwCount); + Status = NtUserBuildHimcList(dwThreadId, dwCount, phNewList, &dwCount); } if (NT_ERROR(Status) || !dwCount) @@ -1701,9 +1654,9 @@ PCLIENTIMC WINAPI ImmLockClientImc(HIMC hImc) return NULL; RtlInitializeCriticalSection(&pClientImc->cs); - pClientImc->unknown = Imm32GetThreadState(THREADSTATE_UNKNOWN13); + pClientImc->unknown = NtUserGetThreadState(THREADSTATE_UNKNOWN13); - if (!Imm32UpdateInputContext(hImc, 0, pClientImc)) + if (!NtUserUpdateInputContext(hImc, 0, pClientImc)) { HeapFree(g_hImm32Heap, 0, pClientImc); return NULL; @@ -2703,9 +2656,9 @@ HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd) return NULL; if (hWnd == NULL) - return (HWND)Imm32GetThreadState(THREADSTATE_ACTIVEWINDOW); + return (HWND)NtUserGetThreadState(THREADSTATE_ACTIVEWINDOW); - return (HWND)Imm32QueryWindow(hWnd, QUERY_WINDOW_DEFAULT_IME); + return (HWND)NtUserQueryWindow(hWnd, QUERY_WINDOW_DEFAULT_IME); } /*********************************************************************** @@ -3918,7 +3871,7 @@ BOOL WINAPI ImmSetConversionStatus( { Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, dwOldConversion, IMC_SETCONVERSIONMODE, IMN_SETCONVERSIONMODE, 0); - Imm32NotifyIMEStatus(hWnd, hIMC, fdwConversion); + NtUserNotifyIMEStatus(hWnd, hIMC, fdwConversion); } if (fSentenceChange) @@ -4040,7 +3993,7 @@ BOOL WINAPI ImmSetOpenStatus(HIMC hIMC, BOOL fOpen) { Imm32NotifyAction(hIMC, hWnd, NI_CONTEXTUPDATED, 0, IMC_SETOPENSTATUS, IMN_SETOPENSTATUS, 0); - Imm32NotifyIMEStatus(hWnd, hIMC, dwConversion); + NtUserNotifyIMEStatus(hWnd, hIMC, dwConversion); } return TRUE; @@ -4742,11 +4695,6 @@ BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID) return FALSE; } -static BOOL APIENTRY Imm32GetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType) -{ - return NtUserGetImeInfoEx(pImeInfoEx, SearchType); -} - /*********************************************************************** * ImmGetImeInfoEx (IMM32.@) */ @@ -4792,7 +4740,7 @@ ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx, } Quit: - return Imm32GetImeInfoEx(pImeInfoEx, SearchType); + return NtUserGetImeInfoEx(pImeInfoEx, SearchType); } BOOL WINAPI User32InitializeImmEntryTable(DWORD); @@ -4834,7 +4782,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) hKL = GetKeyboardLayout(0); // FIXME: NtUserGetThreadState and enum ThreadStateRoutines are broken. - hIMC = (HIMC)Imm32GetThreadState(4); + hIMC = (HIMC)NtUserGetThreadState(4); Imm32CleanupContext(hIMC, hKL, TRUE); break;
3 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32_APITEST] Add ImmIsUIMessage testcase (#3908)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3ff832b5d3fb265c0826b…
commit 3ff832b5d3fb265c0826bc77790ce398dc0361b5 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Aug 16 15:35:25 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Aug 16 15:35:25 2021 +0900 [IMM32_APITEST] Add ImmIsUIMessage testcase (#3908) - Add ImmIsUIMessage testcase in IMM32_APITEST. CORE-11700 --- modules/rostests/apitests/imm32/CMakeLists.txt | 1 + modules/rostests/apitests/imm32/ImmIsUIMessage.c | 29 ++++++++++++++++++++++++ modules/rostests/apitests/imm32/testlist.c | 2 ++ 3 files changed, 32 insertions(+) diff --git a/modules/rostests/apitests/imm32/CMakeLists.txt b/modules/rostests/apitests/imm32/CMakeLists.txt index 2edcec8f68f..79fbf5840bb 100644 --- a/modules/rostests/apitests/imm32/CMakeLists.txt +++ b/modules/rostests/apitests/imm32/CMakeLists.txt @@ -4,6 +4,7 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) list(APPEND SOURCE clientimc.c imcc.c + ImmIsUIMessage.c testlist.c) add_executable(imm32_apitest ${SOURCE}) diff --git a/modules/rostests/apitests/imm32/ImmIsUIMessage.c b/modules/rostests/apitests/imm32/ImmIsUIMessage.c new file mode 100644 index 00000000000..73c645645e2 --- /dev/null +++ b/modules/rostests/apitests/imm32/ImmIsUIMessage.c @@ -0,0 +1,29 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Test for ImmIsUIMessage + * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) + */ + +#include "precomp.h" + +START_TEST(ImmIsUIMessage) +{ + UINT uMsg; + BOOL ret; + for (uMsg = 0x100; uMsg < 0x300; ++uMsg) + { + ret = ImmIsUIMessageA(NULL, uMsg, 0, 0); + switch (uMsg) + { + case WM_IME_STARTCOMPOSITION: case WM_IME_ENDCOMPOSITION: + case WM_IME_COMPOSITION: case WM_IME_SETCONTEXT: case WM_IME_NOTIFY: + case WM_IME_COMPOSITIONFULL: case WM_IME_SELECT: case 0x287: + ok_int(ret, TRUE); + break; + default: + ok_int(ret, FALSE); + break; + } + } +} diff --git a/modules/rostests/apitests/imm32/testlist.c b/modules/rostests/apitests/imm32/testlist.c index a9b8f92a791..73597d5f204 100644 --- a/modules/rostests/apitests/imm32/testlist.c +++ b/modules/rostests/apitests/imm32/testlist.c @@ -4,10 +4,12 @@ extern void func_clientimc(void); extern void func_imcc(void); +extern void func_ImmIsUIMessage(void); const struct test winetest_testlist[] = { { "clientimc", func_clientimc }, { "imcc", func_imcc }, + { "ImmIsUIMessage", func_ImmIsUIMessage }, { 0, 0 } };
3 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
10
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
Results per page:
10
25
50
100
200