BDA minidriver 會處理 KSMETHODSETID_BdaDeviceConfiguration 方法集的請求,以在當前篩選圖表中為 minidriver 配置篩選實例。
在下列代碼段中,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方法要求會呼叫 minidriver 的 CFilter::CreateTopology 方法。 此方法會呼叫 BDA 支援函式庫函式 BdaMethodCreateTopology ,以在濾波針腳之間建立拓撲。 此函式實際上會在 Ring 3 中建立拓撲結構,以反映其他屬性集的已知篩選連接。 BDA 迷你驅動程式應該攔截KSMETHOD_BDA_CREATE_TOPOLOGY方法要求,如上述代碼段所示,如果迷你驅動程式必須在連接特定針腳類型時將特殊指示傳送至硬體,例如,如果 BDA 裝置執行硬體解構,並建立從單一輸入針腳扇出任意數目的輸出針腳。