BDA 필터 구성

BDA 미니 드라이버는 현재 필터 그래프에서 미니 드라이버에 대한 필터 instance 구성하기 위해 설정된 KSMETHODSETID_BdaDeviceConfiguration 메서드의 메서드 요청을 처리합니다.

다음 코드 조각에서는 KSMETHODSETID_BdaDeviceConfiguration 메서드 집합의 메서드 중 두 가지가 BDA 지원 라이브러리에 직접 디스패치되고 나머지 메서드는 BDA 지원 라이브러리로 디스패치하기 전에 먼저 BDA 미니드라이버에 의해 가로채집니다.

//
//  BDA Device Configuration Method Set
//
//  Defines the dispatch routines for the filter level
//  topology configuration methods
//
DEFINE_KSMETHOD_TABLE(BdaDeviceConfigurationMethods)
{
    DEFINE_KSMETHOD_ITEM_BDA_CREATE_PIN_FACTORY(
        BdaMethodCreatePin,
        NULL
        ),
    DEFINE_KSMETHOD_ITEM_BDA_DELETE_PIN_FACTORY(
        BdaMethodDeletePin,
        NULL
        ),
    DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(
        CFilter::CreateTopology,
        NULL
        )
};
/*
** CreateTopology()
**
** Keeps track of topology association between input and output pins
**
*/
NTSTATUS
CFilter::
CreateTopology(
    IN PIRP         pIrp,
    IN PKSMETHOD    pKSMethod,
    PVOID           pvIgnored
    )
{
    NTSTATUS            Status = STATUS_SUCCESS;
    CFilter *           pFilter;
    ULONG               ulPinType;
    PKSFILTER           pKSFilter;

    ASSERT( pIrp);
    ASSERT( pKSMethod);

    //  Obtain a "this" pointer for the method.
    //
    //  Because this function is called directly from the property 
    //  dispatch table, get pointer to the underlying object.
    //
    pFilter = FilterFromIRP( pIrp);
    ASSERT( pFilter);
    if (!pFilter)
    {
        Status = STATUS_INVALID_PARAMETER;
        goto errExit;
    }

    //  Let the BDA support library create the standard topology.
    //  It will also validate the method, instance count, etc.
    //
    Status = BdaMethodCreateTopology( pIrp, pKSMethod, pvIgnored);
    if (Status != STATUS_SUCCESS)
    {
        goto errExit;
    }

    //  This is where the filter can keep track of associated pins.
    //
errExit:
    return Status;
}

KSMETHOD_BDA_CREATE_TOPOLOGY 메서드 요청은 미니드라이버의 CFilter::CreateTopology 메서드를 호출합니다. 이 메서드는 BDA 지원 라이브러리 함수 BdaMethodCreateTopology 를 호출하여 필터 핀 간에 토폴로지를 만듭니다. 이 함수는 실제로 링 3에 토폴로지 구조를 만듭니다. 이 구조는 필터의 알려진 연결을 다른 속성 집합에 반영합니다. BDA 미니드라이버가 특정 핀 유형을 연결할 때 하드웨어에 특별한 지침을 보내야 하는 경우(예: BDA 디바이스가 하드웨어 제거를 수행하고 단일 입력 핀에서 팬오프된 임의의 수의 출력 핀을 만드는 경우) 앞의 코드 조각에 표시된 대로 BDA 미니드라이버가 KSMETHOD_BDA_CREATE_TOPOLOGY 메서드 요청을 가로채야 합니다.