When a device driver’s ConfigCallback routine returns, its DriverEntry routine can use the configuration information collected from its subkeys under \Registry\Machine\Hardware\Description, from calls to HalGetBusData or HalGetBusDataByOffset, and/or from its Parameters subkey(s) under \Registry\Machine\System\CurrentControlSet\Services\DriverName in calls to one or more of HalTranslateBusAddress, HalGetInterruptVector, and HalGetAdapter. The driver can use the values returned by these HAL support routines as parameters to “higher-level” NT routines such as MmMapIoSpace, IoConnectInterrupt, HalAllocateCommonBuffer, and, after initialization IoAllocateAdapterChannel.
When an NT device driver has set up any NT objects that it needs, such as device objects, but before the driver attempts to access its device(s) registers or I/O ports, the DriverEntry routine must call one of the following support routines one or more times to write configuration information about the hardware resources the driver and its device(s) will be using into the registry:
Usually, device drivers that call IoQueryDeviceDescription also call IoReportResourceUsage, possibly after supplementing the returned hardware configuration information in a buffered CM_RESOURCE_LIST that includes DeviceSpecificData.
Usually, device drivers that call HalGetBusData also call IoAssignResources. Such a driver also might call IoReportResourceUsage with the CM_RESOURCE_LIST returned by IoAssignResources to which the driver has appended its DeviceSpecificData before calling IoReportResourceUsage.
Device drivers that call HalGetBusDataByOffset or HalGetBusData with an input BusDataType for such a dynamically configurable I/O bus can call HalAssignSlotResources. Such a driver also might call HalSetBusDataByOffset or HalSetBusData to configure its device on the bus.
A successful call to IoReportResourceUsage, IoAssignResources, or HalAssignSlotResources claims a set of hardware resources for the caller in the \Registry\Machine\Hardware\ResourceMap tree. Making such a call prevents device drivers that load later from trying to use the hardware resources already claimed by a loaded driver.
A subsequent call to any of the preceding support routines to claim resources for the same device(s) overwrites the existing resource claims for the driver or for the particular device in the registry ResourceMap.
Any NT device driver can call one or more of these routines more than once to claim resources for itself or for a particular device. If it does, the caller cannot attempt to claim a single resource at a time, assuming that its previously claimed resources remain claimed. Instead, such a caller must augment the list of claimed resources for the driver or for any particular device at each call to these support routines.