Moved position of ObfDereferenceObject in NtSuspendThread

This commit is contained in:
ergo720 2023-03-07 15:40:42 +01:00 committed by RadWolfie
parent 750d202fa8
commit 1b4a3bb54f
1 changed files with 1 additions and 3 deletions

View File

@ -2098,13 +2098,11 @@ XBSYSAPI EXPORTNUM(231) xbox::ntstatus_xt NTAPI xbox::NtSuspendThread
}
ulong_xt PrevSuspendCount = KeSuspendThread(&Thread->Tcb);
ObfDereferenceObject(Thread);
if (PrevSuspendCount == X_STATUS_SUSPEND_COUNT_EXCEEDED) {
ObfDereferenceObject(Thread);
RETURN(X_STATUS_SUSPEND_COUNT_EXCEEDED);
}
ObfDereferenceObject(Thread);
if (PreviousSuspendCount) {
*PreviousSuspendCount = PrevSuspendCount;
}