ExfInterlockedInsertTailList(): Permit uninitialized (zeroed) ListHead
authorshort <>
Thu, 30 Jan 2003 10:40:18 +0000 (10:40 +0000)
committershort <>
Thu, 30 Jan 2003 10:40:18 +0000 (10:40 +0000)
 - function is called on data initialized by ntoskrnl.exe->DriverEntry()
   - libcaptive does not call ntoskrnl.exe->DriverEntry()

ntoskrnl/ex/list.c

index d4b0e1c..55fdec5 100644 (file)
@@ -295,6 +295,10 @@ ExfInterlockedInsertTailList(IN PLIST_ENTRY ListHead,
     {
       Old = ListHead->Blink;
     }
+#ifdef LIBCAPTIVE
+  if (!ListHead->Flink && !ListHead->Blink)
+    InitializeListHead(ListHead);
+#endif /* LIBCAPTIVE */
   InsertTailList(ListHead,ListEntry);
   KeReleaseSpinLock(Lock,oldlvl);