Author: janderwald
Date: Tue Aug 18 10:24:09 2009
New Revision: 42762
URL:
http://svn.reactos.org/svn/reactos?rev=42762&view=rev
Log:
- Implement IPortEvents interface for IPortTopology
- Fix a bug in the IPortEvents::QueryInterface handler of IPortWaveCyclic &
IPortWavePci
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] Tue Aug
18 10:24:09 2009
@@ -12,6 +12,7 @@
{
IPortTopologyVtbl *lpVtbl;
ISubdeviceVtbl *lpVtblSubDevice;
+ IPortEventsVtbl *lpVtblPortEvents;
LONG ref;
BOOL bInitialized;
@@ -66,6 +67,98 @@
}
};
+//---------------------------------------------------------------
+// IPortEvents
+//
+
+static
+NTSTATUS
+NTAPI
+IPortEvents_fnQueryInterface(
+ IPortEvents* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IPortTopologyImpl * This = (IPortTopologyImpl*)CONTAINING_RECORD(iface,
IPortTopologyImpl, lpVtblPortEvents);
+
+ DPRINT("IPortEvents_fnQueryInterface entered\n");
+
+ if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) ||
+ IsEqualGUIDAligned(refiid, &IID_IUnknown))
+ {
+ *Output = &This->lpVtblPortEvents;
+ InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+static
+ULONG
+NTAPI
+IPortEvents_fnAddRef(
+ IPortEvents* iface)
+{
+ IPortTopologyImpl * This = (IPortTopologyImpl*)CONTAINING_RECORD(iface,
IPortTopologyImpl, lpVtblPortEvents);
+ DPRINT("IPortEvents_fnQueryInterface entered\n");
+ return InterlockedIncrement(&This->ref);
+}
+
+static
+ULONG
+NTAPI
+IPortEvents_fnRelease(
+ IPortEvents* iface)
+{
+ IPortTopologyImpl * This = (IPortTopologyImpl*)CONTAINING_RECORD(iface,
IPortTopologyImpl, lpVtblPortEvents);
+
+ DPRINT("IPortEvents_fnRelease entered\n");
+ InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ FreeItem(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+static
+void
+NTAPI
+IPortEvents_fnAddEventToEventList(
+ IPortEvents* iface,
+ IN PKSEVENT_ENTRY EventEntry)
+{
+ UNIMPLEMENTED
+}
+
+
+static
+void
+NTAPI
+IPortEvents_fnGenerateEventList(
+ IPortEvents* iface,
+ IN GUID* Set OPTIONAL,
+ IN ULONG EventId,
+ IN BOOL PinEvent,
+ IN ULONG PinId,
+ IN BOOL NodeEvent,
+ IN ULONG NodeId)
+{
+ UNIMPLEMENTED
+}
+
+static IPortEventsVtbl vt_IPortEvents =
+{
+ IPortEvents_fnQueryInterface,
+ IPortEvents_fnAddRef,
+ IPortEvents_fnRelease,
+ IPortEvents_fnAddEventToEventList,
+ IPortEvents_fnGenerateEventList
+};
+
//---------------------------------------------------------------
// IUnknown interface functions
@@ -94,6 +187,12 @@
else if (IsEqualGUIDAligned(refiid, &IID_ISubdevice))
{
*Output = &This->lpVtblSubDevice;
+ InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ else if (IsEqualGUIDAligned(refiid, &IID_IPortEvents))
+ {
+ *Output = &This->lpVtblPortEvents;
InterlockedIncrement(&This->ref);
return STATUS_SUCCESS;
}
@@ -707,6 +806,7 @@
This->lpVtbl = &vt_IPortTopology;
This->lpVtblSubDevice = &vt_ISubdeviceVtbl;
+ This->lpVtblPortEvents = &vt_IPortEvents;
This->ref = 1;
*OutPort = (PPORT)(&This->lpVtbl);
DPRINT("NewPortTopology result %p\n", *OutPort);
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1] Tue Aug
18 10:24:09 2009
@@ -13,9 +13,6 @@
typedef struct
{
IPortWaveCyclicVtbl *lpVtbl;
- IPortEventsVtbl *lpVbtlPortEvents;
- IUnregisterSubdeviceVtbl *lpVtblUnregisterSubdevice;
- IUnregisterPhysicalConnectionVtbl *lpVtblPhysicalConnection;
IPortEventsVtbl *lpVtblPortEvents;
ISubdeviceVtbl *lpVtblSubDevice;
@@ -111,7 +108,7 @@
if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) ||
IsEqualGUIDAligned(refiid, &IID_IUnknown))
{
- *Output = &This->lpVbtlPortEvents;
+ *Output = &This->lpVtblPortEvents;
InterlockedIncrement(&This->ref);
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c [iso-8859-1] Tue Aug 18
10:24:09 2009
@@ -93,7 +93,7 @@
if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) ||
IsEqualGUIDAligned(refiid, &IID_IUnknown))
{
- *Output = &This->lpVtblServiceSink;
+ *Output = &This->lpVtblPortEvents;
InterlockedIncrement(&This->ref);
return STATUS_SUCCESS;
}