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=…
==============================================================================
--- 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=353…
==============================================================================
--- 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);
}
Author: sginsberg
Date: Wed Aug 13 02:55:59 2008
New Revision: 35299
URL: http://svn.reactos.org/svn/reactos?rev=35299&view=rev
Log:
- Reapply the PsTerminateSystemThread typo fix. We do boot fine with this fix.
- Note to self: Don't commit after midnight and always test your patches yourself
Modified:
trunk/reactos/ntoskrnl/ps/kill.c
Modified: trunk/reactos/ntoskrnl/ps/kill.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=352…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] Wed Aug 13 02:55:59 2008
@@ -1086,7 +1086,7 @@
PETHREAD Thread = PsGetCurrentThread();
/* Make sure this is a system thread */
- if (Thread->SystemThread) return STATUS_INVALID_PARAMETER;
+ if (!Thread->SystemThread) return STATUS_INVALID_PARAMETER;
/* Terminate it for real */
return PspTerminateThreadByPointer(Thread, ExitStatus, TRUE);
Author: sginsberg
Date: Tue Aug 12 17:22:51 2008
New Revision: 35294
URL: http://svn.reactos.org/svn/reactos?rev=35294&view=rev
Log:
- Temporarily revert my last change. We don't set the SystemThread flag appropriately and it is always zero
Modified:
trunk/reactos/ntoskrnl/ps/kill.c
Modified: trunk/reactos/ntoskrnl/ps/kill.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=352…
==============================================================================
--- trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ps/kill.c [iso-8859-1] Tue Aug 12 17:22:51 2008
@@ -1086,7 +1086,7 @@
PETHREAD Thread = PsGetCurrentThread();
/* Make sure this is a system thread */
- if (!Thread->SystemThread) return STATUS_INVALID_PARAMETER;
+ if (Thread->SystemThread) return STATUS_INVALID_PARAMETER;
/* Terminate it for real */
return PspTerminateThreadByPointer(Thread, ExitStatus, TRUE);