}
_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,
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;