373e72d3276ce386153cd6554871db8ed40686d9
[reactos.git] / reactos / lib / rosrtl / thread / exit.c
1 /* $Id$
2 */
3 /*
4 */
5
6 #include <windows.h>
7 #define NTOS_MODE_USER
8 #include <ndk/ntndk.h>
9
10 #define NDEBUG
11 #include <debug.h>
12
13 #include <rosrtl/thread.h>
14
15 static VOID NTAPI RtlRosExitUserThread_Stage2
16 (
17 IN ULONG_PTR Status
18 )
19 {
20 RtlRosFreeUserThreadStack(NtCurrentProcess(), NtCurrentThread());
21 NtTerminateThread(NtCurrentThread(), Status);
22 }
23
24 __declspec(noreturn) VOID NTAPI RtlRosExitUserThread
25 (
26 IN NTSTATUS Status
27 )
28 {
29 RtlRosSwitchStackForExit
30 (
31 NtCurrentTeb()->StaticUnicodeBuffer,
32 sizeof(NtCurrentTeb()->StaticUnicodeBuffer),
33 RtlRosExitUserThread_Stage2,
34 Status
35 );
36
37 for(;;);
38 }
39
40 /* EOF */