WdfIoResourceRequirementsListRemoveByIoResList method

[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

RequirementsList [in]

A handle to a framework resource-requirements-list object that represents a device's resource requirements list.

IoResList [in]

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.

A system bug check occurs if the driver supplies an invalid object handle.

Remarks

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

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, KmdfIrql, KmdfIrql2

See also

IO_RESOURCE_DESCRIPTOR
WdfIoResourceRequirementsListGetCount
WdfIoResourceRequirementsListGetIoResList
WdfIoResourceListGetCount
WdfIoResourceListGetDescriptor
WdfIoResourceRequirementsListRemove

 

 

Send comments about this topic to Microsoft

Afficher:
© 2014 Microsoft