From 0ddc3e271578d6cbd7847398adfb184e719b70eb Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Mon, 10 Jun 2002 21:37:45 +0000 Subject: [PATCH] Reference/Dereference the process object in PiTerminateProcess. svn path=/trunk/; revision=3043 --- reactos/ntoskrnl/ps/kill.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ps/kill.c b/reactos/ntoskrnl/ps/kill.c index fee047bdb84..190a6d8a8a7 100644 --- a/reactos/ntoskrnl/ps/kill.c +++ b/reactos/ntoskrnl/ps/kill.c @@ -1,4 +1,4 @@ -/* $Id: kill.c,v 1.53 2002/06/05 19:38:08 hbirr Exp $ +/* $Id: kill.c,v 1.54 2002/06/10 21:37:45 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -228,10 +228,12 @@ PiTerminateProcess(PEPROCESS Process, Process, ExitStatus, ObGetObjectPointerCount(Process), ObGetObjectHandleCount(Process)); + ObReferenceObject(Process); if (InterlockedExchange((PLONG)&Process->Pcb.State, PROCESS_STATE_TERMINATED) == PROCESS_STATE_TERMINATED) { + ObDereferenceObject(Process); return(STATUS_SUCCESS); } KeAttachProcess( Process ); @@ -241,6 +243,7 @@ PiTerminateProcess(PEPROCESS Process, Process->Pcb.DispatcherHeader.SignalState = TRUE; KeDispatcherObjectWake(&Process->Pcb.DispatcherHeader); KeReleaseDispatcherDatabaseLock(FALSE); + ObDereferenceObject(Process); return(STATUS_SUCCESS); }