dmcompos: COM cleanup for the IDirectMusicChordMap iface.

This commit is contained in:
Michael Stefaniuc 2014-03-10 23:53:11 +01:00 committed by Alexandre Julliard
parent 826980d7f4
commit 4f03d5d1ae
2 changed files with 30 additions and 20 deletions

View File

@ -23,7 +23,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
WINE_DECLARE_DEBUG_CHANNEL(dmfile); WINE_DECLARE_DEBUG_CHANNEL(dmfile);
static ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface); static ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface);
static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface);
static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
static ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface); static ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
@ -40,8 +39,8 @@ static HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOW
IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
return S_OK; return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) { } else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
*ppobj = &This->ChordMapVtbl; *ppobj = &This->IDirectMusicChordMap_iface;
IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef ((LPDIRECTMUSICCHORDMAP)&This->ChordMapVtbl); IDirectMusicChordMap_AddRef(&This->IDirectMusicChordMap_iface);
return S_OK; return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
*ppobj = &This->ObjectVtbl; *ppobj = &This->ObjectVtbl;
@ -90,32 +89,43 @@ static const IUnknownVtbl DirectMusicChordMap_Unknown_Vtbl = {
}; };
/* IDirectMusicChordMapImpl IDirectMusicChordMap part: */ /* IDirectMusicChordMapImpl IDirectMusicChordMap part: */
static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj) { static inline IDirectMusicChordMapImpl *impl_from_IDirectMusicChordMap(IDirectMusicChordMap *iface)
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); {
return CONTAINING_RECORD(iface, IDirectMusicChordMapImpl, IDirectMusicChordMap_iface);
}
static HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface(IDirectMusicChordMap *iface,
REFIID riid, void **ppobj)
{
IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface);
return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
} }
static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface) { static ULONG WINAPI IDirectMusicChordMapImpl_AddRef(IDirectMusicChordMap *iface)
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); {
IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface);
return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
} }
static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_Release (LPDIRECTMUSICCHORDMAP iface) { static ULONG WINAPI IDirectMusicChordMapImpl_Release(IDirectMusicChordMap *iface)
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); {
IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface);
return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
} }
static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale (LPDIRECTMUSICCHORDMAP iface, DWORD* pdwScale) { static HRESULT WINAPI IDirectMusicChordMapImpl_GetScale(IDirectMusicChordMap *iface,
ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); DWORD *pdwScale)
FIXME("(%p, %p): stub\n", This, pdwScale); {
return S_OK; IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface);
FIXME("(%p, %p): stub\n", This, pdwScale);
return S_OK;
} }
static const IDirectMusicChordMapVtbl DirectMusicChordMap_ChordMap_Vtbl = { static const IDirectMusicChordMapVtbl dmchordmap_vtbl = {
IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface, IDirectMusicChordMapImpl_QueryInterface,
IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef, IDirectMusicChordMapImpl_AddRef,
IDirectMusicChordMapImpl_IDirectMusicChordMap_Release, IDirectMusicChordMapImpl_Release,
IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale IDirectMusicChordMapImpl_GetScale
}; };
/* IDirectMusicChordMapImpl IDirectMusicObject part: */ /* IDirectMusicChordMapImpl IDirectMusicObject part: */
@ -534,7 +544,7 @@ HRESULT WINAPI create_dmchordmap(REFIID lpcGUID, void **ppobj)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
obj->UnknownVtbl = &DirectMusicChordMap_Unknown_Vtbl; obj->UnknownVtbl = &DirectMusicChordMap_Unknown_Vtbl;
obj->ChordMapVtbl = &DirectMusicChordMap_ChordMap_Vtbl; obj->IDirectMusicChordMap_iface.lpVtbl = &dmchordmap_vtbl;
obj->ObjectVtbl = &DirectMusicChordMap_Object_Vtbl; obj->ObjectVtbl = &DirectMusicChordMap_Object_Vtbl;
obj->PersistStreamVtbl = &DirectMusicChordMap_PersistStream_Vtbl; obj->PersistStreamVtbl = &DirectMusicChordMap_PersistStream_Vtbl;
obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));

View File

@ -63,7 +63,7 @@ extern HRESULT WINAPI create_dmsignposttrack(REFIID riid, void **ret_iface) DECL
struct IDirectMusicChordMapImpl { struct IDirectMusicChordMapImpl {
/* IUnknown fields */ /* IUnknown fields */
const IUnknownVtbl *UnknownVtbl; const IUnknownVtbl *UnknownVtbl;
const IDirectMusicChordMapVtbl *ChordMapVtbl; IDirectMusicChordMap IDirectMusicChordMap_iface;
const IDirectMusicObjectVtbl *ObjectVtbl; const IDirectMusicObjectVtbl *ObjectVtbl;
const IPersistStreamVtbl *PersistStreamVtbl; const IPersistStreamVtbl *PersistStreamVtbl;
LONG ref; LONG ref;