mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
This is first part of patch to get loading boot bus drivers working. The loading still doesn't work, but it doesn't crash at least.
Changes: - Added BootDriver parameter to IopInitializeDriver. - Changed second parameter of IopInitializeDevice to BootDriver. - Avoid initalizing boot bus drivers in IopInitializeDevice - Remove thrid parameter (BootDriversOnly) of IopInterrogateBusExtender, because it isn't used - Enabled calling of IopLoadBootStartDrivers in ExpInitializeExecutive. - Disabled some debug messages - Some other small fixies svn path=/trunk/; revision=6194
This commit is contained in:
parent
0ddc55f416
commit
eb69ba9ec2
7 changed files with 46 additions and 36 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 <internal/debug.h>
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue