ntdll: Store the exit code in the server in RtlExitUserThread.

This commit is contained in:
Alexandre Julliard 2008-10-29 20:37:43 +01:00
parent 21453b4c2e
commit 74cdb539a4
2 changed files with 24 additions and 23 deletions

View file

@ -152,27 +152,8 @@ HANDLE WINAPI OpenThread( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwTh
*/
void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
{
BOOL last;
SERVER_START_REQ( terminate_thread )
{
/* send the exit code to the server */
req->handle = GetCurrentThread();
req->exit_code = code;
wine_server_call( req );
last = reply->last;
}
SERVER_END_REQ;
if (last)
{
LdrShutdownProcess();
exit( code );
}
else
{
RtlFreeThreadActivationContextStack();
RtlExitUserThread( code );
}
RtlFreeThreadActivationContextStack();
RtlExitUserThread( code );
}

View file

@ -604,8 +604,28 @@ error:
*/
void WINAPI RtlExitUserThread( ULONG status )
{
LdrShutdownThread();
server_exit_thread( status );
BOOL last;
SERVER_START_REQ( terminate_thread )
{
/* send the exit code to the server */
req->handle = GetCurrentThread();
req->exit_code = status;
wine_server_call( req );
last = reply->last;
}
SERVER_END_REQ;
if (last)
{
LdrShutdownProcess();
exit( status );
}
else
{
LdrShutdownThread();
server_exit_thread( status );
}
}