https://git.reactos.org/?p=reactos.git;a=commitdiff;h=83e1193fb25210bf3bfb2…
commit 83e1193fb25210bf3bfb241a65eadb7f40729544
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sun Oct 22 21:35:18 2023 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Fri Nov 10 19:42:13 2023 +0200
[WIN32K] Fix alignment checks in NtUserSetInformationThread
Fixes random failures on x64.
---
win32ss/user/ntuser/ntstubs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/win32ss/user/ntuser/ntstubs.c b/win32ss/user/ntuser/ntstubs.c
index e301c8116e2..99e34dc5008 100644
--- a/win32ss/user/ntuser/ntstubs.c
+++ b/win32ss/user/ntuser/ntstubs.c
@@ -701,7 +701,7 @@ NtUserSetInformationThread(IN HANDLE ThreadHandle,
TRACE("Shutdown initiated\n");
- if (ThreadInformationLength != sizeof(ULONG))
+ if (ThreadInformationLength != sizeof(CapturedFlags))
{
Status = STATUS_INFO_LENGTH_MISMATCH;
break;
@@ -711,7 +711,7 @@ NtUserSetInformationThread(IN HANDLE ThreadHandle,
Status = STATUS_SUCCESS;
_SEH2_TRY
{
- ProbeForWrite(ThreadInformation, sizeof(CapturedFlags), sizeof(PVOID));
+ ProbeForWrite(ThreadInformation, sizeof(CapturedFlags),
__alignof(CapturedFlags));
CapturedFlags = *(PULONG)ThreadInformation;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -753,7 +753,7 @@ NtUserSetInformationThread(IN HANDLE ThreadHandle,
Status = STATUS_SUCCESS;
_SEH2_TRY
{
- ProbeForRead(ThreadInformation, sizeof(ShutdownStatus), sizeof(PVOID));
+ ProbeForRead(ThreadInformation, sizeof(ShutdownStatus),
__alignof(ShutdownStatus));
ShutdownStatus = *(NTSTATUS*)ThreadInformation;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -783,7 +783,7 @@ NtUserSetInformationThread(IN HANDLE ThreadHandle,
Status = STATUS_SUCCESS;
_SEH2_TRY
{
- ProbeForRead(ThreadInformation, sizeof(CsrPortHandle), sizeof(PVOID));
+ ProbeForRead(ThreadInformation, sizeof(CsrPortHandle),
__alignof(CsrPortHandle));
CsrPortHandle = *(PHANDLE)ThreadInformation;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)