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: [KBSWITCH] Use StringCchCopy instead of lstrcpyn
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3892252bc548a76f3c4ac…
commit 3892252bc548a76f3c4ac66aed04b3927a9e0c99 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 24 10:23:51 2022 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 24 10:23:51 2022 +0900 [KBSWITCH] Use StringCchCopy instead of lstrcpyn --- base/applications/kbswitch/kbswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/kbswitch/kbswitch.c b/base/applications/kbswitch/kbswitch.c index cc9338c7ed0..09f4829eb19 100644 --- a/base/applications/kbswitch/kbswitch.c +++ b/base/applications/kbswitch/kbswitch.c @@ -59,7 +59,7 @@ CreateTrayIcon(LPTSTR szLCID) ZeroMemory(&lf, sizeof(lf)); lf.lfHeight = -11; lf.lfCharSet = ANSI_CHARSET; - lstrcpyn(lf.lfFaceName, _T("Tahoma"), ARRAYSIZE(lf.lfFaceName)); + StringCchCopy(lf.lfFaceName, ARRAYSIZE(lf.lfFaceName), _T("Tahoma")); hFont = CreateFontIndirect(&lf); SetRect(&rect, 0, 0, CX_ICON, CY_ICON);
2 years, 4 months
1
0
0
0
[reactos] 01/01: [KBSWITCH] Refactor CreateTrayIcon
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0991cedca782f770e41bf…
commit 0991cedca782f770e41bf991815d7d57f93ba1fd Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 24 10:21:50 2022 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 24 10:21:50 2022 +0900 [KBSWITCH] Refactor CreateTrayIcon --- base/applications/kbswitch/kbswitch.c | 105 +++++++++++++++++----------------- 1 file changed, 51 insertions(+), 54 deletions(-) diff --git a/base/applications/kbswitch/kbswitch.c b/base/applications/kbswitch/kbswitch.c index 5039e087b61..cc9338c7ed0 100644 --- a/base/applications/kbswitch/kbswitch.c +++ b/base/applications/kbswitch/kbswitch.c @@ -10,6 +10,8 @@ #include "kbswitch.h" #define WM_NOTIFYICONMSG (WM_USER + 248) +#define CX_ICON 16 +#define CY_ICON 16 PKBSWITCHSETHOOKS KbSwitchSetHooks = NULL; PKBSWITCHDELETEHOOKS KbSwitchDeleteHooks = NULL; @@ -30,70 +32,65 @@ ULONG ulCurrentLayoutNum = 1; static HICON CreateTrayIcon(LPTSTR szLCID) { - LANGID lId; + LANGID LangID; TCHAR szBuf[3]; - HDC hdc, hdcsrc; - HBITMAP hBitmap, hBmpNew, hBmpOld; + HDC hdc; + HBITMAP hbmColor, hbmMono, hBmpOld; RECT rect; HFONT hFontOld, hFont = NULL; ICONINFO IconInfo; HICON hIcon = NULL; + LOGFONT lf; - lId = (LANGID)_tcstoul(szLCID, NULL, 16); - if (GetLocaleInfo(lId, - LOCALE_SISO639LANGNAME, - szBuf, - ARRAYSIZE(szBuf)) == 0) + /* Getting "EN", "FR", etc. from English, French, ... */ + LangID = (LANGID)_tcstoul(szLCID, NULL, 16); + if (!GetLocaleInfo(LangID, LOCALE_SISO639LANGNAME, szBuf, ARRAYSIZE(szBuf))) { StringCchCopy(szBuf, ARRAYSIZE(szBuf), _T("??")); } - - hdcsrc = GetDC(NULL); - hdc = CreateCompatibleDC(hdcsrc); - hBitmap = CreateCompatibleBitmap(hdcsrc, 16, 16); - ReleaseDC(NULL, hdcsrc); - - if (hdc && hBitmap) - { - hBmpNew = CreateBitmap(16, 16, 1, 1, NULL); - if (hBmpNew) - { - hBmpOld = SelectObject(hdc, hBitmap); - rect.right = 16; - rect.left = 0; - rect.bottom = 16; - rect.top = 0; - - SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); - SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); - - ExtTextOut(hdc, rect.left, rect.top, ETO_OPAQUE, &rect, _T(""), 0, NULL); - - hFont = CreateFont(-11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, - OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, - DEFAULT_QUALITY, FF_DONTCARE, _T("Tahoma")); - - hFontOld = SelectObject(hdc, hFont); - DrawText(hdc, _tcsupr(szBuf), 2, &rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER); - SelectObject(hdc, hBmpNew); - PatBlt(hdc, 0, 0, 16, 16, BLACKNESS); - SelectObject(hdc, hBmpOld); - SelectObject(hdc, hFontOld); - - IconInfo.hbmColor = hBitmap; - IconInfo.hbmMask = hBmpNew; - IconInfo.fIcon = TRUE; - - hIcon = CreateIconIndirect(&IconInfo); - - DeleteObject(hBmpNew); - DeleteObject(hBmpOld); - DeleteObject(hFont); - } - } - + CharUpper(szBuf); + + /* Create hdc, hbmColor and hbmMono */ + hdc = CreateCompatibleDC(NULL); + hbmColor = CreateCompatibleBitmap(hdc, CX_ICON, CY_ICON); + hbmMono = CreateBitmap(CX_ICON, CY_ICON, 1, 1, NULL); + + /* Create a font */ + ZeroMemory(&lf, sizeof(lf)); + lf.lfHeight = -11; + lf.lfCharSet = ANSI_CHARSET; + lstrcpyn(lf.lfFaceName, _T("Tahoma"), ARRAYSIZE(lf.lfFaceName)); + hFont = CreateFontIndirect(&lf); + + SetRect(&rect, 0, 0, CX_ICON, CY_ICON); + + /* Draw hbmColor */ + hBmpOld = SelectObject(hdc, hbmColor); + SetDCBrushColor(hdc, GetSysColor(COLOR_HIGHLIGHT)); + FillRect(hdc, &rect, (HBRUSH)GetStockObject(DC_BRUSH)); + hFontOld = SelectObject(hdc, hFont); + SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); + SetBkMode(hdc, TRANSPARENT); + DrawText(hdc, szBuf, 2, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); + SelectObject(hdc, hFontOld); + SelectObject(hdc, hBmpOld); + + /* Fill hbmMono by black */ + hBmpOld = SelectObject(hdc, hbmMono); + PatBlt(hdc, 0, 0, CX_ICON, CY_ICON, BLACKNESS); + SelectObject(hdc, hBmpOld); + + /* Create an icon from hbmColor and hbmMono */ + IconInfo.hbmColor = hbmColor; + IconInfo.hbmMask = hbmMono; + IconInfo.fIcon = TRUE; + hIcon = CreateIconIndirect(&IconInfo); + + /* Clean up */ + DeleteObject(hbmColor); + DeleteObject(hbmMono); + DeleteObject(hFont); DeleteDC(hdc); - DeleteObject(hBitmap); return hIcon; }
2 years, 4 months
1
0
0
0
[reactos] 01/01: [KBSWITCH] Fix menu handle leak
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f974f0288109581ff5d0d…
commit f974f0288109581ff5d0dbf9f1e1c11092d0ebb3 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 24 09:11:36 2022 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Aug 24 09:11:36 2022 +0900 [KBSWITCH] Fix menu handle leak --- base/applications/kbswitch/kbswitch.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/base/applications/kbswitch/kbswitch.c b/base/applications/kbswitch/kbswitch.c index 5057fda8e42..5039e087b61 100644 --- a/base/applications/kbswitch/kbswitch.c +++ b/base/applications/kbswitch/kbswitch.c @@ -437,7 +437,8 @@ VOID DoUnregisterAltShiftHotKeys(HWND hwnd) LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { - static HMENU hRightPopupMenu; + static HMENU s_hMenu; + static HMENU s_hRightPopupMenu; static UINT s_uTaskbarRestart; switch (Message) @@ -446,7 +447,9 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { SetHooks(); AddTrayIcon(hwnd); - hRightPopupMenu = GetSubMenu(LoadMenu(hInst, MAKEINTRESOURCE(IDR_POPUP)), 0); + + s_hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_POPUP)); + s_hRightPopupMenu = GetSubMenu(s_hMenu, 0); ActivateLayout(hwnd, ulCurrentLayoutNum); s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated")); @@ -502,7 +505,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) } else { - TrackPopupMenu(hRightPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL); + TrackPopupMenu(s_hRightPopupMenu, 0, pt.x, pt.y, 0, hwnd, NULL); } PostMessage(hwnd, WM_NULL, 0, 0); @@ -558,7 +561,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { DoUnregisterAltShiftHotKeys(hwnd); DeleteHooks(); - DestroyMenu(hRightPopupMenu); + DestroyMenu(s_hMenu); DelTrayIcon(hwnd); PostQuitMessage(0);
2 years, 4 months
1
0
0
0
[reactos] 01/01: [KBSWITCH][NTUSER] Realize Shift+Alt language switch (#4622)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4f73f040f1c329b4fdc2…
commit b4f73f040f1c329b4fdc2c46efd600c2f538a411 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Aug 24 07:31:46 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Aug 24 07:31:46 2022 +0900 [KBSWITCH][NTUSER] Realize Shift+Alt language switch (#4622) - Fix co_UserProcessHotKeys on modifiers-only hot-keys. - Add Alt+Shift hot-keys to kbswitch window. CORE-11737 --- base/applications/kbswitch/kbswitch.c | 37 ++++++++++++++++++++++++++++++++--- win32ss/user/ntuser/hotkey.c | 4 +++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/base/applications/kbswitch/kbswitch.c b/base/applications/kbswitch/kbswitch.c index 61fa5cc4cb8..5057fda8e42 100644 --- a/base/applications/kbswitch/kbswitch.c +++ b/base/applications/kbswitch/kbswitch.c @@ -4,6 +4,7 @@ * PURPOSE: Switching Keyboard Layouts * PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org) * Colin Finck (mail(a)colinfinck.de) + * Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com) */ #include "kbswitch.h" @@ -13,7 +14,7 @@ PKBSWITCHSETHOOKS KbSwitchSetHooks = NULL; PKBSWITCHDELETEHOOKS KbSwitchDeleteHooks = NULL; UINT ShellHookMessage = 0; - +DWORD dwAltShiftHotKeyId = 0, dwShiftAltHotKeyId = 0; static BOOL GetLayoutID(LPTSTR szLayoutNum, LPTSTR szLCID, SIZE_T LCIDLength); @@ -414,6 +415,25 @@ UpdateLanguageDisplayCurrent(HWND hwnd, WPARAM wParam) return UpdateLanguageDisplay(hwnd, GetKeyboardLayout(GetWindowThreadProcessId((HWND)wParam, 0))); } +VOID DoRegisterAltShiftHotKeys(HWND hwnd) +{ + dwAltShiftHotKeyId = GlobalAddAtom(TEXT("ReactOS Alt+Shift")); + dwShiftAltHotKeyId = GlobalAddAtom(TEXT("ReactOS Shift+Alt")); + + RegisterHotKey(hwnd, dwAltShiftHotKeyId, MOD_ALT | MOD_SHIFT, VK_SHIFT); + RegisterHotKey(hwnd, dwShiftAltHotKeyId, MOD_ALT | MOD_SHIFT, VK_MENU); +} + +VOID DoUnregisterAltShiftHotKeys(HWND hwnd) +{ + UnregisterHotKey(hwnd, dwAltShiftHotKeyId); + UnregisterHotKey(hwnd, dwShiftAltHotKeyId); + + GlobalDeleteAtom(dwAltShiftHotKeyId); + GlobalDeleteAtom(dwShiftAltHotKeyId); + dwAltShiftHotKeyId = dwShiftAltHotKeyId = 0; +} + LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { @@ -431,6 +451,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) ActivateLayout(hwnd, ulCurrentLayoutNum); s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated")); + DoRegisterAltShiftHotKeys(hwnd); return 0; } @@ -439,10 +460,19 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) return UpdateLanguageDisplay(hwnd, (HKL)lParam); } - case WM_LOAD_LAYOUT: + case WM_HOTKEY: { - ActivateLayout(hwnd, GetNextLayout()); + if (wParam != dwAltShiftHotKeyId && wParam != dwShiftAltHotKeyId) + break; + /* FALL THROUGH */ + } + + case WM_LOAD_LAYOUT: + { + ULONG uNextNum = GetNextLayout(); + if (ulCurrentLayoutNum != uNextNum) + ActivateLayout(hwnd, uNextNum); return 0; } @@ -526,6 +556,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { + DoUnregisterAltShiftHotKeys(hwnd); DeleteHooks(); DestroyMenu(hRightPopupMenu); DelTrayIcon(hwnd); diff --git a/win32ss/user/ntuser/hotkey.c b/win32ss/user/ntuser/hotkey.c index 02b504fe668..e9e11772a11 100644 --- a/win32ss/user/ntuser/hotkey.c +++ b/win32ss/user/ntuser/hotkey.c @@ -211,7 +211,9 @@ co_UserProcessHotKeys(WORD wVk, BOOL bIsDown) if (IsModifier) { /* Modifier key up -- modifier-only keys are triggered here */ - pHotKey = IsHotKey(gfsModOnlyCandidate, 0); + pHotKey = IsHotKey(gfsModOnlyCandidate, wVk); + if (!pHotKey) + pHotKey = IsHotKey(gfsModOnlyCandidate, 0); gfsModOnlyCandidate = 0; } else
2 years, 4 months
1
0
0
0
[reactos] 01/01: [IMM32] Add CtfImmIsGuidMapEnable and CtfImmGetGuidAtom (#4621)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=372a445ad6de905ee5699…
commit 372a445ad6de905ee56992b7b5dedb804c2776b1 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Aug 23 21:57:45 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Aug 23 21:57:45 2022 +0900 [IMM32] Add CtfImmIsGuidMapEnable and CtfImmGetGuidAtom (#4621) - Add CtfImmIsGuidMapEnable and CtfImmGetGuidAtom functions. - Modify imetable.h and imm32.spec. CORE-11700 --- dll/win32/imm32/ctf.c | 75 +++++++++++++++++++++++++++++++++++++++++++++- dll/win32/imm32/imm32.spec | 2 ++ win32ss/include/imetable.h | 4 +-- 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/dll/win32/imm32/ctf.c b/dll/win32/imm32/ctf.c index 153d4c5e5fa..7c4c9dae4ac 100644 --- a/dll/win32/imm32/ctf.c +++ b/dll/win32/imm32/ctf.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS IMM32 * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) - * PURPOSE: Implementing IMM32 Cicero (modern input method) + * PURPOSE: Implementing the IMM32 Cicero-aware Text Framework (CTF) * COPYRIGHT: Copyright 2022 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ @@ -9,6 +9,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm); +/* + * NOTE: Microsoft CTF protocol has vulnerability. + * If insecure, we don't follow the dangerous design. + * + *
https://www.zdnet.com/article/vulnerability-in-microsoft-ctf-protocol-goes-…
+ *
https://googleprojectzero.blogspot.com/2019/08/down-rabbit-hole.html
+ */ + // Win: LoadCtfIme HMODULE APIENTRY Imm32LoadCtfIme(VOID) { @@ -95,3 +103,68 @@ LRESULT WINAPI CtfImmDispatchDefImeMessage(HWND hWnd, UINT uMsg, WPARAM wParam, FIXME("(%p, %u, %p, %p)\n", hWnd, uMsg, wParam, lParam); return 0; } + +/*********************************************************************** + * CtfImmIsGuidMapEnable(IMM32.@) + */ +BOOL WINAPI CtfImmIsGuidMapEnable(HIMC hIMC) +{ + DWORD dwThreadId; + HKL hKL; + PIMEDPI pImeDpi; + BOOL ret = FALSE; + + TRACE("(%p)\n", hIMC); + + if (!Imm32IsCiceroMode() || Imm32Is16BitMode()) + return ret; + + dwThreadId = (DWORD)NtUserQueryInputContext(hIMC, QIC_INPUTTHREADID); + hKL = GetKeyboardLayout(dwThreadId); + + if (IS_IME_HKL(hKL)) + return ret; + + pImeDpi = Imm32FindOrLoadImeDpi(hKL); + if (!pImeDpi) + return ret; + + if (pImeDpi->CtfImeIsGuidMapEnable) + ret = pImeDpi->CtfImeIsGuidMapEnable(hIMC); + + ImmUnlockImeDpi(pImeDpi); + return ret; +} + +/*********************************************************************** + * CtfImmGetGuidAtom(IMM32.@) + */ +HRESULT WINAPI CtfImmGetGuidAtom(HIMC hIMC, DWORD dwUnknown, LPDWORD pdwGuidAtom) +{ + HRESULT hr = E_FAIL; + PIMEDPI pImeDpi; + DWORD dwThreadId; + HKL hKL; + + TRACE("(%p, 0xlX, %p)\n", hIMC, dwUnknown, pdwGuidAtom); + + *pdwGuidAtom = 0; + + if (!Imm32IsCiceroMode() || Imm32Is16BitMode()) + return hr; + + dwThreadId = (DWORD)NtUserQueryInputContext(hIMC, QIC_INPUTTHREADID); + hKL = GetKeyboardLayout(dwThreadId); + if (IS_IME_HKL(hKL)) + return S_OK; + + pImeDpi = Imm32FindOrLoadImeDpi(hKL); + if (!pImeDpi) + return hr; + + if (pImeDpi->CtfImeGetGuidAtom) + hr = pImeDpi->CtfImeGetGuidAtom(hIMC, dwUnknown, pdwGuidAtom); + + ImmUnlockImeDpi(pImeDpi); + return hr; +} diff --git a/dll/win32/imm32/imm32.spec b/dll/win32/imm32/imm32.spec index 78316f2a447..77442f45829 100644 --- a/dll/win32/imm32/imm32.spec +++ b/dll/win32/imm32/imm32.spec @@ -4,6 +4,8 @@ @ stdcall CtfImmRestoreToolbarWnd(long) @ stdcall CtfImmHideToolbarWnd() @ stdcall CtfImmDispatchDefImeMessage(ptr long ptr ptr) +@ stdcall CtfImmIsGuidMapEnable(ptr) +@ stdcall CtfImmGetGuidAtom(ptr long ptr) @ stdcall ImmActivateLayout(ptr) @ stdcall ImmAssociateContext(ptr ptr) @ stdcall ImmAssociateContextEx(ptr ptr long) diff --git a/win32ss/include/imetable.h b/win32ss/include/imetable.h index 70bc982a6dc..d41c5af653d 100644 --- a/win32ss/include/imetable.h +++ b/win32ss/include/imetable.h @@ -18,5 +18,5 @@ DEFINE_IME_ENTRY(DWORD, ImeGetImeMenuItems, (HIMC hIMC, DWORD dwFlags, DWORD dwT DEFINE_IME_ENTRY(BOOL, CtfImeInquireExW, (LPIMEINFO lpIMEInfo, LPVOID lpszWndClass, DWORD dwSystemInfoFlags, HKL hKL), TRUE) DEFINE_IME_ENTRY(BOOL, CtfImeSelectEx, (HIMC hIMC, BOOL fSelect, HKL hKL), TRUE) DEFINE_IME_ENTRY(LRESULT, CtfImeEscapeEx, (HIMC hIMC, UINT uSubFunc, LPVOID lpData, HKL hKL), TRUE) -DEFINE_IME_ENTRY(DWORD, CtfImeGetGuidAtom, (VOID /* FIXME: unknown */), TRUE) -DEFINE_IME_ENTRY(DWORD, CtfImeIsGuidMapEnable, (VOID /* FIXME: unknown */), TRUE) +DEFINE_IME_ENTRY(HRESULT, CtfImeGetGuidAtom, (HIMC hIMC, DWORD dwUnknown, LPDWORD pdwGuidAtom), TRUE) +DEFINE_IME_ENTRY(BOOL, CtfImeIsGuidMapEnable, (HIMC hIMC), TRUE)
2 years, 4 months
1
0
0
0
[reactos] 01/01: [NTUSER] Use assignment-lock against THREADINFO.KeyboardLayout (#4620)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f34b8460e33fd64afa9ac…
commit f34b8460e33fd64afa9acc1fe3827dfedf00f2d9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Tue Aug 23 19:32:23 2022 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Tue Aug 23 19:32:23 2022 +0900 [NTUSER] Use assignment-lock against THREADINFO.KeyboardLayout (#4620) - Assignment and locking are managed by UserAssignmentLock/UserAssignmentUnlock. - Synchronize ClientInfo->hKL to pti->KeyboardLayout->hkl. CORE-11700, CORE-18317 --- win32ss/user/ntuser/ime.c | 1 + win32ss/user/ntuser/kbdlayout.c | 22 +++++++++------------- win32ss/user/ntuser/keyboard.c | 15 ++++++++++++--- win32ss/user/ntuser/main.c | 16 ++++++++-------- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/win32ss/user/ntuser/ime.c b/win32ss/user/ntuser/ime.c index 370854ad2e8..1cdabee6638 100644 --- a/win32ss/user/ntuser/ime.c +++ b/win32ss/user/ntuser/ime.c @@ -533,6 +533,7 @@ NtUserSetThreadLayoutHandles(HKL hNewKL, HKL hOldKL) pti->hklPrev = hOldKL; UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pNewKL); + pti->pClientInfo->hKL = pNewKL->hkl; Quit: UserLeave(); diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c index fde11969f9b..6a742b27377 100644 --- a/win32ss/user/ntuser/kbdlayout.c +++ b/win32ss/user/ntuser/kbdlayout.c @@ -583,16 +583,13 @@ co_UserActivateKbl(PTHREADINFO pti, PKL pKl, UINT Flags) PWND pWnd; pklPrev = pti->KeyboardLayout; - if (pklPrev) - UserDereferenceObject(pklPrev); - pti->KeyboardLayout = pKl; + UserAssignmentLock((PVOID*)&(pti->KeyboardLayout), pKl); pti->pClientInfo->hKL = pKl->hkl; - UserReferenceObject(pKl); if (Flags & KLF_SETFORPROCESS) { - // FIXME + FIXME("KLF_SETFORPROCESS\n"); } if (!(pWnd = pti->MessageQueue->spwndFocus)) @@ -631,7 +628,8 @@ IntImmActivateLayout( UserDerefObjectCo(pImeWnd); } - UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pKL); + UserAssignmentLock((PVOID*)&(pti->KeyboardLayout), pKL); + pti->pClientInfo->hKL = pKL->hkl; } /* Win: xxxInternalActivateKeyboardLayout */ @@ -658,7 +656,7 @@ co_UserActivateKeyboardLayout( if (uFlags & KLF_RESET) { - /* FIXME */ + FIXME("KLF_RESET\n"); } if (!(uFlags & KLF_SETFORPROCESS) && pKL == pti->KeyboardLayout) @@ -673,10 +671,11 @@ co_UserActivateKeyboardLayout( { UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pKL); ClientInfo->CodePage = pKL->CodePage; + ClientInfo->hKL = pKL->hkl; } else if (uFlags & KLF_SETFORPROCESS) { - /* FIXME */ + FIXME("KLF_SETFORPROCESS\n"); } else { @@ -685,11 +684,8 @@ co_UserActivateKeyboardLayout( else UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pKL); - if (!(pti->TIF_flags & TIF_INCLEANUP)) - { - ClientInfo->CodePage = pKL->CodePage; - ClientInfo->hKL = pKL->hkl; - } + ClientInfo->CodePage = pKL->CodePage; + ClientInfo->hKL = pKL->hkl; } if (gptiForeground && (gptiForeground->ppi == pti->ppi)) diff --git a/win32ss/user/ntuser/keyboard.c b/win32ss/user/ntuser/keyboard.c index 3ecc03ff433..3d427d1cb0b 100644 --- a/win32ss/user/ntuser/keyboard.c +++ b/win32ss/user/ntuser/keyboard.c @@ -1174,9 +1174,18 @@ IntTranslateKbdMessage(LPMSG lpMsg, if (!pti->KeyboardLayout) { - pti->KeyboardLayout = W32kGetDefaultKeyLayout(); - pti->pClientInfo->hKL = pti->KeyboardLayout ? pti->KeyboardLayout->hkl : NULL; - pKbdTbl = pti->KeyboardLayout ? pti->KeyboardLayout->spkf->pKbdTbl : NULL; + PKL pDefKL = W32kGetDefaultKeyLayout(); + UserAssignmentLock((PVOID*)&(pti->KeyboardLayout), pDefKL); + if (pDefKL) + { + pti->pClientInfo->hKL = pDefKL->hkl; + pKbdTbl = pDefKL->spkf->pKbdTbl; + } + else + { + pti->pClientInfo->hKL = NULL; + pKbdTbl = NULL; + } } else pKbdTbl = pti->KeyboardLayout->spkf->pKbdTbl; diff --git a/win32ss/user/ntuser/main.c b/win32ss/user/ntuser/main.c index 1010d7970ef..ea092317809 100644 --- a/win32ss/user/ntuser/main.c +++ b/win32ss/user/ntuser/main.c @@ -462,6 +462,7 @@ InitThreadCallback(PETHREAD Thread) NTSTATUS Status = STATUS_SUCCESS; PTEB pTeb; PRTL_USER_PROCESS_PARAMETERS ProcessParams; + PKL pDefKL; Process = Thread->ThreadsProcess; @@ -532,9 +533,8 @@ InitThreadCallback(PETHREAD Thread) goto error; } - ptiCurrent->KeyboardLayout = W32kGetDefaultKeyLayout(); - if (ptiCurrent->KeyboardLayout) - UserReferenceObject(ptiCurrent->KeyboardLayout); + pDefKL = W32kGetDefaultKeyLayout(); + UserAssignmentLock((PVOID*)&(ptiCurrent->KeyboardLayout), pDefKL); ptiCurrent->TIF_flags &= ~TIF_INCLEANUP; @@ -550,10 +550,10 @@ InitThreadCallback(PETHREAD Thread) pci->ppi = ptiCurrent->ppi; pci->fsHooks = ptiCurrent->fsHooks; pci->dwTIFlags = ptiCurrent->TIF_flags; - if (ptiCurrent->KeyboardLayout) + if (pDefKL) { - pci->hKL = ptiCurrent->KeyboardLayout->hkl; - pci->CodePage = ptiCurrent->KeyboardLayout->CodePage; + pci->hKL = pDefKL->hkl; + pci->CodePage = pDefKL->CodePage; } /* Need to pass the user Startup Information to the current process. */ @@ -829,8 +829,8 @@ ExitThreadCallback(PETHREAD Thread) /* Remove it from the list */ *ppti = ptiCurrent->ptiSibling; - if (ptiCurrent->KeyboardLayout) - UserDereferenceObject(ptiCurrent->KeyboardLayout); + if (!UserAssignmentUnlock((PVOID*)&(ptiCurrent->KeyboardLayout))) + ptiCurrent->pClientInfo->hKL = NULL; if (gptiForeground == ptiCurrent) {
2 years, 4 months
1
0
0
0
[reactos] 01/01: [BOOT][SDK:CMLIB] Compile a CMLIB for FreeLdr / NT bootloader with correct definitions. (#4619)
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5cadc268ef4056b6ce082…
commit 5cadc268ef4056b6ce08283b5d95604e37e02f27 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Aug 21 21:17:05 2022 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Aug 22 22:08:02 2022 +0200 [BOOT][SDK:CMLIB] Compile a CMLIB for FreeLdr / NT bootloader with correct definitions. (#4619) This also allows using the CMLIB with any reduced functionality that could be required at boot-time. --- boot/environ/CMakeLists.txt | 4 ++-- boot/freeldr/freeldr/CMakeLists.txt | 2 +- sdk/lib/cmlib/CMakeLists.txt | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/boot/environ/CMakeLists.txt b/boot/environ/CMakeLists.txt index 3874ed3f031..5406e4f7f08 100644 --- a/boot/environ/CMakeLists.txt +++ b/boot/environ/CMakeLists.txt @@ -101,7 +101,7 @@ endif() set_entrypoint(bootmgfw EfiEntry) -target_link_libraries(bootmgfw bootlib cportlib cmlib blrtl libcntpr) +target_link_libraries(bootmgfw bootlib cportlib blcmlib blrtl libcntpr) # dynamic analysis switches if(STACK_PROTECTOR) @@ -149,7 +149,7 @@ else() set_entrypoint(rosload OslMain) endif() -target_link_libraries(rosload bootlib cportlib cmlib blrtl libcntpr) +target_link_libraries(rosload bootlib cportlib blcmlib blrtl libcntpr) # dynamic analysis switches if(STACK_PROTECTOR) diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index c00416befbc..a295c481202 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -293,7 +293,7 @@ if(ARCH STREQUAL "i386") target_link_libraries(freeldr_pe mini_hal) endif() -target_link_libraries(freeldr_pe freeldr_common cportlib cmlib blrtl libcntpr) +target_link_libraries(freeldr_pe freeldr_common cportlib blcmlib blrtl libcntpr) # dynamic analysis switches if(STACK_PROTECTOR) diff --git a/sdk/lib/cmlib/CMakeLists.txt b/sdk/lib/cmlib/CMakeLists.txt index bcd2b6b5142..2ed0bc304b1 100644 --- a/sdk/lib/cmlib/CMakeLists.txt +++ b/sdk/lib/cmlib/CMakeLists.txt @@ -1,6 +1,5 @@ add_definitions( - -D_BLDR_ -D_NTSYSTEM_ -DNASSERT) @@ -19,10 +18,18 @@ list(APPEND SOURCE cmlib.h) if(CMAKE_CROSSCOMPILING) + # CMLIB for NT bootloader + add_library(blcmlib ${SOURCE}) + target_compile_definitions(blcmlib PRIVATE _BLDR_) + add_dependencies(blcmlib bugcodes xdk) + add_pch(blcmlib cmlib.h SOURCE) + + # CMLIB for NT kernel add_library(cmlib ${SOURCE}) add_dependencies(cmlib bugcodes xdk) add_pch(cmlib cmlib.h SOURCE) else() + # CMLIB for host-tools add_definitions( -D__NO_CTYPE_INLINES -DCMLIB_HOST)
2 years, 4 months
1
0
0
0
[reactos] 01/01: [OSK] Fix text label height for Russian (ru-RU) translation
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=95b3e7508e52a1a1cbce6…
commit 95b3e7508e52a1a1cbce6018ef0e65194c8b26e0 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Mon Aug 22 16:50:17 2022 +0300 Commit: Stanislav Motylkov <x86corez(a)gmail.com> CommitDate: Mon Aug 22 16:50:17 2022 +0300 [OSK] Fix text label height for Russian (ru-RU) translation Addendum to e59e6ba0. --- base/applications/osk/lang/ru-RU.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/applications/osk/lang/ru-RU.rc b/base/applications/osk/lang/ru-RU.rc index 99c48709633..7befd7e17de 100644 --- a/base/applications/osk/lang/ru-RU.rc +++ b/base/applications/osk/lang/ru-RU.rc @@ -54,7 +54,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK", IDOK, 193, 76, 50, 14 ICON IDI_OSK, IDC_STATIC, 7, 17, 20, 20 - LTEXT "Экранная клавиатура обеспечивает минимальный функционал для пользователей с ограниченными физическими возможностями. Пользователям с ограниченными физическими возможностями нужны более функциональные программы.", IDC_STATIC, 36, 7, 207, 33 + LTEXT "Экранная клавиатура обеспечивает минимальный функционал для пользователей с ограниченными физическими возможностями. Пользователям с ограниченными физическими возможностями нужны более функциональные программы.", IDC_STATIC, 36, 7, 207, 41 CONTROL "Не показывать это сообщение снова", IDC_SHOWWARNINGCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10 END
2 years, 4 months
1
0
0
0
[reactos] 06/06: [NTOS] Remove useless functions
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e9a129c1e20c1f4eba227…
commit e9a129c1e20c1f4eba227d762caa313cda9478ee Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sat Jul 23 09:27:47 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Aug 22 11:22:08 2022 +0200 [NTOS] Remove useless functions --- ntoskrnl/include/internal/amd64/intrin_i.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ntoskrnl/include/internal/amd64/intrin_i.h b/ntoskrnl/include/internal/amd64/intrin_i.h index 97072c3fd94..c2563fb7e42 100644 --- a/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/ntoskrnl/include/internal/amd64/intrin_i.h @@ -81,16 +81,6 @@ static __inline__ __attribute__((always_inline)) void __sldt(void *Destination) __asm__ __volatile__("sldt %0" : : "m"(*(short*)Destination) : "memory"); } -static __inline__ __attribute__((always_inline)) void __ldmxcsr(unsigned long *Source) -{ - __asm__ __volatile__("ldmxcsr %0" : : "m"(*Source)); -} - -static __inline__ __attribute__((always_inline)) void __stmxcsr(unsigned long *Destination) -{ - __asm__ __volatile__("stmxcsr %0" : : "m"(*Destination) : "memory"); -} - static __inline__ __attribute__((always_inline)) void __ltr(unsigned short Source) { __asm__ __volatile__("ltr %0" : : "rm"(Source));
2 years, 4 months
1
0
0
0
[reactos] 05/06: [NTOS] Add MxCsr handling to trap handlers
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=620f9ee71a7aa908db8a0…
commit 620f9ee71a7aa908db8a0734fd310538309bbe93 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sat Jul 23 13:31:48 2022 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Mon Aug 22 11:22:08 2022 +0200 [NTOS] Add MxCsr handling to trap handlers --- ntoskrnl/ke/amd64/trap.S | 7 +++++++ sdk/include/asm/ksamd64.template.h | 2 +- sdk/include/asm/trapamd64.inc | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/ke/amd64/trap.S b/ntoskrnl/ke/amd64/trap.S index 9d694518d0f..63dacf8166b 100644 --- a/ntoskrnl/ke/amd64/trap.S +++ b/ntoskrnl/ke/amd64/trap.S @@ -822,6 +822,10 @@ PUBLIC KiSystemCallEntry64 mov ds, ax mov es, ax + /* Save MCXSR and set kernel value */ + stmxcsr [rsp + MAX_SYSCALL_PARAM_SIZE + KTRAP_FRAME_MxCsr] + ldmxcsr gs:[PcMxCsr] + #if DBG /* Check IRQL */ mov rax, cr8 @@ -861,6 +865,9 @@ no_user_apc_pending: /* Disable interrupts for return */ cli + /* Restore MCXSR */ + ldmxcsr [rsp + MAX_SYSCALL_PARAM_SIZE + KTRAP_FRAME_MxCsr] + /* Restore old trap frame */ mov rcx, gs:[PcCurrentThread] mov rdx, [rsp + MAX_SYSCALL_PARAM_SIZE + KTRAP_FRAME_TrapFrame] diff --git a/sdk/include/asm/ksamd64.template.h b/sdk/include/asm/ksamd64.template.h index 1072df28b34..6fcb43149ea 100644 --- a/sdk/include/asm/ksamd64.template.h +++ b/sdk/include/asm/ksamd64.template.h @@ -586,7 +586,7 @@ OFFSET(PcIrql, KPCR, Irql), OFFSET(PcStallScaleFactor, KPCR, StallScaleFactor), OFFSET(PcHalReserved, KPCR, HalReserved), //OFFSET(PcPrcb, KPCR, Prcb), -//OFFSET(PcMxCsr, KPCR, MxCsr), +OFFSET(PcMxCsr, KIPCR, Prcb.MxCsr), //OFFSET(PcNumber, KPCR, Number), //OFFSET(PcInterruptRequest, KPCR, InterruptRequest), //OFFSET(PcIdleHalt, KPCR, IdleHalt), diff --git a/sdk/include/asm/trapamd64.inc b/sdk/include/asm/trapamd64.inc index eeb804ec970..d5d51dc50a6 100644 --- a/sdk/include/asm/trapamd64.inc +++ b/sdk/include/asm/trapamd64.inc @@ -97,6 +97,9 @@ MACRO(EnterTrap, Flags) mov [rbp + KTRAP_FRAME_SegGs], gs endif + /* Save MCXSR */ + stmxcsr [rbp + KTRAP_FRAME_MxCsr] + #if DBG mov ecx, MSR_GS_BASE rdmsr @@ -116,6 +119,9 @@ MACRO(EnterTrap, Flags) mov es, ax swapgs + /* Load kernel MXCSR */ + ldmxcsr gs:[PcMxCsr] + #if DBG /* Check IRQL */ mov rax, cr8 @@ -255,6 +261,9 @@ kernel_mode_return: movdqa xmm5, [rbp + KTRAP_FRAME_Xmm5] endif + /* Restore MCXSR */ + ldmxcsr [rbp + KTRAP_FRAME_MxCsr] + /* Restore rbp */ mov rbp, [rbp + KTRAP_FRAME_Rbp]
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