Author: hpoussin
Date: Sun Jul 2 22:34:21 2006
New Revision: 22773
URL:
http://svn.reactos.org/svn/reactos?rev=22773&view=rev
Log:
Implement IopReinitializeBootDrivers, on the model of IopReinitializeDrivers
Modified:
trunk/reactos/ntoskrnl/include/internal/io.h
trunk/reactos/ntoskrnl/io/iomgr/driver.c
trunk/reactos/ntoskrnl/io/iomgr/iomgr.c
Modified: trunk/reactos/ntoskrnl/include/internal/io.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/io.h Sun Jul 2 22:34:21 2006
@@ -810,6 +810,12 @@
VOID
);
+VOID
+FASTCALL
+IopReinitializeBootDrivers(
+ VOID
+);
+
//
// File Routines
//
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/driver.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/driver.c Sun Jul 2 22:34:21 2006
@@ -79,7 +79,7 @@
PUNICODE_STRING ModuleName,
PLDR_DATA_TABLE_ENTRY *ModuleObject);
-VOID
+static VOID
FASTCALL
INIT_FUNCTION
IopDisplayLoadingMessage(PVOID ServiceName,
@@ -493,8 +493,6 @@
DPRINT("RtlQueryRegistryValues() failed (Status %x)\n", Status);
return Status;
}
-
- //IopDisplayLoadingMessage(ServiceName->Buffer, TRUE);
/*
* Normalize the image path for all later processing.
@@ -1702,6 +1700,50 @@
}
}
+VOID FASTCALL
+IopReinitializeBootDrivers(VOID)
+{
+ PDRIVER_REINIT_ITEM ReinitItem;
+ PLIST_ENTRY Entry;
+ KIRQL Irql;
+
+ KeAcquireSpinLock(&DriverBootReinitListLock,
+ &Irql);
+
+ DriverBootReinitTailEntry = IsListEmpty(&DriverBootReinitListHead) ? NULL :
DriverBootReinitListHead.Blink;
+ Entry = DriverBootReinitTailEntry;
+
+ KeReleaseSpinLock(&DriverBootReinitListLock,
+ Irql);
+
+ if (Entry == NULL)
+ {
+ return;
+ }
+
+ for (;;)
+ {
+ Entry = ExInterlockedRemoveHeadList(&DriverBootReinitListHead,
+ &DriverBootReinitListLock);
+ if (Entry == NULL)
+ return;
+
+ ReinitItem = (PDRIVER_REINIT_ITEM)CONTAINING_RECORD(Entry, DRIVER_REINIT_ITEM,
ItemEntry);
+
+ /* Increment reinitialization counter */
+ ReinitItem->DriverObject->DriverExtension->Count++;
+
+ ReinitItem->ReinitRoutine(ReinitItem->DriverObject,
+ ReinitItem->Context,
+ ReinitItem->DriverObject->DriverExtension->Count);
+
+ ExFreePool(Entry);
+
+ if (Entry == DriverBootReinitTailEntry)
+ return;
+ }
+}
+
/* PUBLIC FUNCTIONS ***********************************************************/
@@ -2110,7 +2152,7 @@
ExInterlockedInsertTailList(
&DriverBootReinitListHead,
&ReinitItem->ItemEntry,
- &DriverReinitListLock);
+ &DriverBootReinitListLock);
}
/*
Modified: trunk/reactos/ntoskrnl/io/iomgr/iomgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iomgr.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iomgr.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iomgr.c Sun Jul 2 22:34:21 2006
@@ -470,6 +470,9 @@
IopInitializeSystemDrivers();
IoDestroyDriverList();
+ /* Call back drivers that asked for */
+ IopReinitializeBootDrivers();
+
/* Stop boot logging */
IopStopBootLog();