Updated thread timings in ethread + null id upon thread termination
This commit is contained in:
parent
ec6b16c68a
commit
79ac0c3019
|
@ -1915,8 +1915,9 @@ KTHREAD, *PKTHREAD, *RESTRICTED_POINTER PRKTHREAD;
|
|||
// ******************************************************************
|
||||
typedef struct _ETHREAD
|
||||
{
|
||||
struct _KTHREAD Tcb;
|
||||
uchar_xt UnknownA[0x10]; // 0x110
|
||||
struct _KTHREAD Tcb;
|
||||
LARGE_INTEGER CreateTime;
|
||||
LARGE_INTEGER ExitTime;
|
||||
ntstatus_xt ExitStatus; // 0x120
|
||||
uchar_xt UnknownB[0x8]; // 0x124
|
||||
HANDLE UniqueThread; // 0x12C
|
||||
|
|
|
@ -288,6 +288,7 @@ XBSYSAPI EXPORTNUM(255) xbox::ntstatus_xt NTAPI xbox::PsCreateSystemThreadEx
|
|||
RETURN(X_STATUS_INSUFFICIENT_RESOURCES);
|
||||
}
|
||||
|
||||
KeQuerySystemTime(&eThread->CreateTime);
|
||||
KiUniqueProcess.StackCount++;
|
||||
RegisterXboxHandle(*ThreadHandle, handle);
|
||||
RegisterXboxHandle(eThread->UniqueThread, handle);
|
||||
|
|
|
@ -225,16 +225,17 @@ void EmuKeFreeThread(xbox::ntstatus_xt ExitStatus)
|
|||
|
||||
xbox::PETHREAD eThread = xbox::PspGetCurrentThread();
|
||||
|
||||
xbox::KeQuerySystemTime(&eThread->ExitTime);
|
||||
eThread->Tcb.HasTerminated = 1;
|
||||
|
||||
// Emulate our exit strategy for GetExitCodeThread
|
||||
eThread->ExitStatus = ExitStatus;
|
||||
eThread->Tcb.Header.SignalState = 1;
|
||||
|
||||
|
||||
xbox::HANDLE UniqueThread = eThread->UniqueThread;
|
||||
if (GetNativeHandle(eThread->UniqueThread)) {
|
||||
xbox::NtClose(eThread->UniqueThread);
|
||||
eThread->UniqueThread = NULL;
|
||||
}
|
||||
|
||||
EmuKeFreePcr(UniqueThread);
|
||||
|
|
Loading…
Reference in New Issue