WdfIoResourceListRemoveByDescriptor method

[Applies to KMDF only]

The WdfIoResourceListRemoveByDescriptor method removes a resource descriptor from a resource requirement list's logical configuration.

Syntax


VOID WdfIoResourceListRemoveByDescriptor(
  [in]  WDFIORESLIST ResourceList,
  [in]  PIO_RESOURCE_DESCRIPTOR Descriptor
);

Parameters

ResourceList [in]

A handle to a framework resource-range-list object that represents a logical configuration of hardware resources for a device.

Descriptor [in]

A pointer to an IO_RESOURCE_DESCRIPTOR structure that describes a hardware resource.

Return value

None.

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

Remarks

The WdfIoResourceListRemoveByDescriptor method removes the resource descriptor that matches the Descriptor parameter. To find a match, the method compares the specified resource descriptor with the resource descriptors in the logical configuration, byte for byte.

When WdfIoResourceListRemoveByDescriptor removes the resource descriptor that has the index value n, the index value of the next resource descriptor changes from n+1 to n.

For more information about resource requirements lists and logical configurations, see Hardware Resources for Framework-Based Drivers.

Examples

The following code example searches a logical configuration for a resource descriptor that contains a specified port address, and it removes that resource descriptor.


IO_RESOURCE_DESCRIPTOR descriptor;
ULONG resCount, j;

//
// 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, and remove the descriptor.
    //
    if (descriptor->Type == CmResourceTypePort) {
        if ((descriptor->u.port.MinimumAddress) == PORT_RANGE_A) {
               WdfIoResourceListRemoveByDescriptor(
                                                   Reslist,
                                                   descriptor
                                                   );
               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
WdfIoResourceListRemove

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft