Author: janderwald
Date: Mon Jul 27 20:40:50 2009
New Revision: 42256
URL:
http://svn.reactos.org/svn/reactos?rev=42256&view=rev
Log:
- Implement KsReferenceBusObject, KsReferenceSoftwareBusObject,
KsDereferenceSoftwareBusObject, KsDereferenceBusObject
Modified:
trunk/reactos/drivers/ksfilter/ks/device.c
trunk/reactos/drivers/ksfilter/ks/irp.c
Modified: trunk/reactos/drivers/ksfilter/ks/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Mon Jul 27 20:40:50 2009
@@ -624,12 +624,19 @@
IN PDEVICE_OBJECT NextDeviceObject,
IN const KSDEVICE_DESCRIPTOR* Descriptor OPTIONAL)
{
+ PDEVICE_EXTENSION DeviceExtension;
PKSIDEVICE_HEADER Header;
ULONG Index;
NTSTATUS Status = STATUS_SUCCESS;
+ /* get device extension */
+ DeviceExtension = (PDEVICE_EXTENSION)FunctionalDeviceObject->DeviceExtension;
+
/* first allocate device header */
- Status = KsAllocateDeviceHeader((KSDEVICE_HEADER*)&Header, 0, NULL);
+ Status =
KsAllocateDeviceHeader((KSDEVICE_HEADER*)&DeviceExtension->DeviceHeader, 0, NULL);
+
+ /* point to allocated header */
+ Header = DeviceExtension->DeviceHeader;
/* check for success */
if (!NT_SUCCESS(Status))
@@ -689,6 +696,85 @@
KsReferenceSoftwareBusObject(
IN KSDEVICE_HEADER Header)
{
- UNIMPLEMENTED
- return STATUS_NOT_IMPLEMENTED;
-}
+ IKsDevice * Device;
+ PKSIDEVICE_HEADER DeviceHeader = (PKSIDEVICE_HEADER)Header;
+
+ /* get device interface */
+ Device = (IKsDevice*)&DeviceHeader->lpVtblIKsDevice;
+
+ if (Device)
+ {
+ /* reference device interface */
+ Device->lpVtbl->AddRef(Device);
+ }
+
+ return STATUS_SUCCESS;
+}
+
+/*
+ @unimplemented
+*/
+KSDDKAPI
+NTSTATUS
+NTAPI
+KsReferenceBusObject(
+ IN KSDEVICE_HEADER Header)
+{
+ IKsDevice * Device;
+ PKSIDEVICE_HEADER DeviceHeader = (PKSIDEVICE_HEADER)Header;
+
+ /* get device interface */
+ Device = (IKsDevice*)&DeviceHeader->lpVtblIKsDevice;
+
+ if (Device)
+ {
+ /* reference device interface */
+ Device->lpVtbl->AddRef(Device);
+ }
+
+ return STATUS_SUCCESS;
+
+}
+
+/*
+ @unimplemented
+*/
+KSDDKAPI
+VOID
+NTAPI
+KsDereferenceBusObject(
+ IN KSDEVICE_HEADER Header)
+{
+ IKsDevice * Device;
+ PKSIDEVICE_HEADER DeviceHeader = (PKSIDEVICE_HEADER)Header;
+
+ /* get device interface */
+ Device = (IKsDevice*)&DeviceHeader->lpVtblIKsDevice;
+
+ if (Device)
+ {
+ /* release device interface */
+ Device->lpVtbl->Release(Device);
+ }
+}
+
+/*
+ @unimplemented
+*/
+KSDDKAPI
+VOID
+NTAPI
+KsDereferenceSoftwareBusObject(
+ IN KSDEVICE_HEADER Header)
+{ IKsDevice * Device;
+ PKSIDEVICE_HEADER DeviceHeader = (PKSIDEVICE_HEADER)Header;
+
+ /* get device interface */
+ Device = (IKsDevice*)&DeviceHeader->lpVtblIKsDevice;
+
+ if (Device)
+ {
+ /* release device interface */
+ Device->lpVtbl->Release(Device);
+ }
+}
Modified: trunk/reactos/drivers/ksfilter/ks/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Mon Jul 27 20:40:50 2009
@@ -8,43 +8,6 @@
#include "priv.h"
-
-/*
- @unimplemented
-*/
-KSDDKAPI
-NTSTATUS
-NTAPI
-KsReferenceBusObject(
- IN KSDEVICE_HEADER Header)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
-/*
- @unimplemented
-*/
-KSDDKAPI
-VOID
-NTAPI
-KsDereferenceBusObject(
- IN KSDEVICE_HEADER Header)
-{
- UNIMPLEMENTED;
-}
-
-/*
- @unimplemented
-*/
-KSDDKAPI
-VOID
-NTAPI
-KsDereferenceSoftwareBusObject(
- IN KSDEVICE_HEADER Header)
-{
- UNIMPLEMENTED;
-}
/*
@implemented