Commit 8d48b745 authored by Octavian Voicu's avatar Octavian Voicu Committed by Alexandre Julliard

mmdevapi/tests: Prevent crash when GetMixFormat fails.

parent bb201bb5
......@@ -193,6 +193,9 @@ static void test_audioclient(IAudioClient *ac)
hr = IAudioClient_GetMixFormat(ac, &pwfx);
ok(hr == S_OK, "Valid GetMixFormat returns %08x\n", hr);
if (hr == S_OK)
{
trace("pwfx: %p\n", pwfx);
trace("Tag: %04x\n", pwfx->wFormatTag);
trace("bits: %u\n", pwfx->wBitsPerSample);
trace("chan: %u\n", pwfx->nChannels);
......@@ -211,8 +214,6 @@ static void test_audioclient(IAudioClient *ac)
&KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)?"FLOAT":"Other"));
}
if (hr == S_OK)
{
hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08x\n", hr);
ok(pwfx2 == NULL, "pwfx2 is non-null\n");
......
......@@ -126,6 +126,9 @@ static void test_audioclient(IAudioClient *ac)
hr = IAudioClient_GetMixFormat(ac, &pwfx);
ok(hr == S_OK, "Valid GetMixFormat returns %08x\n", hr);
if (hr == S_OK)
{
trace("pwfx: %p\n", pwfx);
trace("Tag: %04x\n", pwfx->wFormatTag);
trace("bits: %u\n", pwfx->wBitsPerSample);
trace("chan: %u\n", pwfx->nChannels);
......@@ -144,8 +147,6 @@ static void test_audioclient(IAudioClient *ac)
&KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)?"FLOAT":"Other"));
}
if (hr == S_OK)
{
hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2);
ok(hr == S_OK, "Valid IsFormatSupported(Shared) call returns %08x\n", hr);
ok(pwfx2 == NULL, "pwfx2 is non-null\n");
......
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