WdfCmResourceListGetCount 함수(wdfresource.h)
[KMDF 및 UMDF에 적용]
WdfCmResourceListGetCount 메서드는 지정된 리소스 목록에 포함된 리소스 설명자 수를 반환합니다.
통사론
ULONG WdfCmResourceListGetCount(
[in] WDFCMRESLIST List
);
매개 변수
[in] List
디바이스의 하드웨어 리소스 목록을 나타내는 프레임워크 리소스 목록 개체에 대한 핸들입니다.
반환 값
WdfCmResourceListGetCountList 매개 변수가 지정하는 리소스 목록에 포함된 리소스 설명자 수를 반환합니다.
드라이버가 잘못된 개체 핸들을 제공하는 경우 시스템 버그 검사가 발생합니다.
발언
리소스 목록에 대한 자세한 내용은 Framework-Based 드라이버 하드웨어 리소스를 참조하세요.
예제
다음 코드 예제에서는 EvtDevicePrepareHardware 콜백 함수가 PnP(플러그 앤 플레이) 관리자가 디바이스에 할당한 변환된 하드웨어 리소스 목록에서 메모리, 포트 및 인터럽트 리소스를 찾는 방법을 보여 줍니다.
NTSTATUS
MyEvtDevicePrepareHardware (
WDFDEVICE Device,
WDFCMRESLIST Resources,
WDFCMRESLIST ResourcesTranslated
)
{
ULONG i;
PCM_PARTIAL_RESOURCE_DESCRIPTOR desc;
for (i = 0; i < WdfCmResourceListGetCount(ResourcesTranslated); i++) {
desc = WdfCmResourceListGetDescriptor(
ResourcesTranslated,
i
);
switch (desc->Type) {
case CmResourceTypeMemory:
//
// Handle memory resources here.
//
break;
case CmResourceTypePort:
//
// Handle port resources here.
//
break;
case CmResourceTypeInterrupt:
//
// Handle interrupt resources here.
//
break;
default:
//
// Ignore all other descriptors.
//
break;
}
}
}
요구 사항
요구 | 값 |
---|---|
대상 플랫폼 | 보편적 |
최소 KMDF 버전 | 1.0 |
최소 UMDF 버전 | 2.0 |
헤더 | wdfresource.h(Wdf.h 포함) |
라이브러리 | Wdf01000.sys(KMDF); WUDFx02000.dll(UMDF) |
IRQL | <=DISPATCH_LEVEL |
DDI 규정 준수 규칙 | DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf) |