ReactOS 0.4.15-dev-7674-gc0b4db1
bdasup.c
Go to the documentation of this file.
1
2#include "precomp.h"
3
4#define TAG_BDASUP 'SadB'
5
6const GUID KSPROPSETID_BdaPinControl = {0xded49d5, 0xa8b7, 0x4d5d, {0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d}};
7const GUID KSMETHODSETID_BdaDeviceConfiguration = {0x71985f45, 0x1ca1, 0x11d3, {0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
8const GUID KSPROPSETID_BdaTopology = {0xa14ee835, 0x0a23, 0x11d3, {0x9c, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}};
9
11{
12 0,
13 0,
14 {NULL, NULL}
15};
16
17KSPROPERTY_ITEM FilterPropertyItem[] =
18{
27};
28
29KSPROPERTY_SET FilterPropertySet =
30{
32 8,
34 0,
35 NULL
36};
37
38KSMETHOD_ITEM FilterMethodItem[] =
39{
40 //DEFINE_KSMETHOD_ITEM_BDA_CREATE_PIN_FACTORY(BdaMethodCreatePin, NULL),
42};
43
44KSMETHOD_SET FilterMethodSet =
45{
47 2,
49 0,
50 NULL
51};
52
53KSAUTOMATION_TABLE FilterAutomationTable =
54{
55 1,
56 sizeof(KSPROPERTY_ITEM),
58 1,
59 sizeof(KSMETHOD_ITEM),
61 0,
62 sizeof(KSEVENT_ITEM),
63 NULL
64};
65
66KSPROPERTY_ITEM PinPropertyItem[] =
67{
70};
71
72KSPROPERTY_SET PinPropertySet =
73{
75 2,
77 0,
78 NULL
79};
80
81KSAUTOMATION_TABLE PinAutomationTable =
82{
83 1,
84 sizeof(KSPROPERTY_ITEM),
86 0,
87 sizeof(KSMETHOD_ITEM),
88 NULL,
89 0,
90 sizeof(KSEVENT_ITEM),
91 NULL
92};
93
98{
99 return ExAllocatePoolZero(PoolType, NumberOfBytes, TAG_BDASUP);
100}
101
102VOID
104 IN PVOID Item)
105{
107}
108
111 IN PKSFILTERFACTORY FilterFactory)
112{
113 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry = NULL;
115 KIRQL OldLevel;
116
117 /* acquire list lock */
119
120 /* point to first entry */
122
124 {
125 /* get instance entry from list entry offset */
127
128 /* is the instance entry the requested one */
129 if (InstanceEntry->FilterFactoryInstance == FilterFactory)
130 break;
131
132 /* move to next entry */
133 Entry = Entry->Flink;
134 /* set to null as it has not been found */
135 InstanceEntry = NULL;
136 }
137
138 /* release spin lock */
140
141 /* return result */
142 return InstanceEntry;
143}
144
145/*
146 @implemented
147*/
149NTAPI
152{
153 DPRINT("BDASUP::DllInitialize\n");
154
158
159 return STATUS_SUCCESS;
160}
161
162/*
163 @implemented
164*/
166NTAPI
168{
169 DPRINT("BdaCheckChanges\n");
170
171 if (!Irp)
173
174 return STATUS_SUCCESS;
175}
176
177/*
178 @implemented
179*/
181NTAPI
183{
184 DPRINT("BdaCommitChanges\n");
185
186 if (!Irp)
188
189 return STATUS_SUCCESS;
190}
191
192/*
193 @implemented
194*/
196NTAPI
198 IN PKSDEVICE pKSDevice,
199 IN const KSFILTER_DESCRIPTOR *pFilterDescriptor,
201{
203}
204
205VOID
206NTAPI
209{
210 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry = NULL;
212 KIRQL OldLevel;
213
214 /* acquire list lock */
216
217 /* point to first entry */
219
221 {
222 /* get instance entry from list entry offset */
224
225 /* is the instance entry the requested one */
226 if (InstanceEntry == (PBDA_FILTER_INSTANCE_ENTRY)Context)
227 {
228 RemoveEntryList(&InstanceEntry->Entry);
229 FreeItem(InstanceEntry);
230 break;
231 }
232
233 /* move to next entry */
234 Entry = Entry->Flink;
235 }
236
237 /* release spin lock */
239}
240
241/*
242 @implemented
243*/
245NTAPI
247 IN PKSDEVICE pKSDevice,
248 IN const KSFILTER_DESCRIPTOR *pFilterDescriptor,
249 IN const BDA_FILTER_TEMPLATE *BdaFilterTemplate,
250 OUT PKSFILTERFACTORY *ppKSFilterFactory)
251{
252 PKSFILTERFACTORY FilterFactory;
253 PBDA_FILTER_INSTANCE_ENTRY FilterInstance;
254 KIRQL OldLevel;
256 PKSFILTER_DESCRIPTOR FilterDescriptor;
257
258 DPRINT("BdaCreateFilterFactoryEx\n");
259
260 FilterDescriptor = AllocateItem(NonPagedPool, sizeof(KSFILTER_DESCRIPTOR));
261 if (!FilterDescriptor)
262 {
263 /* no memory */
265 }
266
267 /* copy filter descriptor template */
268 RtlMoveMemory(FilterDescriptor, pFilterDescriptor, sizeof(KSFILTER_DESCRIPTOR));
269
270 /* erase pin / nodes / connections from filter descriptor */
271 FilterDescriptor->PinDescriptorsCount = 0;
272 FilterDescriptor->PinDescriptors = NULL;
273 FilterDescriptor->NodeDescriptorsCount = 0;
274 FilterDescriptor->NodeDescriptors = NULL;
275 FilterDescriptor->ConnectionsCount = 0;
276 FilterDescriptor->Connections = NULL;
277
278 /* merge the automation tables */
279 Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&FilterDescriptor->AutomationTable, (PKSAUTOMATION_TABLE)pFilterDescriptor->AutomationTable, &FilterAutomationTable, NULL);
280
281 /* check for success */
282 if (!NT_SUCCESS(Status))
283 {
284 DPRINT1("KsMergeAutomationTables failed with %lx\n", Status);
286 return Status;
287 }
288
289 /* allocate filter instance */
290 FilterInstance = AllocateItem(NonPagedPool, sizeof(BDA_FILTER_INSTANCE_ENTRY));
291 if (!FilterInstance)
292 {
293 /* not enough memory */
296 }
297
298 /* create the filter factory */
299 Status = KsCreateFilterFactory(pKSDevice->FunctionalDeviceObject, FilterDescriptor, NULL, NULL, 0, NULL, NULL, &FilterFactory);
300
301 /* check for success */
302 if (NT_SUCCESS(Status))
303 {
304 if (FilterDescriptor->AutomationTable != &FilterAutomationTable)
305 {
306 /* add the item to filter object bag */
307 KsAddItemToObjectBag(FilterFactory->Bag, (PVOID)FilterDescriptor->AutomationTable, FreeFilterInstance);
308 }
309 else
310 {
311 /* make sure the automation table is not-read only */
312 Status = _KsEdit(FilterFactory->Bag, (PVOID*)&FilterDescriptor->AutomationTable, sizeof(KSAUTOMATION_TABLE), sizeof(KSAUTOMATION_TABLE), 0);
313
314 /* sanity check */
316
317 /* add to object bag */
318 KsAddItemToObjectBag(FilterFactory->Bag, (PVOID)FilterDescriptor->AutomationTable, FreeFilterInstance);
319 }
320
321 /* initialize filter instance entry */
322 FilterInstance->FilterFactoryInstance = FilterFactory;
323 FilterInstance->FilterTemplate = (BDA_FILTER_TEMPLATE *)BdaFilterTemplate;
324
325 /* acquire list lock */
327
328 /* insert factory at the end */
330
331 /* release spin lock */
333
335 {
336 /* store result */
337 *ppKSFilterFactory = FilterFactory;
338 }
339 }
340 else
341 {
342 /* failed to create filter factory */
343 FreeItem(FilterInstance);
345 }
346
347 /* done */
348 DPRINT("BdaCreateFilterFactoryEx Status %x\n", Status);
349 return Status;
350}
351
352/*
353 @implemented
354*/
356NTAPI
358 IN PKSFILTER pKSFilter,
361{
362 PKSPIN_DESCRIPTOR_EX PinDescriptor;
363 PKSFILTERFACTORY FilterFactory;
364 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
366 ULONG PinId;
367 PKSPIN_DESCRIPTOR_EX NewPinDescriptor;
368
369 DPRINT("BdaCreatePin\n");
370
371 if (!pulPinId || !pKSFilter)
373
374 /* get parent filter factory */
375 FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
376
377 /* sanity check */
378 ASSERT(FilterFactory);
379
380 /* find instance entry */
381 InstanceEntry = GetFilterInstanceEntry(FilterFactory);
382
383 if (!InstanceEntry)
384 {
385 /* the filter was not initialized with BDA */
386 return STATUS_NOT_FOUND;
387 }
388
389 /* sanity checks */
390 ASSERT(InstanceEntry->FilterTemplate);
391 ASSERT(InstanceEntry->FilterTemplate->pFilterDescriptor);
392
393 /* does the filter support any pins */
394 if (!InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount)
395 {
396 /* no pins supported */
397 DPRINT("BdaCreatePin NoPins supported\n");
398 return STATUS_UNSUCCESSFUL;
399 }
400
401 /* is pin factory still existing */
402 if (InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount <= ulPinType)
403 {
404 /* pin request is out of bounds */
405 DPRINT("BdaCreatePin ulPinType %lu >= PinDescriptorCount %lu\n", ulPinType, InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount);
407 }
408
409 /* FIXME custom pin descriptors */
410 ASSERT(InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorSize == sizeof(KSPIN_DESCRIPTOR_EX));
411
412 /* get pin descriptor */
413 PinDescriptor = (PKSPIN_DESCRIPTOR_EX)&InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptors[ulPinType];
414
415 /* allocate pin descriptor */
416 NewPinDescriptor = AllocateItem(NonPagedPool, sizeof(KSPIN_DESCRIPTOR_EX));
417 if (!NewPinDescriptor)
418 {
419 /* no memory */
420 DPRINT("BdaCreatePin OutOfMemory\n");
422 }
423
424 /* make a copy of the pin descriptor */
425 RtlMoveMemory(NewPinDescriptor, PinDescriptor, sizeof(KSPIN_DESCRIPTOR_EX));
426
427 /* merge the automation tables */
428 Status = KsMergeAutomationTables((PKSAUTOMATION_TABLE*)&NewPinDescriptor->AutomationTable, (PKSAUTOMATION_TABLE)PinDescriptor->AutomationTable, &PinAutomationTable, pKSFilter->Bag);
429
430 /* check for success */
431 if (NT_SUCCESS(Status))
432 {
433 /* create the pin factory */
434 Status = KsFilterCreatePinFactory(pKSFilter, NewPinDescriptor, &PinId);
435
436 /* check for success */
437 if (NT_SUCCESS(Status))
438 {
439 /* store result */
440 *pulPinId = PinId;
441 }
442 }
443
444 DPRINT("BdaCreatePin Result %x PinId %u\n", Status, PinId);
445 return Status;
446}
447
448/*
449 @implemented
450*/
452NTAPI
454 IN PIRP Irp,
457{
459 PKSFILTER Filter;
460
461 DPRINT("BdaMethodCreatePin\n");
462
463 if (!Irp)
464 {
465 /* invalid parameter */
467 }
468
469 /* get filter from irp */
471
472 /* sanity check */
473 ASSERT(Filter);
475
476 /* get method request */
478
479 /* create the pin */
480 return BdaCreatePin(Filter, Pin->PinId, pulPinFactoryID);
481}
482
483/*
484 @implemented
485*/
487NTAPI
489 IN PKSFILTER pKSFilter,
491{
492 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
493 PKSFILTERFACTORY FilterFactory;
494 ULONG Index, PinId;
496
497 DPRINT("BdaInitFilter %p\n", pBdaFilterTemplate);
498
499 /* check input parameters */
500 if (!pKSFilter)
502
503 /* get parent filter factory */
504 FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
505
506 /* sanity check */
507 ASSERT(FilterFactory);
508
509 /* find instance entry */
510 InstanceEntry = GetFilterInstanceEntry(FilterFactory);
511
512 /* sanity check */
513 ASSERT(InstanceEntry);
514
516 {
517 /* use template from BdaCreateFilterFactoryEx */
518 pBdaFilterTemplate = InstanceEntry->FilterTemplate;
519 }
520
521 /* now create the pins */
522 for(Index = 0; Index < pBdaFilterTemplate->pFilterDescriptor->PinDescriptorsCount; Index++)
523 {
524 /* create the pin */
525 Status = BdaCreatePin(pKSFilter, Index, &PinId);
526
527 /* check for success */
528 if (!NT_SUCCESS(Status))
529 break;
530 }
531
532 /* done */
533 return Status;
534}
535
536/*
537 @implemented
538*/
540NTAPI
542 IN PKSFILTER pKSFilter,
545{
546 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
547 PKSFILTERFACTORY FilterFactory;
548 KSTOPOLOGY_CONNECTION Connection;
549
550 DPRINT("BdaCreateTopology\n");
551
552 /* check input parameters */
553 if (!pKSFilter)
555
556 /* get parent filter factory */
557 FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
558
559 /* sanity check */
560 ASSERT(FilterFactory);
561
562 /* find instance entry */
563 InstanceEntry = GetFilterInstanceEntry(FilterFactory);
564
565 if (!InstanceEntry)
566 {
567 /* the filter was not initialized with BDA */
568 return STATUS_NOT_FOUND;
569 }
570
571 if (InputPinId >= InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount ||
572 OutputPinId >= InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount)
573 {
574 /* invalid pin id */
576 }
577
578 /* initialize topology connection */
579 Connection.FromNode = KSFILTER_NODE;
580 Connection.ToNode = KSFILTER_NODE;
581 Connection.FromNodePin = InputPinId;
582 Connection.ToNodePin = OutputPinId;
583
584 /* add the connection */
585 return KsFilterAddTopologyConnections(pKSFilter, 1, &Connection);
586}
587
588/*
589 @unimplemented
590*/
592NTAPI
594 IN PKSFILTER pKSFilter,
596{
598 DPRINT("BdaDeletePin\n");
600}
601
602/*
603 @implemented
604*/
606NTAPI
608 IN PKSFILTERFACTORY FilterFactory,
609 IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL)
610{
611 DPRINT("BdaFilterFactoryUpdateCacheData\n");
613}
614
615/*
616 @implemented
617*/
619NTAPI
621 IN PIRP Irp,
622 OUT BDA_CHANGE_STATE *ChangeState)
623{
624 DPRINT("BdaGetChangeState\n");
625
626 if (Irp && ChangeState)
627 {
628 *ChangeState = BDA_CHANGES_COMPLETE;
629 return STATUS_SUCCESS;
630 }
631
632 /* invalid parameters supplied */
634
635}
636
637/*
638 @implemented
639*/
641NTAPI
643 IN PIRP Irp,
646{
647 PKSFILTER Filter;
649
650 DPRINT("BdaMethodCreateTopology\n");
651
652 /* check input parameters */
653 if (!Irp || !pKSMethod)
655
656 /* get filter */
658
659 /* sanity check */
660 ASSERT(Filter);
661
662 /* get method request */
664
665 /* create the topology */
666 return BdaCreateTopology(Filter, Node->ulInputPinId, Node->ulOutputPinId);
667}
668
669/*
670 @implemented
671*/
673NTAPI
675 IN PIRP Irp,
678{
679 DPRINT("BdaMethodDeletePin\n");
680
681 if (!Irp)
683
684 return STATUS_SUCCESS;
685}
686
687/*
688 @unimplemented
689*/
691NTAPI
693 IN PIRP Irp,
696{
698 DPRINT("BdaPropertyGetControllingPinId\n");
700}
701
702/*
703 @implemented
704*/
706NTAPI
708 IN PIRP Irp,
711{
712 PKSPIN Pin;
713 PKSFILTER Filter;
714 PKSFILTERFACTORY FilterFactory;
715 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
716
717 DPRINT("BdaPropertyGetPinControl\n");
718
719 /* first get the pin */
721 ASSERT(Pin);
722
723 /* now get the parent filter */
725 ASSERT(Filter);
726
727 /* get parent filter factory */
728 FilterFactory = KsFilterGetParentFilterFactory(Filter);
729 ASSERT(FilterFactory);
730
731 /* find instance entry */
732 InstanceEntry = GetFilterInstanceEntry(FilterFactory);
733 ASSERT(InstanceEntry);
734
735 /* sanity check */
736 pKSProperty++;
738
739 /* store pin id */
740 *pulProperty = Pin->Id;
741
742 return STATUS_SUCCESS;
743}
744
745/*
746 @unimplemented
747*/
749NTAPI
751 IN PIRP Irp,
754{
756 DPRINT("BdaPropertyNodeDescriptors\n");
758}
759
760/*
761 @unimplemented
762*/
764NTAPI
766 IN PIRP Irp,
769{
771 DPRINT("BdaPropertyNodeEvents\n");
773}
774
775/*
776 @unimplemented
777*/
779NTAPI
781 IN PIRP Irp,
784{
786 DPRINT("BdaPropertyNodeMethods\n");
788}
789
790/*
791 @unimplemented
792*/
794NTAPI
796 IN PIRP Irp,
799{
801 DPRINT("BdaPropertyNodeProperties\n");
803}
804
805/*
806 @implemented
807*/
809NTAPI
811 IN PIRP Irp,
814{
815 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
816 PKSFILTERFACTORY FilterFactory;
817 PKSFILTER pKSFilter;
818 PIO_STACK_LOCATION IoStack;
819 ULONG Index;
820
821 DPRINT("BdaPropertyNodeTypes\n");
822
823 /* check input parameter */
824 if (!Irp || !pKSProperty)
826
827 /* first get the filter */
828 pKSFilter = KsGetFilterFromIrp(Irp);
829
830 /* sanity check */
831 ASSERT(pKSFilter);
832
833 /* get parent filter factory */
834 FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
835
836 /* sanity check */
837 ASSERT(FilterFactory);
838
839 /* find instance entry */
840 InstanceEntry = GetFilterInstanceEntry(FilterFactory);
841 ASSERT(InstanceEntry);
842
843 /* get current irp stack */
845
846 /* are there node types provided */
847 if (!pulProperty)
848 {
849 /* no node entry array provided */
850 Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount * sizeof(ULONG);
851 Irp->IoStatus.Status = STATUS_MORE_ENTRIES;
852 return STATUS_MORE_ENTRIES;
853 }
854
855 if (InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount * sizeof(ULONG) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
856 {
857 /* buffer too small */
858 Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount * sizeof(ULONG);
859 Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
861 }
862
863 /* now copy all descriptors */
864 for(Index = 0; Index < InstanceEntry->FilterTemplate->pFilterDescriptor->NodeDescriptorsCount; Index++)
865 {
866 /* use the index as the type */
868 }
869
870 return STATUS_SUCCESS;
871}
872
873/*
874 @implemented
875*/
877NTAPI
879 IN PIRP Irp,
882{
883 PBDA_FILTER_INSTANCE_ENTRY InstanceEntry;
884 PKSFILTERFACTORY FilterFactory;
885 PKSFILTER pKSFilter;
886 PIO_STACK_LOCATION IoStack;
887 ULONG Index;
888
889 DPRINT("BdaPropertyPinTypes\n");
890
891 /* check input parameter */
892 if (!Irp || !pKSProperty)
894
895 /* first get the filter */
896 pKSFilter = KsGetFilterFromIrp(Irp);
897
898 /* sanity check */
899 ASSERT(pKSFilter);
900
901 /* get parent filter factory */
902 FilterFactory = KsFilterGetParentFilterFactory(pKSFilter);
903
904 /* sanity check */
905 ASSERT(FilterFactory);
906
907 /* find instance entry */
908 InstanceEntry = GetFilterInstanceEntry(FilterFactory);
909 ASSERT(InstanceEntry);
910
911 /* get current irp stack */
913
914 /* are there node types provided */
915 if (!pKSProperty)
916 {
917 /* no node entry array provided */
918 Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount * sizeof(ULONG);
919 Irp->IoStatus.Status = STATUS_MORE_ENTRIES;
920 return STATUS_MORE_ENTRIES;
921 }
922
923 if (InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount * sizeof(ULONG) > IoStack->Parameters.DeviceIoControl.OutputBufferLength)
924 {
925 /* buffer too small */
926 Irp->IoStatus.Information = InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount * sizeof(ULONG);
927 Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
929 }
930
931 /* now copy all descriptors */
932 for(Index = 0; Index < InstanceEntry->FilterTemplate->pFilterDescriptor->PinDescriptorsCount; Index++)
933 {
934 /* use the index as the type */
936 }
937
938 return STATUS_SUCCESS;
939}
940
941/*
942 @implemented
943*/
945NTAPI
947 IN PIRP Irp,
950{
951 PBDA_FILTER_INSTANCE_ENTRY FilterInstance;
952 PKSFILTER Filter;
953 PIO_STACK_LOCATION IoStack;
954 ULONG Index;
955
956 DPRINT("BdaPropertyTemplateConnections\n");
957
958 /* validate parameters */
959 if (!Irp || !pKSProperty)
961
962 /* first get the filter */
964
965 /* sanity check */
966 ASSERT(Filter);
967
968 /* verify filter has been registered with BDA */
969 FilterInstance = GetFilterInstanceEntry(KsFilterGetParentFilterFactory(Filter));
970
971 if (!FilterInstance)
973
974 /* get current irp stack */
976
978 {
979 /* caller needs the size first */
980 Irp->IoStatus.Information = FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount * sizeof(KSTOPOLOGY_CONNECTION);
981 Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
983 }
984
985 /* sanity check */
986 ASSERT(FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount * sizeof(KSTOPOLOGY_CONNECTION) <= IoStack->Parameters.DeviceIoControl.OutputBufferLength);
987
988 for(Index = 0; Index < FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount; Index++)
989 {
990 /* sanity check */
991 ASSERT(FilterInstance->FilterTemplate->pFilterDescriptor->Connections);
992
993 /* copy connection */
995 }
996
997 /* store result */
998 Irp->IoStatus.Information = FilterInstance->FilterTemplate->pFilterDescriptor->ConnectionsCount * sizeof(KSTOPOLOGY_CONNECTION);
999 Irp->IoStatus.Status = STATUS_SUCCESS;
1000
1001 /* done */
1002 return STATUS_SUCCESS;
1003
1004}
1005
1006/*
1007 @implemented
1008*/
1010NTAPI
1012{
1013 DPRINT("BdaStartChanges\n");
1014
1015 if (Irp)
1016 return STATUS_SUCCESS;
1017 else
1019
1020}
1021
1022/*
1023 @implemented
1024*/
1026NTAPI
1027BdaUninitFilter(IN PKSFILTER pKSFilter)
1028{
1029 DPRINT("BdaUninitFilter\n");
1030 return STATUS_SUCCESS;
1031}
1032
1033/*
1034 @implemented
1035*/
1037NTAPI
1039 IN PIRP Irp,
1040 IN KSPROPERTY *KSProperty)
1041{
1042 DPRINT("BdaValidateNodeProperty\n");
1043
1044 /* check for valid parameter */
1045 if (Irp && KSProperty)
1046 return STATUS_SUCCESS;
1047
1049}
NTSTATUS NTAPI KsAddItemToObjectBag(IN KSOBJECT_BAG ObjectBag, IN PVOID Item, IN PFNKSFREE Free OPTIONAL)
Definition: bag.c:86
KSDDKAPI NTSTATUS NTAPI _KsEdit(IN KSOBJECT_BAG ObjectBag, IN OUT PVOID *PointerToPointerToItem, IN ULONG NewSize, IN ULONG OldSize, IN ULONG Tag)
Definition: bag.c:358
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_EVENTS(GetHandler, SetHandler)
Definition: bdamedia.h:115
#define DEFINE_KSPROPERTY_ITEM_BDA_PIN_ID(GetHandler, SetHandler)
Definition: bdamedia.h:198
#define DEFINE_KSPROPERTY_ITEM_BDA_TEMPLATE_CONNECTIONS(GetHandler, SetHandler)
Definition: bdamedia.h:91
#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_TYPES(GetHandler, SetHandler)
Definition: bdamedia.h:75
#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_DESCRIPTORS(GetHandler, SetHandler)
Definition: bdamedia.h:131
#define DEFINE_KSMETHOD_ITEM_BDA_CREATE_TOPOLOGY(MethodHandler, SupportHandler)
Definition: bdamedia.h:173
#define DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPE(GetHandler, SetHandler)
Definition: bdamedia.h:206
#define DEFINE_KSPROPERTY_ITEM_BDA_PIN_TYPES(GetHandler, SetHandler)
Definition: bdamedia.h:83
#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_PROPERTIES(GetHandler, SetHandler)
Definition: bdamedia.h:107
#define DEFINE_KSPROPERTY_ITEM_BDA_NODE_METHODS(GetHandler, SetHandler)
Definition: bdamedia.h:99
#define DEFINE_KSPROPERTY_ITEM_BDA_CONTROLLING_PIN_ID(GetHandler, SetHandler)
Definition: bdamedia.h:123
@ KSPROPERTY_BDA_PIN_TYPE
Definition: bdamedia.h:195
struct _KSP_BDA_NODE_PIN * PKSP_BDA_NODE_PIN
KSMETHOD_SET FilterMethodSet
Definition: bdasup.c:44
NTSTATUS NTAPI BdaUninitFilter(IN PKSFILTER pKSFilter)
Definition: bdasup.c:1027
NTSTATUS NTAPI BdaPropertyNodeMethods(IN PIRP Irp, IN KSP_NODE *pKSProperty, OUT GUID *pguidProperty)
Definition: bdasup.c:780
KSPROPERTY_SET PinPropertySet
Definition: bdasup.c:72
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: bdasup.c:95
NTSTATUS NTAPI BdaPropertyNodeTypes(IN PIRP Irp, IN KSPROPERTY *pKSProperty, OUT ULONG *pulProperty)
Definition: bdasup.c:810
const GUID KSPROPSETID_BdaPinControl
Definition: bdasup.c:6
NTSTATUS NTAPI BdaFilterFactoryUpdateCacheData(IN PKSFILTERFACTORY FilterFactory, IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL)
Definition: bdasup.c:607
KSAUTOMATION_TABLE PinAutomationTable
Definition: bdasup.c:81
VOID NTAPI FreeFilterInstance(IN PVOID Context)
Definition: bdasup.c:207
NTSTATUS NTAPI BdaInitFilter(IN PKSFILTER pKSFilter, IN const BDA_FILTER_TEMPLATE *pBdaFilterTemplate)
Definition: bdasup.c:488
NTSTATUS NTAPI BdaValidateNodeProperty(IN PIRP Irp, IN KSPROPERTY *KSProperty)
Definition: bdasup.c:1038
NTSTATUS NTAPI BdaPropertyNodeDescriptors(IN PIRP Irp, IN KSPROPERTY *pKSProperty, OUT BDANODE_DESCRIPTOR *pNodeDescriptorProperty)
Definition: bdasup.c:750
NTSTATUS NTAPI DllInitialize(PUNICODE_STRING RegistryPath)
Definition: bdasup.c:150
NTSTATUS NTAPI BdaCreateTopology(IN PKSFILTER pKSFilter, IN ULONG InputPinId, IN ULONG OutputPinId)
Definition: bdasup.c:541
NTSTATUS NTAPI BdaCheckChanges(IN PIRP Irp)
Definition: bdasup.c:167
KSPROPERTY_ITEM FilterPropertyItem[]
Definition: bdasup.c:17
NTSTATUS NTAPI BdaPropertyNodeEvents(IN PIRP Irp, IN KSP_NODE *pKSProperty, OUT GUID *pguidProperty)
Definition: bdasup.c:765
NTSTATUS NTAPI BdaCreateFilterFactoryEx(IN PKSDEVICE pKSDevice, IN const KSFILTER_DESCRIPTOR *pFilterDescriptor, IN const BDA_FILTER_TEMPLATE *BdaFilterTemplate, OUT PKSFILTERFACTORY *ppKSFilterFactory)
Definition: bdasup.c:246
NTSTATUS NTAPI BdaPropertyPinTypes(IN PIRP Irp, IN KSPROPERTY *pKSProperty, OUT ULONG *pulProperty)
Definition: bdasup.c:878
const GUID KSMETHODSETID_BdaDeviceConfiguration
Definition: bdasup.c:7
PBDA_FILTER_INSTANCE_ENTRY GetFilterInstanceEntry(IN PKSFILTERFACTORY FilterFactory)
Definition: bdasup.c:110
const GUID KSPROPSETID_BdaTopology
Definition: bdasup.c:8
KSPROPERTY_ITEM PinPropertyItem[]
Definition: bdasup.c:66
NTSTATUS NTAPI BdaPropertyGetPinControl(IN PIRP Irp, IN KSPROPERTY *pKSProperty, OUT ULONG *pulProperty)
Definition: bdasup.c:707
KSMETHOD_ITEM FilterMethodItem[]
Definition: bdasup.c:38
NTSTATUS NTAPI BdaPropertyGetControllingPinId(IN PIRP Irp, IN KSP_BDA_NODE_PIN *pProperty, OUT ULONG *pulControllingPinId)
Definition: bdasup.c:692
KSAUTOMATION_TABLE FilterAutomationTable
Definition: bdasup.c:53
NTSTATUS NTAPI BdaCreatePin(IN PKSFILTER pKSFilter, IN ULONG ulPinType, OUT ULONG *pulPinId)
Definition: bdasup.c:357
#define TAG_BDASUP
Definition: bdasup.c:4
NTSTATUS NTAPI BdaMethodCreateTopology(IN PIRP Irp, IN KSMETHOD *pKSMethod, OPTIONAL PVOID pvIgnored)
Definition: bdasup.c:642
NTSTATUS NTAPI BdaGetChangeState(IN PIRP Irp, OUT BDA_CHANGE_STATE *ChangeState)
Definition: bdasup.c:620
NTSTATUS NTAPI BdaDeletePin(IN PKSFILTER pKSFilter, IN ULONG *pulPinId)
Definition: bdasup.c:593
NTSTATUS NTAPI BdaStartChanges(IN PIRP Irp)
Definition: bdasup.c:1011
NTSTATUS NTAPI BdaCreateFilterFactory(IN PKSDEVICE pKSDevice, IN const KSFILTER_DESCRIPTOR *pFilterDescriptor, IN const BDA_FILTER_TEMPLATE *pBdaFilterTemplate)
Definition: bdasup.c:197
KSPROPERTY_SET FilterPropertySet
Definition: bdasup.c:29
NTSTATUS NTAPI BdaPropertyNodeProperties(IN PIRP Irp, IN KSP_NODE *pKSProperty, OUT GUID *pguidProperty)
Definition: bdasup.c:795
VOID FreeItem(IN PVOID Item)
Definition: bdasup.c:103
NTSTATUS NTAPI BdaCommitChanges(IN PIRP Irp)
Definition: bdasup.c:182
NTSTATUS NTAPI BdaPropertyTemplateConnections(IN PIRP Irp, IN KSPROPERTY *pKSProperty, OUT KSTOPOLOGY_CONNECTION *pConnectionProperty)
Definition: bdasup.c:946
NTSTATUS NTAPI BdaMethodDeletePin(IN PIRP Irp, IN KSMETHOD *pKSMethod, OPTIONAL PVOID pvIgnored)
Definition: bdasup.c:674
NTSTATUS NTAPI BdaMethodCreatePin(IN PIRP Irp, IN KSMETHOD *pKSMethod, OUT ULONG *pulPinFactoryID)
Definition: bdasup.c:453
BDA_GLOBAL g_Settings
Definition: bdasup.c:10
_Must_inspect_result_ _In_ const KSFILTER_DESCRIPTOR _In_ const BDA_FILTER_TEMPLATE _Out_opt_ PKSFILTERFACTORY * ppKSFilterFactory
Definition: bdasup.h:81
struct _KSM_PIN * PKSM_PIN
_Must_inspect_result_ _In_ KSMETHOD _Out_opt_ ULONG * pulPinFactoryID
Definition: bdasup.h:133
_Must_inspect_result_ _In_ KSP_BDA_NODE_PIN * pProperty
Definition: bdasup.h:156
_Must_inspect_result_ _In_ KSMETHOD PVOID pvIgnored
Definition: bdasup.h:141
_Must_inspect_result_ _In_ KSPROPERTY _Out_opt_ KSTOPOLOGY_CONNECTION * pConnectionProperty
Definition: bdasup.h:221
_Must_inspect_result_ _In_ ULONG ulPinType
Definition: bdasup.h:88
_Must_inspect_result_ _In_ const KSFILTER_DESCRIPTOR * pFilterDescriptor
Definition: bdasup.h:71
_Must_inspect_result_ _In_ KSPROPERTY _Out_opt_ ULONG * pulProperty
Definition: bdasup.h:165
_Must_inspect_result_ _In_ ULONG _Out_opt_ ULONG * pulPinId
Definition: bdasup.h:89
_Must_inspect_result_ _In_ KSPROPERTY _Out_opt_ BDANODE_DESCRIPTOR * pNodeDescriptorProperty
Definition: bdasup.h:173
_Must_inspect_result_ _In_ KSP_BDA_NODE_PIN _Out_opt_ ULONG * pulControllingPinId
Definition: bdasup.h:157
_Must_inspect_result_ _In_ const KSFILTER_DESCRIPTOR _In_ const BDA_FILTER_TEMPLATE * pBdaFilterTemplate
Definition: bdasup.h:72
_Must_inspect_result_ _In_ KSP_NODE _Out_opt_ GUID * pguidProperty
Definition: bdasup.h:181
_Must_inspect_result_ _In_ KSMETHOD * pKSMethod
Definition: bdasup.h:132
_Must_inspect_result_ _In_ ULONG InputPinId
Definition: bdasup.h:96
_Must_inspect_result_ _In_ KSPROPERTY * pKSProperty
Definition: bdasup.h:164
_Must_inspect_result_ _In_ ULONG _In_ ULONG OutputPinId
Definition: bdasup.h:97
BDA_CHANGE_STATE
Definition: bdatypes.h:115
@ BDA_CHANGES_COMPLETE
Definition: bdatypes.h:116
#define UNIMPLEMENTED
Definition: debug.h:115
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
union node Node
Definition: types.h:1255
NTSTATUS NTAPI KsMergeAutomationTables(OUT PKSAUTOMATION_TABLE *AutomationTableAB, IN PKSAUTOMATION_TABLE AutomationTableA OPTIONAL, IN PKSAUTOMATION_TABLE AutomationTableB OPTIONAL, IN KSOBJECT_BAG Bag OPTIONAL)
Definition: api.c:2303
KSDDKAPI NTSTATUS NTAPI KsFilterCreatePinFactory(IN PKSFILTER Filter, IN const KSPIN_DESCRIPTOR_EX *const InPinDescriptor, OUT PULONG PinID)
Definition: filter.c:1956
KSDDKAPI NTSTATUS NTAPI KsFilterAddTopologyConnections(IN PKSFILTER Filter, IN ULONG NewConnectionsCount, IN const KSTOPOLOGY_CONNECTION *const NewTopologyConnections)
Definition: filter.c:1865
KSDDKAPI PKSFILTER NTAPI KsGetFilterFromIrp(IN PIRP Irp)
Definition: filter.c:2106
PKSFILTER NTAPI KsPinGetParentFilter(IN PKSPIN Pin)
Definition: pin.c:1097
KSDDKAPI PKSPIN NTAPI KsGetPinFromIrp(IN PIRP Irp)
Definition: pin.c:1211
struct BDA_FILTER_INSTANCE_ENTRY * PBDA_FILTER_INSTANCE_ENTRY
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeInitializeSpinLock(sl)
Definition: env_spec_w32.h:604
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
KSDDKAPI NTSTATUS NTAPI KsCreateFilterFactory(IN PDEVICE_OBJECT DeviceObject, IN const KSFILTER_DESCRIPTOR *Descriptor, IN PWSTR RefString OPTIONAL, IN PSECURITY_DESCRIPTOR SecurityDescriptor OPTIONAL, IN ULONG CreateItemFlags, IN PFNKSFILTERFACTORYPOWER SleepCallback OPTIONAL, IN PFNKSFILTERFACTORYPOWER WakeCallback OPTIONAL, OUT PKSFILTERFACTORY *FilterFactory OPTIONAL)
KSDDKAPI NTSTATUS NTAPI KsFilterFactoryUpdateCacheData(IN PKSFILTERFACTORY FilterFactory, IN const KSFILTER_DESCRIPTOR *FilterDescriptor OPTIONAL)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
Status
Definition: gdiplustypes.h:25
#define KSFILTER_NODE
Definition: ks.h:44
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_NOT_FOUND
Definition: shellext.h:72
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define DPRINT
Definition: sndvol32.h:71
const KSFILTER_DESCRIPTOR FilterDescriptor
Definition: splitter.c:229
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: precomp.h:18
PKSFILTERFACTORY FilterFactoryInstance
Definition: precomp.h:20
LIST_ENTRY Entry
Definition: precomp.h:19
PBDA_FILTER_TEMPLATE FilterTemplate
Definition: precomp.h:21
LIST_ENTRY FilterFactoryInstanceList
Definition: precomp.h:28
BOOLEAN Initialized
Definition: precomp.h:26
KSPIN_LOCK FilterFactoryInstanceListLock
Definition: precomp.h:27
base of all file and directory entries
Definition: entries.h:83
ULONG Id
Definition: dmksctrl.h:77
Definition: ks.h:2074
const KSFILTER_DESCRIPTOR * pFilterDescriptor
Definition: bdasup.h:31
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
INT POOL_TYPE
Definition: typedefs.h:78
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
Definition: dlist.c:348
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036