diff --git a/reactos/ntoskrnl/include/internal/io.h b/reactos/ntoskrnl/include/internal/io.h index 4bdc3aa72f5..959dedef0e0 100644 --- a/reactos/ntoskrnl/include/internal/io.h +++ b/reactos/ntoskrnl/include/internal/io.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: io.h,v 1.34 2003/08/24 11:35:41 dwelch Exp $ +/* $Id: io.h,v 1.35 2003/09/29 20:43:06 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -260,8 +260,7 @@ NTSTATUS IopFreeDeviceNode(PDEVICE_NODE DeviceNode); NTSTATUS IopInterrogateBusExtender(PDEVICE_NODE DeviceNode, - PDEVICE_OBJECT Pdo, - BOOLEAN BootDriversOnly); + PDEVICE_OBJECT Pdo); VOID IopLoadBootStartDrivers(VOID); NTSTATUS @@ -277,7 +276,8 @@ IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry, PDEVICE_NODE DeviceNode, BOOLEAN FileSystemDriver, PVOID DriverImageStart, - ULONG DriverImageSize); + ULONG DriverImageSize, + BOOLEAN BootDriver); VOID IoInitCancelHandling(VOID); VOID diff --git a/reactos/ntoskrnl/io/device.c b/reactos/ntoskrnl/io/device.c index 12ceb30ddd2..85a2c9a1491 100644 --- a/reactos/ntoskrnl/io/device.c +++ b/reactos/ntoskrnl/io/device.c @@ -1,4 +1,4 @@ -/* $Id: device.c,v 1.60 2003/09/25 20:04:27 ekohl Exp $ +/* $Id: device.c,v 1.61 2003/09/29 20:43:06 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -365,7 +365,7 @@ IopAttachFilterDrivers(PDEVICE_NODE DeviceNode, NTSTATUS IopInitializeDevice(PDEVICE_NODE DeviceNode, - BOOLEAN BootDriversOnly) + BOOLEAN BootDriver) { IO_STATUS_BLOCK IoStatusBlock; PDRIVER_OBJECT DriverObject; @@ -424,12 +424,22 @@ IopInitializeDevice(PDEVICE_NODE DeviceNode, { DPRINT("Bus extender found\n"); - Status = IopInterrogateBusExtender( - DeviceNode, Fdo, BootDriversOnly); - if (!NT_SUCCESS(Status)) + /* + * Don't initialize boot bus drivers here, because + * it will not be able to load the required drivers + * for the devices found. + * + * FiN + */ + if (!BootDriver) { - ObDereferenceObject(Fdo); - return(Status); + Status = IopInterrogateBusExtender( + DeviceNode, Fdo); + if (!NT_SUCCESS(Status)) + { + ObDereferenceObject(Fdo); + return(Status); + } } } else if (Fdo->DeviceType == FILE_DEVICE_ACPI) @@ -473,7 +483,8 @@ IopInitializeService( } Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode, FALSE, - ModuleObject->Base, ModuleObject->Length); + ModuleObject->Base, ModuleObject->Length, + FALSE); if (!NT_SUCCESS(Status)) { LdrUnloadModule(ModuleObject); @@ -482,10 +493,11 @@ IopInitializeService( CPRINT("A driver failed to initialize\n"); return(Status); } + } else + { + Status = IopInitializeDevice(DeviceNode, FALSE); } - Status = IopInitializeDevice(DeviceNode, FALSE); - return(Status); } @@ -601,7 +613,8 @@ IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry, PDEVICE_NODE DeviceNode, BOOLEAN FileSystemDriver, PVOID DriverImageStart, - ULONG DriverImageSize) + ULONG DriverImageSize, + BOOLEAN BootDriver) /* * FUNCTION: Called to initalize a loaded driver * ARGUMENTS: @@ -653,7 +666,7 @@ IopInitializeDriver(PDRIVER_INITIALIZE DriverEntry, return(Status); } - Status = IopInitializeDevice(DeviceNode, TRUE); + Status = IopInitializeDevice(DeviceNode, BootDriver); return(Status); } diff --git a/reactos/ntoskrnl/io/driver.c b/reactos/ntoskrnl/io/driver.c index e714eb7f636..5faf6324527 100644 --- a/reactos/ntoskrnl/io/driver.c +++ b/reactos/ntoskrnl/io/driver.c @@ -1,4 +1,4 @@ -/* $Id: driver.c,v 1.17 2003/09/25 18:29:44 navaraf Exp $ +/* $Id: driver.c,v 1.18 2003/09/29 20:43:06 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -224,7 +224,8 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName) DeviceNode, (Type == 2 || Type == 8), ModuleObject->Base, - ModuleObject->Length); + ModuleObject->Length, + FALSE); if (!NT_SUCCESS(Status)) { DPRINT1("IopInitializeDriver() failed (Status %lx)\n", Status); diff --git a/reactos/ntoskrnl/io/iomgr.c b/reactos/ntoskrnl/io/iomgr.c index a7e3b7678e2..de16699d656 100644 --- a/reactos/ntoskrnl/io/iomgr.c +++ b/reactos/ntoskrnl/io/iomgr.c @@ -1,4 +1,4 @@ -/* $Id: iomgr.c,v 1.37 2003/08/24 11:35:41 dwelch Exp $ +/* $Id: iomgr.c,v 1.38 2003/09/29 20:43:07 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -375,7 +375,8 @@ VOID IoInit2(VOID) DeviceNode, TRUE, NULL, - 0); + 0, + FALSE); if (!NT_SUCCESS(Status)) { IopFreeDeviceNode(DeviceNode); diff --git a/reactos/ntoskrnl/io/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr.c index 992a74d4258..bb25cdf3c36 100644 --- a/reactos/ntoskrnl/io/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr.c @@ -1,4 +1,4 @@ -/* $Id: pnpmgr.c,v 1.16 2003/09/28 12:52:53 navaraf Exp $ +/* $Id: pnpmgr.c,v 1.17 2003/09/29 20:43:07 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -26,7 +26,7 @@ DEFINE_GUID(GUID_CLASS_COMPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4 DEFINE_GUID(GUID_SERENUM_BUS_ENUMERATOR, 0x4D36E978L, 0xE325, 0x11CE, 0xBF, 0xC1, 0x08, 0x00, 0x2B, 0xE1, 0x03, 0x18); #endif // DEFINE_GUID -//#define NDEBUG +#define NDEBUG #include @@ -1064,18 +1064,17 @@ IopActionInitChildServices( NTSTATUS IopInterrogateBusExtender( PDEVICE_NODE DeviceNode, - PDEVICE_OBJECT Pdo, - BOOLEAN BootDriversOnly) + PDEVICE_OBJECT Pdo) { DEVICETREE_TRAVERSE_CONTEXT Context; PDEVICE_RELATIONS DeviceRelations; - IO_STATUS_BLOCK IoStatusBlock; + IO_STATUS_BLOCK IoStatusBlock; PDEVICE_NODE ChildDeviceNode; IO_STACK_LOCATION Stack; NTSTATUS Status; ULONG i; - DPRINT("DeviceNode %x Pdo %x BootDriversOnly %d\n", DeviceNode, Pdo, BootDriversOnly); + DPRINT("DeviceNode %x Pdo %x\n", DeviceNode, Pdo); DPRINT("Sending IRP_MN_QUERY_DEVICE_RELATIONS to device stack\n"); @@ -1179,10 +1178,7 @@ IopInterrogateBusExtender( VOID IopLoadBootStartDrivers(VOID) { - IopInterrogateBusExtender( - IopRootDeviceNode, - IopRootDeviceNode->Pdo, - TRUE); + IopInterrogateBusExtender(IopRootDeviceNode, IopRootDeviceNode->Pdo); } VOID PnpInit(VOID) diff --git a/reactos/ntoskrnl/ke/main.c b/reactos/ntoskrnl/ke/main.c index 4ca33d96bf8..f82ed3d8fd2 100644 --- a/reactos/ntoskrnl/ke/main.c +++ b/reactos/ntoskrnl/ke/main.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: main.c,v 1.171 2003/09/25 05:12:24 vizzini Exp $ +/* $Id: main.c,v 1.172 2003/09/29 20:43:07 navaraf Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/main.c @@ -724,17 +724,15 @@ ExpInitializeExecutive(VOID) PiInitDefaultLocale(); -#if 0 /* * Load boot start drivers */ IopLoadBootStartDrivers(); -#else + /* * Load Auto configured drivers */ LdrLoadAutoConfigDrivers(); -#endif IoDestroyDriverList(); diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index f7bea8755b3..4722e5e4cb9 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -1,4 +1,4 @@ -/* $Id: loader.c,v 1.134 2003/08/24 11:35:41 dwelch Exp $ +/* $Id: loader.c,v 1.135 2003/09/29 20:43:07 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -540,7 +540,8 @@ LdrInitializeBootStartDriver(PVOID ModuleLoadBase, Status = IopInitializeDriver(ModuleObject->EntryPoint, DeviceNode, FALSE, ModuleObject->Base, - ModuleObject->Length); + ModuleObject->Length, + TRUE); if (!NT_SUCCESS(Status)) { IopFreeDeviceNode(DeviceNode);