Commit afbf2894 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

dmime: Check return code of CoCreateInstance in Init method.

parent 7afb1290
......@@ -238,15 +238,18 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANC
This->pDirectMusic = (IDirectMusic8*) *ppDirectMusic;
IDirectMusic8_AddRef(This->pDirectMusic);
} else {
/* app allows the performance to initialise itself and needs a pointer to object*/
CoCreateInstance (&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic8, (void**)&This->pDirectMusic);
if (ppDirectMusic) {
*ppDirectMusic = (LPDIRECTMUSIC) This->pDirectMusic;
IDirectMusic8_AddRef((LPDIRECTMUSIC8) *ppDirectMusic);
}
}
return S_OK;
HRESULT hr;
/* App enables the performance to initialize itself and needs a pointer to object */
hr = CoCreateInstance(&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic8, (void**)&This->pDirectMusic);
if (FAILED(hr))
return hr;
if (ppDirectMusic) {
*ppDirectMusic = (LPDIRECTMUSIC)This->pDirectMusic;
IDirectMusic8_AddRef((LPDIRECTMUSIC8)*ppDirectMusic);
}
}
return S_OK;
}
static HRESULT WINAPI IDirectMusicPerformance8Impl_PlaySegment (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusicSegment* pSegment, DWORD dwFlags, __int64 i64StartTime, IDirectMusicSegmentState** ppSegmentState) {
......
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