mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 00:23:10 +00:00
Rollback last change since it was incorrect.
See http://www.reactos.com/bugzilla/show_bug.cgi?id=36 svn path=/trunk/; revision=11173
This commit is contained in:
parent
fc4b179d93
commit
7eb30acddb
2 changed files with 19 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: exit.c,v 1.2 2004/10/03 18:53:05 gvg Exp $
|
/* $Id: exit.c,v 1.3 2004/10/03 21:03:06 gvg Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
|
@ -11,12 +11,27 @@
|
||||||
|
|
||||||
#include <rosrtl/thread.h>
|
#include <rosrtl/thread.h>
|
||||||
|
|
||||||
|
static VOID NTAPI RtlRosExitUserThread_Stage2
|
||||||
|
(
|
||||||
|
IN ULONG_PTR Status
|
||||||
|
)
|
||||||
|
{
|
||||||
|
RtlRosFreeUserThreadStack(NtCurrentProcess(), NtCurrentThread());
|
||||||
|
NtTerminateThread(NtCurrentThread(), Status);
|
||||||
|
}
|
||||||
|
|
||||||
__declspec(noreturn) VOID NTAPI RtlRosExitUserThread
|
__declspec(noreturn) VOID NTAPI RtlRosExitUserThread
|
||||||
(
|
(
|
||||||
IN NTSTATUS Status
|
IN NTSTATUS Status
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
NtTerminateThread(NtCurrentThread(), Status);
|
RtlRosSwitchStackForExit
|
||||||
|
(
|
||||||
|
NtCurrentTeb()->StaticUnicodeBuffer,
|
||||||
|
sizeof(NtCurrentTeb()->StaticUnicodeBuffer),
|
||||||
|
RtlRosExitUserThread_Stage2,
|
||||||
|
Status
|
||||||
|
);
|
||||||
|
|
||||||
for(;;);
|
for(;;);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: kill.c,v 1.78 2004/10/03 18:53:05 gvg Exp $
|
/* $Id: kill.c,v 1.79 2004/10/03 21:03:03 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -114,7 +114,6 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
||||||
PEPROCESS CurrentProcess;
|
PEPROCESS CurrentProcess;
|
||||||
SIZE_T Length = PAGE_SIZE;
|
SIZE_T Length = PAGE_SIZE;
|
||||||
PVOID TebBlock;
|
PVOID TebBlock;
|
||||||
ULONG StackSize;
|
|
||||||
|
|
||||||
KeLowerIrql(PASSIVE_LEVEL);
|
KeLowerIrql(PASSIVE_LEVEL);
|
||||||
|
|
||||||
|
@ -148,14 +147,9 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
||||||
PspRunCreateThreadNotifyRoutines(CurrentThread, FALSE);
|
PspRunCreateThreadNotifyRoutines(CurrentThread, FALSE);
|
||||||
PsTerminateWin32Thread(CurrentThread);
|
PsTerminateWin32Thread(CurrentThread);
|
||||||
|
|
||||||
/* Free the usermode stack and the TEB */
|
/* Free the TEB */
|
||||||
if(CurrentThread->Tcb.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);
|
DPRINT("Decommit teb at %p\n", CurrentThread->Tcb.Teb);
|
||||||
ExAcquireFastMutex(&CurrentProcess->TebLock);
|
ExAcquireFastMutex(&CurrentProcess->TebLock);
|
||||||
TebBlock = MM_ROUND_DOWN(CurrentThread->Tcb.Teb, MM_VIRTMEM_GRANULARITY);
|
TebBlock = MM_ROUND_DOWN(CurrentThread->Tcb.Teb, MM_VIRTMEM_GRANULARITY);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue