Modifying a Resource Requirements List
After the PnP manager has ensured that all of a newly connected device's drivers have been loaded, it sends the device's hardware requirements list to the device's driver stack.
As the list travels down the stack, the framework calls each function and filter driver's EvtDeviceFilterRemoveResourceRequirements callback function, passing the hardware requirements list as an input argument. This callback function can remove hardware resources from the hardware requirements list that the bus driver has specified but that the function driver determines are not necessary for the device to operate.
For example, a PCI bus driver might, in accordance with the PCI specification, replicate an I/O space resource in memory space. If your device can operate without using the I/O space resource, the device's function driver can remove the I/O space resource from the hardware requirements list.
To remove items from the requirements list, a driver can do the following:
- Call the following methods to modify the logical configurations in the resource requirements list:
- WdfIoResourceRequirementsListGetCount, to obtain the number of logical configurations.
- WdfIoResourceRequirementsListGetIoResList, to obtain access to a logical configuration.
- WdfIoResourceRequirementsListRemove and WdfIoResourceRequirementsListRemoveByIoResList, to remove a logical configuration.
- Call the following methods to modify the resource descriptors within a logical configuration:
- WdfIoResourceListGetCount, to obtain the number of resource descriptors.
- WdfIoResourceListGetDescriptor, to obtain access to a resource descriptor.
- WdfIoResourceListRemove and WdfIoResourceListRemoveByDescriptor, to remove a resource descriptor.
As the list travels back up the driver stack, the framework calls each function and filter driver's EvtDeviceFilterAddResourceRequirements callback function, passing the hardware requirements list as an input argument. This callback function can add additional hardware resources that the function driver requires to make the device operational.
To add items to the hardware requirements list, a driver can do the following:
- Call the following methods to modify the logical configurations in the resource requirements list:
- WdfIoResourceRequirementsListGetCount, to obtain the number of logical configurations.
- WdfIoResourceRequirementsListGetIoResList, to obtain access to a logical configuration.
- WdfIoResourceListCreate, to create a new logical configuration.
- WdfIoResourceRequirementsListAppendIoResList or WdfIoResourceRequirementsListInsertIoResList, to add a new logical configuration.
- Call the following methods to modify the resource descriptors within a logical configuration:
- WdfIoResourceListGetCount, to obtain the number of resource descriptors.
- WdfIoResourceListGetDescriptor, to obtain access to a resource descriptor.
- WdfIoResourceListAppendDescriptor or WdfIoResourceListInsertDescriptor, to add a resource descriptor.