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 2022
----- 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
11 participants
86 discussions
Start a n
N
ew thread
[reactos] 01/01: [IMM32] Add 'Win:' comments more
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f9a11d1e0be180c0619d4…
commit f9a11d1e0be180c0619d41ed46c89ec6862d56db Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Aug 15 21:46:33 2022 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Mon Aug 15 21:46:33 2022 +0900 [IMM32] Add 'Win:' comments more CORE-11700 --- dll/win32/imm32/keymsg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dll/win32/imm32/keymsg.c b/dll/win32/imm32/keymsg.c index 8abd8a5c8ae..e0085026136 100644 --- a/dll/win32/imm32/keymsg.c +++ b/dll/win32/imm32/keymsg.c @@ -13,6 +13,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm); +/* Win: CIMENonIMEToggle */ BOOL APIENTRY Imm32ImeNonImeToggle(HIMC hIMC, HKL hKL, HWND hWnd, LANGID LangID) { LPINPUTCONTEXT pIC; @@ -44,6 +45,7 @@ BOOL APIENTRY Imm32ImeNonImeToggle(HIMC hIMC, HKL hKL, HWND hWnd, LANGID LangID) return TRUE; } +/* Win: TShapeToggle */ BOOL APIENTRY Imm32CShapeToggle(HIMC hIMC, HKL hKL, HWND hWnd) { LPINPUTCONTEXT pIC; @@ -74,6 +76,7 @@ BOOL APIENTRY Imm32CShapeToggle(HIMC hIMC, HKL hKL, HWND hWnd) return TRUE; } +/* Win: CSymbolToggle */ BOOL APIENTRY Imm32CSymbolToggle(HIMC hIMC, HKL hKL, HWND hWnd) { LPINPUTCONTEXT pIC; @@ -104,6 +107,7 @@ BOOL APIENTRY Imm32CSymbolToggle(HIMC hIMC, HKL hKL, HWND hWnd) return TRUE; } +/* Win: JCloseOpen */ BOOL APIENTRY Imm32JCloseOpen(HIMC hIMC, HKL hKL, HWND hWnd) { BOOL fOpen; @@ -119,6 +123,7 @@ BOOL APIENTRY Imm32JCloseOpen(HIMC hIMC, HKL hKL, HWND hWnd) return TRUE; } +/* Win: KShapeToggle */ BOOL APIENTRY Imm32KShapeToggle(HIMC hIMC) { LPINPUTCONTEXT pIC; @@ -141,6 +146,7 @@ BOOL APIENTRY Imm32KShapeToggle(HIMC hIMC) return TRUE; } +/* Win: KHanjaConvert */ BOOL APIENTRY Imm32KHanjaConvert(HIMC hIMC) { LPINPUTCONTEXT pIC; @@ -158,6 +164,7 @@ BOOL APIENTRY Imm32KHanjaConvert(HIMC hIMC) return TRUE; } +/* Win: KEnglishHangul */ BOOL APIENTRY Imm32KEnglish(HIMC hIMC) { LPINPUTCONTEXT pIC;
2 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER] Refactor NtUserUnloadKeyboardLayout (#4605)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=379188acfeb55efc0dbbc…
commit 379188acfeb55efc0dbbc7b5c7f3e7ecf57bbd0b Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Aug 15 08:25:06 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Aug 15 08:25:06 2022 +0900 [NTUSER] Refactor NtUserUnloadKeyboardLayout (#4605) - Add IntHKLtoPKL, co_UserActivateKeyboardLayout, IntReorderKeyboardLayouts, and co_IntActivateKeyboardLayout helper functions. - Rewrite NtUserUnloadKeyboardLayout by using helper functions. CORE-11700 --- win32ss/include/ntuser.h | 2 +- win32ss/user/ntuser/kbdlayout.c | 183 +++++++++++++++++++++++++++++----------- 2 files changed, 135 insertions(+), 50 deletions(-) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 924a0bef195..3f0449d2ee6 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1515,7 +1515,7 @@ NtUserTrackPopupMenuEx( HKL NTAPI NtUserActivateKeyboardLayout( - HKL hKl, + HKL hKL, ULONG Flags); DWORD diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c index 09e0f677f38..c4d97267101 100644 --- a/win32ss/user/ntuser/kbdlayout.c +++ b/win32ss/user/ntuser/kbdlayout.c @@ -27,7 +27,71 @@ typedef PVOID (*PFN_KBDLAYERDESCRIPTOR)(VOID); /* PRIVATE FUNCTIONS ******************************************************/ -// Win: _GetKeyboardLayoutList +/* + * Retrieves a PKL by an input locale identifier (HKL). + * @implemented + * Win: HKLtoPKL + */ +PKL FASTCALL IntHKLtoPKL(_Inout_ PTHREADINFO pti, _In_ HKL hKL) +{ + PKL pFirstKL, pKL; + + pFirstKL = pti->KeyboardLayout; + if (!pFirstKL) + return NULL; + + pKL = pFirstKL; + + /* hKL can have special value HKL_NEXT or HKL_PREV */ + if (hKL == (HKL)(ULONG_PTR)HKL_NEXT) /* Looking forward */ + { + do + { + pKL = pKL->pklNext; + if (!(pKL->dwKL_Flags & KLF_UNLOAD)) + return pKL; + } while (pKL != pFirstKL); + } + else if (hKL == (HKL)(ULONG_PTR)HKL_PREV) /* Looking backward */ + { + do + { + pKL = pKL->pklPrev; + if (!(pKL->dwKL_Flags & KLF_UNLOAD)) + return pKL; + } while (pKL != pFirstKL); + } + else if (HIWORD(hKL)) /* hKL is a full input locale identifier */ + { + /* No KLF_UNLOAD check */ + do + { + if (pKL->hkl == hKL) + return pKL; + + pKL = pKL->pklNext; + } while (pKL != pFirstKL); + } + else /* Language only specified */ + { + /* No KLF_UNLOAD check */ + do + { + if (LOWORD(pKL->hkl) == LOWORD(hKL)) /* Low word is language ID */ + return pKL; + + pKL = pKL->pklNext; + } while (pKL != pFirstKL); + } + + return NULL; +} + +/* + * A helper function for NtUserGetKeyboardLayoutList. + * @implemented + * Win: _GetKeyboardLayoutList + */ static UINT APIENTRY IntGetKeyboardLayoutList( _Inout_ PWINSTATION_OBJECT pWinSta, @@ -543,6 +607,66 @@ co_UserActivateKbl(PTHREADINFO pti, PKL pKl, UINT Flags) return pklPrev; } +/* Win: xxxInternalActivateKeyboardLayout */ +HKL APIENTRY +co_UserActivateKeyboardLayout( + _Inout_ PKL pKL, + _In_ ULONG uFlags, + _Inout_ PWND pWnd) +{ + HKL hKL = pKL->hkl; + PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + + if (pKL != pti->KeyboardLayout) + { + /* Activate layout for current thread */ + co_UserActivateKbl(pti, pKL, uFlags); + + /* Send shell message */ + if (!(uFlags & KLF_NOTELLSHELL)) + co_IntShellHookNotify(HSHELL_LANGUAGE, 0, (LPARAM)hKL); + } + + /* FIXME: KLF_RESET + KLF_SHIFTLOCK */ + + return hKL; +} + +// Win: ReorderKeyboardLayouts +VOID FASTCALL +IntReorderKeyboardLayouts( + _Inout_ PWINSTATION_OBJECT pWinSta, + _Inout_ PKL pKL) +{ + /* FIXME */ + gspklBaseLayout = pKL; +} + +/* Win: xxxActivateKeyboardLayout */ +HKL APIENTRY +co_IntActivateKeyboardLayout( + _Inout_ PWINSTATION_OBJECT pWinSta, + _In_ HKL hKL, + _In_ ULONG uFlags, + _Inout_ PWND pWnd) +{ + PKL pKL; + PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + + pKL = IntHKLtoPKL(pti, hKL); + if (!pKL) + { + ERR("Invalid HKL %p!\n", hKL); + return NULL; + } + + if (uFlags & KLF_REORDER) + IntReorderKeyboardLayouts(pWinSta, pKL); + + return co_UserActivateKeyboardLayout(pKL, uFlags, pWnd); +} + /* EXPORTS *******************************************************************/ /* @@ -821,62 +945,23 @@ cleanup: * Activates specified layout for thread or process */ HKL -APIENTRY +NTAPI NtUserActivateKeyboardLayout( - HKL hKl, + HKL hKL, ULONG Flags) { - PKL pKl = NULL; - HKL hkl = NULL; - PTHREADINFO pti; + PWINSTATION_OBJECT pWinSta; + HKL hOldKL; UserEnterExclusive(); - pti = PsGetCurrentThreadWin32Thread(); + /* FIXME */ - /* hKl can have special value HKL_NEXT or HKL_PREV */ - if (hKl == (HKL)HKL_NEXT) - { - /* Get next keyboard layout starting with current */ - if (pti->KeyboardLayout) - pKl = pti->KeyboardLayout->pklNext; - } - else if (hKl == (HKL)HKL_PREV) - { - /* Get previous keyboard layout starting with current */ - if (pti->KeyboardLayout) - pKl = pti->KeyboardLayout->pklPrev; - } - else - pKl = UserHklToKbl(hKl); - - if (!pKl) - { - ERR("Invalid HKL %p!\n", hKl); - goto cleanup; - } - - hkl = pKl->hkl; - - /* FIXME: KLF_RESET - KLF_SHIFTLOCK */ - - if (Flags & KLF_REORDER) - gspklBaseLayout = pKl; - - if (pKl != pti->KeyboardLayout) - { - /* Activate layout for current thread */ - pKl = co_UserActivateKbl(pti, pKl, Flags); - - /* Send shell message */ - if (!(Flags & KLF_NOTELLSHELL)) - co_IntShellHookNotify(HSHELL_LANGUAGE, 0, (LPARAM)hkl); - } - -cleanup: + pWinSta = IntGetProcessWindowStation(NULL); + hOldKL = co_IntActivateKeyboardLayout(pWinSta, hKL, Flags, NULL); UserLeave(); - return hkl; + + return hOldKL; } /*
2 years, 4 months
1
0
0
0
[reactos] 01/01: [USER32] Call CliImmInitializeHotKeys on LoadKeyboardLayoutW epilogue (#4604)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e8ccc8516f19b50531675…
commit e8ccc8516f19b50531675793f5f47c11189fd845 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun Aug 14 10:53:58 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Aug 14 10:53:58 2022 +0900 [USER32] Call CliImmInitializeHotKeys on LoadKeyboardLayoutW epilogue (#4604) Enable the IME hotkeys. - Call CliImmInitializeHotKeys.SETIMEHOTKEY_ADD on IntLoadKeyboardLayout epilogue. CORE-11700 --- win32ss/user/user32/windows/input.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/win32ss/user/user32/windows/input.c b/win32ss/user/user32/windows/input.c index dd396999e3b..8d4d3ad8732 100644 --- a/win32ss/user/user32/windows/input.c +++ b/win32ss/user/user32/windows/input.c @@ -656,6 +656,7 @@ IntLoadKeyboardLayout( WCHAR wszRegKey[256] = L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; WCHAR wszLayoutId[10], wszNewKLID[10]; HKEY hKey; + HKL hNewKL; /* LOWORD of dwhkl is Locale Identifier */ dwhkl = LOWORD(wcstoul(pwszKLID, NULL, 16)); @@ -712,9 +713,11 @@ IntLoadKeyboardLayout( ZeroMemory(&ustrKbdName, sizeof(ustrKbdName)); RtlInitUnicodeString(&ustrKLID, pwszKLID); - return NtUserLoadKeyboardLayoutEx(NULL, 0, &ustrKbdName, - NULL, &ustrKLID, - dwhkl, Flags); + hNewKL = NtUserLoadKeyboardLayoutEx(NULL, 0, &ustrKbdName, + NULL, &ustrKLID, + dwhkl, Flags); + CliImmInitializeHotKeys(SETIMEHOTKEY_ADD, hNewKL); + return hNewKL; } /*
2 years, 4 months
1
0
0
0
[reactos] 01/01: [USER32][IMM32][INCLUDE] Empower WM_IME_SYSTEM handling (#4603)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=25fcdc5c2bbb3e7457646…
commit 25fcdc5c2bbb3e745764614d4942dc286848af7d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Aug 13 07:08:18 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Aug 13 07:08:18 2022 +0900 [USER32][IMM32][INCLUDE] Empower WM_IME_SYSTEM handling (#4603) - Add code to ImeWnd_OnImeSystem function. - Add CtfLoadThreadLayout and User32DoImeHelp helper functions. - Define IMS_... constants (for WM_IME_SYSTEM wParam) and fix some magic numbers. CORE-11700 --- dll/win32/imm32/keymsg.c | 25 +++++---- sdk/include/ddk/immdev.h | 16 ++++++ win32ss/user/user32/misc/imm.c | 116 +++++++++++++++++++++++++++++++---------- 3 files changed, 118 insertions(+), 39 deletions(-) diff --git a/dll/win32/imm32/keymsg.c b/dll/win32/imm32/keymsg.c index e2d41141063..8abd8a5c8ae 100644 --- a/dll/win32/imm32/keymsg.c +++ b/dll/win32/imm32/keymsg.c @@ -264,14 +264,15 @@ ImmIsUIMessageAW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAns typedef struct IMM_DELAY_SET_LANG_BAND { HWND hWnd; - BOOL fFlag; + BOOL fSet; } IMM_DELAY_SET_LANG_BAND, *PIMM_DELAY_SET_LANG_BAND; +/* Sends a message to set the language band with delay. */ /* Win: DelaySetLangBand */ static DWORD APIENTRY Imm32DelaySetLangBandProc(LPVOID arg) { HWND hwndDefIME; - UINT uValue; + WPARAM wParam; DWORD_PTR lResult; PIMM_DELAY_SET_LANG_BAND pSetBand = arg; @@ -280,16 +281,17 @@ static DWORD APIENTRY Imm32DelaySetLangBandProc(LPVOID arg) hwndDefIME = ImmGetDefaultIMEWnd(pSetBand->hWnd); if (hwndDefIME) { - uValue = (pSetBand->fFlag ? 0x23 : 0x24); - SendMessageTimeoutW(hwndDefIME, WM_IME_SYSTEM, uValue, (LPARAM)pSetBand->hWnd, + wParam = (pSetBand->fSet ? IMS_SETLANGBAND : IMS_UNSETLANGBAND); + SendMessageTimeoutW(hwndDefIME, WM_IME_SYSTEM, wParam, (LPARAM)pSetBand->hWnd, SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, &lResult); } ImmLocalFree(pSetBand); return FALSE; } +/* Updates the language band. */ /* Win: CtfImmSetLangBand */ -LRESULT APIENTRY CtfImmSetLangBand(HWND hWnd, BOOL fFlag) +LRESULT APIENTRY CtfImmSetLangBand(HWND hWnd, BOOL fSet) { HANDLE hThread; PWND pWnd = NULL; @@ -304,7 +306,7 @@ LRESULT APIENTRY CtfImmSetLangBand(HWND hWnd, BOOL fFlag) if (pWnd->state2 & WNDS2_WMCREATEMSGPROCESSED) { - SendMessageTimeoutW(hWnd, 0x505, 0, fFlag, 3, 5000, &lResult); + SendMessageTimeoutW(hWnd, 0x505, 0, fSet, 3, 5000, &lResult); return lResult; } @@ -313,7 +315,7 @@ LRESULT APIENTRY CtfImmSetLangBand(HWND hWnd, BOOL fFlag) return 0; pSetBand->hWnd = hWnd; - pSetBand->fFlag = fFlag; + pSetBand->fSet = fSet; hThread = CreateThread(NULL, 0, Imm32DelaySetLangBandProc, pSetBand, 0, NULL); if (hThread) @@ -762,16 +764,17 @@ LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam) switch (wParam) { - case 0x1f: + case IMS_SENDNOTIFICATION: Imm32SendNotification((BOOL)lParam); return 0; - case 0x20: + case IMS_COMPLETECOMPSTR: ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0); return 0; - case 0x23: case 0x24: - return CtfImmSetLangBand((HWND)lParam, (wParam == 0x23)); + case IMS_SETLANGBAND: + case IMS_UNSETLANGBAND: + return CtfImmSetLangBand((HWND)lParam, (wParam == IMS_SETLANGBAND)); default: return 0; diff --git a/sdk/include/ddk/immdev.h b/sdk/include/ddk/immdev.h index 33146de3c95..a239dcda3ec 100644 --- a/sdk/include/ddk/immdev.h +++ b/sdk/include/ddk/immdev.h @@ -25,10 +25,26 @@ extern "C" { #define IMC_SETSOFTKBDPOS 0x0014 /* wParam for WM_IME_SYSTEM */ +#define IMS_NOTIFYIMESHOW 0x05 +#define IMS_UPDATEIMEUI 0x06 +#define IMS_SETCANDFORM 0x09 +#define IMS_SETCOMPFONT 0x0A +#define IMS_SETCOMPFORM 0x0B +#define IMS_CONFIGURE 0x0D +#define IMS_SETOPENSTATUS 0x0F +#define IMS_FREELAYOUT 0x11 +#define IMS_GETCONVSTATUS 0x14 +#define IMS_IMEHELP 0x15 #define IMS_IMEACTIVATE 0x17 #define IMS_IMEDEACTIVATE 0x18 #define IMS_ACTIVATELAYOUT 0x19 #define IMS_GETIMEMENU 0x1C +#define IMS_GETCONTEXT 0x1E +#define IMS_SENDNOTIFICATION 0x1F +#define IMS_COMPLETECOMPSTR 0x20 +#define IMS_LOADTHREADLAYOUT 0x21 +#define IMS_SETLANGBAND 0x23 +#define IMS_UNSETLANGBAND 0x24 #define IMMGWL_IMC 0 #define IMMGWL_PRIVATE (sizeof(LONG)) diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c index 4cfe094b066..2f1a1227b18 100644 --- a/win32ss/user/user32/misc/imm.c +++ b/win32ss/user/user32/misc/imm.c @@ -164,7 +164,8 @@ static BOOL User32GetImeShowStatus(VOID) return (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_GETIMESHOWSTATUS); } -// Win: SendMessageToUI(pimeui, uMsg, wParam, lParam, !unicode) +/* Sends a message to the IME UI window. */ +/* Win: SendMessageToUI(pimeui, uMsg, wParam, lParam, !unicode) */ static LRESULT User32SendImeUIMessage(PIMEUI pimeui, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode) { @@ -240,7 +241,8 @@ static VOID User32UpdateImcOfImeUI(PIMEUI pimeui, HIMC hNewIMC) User32SetImeWindowOfImc(hNewIMC, hImeWnd); } -// Win: ImeNotifyHandler +/* Handles WM_IME_NOTIFY message of the default IME window. */ +/* Win: ImeNotifyHandler */ static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) { LRESULT ret = 0; @@ -290,7 +292,8 @@ static LRESULT ImeWnd_OnImeNotify(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) return ret; } -// Win: CreateIMEUI +/* Creates the IME UI window. */ +/* Win: CreateIMEUI */ static HWND User32CreateImeUIWindow(PIMEUI pimeui, HKL hKL) { IMEINFOEX ImeInfoEx; @@ -335,7 +338,8 @@ Quit: return hwndUI; } -// Win: ImeWndCreateHandler +/* Initializes the default IME window. */ +/* Win: ImeWndCreateHandler */ static BOOL ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS) { PWND pParentWnd, pWnd = pimeui->spwnd; @@ -369,7 +373,8 @@ static BOOL ImeWnd_OnCreate(PIMEUI pimeui, LPCREATESTRUCT lpCS) return TRUE; } -// Win: DestroyIMEUI +/* Destroys the IME UI window. */ +/* Win: DestroyIMEUI */ static VOID User32DestroyImeUIWindow(PIMEUI pimeui) { HWND hwndUI = pimeui->hwndUI; @@ -384,7 +389,8 @@ static VOID User32DestroyImeUIWindow(PIMEUI pimeui) pimeui->hwndUI = NULL; } -// Win: ImeSelectHandler +/* Handles WM_IME_SELECT message of the default IME window. */ +/* Win: ImeSelectHandler */ static VOID ImeWnd_OnImeSelect(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) { HKL hKL; @@ -414,7 +420,8 @@ static VOID ImeWnd_OnImeSelect(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) } } -// Win: ImeControlHandler(pimeui, wParam, lParam, !unicode) +/* Handles WM_IME_CONTROL message of the default IME window. */ +/* Win: ImeControlHandler(pimeui, wParam, lParam, !unicode) */ static LRESULT ImeWnd_OnImeControl(PIMEUI pimeui, WPARAM wParam, LPARAM lParam, BOOL unicode) { @@ -536,7 +543,8 @@ ImeWnd_OnImeControl(PIMEUI pimeui, WPARAM wParam, LPARAM lParam, BOOL unicode) return 0; } -// Win: FocusSetIMCContext +/* Modify the IME activation status. */ +/* Win: FocusSetIMCContext */ static VOID FASTCALL User32SetImeActivenessOfWindow(HWND hWnd, BOOL bActive) { HIMC hIMC; @@ -552,7 +560,52 @@ static VOID FASTCALL User32SetImeActivenessOfWindow(HWND hWnd, BOOL bActive) IMM_FN(ImmReleaseContext)(hWnd, hIMC); } -// Win: ImeSystemHandler +/* Win: CtfLoadThreadLayout */ +VOID FASTCALL CtfLoadThreadLayout(PIMEUI pimeui) +{ + IMM_FN(CtfImmTIMActivate)(pimeui->hKL); + pimeui->hKL = GetWin32ClientInfo()->hKL; + IMM_FN(ImmLoadIME)(pimeui->hKL); + pimeui->hwndUI = NULL; +} + +/* Open the IME help or check the existence of the IME help. */ +static LRESULT FASTCALL +User32DoImeHelp(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) +{ + WCHAR szHelpFile[MAX_PATH]; + DWORD ret, dwEsc = IME_ESC_GETHELPFILENAME; + size_t cch; + + /* Is there any IME help file? */ + ret = IMM_FN(ImmEscapeW)(pimeui->hKL, pimeui->hIMC, IME_ESC_QUERY_SUPPORT, &dwEsc); + if (!ret || !lParam) + return ret; + + /* Get the help filename */ + if (IMM_FN(ImmEscapeW)(pimeui->hKL, pimeui->hIMC, IME_ESC_GETHELPFILENAME, szHelpFile)) + { + /* Check filename extension */ + cch = wcslen(szHelpFile); + if (cch > 4 && _wcsicmp(&szHelpFile[cch - 4], L".HLP") == 0) + { + /* Open the old-style help */ + TRACE("szHelpFile: %s\n", debugstr_w(szHelpFile)); + WinHelpW(NULL, szHelpFile, HELP_FINDER, 0); + } + else + { + /* Open the new-style help */ + FIXME("(%p, %p, %p): %s\n", pimeui, wParam, lParam, debugstr_w(szHelpFile)); + ret = FALSE; + } + } + + return ret; +} + +/* Handles WM_IME_SYSTEM message of the default IME window. */ +/* Win: ImeSystemHandler */ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) { LRESULT ret = 0; @@ -571,7 +624,7 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) switch (wParam) { - case 0x05: + case IMS_NOTIFYIMESHOW: if (User32GetImeShowStatus() == !lParam) { hImeWnd = UserHMGetHandle(pimeui->spwnd); @@ -579,7 +632,7 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) } break; - case 0x06: + case IMS_UPDATEIMEUI: if (!hIMC) break; @@ -610,7 +663,7 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) } break; - case 0x09: + case IMS_SETCANDFORM: pIC = IMM_FN(ImmLockIMC)(hIMC); if (!pIC) break; @@ -620,7 +673,7 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) IMM_FN(ImmUnlockIMC)(hIMC); break; - case 0x0A: + case IMS_SETCOMPFONT: pIC = IMM_FN(ImmLockIMC)(hIMC); if (!pIC) break; @@ -629,7 +682,7 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) IMM_FN(ImmUnlockIMC)(hIMC); break; - case 0x0B: + case IMS_SETCOMPFORM: pIC = IMM_FN(ImmLockIMC)(hIMC); if (!pIC) break; @@ -640,31 +693,30 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) IMM_FN(ImmUnlockIMC)(hIMC); break; - case 0x0D: + case IMS_CONFIGURE: IMM_FN(ImmConfigureIMEW)((HKL)lParam, pimeui->hwndIMC, IME_CONFIG_GENERAL, NULL); break; - case 0x0F: + case IMS_SETOPENSTATUS: if (hIMC) IMM_FN(ImmSetOpenStatus)(hIMC, (BOOL)lParam); break; - case 0x11: + case IMS_FREELAYOUT: ret = IMM_FN(ImmFreeLayout)((DWORD)lParam); break; case 0x13: - // TODO: + FIXME("\n"); break; - case 0x14: + case IMS_GETCONVSTATUS: IMM_FN(ImmGetConversionStatus)(hIMC, &dwConversion, &dwSentence); ret = dwConversion; break; - case 0x15: - // TODO: - break; + case IMS_IMEHELP: + return User32DoImeHelp(pimeui, wParam, lParam); case IMS_IMEACTIVATE: User32SetImeActivenessOfWindow((HWND)lParam, TRUE); @@ -683,18 +735,24 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) break; case 0x1D: - // TODO: + FIXME("\n"); break; - case 0x1E: + case IMS_GETCONTEXT: ret = (ULONG_PTR)IMM_FN(ImmGetContext)((HWND)lParam); break; - case 0x1F: - case 0x20: + case IMS_SENDNOTIFICATION: + case IMS_COMPLETECOMPSTR: + case IMS_SETLANGBAND: + case IMS_UNSETLANGBAND: ret = IMM_FN(ImmSystemHandler)(hIMC, wParam, lParam); break; + case IMS_LOADTHREADLAYOUT: + CtfLoadThreadLayout(pimeui); + break; + default: break; } @@ -702,7 +760,8 @@ static LRESULT ImeWnd_OnImeSystem(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) return ret; } -// Win: ImeSetContextHandler +/* Handles WM_IME_SETCONTEXT message of the default IME window. */ +/* Win: ImeSetContextHandler */ LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) { LRESULT ret; @@ -856,7 +915,8 @@ LRESULT ImeWnd_OnImeSetContext(PIMEUI pimeui, WPARAM wParam, LPARAM lParam) return ret; } -// Win: ImeWndProcWorker(hwnd, msg, wParam, lParam, !unicode) +/* The window procedure of the default IME window */ +/* Win: ImeWndProcWorker(hwnd, msg, wParam, lParam, !unicode) */ LRESULT WINAPI ImeWndProc_common(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode) // ReactOS {
2 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] Renaming around ImmSystemHandler (#4602)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5fa84035cfafd535fe8b8…
commit 5fa84035cfafd535fe8b8baeef49565f2b931ca7 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Aug 12 09:17:46 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Aug 12 09:17:46 2022 +0900 [IMM32] Renaming around ImmSystemHandler (#4602) - s/IMM_UNKNOWN_PROCESS1/IMM_DELAY_SET_LANG_BAND/ - s/Imm32UnknownProcess1Proc/Imm32DelaySetLangBandProc/ (Win: DelaySetLangBand) - s/Imm32UnknownProcess1/CtfImmSetLangBand/ (Win: CtfImmSetLangBand) - s/Imm32SendChangeProc/Imm32SendNotificationProc/ (Win: SendNotificationProc) - s/Imm32SendChange/Imm32SendNotification/ (Win: ImmSendNotification) CORE-11700 --- dll/win32/imm32/keymsg.c | 53 ++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/dll/win32/imm32/keymsg.c b/dll/win32/imm32/keymsg.c index 2101fcb9afb..e2d41141063 100644 --- a/dll/win32/imm32/keymsg.c +++ b/dll/win32/imm32/keymsg.c @@ -179,7 +179,7 @@ BOOL APIENTRY Imm32KEnglish(HIMC hIMC) return TRUE; } -// Win: HotKeyIDDispatcher +/* Win: HotKeyIDDispatcher */ BOOL APIENTRY Imm32ProcessHotKey(HWND hWnd, HIMC hIMC, HKL hKL, DWORD dwHotKeyID) { PIMEDPI pImeDpi; @@ -236,7 +236,7 @@ BOOL APIENTRY Imm32ProcessHotKey(HWND hWnd, HIMC hIMC, HKL hKL, DWORD dwHotKeyID return ret; } -// Win: ImmIsUIMessageWorker +/* Win: ImmIsUIMessageWorker */ static BOOL APIENTRY ImmIsUIMessageAW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAnsi) { @@ -261,36 +261,39 @@ ImmIsUIMessageAW(HWND hWndIME, UINT msg, WPARAM wParam, LPARAM lParam, BOOL bAns return TRUE; } -typedef struct IMM_UNKNOWN_PROCESS1 +typedef struct IMM_DELAY_SET_LANG_BAND { HWND hWnd; BOOL fFlag; -} IMM_UNKNOWN_PROCESS1, *PIMM_UNKNOWN_PROCESS1; +} IMM_DELAY_SET_LANG_BAND, *PIMM_DELAY_SET_LANG_BAND; -static DWORD WINAPI Imm32UnknownProcess1Proc(LPVOID arg) +/* Win: DelaySetLangBand */ +static DWORD APIENTRY Imm32DelaySetLangBandProc(LPVOID arg) { HWND hwndDefIME; UINT uValue; DWORD_PTR lResult; - PIMM_UNKNOWN_PROCESS1 pUnknown = arg; + PIMM_DELAY_SET_LANG_BAND pSetBand = arg; - Sleep(3000); - hwndDefIME = ImmGetDefaultIMEWnd(pUnknown->hWnd); + Sleep(3000); /* Delay 3 seconds! */ + + hwndDefIME = ImmGetDefaultIMEWnd(pSetBand->hWnd); if (hwndDefIME) { - uValue = (pUnknown->fFlag ? 0x23 : 0x24); - SendMessageTimeoutW(hwndDefIME, WM_IME_SYSTEM, uValue, (LPARAM)pUnknown->hWnd, + uValue = (pSetBand->fFlag ? 0x23 : 0x24); + SendMessageTimeoutW(hwndDefIME, WM_IME_SYSTEM, uValue, (LPARAM)pSetBand->hWnd, SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, &lResult); } - ImmLocalFree(pUnknown); + ImmLocalFree(pSetBand); return FALSE; } -LRESULT APIENTRY Imm32UnknownProcess1(HWND hWnd, BOOL fFlag) +/* Win: CtfImmSetLangBand */ +LRESULT APIENTRY CtfImmSetLangBand(HWND hWnd, BOOL fFlag) { HANDLE hThread; PWND pWnd = NULL; - PIMM_UNKNOWN_PROCESS1 pUnknown1; + PIMM_DELAY_SET_LANG_BAND pSetBand; DWORD_PTR lResult = 0; if (hWnd && gpsi) @@ -305,20 +308,21 @@ LRESULT APIENTRY Imm32UnknownProcess1(HWND hWnd, BOOL fFlag) return lResult; } - pUnknown1 = ImmLocalAlloc(0, sizeof(IMM_UNKNOWN_PROCESS1)); - if (!pUnknown1) + pSetBand = ImmLocalAlloc(0, sizeof(IMM_DELAY_SET_LANG_BAND)); + if (!pSetBand) return 0; - pUnknown1->hWnd = hWnd; - pUnknown1->fFlag = fFlag; + pSetBand->hWnd = hWnd; + pSetBand->fFlag = fFlag; - hThread = CreateThread(NULL, 0, Imm32UnknownProcess1Proc, pUnknown1, 0, NULL); + hThread = CreateThread(NULL, 0, Imm32DelaySetLangBandProc, pSetBand, 0, NULL); if (hThread) CloseHandle(hThread); return 0; } -static BOOL CALLBACK Imm32SendChangeProc(HIMC hIMC, LPARAM lParam) +/* Win: SendNotificationProc */ +static BOOL CALLBACK Imm32SendNotificationProc(HIMC hIMC, LPARAM lParam) { HWND hWnd; LPINPUTCONTEXTDX pIC; @@ -345,9 +349,10 @@ Quit: return TRUE; } -BOOL APIENTRY Imm32SendChange(BOOL bProcess) +/* Win: ImmSendNotification */ +BOOL APIENTRY Imm32SendNotification(BOOL bProcess) { - return ImmEnumInputContext((bProcess ? -1 : 0), Imm32SendChangeProc, 0); + return ImmEnumInputContext((bProcess ? -1 : 0), Imm32SendNotificationProc, 0); } VOID APIENTRY Imm32RequestError(DWORD dwError) @@ -557,7 +562,7 @@ Quit: return ret; } -// Win: ImmRequestMessageWorker +/* Win: ImmRequestMessageWorker */ LRESULT APIENTRY ImmRequestMessageAW(HIMC hIMC, WPARAM wParam, LPARAM lParam, BOOL bAnsi) { LRESULT ret = 0; @@ -758,7 +763,7 @@ LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam) switch (wParam) { case 0x1f: - Imm32SendChange((BOOL)lParam); + Imm32SendNotification((BOOL)lParam); return 0; case 0x20: @@ -766,7 +771,7 @@ LRESULT WINAPI ImmSystemHandler(HIMC hIMC, WPARAM wParam, LPARAM lParam) return 0; case 0x23: case 0x24: - return Imm32UnknownProcess1((HWND)lParam, (wParam == 0x23)); + return CtfImmSetLangBand((HWND)lParam, (wParam == 0x23)); default: return 0;
2 years, 4 months
1
0
0
0
[reactos] 01/01: [USER32] Refactoring on LoadKeyboardLayout(W/Ex) (#4601)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1381cea2a73245002c09e…
commit 1381cea2a73245002c09ee3f3a743dd6b7111589 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Aug 12 09:16:18 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Aug 12 09:16:18 2022 +0900 [USER32] Refactoring on LoadKeyboardLayout(W/Ex) (#4601) - Add IntLoadKeyboardLayout (Win: LoadKeyboardLayoutWorker) helper function. - Use it in LoadKeyboardLayoutW and LoadKeyboardLayoutEx functions. CORE-11700 --- win32ss/user/user32/misc/stubs.c | 9 --------- win32ss/user/user32/windows/input.c | 38 +++++++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/win32ss/user/user32/misc/stubs.c b/win32ss/user/user32/misc/stubs.c index 8199c0222f7..bb1754b781f 100644 --- a/win32ss/user/user32/misc/stubs.c +++ b/win32ss/user/user32/misc/stubs.c @@ -441,15 +441,6 @@ BOOL WINAPI IsServerSideWindow(HWND wnd) return FALSE; } -/* - * @unimplemented - */ -HKL WINAPI LoadKeyboardLayoutEx(DWORD unknown,LPCWSTR pwszKLID,UINT Flags) //1st parameter unknown -{ - UNIMPLEMENTED; - return FALSE; -} - /* * @unimplemented */ diff --git a/win32ss/user/user32/windows/input.c b/win32ss/user/user32/windows/input.c index 1de1dc0f293..dd396999e3b 100644 --- a/win32ss/user/user32/windows/input.c +++ b/win32ss/user/user32/windows/input.c @@ -639,11 +639,16 @@ LoadKeyboardLayoutA(LPCSTR pszKLID, } /* - * @implemented + * @unimplemented */ -HKL WINAPI -LoadKeyboardLayoutW(LPCWSTR pwszKLID, - UINT Flags) +/* Win: LoadKeyboardLayoutWorker */ +HKL APIENTRY +IntLoadKeyboardLayout( + _In_ HKL hklUnload, + _In_z_ LPCWSTR pwszKLID, + _In_ LANGID wLangID, + _In_ UINT Flags, + _In_ BOOL unknown5) { DWORD dwhkl, dwType, dwSize; UNICODE_STRING ustrKbdName; @@ -712,6 +717,31 @@ LoadKeyboardLayoutW(LPCWSTR pwszKLID, dwhkl, Flags); } +/* + * @implemented + */ +HKL WINAPI +LoadKeyboardLayoutW(LPCWSTR pwszKLID, + UINT Flags) +{ + TRACE("(%s, 0x%X)", debugstr_w(pwszKLID), Flags); + return IntLoadKeyboardLayout(NULL, pwszKLID, 0, Flags, FALSE); +} + +/* + * @unimplemented + */ +HKL WINAPI +LoadKeyboardLayoutEx(HKL hklUnload, + LPCWSTR pwszKLID, + UINT Flags) +{ + FIXME("(%p, %s, 0x%X)", hklUnload, debugstr_w(pwszKLID), Flags); + if (!hklUnload) + return NULL; + return IntLoadKeyboardLayout(hklUnload, pwszKLID, 0, Flags, FALSE); +} + /* * @implemented */
2 years, 4 months
1
0
0
0
[reactos] 01/01: [KERNEL32] lpNumberOfCharsWritten is optional for WriteConsole (#1079)
by Andrew Boyarshin
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c15a9c1d097cfd5c10c36…
commit c15a9c1d097cfd5c10c361a24981ff215fcd4153 Author: Andrew Boyarshin <andrew.boyarshin(a)gmail.com> AuthorDate: Fri Aug 12 06:58:18 2022 +0700 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Aug 12 01:58:18 2022 +0200 [KERNEL32] lpNumberOfCharsWritten is optional for WriteConsole (#1079) Some applications (and libraries, like replxx) rely on this undocumented behavior. --- dll/win32/kernel32/client/console/readwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dll/win32/kernel32/client/console/readwrite.c b/dll/win32/kernel32/client/console/readwrite.c index b06f7ab8299..00fbf7761cb 100644 --- a/dll/win32/kernel32/client/console/readwrite.c +++ b/dll/win32/kernel32/client/console/readwrite.c @@ -681,8 +681,8 @@ IntWriteConsole(IN HANDLE hConsoleOutput, /* Release the capture buffer if needed */ if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer); - /* Retrieve the results */ - if (Success) + /* Retrieve the results. NOTE: lpNumberOfCharsWritten optional since Vista+ */ + if (Success && lpNumberOfCharsWritten) { _SEH2_TRY { @@ -695,7 +695,7 @@ IntWriteConsole(IN HANDLE hConsoleOutput, } _SEH2_END; } - else + else if (!Success) { BaseSetLastNTError(ApiMessage.Status); }
2 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] Implement ImmWINNLSEnableIME (#4599)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=934e5212e4cf36fa1467a…
commit 934e5212e4cf36fa1467a30fab3e82ce46208ad9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Aug 9 20:09:23 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Aug 9 20:09:23 2022 +0900 [IMM32] Implement ImmWINNLSEnableIME (#4599) - Implement imm32!ImmWINNLSEnableIME function. - Rename CLIENTIMC_UNKNOWN3 flag as CLIENTIMC_DISABLEIME. - Modify imm32.spec. CORE-11700 --- dll/win32/imm32/ime.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++ dll/win32/imm32/imm.c | 2 +- dll/win32/imm32/imm32.spec | 2 +- win32ss/include/ntuser.h | 2 +- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/dll/win32/imm32/ime.c b/dll/win32/imm32/ime.c index 30fc0af9203..79c40435188 100644 --- a/dll/win32/imm32/ime.c +++ b/dll/win32/imm32/ime.c @@ -1993,3 +1993,57 @@ ImmGetImeMenuItemsW(HIMC hIMC, DWORD dwFlags, DWORD dwType, hIMC, dwFlags, dwType, lpImeParentMenu, lpImeMenu, dwSize); return ImmGetImeMenuItemsAW(hIMC, dwFlags, dwType, lpImeParentMenu, lpImeMenu, dwSize, FALSE); } + +/*********************************************************************** + * ImmWINNLSEnableIME (IMM32.@) + */ +BOOL WINAPI ImmWINNLSEnableIME(HWND hWnd, BOOL enable) +{ + HIMC hIMC; + PCLIENTIMC pClientImc; + HWND hImeWnd; + BOOL bImeWnd, ret; + + TRACE("(%p, %d)\n", hWnd, enable); + + if (!Imm32IsSystemJapaneseOrKorean()) + { + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } + + hIMC = (HIMC)NtUserGetThreadState(THREADSTATE_DEFAULTINPUTCONTEXT); + if (!hIMC) + return FALSE; + + pClientImc = ImmLockClientImc(hIMC); + if (!pClientImc) + return FALSE; + + ret = !(pClientImc->dwFlags & CLIENTIMC_DISABLEIME); + if (!!enable == ret) + { + ImmUnlockClientImc(pClientImc); + return ret; + } + + if (!IsWindow(hWnd)) + hWnd = GetFocus(); + + hImeWnd = ImmGetDefaultIMEWnd(hWnd); + bImeWnd = IsWindow(hImeWnd); + if (bImeWnd) + ImmSetActiveContext(hWnd, (enable ? NULL : hIMC), FALSE); + + if (enable) + pClientImc->dwFlags &= ~CLIENTIMC_DISABLEIME; + else + pClientImc->dwFlags |= CLIENTIMC_DISABLEIME; + + ImmUnlockClientImc(pClientImc); + + if (bImeWnd) + ImmSetActiveContext(hWnd, (enable ? hIMC : NULL), TRUE); + + return ret; +} diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index c4cb95a1da1..94a1afcd488 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -998,7 +998,7 @@ Quit: pClientImc = ImmLockClientImc(hIMC); if (pClientImc == NULL) return NULL; - if ((dwContextFlags & 2) && (pClientImc->dwFlags & CLIENTIMC_UNKNOWN3)) + if ((dwContextFlags & 2) && (pClientImc->dwFlags & CLIENTIMC_DISABLEIME)) hIMC = NULL; ImmUnlockClientImc(pClientImc); return hIMC; diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec index 0764e8dd0e5..78316f2a447 100644 --- a/dll/win32/imm32/imm32.spec +++ b/dll/win32/imm32/imm32.spec @@ -114,6 +114,6 @@ @ stdcall ImmUnlockImeDpi(ptr) @ stdcall ImmUnregisterWordA(long str long str) @ stdcall ImmUnregisterWordW(long wstr long wstr) -@ stdcall -stub ImmWINNLSEnableIME(ptr long) +@ stdcall ImmWINNLSEnableIME(ptr long) @ stdcall ImmWINNLSGetEnableStatus(ptr) @ stdcall ImmWINNLSGetIMEHotkey(ptr) diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h index 531d83392ef..924a0bef195 100644 --- a/win32ss/include/ntuser.h +++ b/win32ss/include/ntuser.h @@ -1326,7 +1326,7 @@ C_ASSERT(sizeof(CLIENTIMC) == 0x34); #define CLIENTIMC_UNKNOWN5 0x2 #define CLIENTIMC_UNKNOWN4 0x20 #define CLIENTIMC_DESTROY 0x40 -#define CLIENTIMC_UNKNOWN3 0x80 +#define CLIENTIMC_DISABLEIME 0x80 #define CLIENTIMC_UNKNOWN2 0x100 DWORD
2 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER] Security: Follow-up of #4595 (#4598)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d519b11a286819d9d00e9…
commit d519b11a286819d9d00e986ed07778a17790f7ed Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Aug 8 21:23:49 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Aug 8 21:23:49 2022 +0900 [NTUSER] Security: Follow-up of #4595 (#4598) Improve security. CORE-11700 --- win32ss/user/ntuser/kbdlayout.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c index a91a641e994..09e0f677f38 100644 --- a/win32ss/user/ntuser/kbdlayout.c +++ b/win32ss/user/ntuser/kbdlayout.c @@ -654,7 +654,8 @@ NtUserGetKeyboardLayoutName( BOOL bRet = FALSE; PKL pKl; PTHREADINFO pti; - UNICODE_STRING ustrTemp; + UNICODE_STRING ustrNameSafe; + NTSTATUS Status; UserEnterShared(); @@ -667,24 +668,32 @@ NtUserGetKeyboardLayoutName( _SEH2_TRY { ProbeForWriteUnicodeString(pustrName); - ProbeForWrite(pustrName->Buffer, pustrName->MaximumLength, 1); + ustrNameSafe = *pustrName; + + ProbeForWrite(ustrNameSafe.Buffer, ustrNameSafe.MaximumLength, 1); if (IS_IME_HKL(pKl->hkl)) { - RtlIntegerToUnicodeString((ULONG)(ULONG_PTR)pKl->hkl, 16, pustrName); + Status = RtlIntegerToUnicodeString((ULONG)(ULONG_PTR)pKl->hkl, 16, &ustrNameSafe); } else { - if (pustrName->MaximumLength < KL_NAMELENGTH * sizeof(WCHAR)) + if (ustrNameSafe.MaximumLength < KL_NAMELENGTH * sizeof(WCHAR)) { EngSetLastError(ERROR_INVALID_PARAMETER); goto cleanup; } - RtlInitUnicodeString(&ustrTemp, pKl->spkf->awchKF); /* FIXME: Do not use awchKF */ - RtlCopyUnicodeString(pustrName, &ustrTemp); + + /* FIXME: Do not use awchKF */ + ustrNameSafe.Length = 0; + Status = RtlAppendUnicodeToString(&ustrNameSafe, pKl->spkf->awchKF); } - bRet = TRUE; + if (NT_SUCCESS(Status)) + { + *pustrName = ustrNameSafe; + bRet = TRUE; + } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
2 years, 4 months
1
0
0
0
[reactos] 01/01: [SHELL32] Fix "Fonts" and "Administrative Tools" icon incorrectly displayed after 8d520f3 (#4597)
by Thamatip Chitpong
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7d068e2bd15633b7a403…
commit f7d068e2bd15633b7a40397ccc3a664fb3c855cf Author: Thamatip Chitpong <tangaming123456(a)outlook.com> AuthorDate: Mon Aug 8 16:46:20 2022 +0700 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Aug 8 18:46:20 2022 +0900 [SHELL32] Fix "Fonts" and "Administrative Tools" icon incorrectly displayed after 8d520f3 (#4597) CORE-18251 --- dll/win32/shell32/res/rgs/adminfoldershortcut.rgs | 2 +- dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/shell32/res/rgs/adminfoldershortcut.rgs b/dll/win32/shell32/res/rgs/adminfoldershortcut.rgs index bc66450a2af..7ba6ee8b348 100644 --- a/dll/win32/shell32/res/rgs/adminfoldershortcut.rgs +++ b/dll/win32/shell32/res/rgs/adminfoldershortcut.rgs @@ -7,7 +7,7 @@ HKCR val '{305CA226-D286-468e-B848-2B2E8E697B74} 2' = d '5' val InfoTip = e '@%%SystemRoot%%\system32\SHELL32.dll,-22921' val LocalizedString = e '@%%SystemRoot%%\system32\SHELL32.dll,-22982' - DefaultIcon = e '%%SystemRoot%%\system32\main.cpl,10' + DefaultIcon = e '%%SystemRoot%%\system32\main.cpl,-500' InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment' diff --git a/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs b/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs index 5ab751d1342..eb4ed407b7e 100644 --- a/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs +++ b/dll/win32/shell32/res/rgs/fontsfoldershortcut.rgs @@ -7,7 +7,7 @@ HKCR val '{305CA226-D286-468e-B848-2B2E8E697B74} 2' = d '&Hffffffff' val InfoTip = e '@%%SystemRoot%%\system32\SHELL32.dll,-22920' val LocalizedString = e '@%%SystemRoot%%\system32\SHELL32.dll,-22981' - DefaultIcon = e '%%SystemRoot%%\system32\main.cpl,9' + DefaultIcon = e '%%SystemRoot%%\system32\main.cpl,-400' InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Apartment'
2 years, 4 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
Results per page:
10
25
50
100
200