NTSTATUS
IoQueryDeviceDescription(
IN PINTERFACE_TYPE BusType, /* optional */
IN PULONG BusNumber, /* optional */
IN PCONFIGURATION_TYPE ControllerType, /* optional */
IN PULONG ControllerNumber, /* optional */
IN PCONFIGURATION_TYPE PeripheralType, /* optional */
IN PULONG PeripheralNumber, /* optional */
IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
IN PVOID Context
);
IoQueryDeviceDescription retrieves hardware configuration information about a given bus, controller or peripheral object, or any combination of these three types from the \Registry\Machine\Hardware\Description tree.
NTSTATUS (*PIO_QUERY_DEVICE_ROUTINE) ( IN PVOID Context, IN PUNICODE_STRING PathName, IN INTERFACE_TYPE BusType, IN ULONG BusNumber, IN PKEY_VALUE_FULL_INFORMATION *BusInformation, IN CONFIGURATION_TYPE ControllerType, IN ULONG ControllerNumber, IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation, IN CONFIGURATION_TYPE PeripheralType, IN ULONG PeripheralNumber, IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation );
IoQueryDeviceDescription returns the STATUS_XXX returned by the callback routine.
This routine queries the registry for description(s) of the given bus type and number, controller type and number, and/or peripheral type and number. The information retrieved is passed to a driver-supplied ConfigCallback routine.
While the bus, controller, and peripheral parameters are each optional, the caller must supply at least one type parameter.
When the ConfigCallback routine returns control, these pointers become invalid. The driver’s ConfigCallback routine should save pertinent information about the I/O ports or device memory, the bus-relative interrupt vector or IRQL, and/or the DMA channel or port, that is available in the registry for the DriverEntry routine to use in subsequent calls to HalTranslateBusAddress (and possibly MmMapIoSpace), HalGetInterruptVector, and/or HalGetAdapter.
As an alternative, a driver can call HalGetBusData or HalGetBusDataByOffset to locate its device(s) and to retrieve bus-relative configuration information. Then, the driver can call IoAssignResources, which checks the input resource list against the hardware configuration information in the registry and also encapsulates most of the functionality of IoReportResourceUsage. As an alternative, drivers of PCI-type devices can call HalAssignSlotResources.
Callers of IoQueryDeviceDescription must be running at IRQL PASSIVE_LEVEL.
IoAssignResources, IoReportResourceUsage, HalAssignSlotResources, HalGetAdapter, HalGetBusData, HalGetBusDataByOffset, HalGetInterruptVector, HalTranslateBusAddress, MmMapIoSpace