Commit 44292573 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

dsound: COM cleanup property sets.

parent dd2c7d0d
...@@ -57,7 +57,6 @@ typedef struct IDirectSoundCaptureNotifyImpl IDirectSoundCaptureNotifyImpl; ...@@ -57,7 +57,6 @@ typedef struct IDirectSoundCaptureNotifyImpl IDirectSoundCaptureNotifyImpl;
typedef struct IDirectSound3DListenerImpl IDirectSound3DListenerImpl; typedef struct IDirectSound3DListenerImpl IDirectSound3DListenerImpl;
typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl; typedef struct IDirectSound3DBufferImpl IDirectSound3DBufferImpl;
typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl; typedef struct IKsBufferPropertySetImpl IKsBufferPropertySetImpl;
typedef struct IKsPrivatePropertySetImpl IKsPrivatePropertySetImpl;
typedef struct PrimaryBufferImpl PrimaryBufferImpl; typedef struct PrimaryBufferImpl PrimaryBufferImpl;
typedef struct SecondaryBufferImpl SecondaryBufferImpl; typedef struct SecondaryBufferImpl SecondaryBufferImpl;
typedef struct DirectSoundDevice DirectSoundDevice; typedef struct DirectSoundDevice DirectSoundDevice;
...@@ -329,19 +328,7 @@ HRESULT IKsBufferPropertySetImpl_Create( ...@@ -329,19 +328,7 @@ HRESULT IKsBufferPropertySetImpl_Create(
HRESULT IKsBufferPropertySetImpl_Destroy( HRESULT IKsBufferPropertySetImpl_Destroy(
IKsBufferPropertySetImpl *piks); IKsBufferPropertySetImpl *piks);
/***************************************************************************** HRESULT IKsPrivatePropertySetImpl_Create(REFIID riid, IKsPropertySet **piks);
* IKsPrivatePropertySet implementation structure
*/
struct IKsPrivatePropertySetImpl
{
/* IUnknown fields */
const IKsPropertySetVtbl *lpVtbl;
LONG ref;
};
HRESULT IKsPrivatePropertySetImpl_Create(
REFIID riid,
IKsPrivatePropertySetImpl **piks);
/***************************************************************************** /*****************************************************************************
* IDirectSound3DBuffer implementation structure * IDirectSound3DBuffer implementation structure
......
...@@ -44,6 +44,17 @@ ...@@ -44,6 +44,17 @@
WINE_DEFAULT_DEBUG_CHANNEL(dsound); WINE_DEFAULT_DEBUG_CHANNEL(dsound);
typedef struct IKsPrivatePropertySetImpl
{
IKsPropertySet IKsPropertySet_iface;
LONG ref;
} IKsPrivatePropertySetImpl;
static IKsPrivatePropertySetImpl *impl_from_IKsPropertySet(IKsPropertySet *iface)
{
return CONTAINING_RECORD(iface, IKsPrivatePropertySetImpl, IKsPropertySet_iface);
}
/******************************************************************************* /*******************************************************************************
* IKsPrivatePropertySet * IKsPrivatePropertySet
*/ */
...@@ -54,7 +65,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface( ...@@ -54,7 +65,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface(
REFIID riid, REFIID riid,
LPVOID *ppobj ) LPVOID *ppobj )
{ {
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface; IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj); TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppobj);
if (IsEqualIID(riid, &IID_IUnknown) || if (IsEqualIID(riid, &IID_IUnknown) ||
...@@ -69,7 +80,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface( ...@@ -69,7 +80,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QueryInterface(
static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface) static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
{ {
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface; IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
ULONG ref = InterlockedIncrement(&(This->ref)); ULONG ref = InterlockedIncrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref - 1); TRACE("(%p) ref was %d\n", This, ref - 1);
return ref; return ref;
...@@ -77,7 +88,7 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface) ...@@ -77,7 +88,7 @@ static ULONG WINAPI IKsPrivatePropertySetImpl_AddRef(LPKSPROPERTYSET iface)
static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface) static ULONG WINAPI IKsPrivatePropertySetImpl_Release(LPKSPROPERTYSET iface)
{ {
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface; IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
ULONG ref = InterlockedDecrement(&(This->ref)); ULONG ref = InterlockedDecrement(&(This->ref));
TRACE("(%p) ref was %d\n", This, ref + 1); TRACE("(%p) ref was %d\n", This, ref + 1);
...@@ -514,7 +525,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_Get( ...@@ -514,7 +525,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_Get(
ULONG cbPropData, ULONG cbPropData,
PULONG pcbReturned ) PULONG pcbReturned )
{ {
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface; IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n", TRACE("(iface=%p,guidPropSet=%s,dwPropID=%d,pInstanceData=%p,cbInstanceData=%d,pPropData=%p,cbPropData=%d,pcbReturned=%p)\n",
This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned); This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData,pcbReturned);
...@@ -561,7 +572,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_Set( ...@@ -561,7 +572,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_Set(
LPVOID pPropData, LPVOID pPropData,
ULONG cbPropData ) ULONG cbPropData )
{ {
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface; IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData); FIXME("(%p,%s,%d,%p,%d,%p,%d), stub!\n",This,debugstr_guid(guidPropSet),dwPropID,pInstanceData,cbInstanceData,pPropData,cbPropData);
return E_PROP_ID_UNSUPPORTED; return E_PROP_ID_UNSUPPORTED;
...@@ -573,7 +584,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport( ...@@ -573,7 +584,7 @@ static HRESULT WINAPI IKsPrivatePropertySetImpl_QuerySupport(
ULONG dwPropID, ULONG dwPropID,
PULONG pTypeSupport ) PULONG pTypeSupport )
{ {
IKsPrivatePropertySetImpl *This = (IKsPrivatePropertySetImpl *)iface; IKsPrivatePropertySetImpl *This = impl_from_IKsPropertySet(iface);
TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport); TRACE("(%p,%s,%d,%p)\n",This,debugstr_guid(guidPropSet),dwPropID,pTypeSupport);
if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) { if ( IsEqualGUID( &DSPROPSETID_DirectSoundDevice, guidPropSet) ) {
...@@ -624,7 +635,7 @@ static const IKsPropertySetVtbl ikspvt = { ...@@ -624,7 +635,7 @@ static const IKsPropertySetVtbl ikspvt = {
HRESULT IKsPrivatePropertySetImpl_Create( HRESULT IKsPrivatePropertySetImpl_Create(
REFIID riid, REFIID riid,
IKsPrivatePropertySetImpl **piks) IKsPropertySet **piks)
{ {
IKsPrivatePropertySetImpl *iks; IKsPrivatePropertySetImpl *iks;
TRACE("(%s, %p)\n", debugstr_guid(riid), piks); TRACE("(%s, %p)\n", debugstr_guid(riid), piks);
...@@ -637,8 +648,8 @@ HRESULT IKsPrivatePropertySetImpl_Create( ...@@ -637,8 +648,8 @@ HRESULT IKsPrivatePropertySetImpl_Create(
iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks)); iks = HeapAlloc(GetProcessHeap(),0,sizeof(*iks));
iks->ref = 1; iks->ref = 1;
iks->lpVtbl = &ikspvt; iks->IKsPropertySet_iface.lpVtbl = &ikspvt;
*piks = iks; *piks = &iks->IKsPropertySet_iface;
return S_OK; return S_OK;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment