46 return (IIrpTarget*)IoStack->
FileObject->FsContext;
81 IN PKSPROPERTY_SET PropertySet,
96 KSPROPERTY_ITEM_IRP_STORAGE(
Irp) = (PKSPROPERTY_ITEM)SubDeviceDescriptor;
140 PKSPROPERTY_SET PropertySet;
150 if (!PropertyRequest)
163 PropertySet = (PKSPROPERTY_SET)KSPROPERTY_SET_IRP_STORAGE(
Irp);
177 PropertyRequest->
Irp =
Irp;
226 if (PropertySet->PropertyItem[
Index].PropertyId ==
Property->Id)
241 if (PropertyRequest->
Node <
Descriptor->DeviceDescriptor->NodeCount)
254 for(
Index = 0; Index < NodeAutomation->PropertyCount;
Index++)
281 DPRINT(
"Calling Node %lu MajorTarget %p MinorTarget %p PropertySet %S PropertyId %lu PropertyFlags %lx InstanceSize %lu ValueSize %lu Handler %p PropertyRequest %p PropertyItemFlags %lx PropertyItemId %lu\n",
286 DPRINT(
"Status %lx ValueSize %lu Information %lu\n",
Status, PropertyRequest->
ValueSize,
Irp->IoStatus.Information);
312 ULONG Index, PropertySetIndex, PropertySetItemIndex;
313 PKSPROPERTY_SET NewPropertySet;
324 for(
Index = 0;
Index < SubDeviceDescriptor->FilterPropertySetCount;
Index++)
333 PropertySetIndex =
Index;
361 if (SubDeviceDescriptor->FilterPropertySetCount)
364 RtlMoveMemory(NewPropertySet, SubDeviceDescriptor->FilterPropertySet, SubDeviceDescriptor->FilterPropertySetCount *
sizeof(KSPROPERTY_SET));
371 SubDeviceDescriptor->FilterPropertySet = NewPropertySet;
374 PropertySetIndex = SubDeviceDescriptor->FilterPropertySetCount;
377 SubDeviceDescriptor->FilterPropertySetCount++;
383 SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].Set =
Guid;
384 SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertiesCount = 0;
388 FilterPropertyItem = (PKSPROPERTY_ITEM)SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertyItem;
398 PropertySetItemIndex =
Index;
409 NewFilterPropertyItem = (PKSPROPERTY_ITEM)
AllocateItem(
NonPagedPool, (SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertiesCount + 1) *
sizeof(KSPROPERTY_ITEM),
TAG_PORTCLASS);
410 if (!NewFilterPropertyItem)
417 if (SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertiesCount)
421 (
PVOID)SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertyItem,
422 SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertiesCount *
sizeof(KSPROPERTY_ITEM));
429 SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertyItem = NewFilterPropertyItem;
432 PropertySetItemIndex = SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertiesCount;
435 SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertiesCount++;
438 FilterPropertyItem = (PKSPROPERTY_ITEM)&SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertyItem[PropertySetItemIndex];
488 ASSERT(SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertyItem[PropertySetItemIndex].Relations ==
NULL);
493 ASSERT(SubDeviceDescriptor->FilterPropertySet[PropertySetIndex].PropertyItem[PropertySetItemIndex].Relations !=
NULL);
524 if (!AutomationTable)
530 DPRINT(
"=====================================================================\n");
531 DPRINT(
"%S%S AutomationTable %p\n", DebugIndentation, DebugPrefix, AutomationTable);
532 DPRINT(
"%S%S PropertyCount %lu\n", DebugIndentation, DebugPrefix, AutomationTable->PropertyCount);
533 DPRINT(
"%S%S EventCount %lu\n", DebugIndentation, DebugPrefix, AutomationTable->EventCount);
534 DPRINT(
"%S%S MethodCount %lu\n", DebugIndentation, DebugPrefix, AutomationTable->MethodCount);
537 if (AutomationTable->PropertyCount)
561 DPRINT1(
"DRIVER BUG: property item must be at least %lu but got %lu\n",
sizeof(
PCPROPERTY_ITEM), AutomationTable->PropertyItemSize);
566 if (AutomationTable->EventCount)
568 if (AutomationTable->EventItemSize >=
sizeof(
PCEVENT_ITEM))
580 DPRINT(
"%SEventItemIndex %lu %p GUID %S Id %u Flags %x\n", DebugIndentation,
Index, EventItem,
GuidString.Buffer, EventItem->
Id, EventItem->
Flags);
589 DPRINT1(
"DRIVER BUG: event item must be at least %lu but got %lu\n",
sizeof(
PCEVENT_ITEM), AutomationTable->EventItemSize);
594 if (AutomationTable->MethodCount)
596 if (AutomationTable->MethodItemSize >=
sizeof(
PCMETHOD_ITEM))
608 DPRINT(
"%SMethodItemIndex %lu %p GUID %S Id %u Flags %x\n", DebugIndentation,
Index, MethodItem,
GuidString.Buffer, MethodItem->
Id, MethodItem->
Flags);
618 DPRINT1(
"DRIVER BUG: method item must be at least %lu but got %lu\n",
sizeof(
PCEVENT_ITEM), AutomationTable->MethodItemSize);
621 DPRINT(
"=====================================================================\n");
633 DPRINT(
"======================\n");
634 DPRINT(
"Descriptor Automation Table %p\n",FilterDescription->AutomationTable);
635 DPRINT(
"PinCount %lu PinSize %lu StandardSize %lu\n", FilterDescription->PinCount, FilterDescription->PinSize,
sizeof(
PCPIN_DESCRIPTOR));
636 DPRINT(
"NodeCount %lu NodeSize %lu StandardSize %lu\n", FilterDescription->NodeCount, FilterDescription->NodeSize,
sizeof(
PCNODE_DESCRIPTOR));
641 if (FilterDescription->PinCount)
665 DPRINT1(
"DRIVER BUG: pin size smaller than minimum size\n");
669 if (FilterDescription->Nodes)
693 DPRINT1(
"DRIVER BUG: node size smaller than standard descriptor size\n");
697 DPRINT(
"ConnectionCount: %lu\n", FilterDescription->ConnectionCount);
699 if (FilterDescription->ConnectionCount)
701 DPRINT(
"------ Start of Nodes Connections ----------------\n");
704 DPRINT1(
"Index %ld FromPin %ld FromNode %ld -> ToPin %ld ToNode %ld\n",
Index,
705 FilterDescription->Connections[
Index].FromNodePin,
706 FilterDescription->Connections[
Index].FromNode,
707 FilterDescription->Connections[
Index].ToNodePin,
708 FilterDescription->Connections[
Index].ToNode);
710 DPRINT(
"------ End of Nodes Connections----------------\n");
712 DPRINT1(
"======================\n");
723 IN ULONG FilterPropertiesCount,
724 IN KSPROPERTY_SET * FilterProperties,
728 IN KSPROPERTY_SET * PinProperties,
730 IN KSEVENT_SET * EventSet,
761 if (FilterPropertiesCount)
769 Descriptor->FilterPropertySetCount = FilterPropertiesCount;
792 if (FilterDescription->AutomationTable)
798 for(
Index = 0; Index < FilterDescription->AutomationTable->PropertyCount;
Index++)
816 if (FilterDescription->PinCount)
829 Descriptor->Factory.PinDescriptorCount = FilterDescription->PinCount;
830 Descriptor->Factory.PinDescriptorSize =
sizeof(KSPIN_DESCRIPTOR);
854 for(SubIndex = 0; SubIndex < SrcDescriptor->AutomationTable->PropertyCount; SubIndex++)
882 if (FilterDescription->ConnectionCount)
886 if (!
Descriptor->Topology->TopologyConnections)
893 Descriptor->Topology->TopologyConnectionsCount = FilterDescription->ConnectionCount;
897 if (FilterDescription->NodeCount)
906 if (!
Descriptor->Topology->TopologyNodesNames)
913 for(
Index = 0; Index < FilterDescription->NodeCount;
Index++)
936 for(SubIndex = 0; SubIndex < NodeDescriptor->AutomationTable->PropertyCount; SubIndex++)
958 Descriptor->Topology->TopologyNodesCount = FilterDescription->NodeCount;
962 Descriptor->DeviceDescriptor = FilterDescription;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
struct SUBDEVICE_DESCRIPTOR * PSUBDEVICE_DESCRIPTOR
struct PIN_INSTANCE_INFO * PPIN_INSTANCE_INFO
KSPROPERTY_ITEM FilterPropertyItem[]
KSDDKAPI NTSTATUS NTAPI KsValidateConnectRequest(IN PIRP Irp, IN ULONG DescriptorsCount, IN KSPIN_DESCRIPTOR *Descriptor, OUT PKSPIN_CONNECT *Connect)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD IN DWORD Unknown6
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD IN DWORD IN DWORD Unknown5
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
#define STATUS_NOT_IMPLEMENTED
static void cleanup(void)
KSDDKAPI NTSTATUS NTAPI KsEnableEvent(IN PIRP Irp, IN ULONG EventSetsCount, IN KSEVENT_SET *EventSet, IN OUT PLIST_ENTRY EventsList OPTIONAL, IN KSEVENTS_LOCKTYPE EventsFlags OPTIONAL, IN PVOID EventsLock OPTIONAL)
KSDDKAPI NTSTATUS NTAPI KsDisableEvent(IN PIRP Irp, IN OUT PLIST_ENTRY EventsList, IN KSEVENTS_LOCKTYPE EventsFlags, IN PVOID EventsLock)
KSPROPERTY_SET FilterPropertySet[]
KSDDKAPI NTSTATUS NTAPI KsPropertyHandler(IN PIRP Irp, IN ULONG PropertySetsCount, IN const KSPROPERTY_SET *PropertySet)
#define KSPROPERTY_TYPE_TOPOLOGY
struct KSIDENTIFIER KSPROPERTY
struct KSIDENTIFIER * PKSPROPERTY
#define InitializeListHead(ListHead)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
struct KSTOPOLOGY * PKSTOPOLOGY
_In_ PKSPIN_CONNECT Connect
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
VOID FreeItem(IN PVOID Item)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_INVALID_BUFFER_SIZE
static GUID InterfaceGuids[3]
struct _PCPROPERTY_REQUEST * PPCPROPERTY_REQUEST
#define PCPROPERTY_ITEM_FLAG_SET
struct PCPROPERTY_ITEM * PPCPROPERTY_ITEM
struct _PCMETHOD_ITEM * PPCMETHOD_ITEM
#define PCPROPERTY_ITEM_FLAG_GET
struct PCAUTOMATION_TABLE * PPCAUTOMATION_TABLE
struct _PCEVENT_ITEM * PPCEVENT_ITEM
struct PCNODE_DESCRIPTOR * PPCNODE_DESCRIPTOR
struct PCPIN_DESCRIPTOR * PPCPIN_DESCRIPTOR
#define PCPROPERTY_ITEM_FLAG_BASICSUPPORT
const KSNODE_DESCRIPTOR NodeDescriptor[]
_In_ const GUID _In_ ULONG PinCount
const PCPROPERTY_ITEM * Properties
ULONG MaxGlobalInstanceCount
ULONG MinFilterInstanceCount
KSPIN_DESCRIPTOR KsPinDescriptor
const PCAUTOMATION_TABLE * AutomationTable
ULONG MaxFilterInstanceCount
PCPFNPROPERTY_HANDLER Handler
union _IO_STACK_LOCATION::@1581 Parameters
struct _IO_STACK_LOCATION::@1581::@1582 DeviceIoControl
const PCPROPERTY_ITEM * PropertyItem
#define RtlCopyMemory(Destination, Source, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS PcCaptureFormat(LONG Unknown, LONG Unknown2, LONG Unknown3, LONG Unknown4)
NTSTATUS NTAPI PcValidateConnectRequest(IN PIRP Irp, IN KSPIN_FACTORY *Factory, OUT PKSPIN_CONNECT *Connect)
IIrpTarget *NTAPI KsoGetIrpTargetFromFileObject(PFILE_OBJECT FileObject)
NTSTATUS NTAPI PcHandlePropertyWithTable(IN PIRP Irp, IN ULONG PropertySetCount, IN PKSPROPERTY_SET PropertySet, IN PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor)
NTSTATUS NTAPI KsoDispatchCreateWithGenericFactory(LONG Unknown, PIRP Irp)
NTSTATUS NTAPI PropertyItemDispatch(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
NTSTATUS NTAPI PcCreateSubdeviceDescriptor(OUT SUBDEVICE_DESCRIPTOR **OutSubdeviceDescriptor, IN ULONG InterfaceCount, IN GUID *InterfaceGuids, IN ULONG IdentifierCount, IN KSIDENTIFIER *Identifier, IN ULONG FilterPropertiesCount, IN KSPROPERTY_SET *FilterProperties, IN ULONG Unknown1, IN ULONG Unknown2, IN ULONG PinPropertiesCount, IN KSPROPERTY_SET *PinProperties, IN ULONG EventSetCount, IN KSEVENT_SET *EventSet, IN PPCFILTER_DESCRIPTOR FilterDescription)
IIrpTarget *NTAPI KsoGetIrpTargetFromIrp(PIRP Irp)
NTSTATUS NTAPI PcHandleDisableEventWithTable(IN PIRP Irp, IN PSUBDEVICE_DESCRIPTOR Descriptor)
NTSTATUS PcAddToPropertyTable(IN PSUBDEVICE_DESCRIPTOR SubDeviceDescriptor, IN PPCPROPERTY_ITEM PropertyItem, IN ULONG bNode)
VOID DumpFilterDescriptor(IN PPCFILTER_DESCRIPTOR FilterDescription)
NTSTATUS PcAddToEventTable(PVOID Ptr, LONG Unknown2, ULONG Length, LONG Unknown3, LONG Unknown4, LONG Unknown5, LONG Unknown6, LONG Unknown7)
NTSTATUS NTAPI PcHandleEnableEventWithTable(IN PIRP Irp, IN PSUBDEVICE_DESCRIPTOR Descriptor)
VOID DumpAutomationTable(IN PPCAUTOMATION_TABLE AutomationTable, IN LPCWSTR DebugPrefix, IN LPCWSTR DebugIndentation)
VOID NTAPI PcAcquireFormatResources(LONG Unknown, LONG Unknown2, LONG Unknown3, LONG Unknown4)
struct KSTOPOLOGY_CONNECTION * PKSTOPOLOGY_CONNECTION
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
#define IsEqualGUIDAligned(guid1, guid2)