Author: janderwald
Date: Thu Oct 20 20:02:43 2016
New Revision: 72999
URL:
http://svn.reactos.org/svn/reactos?rev=72999&view=rev
Log:
[KS]
- implement support for KSPROPSETID_General
Modified:
trunk/reactos/drivers/ksfilter/ks/filter.c
trunk/reactos/drivers/ksfilter/ks/pin.c
trunk/reactos/drivers/ksfilter/ks/precomp.h
trunk/reactos/drivers/ksfilter/ks/property.c
Modified: trunk/reactos/drivers/ksfilter/ks/filter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] Thu Oct 20 20:02:43 2016
@@ -45,6 +45,7 @@
const GUID IID_IKsFilter = {0x3ef6ee44L, 0x0D41, 0x11d2, {0xbe, 0xDA, 0x00, 0xc0, 0x4f,
0x8e, 0xF4, 0x57}};
const GUID KSPROPSETID_Topology = {0x720D4AC0L, 0x7533, 0x11D0, {0xA5,
0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
const GUID KSPROPSETID_Pin = {0x8C134960L, 0x51AD, 0x11CF, {0x87,
0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}};
+const GUID KSPROPSETID_General = {0x1464EDA5L, 0x6A8F, 0x11D1, {0x9A,
0xA7, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
VOID
IKsFilter_RemoveFilterFromFilterFactory(
@@ -53,10 +54,11 @@
NTSTATUS NTAPI FilterTopologyPropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN
OUT PVOID Data);
NTSTATUS NTAPI FilterPinPropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT
PVOID Data);
-
+NTSTATUS NTAPI FilterGeneralComponentIdHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN
OUT PVOID Data);
DEFINE_KSPROPERTY_TOPOLOGYSET(IKsFilterTopologySet, FilterTopologyPropertyHandler);
DEFINE_KSPROPERTY_PINPROPOSEDATAFORMAT(IKsFilterPinSet, FilterPinPropertyHandler,
FilterPinPropertyHandler, FilterPinPropertyHandler);
+DEFINE_KSPROPERTY_GENEREAL_COMPONENTID(IKsFilterGeneralSet,
FilterGeneralComponentIdHandler);
KSPROPERTY_SET FilterPropertySet[] =
{
@@ -71,6 +73,13 @@
&KSPROPSETID_Pin,
sizeof(IKsFilterPinSet) / sizeof(KSPROPERTY_ITEM),
(const KSPROPERTY_ITEM*)&IKsFilterPinSet,
+ 0,
+ NULL
+ },
+ {
+ &KSPROPSETID_General,
+ sizeof(IKsFilterGeneralSet) / sizeof(KSPROPERTY_ITEM),
+ (const KSPROPERTY_ITEM*)&IKsFilterGeneralSet,
0,
NULL
}
@@ -906,6 +915,39 @@
}
+NTSTATUS
+NTAPI
+FilterGeneralComponentIdHandler(
+ IN PIRP Irp,
+ IN PKSIDENTIFIER Request,
+ IN OUT PVOID Data)
+{
+ PIO_STACK_LOCATION IoStack;
+ IKsFilterImpl * This;
+
+ /* get filter implementation */
+ This = (IKsFilterImpl*)KSPROPERTY_ITEM_IRP_STORAGE(Irp);
+
+ /* sanity check */
+ ASSERT(This);
+
+ /* get current stack location */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+ ASSERT(IoStack->Parameters.DeviceIoControl.OutputBufferLength >=
sizeof(KSCOMPONENTID));
+
+ if (This->Filter.Descriptor->ComponentId != NULL)
+ {
+ RtlMoveMemory(Data, This->Filter.Descriptor->ComponentId,
sizeof(KSCOMPONENTID));
+ Irp->IoStatus.Information = sizeof(KSCOMPONENTID);
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ /* not valid */
+ return STATUS_NOT_FOUND;
+ }
+
+}
NTSTATUS
NTAPI
@@ -977,6 +1019,7 @@
UNICODE_STRING GuidString;
PKSPROPERTY Property;
ULONG SetCount = 0;
+ //PKSP_NODE NodeProperty;
/* obtain filter from object header */
Status = IKsFilter_GetFilterFromIrp(Irp, &Filter);
@@ -1024,8 +1067,20 @@
{
const KSPROPERTY_SET *PropertySet = NULL;
ULONG PropertyItemSize = 0;
-
+#if 0
/* check if the driver supports method sets */
+ if (Property->Flags & KSPROPERTY_TYPE_TOPOLOGY)
+ {
+ NodeProperty = (PKSP_NODE)Property;
+ if
(FilterInstance->Descriptor->NodeDescriptors[NodeProperty->NodeId].AutomationTable
!= NULL)
+ {
+ SetCount =
FilterInstance->Descriptor->NodeDescriptors[NodeProperty->NodeId].AutomationTable->PropertySetsCount;
+ PropertySet =
FilterInstance->Descriptor->NodeDescriptors[NodeProperty->NodeId].AutomationTable->PropertySets;
+ PropertyItemSize = 0;
+ }
+
+ } else
+#endif
if (FilterInstance->Descriptor->AutomationTable->PropertySetsCount)
{
SetCount =
FilterInstance->Descriptor->AutomationTable->PropertySetsCount;
@@ -1267,7 +1322,7 @@
/* setup filter property sets */
AutomationTable.PropertyItemSize = sizeof(KSPROPERTY_ITEM);
- AutomationTable.PropertySetsCount = 2;
+ AutomationTable.PropertySetsCount = 3;
AutomationTable.PropertySets = FilterPropertySet;
/* merge filter automation table */
Modified: trunk/reactos/drivers/ksfilter/ks/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/pin.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/pin.c [iso-8859-1] Thu Oct 20 20:02:43 2016
@@ -1466,7 +1466,7 @@
{
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)CONTAINING_RECORD(StreamPointer,
KSISTREAM_POINTER, StreamPointer);
- DPRINT("KsStreamPointerUnlock StreamPointer %pEject %lu\n", StreamPointer,
Eject);
+ DPRINT1("KsStreamPointerUnlock StreamPointer %pEject %lu\n", StreamPointer,
Eject);
Pointer->Irp = NULL;
}
@@ -1483,7 +1483,7 @@
IN ULONG OutUsed,
IN BOOLEAN Eject)
{
- DPRINT("KsStreamPointerAdvanceOffsets InUsed %lu OutUsed %lu Eject %lu\n",
InUsed, OutUsed, Eject);
+ DPRINT1("KsStreamPointerAdvanceOffsets InUsed %lu OutUsed %lu Eject %lu\n",
InUsed, OutUsed, Eject);
DbgBreakPoint();
UNIMPLEMENTED
}
@@ -2636,8 +2636,8 @@
{
/* failed to create pin, release resources */
IKsFilter_RemovePin(Filter->lpVtbl->GetStruct(Filter), &This->Pin);
+ KsFreeObjectBag((KSOBJECT_BAG)This->Pin.Bag);
KsFreeObjectHeader((KSOBJECT_HEADER)This->ObjectHeader);
- KsFreeObjectBag((KSOBJECT_BAG)This->Pin.Bag);
FreeItem(This);
/* return failure code */
Modified: trunk/reactos/drivers/ksfilter/ks/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/precom…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/precomp.h [iso-8859-1] Thu Oct 20 20:02:43 2016
@@ -33,6 +33,11 @@
DEFINE_KSPROPERTY_ITEM_PIN_CONSTRAINEDDATARANGES(PropGeneral),\
DEFINE_KSPROPERTY_ITEM_PIN_PROPOSEDATAFORMAT(PropGeneral)\
}
+#define DEFINE_KSPROPERTY_GENEREAL_COMPONENTID(PinSet,\
+ PropGeneral)\
+DEFINE_KSPROPERTY_TABLE(PinSet) {\
+DEFINE_KSPROPERTY_ITEM_GENERAL_COMPONENTID(PropGeneral)\
+}
#define DEFINE_KSPROPERTY_CONNECTIONSET(PinSet,\
PropStateHandler, PropDataFormatHandler, PropAllocatorFraming)\
Modified: trunk/reactos/drivers/ksfilter/ks/property.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/proper…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/property.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/property.c [iso-8859-1] Thu Oct 20 20:02:43 2016
@@ -30,6 +30,8 @@
OUT PKSPROPERTY_ITEM *PropertyItem)
{
ULONG Index, ItemIndex;
+ PULONG Flags;
+ PKSPROPERTY_DESCRIPTION Description;
for(Index = 0; Index < PropertySetCount; Index++)
{
@@ -39,46 +41,16 @@
{
for(ItemIndex = 0; ItemIndex < PropertySet[Index].PropertiesCount;
ItemIndex++)
{
+
+ /* store property set */
+ *Set = (PKSPROPERTY_SET)&PropertySet[Index];
+ *PropertyItem =
(PKSPROPERTY_ITEM)&PropertySet[Index].PropertyItem[ItemIndex];
+
+
if (PropertySet[Index].PropertyItem[ItemIndex].PropertyId ==
Property->Id)
{
- if (PropertySet[Index].PropertyItem[ItemIndex].MinProperty >
InputBufferLength)
- {
- /* too small input buffer */
- IoStatus->Information =
PropertySet[Index].PropertyItem[ItemIndex].MinProperty;
- return STATUS_INVALID_PARAMETER;
- }
-
- if (PropertySet[Index].PropertyItem[ItemIndex].MinData >
OutputBufferLength)
- {
- /* too small output buffer */
- IoStatus->Information =
PropertySet[Index].PropertyItem[ItemIndex].MinData;
- return STATUS_MORE_ENTRIES;
- }
-
- /* store property set */
- *Set = (PKSPROPERTY_SET)&PropertySet[Index];
- *PropertyItem =
(PKSPROPERTY_ITEM)&PropertySet[Index].PropertyItem[ItemIndex];
-
- if (Property->Flags & KSPROPERTY_TYPE_SET)
- {
- /* store property handler */
- *PropertyHandler =
PropertySet[Index].PropertyItem[ItemIndex].SetPropertyHandler;
- return STATUS_SUCCESS;
- }
-
- if (Property->Flags & KSPROPERTY_TYPE_GET)
- {
- /* store property handler */
- *PropertyHandler =
PropertySet[Index].PropertyItem[ItemIndex].GetPropertyHandler;
- return STATUS_SUCCESS;
- }
-
-
if (Property->Flags & KSPROPERTY_TYPE_BASICSUPPORT)
{
- PULONG Flags;
- PKSPROPERTY_DESCRIPTION Description;
-
if (sizeof(ULONG) > OutputBufferLength)
{
/* too small buffer */
@@ -123,6 +95,37 @@
}
return STATUS_SUCCESS;
}
+
+ if (PropertySet[Index].PropertyItem[ItemIndex].MinProperty >
InputBufferLength)
+ {
+ /* too small input buffer */
+ IoStatus->Information =
PropertySet[Index].PropertyItem[ItemIndex].MinProperty;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (PropertySet[Index].PropertyItem[ItemIndex].MinData >
OutputBufferLength)
+ {
+ /* too small output buffer */
+ IoStatus->Information =
PropertySet[Index].PropertyItem[ItemIndex].MinData;
+ return STATUS_MORE_ENTRIES;
+ }
+
+
+ if (Property->Flags & KSPROPERTY_TYPE_SET)
+ {
+ /* store property handler */
+ *PropertyHandler =
PropertySet[Index].PropertyItem[ItemIndex].SetPropertyHandler;
+ return STATUS_SUCCESS;
+ }
+
+ if (Property->Flags & KSPROPERTY_TYPE_GET)
+ {
+ /* store property handler */
+ *PropertyHandler =
PropertySet[Index].PropertyItem[ItemIndex].GetPropertyHandler;
+ return STATUS_SUCCESS;
+ }
+
+
}
}
}