- Fix a serious bug in Kernel Queues. A condition existed where an inserted kernel...
authorAlex Ionescu <aionescu@gmail.com>
Fri, 14 Jul 2006 02:26:44 +0000 (02:26 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Fri, 14 Jul 2006 02:26:44 +0000 (02:26 +0000)
- Thanks a lot to Thomas for his brutal test application which allowed me to discover this bug and the bugs addressed in the previous commits (related to the wait list and thread scheduler list corruption).

svn path=/trunk/; revision=23057

reactos/ntoskrnl/ke/kthread.c
reactos/ntoskrnl/ke/queue.c
reactos/ntoskrnl/ke/wait.c

index ec840ca..5cf0762 100644 (file)
@@ -764,7 +764,7 @@ KeInitializeThread(PKPROCESS Process,
     /* Initialize the Suspend Semaphore */
     KeInitializeSemaphore(&Thread->SuspendSemaphore, 0, 128);
 
-    /* FIXME OPTIMIZATION OF DOOM. DO NOT ENABLE FIXME */
+    /* Setup the timer */
     Timer = &Thread->Timer;
     KeInitializeTimer(Timer);
     TimerWaitBlock = &Thread->WaitBlock[TIMER_WAIT_BLOCK];
index 91f213d..7709d08 100644 (file)
@@ -390,6 +390,10 @@ KeRemoveQueue(IN PKQUEUE Queue,
                         &WaitBlock->WaitListEntry;
                     Timer->Header.WaitListHead.Blink =
                         &WaitBlock->WaitListEntry;
+                    WaitBlock->WaitListEntry.Flink =
+                        &Timer->Header.WaitListHead;
+                    WaitBlock->WaitListEntry.Blink =
+                        &Timer->Header.WaitListHead;
 
                     /* Create Timer */
                     KiInsertTimer(Timer, *Timeout);
@@ -427,8 +431,8 @@ KeRemoveQueue(IN PKQUEUE Queue,
                 /* Check if we had a timeout */
                 if (Timeout)
                 {
-                    /* FIXME: Fixup interval */
-                    DPRINT1("FIXME!!!\n");
+                    DPRINT1("If you see this message, contact Alex ASAP\n");
+                    KEBUGCHECK(0);
                 }
             }
 
index 2907728..31b7f5a 100644 (file)
@@ -360,7 +360,9 @@ KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode,
                 return WaitStatus;
             }
 
-            /* FIXME: Fixup interval */
+            /* Check if we had a timeout */
+            DPRINT1("If you see this message, contact Alex ASAP\n");
+            KEBUGCHECK(0);
         }
 
         /* Acquire again the lock */
@@ -533,7 +535,8 @@ KeWaitForSingleObject(PVOID Object,
             /* Check if we had a timeout */
             if (Timeout)
             {
-                 /* FIXME: Fixup interval */
+                DPRINT1("If you see this message, contact Alex ASAP\n");
+                KEBUGCHECK(0);
             }
         }
 
@@ -813,7 +816,8 @@ KeWaitForMultipleObjects(IN ULONG Count,
             /* Check if we had a timeout */
             if (Timeout)
             {
-                /* FIXME: Fixup interval */
+                DPRINT1("If you see this message, contact Alex ASAP\n");
+                KEBUGCHECK(0);
             }
 
             /* Acquire again the lock */