https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e5254974d22199c52766f5...
commit e5254974d22199c52766f5de43233c842020d7e9 Author: Victor Perevertkin victor.perevertkin@reactos.org AuthorDate: Tue Dec 22 20:52:20 2020 +0300 Commit: Victor Perevertkin victor.perevertkin@reactos.org CommitDate: Mon Jan 4 16:50:33 2021 +0300
[NTOS:IO] Start loading drivers from the disk only after SystemRoot is initialized
Add another PnPBootDriversInitialized variable to indicate a point where both disk subsystem and SystemRoot symlink are initialized, and use it in a PiCallDriverAddDevice call. --- ntoskrnl/io/iomgr/iomgr.c | 5 +++++ ntoskrnl/io/pnpmgr/devaction.c | 3 ++- ntoskrnl/io/pnpmgr/pnpinit.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/io/iomgr/iomgr.c b/ntoskrnl/io/iomgr/iomgr.c index d7dc1bcb8c4..5d272cb8af7 100644 --- a/ntoskrnl/io/iomgr/iomgr.c +++ b/ntoskrnl/io/iomgr/iomgr.c @@ -77,6 +77,7 @@ extern KSPIN_LOCK IopLogListLock; extern KSPIN_LOCK IopTimerLock;
extern PDEVICE_OBJECT IopErrorLogObject; +extern BOOLEAN PnPBootDriversInitialized;
GENERAL_LOOKASIDE IoLargeIrpLookaside; GENERAL_LOOKASIDE IoSmallIrpLookaside; @@ -583,6 +584,10 @@ IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock) return FALSE; }
+ // the disk subsystem is initialized here and the SystemRoot is set too + // we can finally load other drivers from the boot volume + PnPBootDriversInitialized = TRUE; + #if !defined(_WINKD_) && defined(KDBG) /* Read KDB Data */ KdbInit(); diff --git a/ntoskrnl/io/pnpmgr/devaction.c b/ntoskrnl/io/pnpmgr/devaction.c index 12f3e443c30..8b4db9d387a 100644 --- a/ntoskrnl/io/pnpmgr/devaction.c +++ b/ntoskrnl/io/pnpmgr/devaction.c @@ -35,6 +35,7 @@ extern ERESOURCE IopDriverLoadResource; extern BOOLEAN PnpSystemInit; extern PDEVICE_NODE IopRootDeviceNode; extern BOOLEAN PnPBootDriversLoaded; +extern BOOLEAN PnPBootDriversInitialized;
#define MAX_DEVICE_ID_LEN 200 #define MAX_SEPARATORS_INSTANCEID 0 @@ -1560,7 +1561,7 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode, IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED)) return STATUS_SUCCESS;
- PiCallDriverAddDevice(DeviceNode, PnPBootDriversLoaded); + PiCallDriverAddDevice(DeviceNode, PnPBootDriversInitialized); return STATUS_SUCCESS; }
diff --git a/ntoskrnl/io/pnpmgr/pnpinit.c b/ntoskrnl/io/pnpmgr/pnpinit.c index e32c11e930d..0667fd72785 100644 --- a/ntoskrnl/io/pnpmgr/pnpinit.c +++ b/ntoskrnl/io/pnpmgr/pnpinit.c @@ -24,6 +24,7 @@ PUNICODE_STRING PiInitGroupOrderTable; USHORT PiInitGroupOrderTableCount; INTERFACE_TYPE PnpDefaultInterfaceType; BOOLEAN PnPBootDriversLoaded = FALSE; +BOOLEAN PnPBootDriversInitialized = FALSE;
ARBITER_INSTANCE IopRootBusNumberArbiter; ARBITER_INSTANCE IopRootIrqArbiter;