A thread may exit with a status code of 0.

svn path=/trunk/; revision=23533
This commit is contained in:
Hervé Poussineau 2006-08-09 12:46:41 +00:00
parent 009c9838df
commit 4419e2ce2a
2 changed files with 4 additions and 3 deletions

View file

@ -921,9 +921,7 @@ NtQueryInformationThread(IN HANDLE ThreadHandle,
_SEH_TRY
{
/* Write all the information from the ETHREAD/KTHREAD */
ThreadBasicInfo->ExitStatus = (Thread->ExitStatus == 0) ?
STATUS_PENDING :
Thread->ExitStatus;
ThreadBasicInfo->ExitStatus = Thread->ExitStatus;
ThreadBasicInfo->TebBaseAddress = (PVOID)Thread->Tcb.Teb;
ThreadBasicInfo->ClientId = Thread->Cid;
ThreadBasicInfo->AffinityMask = Thread->Tcb.Affinity;

View file

@ -239,6 +239,9 @@ PspCreateThread(OUT PHANDLE ThreadHandle,
/* Initialize rundown protection */
ExInitializeRundownProtection(&Thread->RundownProtect);
/* Initialize exit code */
Thread->ExitStatus = STATUS_PENDING;
/* Set the Process CID */
Thread->ThreadsProcess = Process;
Thread->Cid.UniqueProcess = Process->UniqueProcessId;