mirror of
https://github.com/reactos/reactos.git
synced 2024-10-20 16:06:27 +00:00
Check if attached when terminating thread. Suggested by tamlin.
svn path=/trunk/; revision=10857
This commit is contained in:
parent
7678fed2ef
commit
5a97f250e7
|
@ -1,4 +1,4 @@
|
|||
/* $Id: kill.c,v 1.74 2004/08/31 20:17:18 hbirr Exp $
|
||||
/* $Id: kill.c,v 1.75 2004/09/14 18:37:40 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -124,6 +124,15 @@ PsTerminateCurrentThread(NTSTATUS ExitStatus)
|
|||
CurrentThread = PsGetCurrentThread();
|
||||
CurrentProcess = CurrentThread->ThreadsProcess;
|
||||
|
||||
/* Can't terminate a thread if it attached another process */
|
||||
if (AttachedApcEnvironment == CurrentThread->Tcb.ApcStateIndex)
|
||||
{
|
||||
KEBUGCHECKEX(INVALID_PROCESS_ATTACH_ATTEMPT, (ULONG) CurrentProcess,
|
||||
(ULONG) CurrentThread->Tcb.ApcState.Process,
|
||||
(ULONG) CurrentThread->Tcb.ApcStateIndex,
|
||||
(ULONG) CurrentThread);
|
||||
}
|
||||
|
||||
KeAcquireSpinLock(&PiThreadListLock, &oldIrql);
|
||||
|
||||
DPRINT("terminating %x\n",CurrentThread);
|
||||
|
|
Loading…
Reference in a new issue