dmusic: Fail in CreatePort() if SetDirectSound() wasn't called.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2017-05-12 16:11:25 +02:00 committed by Alexandre Julliard
parent 14f899317a
commit 40a4a5c7bf
2 changed files with 4 additions and 4 deletions

View file

@ -129,14 +129,14 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSI
TRACE("(%p)->(%s, %p, %p, %p)\n", This, debugstr_dmguid(rclsid_port), port_params, port, unkouter);
if (!rclsid_port)
if (!rclsid_port || !port)
return E_POINTER;
if (!port_params)
return E_INVALIDARG;
if (!port)
return E_POINTER;
if (unkouter)
return CLASS_E_NOAGGREGATION;
if (!This->dsound)
return DMUS_E_DSOUND_NOT_SET;
if (TRACE_ON(dmusic))
dump_DMUS_PORTPARAMS(port_params);

View file

@ -68,7 +68,7 @@ static void test_dmusic(void)
/* No port can be created before SetDirectSound is called */
hr = IDirectMusic_CreatePort(dmusic, &GUID_NULL, &port_params, &port, NULL);
todo_wine ok(hr == DMUS_E_DSOUND_NOT_SET, "IDirectMusic_CreatePort returned: %x\n", hr);
ok(hr == DMUS_E_DSOUND_NOT_SET, "IDirectMusic_CreatePort returned: %x\n", hr);
hr = IDirectMusic_SetDirectSound(dmusic, NULL, NULL);
ok(hr == S_OK, "IDirectMusic_SetDirectSound returned: %x\n", hr);