Fix parameter type of NtQueryInformationThread; do not call ExitThread from itself. Bug #5076.

svn path=/trunk/; revision=44864
This commit is contained in:
Dmitry Gorbachev 2010-01-01 23:14:10 +00:00
parent 126c7209ac
commit 756859265d

View file

@ -242,7 +242,7 @@ WINAPI
ExitThread(DWORD uExitCode) ExitThread(DWORD uExitCode)
{ {
NTSTATUS Status; NTSTATUS Status;
BOOLEAN LastThread; ULONG LastThread;
/* /*
* Terminate process if this is the last thread * Terminate process if this is the last thread
@ -251,7 +251,7 @@ ExitThread(DWORD uExitCode)
Status = NtQueryInformationThread(NtCurrentThread(), Status = NtQueryInformationThread(NtCurrentThread(),
ThreadAmILastThread, ThreadAmILastThread,
&LastThread, &LastThread,
sizeof(BOOLEAN), sizeof(LastThread),
NULL); NULL);
if (NT_SUCCESS(Status) && LastThread) if (NT_SUCCESS(Status) && LastThread)
{ {
@ -266,8 +266,9 @@ ExitThread(DWORD uExitCode)
NtCurrentTeb()->FreeStackOnTermination = TRUE; NtCurrentTeb()->FreeStackOnTermination = TRUE;
NtTerminateThread(NULL, uExitCode); NtTerminateThread(NULL, uExitCode);
/* We will never reach this place. This silences the compiler */ /* We should never reach this place */
ExitThread(uExitCode); DPRINT1("It should not happen\n");
while (TRUE) ;
} }
/* /*