From 9dfa505536c8da1d4d3c63894043a2b3dfc4c2f6 Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Mon, 2 Apr 2001 04:07:49 +0000 Subject: [PATCH] Fixed DPC bug: when the DPC is run, it has been removed from the queue and therefore can be queued again, the old code did not allow the dpc to be queued again until after the first one returned svn path=/trunk/; revision=1771 --- reactos/ntoskrnl/ke/dpc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reactos/ntoskrnl/ke/dpc.c b/reactos/ntoskrnl/ke/dpc.c index 3ba8e7a6f32..c0862795b61 100644 --- a/reactos/ntoskrnl/ke/dpc.c +++ b/reactos/ntoskrnl/ke/dpc.c @@ -18,7 +18,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dpc.c,v 1.19 2000/12/10 23:42:00 dwelch Exp $ +/* $Id: dpc.c,v 1.20 2001/04/02 04:07:49 phreak Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -98,21 +98,23 @@ KiDispatchInterrupt(VOID) current_entry = RemoveHeadList(&DpcQueueHead); DpcQueueSize--; KeReleaseSpinLockFromDpcLevel(&DpcQueueLock); - KeLowerIrql(oldlvl); current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry); + current->Lock=FALSE; + KeLowerIrql(oldlvl); while (current_entry!=(&DpcQueueHead)) { current->DeferredRoutine(current,current->DeferredContext, current->SystemArgument1, current->SystemArgument2); - current->Lock=FALSE; + KeRaiseIrql(HIGH_LEVEL, &oldlvl); KeAcquireSpinLockAtDpcLevel(&DpcQueueLock); current_entry = RemoveHeadList(&DpcQueueHead); DpcQueueSize--; KeReleaseSpinLockFromDpcLevel(&DpcQueueLock); - KeLowerIrql(oldlvl); current = CONTAINING_RECORD(current_entry,KDPC,DpcListEntry); + current->Lock=FALSE; + KeLowerIrql(oldlvl); } }