[WIN32K] Fix alignment checks in NtUserSetInformationThread

Fixes random failures on x64.
This commit is contained in:
Timo Kreuzer 2023-10-22 21:35:18 +03:00
parent 6ca8eb5c1e
commit 83e1193fb2

View file

@ -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)