Use RtlExitUserThread instead of NtTerminateThread, so the stack is properly freed.
Modified: trunk/reactos/subsys/csrss/api/wapi.c
--- trunk/reactos/subsys/csrss/api/wapi.c 2005-07-02 13:42:43 UTC (rev 16376) +++ trunk/reactos/subsys/csrss/api/wapi.c 2005-07-02 13:45:23 UTC (rev 16377) @@ -165,7 +165,7 @@
/* Close the port and exit the thread */ NtClose(ServerPort);
- NtTerminateThread(NtCurrentThread(), STATUS_SUCCESS);
+ RtlExitUserThread(STATUS_SUCCESS);
} /**********************************************************************