Use NtQueryInformationThread to implement GetExitCodeThread.

This commit is contained in:
Alexandre Julliard 2003-07-09 19:58:01 +00:00
parent 04c1f9f88c
commit e8b2630620
1 changed files with 9 additions and 8 deletions

View File

@ -385,16 +385,17 @@ BOOL WINAPI GetExitCodeThread(
HANDLE hthread, /* [in] Handle to thread */
LPDWORD exitcode) /* [out] Address to receive termination status */
{
BOOL ret;
SERVER_START_REQ( get_thread_info )
THREAD_BASIC_INFORMATION info;
NTSTATUS status = NtQueryInformationThread( hthread, ThreadBasicInformation,
&info, sizeof(info), NULL );
if (status)
{
req->handle = hthread;
req->tid_in = 0;
ret = !wine_server_call_err( req );
if (ret && exitcode) *exitcode = reply->exit_code;
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
SERVER_END_REQ;
return ret;
if (exitcode) *exitcode = info.ExitStatus;
return TRUE;
}