⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objdesc.cpp

📁 winddk src目录下的WDM源码压缩!
💻 CPP
📖 第 1 页 / 共 3 页
字号:
        0,  // Specify the number of instances of this pin type that are necessary for proper functioning of this filter
        NULL,   // Allocator Framing
        CTransportPin::IntersectDataFormat    // Point to the data intersection handler function
    }
};


//
//  BDA Device Topology Property Set
//
//  The BDA Support Library supplies a default implementation of the
//  BDA Device Topology Property Set.  If the driver needs to override
//  this default implemenation, the definitions for the override properties
//  will be defined here.
//


//
//  BDA Change Sync Method Set
//
//  The Change Sync Method Set is required on BDA filters.  Setting a
//  node property should not become effective on the underlying device
//  until CommitChanges is called.
//
//  The BDA Support Library provides routines that handle committing
//  changes to topology.  The BDA Support Library routines should be
//  called from the driver's implementation before the driver implementation
//  returns.
//
DEFINE_KSMETHOD_TABLE(BdaChangeSyncMethods)
{
    DEFINE_KSMETHOD_ITEM_BDA_START_CHANGES(
        CFilter::StartChanges, // Calls BdaStartChanges
        NULL
        ),
    DEFINE_KSMETHOD_ITEM_BDA_CHECK_CHANGES(
        CFilter::CheckChanges, // Calls BdaCheckChanges
        NULL
        ),
    DEFINE_KSMETHOD_ITEM_BDA_COMMIT_CHANGES(
        CFilter::CommitChanges, // Calls BdaCommitChanges
        NULL
        ),
    DEFINE_KSMETHOD_ITEM_BDA_GET_CHANGE_STATE(
        CFilter::GetChangeState, // Calls BdaGetChangeState
        NULL
        )
};


//  Override the standard pin medium property set so that we can provide
//  device specific medium information.
//
//  Because the property is on a Pin Factory and not on a pin instance,
//  this is a filter property.
//
DEFINE_KSPROPERTY_TABLE( SampleFilterPropertyOverrides)
{

    DEFINE_KSPROPERTY_ITEM_PIN_MEDIUMS(
        CFilter::GetMedium
        )
};

DEFINE_KSPROPERTY_SET_TABLE(SampleFilterPropertySets)
{
    DEFINE_KSPROPERTY_SET
    (
        &KSPROPSETID_Pin,                            // Property Set GUID
        SIZEOF_ARRAY(SampleFilterPropertyOverrides), // Number of Properties
        SampleFilterPropertyOverrides,               // Array of KSPROPERTY_ITEM structures 
        0,                                           // FastIoCount
        NULL                                         // FastIoTable
    )

    //
    //  Additional property sets for the filter can be added here.
    //
};


//
//  BDA Device Configuration Method Set
//
//  The BDA Support Library provides a default implementation of
//  the BDA Device Configuration Method Set.  In this example, the
//  driver overrides the CreateTopology method.  Note that the
//  support libraries CreateTopology method is called before the
//  driver's implementation returns.
//
DEFINE_KSMETHOD_TABLE(BdaDeviceConfigurationMethods)
{
    DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(
        CFilter::CreateTopology, // Calls BdaMethodCreateTopology
        NULL
        )
};


//
//  Define an array of method sets that the filter supports
//
DEFINE_KSMETHOD_SET_TABLE(FilterMethodSets)
{
    DEFINE_KSMETHOD_SET
    (
        &KSMETHODSETID_BdaChangeSync,       // Method set GUID
        SIZEOF_ARRAY(BdaChangeSyncMethods), // Number of methods
        BdaChangeSyncMethods,               // Array of KSMETHOD_ITEM structures 
        0,                                  // FastIoCount
        NULL                                // FastIoTable
    ),

    DEFINE_KSMETHOD_SET
    (
        &KSMETHODSETID_BdaDeviceConfiguration,       // Method set GUID
        SIZEOF_ARRAY(BdaDeviceConfigurationMethods), // Number of methods
        BdaDeviceConfigurationMethods,  // Array of KSMETHOD_ITEM structures 
        0,                                           // FastIoCount
        NULL                                         // FastIoTable
    )
};


//
//  Filter Automation Table
//
//  Lists all Property, Method, and Event Set tables for the filter
//
DEFINE_KSAUTOMATION_TABLE(FilterAutomation) {
    //DEFINE_KSAUTOMATION_PROPERTIES(SampleFilterPropertySets),
    DEFINE_KSAUTOMATION_PROPERTIES_NULL,
    DEFINE_KSAUTOMATION_METHODS(FilterMethodSets),
    DEFINE_KSAUTOMATION_EVENTS_NULL
};


