Fix the check for an empty list.

svn path=/trunk/; revision=20884
This commit is contained in:
Hartmut Birr 2006-01-15 08:51:20 +00:00
parent 68151ba039
commit aab50d9dd5

View file

@ -287,6 +287,8 @@ KiInsertQueueApc(PKAPC Apc,
PKAPC QueuedApc;
NTSTATUS Status;
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
/* Acquire the lock (only needed on MP) */
KeAcquireSpinLockAtDpcLevel(&Thread->ApcQueueLock);
@ -790,7 +792,7 @@ KiDeliverApc(KPROCESSOR_MODE DeliveryMode,
ApcListEntry = Thread->ApcState.ApcListHead[UserMode].Flink;
/* Is it empty now? */
if (!ApcListEntry)
if (ApcListEntry == &Thread->ApcState.ApcListHead[UserMode])
{
/* Release the lock and return */
KeReleaseSpinLock(&Thread->ApcQueueLock, OldIrql);