Bewerken

Delen via


WdfIoResourceListUpdateDescriptor function (wdfresource.h)

[Applies to KMDF only]

The WdfIoResourceListUpdateDescriptor method updates a resource descriptor in a resource requirements list's logical configuration.

Syntax

void WdfIoResourceListUpdateDescriptor(
  [in] WDFIORESLIST            ResourceList,
  [in] PIO_RESOURCE_DESCRIPTOR Descriptor,
  [in] ULONG                   Index
);

Parameters

[in] ResourceList

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

[in] Descriptor

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

[in] Index

A zero-based value that is used as an index into the set of resource descriptors that are already in the logical configuration that ResourceList specifies.

Return value

None

Remarks

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

The WdfIoResourceListUpdateDescriptor method locates the resource descriptor that the Index parameter identifies. Then the method copies the resource descriptor that the Descriptor parameter specifies into the descriptor that Index specifies.

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

Examples

The following code example initializes a new resource descriptor and then calls WdfIoResourceListUpdateDescriptor to replace the second descriptor in a logical configuration with the new descriptor.

IO_RESOURCE_DESCRIPTOR newDescriptor;

RtlZeroMemory(
              &newDescriptor,
              sizeof(newDescriptor)
              );

newDescriptor.Option = 0;
newDescriptor.Type = CmResourceTypePort;
newDescriptor.ShareDisposition = CmResourceShareDeviceExclusive;
newDescriptor.Flags = CM_RESOURCE_PORT_IO|CM_RESOURCE_PORT_16_BIT_DECODE;
newDescriptor.u.Port.Length = 1;
newDescriptor.u.Port.Alignment = 0x01;
newDescriptor.u.Port.MinimumAddress.QuadPart = 0;
newDescriptor.u.Port.MaximumAddress.QuadPart = 0xFFFF;

WdfIoResourceListUpdateDescriptor(
                                  Reslist,
                                  &newDescriptor,
                                  1
                                  );

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

IO_RESOURCE_DESCRIPTOR