Author: sginsberg Date: Wed Aug 13 04:00:50 2008 New Revision: 35302
URL: http://svn.reactos.org/svn/reactos?rev=35302&view=rev Log: - Fix a broken check in PspExitThread. We should check if Stack Swapping is _disabled_ during termination, not crash if it is enabled! - Fix KeInitThread to respect this, and initialize EnableStackSwap to TRUE. Otherwise, only executive worker threads who modify the stack swap flag themselves encounter this issue. - This, along with my previous change, fixes worker thread termination being completely broken and crashing ros. - Thanks to Aleksey for confirming my changes
Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c trunk/reactos/ntoskrnl/ps/kill.c
Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdobj.c?rev=3... ============================================================================== --- trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] Wed Aug 13 04:00:50 2008 @@ -742,7 +742,7 @@ }
/* Set swap settings */ - Thread->EnableStackSwap = FALSE;//TRUE; + Thread->EnableStackSwap = TRUE; Thread->IdealProcessor = 1; Thread->SwapBusy = FALSE; Thread->KernelStackResident = TRUE;
Modified: trunk/reactos/ntoskrnl/ps/kill.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=3530... ============================================================================== --- trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] Wed Aug 13 04:00:50 2008 @@ -697,10 +697,10 @@ PspW32ProcessCallout(CurrentProcess, FALSE); }
- /* Make sure Stack Swap isn't enabled */ - if (Thread->Tcb.EnableStackSwap) - { - /* Stack swap really shouldn't be on during exit !*/ + /* Make sure Stack Swap is enabled */ + if (!Thread->Tcb.EnableStackSwap) + { + /* Stack swap really shouldn't be disabled during exit! */ KEBUGCHECKEX(KERNEL_STACK_LOCKED_AT_EXIT, 0, 0, 0, 0); }