共用方式為


WdfIoResourceRequirementsListGetIoResList 函式 (wdfresource.h)

[僅適用於 KMDF]

WdfIoResourceRequirementsListGetIoResList 方法會傳回架構 resource-range-list 物件的句柄,此物件代表指定資源需求清單中的指定 邏輯組態

語法

WDFIORESLIST WdfIoResourceRequirementsListGetIoResList(
  [in] WDFIORESREQLIST RequirementsList,
  [in] ULONG           Index
);

參數

[in] RequirementsList

架構 resource-requirements-list 物件的句柄,代表裝置的資源需求清單。

[in] Index

RequirementsList 所指定之資源需求清單中的索引,以零起始的值。

傳回值

WdfIoResourceRequirementsListGetIoResList 會傳回 framework resource-range-list 物件的句柄,代表 Index 參數所識別的邏輯組態,如果索引值有效。 否則,方法會傳回 null

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

言論

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

下列程式代碼範例會搜尋裝置的資源需求清單,以尋找描述中斷資源的第一個資源描述元。

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 an interrupt descriptor.
            //
            if (descriptor->Type == CmResourceTypeInterrupt) {
                descriptorFound = TRUE;
                break;
            }
        }
    }
...
}

要求

要求 價值
目標平臺 普遍
最低 KMDF 版本 1.0
標頭 wdfresource.h (包括 Wdf.h)
連結庫 Wdf01000.sys (請參閱架構連結庫版本控制。)
IRQL <=DISPATCH_LEVEL
DDI 合規性規則 DriverCreate(kmdf)KmdfIrql(kmdf)KmdfIrql2(kmdf),KmdfIrqlExplicit(kmdf)

另請參閱

IO_RESOURCE_DESCRIPTOR

WdfIoResourceListGetCount

WdfIoResourceListGetDescriptor

WdfIoResourceRequirementsListGetCount