WdfIoResourceListUpdateDescriptor 函式 (wdfresource.h)

[僅適用於 KMDF]

WdfIoResourceListUpdateDescriptor 方法會更新資源需求清單中的資源描述元邏輯組態

語法

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

參數

[in] ResourceList

架構 resource-range-list 物件的句柄,代表裝置硬體資源的邏輯設定。

[in] Descriptor

描述硬體資源的 IO_RESOURCE_DESCRIPTOR 結構的指標。

[in] Index

以零起始的值,用來做為資源描述元集的索引,這些描述項已在 ResourceList 指定的邏輯組態中。

傳回值

備註

如果驅動程式提供無效的物件句柄,就會發生錯誤檢查。

WdfIoResourceListUpdateDescriptor 方法會找出 Index 參數所識別的資源描述元。 然後,方法會將 描述元 參數所指定的資源描述項複製到 Index 所指定的描述元中。

如需資源需求清單和邏輯組態的詳細資訊,請參閱 Framework-Based 驅動程式的硬體資源

範例

下列程式代碼範例會初始化新的資源描述元,然後呼叫 WdfIoResourceListUpdateDescriptor ,以新的描述元取代邏輯組態中的第二個描述元。

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
                                  );

規格需求

需求
目標平台 Universal
最低 KMDF 版本 1.0
標頭 wdfresource.h (包含 Wdf.h)
程式庫 Wdf01000.sys (請參閱 Framework Library Versioning.)
IRQL <=DISPATCH_LEVEL
DDI 合規性規則 DriverCreate (kmdf) KmdfIrql (kmdf) KmdfIrql2 (kmdf) 、 KmdfIrqlExplicit (kmdf)

另請參閱

IO_RESOURCE_DESCRIPTOR