[NTOS:PS] Fix misplaced Thread variable reference caught by RTC

Addendum to 2e88e2b9.
This commit is contained in:
Stanislav Motylkov
2021-05-07 21:54:10 +03:00
parent 2b52f3bb56
commit 0c8f07854b

View File

@@ -2454,14 +2454,6 @@ NtSetInformationThread(IN HANDLE ThreadHandle,
}
_SEH2_END;
/* This is only valid for the current thread */
if (Thread != PsGetCurrentThread())
{
/* Fail */
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Reference the thread */
Status = ObReferenceObjectByHandle(ThreadHandle,
THREAD_SET_INFORMATION,
@@ -2472,6 +2464,14 @@ NtSetInformationThread(IN HANDLE ThreadHandle,
if (!NT_SUCCESS(Status))
break;
/* This is only valid for the current thread */
if (Thread != PsGetCurrentThread())
{
/* Fail */
Status = STATUS_INVALID_PARAMETER;
break;
}
/* Get the process */
Process = Thread->ThreadsProcess;