https://git.reactos.org/?p=reactos.git;a=commitdiff;h=07abea90d9fecbce58a84…
commit 07abea90d9fecbce58a84ef16018b6603cfb272d
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sun Sep 1 13:24:22 2024 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 1 13:24:22 2024 -0500
[NTUSER] Optimize BroadcastSystemMessage a bit. Follow-up of #6884 (#7215)
Optimize BroadcastSystemMessage with Environment parameter.
Minimize processing when UserModeMsg->lParam is NULL and KernelModeMsg->message != WM_WININICHANGE
Make sure that we have a UNICODE_NULL within lParamMsg based on comment from @whindsaks
---
win32ss/user/ntuser/message.c | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/win32ss/user/ntuser/message.c b/win32ss/user/ntuser/message.c
index c86754abc56..d28f35e3c79 100644
--- a/win32ss/user/ntuser/message.c
+++ b/win32ss/user/ntuser/message.c
@@ -453,7 +453,7 @@ CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEnt
NTSTATUS Status;
PVOID KernelMem;
- UINT Size, i;
+ UINT Size;
*KernelModeMsg = *UserModeMsg;
@@ -483,23 +483,15 @@ CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEnt
{
TRACE("Copy Message %u from usermode buffer\n", KernelModeMsg->message);
/* Don't do extra testing for 1 word messages. For examples see
- * https://wiki.winehq.org/List_Of_Windows_Messages. */
- if (Size > 1)
+ * https://wiki.winehq.org/List_Of_Windows_Messages and
+ * we are just handling WM_WININICHANGE here. */
+ if (Size > 1 && UserModeMsg->lParam &&
+ KernelModeMsg->message == WM_WININICHANGE)
{
WCHAR lParamMsg[_countof(StrUserKernel[0]) + 1] = { 0 };
_SEH2_TRY
{
- if (UserModeMsg->lParam)
- RtlCopyMemory(lParamMsg, (WCHAR*)UserModeMsg->lParam, sizeof(lParamMsg));
- /* Make sure that the last WCHAR is a UNICODE_NULL */
- for (i = 0; i < ARRAYSIZE(lParamMsg); ++i)
- {
- if (lParamMsg[i] == 0)
- break;
- }
- /* If we did not find a UNICODE_NULL, then set last WCHAR to one */
- if (i == ARRAYSIZE(lParamMsg))
- lParamMsg[_countof(StrUserKernel[0])] = UNICODE_NULL;
+ RtlCopyMemory(lParamMsg, (WCHAR*)UserModeMsg->lParam, sizeof(lParamMsg));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -507,8 +499,10 @@ CopyMsgToKernelMem(MSG *KernelModeMsg, MSG *UserModeMsg, PMSGMEMORY MsgMemoryEnt
}
_SEH2_END;
- if (UserModeMsg->lParam && !UserModeMsg->wParam &&
- PosInArray(lParamMsg) >= 0)
+ /* Make sure that we have a UNICODE_NULL within lParamMsg */
+ lParamMsg[ARRAYSIZE(lParamMsg) - 1] = UNICODE_NULL;
+
+ if (!UserModeMsg->wParam && PosInArray(lParamMsg) >= 0)
{
TRACE("Copy String '%S' from usermode buffer\n", lParamMsg);
wcscpy(KernelMem, lParamMsg);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a1bff5b94efa36b9e48d3…
commit a1bff5b94efa36b9e48d37f91b56428131c10531
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sun Sep 1 13:18:23 2024 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 1 13:18:23 2024 -0500
[NTGDI:FREETYPE] Account for spaces in x-dimension of IntExtTextOutW function (#7274)
@I_Kill_Bugs fix
CORE-11787, CORE-17721 and CORE-19721
For function IntExtTextOutW with space character, the x-dimension should be taken into account.
Fixes HexEdit 1.2.1 right side of display window not being cleared.
Account for x-dimension if TA_UPDATECP flag set and 'String' is not NULL.
Clarify 'etx' is ASCII End of Text
---
win32ss/gdi/ntgdi/freetype.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 6a72112f2c9..5a6f8479bbc 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -6795,8 +6795,9 @@ IntExtTextOutW(
FONT_CACHE_ENTRY Cache;
FT_Matrix mat;
BOOL bNoTransform;
- DWORD ch0, ch1;
+ DWORD ch0, ch1, etx = 3; // etx is ASCII End of Text
FONTLINK_CHAIN Chain;
+ SIZE spaceWidth;
/* Check if String is valid */
if (Count > 0xFFFF || (Count > 0 && String == NULL))
@@ -7062,6 +7063,22 @@ IntExtTextOutW(
bitSize.cx = realglyph->bitmap.width;
bitSize.cy = realglyph->bitmap.rows;
+ /* Do chars other than space and etx have a bitSize.cx of zero? */
+ if (ch0 != L' ' && ch0 != etx && bitSize.cx == 0)
+ DPRINT1("WARNING: WChar 0x%04x has a bitSize.cx of zero\n", ch0);
+
+ /* Don't ignore spaces when computing offset.
+ * This completes the fix of CORE-11787. */
+ if ((pdcattr->flTextAlign & TA_UPDATECP) && ch0 == L' ' && bitSize.cx == 0)
+ {
+ IntUnLockFreeType();
+ /* Get the width of the space character */
+ TextIntGetTextExtentPoint(dc, TextObj, L" ", 1, 0, NULL, 0, &spaceWidth, 0);
+ IntLockFreeType();
+ bitSize.cx = spaceWidth.cx;
+ realglyph->left = 0;
+ }
+
MaskRect.right = realglyph->bitmap.width;
MaskRect.bottom = realglyph->bitmap.rows;
@@ -7166,8 +7183,8 @@ IntExtTextOutW(
previous = glyph_index;
}
-
- if (pdcattr->flTextAlign & TA_UPDATECP)
+ /* Don't update position if String == NULL. Fixes CORE-19721. */
+ if ((pdcattr->flTextAlign & TA_UPDATECP) && String)
pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x;
if (plf->lfUnderline || plf->lfStrikeOut) /* Underline or strike-out? */
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e168d60bc50058ec0cf78…
commit e168d60bc50058ec0cf78275d333ce80f90c1ffd
Author: Adam Słaboń <asaillen(a)protonmail.com>
AuthorDate: Sun Sep 1 08:54:28 2024 +0000
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Sep 1 11:54:28 2024 +0300
[FREELDR] Fix boot timeout regression on AMD64 (#7281)
Initialize the BootMgrInfo struct globally, so the TimeOut value is guaranteed to be negative when no Multiboot cmdline is provided. This could happen when BootMain is called with a NULL pointer:
https://git.reactos.org/?p=reactos.git;a=blob;f=boot/freeldr/freeldr/arch/a…
so CmdLine == NULL and LoadSettings is called with NULL, thus the CmdLineParse isn't run.
Fixes boot timeout regression introduced in commit 7bee32d2372feb55949714eec5c92ca7ef2754bf which occured only on AMD64 builds.
---
boot/freeldr/freeldr/settings.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/boot/freeldr/freeldr/settings.c b/boot/freeldr/freeldr/settings.c
index 82051714bcc..7f1e44e51af 100644
--- a/boot/freeldr/freeldr/settings.c
+++ b/boot/freeldr/freeldr/settings.c
@@ -15,7 +15,7 @@
static CCHAR DebugString[256];
static CCHAR DefaultOs[256];
-BOOTMGRINFO BootMgrInfo = {0};
+BOOTMGRINFO BootMgrInfo = {NULL, NULL, -1, 0};
/* FUNCTIONS ******************************************************************/
@@ -26,12 +26,6 @@ CmdLineParse(
PCHAR End, Setting;
ULONG_PTR Length, Offset = 0;
- /* Set defaults */
- BootMgrInfo.DebugString = NULL;
- BootMgrInfo.DefaultOs = NULL;
- BootMgrInfo.TimeOut = -1;
- // BootMgrInfo.FrLdrSection = 0;
-
/*
* Get the debug string, in the following format:
* "debug=option1=XXX;option2=YYY;..."