dmsynth: Check the rigth CLSID to create the DirectMusicSynthSink object.

This commit is contained in:
Christian Costa 2012-04-06 13:39:10 +02:00 committed by Alexandre Julliard
parent d2d5d0e0d7
commit 3e48fe9d61
2 changed files with 11 additions and 10 deletions

View File

@ -148,15 +148,16 @@ HRESULT WINAPI DllCanUnloadNow(void)
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%s, %s, %p)\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSynth) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = &Synth_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSynth) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = &SynthSink_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
if (IsEqualCLSID(rclsid, &CLSID_DirectMusicSynth) && IsEqualIID(riid, &IID_IClassFactory)) {
*ppv = &Synth_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID(rclsid, &CLSID_DirectMusicSynthSink) && IsEqualIID(riid, &IID_IClassFactory)) {
*ppv = &SynthSink_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%s,%s,%p): no interface found.\n", debugstr_dmguid(rclsid), debugstr_dmguid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;

View File

@ -43,7 +43,7 @@ static void test_dmsynth(void)
}
hr = CoCreateInstance(&CLSID_DirectMusicSynthSink, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynthSink, (LPVOID*)&dmsynth_sink);
todo_wine ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
ok(hr == S_OK, "CoCreateInstance returned: %x\n", hr);
if (dmsynth_sink)
IDirectMusicSynthSink_Release(dmsynth_sink);