Fix the check for an empty list.
Modified: trunk/reactos/ntoskrnl/ke/apc.c

Modified: trunk/reactos/ntoskrnl/ke/apc.c
--- trunk/reactos/ntoskrnl/ke/apc.c	2006-01-15 08:49:26 UTC (rev 20883)
+++ trunk/reactos/ntoskrnl/ke/apc.c	2006-01-15 08:51:20 UTC (rev 20884)
@@ -287,6 +287,8 @@
     PKAPC QueuedApc;
     NTSTATUS Status;
 
+    ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
+
     /* Acquire the lock (only needed on MP) */
     KeAcquireSpinLockAtDpcLevel(&Thread->ApcQueueLock);
 
@@ -790,7 +792,7 @@
         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);