From: Alex Ionescu Date: Tue, 26 Jul 2005 15:15:18 +0000 (+0000) Subject: - Allow file debug prints to happen at IRQL > DISPATCH_LEVEL, but don't queue a work... X-Git-Tag: ReactOS-0.2.8~1577 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=cdfdfa0b8b19587c17a7b25b6e74b058c7758738 - Allow file debug prints to happen at IRQL > DISPATCH_LEVEL, but don't queue a work item until we are at <= DISPATCH. Fixes /DEBUGPORT=FILE freeze/crash/bug. svn path=/trunk/; revision=16745 --- diff --git a/reactos/ntoskrnl/kd/kdio.c b/reactos/ntoskrnl/kd/kdio.c index e463282ce51..deecf6ad95c 100644 --- a/reactos/ntoskrnl/kd/kdio.c +++ b/reactos/ntoskrnl/kd/kdio.c @@ -71,9 +71,17 @@ KdpPrintToLog(PCH String) /* Make sure we are initialized and can queue */ if (!KdpLogInitialized || (ItemQueued)) return; - /* Queue the work item */ - ExQueueWorkItem(&KdpDebugLogQueue, HyperCriticalWorkQueue); - ItemQueued = TRUE; + /* + * Queue the work item + * Note that we don't want to queue if we are > DISPATCH_LEVEL... + * The message is in the buffer and will simply be taken care of at + * the next time we are at <= DISPATCH, so it won't be lost. + */ + if (KeGetCurrentIrql() <= DISPATCH_LEVEL) + { + ExQueueWorkItem(&KdpDebugLogQueue, HyperCriticalWorkQueue); + ItemQueued = TRUE; + } } VOID