Commit in reactos/ntoskrnl/ps on MAIN
kill.c+10-11.74 -> 1.75
Check if attached when terminating thread. Suggested by tamlin.

reactos/ntoskrnl/ps
kill.c 1.74 -> 1.75
diff -u -r1.74 -r1.75
--- kill.c	31 Aug 2004 20:17:18 -0000	1.74
+++ kill.c	14 Sep 2004 18:37:40 -0000	1.75
@@ -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 @@
    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);
CVSspam 0.2.8