Author: tkreuzer
Date: Sat Dec 26 20:36:24 2009
New Revision: 44766
URL:
http://svn.reactos.org/svn/reactos?rev=44766&view=rev
Log:
[KDBG]
Hackfix the problem with attaching to processes introduced in r44743, by lowering IRQL to
passive level, although interrupts are off. Needed because KDBG calls pageable code.
Modified:
trunk/reactos/ntoskrnl/kdbg/kdb.c
Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb.c?rev=44…
==============================================================================
--- trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] Sat Dec 26 20:36:24 2009
@@ -1350,6 +1350,7 @@
BOOLEAN Resume = FALSE;
BOOLEAN EnterConditionMet = TRUE;
ULONG OldEflags;
+ KIRQL OldIrql;
NTSTATUS ExceptionCode;
ExceptionCode = (ExceptionRecord ? ExceptionRecord->ExceptionCode :
STATUS_BREAKPOINT);
@@ -1607,6 +1608,11 @@
OldEflags = __readeflags();
_disable();
+ /* HACK: Save the current IRQL and pretend we are at passive level,
+ * although interrupts are off. Needed because KDBG calls pageable code. */
+ OldIrql = KeGetCurrentIrql();
+ KeLowerIrql(PASSIVE_LEVEL);
+
/* Exception inside the debugger? Game over. */
if (InterlockedIncrement(&KdbEntryCount) > 1)
{
@@ -1645,6 +1651,9 @@
/* Decrement the entry count */
InterlockedDecrement(&KdbEntryCount);
+
+ /* HACK: Raise back to old IRWL */
+ KeRaiseIrql(OldIrql, &OldIrql);
/* Leave critical section */
__writeeflags(OldEflags);