WdfIoResourceRequirementsListRemoveByIoResList function (wdfresource.h)
[Applies to KMDF only]
The WdfIoResourceRequirementsListRemoveByIoResList method removes a logical configuration from a resource requirements list.
Syntax
void WdfIoResourceRequirementsListRemoveByIoResList(
[in] WDFIORESREQLIST RequirementsList,
[in] WDFIORESLIST IoResList
);
Parameters
[in] RequirementsList
A handle to a framework resource-requirements-list object that represents a device's resource requirements list.
[in] IoResList
A handle to a framework resource-range-list object that represents the logical configuration to be removed from the resource requirements list that RequirementsList specifies.
Return value
None
Remarks
A bug check occurs if the driver supplies an invalid object handle.
The WdfIoResourceRequirementsListRemoveByIoResList method removes the logical configuration that is associated with the handle that the IoResList parameter specifies.
When WdfIoResourceRequirementsListRemoveByIoResList removes the logical configuration that has the index value n, the index value of the next logical configuration changes from n+1 to n.
For more information about resource requirements lists, see Hardware Resources for Framework-Based Drivers.
Examples
The following code example searches the logical configurations in a device's resource requirements list to find a configuration that contains a specific port address. If the example finds that configuration, it removes the configuration.
NTSTATUS
Example_EvtDeviceFilterRemoveResourceRequirements(
IN WDFDEVICE Device,
IN WDFIORESREQLIST RequirementsList
)
{
ULONG i, j, reqCount, resCount;
BOOLEAN descriptorFound = FALSE;
//
// Obtain the number of logical configurations.
//
reqCount = WdfIoResourceRequirementsListGetCount(RequirementsList);
//
// Search each logical configuration.
//
for (i = 0; i < reqCount; i++) {
WDFIORESLIST reslist;
if (descriptorFound) {
break;
}
reslist = WdfIoResourceRequirementsListGetIoResList(RequirementsList, i);
//
// Get the number of resource descriptors that
// are in this logical configuration.
//
resCount = WdfIoResourceListGetCount(reslist);
for (j = 0; j < resCount; j++) {
PIO_RESOURCE_DESCRIPTOR descriptor;
//
// Get the next resource descriptor.
//
descriptor = WdfIoResourceListGetDescriptor(
reslist,
j
);
//
// Stop if this descriptor is the port descriptor
// that we're looking for.
//
if (descriptor->Type == CmResourceTypePort) {
if ((descriptor->u.Port.MinimumAddress) == PORT_RANGE_A) {
WdfIoResourceRequirementsListRemoveByIoResList(
RequirementsList,
reslist
);
descriptorFound = TRUE;
break;
}
}
}
...
}
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Header | wdfresource.h (include Wdf.h) |
Library | Wdf01000.sys (see Framework Library Versioning.) |
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf) |
See also
WdfIoResourceListGetDescriptor
WdfIoResourceRequirementsListGetCount