Commit 9d1ca9fb authored by Rok Mandeljc's avatar Rok Mandeljc Committed by Alexandre Julliard

Dmusic class factory can now create dmloader8 and dmperformance8.

parent cba9795f
......@@ -213,7 +213,6 @@ ICOM_VTABLE(IDirectMusic) DirectMusic_Vtbl =
IDirectMusicImpl_SetDirectSound
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusic (LPCGUID lpcGUID, LPDIRECTMUSIC *ppDM, LPUNKNOWN pUnkOuter)
{
......@@ -231,7 +230,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusic (LPCGUID lpcGUID, LPDIRECTMUSIC *ppDM, L
}
dmusic->lpVtbl = &DirectMusic_Vtbl;
dmusic->ref = 0;
dmusic->ref = 1;
*ppDM = (LPDIRECTMUSIC)dmusic;
return S_OK;
}
......
......@@ -263,6 +263,29 @@ ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl =
IDirectMusicLoader8Impl_LoadObjectFromFile
};
HRESULT WINAPI DMUSIC_CreateDirectMusicLoader8 (LPCGUID lpcGUID, LPDIRECTMUSICLOADER8 *ppDMLoad8, LPUNKNOWN pUnkOuter)
{
IDirectMusicLoader8Impl *dmloader8;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMLoad8, pUnkOuter);
if (IsEqualGUID(lpcGUID, &IID_IDirectMusicLoader8))
{
dmloader8 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicImpl));
if (NULL == dmloader8)
{
*ppDMLoad8 = (LPDIRECTMUSICLOADER8)NULL;
return E_OUTOFMEMORY;
}
dmloader8->lpVtbl = &DirectMusicLoader8_Vtbl;
dmloader8->ref = 1;
*ppDMLoad8 = (LPDIRECTMUSICLOADER8)dmloader8;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/* IDirectMusicGetLoader IUnknown parts follow: */
HRESULT WINAPI IDirectMusicGetLoaderImpl_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, LPVOID *ppobj)
......
......@@ -69,6 +69,14 @@ static HRESULT WINAPI DMCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter
{
return DMUSIC_CreateDirectMusicPerformance (riid, (LPDIRECTMUSICPERFORMANCE*)ppobj, pOuter);
}
if (IsEqualGUID (&IID_IDirectMusicPerformance8, riid))
{
return DMUSIC_CreateDirectMusicPerformance8 (riid, (LPDIRECTMUSICPERFORMANCE8*)ppobj, pOuter);
}
if (IsEqualGUID (&IID_IDirectMusicLoader8, riid))
{
return DMUSIC_CreateDirectMusicLoader8 (riid, (LPDIRECTMUSICLOADER8*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
......
......@@ -387,12 +387,12 @@ ICOM_VTABLE(IDirectMusicPerformance) DirectMusicPerformance_Vtbl =
IDirectMusicPerformanceImpl_RhythmToTime
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE *ppDMPerf, LPUNKNOWN pUnkOuter)
{
IDirectMusicPerformanceImpl *pPerf;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMPerf, pUnkOuter);
if (IsEqualGUID(lpcGUID, &IID_IDirectMusicPerformance))
{
pPerf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformanceImpl));
......@@ -401,17 +401,17 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUS
*ppDMPerf = (LPDIRECTMUSICPERFORMANCE)NULL;
return E_OUTOFMEMORY;
}
pPerf->lpVtbl = &DirectMusicPerformance_Vtbl;
pPerf->ref = 1;
*ppDMPerf = (LPDIRECTMUSICPERFORMANCE)pPerf;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/* IDirectMusicPerformance8 IUnknown parts follow: */
HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORMANCE8 iface, REFIID riid, LPVOID *ppobj)
{
......@@ -805,3 +805,27 @@ ICOM_VTABLE(IDirectMusicPerformance8) DirectMusicPerformance8_Vtbl =
IDirectMusicPerformance8ImplGetDefaultAudioPath,
IDirectMusicPerformance8ImplGetParamEx
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance8 (LPCGUID lpcGUID, LPDIRECTMUSICPERFORMANCE8 *ppDMPerf8, LPUNKNOWN pUnkOuter)
{
IDirectMusicPerformance8Impl *pPerf8;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMPerf8, pUnkOuter);
if (IsEqualGUID(lpcGUID, &IID_IDirectMusicPerformance8))
{
pPerf8 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformance8Impl));
if (NULL == pPerf8)
{
*ppDMPerf8 = (LPDIRECTMUSICPERFORMANCE8)NULL;
return E_OUTOFMEMORY;
}
pPerf8->lpVtbl = &DirectMusicPerformance8_Vtbl;
pPerf8->ref = 1;
*ppDMPerf8 = (LPDIRECTMUSICPERFORMANCE8)pPerf8;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
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