From 393135c3c71748c078a930424ac4d0b4098bb4b3 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Thu, 2 Jan 2014 01:50:47 +0100 Subject: [PATCH] dmusic/tests: Change the way of detecting a workable dmusic. --- dlls/dmusic/tests/dmusic.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index ced23361b31..3e67c564408 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -323,10 +323,15 @@ static void test_COM_dmcoll(void) static BOOL missing_dmusic(void) { IDirectMusic8 *dm; - HRESULT hr = CoCreateInstance(&CLSID_DirectMusic, (IUnknown*)&dm, CLSCTX_INPROC_SERVER, - &IID_IUnknown, (void**)&dm); + HRESULT hr = CoCreateInstance(&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic, + (void**)&dm); - return (hr == REGDB_E_CLASSNOTREG || hr == CLASS_E_CLASSNOTAVAILABLE); + if (hr == S_OK && dm) + { + IDirectMusic_Release(dm); + return FALSE; + } + return TRUE; } START_TEST(dmusic)