From 90125b20eb688dff5d1758524c91dcfb0748d93b Mon Sep 17 00:00:00 2001 From: Gunnar Dalsnes Date: Fri, 19 Nov 2004 22:19:33 +0000 Subject: [PATCH] return correct ExitCode for non-terminated threads svn path=/trunk/; revision=11704 --- reactos/ntoskrnl/ps/tinfo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/ps/tinfo.c b/reactos/ntoskrnl/ps/tinfo.c index c095b20c160..fc73625c729 100644 --- a/reactos/ntoskrnl/ps/tinfo.c +++ b/reactos/ntoskrnl/ps/tinfo.c @@ -1,4 +1,4 @@ -/* $Id: tinfo.c,v 1.30 2004/10/24 20:37:27 weiden Exp $ +/* $Id: tinfo.c,v 1.31 2004/11/19 22:19:33 gdalsnes Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -252,7 +252,11 @@ NtQueryInformationThread (IN HANDLE ThreadHandle, break; } - TBI->ExitStatus = Thread->ExitStatus; + /* A test on W2K agains ntdll shows NtQueryInformationThread return STATUS_PENDING + * as ExitStatus for current/running thread, while KETHREAD's ExitStatus is + * 0. So do the conversion here: + * -Gunnar */ + TBI->ExitStatus = (Thread->ExitStatus == 0) ? STATUS_PENDING : Thread->ExitStatus; TBI->TebBaseAddress = Thread->Tcb.Teb; TBI->ClientId = Thread->Cid; TBI->AffinityMask = Thread->Tcb.Affinity;