信息
您所需的主题如下所示。但此主题未包含在此库中。

WdfIoResourceRequirementsListRemoveByIoResList 方法

The WdfIoResourceRequirementsListRemoveByIoResList method removes a logical configuration from a resource requirements list.

语法

VOID WdfIoResourceRequirementsListRemoveByIoResList(
  [in]  WDFIORESREQLIST RequirementsList,
  [in]  WDFIORESLIST IoResList
);

参数

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.

返回值

None.

A system 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.

示例

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;
            }
        }
    }
...
}

要求

版本

Available in version 1.0 and later versions of KMDF.

标头

Wdfresource.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<=DISPATCH_LEVEL

另请参见

IO_RESOURCE_DESCRIPTOR
WdfIoResourceRequirementsListGetCount
WdfIoResourceRequirementsListGetIoResList
WdfIoResourceListGetCount
WdfIoResourceListGetDescriptor
WdfIoResourceRequirementsListRemove

 

 

社区附加资源

显示:
© 2014 Microsoft