[ros-diffs] [hbirr] 12829: - Prevent from calling PsTerminateCurrentThread from within an apc if PsTerminateThread was already called.

hbirr at svn.reactos.com hbirr at svn.reactos.com
Wed Jan 5 20:04:26 CET 2005


- 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);
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050105/df2d8e46/attachment.html


More information about the Ros-diffs mailing list