Author: janderwald
Date: Thu Jul 30 09:31:41 2009
New Revision: 42296
URL:
http://svn.reactos.org/svn/reactos?rev=42296&view=rev
Log:
- Implement KsAddEvent, KsDefaultAddEventHandler, KsPinAttachAndGate, KsPinAttachOrGate,
KsPinGetAndGate
Modified:
trunk/reactos/drivers/ksfilter/ks/event.c
trunk/reactos/drivers/ksfilter/ks/filter.c
trunk/reactos/drivers/ksfilter/ks/filterfactory.c
trunk/reactos/drivers/ksfilter/ks/kstypes.h
trunk/reactos/drivers/ksfilter/ks/pin.c
Modified: trunk/reactos/drivers/ksfilter/ks/event.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/event.…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/event.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/event.c [iso-8859-1] Thu Jul 30 09:31:41 2009
@@ -138,7 +138,7 @@
}
/*
- @unimplemented
+ @implemented
*/
KSDDKAPI
VOID
@@ -147,7 +147,9 @@
IN PVOID Object,
IN PKSEVENT_ENTRY EventEntry)
{
- UNIMPLEMENTED
+ PKSBASIC_HEADER Header = (PKSBASIC_HEADER)((ULONG_PTR)Object -
sizeof(KSBASIC_HEADER));
+
+ ExInterlockedInsertTailList(&Header->EventList, &EventEntry->ListEntry,
&Header->EventListLock);
}
/*
@@ -160,9 +162,30 @@
IN PKSEVENTDATA EventData,
IN OUT PKSEVENT_ENTRY EventEntry)
{
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
-}
+ PIO_STACK_LOCATION IoStack;
+ PKSIOBJECT_HEADER ObjectHeader;
+ PKSBASIC_HEADER Header;
+
+ /* first get the io stack location */
+ IoStack = IoGetCurrentIrpStackLocation(Irp);
+
+ /* now get the object header */
+ ObjectHeader =(PKSIOBJECT_HEADER)IoStack->FileObject->FsContext;
+
+ /* sanity check */
+ ASSERT(ObjectHeader->ObjectType);
+
+ /* obtain basic header */
+ Header = (PKSBASIC_HEADER)((ULONG_PTR)ObjectHeader->ObjectType -
sizeof(KSBASIC_HEADER));
+
+ /* now insert the event entry */
+ ExInterlockedInsertTailList(&Header->EventList, &EventEntry->ListEntry,
&Header->EventListLock);
+
+ /* done */
+ return STATUS_SUCCESS;
+}
+
+
/*
@unimplemented
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 Jul 30 09:31:41 2009
@@ -1060,6 +1060,10 @@
This->Header.Parent.KsFilterFactory = iface->lpVtbl->GetStruct(iface);
This->Header.Type = KsObjectTypeFilter;
KeInitializeMutex(&This->Header.ControlMutex, 0);
+ InitializeListHead(&This->Header.EventList);
+ KeInitializeSpinLock(&This->Header.EventListLock);
+
+
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 Jul 30 09:31:41
2009
@@ -189,6 +189,12 @@
This->Header.Parent.KsDevice =
&DeviceExtension->DeviceHeader->KsDevice;
This->DeviceHeader = DeviceExtension->DeviceHeader;
+ /* unused fields */
+ KeInitializeMutex(&This->Header.ControlMutex, 0);
+ InitializeListHead(&This->Header.EventList);
+ KeInitializeSpinLock(&This->Header.EventListLock);
+
+
InitializeListHead(&This->SymbolicLinkList);
InitializeListHead(&This->FilterInstanceList);
Modified: trunk/reactos/drivers/ksfilter/ks/kstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/kstype…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/kstypes.h [iso-8859-1] Thu Jul 30 09:31:41 2009
@@ -60,6 +60,9 @@
KSOBJECTTYPE Type;
PKSDEVICE KsDevice;
KMUTEX ControlMutex;
+ LIST_ENTRY EventList;
+ KSPIN_LOCK EventListLock;
+
union
{
PKSDEVICE KsDevice;
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 Jul 30 09:31:41 2009
@@ -21,6 +21,9 @@
LONG ref;
KMUTEX ProcessingMutex;
PFILE_OBJECT FileObject;
+
+ PKSGATE AttachedGate;
+ BOOL OrGate;
PFNKSPINPOWER Sleep;
PFNKSPINPOWER Wake;
@@ -262,7 +265,7 @@
}
/*
- @unimplemented
+ @implemented
*/
VOID
NTAPI
@@ -270,11 +273,16 @@
IN PKSPIN Pin,
IN PKSGATE AndGate OPTIONAL)
{
- UNIMPLEMENTED
-}
-
-/*
- @unimplemented
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ /* FIXME attach to filter's and gate (filter-centric processing) */
+
+ This->AttachedGate = AndGate;
+ This->OrGate = FALSE;
+}
+
+/*
+ @implemented
*/
VOID
NTAPI
@@ -282,8 +290,27 @@
IN PKSPIN Pin,
IN PKSGATE OrGate OPTIONAL)
{
- UNIMPLEMENTED
-}
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ /* FIXME attach to filter's and gate (filter-centric processing) */
+
+ This->AttachedGate = OrGate;
+ This->OrGate = TRUE;
+}
+
+/*
+ @implemented
+*/
+PKSGATE
+NTAPI
+KsPinGetAndGate(
+ IN PKSPIN Pin)
+{
+ IKsPinImpl * This = (IKsPinImpl*)CONTAINING_RECORD(Pin, IKsPinImpl, Pin);
+
+ return This->AttachedGate;
+}
+
/*
@unimplemented
*/
@@ -322,18 +349,6 @@
{
UNIMPLEMENTED
return STATUS_NOT_IMPLEMENTED;
-}
-
-/*
- @unimplemented
-*/
-PKSGATE
-NTAPI
-KsPinGetAndGate(
- IN PKSPIN Pin)
-{
- UNIMPLEMENTED
- return NULL;
}
/*
@@ -887,7 +902,6 @@
KsDispatchFastReadFailure
};
-
NTSTATUS
KspCreatePin(
IN PDEVICE_OBJECT DeviceObject,
@@ -940,6 +954,8 @@
This->BasicHeader.Type = KsObjectTypePin;
This->BasicHeader.Parent.KsFilter = Filter->lpVtbl->GetStruct(Filter);
KeInitializeMutex(&This->BasicHeader.ControlMutex, 0);
+ InitializeListHead(&This->BasicHeader.EventList);
+ KeInitializeSpinLock(&This->BasicHeader.EventListLock);
/* initialize pin */
This->lpVtbl = &vt_IKsPin;