Module: wine Branch: master Commit: 31bfc380eef32c00d66f173e89d0815ca8ef112f URL: http://source.winehq.org/git/wine.git/?a=commit;h=31bfc380eef32c00d66f173e89...
Author: Christian Costa titan.costa@gmail.com Date: Thu Mar 29 08:52:54 2012 +0200
dmusic: Check return codes and display name from port caps when enumerating microsoft synthetizer.
---
dlls/dmusic/dmusic.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index b0dd7c9..ba12f98 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -138,12 +138,16 @@ static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD ind
if (index == (nb_midi_in + nb_midi_out + 1)) { - IDirectMusicSynth8* synth; - TRACE("Enumerating port: 'Microsoft Software Synthesizer'\n"); - CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth8, (void**)&synth); - IDirectMusicSynth8_GetPortCaps(synth, port_caps); - IDirectMusicSynth8_Release(synth); - return S_OK; + IDirectMusicSynth8* synth = NULL; + HRESULT hr; + hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth8, (void**)&synth); + if (SUCCEEDED(hr)) + IDirectMusicSynth8_GetPortCaps(synth, port_caps); + if (SUCCEEDED(hr)) + TRACE("Enumerating port: %s\n", debugstr_w(port_caps->wszDescription)); + if (synth) + IDirectMusicSynth8_Release(synth); + return hr; }
return S_FALSE;