{
/* Create the PDO */
Status = PnpRootCreateDevice(&ServiceName,
- DriverObject,
+ NULL,
&Pdo,
NULL);
if (!NT_SUCCESS(Status))
return Status;
}
+ /* We're enumerated already */
+ IopDeviceNodeSetFlag(DeviceNode, DNF_ENUMERATED);
+
/* We don't call AddDevice for devices reported this way */
IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED);
/* Close the instance key handle */
ZwClose(InstanceKey);
+ /* Register the given DO with PnP root if required */
+ if (DeviceObject && *DeviceObject)
+ PnpRootRegisterDevice(*DeviceObject);
+
/* Report the device's enumeration to umpnpmgr */
IopQueueTargetDeviceEvent(&GUID_DEVICE_ENUMERATED,
&DeviceNode->InstancePath);