- Prevent from calling PsTerminateCurrentThread from within an apc if PsTerminateThread was already called.
Modified: trunk/reactos/ntoskrnl/ps/kill.c

Modified: trunk/reactos/ntoskrnl/ps/kill.c
--- trunk/reactos/ntoskrnl/ps/kill.c	2005-01-05 19:03:21 UTC (rev 12828)
+++ trunk/reactos/ntoskrnl/ps/kill.c	2005-01-05 19:04:25 UTC (rev 12829)
@@ -239,6 +239,12 @@
 			     PVOID SystemArgument1,
 			     PVOID SystemArgument2)
 {
+  PETHREAD EThread = PsGetCurrentThread();
+  if (EThread->HasTerminated)
+  {
+     /* Someone else has already called PsTerminateCurrentThread */
+     return;
+  }
   PsTerminateCurrentThread(PsGetCurrentThread()->ExitStatus);
 }