Commit 74cdb539 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 21453b4c
...@@ -152,27 +152,8 @@ HANDLE WINAPI OpenThread( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwTh ...@@ -152,27 +152,8 @@ HANDLE WINAPI OpenThread( DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwTh
*/ */
void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */ void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
{ {
BOOL last; RtlFreeThreadActivationContextStack();
SERVER_START_REQ( terminate_thread ) RtlExitUserThread( code );
{
/* 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 );
}
} }
......
...@@ -604,8 +604,28 @@ error: ...@@ -604,8 +604,28 @@ error:
*/ */
void WINAPI RtlExitUserThread( ULONG status ) void WINAPI RtlExitUserThread( ULONG status )
{ {
LdrShutdownThread(); BOOL last;
server_exit_thread( status );
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 );
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment