}
VOID
+NTAPI
IopReportTargetDeviceChangeAsyncWorker(PVOID Context)
{
PINTERNAL_WORK_QUEUE_ITEM Item;
DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
DeviceObject, DeviceObject ? *DeviceObject : NULL);
- /* Create the service name (eg. ACPI_HAL) */
- ServiceName.Buffer = DriverObject->DriverName.Buffer +
- sizeof(DRIVER_ROOT_NAME) / sizeof(WCHAR) - 1;
- ServiceName.Length = DriverObject->DriverName.Length -
- sizeof(DRIVER_ROOT_NAME) + sizeof(WCHAR);
- ServiceName.MaximumLength = ServiceName.Length;
+ ServiceName = DriverObject->DriverExtension->ServiceKeyName;
/* If the interface type is unknown, treat it as internal */
if (LegacyBusType == InterfaceTypeUndefined)
/* We're enumerated already */
IopDeviceNodeSetFlag(DeviceNode, DNF_ENUMERATED);
-
+
/* We don't call AddDevice for devices reported this way */
IopDeviceNodeSetFlag(DeviceNode, DNF_ADDED);
IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
&DeviceNode->InstancePath);
- DPRINT1("Reported device: %S (%wZ)\n", HardwareId, &DeviceNode->InstancePath);
+ DPRINT("Reported device: %S (%wZ)\n", HardwareId, &DeviceNode->InstancePath);
/* Return the PDO */
if (DeviceObject) *DeviceObject = Pdo;
/* Check for valid PDO */
if (!IopIsValidPhysicalDeviceObject(PhysicalDeviceObject))
{
- KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG)PhysicalDeviceObject, 0, 0);
+ KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
}
/* FileObject must be null. PnP will fill in it */
/* Check for valid PDO */
if (!IopIsValidPhysicalDeviceObject(PhysicalDeviceObject))
{
- KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG)PhysicalDeviceObject, 0, 0);
+ KeBugCheckEx(PNP_DETECTED_FATAL_ERROR, 0x2, (ULONG_PTR)PhysicalDeviceObject, 0, 0);
}
/* FileObject must be null. PnP will fill in it */
Item->PhysicalDeviceObject = PhysicalDeviceObject;
Item->Callback = Callback;
Item->Context = Context;
- ExInitializeWorkItem(&(Item->WorkItem), (PWORKER_THREAD_ROUTINE)IopReportTargetDeviceChangeAsyncWorker, Item);
+ ExInitializeWorkItem(&(Item->WorkItem), IopReportTargetDeviceChangeAsyncWorker, Item);
/* Finally, queue the item, our work here is done */
ExQueueWorkItem(&(Item->WorkItem), DelayedWorkQueue);