mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
- Implement IPortEvents interface for IPortTopology
- Fix a bug in the IPortEvents::QueryInterface handler of IPortWaveCyclic & IPortWavePci svn path=/trunk/; revision=42762
This commit is contained in:
parent
f886c8a5b0
commit
8739063551
3 changed files with 102 additions and 5 deletions
|
@ -12,6 +12,7 @@ typedef struct
|
|||
{
|
||||
IPortTopologyVtbl *lpVtbl;
|
||||
ISubdeviceVtbl *lpVtblSubDevice;
|
||||
IPortEventsVtbl *lpVtblPortEvents;
|
||||
|
||||
LONG ref;
|
||||
BOOL bInitialized;
|
||||
|
@ -66,6 +67,98 @@ KSPROPERTY_SET TopologyPropertySet[] =
|
|||
}
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// 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
|
||||
|
@ -97,6 +190,12 @@ IPortTopology_fnQueryInterface(
|
|||
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);
|
||||
|
@ -707,6 +806,7 @@ NewPortTopology(
|
|||
|
||||
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);
|
||||
|
|
|
@ -13,9 +13,6 @@ extern GUID IID_IDmaChannelSlave;
|
|||
typedef struct
|
||||
{
|
||||
IPortWaveCyclicVtbl *lpVtbl;
|
||||
IPortEventsVtbl *lpVbtlPortEvents;
|
||||
IUnregisterSubdeviceVtbl *lpVtblUnregisterSubdevice;
|
||||
IUnregisterPhysicalConnectionVtbl *lpVtblPhysicalConnection;
|
||||
IPortEventsVtbl *lpVtblPortEvents;
|
||||
ISubdeviceVtbl *lpVtblSubDevice;
|
||||
|
||||
|
@ -111,7 +108,7 @@ IPortEvents_fnQueryInterface(
|
|||
if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) ||
|
||||
IsEqualGUIDAligned(refiid, &IID_IUnknown))
|
||||
{
|
||||
*Output = &This->lpVbtlPortEvents;
|
||||
*Output = &This->lpVtblPortEvents;
|
||||
InterlockedIncrement(&This->ref);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ IPortEvents_fnQueryInterface(
|
|||
if (IsEqualGUIDAligned(refiid, &IID_IPortEvents) ||
|
||||
IsEqualGUIDAligned(refiid, &IID_IUnknown))
|
||||
{
|
||||
*Output = &This->lpVtblServiceSink;
|
||||
*Output = &This->lpVtblPortEvents;
|
||||
InterlockedIncrement(&This->ref);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue