Author: janderwald
Date: Sat Jan 17 18:44:54 2009
New Revision: 38862
URL:
http://svn.reactos.org/svn/reactos?rev=38862&view=rev
Log:
- Implement IPortEvents interface to IPortWavePci
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/guids.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/guids.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/guids.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/guids.c [iso-8859-1] Sat Jan 17
18:44:54 2009
@@ -39,6 +39,8 @@
const GUID IID_IServiceSink = {0x22C6AC64L, 0x851B, 0x11D0, {0x9A, 0x7F, 0x00, 0xAA,
0x00, 0x38, 0xAC, 0xFE}};
const GUID IID_IPortClsVersion = {0x7D89A7BBL, 0x869B, 0x4567, {0x8D, 0xBE, 0x1E, 0x16,
0x8C, 0xC8, 0x53, 0xDE}};
const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x46}};
+const GUID IID_IPortEvents = {0xA80F29C4L, 0x5498, 0x11D2, {0x95, 0xD9, 0x00, 0xC0, 0x4F,
0xB9, 0x25, 0xD3}};
+
///
/// undocumented guids
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] Sat Jan 17
18:44:54 2009
@@ -4,6 +4,7 @@
{
IPortWavePciVtbl *lpVtbl;
IServiceSinkVtbl *lpVtblServiceSink;
+ IPortEventsVtbl *lpVtblPortEvents;
#if 0
IUnregisterSubdevice *lpVtblUnregisterSubDevice;
@@ -19,7 +20,96 @@
}IPortWavePciImpl;
-
+//---------------------------------------------------------------
+// IPortEvents
+//
+
+static
+NTSTATUS
+NTAPI
+IPortEvents_fnQueryInterface(
+ IPortEvents* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IPortWavePciImpl * This = (IPortWavePciImpl*)CONTAINING_RECORD(iface,
IPortWavePciImpl, lpVtblPortEvents);
+
+ DPRINT1("IServiceSink_fnQueryInterface entered\n");
+
+ if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) ||
+ IsEqualGUIDAligned(refiid, &IID_IUnknown))
+ {
+ *Output = &This->lpVtblServiceSink;
+ InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+static
+ULONG
+NTAPI
+IPortEvents_fnAddRef(
+ IPortEvents* iface)
+{
+ IPortWavePciImpl * This = (IPortWavePciImpl*)CONTAINING_RECORD(iface,
IPortWavePciImpl, lpVtblPortEvents);
+ DPRINT1("IServiceSink_fnAddRef entered\n");
+ return InterlockedIncrement(&This->ref);
+}
+
+static
+ULONG
+NTAPI
+IPortEvents_fnRelease(
+ IPortEvents* iface)
+{
+ IPortWavePciImpl * This = (IPortWavePciImpl*)CONTAINING_RECORD(iface,
IPortWavePciImpl, lpVtblPortEvents);
+ DPRINT1("IServiceSink_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)
+{
+ DPRINT1("IPortEvents_fnAddEventToEventList stub\n");
+}
+
+
+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)
+{
+ DPRINT1("IPortEvents_fnGenerateEventList stub\n");
+}
+
+static IPortEventsVtbl vt_IPortEvents =
+{
+ IPortEvents_fnQueryInterface,
+ IPortEvents_fnAddRef,
+ IPortEvents_fnRelease,
+ IPortEvents_fnAddEventToEventList,
+ IPortEvents_fnGenerateEventList
+};
//---------------------------------------------------------------
// IServiceSink
@@ -111,6 +201,7 @@
IN REFIID refiid,
OUT PVOID* Output)
{
+ WCHAR Buffer[100];
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
DPRINT1("IPortWavePci_fnQueryInterface entered\n");
@@ -128,13 +219,20 @@
InterlockedIncrement(&This->ref);
return STATUS_SUCCESS;
}
+ else if (IsEqualGUIDAligned(refiid, &IID_IPortEvents))
+ {
+ *Output = &This->lpVtblPortEvents;
+ InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
else if (IsEqualGUIDAligned(refiid, &IID_IPortClsVersion))
{
return NewPortClsVersion((PPORTCLSVERSION*)Output);
}
- DPRINT1("IPortWavePci_fnQueryInterface no interface!!!\n");
-
+ StringFromCLSID(refiid, Buffer);
+ DPRINT1("IPortWavePci_fnQueryInterface no interface!!! iface %S\n",
Buffer);
+ KeBugCheckEx(0, 0, 0, 0, 0);
return STATUS_UNSUCCESSFUL;
}
@@ -180,11 +278,12 @@
IN PVOID SystemArgument1,
IN PVOID SystemArgument2)
{
- DPRINT1("ServiceNotifyRoutine entered\n");
+ DPRINT1("ServiceNotifyRoutine entered %p %p %p\n", DeferredContext,
SystemArgument1, SystemArgument2);
IPortWavePciImpl * This = (IPortWavePciImpl*)DeferredContext;
if (This->ServiceGroup && This->bInitialized)
{
+ DPRINT1("ServiceGroup %p\n", This->ServiceGroup);
This->ServiceGroup->lpVtbl->RequestService(This->ServiceGroup);
}
}
@@ -352,9 +451,14 @@
IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
- DPRINT1("IPortWavePci_fnNotify entered\n");
-
- KeInsertQueueDpc(&This->Dpc, NULL, NULL);
+ DPRINT1("IPortWavePci_fnNotify entered %p, ServiceGroup %p\n", This,
This->ServiceGroup);
+
+ if (This->ServiceGroup)
+ {
+ This->ServiceGroup->lpVtbl->RequestService (This->ServiceGroup);
+ }
+
+ // KeInsertQueueDpc(&This->Dpc, NULL, NULL);
}
static IPortWavePciVtbl vt_IPortWavePci =
@@ -385,6 +489,7 @@
This->lpVtblServiceSink = &vt_IServiceSink;
This->lpVtbl = &vt_IPortWavePci;
+ This->lpVtblPortEvents = &vt_IPortEvents;
This->ref = 1;
*OutPort = (PPORT)&This->lpVtbl;