2009-08-07 13:23:35 +00:00
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
#include "precomp.h"
|
|
|
|
|
2023-10-23 16:16:59 +00:00
|
|
|
#define TAG_BDASUP 'SadB'
|
|
|
|
|
2009-08-20 12:26:09 +00:00
|
|
|
const GUID KSPROPSETID_BdaPinControl = {0xded49d5, 0xa8b7, 0x4d5d, {0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d}};
|
|
|
|
const GUID KSMETHODSETID_BdaDeviceConfiguration = {0x71985f45, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
|
|
|
|
const GUID KSPROPSETID_BdaTopology = {0xa14ee835, 0x0a23, 0x11d3, {0x9c, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
BDA_GLOBAL g_Settings =
|
|
|
|
{
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
2009-08-07 13:23:35 +00:00
|
|
|
|
2009-08-20 12:26:09 +00:00
|
|
|
KSPROPERTY_ITEM FilterPropertyItem[] =
|
|
|
|
{
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_TYPES(BdaPropertyNodeTypes, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPES( BdaPropertyPinTypes, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_TEMPLATE_CONNECTIONS(BdaPropertyTemplateConnections, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_METHODS(BdaPropertyNodeMethods, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_PROPERTIES(BdaPropertyNodeProperties, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_EVENTS(BdaPropertyNodeEvents, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_CONTROLLING_PIN_ID(BdaPropertyGetControllingPinId, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_NODE_DESCRIPTORS(BdaPropertyNodeDescriptors, NULL)
|
|
|
|
};
|
|
|
|
|
|
|
|
KSPROPERTY_SET FilterPropertySet =
|
|
|
|
{
|
|
|
|
&KSPROPSETID_BdaTopology,
|
|
|
|
8,
|
|
|
|
FilterPropertyItem,
|
|
|
|
0,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
KSMETHOD_ITEM FilterMethodItem[] =
|
|
|
|
{
|
|
|
|
//DEFINE_KSMETHOD_ITEM_BDA_CREATE_PIN_FACTORY(BdaMethodCreatePin, NULL),
|
|
|
|
DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(BdaMethodCreateTopology, NULL)
|
|
|
|
};
|
|
|
|
|
|
|
|
KSMETHOD_SET FilterMethodSet =
|
|
|
|
{
|
|
|
|
&KSMETHODSETID_BdaDeviceConfiguration,
|
|
|
|
2,
|
|
|
|
FilterMethodItem,
|
|
|
|
0,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
KSAUTOMATION_TABLE FilterAutomationTable =
|
|
|
|
{
|
|
|
|
1,
|
2010-03-31 15:37:36 +00:00
|
|
|
sizeof(KSPROPERTY_ITEM),
|
2009-08-20 12:26:09 +00:00
|
|
|
&FilterPropertySet,
|
|
|
|
1,
|
2010-03-31 15:37:36 +00:00
|
|
|
sizeof(KSMETHOD_ITEM),
|
2009-08-20 12:26:09 +00:00
|
|
|
&FilterMethodSet,
|
|
|
|
0,
|
2010-03-31 15:37:36 +00:00
|
|
|
sizeof(KSEVENT_ITEM),
|
2009-08-20 12:26:09 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
KSPROPERTY_ITEM PinPropertyItem[] =
|
|
|
|
{
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_PIN_ID(BdaPropertyGetPinControl, NULL),
|
|
|
|
DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPE(BdaPropertyGetPinControl, NULL)
|
|
|
|
};
|
|
|
|
|
|
|
|
KSPROPERTY_SET PinPropertySet =
|
|
|
|
{
|
|
|
|
&KSPROPSETID_BdaPinControl,
|
|
|
|
2,
|
|
|
|
PinPropertyItem,
|
|
|
|
0,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
KSAUTOMATION_TABLE PinAutomationTable =
|
|
|
|
{
|
|
|
|
1,
|
2010-03-31 15:37:36 +00:00
|
|
|
sizeof(KSPROPERTY_ITEM),
|
2009-08-20 12:26:09 +00:00
|
|
|
&PinPropertySet,
|
|
|
|
0,
|
2010-03-31 15:37:36 +00:00
|
|
|
sizeof(KSMETHOD_ITEM),
|
2009-08-20 12:26:09 +00:00
|
|
|
NULL,
|
|
|
|
0,
|
2010-03-31 15:37:36 +00:00
|
|
|
sizeof(KSEVENT_ITEM),
|
2009-08-20 12:26:09 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
PVOID
|
|
|
|
AllocateItem(
|
|
|
|
IN POOL_TYPE PoolType,
|
|
|
|
IN SIZE_T NumberOfBytes)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2023-10-23 16:16:59 +00:00
|
|
|
return ExAllocatePoolZero(PoolType, NumberOfBytes, TAG_BDASUP);
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
VOID
|
|
|
|
FreeItem(
|
|
|
|
IN PVOID Item)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2023-10-23 16:16:59 +00:00
|
|
|
ExFreePoolWithTag(Item, TAG_BDASUP);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PBDA_FILTER_INSTANCE_ENTRY
|
|
|
|
GetFilterInstanceEntry(
|
|
|
|
IN PKSFILTERFACTORY FilterFactory)
|
|
|
|
{
|
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry = NULL;
|
|
|
|
PLIST_ENTRY Entry;
|
|
|
|
KIRQL OldLevel;
|
|
|
|
|
|
|
|
/* acquire list lock */
|
|
|
|
KeAcquireSpinLock(&g_Settings.FilterFactoryInstanceListLock, &OldLevel);
|
|
|
|
|
|
|
|
/* point to first entry */
|
|
|
|
Entry = g_Settings.FilterFactoryInstanceList.Flink;
|
|
|
|
|
|
|
|
while(Entry != &g_Settings.FilterFactoryInstanceList)
|
|
|
|
{
|
|
|
|
/* get instance entry from list entry offset */
|
|
|
|
InstanceEntry = (PBDA_FILTER_INSTANCE_ENTRY)CONTAINING_RECORD(Entry, BDA_FILTER_INSTANCE_ENTRY, Entry);
|
|
|
|
|
|
|
|
/* is the instance entry the requested one */
|
|
|
|
if (InstanceEntry->FilterFactoryInstance == FilterFactory)
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* move to next entry */
|
|
|
|
Entry = Entry->Flink;
|
|
|
|
/* set to null as it has not been found */
|
|
|
|
InstanceEntry = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* release spin lock */
|
|
|
|
KeReleaseSpinLock(&g_Settings.FilterFactoryInstanceListLock, OldLevel);
|
|
|
|
|
|
|
|
/* return result */
|
|
|
|
return InstanceEntry;
|
|
|
|
}
|
|
|
|
|
2009-08-20 12:38:52 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
DllInitialize(
|
|
|
|
PUNICODE_STRING RegistryPath)
|
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BDASUP::DllInitialize\n");
|
|
|
|
|
2009-08-20 12:38:52 +00:00
|
|
|
KeInitializeSpinLock(&g_Settings.FilterFactoryInstanceListLock);
|
|
|
|
InitializeListHead(&g_Settings.FilterFactoryInstanceList);
|
|
|
|
g_Settings.Initialized = TRUE;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaCheckChanges(IN PIRP Irp)
|
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaCheckChanges\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (!Irp)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaCommitChanges(IN PIRP Irp)
|
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaCommitChanges\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (!Irp)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaCreateFilterFactory(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PKSDEVICE pKSDevice,
|
|
|
|
IN const KSFILTER_DESCRIPTOR *pFilterDescriptor,
|
|
|
|
IN const BDA_FILTER_TEMPLATE *pBdaFilterTemplate)
|
|
|
|
{
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return BdaCreateFilterFactoryEx(pKSDevice, pFilterDescriptor, pBdaFilterTemplate, NULL);
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
2009-08-10 11:28:25 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
FreeFilterInstance(
|
|
|
|
IN PVOID Context)
|
|
|
|
{
|
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry = NULL;
|
|
|
|
PLIST_ENTRY Entry;
|
|
|
|
KIRQL OldLevel;
|
|
|
|
|
|
|
|
/* acquire list lock */
|
|
|
|
KeAcquireSpinLock(&g_Settings.FilterFactoryInstanceListLock, &OldLevel);
|
|
|
|
|
|
|
|
/* point to first entry */
|
|
|
|
Entry = g_Settings.FilterFactoryInstanceList.Flink;
|
|
|
|
|
|
|
|
while(Entry != &g_Settings.FilterFactoryInstanceList)
|
|
|
|
{
|
|
|
|
/* get instance entry from list entry offset */
|
|
|
|
InstanceEntry = (PBDA_FILTER_INSTANCE_ENTRY)CONTAINING_RECORD(Entry, BDA_FILTER_INSTANCE_ENTRY, Entry);
|
|
|
|
|
|
|
|
/* is the instance entry the requested one */
|
|
|
|
if (InstanceEntry == (PBDA_FILTER_INSTANCE_ENTRY)Context)
|
|
|
|
{
|
|
|
|
RemoveEntryList(&InstanceEntry->Entry);
|
|
|
|
FreeItem(InstanceEntry);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* move to next entry */
|
|
|
|
Entry = Entry->Flink;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* release spin lock */
|
|
|
|
KeReleaseSpinLock(&g_Settings.FilterFactoryInstanceListLock, OldLevel);
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaCreateFilterFactoryEx(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PKSDEVICE pKSDevice,
|
|
|
|
IN const KSFILTER_DESCRIPTOR *pFilterDescriptor,
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
IN const BDA_FILTER_TEMPLATE *BdaFilterTemplate,
|
2009-08-07 13:23:35 +00:00
|
|
|
OUT PKSFILTERFACTORY *ppKSFilterFactory)
|
|
|
|
{
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
PBDA_FILTER_INSTANCE_ENTRY FilterInstance;
|
|
|
|
KIRQL OldLevel;
|
|
|
|
NTSTATUS Status;
|
2010-04-01 02:35:37 +00:00
|
|
|
PKSFILTER_DESCRIPTOR FilterDescriptor;
|
2009-08-20 12:26:09 +00:00
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaCreateFilterFactoryEx\n");
|
2010-04-01 02:35:37 +00:00
|
|
|
|
|
|
|
FilterDescriptor = AllocateItem(NonPagedPool, sizeof(KSFILTER_DESCRIPTOR));
|
|
|
|
if (!FilterDescriptor)
|
|
|
|
{
|
|
|
|
/* no memory */
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* copy filter descriptor template */
|
|
|
|
RtlMoveMemory(FilterDescriptor, pFilterDescriptor, sizeof(KSFILTER_DESCRIPTOR));
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
|
2010-04-01 17:18:13 +00:00
|
|
|
/* erase pin / nodes / connections from filter descriptor */
|
|
|
|
FilterDescriptor->PinDescriptorsCount = 0;
|
|
|
|
FilterDescriptor->PinDescriptors = NULL;
|
|
|
|
FilterDescriptor->NodeDescriptorsCount = 0;
|
|
|
|
FilterDescriptor->NodeDescriptors = NULL;
|
|
|
|
FilterDescriptor->ConnectionsCount = 0;
|
|
|
|
FilterDescriptor->Connections = NULL;
|
|
|
|
|
2009-08-20 12:26:09 +00:00
|
|
|
/* merge the automation tables */
|
2010-04-01 02:35:37 +00:00
|
|
|
Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&FilterDescriptor->AutomationTable, (PKSAUTOMATION_TABLE)pFilterDescriptor->AutomationTable, &FilterAutomationTable, NULL);
|
2009-08-20 12:26:09 +00:00
|
|
|
|
|
|
|
/* check for success */
|
|
|
|
if (!NT_SUCCESS(Status))
|
2010-03-31 15:37:36 +00:00
|
|
|
{
|
|
|
|
DPRINT1("KsMergeAutomationTables failed with %lx\n", Status);
|
2010-04-01 02:35:37 +00:00
|
|
|
FreeItem(FilterDescriptor);
|
2009-08-20 12:26:09 +00:00
|
|
|
return Status;
|
2010-03-31 15:37:36 +00:00
|
|
|
}
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
|
|
|
|
/* allocate filter instance */
|
|
|
|
FilterInstance = AllocateItem(NonPagedPool, sizeof(BDA_FILTER_INSTANCE_ENTRY));
|
|
|
|
if (!FilterInstance)
|
|
|
|
{
|
|
|
|
/* not enough memory */
|
2010-04-01 02:35:37 +00:00
|
|
|
FreeItem(FilterDescriptor);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* create the filter factory */
|
2010-04-01 02:35:37 +00:00
|
|
|
Status = KsCreateFilterFactory(pKSDevice->FunctionalDeviceObject, FilterDescriptor, NULL, NULL, 0, NULL, NULL, &FilterFactory);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
|
|
|
|
/* check for success */
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
2010-04-01 17:18:13 +00:00
|
|
|
if (FilterDescriptor->AutomationTable != &FilterAutomationTable)
|
2009-08-10 11:28:25 +00:00
|
|
|
{
|
2010-04-01 17:18:13 +00:00
|
|
|
/* add the item to filter object bag */
|
|
|
|
KsAddItemToObjectBag(FilterFactory->Bag, (PVOID)FilterDescriptor->AutomationTable, FreeFilterInstance);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* make sure the automation table is not-read only */
|
|
|
|
Status = _KsEdit(FilterFactory->Bag, (PVOID*)&FilterDescriptor->AutomationTable, sizeof(KSAUTOMATION_TABLE), sizeof(KSAUTOMATION_TABLE), 0);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(Status == STATUS_SUCCESS);
|
|
|
|
|
|
|
|
/* add to object bag */
|
|
|
|
KsAddItemToObjectBag(FilterFactory->Bag, (PVOID)FilterDescriptor->AutomationTable, FreeFilterInstance);
|
2009-08-10 11:28:25 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/* initialize filter instance entry */
|
|
|
|
FilterInstance->FilterFactoryInstance = FilterFactory;
|
|
|
|
FilterInstance->FilterTemplate = (BDA_FILTER_TEMPLATE *)BdaFilterTemplate;
|
|
|
|
|
|
|
|
/* acquire list lock */
|
|
|
|
KeAcquireSpinLock(&g_Settings.FilterFactoryInstanceListLock, &OldLevel);
|
|
|
|
|
|
|
|
/* insert factory at the end */
|
|
|
|
InsertTailList(&g_Settings.FilterFactoryInstanceList, &FilterInstance->Entry);
|
|
|
|
|
|
|
|
/* release spin lock */
|
|
|
|
KeReleaseSpinLock(&g_Settings.FilterFactoryInstanceListLock, OldLevel);
|
|
|
|
|
|
|
|
if (ppKSFilterFactory)
|
|
|
|
{
|
|
|
|
/* store result */
|
|
|
|
*ppKSFilterFactory = FilterFactory;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* failed to create filter factory */
|
|
|
|
FreeItem(FilterInstance);
|
2010-04-01 17:18:13 +00:00
|
|
|
FreeItem(FilterDescriptor);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* done */
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaCreateFilterFactoryEx Status %x\n", Status);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return Status;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaCreatePin(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PKSFILTER pKSFilter,
|
|
|
|
IN ULONG ulPinType,
|
|
|
|
OUT ULONG *pulPinId)
|
|
|
|
{
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
PKSPIN_DESCRIPTOR_EX PinDescriptor;
|
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
|
|
|
NTSTATUS Status;
|
|
|
|
ULONG PinId;
|
2010-04-01 02:35:37 +00:00
|
|
|
PKSPIN_DESCRIPTOR_EX NewPinDescriptor;
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaCreatePin\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (!pulPinId || !pKSFilter)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* get parent filter factory */
|
|
|
|
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterFactory);
|
|
|
|
|
|
|
|
/* find instance entry */
|
|
|
|
InstanceEntry = GetFilterInstanceEntry(FilterFactory);
|
|
|
|
|
|
|
|
if (!InstanceEntry)
|
|
|
|
{
|
|
|
|
/* the filter was not initialized with BDA */
|
|
|
|
return STATUS_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* sanity checks */
|
|
|
|
ASSERT(InstanceEntry->FilterTemplate);
|
|
|
|
ASSERT(InstanceEntry->FilterTemplate->pFilterDescriptor);
|
|
|
|
|
|
|
|
/* does the filter support any pins */
|
|
|
|
if (!InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount)
|
|
|
|
{
|
|
|
|
/* no pins supported */
|
2010-04-01 02:35:37 +00:00
|
|
|
DPRINT("BdaCreatePin NoPins supported\n");
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* is pin factory still existing */
|
|
|
|
if (InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount <= ulPinType)
|
|
|
|
{
|
|
|
|
/* pin request is out of bounds */
|
2010-04-01 02:35:37 +00:00
|
|
|
DPRINT("BdaCreatePin ulPinType %lu >= PinDescriptorCount %lu\n", ulPinType, InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* FIXME custom pin descriptors */
|
|
|
|
ASSERT(InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorSize == sizeof(KSPIN_DESCRIPTOR_EX));
|
|
|
|
|
|
|
|
/* get pin descriptor */
|
|
|
|
PinDescriptor = (PKSPIN_DESCRIPTOR_EX)&InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptors[ulPinType];
|
|
|
|
|
2010-04-01 02:35:37 +00:00
|
|
|
/* allocate pin descriptor */
|
|
|
|
NewPinDescriptor = AllocateItem(NonPagedPool, sizeof(KSPIN_DESCRIPTOR_EX));
|
|
|
|
if (!NewPinDescriptor)
|
|
|
|
{
|
|
|
|
/* no memory */
|
|
|
|
DPRINT("BdaCreatePin OutOfMemory\n");
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
|
|
|
|
2009-08-20 12:26:09 +00:00
|
|
|
/* make a copy of the pin descriptor */
|
2010-04-01 02:35:37 +00:00
|
|
|
RtlMoveMemory(NewPinDescriptor, PinDescriptor, sizeof(KSPIN_DESCRIPTOR_EX));
|
2009-08-20 12:26:09 +00:00
|
|
|
|
|
|
|
/* merge the automation tables */
|
2010-04-01 02:35:37 +00:00
|
|
|
Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&NewPinDescriptor->AutomationTable, (PKSAUTOMATION_TABLE)PinDescriptor->AutomationTable, &PinAutomationTable, pKSFilter->Bag);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
|
|
|
|
/* check for success */
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
2009-08-20 12:26:09 +00:00
|
|
|
/* create the pin factory */
|
2010-04-01 02:35:37 +00:00
|
|
|
Status = KsFilterCreatePinFactory(pKSFilter, NewPinDescriptor, &PinId);
|
2009-08-20 12:26:09 +00:00
|
|
|
|
|
|
|
/* check for success */
|
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
/* store result */
|
|
|
|
*pulPinId = PinId;
|
|
|
|
}
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
}
|
|
|
|
|
2010-04-01 02:35:37 +00:00
|
|
|
DPRINT("BdaCreatePin Result %x PinId %u\n", Status, PinId);
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return Status;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaMethodCreatePin(
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSMETHOD *pKSMethod,
|
|
|
|
OUT ULONG *pulPinFactoryID)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
PKSM_PIN Pin;
|
|
|
|
PKSFILTER Filter;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaMethodCreatePin\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (!Irp)
|
|
|
|
{
|
|
|
|
/* invalid parameter */
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get filter from irp */
|
|
|
|
Filter = KsGetFilterFromIrp(Irp);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(Filter);
|
|
|
|
ASSERT(pKSMethod);
|
|
|
|
|
|
|
|
/* get method request */
|
|
|
|
Pin = (PKSM_PIN)pKSMethod;
|
|
|
|
|
|
|
|
/* create the pin */
|
|
|
|
return BdaCreatePin(Filter, Pin->PinId, pulPinFactoryID);
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
2009-08-10 15:18:48 +00:00
|
|
|
@implemented
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaInitFilter(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PKSFILTER pKSFilter,
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
IN const BDA_FILTER_TEMPLATE *pBdaFilterTemplate)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2009-08-10 14:18:51 +00:00
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
ULONG Index, PinId;
|
|
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
|
|
|
2010-04-01 02:35:37 +00:00
|
|
|
DPRINT("BdaInitFilter %p\n", pBdaFilterTemplate);
|
2010-03-31 15:37:36 +00:00
|
|
|
|
2009-08-10 14:18:51 +00:00
|
|
|
/* check input parameters */
|
|
|
|
if (!pKSFilter)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* get parent filter factory */
|
|
|
|
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterFactory);
|
|
|
|
|
|
|
|
/* find instance entry */
|
|
|
|
InstanceEntry = GetFilterInstanceEntry(FilterFactory);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(InstanceEntry);
|
2010-04-01 02:35:37 +00:00
|
|
|
|
|
|
|
if (!pBdaFilterTemplate)
|
|
|
|
{
|
|
|
|
/* use template from BdaCreateFilterFactoryEx */
|
|
|
|
pBdaFilterTemplate = InstanceEntry->FilterTemplate;
|
|
|
|
}
|
2009-08-10 14:18:51 +00:00
|
|
|
|
|
|
|
/* now create the pins */
|
|
|
|
for(Index = 0; Index < pBdaFilterTemplate->pFilterDescriptor->PinDescriptorsCount; Index++)
|
|
|
|
{
|
|
|
|
/* create the pin */
|
|
|
|
Status = BdaCreatePin(pKSFilter, Index, &PinId);
|
|
|
|
|
|
|
|
/* check for success */
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* done */
|
|
|
|
return Status;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
2009-08-10 14:18:51 +00:00
|
|
|
@implemented
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaCreateTopology(
|
|
|
|
IN PKSFILTER pKSFilter,
|
|
|
|
IN ULONG InputPinId,
|
|
|
|
IN ULONG OutputPinId)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2009-08-10 14:18:51 +00:00
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
KSTOPOLOGY_CONNECTION Connection;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaCreateTopology\n");
|
|
|
|
|
2009-08-10 14:18:51 +00:00
|
|
|
/* check input parameters */
|
|
|
|
if (!pKSFilter)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* get parent filter factory */
|
|
|
|
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterFactory);
|
|
|
|
|
|
|
|
/* find instance entry */
|
|
|
|
InstanceEntry = GetFilterInstanceEntry(FilterFactory);
|
|
|
|
|
|
|
|
if (!InstanceEntry)
|
|
|
|
{
|
|
|
|
/* the filter was not initialized with BDA */
|
|
|
|
return STATUS_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (InputPinId >= InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount ||
|
|
|
|
OutputPinId >= InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount)
|
|
|
|
{
|
|
|
|
/* invalid pin id */
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* initialize topology connection */
|
|
|
|
Connection.FromNode = KSFILTER_NODE;
|
|
|
|
Connection.ToNode = KSFILTER_NODE;
|
|
|
|
Connection.FromNodePin = InputPinId;
|
|
|
|
Connection.ToNodePin = OutputPinId;
|
|
|
|
|
|
|
|
/* add the connection */
|
|
|
|
return KsFilterAddTopologyConnections(pKSFilter, 1, &Connection);
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaDeletePin(
|
|
|
|
IN PKSFILTER pKSFilter,
|
|
|
|
IN ULONG *pulPinId)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2017-02-06 15:49:23 +00:00
|
|
|
UNIMPLEMENTED;
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaDeletePin\n");
|
2009-08-07 13:23:35 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaFilterFactoryUpdateCacheData(
|
|
|
|
IN PKSFILTERFACTORY FilterFactory,
|
|
|
|
IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaFilterFactoryUpdateCacheData\n");
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return KsFilterFactoryUpdateCacheData(FilterFactory, FilterDescriptor);
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaGetChangeState(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
OUT BDA_CHANGE_STATE *ChangeState)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaGetChangeState\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (Irp && ChangeState)
|
|
|
|
{
|
|
|
|
*ChangeState = BDA_CHANGES_COMPLETE;
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* invalid parameters supplied */
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaMethodCreateTopology(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSMETHOD *pKSMethod,
|
|
|
|
OPTIONAL PVOID pvIgnored)
|
|
|
|
{
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
PKSFILTER Filter;
|
|
|
|
PKSP_BDA_NODE_PIN Node;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaMethodCreateTopology\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/* check input parameters */
|
|
|
|
if (!Irp || !pKSMethod)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* get filter */
|
|
|
|
Filter = KsGetFilterFromIrp(Irp);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(Filter);
|
|
|
|
|
|
|
|
/* get method request */
|
|
|
|
Node = (PKSP_BDA_NODE_PIN)pKSMethod;
|
|
|
|
|
|
|
|
/* create the topology */
|
|
|
|
return BdaCreateTopology(Filter, Node->ulInputPinId, Node->ulOutputPinId);
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaMethodDeletePin(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSMETHOD *pKSMethod,
|
|
|
|
OPTIONAL PVOID pvIgnored)
|
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaMethodDeletePin\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (!Irp)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyGetControllingPinId(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSP_BDA_NODE_PIN *pProperty,
|
|
|
|
OUT ULONG *pulControllingPinId)
|
|
|
|
{
|
2017-02-06 15:49:23 +00:00
|
|
|
UNIMPLEMENTED;
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyGetControllingPinId\n");
|
2009-08-07 13:23:35 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
2009-08-10 16:10:26 +00:00
|
|
|
@implemented
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyGetPinControl(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSPROPERTY *pKSProperty,
|
|
|
|
OUT ULONG *pulProperty)
|
|
|
|
{
|
2009-08-10 16:10:26 +00:00
|
|
|
PKSPIN Pin;
|
|
|
|
PKSFILTER Filter;
|
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyGetPinControl\n");
|
|
|
|
|
2009-08-10 16:10:26 +00:00
|
|
|
/* first get the pin */
|
|
|
|
Pin = KsGetPinFromIrp(Irp);
|
|
|
|
ASSERT(Pin);
|
|
|
|
|
|
|
|
/* now get the parent filter */
|
|
|
|
Filter = KsPinGetParentFilter(Pin);
|
|
|
|
ASSERT(Filter);
|
|
|
|
|
|
|
|
/* get parent filter factory */
|
|
|
|
FilterFactory = KsFilterGetParentFilterFactory(Filter);
|
|
|
|
ASSERT(FilterFactory);
|
|
|
|
|
|
|
|
/* find instance entry */
|
|
|
|
InstanceEntry = GetFilterInstanceEntry(FilterFactory);
|
|
|
|
ASSERT(InstanceEntry);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
pKSProperty++;
|
|
|
|
ASSERT(pKSProperty->Id == KSPROPERTY_BDA_PIN_TYPE);
|
|
|
|
|
|
|
|
/* store pin id */
|
|
|
|
*pulProperty = Pin->Id;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyNodeDescriptors(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSPROPERTY *pKSProperty,
|
2009-10-13 21:49:36 +00:00
|
|
|
OUT BDANODE_DESCRIPTOR *pNodeDescriptorProperty)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2017-02-06 15:49:23 +00:00
|
|
|
UNIMPLEMENTED;
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyNodeDescriptors\n");
|
2009-08-07 13:23:35 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyNodeEvents(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
2009-10-13 21:49:36 +00:00
|
|
|
IN KSP_NODE *pKSProperty,
|
2009-08-07 13:23:35 +00:00
|
|
|
OUT GUID *pguidProperty)
|
|
|
|
{
|
2017-02-06 15:49:23 +00:00
|
|
|
UNIMPLEMENTED;
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyNodeEvents\n");
|
2009-08-07 13:23:35 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyNodeMethods(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
2009-10-13 21:49:36 +00:00
|
|
|
IN KSP_NODE *pKSProperty,
|
2009-08-07 13:23:35 +00:00
|
|
|
OUT GUID *pguidProperty)
|
|
|
|
{
|
2017-02-06 15:49:23 +00:00
|
|
|
UNIMPLEMENTED;
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyNodeMethods\n");
|
2009-08-07 13:23:35 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyNodeProperties(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
2009-10-13 21:49:36 +00:00
|
|
|
IN KSP_NODE *pKSProperty,
|
2009-08-07 13:23:35 +00:00
|
|
|
OUT GUID *pguidProperty)
|
|
|
|
{
|
2017-02-06 15:49:23 +00:00
|
|
|
UNIMPLEMENTED;
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyNodeProperties\n");
|
2009-08-07 13:23:35 +00:00
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
2009-08-10 15:18:48 +00:00
|
|
|
@implemented
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyNodeTypes(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSPROPERTY *pKSProperty,
|
|
|
|
OUT ULONG *pulProperty)
|
|
|
|
{
|
2009-08-10 15:18:48 +00:00
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
PKSFILTER pKSFilter;
|
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
ULONG Index;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyNodeTypes\n");
|
|
|
|
|
2009-08-10 15:18:48 +00:00
|
|
|
/* check input parameter */
|
|
|
|
if (!Irp || !pKSProperty)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* first get the filter */
|
|
|
|
pKSFilter = KsGetFilterFromIrp(Irp);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(pKSFilter);
|
|
|
|
|
|
|
|
/* get parent filter factory */
|
|
|
|
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterFactory);
|
|
|
|
|
|
|
|
/* find instance entry */
|
|
|
|
InstanceEntry = GetFilterInstanceEntry(FilterFactory);
|
|
|
|
ASSERT(InstanceEntry);
|
|
|
|
|
|
|
|
/* get current irp stack */
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
|
|
|
|
/* are there node types provided */
|
|
|
|
if (!pulProperty)
|
|
|
|
{
|
|
|
|
/* no node entry array provided */
|
|
|
|
Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount * sizeof(ULONG);
|
|
|
|
Irp->IoStatus.Status = STATUS_MORE_ENTRIES;
|
|
|
|
return STATUS_MORE_ENTRIES;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount * sizeof(ULONG) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
|
|
|
|
{
|
|
|
|
/* buffer too small */
|
|
|
|
Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount * sizeof(ULONG);
|
|
|
|
Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
|
|
|
|
return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now copy all descriptors */
|
|
|
|
for(Index = 0; Index < InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount; Index++)
|
|
|
|
{
|
|
|
|
/* use the index as the type */
|
|
|
|
pulProperty[Index] = Index;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
2009-08-10 15:18:48 +00:00
|
|
|
@implemented
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyPinTypes(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSPROPERTY *pKSProperty,
|
|
|
|
OUT ULONG *pulProperty)
|
|
|
|
{
|
2009-08-10 15:18:48 +00:00
|
|
|
PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
|
|
|
|
PKSFILTERFACTORY FilterFactory;
|
|
|
|
PKSFILTER pKSFilter;
|
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
ULONG Index;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyPinTypes\n");
|
|
|
|
|
2009-08-10 15:18:48 +00:00
|
|
|
/* check input parameter */
|
|
|
|
if (!Irp || !pKSProperty)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* first get the filter */
|
|
|
|
pKSFilter = KsGetFilterFromIrp(Irp);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(pKSFilter);
|
|
|
|
|
|
|
|
/* get parent filter factory */
|
|
|
|
FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterFactory);
|
|
|
|
|
|
|
|
/* find instance entry */
|
|
|
|
InstanceEntry = GetFilterInstanceEntry(FilterFactory);
|
|
|
|
ASSERT(InstanceEntry);
|
|
|
|
|
|
|
|
/* get current irp stack */
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
|
|
|
|
/* are there node types provided */
|
|
|
|
if (!pKSProperty)
|
|
|
|
{
|
|
|
|
/* no node entry array provided */
|
|
|
|
Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount * sizeof(ULONG);
|
|
|
|
Irp->IoStatus.Status = STATUS_MORE_ENTRIES;
|
|
|
|
return STATUS_MORE_ENTRIES;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount * sizeof(ULONG) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
|
|
|
|
{
|
|
|
|
/* buffer too small */
|
|
|
|
Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount * sizeof(ULONG);
|
|
|
|
Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
|
|
|
|
return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now copy all descriptors */
|
|
|
|
for(Index = 0; Index < InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount; Index++)
|
|
|
|
{
|
|
|
|
/* use the index as the type */
|
|
|
|
pulProperty[Index] = Index;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaPropertyTemplateConnections(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN KSPROPERTY *pKSProperty,
|
|
|
|
OUT KSTOPOLOGY_CONNECTION *pConnectionProperty)
|
|
|
|
{
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
PBDA_FILTER_INSTANCE_ENTRY FilterInstance;
|
|
|
|
PKSFILTER Filter;
|
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
ULONG Index;
|
|
|
|
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaPropertyTemplateConnections\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/* validate parameters */
|
|
|
|
if (!Irp || !pKSProperty)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* first get the filter */
|
|
|
|
Filter = KsGetFilterFromIrp(Irp);
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(Filter);
|
|
|
|
|
|
|
|
/* verify filter has been registered with BDA */
|
|
|
|
FilterInstance = GetFilterInstanceEntry(KsFilterGetParentFilterFactory(Filter));
|
|
|
|
|
|
|
|
if (!FilterInstance)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* get current irp stack */
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
|
|
|
|
if (!pConnectionProperty)
|
|
|
|
{
|
|
|
|
/* caller needs the size first */
|
|
|
|
Irp->IoStatus.Information = FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount * sizeof(KSTOPOLOGY_CONNECTION);
|
|
|
|
Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
|
|
|
|
return STATUS_BUFFER_OVERFLOW;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount * sizeof(KSTOPOLOGY_CONNECTION) <= IoStack->Parameters.DeviceIoControl.OutputBufferLength);
|
|
|
|
|
|
|
|
for(Index = 0; Index < FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount; Index++)
|
|
|
|
{
|
|
|
|
/* sanity check */
|
|
|
|
ASSERT(FilterInstance->FilterTemplate->pFilterDescriptor->Connections);
|
|
|
|
|
|
|
|
/* copy connection */
|
|
|
|
RtlMoveMemory(pConnectionProperty, &FilterInstance->FilterTemplate->pFilterDescriptor->Connections[Index], sizeof(KSTOPOLOGY_CONNECTION));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* store result */
|
|
|
|
Irp->IoStatus.Information = FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount * sizeof(KSTOPOLOGY_CONNECTION);
|
|
|
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
|
|
|
|
|
|
|
/* done */
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaStartChanges(IN PIRP Irp)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaStartChanges\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
if (Irp)
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
else
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
|
|
|
@implemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaUninitFilter(IN PKSFILTER pKSFilter)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaUninitFilter\n");
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
return STATUS_SUCCESS;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/*
|
2009-08-10 14:18:51 +00:00
|
|
|
@implemented
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
BdaValidateNodeProperty(
|
2009-08-07 13:23:35 +00:00
|
|
|
IN PIRP Irp,
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
IN KSPROPERTY *KSProperty)
|
2009-08-07 13:23:35 +00:00
|
|
|
{
|
2010-03-31 15:37:36 +00:00
|
|
|
DPRINT("BdaValidateNodeProperty\n");
|
|
|
|
|
[BDASUP]
- Start implementing BDASup
- Implement BdaCheckChanges, BdaCommitChanges, BdaCreateFilterFactory, BdaCreateFilterFactoryEx, BdaCreatePin, BdaMethodCreatePin, BdaFilterFactoryUpdateCacheData, BdaGetChangeState, BdaMethodCreateTopology, BdaMethodDeletePin, BdaPropertyTemplateConnections, BdaStartChanges, BdaUninitFilter, BdaValidateNodeProperty
svn path=/trunk/; revision=42586
2009-08-10 11:13:43 +00:00
|
|
|
/* check for valid parameter */
|
|
|
|
if (Irp && KSProperty)
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
2009-08-07 13:23:35 +00:00
|
|
|
}
|