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.

svn path=/trunk/; revision=44766
This commit is contained in:
Timo Kreuzer 2009-12-26 19:36:24 +00:00
parent be29496e50
commit c300719e77

View file

@ -1350,6 +1350,7 @@ KdbEnterDebuggerException(
BOOLEAN Resume = FALSE;
BOOLEAN EnterConditionMet = TRUE;
ULONG OldEflags;
KIRQL OldIrql;
NTSTATUS ExceptionCode;
ExceptionCode = (ExceptionRecord ? ExceptionRecord->ExceptionCode : STATUS_BREAKPOINT);
@ -1607,6 +1608,11 @@ KdbEnterDebuggerException(
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)
{
@ -1646,6 +1652,9 @@ KdbEnterDebuggerException(
/* Decrement the entry count */
InterlockedDecrement(&KdbEntryCount);
/* HACK: Raise back to old IRWL */
KeRaiseIrql(OldIrql, &OldIrql);
/* Leave critical section */
__writeeflags(OldEflags);