//
//  Filter Dispatch Table
//
//  Lists the dispatch routines for major events at the filter
//  level.
//
const
KSFILTER_DISPATCH
FilterDispatch =
{
    CFilter::Create,        // Create
    CFilter::FilterClose,   // Close
    NULL,                   // Process
    NULL                    // Reset
};

//
//  Define the name GUID for our digital tuner filter.
//
//  NOTE!  You must use a different GUID for each type of filter that
//  your driver exposes.
//
#define STATIC_KSNAME_BdaSWTunerFilter\
    0x91b0cc87L, 0x9905, 0x4d65, 0xa0, 0xd1, 0x58, 0x61, 0xc6, 0xf2, 0x2c, 0xbf
DEFINE_GUIDSTRUCT("91B0CC87-9905-4d65-A0D1-5861C6F22CBF", KSNAME_BdaSWTunerFilter);
#define KSNAME_BdaSWTunerFilter DEFINE_GUIDNAMED(KSNAME_BdaSWTunerFilter)

//  Must match the KSSTRING used in the installation INFs interface sections
//  AND must match the KSNAME GUID above.
//
#define KSSTRING_BdaSWTunerFilter L"{91B0CC87-9905-4d65-A0D1-5861C6F22CBF}"


//
//  Define the Filter Factory Descriptor for the filter
//
//  This structure brings together all of the structures that define
//  the tuner filter as it appears when it is first instantiated.
//  Note that not all of the template pin and node types may be exposed as
//  pin and node factories when the filter is first instanciated.
//
//  If a driver exposes more than one filter, each filter must have a
//  unique ReferenceGuid.
//
DEFINE_KSFILTER_DESCRIPTOR(InitialFilterDescriptor)
{
    &FilterDispatch,        // Dispatch
    &FilterAutomation,  // AutomationTable
    KSFILTER_DESCRIPTOR_VERSION,  // Version
    0,                                 // Flags
    &KSNAME_BdaSWTunerFilter,  // ReferenceGuid
    DEFINE_KSFILTER_PIN_DESCRIPTORS(InitialPinDescriptors), 
                                       // PinDescriptorsCount; must expose at least one pin
                                       // PinDescriptorSize; size of each item
                                       // PinDescriptors; table of pin descriptors
    DEFINE_KSFILTER_CATEGORY(KSCATEGORY_BDA_NETWORK_TUNER),
                                       // CategoriesCount; number of categories in the table
                                       // Categories; table of categories
    DEFINE_KSFILTER_NODE_DESCRIPTORS_NULL,              
                                       // NodeDescriptorsCount; in this case, 0
                                       // NodeDescriptorSize; in this case, 0
                                       // NodeDescriptors; in this case, NULL
    DEFINE_KSFILTER_DEFAULT_CONNECTIONS,
    // Automatically fills in the connections table for a filter which defines no explicit connections
                                       // ConnectionsCount; number of connections in the table
                                       // Connections; table of connections
    NULL                        // ComponentId; in this case, no ID is provided
};


//===========================================================================
//
//  Define Filter Template Topology 
//
//===========================================================================

//
//  Define BDA Template Topology Connections
//
//  Lists the Connections that are possible between pin types and
//  node types.  This, together with the Template Filter Descriptor, and
//  the Pin Pairings, describe how topologies can be created in the filter.
//
//                 ===========         ============
//  AntennaPin ----| RF Node |--Joint--|Demod Node|----TransportPin
//                 ===========         ============
//
//  The RF Node of this filter is controlled by the Antenna input pin.
//  RF properties will be set as NODE properties (with NodeType == 0)
//  on the filter's Antenna Pin
//
//  The Demodulator Node of this filter is controlled by the Transport output pin.
//  Demod properties will be set as NODE properties (with NodeType == 1)
//  on the filter's Transport Pin
//
const
KSTOPOLOGY_CONNECTION TemplateFilterConnections[] =
{   // KSFILTER_NODE  is defined as ((ULONG)-1) in ks.h 
     // Indicate pin types by the item number is the TemplatePinDescriptors array.
     // Indicate node types by either the item number in the NodeDescriptors array
     // or the element in the BDA_SAMPLE_NODE enumeration.
    { KSFILTER_NODE, 0,                 BDA_SAMPLE_TUNER_NODE, 0},
    { BDA_SAMPLE_TUNER_NODE, 1,         BDA_SAMPLE_DEMODULATOR_NODE, 0},
    { BDA_SAMPLE_DEMODULATOR_NODE, 1,   KSFILTER_NODE, 1}
};


