Commit 25bf82ba authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

- huge COM cleanup: only keep dmusic8 version of interfaces when they

inherit from dmusic1 and dmusic2 version. And always use dmusic8 versions when available. - really stupid implementation of IDirectMusicLoader8::GetObject when IDirectMusicScript wanted - really fix the refcount problem found by Rok
parent e7724ffc
......@@ -30,151 +30,14 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicLoader IUnknown parts follow: */
HRESULT WINAPI IDirectMusicLoaderImpl_QueryInterface (LPDIRECTMUSICLOADER iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicLoader))
{
IDirectMusicLoaderImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicLoaderImpl_AddRef (LPDIRECTMUSICLOADER iface)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicLoaderImpl_Release (LPDIRECTMUSICLOADER iface)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicLoader Interface follow: */
HRESULT WINAPI IDirectMusicLoaderImpl_GetObject (LPDIRECTMUSICLOADER iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %p, %s, %p): stub\n", This, pDesc, debugstr_guid(riid), ppv);
*ppv = NULL;
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_SetObject (LPDIRECTMUSICLOADER iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %p): stub\n", This, pDesc);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory (LPDIRECTMUSICLOADER iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %s, %p, %d): to check\n", This, debugstr_guid(rguidClass), pwzPath, fClear);
if (0 == strncmpW(This->searchPath, pwzPath, MAX_PATH)) {
return S_FALSE;
}
strncpyW(This->searchPath, pwzPath, MAX_PATH);
return DS_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory (LPDIRECTMUSICLOADER iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %s, %p, %p): stub\n", This, debugstr_guid(rguidClass), pwzFileExtension, pwzScanFileName);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_CacheObject (LPDIRECTMUSICLOADER iface, IDirectMusicObject* pObject)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %p): stub\n", This, pObject);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_ReleaseObject (LPDIRECTMUSICLOADER iface, IDirectMusicObject* pObject)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %p): stub\n", This, pObject);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_ClearCache (LPDIRECTMUSICLOADER iface, REFGUID rguidClass)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p,%s): stub\n", This, debugstr_guid(rguidClass));
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_EnableCache (LPDIRECTMUSICLOADER iface, REFGUID rguidClass, BOOL fEnable)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %s, %d): stub\n", This, debugstr_guid(rguidClass), fEnable);
return S_OK;
}
HRESULT WINAPI IDirectMusicLoaderImpl_EnumObject (LPDIRECTMUSICLOADER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicLoaderImpl,iface);
FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_guid(rguidClass), dwIndex, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicLoader) DirectMusicLoader_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicLoaderImpl_QueryInterface,
IDirectMusicLoaderImpl_AddRef,
IDirectMusicLoaderImpl_Release,
IDirectMusicLoaderImpl_GetObject,
IDirectMusicLoaderImpl_SetObject,
IDirectMusicLoaderImpl_SetSearchDirectory,
IDirectMusicLoaderImpl_ScanDirectory,
IDirectMusicLoaderImpl_CacheObject,
IDirectMusicLoaderImpl_ReleaseObject,
IDirectMusicLoaderImpl_ClearCache,
IDirectMusicLoaderImpl_EnableCache,
IDirectMusicLoaderImpl_EnumObject
};
/* IDirectMusicLoader8 IUnknown parts follow: */
/* IDirectMusicLoader8 IUnknown part follow: */
HRESULT WINAPI IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicLoader8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicLoader8))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicLoader) ||
IsEqualGUID(riid, &IID_IDirectMusicLoader8))
{
IDirectMusicLoader8Impl_AddRef(iface);
*ppobj = This;
......@@ -204,13 +67,20 @@ ULONG WINAPI IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface)
}
/* IDirectMusicLoader Interface part follow: */
HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID*ppv)
HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv)
{
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %p, %s, %p): stub\n", This, pDesc, debugstr_guid(riid), ppv);
*ppv = NULL;
if (IsEqualGUID(riid, &IID_IDirectMusicScript)) {
IDirectMusicScriptImpl* script;
script = (IDirectMusicScriptImpl*) HeapAlloc(GetProcessHeap(), 0, sizeof(IDirectMusicScriptImpl));
script->lpVtbl = &DirectMusicScript_Vtbl;
script->ref = 1;
*ppv = script;
}
return DS_OK;
}
......@@ -227,9 +97,13 @@ HRESULT WINAPI IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8
{
ICOM_THIS(IDirectMusicLoader8Impl,iface);
FIXME("(%p, %s, %p, %d): forward to IDirectMusicLoaderImpl::SetSearchDirectory\n", This, debugstr_guid(rguidClass), pwzPath, fClear);
FIXME("(%p, %s, %p, %d): to check\n", This, debugstr_guid(rguidClass), pwzPath, fClear);
return IDirectMusicLoaderImpl_SetSearchDirectory((LPDIRECTMUSICLOADER) iface, rguidClass, pwzPath, fClear);
if (0 == strncmpW(This->searchPath, pwzPath, MAX_PATH)) {
return S_FALSE;
}
strncpyW(This->searchPath, pwzPath, MAX_PATH);
return DS_OK;
}
HRESULT WINAPI IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName)
......@@ -303,9 +177,6 @@ HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObjectByUnknown (LPDIRECTMUSICLOAD
return S_OK;
}
extern ICOM_VTABLE(IDirectMusicSegment) DirectMusicSegment_Vtbl;
extern ICOM_VTABLE(IDirectMusicSegment8) DirectMusicSegment8_Vtbl;
HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface,
REFGUID rguidClassID,
REFIID iidInterfaceID,
......@@ -402,12 +273,11 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoader8 (LPCGUID lpcGUID, LPDIRECTMUSICLO
IDirectMusicLoader8Impl *dmloader8;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMLoad8, pUnkOuter);
if (IsEqualGUID(lpcGUID, &IID_IDirectMusicLoader)
|| IsEqualGUID(lpcGUID, &IID_IDirectMusicLoader8))
if (IsEqualGUID(lpcGUID, &IID_IDirectMusicLoader) ||
IsEqualGUID(lpcGUID, &IID_IDirectMusicLoader8))
{
dmloader8 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicImpl));
if (NULL == dmloader8)
{
dmloader8 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLoader8Impl));
if (NULL == dmloader8) {
*ppDMLoad8 = (LPDIRECTMUSICLOADER8)NULL;
return E_OUTOFMEMORY;
}
......@@ -427,7 +297,8 @@ HRESULT WINAPI IDirectMusicGetLoaderImpl_QueryInterface (LPDIRECTMUSICGETLOADER
{
ICOM_THIS(IDirectMusicGetLoaderImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicGetLoader))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicGetLoader))
{
IDirectMusicGetLoaderImpl_AddRef(iface);
*ppobj = This;
......
......@@ -61,13 +61,13 @@ static HRESULT WINAPI DMCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualGUID (&IID_IDirectMusic, riid)) {
return DMUSIC_CreateDirectMusic (riid, (LPDIRECTMUSIC*) ppobj, pOuter);
if (IsEqualGUID (&IID_IDirectMusic, riid) ||
IsEqualGUID (&IID_IDirectMusic2, riid) ||
IsEqualGUID (&IID_IDirectMusic8, riid)) {
return DMUSIC_CreateDirectMusic(riid, (LPDIRECTMUSIC*) ppobj, pOuter);
}
if (IsEqualGUID (&IID_IDirectMusicPerformance, riid) ||
IsEqualGUID (&IID_IDirectMusicPerformance8, riid))
{
/*return DMUSIC_CreateDirectMusicPerformance (riid, (LPDIRECTMUSICPERFORMANCE*) ppobj, pOuter);*/
IsEqualGUID (&IID_IDirectMusicPerformance8, riid)) {
return DMUSIC_CreateDirectMusicPerformance8(riid, (LPDIRECTMUSICPERFORMANCE8*) ppobj, pOuter);
}
......
......@@ -41,13 +41,14 @@ HRESULT WINAPI IReferenceClockImpl_QueryInterface (LPREFERENCECLOCK iface, REFII
{
ICOM_THIS(IReferenceClockImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IReferenceClock))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IReferenceClock))
{
IReferenceClockImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -125,13 +126,14 @@ HRESULT WINAPI IDirectMusicThruImpl_QueryInterface (LPDIRECTMUSICTHRU iface, REF
{
ICOM_THIS(IDirectMusicThruImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicThru))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicThru))
{
IDirectMusicThruImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -179,13 +181,14 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_QueryInterface (LPDIRECTMUSICAUDIOPATH
{
ICOM_THIS(IDirectMusicAudioPathImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicAudioPath))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicAudioPath))
{
IDirectMusicAudioPathImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -268,8 +271,8 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH
case DMUS_PATH_PERFORMANCE:
{
/* TODO check wanted GUID */
*ppObject = (LPDIRECTMUSICPERFORMANCE) This->perfo;
IDirectMusicPerformanceImpl_AddRef((LPDIRECTMUSICPERFORMANCE) *ppObject);
*ppObject = (LPDIRECTMUSICPERFORMANCE8) This->perfo;
IDirectMusicPerformance8Impl_AddRef((LPDIRECTMUSICPERFORMANCE8) *ppObject);
return S_OK;
}
break;
......@@ -277,13 +280,13 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (LPDIRECTMUSICAUDIOPATH
case DMUS_PATH_PERFORMANCE_GRAPH:
{
IDirectMusicGraph* pPerfoGraph = NULL;
IDirectMusicPerformanceImpl_GetGraph((LPDIRECTMUSICPERFORMANCE) This->perfo, &pPerfoGraph);
IDirectMusicPerformance8Impl_GetGraph((LPDIRECTMUSICPERFORMANCE8) This->perfo, &pPerfoGraph);
if (NULL == pPerfoGraph) {
IDirectMusicGraphImpl* pGraph = NULL;
pGraph = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphImpl));
pGraph->lpVtbl = &DirectMusicGraph_Vtbl;
pGraph->ref = 1;
IDirectMusicPerformanceImpl_SetGraph((LPDIRECTMUSICPERFORMANCE) This->perfo, (IDirectMusicGraph*) pGraph);
IDirectMusicPerformance8Impl_SetGraph((LPDIRECTMUSICPERFORMANCE8) This->perfo, (IDirectMusicGraph*) pGraph);
/* we need release as SetGraph do an AddRef */
IDirectMusicGraphImpl_Release((LPDIRECTMUSICGRAPH) pGraph);
pPerfoGraph = (LPDIRECTMUSICGRAPH) pGraph;
......@@ -347,13 +350,14 @@ HRESULT WINAPI IDirectMusicBandImpl_QueryInterface (LPDIRECTMUSICBAND iface, REF
{
ICOM_THIS(IDirectMusicBandImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicBand))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicBand))
{
IDirectMusicBandImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -421,13 +425,14 @@ HRESULT WINAPI IDirectMusicSongImpl_QueryInterface (LPDIRECTMUSICSONG iface, REF
{
ICOM_THIS(IDirectMusicSongImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSong))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSong))
{
IDirectMusicSongImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -535,13 +540,14 @@ HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface (LPDIRECTMUSICCHORDMAP if
{
ICOM_THIS(IDirectMusicChordMapImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicChordMap))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicChordMap))
{
IDirectMusicChordMapImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -589,13 +595,14 @@ HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER if
{
ICOM_THIS(IDirectMusicComposerImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicComposer))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicComposer))
{
IDirectMusicComposerImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -693,13 +700,14 @@ HRESULT WINAPI IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER
{
ICOM_THIS(IDirectMusicContainerImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicContainer))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicContainer))
{
IDirectMusicContainerImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -747,7 +755,8 @@ HRESULT WINAPI IDirectMusicGraphImpl_QueryInterface (LPDIRECTMUSICGRAPH iface, R
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicGraph))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicGraph))
{
IDirectMusicGraphImpl_AddRef(iface);
*ppobj = This;
......@@ -789,8 +798,8 @@ HRESULT WINAPI IDirectMusicGraphImpl_StampPMsg (LPDIRECTMUSICGRAPH iface, DMUS_P
HRESULT WINAPI IDirectMusicGraphImpl_InsertTool (LPDIRECTMUSICGRAPH iface, IDirectMusicTool* pTool, DWORD* pdwPChannels, DWORD cPChannels, LONG lIndex)
{
int i;
IDirectMusicToolImpl* p;
IDirectMusicToolImpl* toAdd = (IDirectMusicToolImpl*) pTool;
IDirectMusicTool8Impl* p;
IDirectMusicTool8Impl* toAdd = (IDirectMusicTool8Impl*) pTool;
ICOM_THIS(IDirectMusicGraphImpl,iface);
FIXME("(%p, %p, %p, %ld, %li): use of pdwPChannels\n", This, pTool, pdwPChannels, cPChannels, lIndex);
......@@ -834,7 +843,7 @@ HRESULT WINAPI IDirectMusicGraphImpl_InsertTool (LPDIRECTMUSICGRAPH iface, IDire
HRESULT WINAPI IDirectMusicGraphImpl_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dwIndex, IDirectMusicTool** ppTool)
{
int i;
IDirectMusicToolImpl* p = NULL;
IDirectMusicTool8Impl* p = NULL;
ICOM_THIS(IDirectMusicGraphImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, ppTool);
......@@ -845,7 +854,7 @@ HRESULT WINAPI IDirectMusicGraphImpl_GetTool (LPDIRECTMUSICGRAPH iface, DWORD dw
}
*ppTool = (IDirectMusicTool*) p;
if (NULL != *ppTool) {
IDirectMusicToolImpl_AddRef(*ppTool);
IDirectMusicTool8Impl_AddRef((LPDIRECTMUSICTOOL8) *ppTool);
}
return DS_OK;
}
......@@ -877,13 +886,14 @@ HRESULT WINAPI IDirectMusicScriptImpl_QueryInterface (LPDIRECTMUSICSCRIPT iface,
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicScript))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicScript))
{
IDirectMusicScriptImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -920,7 +930,7 @@ HRESULT WINAPI IDirectMusicScriptImpl_CallRoutine (LPDIRECTMUSICSCRIPT iface, WC
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pwszRoutineName, pErrorInfo);
FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszRoutineName), pErrorInfo);
return S_OK;
}
......
......@@ -28,172 +28,21 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicStyle IUnknown parts follow: */
HRESULT WINAPI IDirectMusicStyleImpl_QueryInterface (LPDIRECTMUSICSTYLE iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicStyle))
{
IDirectMusicStyleImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleImpl_AddRef (LPDIRECTMUSICSTYLE iface)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleImpl_Release (LPDIRECTMUSICSTYLE iface)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyle Interface follow: */
HRESULT WINAPI IDirectMusicStyleImpl_GetBand (LPDIRECTMUSICSTYLE iface, WCHAR* pwszName, IDirectMusicBand** ppBand)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppBand);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_EnumBand (LPDIRECTMUSICSTYLE iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetDefaultBand (LPDIRECTMUSICSTYLE iface, IDirectMusicBand** ppBand)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p): stub\n", This, ppBand);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_EnumMotif (LPDIRECTMUSICSTYLE iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetMotif (LPDIRECTMUSICSTYLE iface, WCHAR* pwszName, IDirectMusicSegment** ppSegment)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppSegment);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetDefaultChordMap (LPDIRECTMUSICSTYLE iface, IDirectMusicChordMap** ppChordMap)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p): stub\n", This, ppChordMap);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_EnumChordMap (LPDIRECTMUSICSTYLE iface, DWORD dwIndex, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %ld, %p): stub\n", This, dwIndex, pwszName);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetChordMap (LPDIRECTMUSICSTYLE iface, WCHAR* pwszName, IDirectMusicChordMap** ppChordMap)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pwszName, ppChordMap);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetTimeSignature (LPDIRECTMUSICSTYLE iface, DMUS_TIMESIGNATURE* pTimeSig)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p): stub\n", This, pTimeSig);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetEmbellishmentLength (LPDIRECTMUSICSTYLE iface, DWORD dwType, DWORD dwLevel, DWORD* pdwMin, DWORD* pdwMax)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %ld, %ld, %p, %p): stub\n", This, dwType, dwLevel, pdwMin, pdwMax);
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleImpl_GetTempo (LPDIRECTMUSICSTYLE iface, double* pTempo)
{
ICOM_THIS(IDirectMusicStyleImpl,iface);
FIXME("(%p, %p): stub\n", This, pTempo);
return S_OK;
}
ICOM_VTABLE(IDirectMusicStyle) DirectMusicStyle_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleImpl_QueryInterface,
IDirectMusicStyleImpl_AddRef,
IDirectMusicStyleImpl_Release,
IDirectMusicStyleImpl_GetBand,
IDirectMusicStyleImpl_EnumBand,
IDirectMusicStyleImpl_GetDefaultBand,
IDirectMusicStyleImpl_EnumMotif,
IDirectMusicStyleImpl_GetMotif,
IDirectMusicStyleImpl_GetDefaultChordMap,
IDirectMusicStyleImpl_EnumChordMap,
IDirectMusicStyleImpl_GetChordMap,
IDirectMusicStyleImpl_GetTimeSignature,
IDirectMusicStyleImpl_GetEmbellishmentLength,
IDirectMusicStyleImpl_GetTempo
};
/* IDirectMusicStyle8 IUnknown parts follow: */
HRESULT WINAPI IDirectMusicStyle8Impl_QueryInterface (LPDIRECTMUSICSTYLE8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicStyle8))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicStyle) ||
IsEqualGUID(riid, &IID_IDirectMusicStyle8))
{
IDirectMusicStyle8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......
......@@ -29,232 +29,20 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicSynth IUnknown parts follow: */
HRESULT WINAPI IDirectMusicSynthImpl_QueryInterface (LPDIRECTMUSICSYNTH iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSynth))
{
IDirectMusicSynthImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSynthImpl_AddRef (LPDIRECTMUSICSYNTH iface)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSynthImpl_Release (LPDIRECTMUSICSYNTH iface)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSynth Interface follow: */
HRESULT WINAPI IDirectMusicSynthImpl_Open (LPDIRECTMUSICSYNTH iface, LPDMUS_PORTPARAMS pPortParams)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, pPortParams);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_Close (LPDIRECTMUSICSYNTH iface)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p): stub\n", This);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_SetNumChannelGroups (LPDIRECTMUSICSYNTH iface, DWORD dwGroups)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %ld): stub\n", This, dwGroups);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_Download (LPDIRECTMUSICSYNTH iface, LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p, %p, %p): stub\n", This, phDownload, pvData, pbFree);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_Unload (LPDIRECTMUSICSYNTH iface, HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, hDownload, hUserData);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_PlayBuffer (LPDIRECTMUSICSYNTH iface, REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, FIXME, %p, %ld): stub\n", This/*, rt*/, pbBuffer, cbBuffer);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_GetRunningStats (LPDIRECTMUSICSYNTH iface, LPDMUS_SYNTHSTATS pStats)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, pStats);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_GetPortCaps (LPDIRECTMUSICSYNTH iface, LPDMUS_PORTCAPS pCaps)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, pCaps);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_SetMasterClock (LPDIRECTMUSICSYNTH iface, IReferenceClock* pClock)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, pClock);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_GetLatencyClock (LPDIRECTMUSICSYNTH iface, IReferenceClock** ppClock)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, ppClock);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_Activate (LPDIRECTMUSICSYNTH iface, BOOL fEnable)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %d): stub\n", This, fEnable);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_SetSynthSink (LPDIRECTMUSICSYNTH iface, IDirectMusicSynthSink* pSynthSink)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, pSynthSink);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_Render (LPDIRECTMUSICSYNTH iface, short* pBuffer, DWORD dwLength, LONGLONG llPosition)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p, %ld, FIXME): stub\n", This, pBuffer, dwLength/*, llPosition*/);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_SetChannelPriority (LPDIRECTMUSICSYNTH iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %ld, %ld, %ld): stub\n", This, dwChannelGroup, dwChannel, dwPriority);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_GetChannelPriority (LPDIRECTMUSICSYNTH iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %ld, %ld, %p): stub\n", This, dwChannelGroup, dwChannel, pdwPriority);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_GetFormat (LPDIRECTMUSICSYNTH iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pWaveFormatEx, pdwWaveFormatExSiz);
return S_OK;
}
HRESULT WINAPI IDirectMusicSynthImpl_GetAppend (LPDIRECTMUSICSYNTH iface, DWORD* pdwAppend)
{
ICOM_THIS(IDirectMusicSynthImpl,iface);
FIXME("(%p, %p): stub\n", This, pdwAppend);
return S_OK;
}
ICOM_VTABLE(IDirectMusicSynth) DirectMusicSynth_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSynthImpl_QueryInterface,
IDirectMusicSynthImpl_AddRef,
IDirectMusicSynthImpl_Release,
IDirectMusicSynthImpl_Open,
IDirectMusicSynthImpl_Close,
IDirectMusicSynthImpl_SetNumChannelGroups,
IDirectMusicSynthImpl_Download,
IDirectMusicSynthImpl_Unload,
IDirectMusicSynthImpl_PlayBuffer,
IDirectMusicSynthImpl_GetRunningStats,
IDirectMusicSynthImpl_GetPortCaps,
IDirectMusicSynthImpl_SetMasterClock,
IDirectMusicSynthImpl_GetLatencyClock,
IDirectMusicSynthImpl_Activate,
IDirectMusicSynthImpl_SetSynthSink,
IDirectMusicSynthImpl_Render,
IDirectMusicSynthImpl_SetChannelPriority,
IDirectMusicSynthImpl_GetChannelPriority,
IDirectMusicSynthImpl_GetFormat,
IDirectMusicSynthImpl_GetAppend
};
/* IDirectMusicSynth8 IUnknown parts follow: */
HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSynth8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSynth8))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSynth) ||
IsEqualGUID(riid, &IID_IDirectMusicSynth8))
{
IDirectMusicSynth8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -513,13 +301,14 @@ HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK
{
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSynthSink))
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSynthSink))
{
IDirectMusicSynthSinkImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......
......@@ -303,7 +303,7 @@ HRESULT WINAPI DMUSIC_FillBandFromFileHandle (IDirectMusicBandImpl *band, HANDLE
* implement loading for missing (empty) clauses
* fix a problem with tempo track loading (look at code)
*/
HRESULT WINAPI DMUSIC_FillTrackFromFileHandle (IDirectMusicTrackImpl *segment, HANDLE fd)
HRESULT WINAPI DMUSIC_FillTrackFromFileHandle (IDirectMusicTrack8Impl *segment, HANDLE fd)
{
rawChunk chunk;
DWORD BytesRead, ListCount = 0, ListCount2 = 0, ListSize, ListSize2, FileCount = 0, FileSize, FileCount2 = 0, FileSize2 /* *2s are for various subchunks */;
......@@ -642,7 +642,7 @@ HRESULT WINAPI DMUSIC_FillTrackFromFileHandle (IDirectMusicTrackImpl *segment, H
return S_OK;
}
HRESULT WINAPI DMUSIC_FillSegmentFromFileHandle (IDirectMusicSegmentImpl *segment, HANDLE fd)
HRESULT WINAPI DMUSIC_FillSegmentFromFileHandle (IDirectMusicSegment8Impl *segment, HANDLE fd)
{
rawChunk chunk;
DWORD BytesRead, ListCount = 0, ListSize, FileCount = 0, FileSize;
......
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