WdfCmResourceListRemove function (wdfresource.h)

[Applies to KMDF only]

The WdfCmResourceListRemove method removes a resource descriptor from a specified resource list.

Syntax

void WdfCmResourceListRemove(
  [in] WDFCMRESLIST List,
  [in] ULONG        Index
);

Parameters

[in] List

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

[in] Index

A zero-based value that is used as an index into the resource list that List specifies.

Return value

None

Remarks

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

The WdfCmResourceListRemove method removes the resource descriptor that is associated with the index value that the Index parameter specifies.

When WdfCmResourceListRemove 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 lists, see Hardware Resources for Framework-Based Drivers.

Examples

The following code example removes the third resource descriptor from the raw and translated lists of hardware resources that an EvtDeviceRemoveAddedResources callback function receives.

NTSTATUS
MyEvtDeviceRemoveAddedResources(
    WDFDEVICE Device,
    WDFCMRESLIST ResourcesRaw,
    WDFCMRESLIST ResourcesTranslated
    )
{
...
    WdfCmResourceListRemove(
                            ResourcesRaw,
                            2
                            );
    WdfCmResourceListRemove(
                            ResourcesTranslated,
                            2
                            );
...

}

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

WdfCmResourceListRemoveByDescriptor