mirror of
https://github.com/reactos/reactos.git
synced 2025-04-18 19:47:14 +00:00
[NTOSKRNL]: The ExitTime in ETHREAD is unionized and only valid if the thread actually exited, so don't always return the raw value -- return 0 if the thread is still alive. Fixes code which uses ExitTime != 0 to tell if a thread is still alive or not -- everyone always thought all ReactOS threads are always dead.
svn path=/trunk/; revision=55719
This commit is contained in:
parent
682a93c9f9
commit
339ee42bae
1 changed files with 12 additions and 5 deletions
|
@ -2279,12 +2279,19 @@ NtQueryInformationThread(IN HANDLE ThreadHandle,
|
|||
_SEH2_TRY
|
||||
{
|
||||
/* Copy time information from ETHREAD/KTHREAD */
|
||||
ThreadTime->KernelTime.QuadPart = Thread->Tcb.KernelTime *
|
||||
100000LL;
|
||||
ThreadTime->UserTime.QuadPart = Thread->Tcb.UserTime *
|
||||
100000LL;
|
||||
ThreadTime->KernelTime.QuadPart = Thread->Tcb.KernelTime * KeMaximumIncrement;
|
||||
ThreadTime->UserTime.QuadPart = Thread->Tcb.UserTime * KeMaximumIncrement;
|
||||
ThreadTime->CreateTime = Thread->CreateTime;
|
||||
ThreadTime->ExitTime = Thread->ExitTime;
|
||||
|
||||
/* Exit time is in a union and only valid on actual exit! */
|
||||
if (KeReadStateThread(&Thread->Tcb))
|
||||
{
|
||||
ThreadTime->ExitTime = Thread->ExitTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadTime->ExitTime.QuadPart = 0;
|
||||
}
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue