Octavian Voicu <octavian.voicu(a)gmail.com> writes:
> @@ -190,25 +190,31 @@ static void test_audioclient(IAudioClient *ac)
> hr = IAudioClient_GetMixFormat(ac, NULL);
> ok(hr == E_POINTER, "GetMixFormat returns %08x\n", hr);
>
> + pwfx = (void *)0xdeadbeef;
> hr = IAudioClient_GetMixFormat(ac, &pwfx);
> ok(hr == S_OK, "Valid GetMixFormat returns %08x\n", hr);
>
> - trace("Tag: %04x\n", pwfx->wFormatTag);
> - trace("bits: %u\n", pwfx->wBitsPerSample);
> - trace("chan: %u\n", pwfx->nChannels);
> - trace("rate: %u\n", pwfx->nSamplesPerSec);
> - trace("align: %u\n", pwfx->nBlockAlign);
> - trace("extra: %u\n", pwfx->cbSize);
> - ok(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE, "wFormatTag is %x\n", pwfx->wFormatTag);
> - if (pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE)
> + trace("pwfx: %p\n", pwfx);
> + if (pwfx == (void *)0xdeadbeef) pwfx = NULL;
> + if (pwfx)
That's ugly, you should check the function result, not a magic pointer
value.
--
Alexandre Julliard
julliard(a)winehq.org