Commit in reactos on MAIN
lib/rosrtl/thread/exit.c+2-171.1 -> 1.2
ntoskrnl/ps/kill.c+8-21.77 -> 1.78
+10-19
2 modified files
Move final user stack cleanup to kernelmode

reactos/lib/rosrtl/thread
exit.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- exit.c	30 Dec 2003 05:10:32 -0000	1.1
+++ exit.c	3 Oct 2004 18:53:05 -0000	1.2
@@ -1,4 +1,4 @@
-/* $Id: exit.c,v 1.1 2003/12/30 05:10:32 hyperion Exp $
+/* $Id: exit.c,v 1.2 2004/10/03 18:53:05 gvg Exp $
 */
 /*
 */
@@ -11,27 +11,12 @@
 
 #include <rosrtl/thread.h>
 
-static VOID NTAPI RtlRosExitUserThread_Stage2
-(
- IN ULONG_PTR Status
-)
-{
- RtlRosFreeUserThreadStack(NtCurrentProcess(), NtCurrentThread());
- NtTerminateThread(NtCurrentThread(), Status);
-}
-
 __declspec(noreturn) VOID NTAPI RtlRosExitUserThread
 (
  IN NTSTATUS Status
 )
 {
- RtlRosSwitchStackForExit
- (
-  NtCurrentTeb()->StaticUnicodeBuffer,
-  sizeof(NtCurrentTeb()->StaticUnicodeBuffer),
-  RtlRosExitUserThread_Stage2,
-  Status
- );
+ NtTerminateThread(NtCurrentThread(), Status);
 
  for(;;);
 }

reactos/ntoskrnl/ps
kill.c 1.77 -> 1.78
diff -u -r1.77 -r1.78
--- kill.c	1 Oct 2004 20:29:58 -0000	1.77
+++ kill.c	3 Oct 2004 18:53:05 -0000	1.78
@@ -1,4 +1,4 @@
-/* $Id: kill.c,v 1.77 2004/10/01 20:29:58 gvg Exp $
+/* $Id: kill.c,v 1.78 2004/10/03 18:53:05 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -114,6 +114,7 @@
    PEPROCESS CurrentProcess;
    SIZE_T Length = PAGE_SIZE;
    PVOID TebBlock;
+   ULONG StackSize;
 
    KeLowerIrql(PASSIVE_LEVEL);
 
@@ -147,9 +148,14 @@
    PspRunCreateThreadNotifyRoutines(CurrentThread, FALSE);
    PsTerminateWin32Thread(CurrentThread);
 
-   /* Free the TEB */
+   /* Free the usermode stack and the TEB */
    if(CurrentThread->Tcb.Teb)
    {
+     StackSize = 0;
+     ZwFreeVirtualMemory(NtCurrentProcess(),
+                         &CurrentThread->Tcb.Teb->DeallocationStack,
+                         &StackSize,
+                         MEM_RELEASE);
      DPRINT("Decommit teb at %p\n", CurrentThread->Tcb.Teb);
      ExAcquireFastMutex(&CurrentProcess->TebLock);
      TebBlock = MM_ROUND_DOWN(CurrentThread->Tcb.Teb, MM_VIRTMEM_GRANULARITY);
CVSspam 0.2.8