mirror of
https://github.com/reactos/reactos.git
synced 2024-07-30 16:18:43 +00:00
[NTOSKRNL]
- First check if a driver object exists before trying to load the service module to properly handle boot drivers svn path=/trunk/; revision=55743
This commit is contained in:
parent
b175abf7c1
commit
94da11bec8
|
@ -560,35 +560,25 @@ IopAttachFilterDriversCallback(
|
||||||
ServiceName.MaximumLength =
|
ServiceName.MaximumLength =
|
||||||
ServiceName.Length = (USHORT)wcslen(Filters) * sizeof(WCHAR);
|
ServiceName.Length = (USHORT)wcslen(Filters) * sizeof(WCHAR);
|
||||||
|
|
||||||
/* Load and initialize the filter driver */
|
Status = IopGetDriverObject(&DriverObject,
|
||||||
Status = IopLoadServiceModule(&ServiceName, &ModuleObject);
|
&ServiceName,
|
||||||
if (Status != STATUS_IMAGE_ALREADY_LOADED)
|
FALSE);
|
||||||
{
|
if (!NT_SUCCESS(Status))
|
||||||
if (!NT_SUCCESS(Status))
|
{
|
||||||
continue;
|
/* Load and initialize the filter driver */
|
||||||
|
Status = IopLoadServiceModule(&ServiceName, &ModuleObject);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
continue;
|
||||||
|
|
||||||
Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName,
|
Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName,
|
||||||
FALSE, &DriverObject);
|
FALSE, &DriverObject);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* get existing DriverObject pointer */
|
|
||||||
Status = IopGetDriverObject(
|
|
||||||
&DriverObject,
|
|
||||||
&ServiceName,
|
|
||||||
FALSE);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DPRINT1("IopGetDriverObject() returned status 0x%08x!\n", Status);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = IopInitializeDevice(DeviceNode, DriverObject);
|
Status = IopInitializeDevice(DeviceNode, DriverObject);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
Loading…
Reference in a new issue