mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 19:31:45 +00:00
[PNPMGR]
- Fix IoReportDetectedDevice to use the caller's driver object svn path=/trunk/; revision=53392
This commit is contained in:
parent
4ee1da837b
commit
6cf62841ad
4 changed files with 15 additions and 13 deletions
|
@ -1022,6 +1022,7 @@ PnpRootDriverEntry(
|
|||
NTSTATUS
|
||||
PnpRootCreateDevice(
|
||||
IN PUNICODE_STRING ServiceName,
|
||||
IN OPTIONAL PDRIVER_OBJECT DriverObject,
|
||||
OUT PDEVICE_OBJECT *PhysicalDeviceObject,
|
||||
OUT OPTIONAL PUNICODE_STRING FullInstancePath
|
||||
);
|
||||
|
|
|
@ -690,7 +690,7 @@ IopCreateDeviceNode(PDEVICE_NODE ParentNode,
|
|||
RtlAppendUnicodeStringToString(&FullServiceName, &LegacyPrefix);
|
||||
RtlAppendUnicodeStringToString(&FullServiceName, ServiceName1);
|
||||
|
||||
Status = PnpRootCreateDevice(&FullServiceName, &PhysicalDeviceObject, &Node->InstancePath);
|
||||
Status = PnpRootCreateDevice(&FullServiceName, NULL, &PhysicalDeviceObject, &Node->InstancePath);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("PnpRootCreateDevice() failed with status 0x%08X\n", Status);
|
||||
|
|
|
@ -202,12 +202,12 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
|
|||
if (DeviceObject && *DeviceObject)
|
||||
{
|
||||
Pdo = *DeviceObject;
|
||||
DeviceNode = IopGetDeviceNode(*DeviceObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Create the PDO */
|
||||
Status = PnpRootCreateDevice(&ServiceName,
|
||||
DriverObject,
|
||||
&Pdo,
|
||||
NULL);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -215,18 +215,18 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
|
|||
DPRINT("PnpRootCreateDevice() failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the device node for the new PDO */
|
||||
Status = IopCreateDeviceNode(IopRootDeviceNode,
|
||||
Pdo,
|
||||
NULL,
|
||||
&DeviceNode);
|
||||
/* Create the device node for the new PDO */
|
||||
Status = IopCreateDeviceNode(IopRootDeviceNode,
|
||||
Pdo,
|
||||
NULL,
|
||||
&DeviceNode);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* We don't call AddDevice for devices reported this way */
|
||||
|
|
|
@ -130,6 +130,7 @@ LocateChildDevice(
|
|||
NTSTATUS
|
||||
PnpRootCreateDevice(
|
||||
IN PUNICODE_STRING ServiceName,
|
||||
IN OPTIONAL PDRIVER_OBJECT DriverObject,
|
||||
OUT PDEVICE_OBJECT *PhysicalDeviceObject,
|
||||
OUT OPTIONAL PUNICODE_STRING FullInstancePath)
|
||||
{
|
||||
|
@ -271,7 +272,7 @@ tryagain:
|
|||
|
||||
/* Initialize a device object */
|
||||
Status = IoCreateDevice(
|
||||
PnpRootDeviceObject->DriverObject,
|
||||
DriverObject ? DriverObject : PnpRootDeviceObject->DriverObject,
|
||||
sizeof(PNPROOT_PDO_DEVICE_EXTENSION),
|
||||
NULL,
|
||||
FILE_DEVICE_CONTROLLER,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue