Author: janderwald
Date: Thu Apr 1 05:14:45 2010
New Revision: 46634
URL:
http://svn.reactos.org/svn/reactos?rev=46634&view=rev
Log:
[KS]
- Fix a bad cast in KsGetDevice which led to a crash
- Store IKsFilter in create item storage which is needed later by the pin property
handler
- There is no need to copy the existing pin factories, just add pin factories which are
added dynamically
- Handle possible null values for node types & names
- Put allocated objects into object bags which can be released later automatically
- Fix access IKsFilterFactory interface in IKsFilterFactory_Create
- graphedt can now 'open' tv tuner and enumerate pins / communication / interface.
Code required for devenum not yet commited
Modified:
trunk/reactos/drivers/ksfilter/ks/api.c
trunk/reactos/drivers/ksfilter/ks/deviceinterface.c
trunk/reactos/drivers/ksfilter/ks/driver.c
trunk/reactos/drivers/ksfilter/ks/filter.c
trunk/reactos/drivers/ksfilter/ks/filterfactory.c
trunk/reactos/drivers/ksfilter/ks/pin.c
Modified: trunk/reactos/drivers/ksfilter/ks/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/api.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/api.c [iso-8859-1] Thu Apr 1 05:14:45 2010
@@ -1621,7 +1621,10 @@
IN PKSDEVICE Device)
{
IKsDevice *KsDevice;
- PKSIDEVICE_HEADER DeviceHeader = (PKSIDEVICE_HEADER)CONTAINING_RECORD(Device,
KSIDEVICE_HEADER, KsDevice);
+ PKSIDEVICE_HEADER DeviceHeader;
+
+
+ DeviceHeader = (PKSIDEVICE_HEADER)CONTAINING_RECORD(Device, KSIDEVICE_HEADER,
KsDevice);
/* get device interface*/
KsDevice = (IKsDevice*)&DeviceHeader->lpVtblIKsDevice;
Modified: trunk/reactos/drivers/ksfilter/ks/deviceinterface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/deviceinterface.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/deviceinterface.c [iso-8859-1] Thu Apr 1 05:14:45
2010
@@ -18,7 +18,7 @@
/* set device interface state */
Status = IoSetDeviceInterfaceState(&SymEntry->SymbolicLink, Enable);
- DPRINT("KspSetDeviceInterfacesState SymbolicLink %S Status %lx\n",
SymEntry->SymbolicLink.Buffer, Status, Enable);
+ DPRINT("KspSetDeviceInterfacesState SymbolicLink '%S' Status
%lx\n", SymEntry->SymbolicLink.Buffer, Status, Enable);
/* check for success */
if (!NT_SUCCESS(Status))
Modified: trunk/reactos/drivers/ksfilter/ks/driver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/driver…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/driver.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/driver.c [iso-8859-1] Thu Apr 1 05:14:45 2010
@@ -37,11 +37,12 @@
KsGetDevice(
IN PVOID Object)
{
- PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)(ULONG_PTR)Object -
sizeof(KSBASIC_HEADER);
+ PKSBASIC_HEADER BasicHeader = (PKSBASIC_HEADER)((ULONG_PTR)Object -
sizeof(KSBASIC_HEADER));
- DPRINT("KsGetDevice %p\n", Object);
+ DPRINT("KsGetDevice %p BasicHeader %p Type %x\n", Object, BasicHeader,
BasicHeader->Type);
ASSERT(BasicHeader->Type == KsObjectTypeFilterFactory || BasicHeader->Type ==
KsObjectTypeFilter || BasicHeader->Type == BasicHeader->Type);
+ ASSERT(BasicHeader->KsDevice);
return BasicHeader->KsDevice;
}
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 Apr 1 05:14:45 2010
@@ -21,6 +21,7 @@
PKSIOBJECT_HEADER ObjectHeader;
KSTOPOLOGY Topology;
+ KSPIN_DESCRIPTOR_EX * PinDescriptorsEx;
KSPIN_DESCRIPTOR * PinDescriptors;
ULONG PinDescriptorCount;
PKSFILTERFACTORY Factory;
@@ -695,7 +696,6 @@
UNIMPLEMENTED
Status = STATUS_UNSUCCESSFUL;
}
-
return Status;
}
@@ -736,6 +736,7 @@
}
/* call property handler supported by ks */
+ KSPROPERTY_ITEM_IRP_STORAGE(Irp) = (KSPROPERTY_ITEM*)This;
Status = KspPropertyHandler(Irp, 2, FilterPropertySet, NULL,
sizeof(KSPROPERTY_ITEM));
if (Status == STATUS_NOT_FOUND)
@@ -785,41 +786,12 @@
ULONG Index = 0;
/* initialize pin descriptors */
- if (FilterDescriptor->PinDescriptorsCount)
- {
- /* allocate pin instance count array */
- This->PinInstanceCount = AllocateItem(NonPagedPool, sizeof(ULONG) *
FilterDescriptor->PinDescriptorsCount);
- if(!This->PinDescriptors)
- {
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- /* allocate first pin array */
- This->FirstPin = AllocateItem(NonPagedPool, sizeof(PKSPIN) *
FilterDescriptor->PinDescriptorsCount);
- if(!This->FirstPin)
- {
- FreeItem(This->PinDescriptors);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
-
- /* allocate pin descriptor array */
- This->PinDescriptors = AllocateItem(NonPagedPool, sizeof(KSPIN_DESCRIPTOR) *
FilterDescriptor->PinDescriptorsCount);
- if(!This->PinDescriptors)
- {
- FreeItem(This->PinInstanceCount);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- /* set pin count */
- This->PinDescriptorCount = FilterDescriptor->PinDescriptorsCount;
- /* now copy those pin descriptors over */
- for(Index = 0; Index < FilterDescriptor->PinDescriptorsCount; Index++)
- {
- /* copy one pin per time */
- RtlMoveMemory(&This->PinDescriptors[Index],
&FilterDescriptor->PinDescriptors[Index].PinDescriptor, sizeof(KSPIN_DESCRIPTOR));
- }
- }
+ This->PinInstanceCount = NULL;
+ This->FirstPin = NULL;
+ This->PinInstanceCount = NULL;
+ This->PinDescriptors = NULL;
+ This->PinDescriptorsEx = NULL;
+ This->PinDescriptorCount = 0;
/* initialize topology descriptor */
This->Topology.CategoriesCount = FilterDescriptor->CategoriesCount;
@@ -828,30 +800,45 @@
This->Topology.TopologyConnectionsCount = FilterDescriptor->ConnectionsCount;
This->Topology.TopologyConnections = FilterDescriptor->Connections;
- if (This->Topology.TopologyNodesCount > 0)
- {
- This->Topology.TopologyNodes = AllocateItem(NonPagedPool, sizeof(GUID) *
This->Topology.TopologyNodesCount);
+ if (FilterDescriptor->NodeDescriptorsCount)
+ {
+ /* sanity check */
+ ASSERT(FilterDescriptor->NodeDescriptors);
+
+ /* FIXME handle variable sized node descriptors */
+ ASSERT(FilterDescriptor->NodeDescriptorSize == sizeof(KSNODE_DESCRIPTOR));
+
+ This->Topology.TopologyNodes = AllocateItem(NonPagedPool, sizeof(GUID) *
FilterDescriptor->NodeDescriptorsCount);
/* allocate topology node types array */
if (!This->Topology.TopologyNodes)
+ {
+ DPRINT("IKsFilter_CreateDescriptors OutOfMemory TopologyNodesCount
%lu\n", FilterDescriptor->NodeDescriptorsCount);
return STATUS_INSUFFICIENT_RESOURCES;
-
- This->Topology.TopologyNodesNames = AllocateItem(NonPagedPool, sizeof(GUID) *
This->Topology.TopologyNodesCount);
+ }
+
+ This->Topology.TopologyNodesNames = AllocateItem(NonPagedPool, sizeof(GUID) *
FilterDescriptor->NodeDescriptorsCount);
/* allocate topology names array */
if (!This->Topology.TopologyNodesNames)
{
FreeItem((PVOID)This->Topology.TopologyNodes);
+ DPRINT("IKsFilter_CreateDescriptors OutOfMemory TopologyNodesCount
%lu\n", FilterDescriptor->NodeDescriptorsCount);
return STATUS_INSUFFICIENT_RESOURCES;
}
- for(Index = 0; Index < This->Topology.TopologyNodesCount; Index++)
+ DPRINT("NodeDescriptorCount %lu\n",
FilterDescriptor->NodeDescriptorsCount);
+ for(Index = 0; Index < FilterDescriptor->NodeDescriptorsCount; Index++)
{
+ DPRINT("Index %lu Type %p Name %p\n", Index,
FilterDescriptor->NodeDescriptors[Index].Type,
FilterDescriptor->NodeDescriptors[Index].Name);
+
/* copy topology type */
- RtlMoveMemory((PVOID)&This->Topology.TopologyNodes[Index],
FilterDescriptor->NodeDescriptors[Index].Type, sizeof(GUID));
+ if (FilterDescriptor->NodeDescriptors[Index].Type)
+ RtlMoveMemory((PVOID)&This->Topology.TopologyNodes[Index],
FilterDescriptor->NodeDescriptors[Index].Type, sizeof(GUID));
+
/* copy topology name */
- RtlMoveMemory((PVOID)&This->Topology.TopologyNodesNames[Index],
FilterDescriptor->NodeDescriptors[Index].Name, sizeof(GUID));
+ if (FilterDescriptor->NodeDescriptors[Index].Name)
+ RtlMoveMemory((PVOID)&This->Topology.TopologyNodesNames[Index],
FilterDescriptor->NodeDescriptors[Index].Name, sizeof(GUID));
}
}
-
/* done! */
return STATUS_SUCCESS;
}
@@ -861,72 +848,24 @@
IKsFilterImpl * This,
const KSFILTER_DESCRIPTOR* FilterDescriptor)
{
- This->Filter.Descriptor = (const KSFILTER_DESCRIPTOR*)AllocateItem(NonPagedPool,
sizeof(KSFILTER_DESCRIPTOR));
+ NTSTATUS Status;
+
+ This->Filter.Descriptor = AllocateItem(NonPagedPool,
sizeof(KSFILTER_DESCRIPTOR));
if (!This->Filter.Descriptor)
return STATUS_INSUFFICIENT_RESOURCES;
- /* copy all fields */
+ Status = KsAddItemToObjectBag(This->Filter.Bag, (PVOID)This->Filter.Descriptor,
NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ FreeItem((PVOID)This->Filter.Descriptor);
+ This->Filter.Descriptor = NULL;
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* copy filter descriptor fields */
RtlMoveMemory((PVOID)This->Filter.Descriptor, FilterDescriptor,
sizeof(KSFILTER_DESCRIPTOR));
-
- /* perform deep copy of pin descriptors */
- if (FilterDescriptor->PinDescriptorsCount)
- {
- KSPIN_DESCRIPTOR_EX * PinDescriptors = (KSPIN_DESCRIPTOR_EX
*)AllocateItem(NonPagedPool, FilterDescriptor->PinDescriptorSize *
FilterDescriptor->PinDescriptorsCount);
-
-
- if (!PinDescriptors)
- {
- FreeItem((PVOID)This->Filter.Descriptor);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
- RtlMoveMemory((PVOID)PinDescriptors, FilterDescriptor->PinDescriptors,
FilterDescriptor->PinDescriptorSize * FilterDescriptor->PinDescriptorsCount);
-
- /* brain-dead gcc hack */
- RtlMoveMemory((PVOID)&This->Filter.Descriptor->PinDescriptors,
PinDescriptors, sizeof(PKSPIN_DESCRIPTOR_EX));
-
- }
-
- /* perform deep copy of node descriptors */
- if (FilterDescriptor->NodeDescriptorsCount)
- {
- KSNODE_DESCRIPTOR* NodeDescriptor = AllocateItem(NonPagedPool,
FilterDescriptor->NodeDescriptorsCount * FilterDescriptor->NodeDescriptorSize);
- if (!NodeDescriptor)
- {
- if (This->Filter.Descriptor->PinDescriptors)
- FreeItem((PVOID)This->Filter.Descriptor->PinDescriptors);
- FreeItem((PVOID)This->Filter.Descriptor);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
- RtlMoveMemory((PVOID)NodeDescriptor, FilterDescriptor->NodeDescriptors,
FilterDescriptor->NodeDescriptorsCount * FilterDescriptor->NodeDescriptorSize);
-
- /* brain-dead gcc hack */
- RtlMoveMemory((PVOID)&This->Filter.Descriptor->NodeDescriptors,
NodeDescriptor, sizeof(PKSNODE_DESCRIPTOR));
- }
-
- /* perform deep copy of connections descriptors */
- if (FilterDescriptor->NodeDescriptorsCount)
- {
- KSTOPOLOGY_CONNECTION* Connections = AllocateItem(NonPagedPool,
sizeof(KSTOPOLOGY_CONNECTION) * FilterDescriptor->ConnectionsCount);
- if (!Connections)
- {
- if (This->Filter.Descriptor->PinDescriptors)
- FreeItem((PVOID)This->Filter.Descriptor->PinDescriptors);
-
- if (This->Filter.Descriptor->NodeDescriptors)
- FreeItem((PVOID)This->Filter.Descriptor->PinDescriptors);
-
- FreeItem((PVOID)This->Filter.Descriptor);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- RtlMoveMemory((PVOID)Connections, FilterDescriptor->Connections,
sizeof(KSTOPOLOGY_CONNECTION) * FilterDescriptor->ConnectionsCount);
-
- /* brain-dead gcc hack */
- RtlMoveMemory((PVOID)&This->Filter.Descriptor->Connections,
Connections, sizeof(PKSTOPOLOGY_CONNECTION));
- }
-
- return STATUS_SUCCESS;
+ return Status;
}
@@ -1118,37 +1057,47 @@
}
/* allocate filter instance */
- This = AllocateItem(NonPagedPool, sizeof(IKsFilterFactory));
+ This = AllocateItem(NonPagedPool, sizeof(IKsFilterImpl));
if (!This)
+ {
+ DPRINT("KspCreateFilter OutOfMemory\n");
return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* initialize object bag */
+ This->Filter.Bag = AllocateItem(NonPagedPool, sizeof(KSIOBJECT_BAG));
+ if (!This->Filter.Bag)
+ {
+ /* no memory */
+ FreeItem(This);
+ DPRINT("KspCreateFilter OutOfMemory\n");
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+ KsDevice = (IKsDevice*)&DeviceExtension->DeviceHeader->lpVtblIKsDevice;
+ KsDevice->lpVtbl->InitializeObjectBag(KsDevice,
(PKSIOBJECT_BAG)This->Filter.Bag, NULL);
/* copy filter descriptor */
Status = IKsFilter_CopyFilterDescriptor(This, Factory->FilterDescriptor);
if (!NT_SUCCESS(Status))
{
/* not enough memory */
+ FreeItem(This->Filter.Bag);
FreeItem(This);
+ DPRINT("KspCreateFilter IKsFilter_CopyFilterDescriptor failed %lx\n",
Status);
return STATUS_INSUFFICIENT_RESOURCES;
}
/* get current irp stack */
IoStack = IoGetCurrentIrpStackLocation(Irp);
-
- /* initialize object bag */
- This->Filter.Bag = AllocateItem(NonPagedPool, sizeof(KSIOBJECT_BAG));
- if (!This->Filter.Bag)
- {
- /* no memory */
- FreeItem(This);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
/* allocate create items */
CreateItem = AllocateItem(NonPagedPool, sizeof(KSOBJECT_CREATE_ITEM) * 2);
if (!CreateItem)
{
/* no memory */
+ FreeItem(This->Filter.Bag);
FreeItem(This);
+ DPRINT("KspCreateFilter OutOfMemory\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -1163,9 +1112,6 @@
CreateItem[1].Flags = KSCREATE_ITEM_FREEONSTOP;
RtlInitUnicodeString(&CreateItem[1].ObjectClass, KSSTRING_TopologyNode);
-
- KsDevice = (IKsDevice*)&DeviceExtension->DeviceHeader->lpVtblIKsDevice;
- KsDevice->lpVtbl->InitializeObjectBag(KsDevice,
(PKSIOBJECT_BAG)This->Filter.Bag, NULL);
/* initialize filter instance */
This->ref = 1;
@@ -1192,6 +1138,7 @@
/* what can go wrong, goes wrong */
FreeItem(This);
FreeItem(CreateItem);
+ DPRINT("IKsFilter_CreateDescriptors failed with %lx\n", Status);
return Status;
}
@@ -1202,6 +1149,8 @@
if (Factory->FilterDescriptor->Dispatch->Create)
{
/* now let driver initialize the filter instance */
+ DPRINT("Before instantiating filter Filter %p This %p KSBASIC_HEADER
%u\n", &This->Filter, This, sizeof(KSBASIC_HEADER));
+ ASSERT(This->Header.KsDevice);
Status =
Factory->FilterDescriptor->Dispatch->Create(&This->Filter, Irp);
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
@@ -1236,6 +1185,7 @@
IKsFilter_AttachFilterToFilterFactory(This, This->Header.Parent.KsFilterFactory);
/* completed initialization */
+ DPRINT("KspCreateFilter done %lx\n", Status);
return Status;
}
@@ -1355,77 +1305,57 @@
OUT PULONG PinID)
{
ULONG Count;
- ULONG *PinInstanceCount;
- KSPIN_DESCRIPTOR_EX * PinDescriptorsEx;
- KSPIN_DESCRIPTOR * PinDescriptors;
- PKSPIN *FirstPin;
+ NTSTATUS Status;
IKsFilterImpl * This = (IKsFilterImpl*)CONTAINING_RECORD(Filter, IKsFilterImpl,
Filter);
- /* calculate existing count */
+ DPRINT("KsFilterCreatePinFactory\n");
+
+ /* calculate new count */
Count = This->PinDescriptorCount + 1;
+ /* sanity check */
+ ASSERT(This->Filter.Descriptor->PinDescriptorSize ==
sizeof(KSPIN_DESCRIPTOR_EX));
+
+ /* allocate pin descriptors ex array */
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->PinDescriptorsEx, Count *
sizeof(KSPIN_DESCRIPTOR_EX), This->PinDescriptorCount * sizeof(KSPIN_DESCRIPTOR_EX),
0);
+ if (!NT_SUCCESS(Status))
+ {
+ /* failed */
+ DPRINT("KsFilterCreatePinFactory _KsEdit failed with %lx\n", Status);
+ return Status;
+ }
+
/* allocate pin descriptors array */
- PinDescriptorsEx = AllocateItem(NonPagedPool,
max(This->Filter.Descriptor->PinDescriptorSize, sizeof(KSPIN_DESCRIPTOR_EX)) *
Count);
- if (!PinDescriptorsEx)
- return STATUS_INSUFFICIENT_RESOURCES;
+ Status = _KsEdit(This->Filter.Bag, (PVOID*)&This->PinDescriptors, Count *
sizeof(KSPIN_DESCRIPTOR), This->PinDescriptorCount * sizeof(KSPIN_DESCRIPTOR), 0);
+ if (!NT_SUCCESS(Status))
+ {
+ /* failed */
+ DPRINT("KsFilterCreatePinFactory _KsEdit failed with %lx\n", Status);
+ return Status;
+ }
+
/* allocate pin instance count array */
- PinInstanceCount = AllocateItem(NonPagedPool, sizeof(ULONG) * Count);
- if (!PinInstanceCount)
- {
- /* not enough memory */
- FreeItem(PinDescriptorsEx);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- /* allocate pin descriptor array for pin property handling */
- PinDescriptors = AllocateItem(NonPagedPool, sizeof(KSPIN_DESCRIPTOR) * Count);
- if (!PinDescriptors)
- {
- /* not enough memory */
- FreeItem(PinDescriptorsEx);
- FreeItem(PinInstanceCount);
- return STATUS_INSUFFICIENT_RESOURCES;
+ Status = _KsEdit(This->Filter.Bag,(PVOID*)&This->PinInstanceCount,
sizeof(ULONG) * Count, sizeof(ULONG) * This->PinDescriptorCount, 0);
+ if (!NT_SUCCESS(Status))
+ {
+ /* failed */
+ DPRINT("KsFilterCreatePinFactory _KsEdit failed with %lx\n", Status);
+ return Status;
}
/* allocate first pin array */
- FirstPin = AllocateItem(NonPagedPool, sizeof(PKSPIN) * Count);
- if (!FirstPin)
- {
- /* not enough memory */
- FreeItem(PinDescriptorsEx);
- FreeItem(PinInstanceCount);
- FreeItem(PinDescriptors);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- /* now copy all fields */
- if (Count > 1)
- {
- /* copy old descriptors */
- RtlMoveMemory(PinDescriptorsEx, This->Filter.Descriptor->PinDescriptors,
max(This->Filter.Descriptor->PinDescriptorSize, sizeof(KSPIN_DESCRIPTOR_EX)) *
This->PinDescriptorCount);
- RtlMoveMemory(PinInstanceCount, This->PinInstanceCount,
This->PinDescriptorCount * sizeof(ULONG));
- RtlMoveMemory(PinDescriptors, This->PinDescriptors, sizeof(KSPIN_DESCRIPTOR) *
This->PinDescriptorCount);
- RtlMoveMemory(FirstPin, This->FirstPin, sizeof(PKSPIN) *
This->PinDescriptorCount);
-
- /* now free old descriptors */
- FreeItem(This->PinInstanceCount);
- FreeItem((PVOID)This->Filter.Descriptor->PinDescriptors);
- FreeItem(This->PinDescriptors);
- FreeItem(This->FirstPin);
+ Status = _KsEdit(This->Filter.Bag,(PVOID*)&This->FirstPin, sizeof(PKSPIN) *
Count, sizeof(PKSPIN) * This->PinDescriptorCount, 0);
+ if (!NT_SUCCESS(Status))
+ {
+ /* failed */
+ DPRINT("KsFilterCreatePinFactory _KsEdit failed with %lx\n", Status);
+ return Status;
}
/* add new pin factory */
- RtlMoveMemory((PVOID)((ULONG_PTR)PinDescriptorsEx +
max(This->Filter.Descriptor->PinDescriptorSize, sizeof(KSPIN_DESCRIPTOR_EX)) *
This->PinDescriptorCount), InPinDescriptor, sizeof(KSPIN_DESCRIPTOR));
- RtlMoveMemory((PVOID)(PinDescriptors + This->PinDescriptorCount),
&InPinDescriptor->PinDescriptor, sizeof(KSPIN_DESCRIPTOR));
-
- /* replace old descriptor by using a gcc-compliant hack */
- RtlMoveMemory((PVOID)&This->Filter.Descriptor->PinDescriptors,
PinDescriptorsEx, sizeof(KSPIN_DESCRIPTOR_EX*));
- RtlMoveMemory((PVOID)&This->Filter.Descriptor->PinDescriptorsCount,
&Count, sizeof(ULONG));
-
- This->PinDescriptors = PinDescriptors;
- This->PinInstanceCount = PinInstanceCount;
- This->FirstPin = FirstPin;
+ RtlMoveMemory(&This->PinDescriptorsEx[This->PinDescriptorCount],
InPinDescriptor, sizeof(KSPIN_DESCRIPTOR_EX));
+ RtlMoveMemory(&This->PinDescriptors[This->PinDescriptorCount],
&InPinDescriptor->PinDescriptor, sizeof(KSPIN_DESCRIPTOR));
/* store new pin id */
*PinID = This->PinDescriptorCount;
@@ -1433,6 +1363,8 @@
/* increment pin descriptor count */
This->PinDescriptorCount++;
+
+ DPRINT("KsFilterCreatePinFactory done\n");
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Thu Apr 1 05:14:45
2010
@@ -41,6 +41,7 @@
IN PIRP Irp)
{
PKSOBJECT_CREATE_ITEM CreateItem;
+ IKsFilterFactoryImpl * Factory;
IKsFilterFactory * iface;
NTSTATUS Status;
@@ -53,7 +54,10 @@
}
/* get filter factory interface */
- iface = (IKsFilterFactory*)CONTAINING_RECORD(CreateItem->Context,
IKsFilterFactoryImpl, FilterFactory);
+ Factory = (IKsFilterFactoryImpl*)CONTAINING_RECORD(CreateItem->Context,
IKsFilterFactoryImpl, FilterFactory);
+
+ /* get interface */
+ iface = (IKsFilterFactory*)&Factory->lpVtbl;
/* create a filter instance */
Status = KspCreateFilter(DeviceObject, Irp, iface);
@@ -253,6 +257,8 @@
FreeString = TRUE;
}
+ DPRINT("IKsFilterFactory_fnInitialize CategoriesCount %u ReferenceString
'%S'\n", Descriptor->CategoriesCount,ReferenceString.Buffer);
+
/* now register the device interface */
Status =
KspRegisterDeviceInterfaces(DeviceExtension->DeviceHeader->KsDevice.PhysicalDeviceObject,
Descriptor->CategoriesCount,
@@ -365,6 +371,10 @@
}
/* return result */
+ DPRINT("KsCreateFilterFactory %x\n", Status);
+ /* sanity check */
+ ASSERT(Status == STATUS_SUCCESS);
+
return Status;
}
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 Apr 1 05:14:45 2010
@@ -339,6 +339,7 @@
IN PKSPIN Pin,
IN BOOLEAN Asynchronous)
{
+ DPRINT("KsPinAttemptProcessing\n");
UNIMPLEMENTED
}
@@ -456,6 +457,7 @@
OUT PIKSREFERENCECLOCK* Interface)
{
UNIMPLEMENTED
+ DPRINT("KsPinGetReferenceClockInterface Pin %p Interface %p\n", Pin,
Interface);
return STATUS_UNSUCCESSFUL;
}
@@ -546,6 +548,8 @@
{
PKSIOBJECT_HEADER ObjectHeader;
PIO_STACK_LOCATION IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ DPRINT("KsGetPinFromIrp\n");
/* get object header */
ObjectHeader = (PKSIOBJECT_HEADER)IoStack->FileObject->FsContext2;
@@ -624,6 +628,7 @@
IN KSSTREAM_POINTER_STATE State)
{
UNIMPLEMENTED
+ DPRINT("KsPinGetLeadingEdgeStreamPointer Pin %p State %x\n", Pin, State);
return NULL;
}
@@ -679,6 +684,7 @@
IN BOOLEAN Eject)
{
UNIMPLEMENTED
+ DPRINT("KsStreamPointerUnlock\n");
}
/*
@@ -693,6 +699,8 @@
IN ULONG OutUsed,
IN BOOLEAN Eject)
{
+ DPRINT("KsStreamPointerAdvanceOffsets\n");
+
UNIMPLEMENTED
}
@@ -708,6 +716,8 @@
IKsPinImpl * This;
PKSISTREAM_POINTER Cur, Last;
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
+
+ DPRINT("KsStreamPointerDelete\n");
This = (IKsPinImpl*)CONTAINING_RECORD(Pointer->StreamPointer.Pin, IKsPinImpl,
Pin);
@@ -755,6 +765,7 @@
OUT PKSSTREAM_POINTER* CloneStreamPointer)
{
UNIMPLEMENTED
+ DPRINT("KsStreamPointerClone\n");
return STATUS_NOT_IMPLEMENTED;
}
@@ -864,7 +875,11 @@
KsPinGetFirstCloneStreamPointer(
IN PKSPIN Pin)
{
- IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+ IKsPinImpl * This;
+
+ DPRINT("KsPinGetFirstCloneStreamPointer %p\n", Pin);
+
+ This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
/* return first cloned stream pointer */
return &This->ClonedStreamPointer->StreamPointer;
}
@@ -879,6 +894,8 @@
IN PKSSTREAM_POINTER StreamPointer)
{
PKSISTREAM_POINTER Pointer = (PKSISTREAM_POINTER)StreamPointer;
+
+ DPRINT("KsStreamPointerGetNextClone\n");
/* is there a another cloned stream pointer */
if (!Pointer->Next)