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 會傳回架構 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;
            }
        }
    }
...
}

規格需求

需求
目標平台 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

WdfIoResourceListGetCount

WdfIoResourceListGetDescriptor

WdfIoResourceRequirementsListGetCount