//
//  Template Joints between the Antenna and Transport Pin Types.
//
//  Lists the template joints between the Antenna Input Pin Type and
//  the Transport Output Pin Type.
//
//  In this case the RF Node is considered to belong to the antennea input
//  pin and the 8VSB Demodulator Node is considered to belong to the
//  tranport stream output pin.
//
const
ULONG   AntennaTransportJoints[] =
{
    1 // joint occurs between the two node types (second element in array)
       // indicates that 1st node is controlled by input pin and 2nd node by output pin
};

//
//  Define Template Pin Parings.
//
//  Array of BDA_PIN_PAIRING structures that are used to determine 
//  which nodes get duplicated when more than one output pin type is 
//  connected to a single input pin type or when more that one input pin 
//  type is connected to a single output pin type.
//  
const
BDA_PIN_PAIRING TemplatePinPairings[] =
{
    //  Input pin to Output pin Topology Joints
    //
    {
        0,  // ulInputPin; 0 element in the TemplatePinDescriptors array.
        1,  // ulOutputPin; 1 element in the TemplatePinDescriptors array.
        1,  // ulcMaxInputsPerOutput
        1,  // ulcMinInputsPerOutput
        1,  // ulcMaxOutputsPerInput
        1,  // ulcMinOutputsPerInput
        SIZEOF_ARRAY(AntennaTransportJoints),   // ulcTopologyJoints
        AntennaTransportJoints   // pTopologyJoints; array of joints
    }
    //  If applicable, list topology of joints between other pins.
    //
};


//
//  Define the Filter Factory Descriptor that the BDA support library uses 
//  to create template topology for the filter.
//
//  This KSFILTER_DESCRIPTOR structure combines the structures that 
//  define the topologies that the filter can assume as a result of
//  pin factory and topology creation methods.
//  Note that not all of the template pin and node types may be exposed as
//  pin and node factories when the filter is first instanciated.
//
DEFINE_KSFILTER_DESCRIPTOR(TemplateFilterDescriptor)
{
    &FilterDispatch,  // Dispatch
    &FilterAutomation,  // AutomationTable
    KSFILTER_DESCRIPTOR_VERSION,  // Version
    0,  // Flags
    &KSNAME_BdaSWTunerFilter,  // ReferenceGuid
    DEFINE_KSFILTER_PIN_DESCRIPTORS(TemplatePinDescriptors),
                                       // PinDescriptorsCount; exposes all template pins 
                                       // PinDescriptorSize; size of each item
                                       // PinDescriptors; table of pin descriptors
    DEFINE_KSFILTER_CATEGORY(KSCATEGORY_BDA_NETWORK_TUNER),
                                       // CategoriesCount; number of categories in the table
                                       // Categories; table of categories
    DEFINE_KSFILTER_NODE_DESCRIPTORS(NodeDescriptors),  
                                      // NodeDescriptorsCount; exposes all template nodes
                                      // NodeDescriptorSize; size of each item
                                      // NodeDescriptors; table of node descriptors
    DEFINE_KSFILTER_CONNECTIONS(TemplateFilterConnections), 
                                      // ConnectionsCount; number of connections in the table
                                       // Connections; table of connections
    NULL                        // ComponentId; in this case, no ID is provided
};

//
//  Define BDA Template Topology Descriptor for the filter.
//
//  This structure combines the filter descriptor and pin pairings that
//  the BDA support library uses to create an instance of the filter.
//
const
BDA_FILTER_TEMPLATE
BdaFilterTemplate =
{
    &TemplateFilterDescriptor,
    SIZEOF_ARRAY(TemplatePinPairings),
    TemplatePinPairings
};


//===========================================================================
//
//  Define the Device 
//
//===========================================================================


//
//  Define Device Dispatch Table
//
//  List the dispatch routines for the major events that occur 
//  during the existence of the underlying device.
//
extern
const
KSDEVICE_DISPATCH
DeviceDispatch =
{
    CDevice::Create,    // Add
    CDevice::Start,     // Start
    NULL,               // PostStart
    NULL,               // QueryStop
    NULL,               // CancelStop
    NULL,               // Stop
    NULL,               // QueryRemove
    NULL,               // CancelRemove
    NULL,               // Remove
    NULL,               // QueryCapabilities
    NULL,               // SurpriseRemoval
    NULL,               // QueryPower
    NULL                // SetPower
};


//
//  Define Device Descriptor
//
//  Combines structures that define the device and any non-BDA
//  intial filter factories that can be created on it.
//  Note that this structure does not include the template topology
//  structures as they are specific to BDA.
//
extern
const
KSDEVICE_DESCRIPTOR
DeviceDescriptor =
{
    &DeviceDispatch,    // Dispatch
    0,      // SIZEOF_ARRAY( FilterDescriptors),   // FilterDescriptorsCount
    NULL,   // FilterDescriptors                   // FilterDescriptors
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -