https://git.reactos.org/?p=reactos.git;a=commitdiff;h=26a64324e785ff712bde6…
commit 26a64324e785ff712bde6736ed7cbfc92a98925b
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Tue Aug 15 22:51:05 2023 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sun Sep 17 10:37:50 2023 +0300
[NTOSKRNL/x64] Fix a bug in KeSwitchKernelStack
Don't safe anything in the callee's home space, because the callee can overwrite it. Use the functions home space instead.
---
ntoskrnl/ke/amd64/trap.S | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/ke/amd64/trap.S b/ntoskrnl/ke/amd64/trap.S
index 082160893b4..93dce4215dc 100644
--- a/ntoskrnl/ke/amd64/trap.S
+++ b/ntoskrnl/ke/amd64/trap.S
@@ -1213,19 +1213,18 @@ EXTERN KiSwitchKernelStack:PROC
PUBLIC KeSwitchKernelStack
FUNC KeSwitchKernelStack
+ /* Save rcx and allocate callee home space */
+ mov [rsp + P1Home], rcx
+ .savereg rcx, P1Home
sub rsp, 40
.allocstack 40
-
- /* Save rcx */
- mov [rsp], rcx
- .savereg rcx, 0
.endprolog
/* Call the C handler, which returns the old stack in rax */
call KiSwitchKernelStack
/* Restore rcx (StackBase) */
- mov rcx, [rsp]
+ mov rcx, [rsp + 40 + P1Home]
/* Switch to new stack: RSP += (StackBase - OldStackBase) */
sub rcx, rax
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a16fc5e19b5356d98a3b…
commit 2a16fc5e19b5356d98a3bace9be3cf161304024a
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Sep 12 05:56:36 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Sep 12 05:56:36 2023 +0900
[NTGDI] GetPixel's return top byte is zero if valid (#5677)
According to the results of CImage testcase,
the top byte of the GetPixel() return value is
zero if the return is a valid color.
Do bitwise-AND operation if the color value is valid.
CORE-19008
---
win32ss/gdi/ntgdi/bitblt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/win32ss/gdi/ntgdi/bitblt.c b/win32ss/gdi/ntgdi/bitblt.c
index 2e3eaeef0b2..c86bbbc53ba 100644
--- a/win32ss/gdi/ntgdi/bitblt.c
+++ b/win32ss/gdi/ntgdi/bitblt.c
@@ -1598,6 +1598,9 @@ NtGdiGetPixel(
/* Delete the surface */
GDIOBJ_vDeleteObject(&psurfDest->BaseObject);
+
+ /* The top byte is zero */
+ ulRGBColor &= 0x00FFFFFF;
}
leave: