From 7bc0cbc078acd1c587d03270122a632629655a1a Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Mon, 9 Nov 2020 17:40:25 +0100 Subject: [PATCH] mmdevapi/tests: Work around Initialize() render breakage on Win 10. Calling Initialize() twice causes later Start() operations to report a failure on Windows 10 >= 1607. Signed-off-by: Francois Gouget Signed-off-by: Andrew Eikum Signed-off-by: Alexandre Julliard --- dlls/mmdevapi/tests/render.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 8c82a1a81fd..a0aa1b18936 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -337,6 +337,14 @@ static void test_audioclient(void) trace("Initialize(duration=0) GetBufferSize is %u\n", num); } + hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL); + ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08x\n", hr); + + hr = IAudioClient_Start(ac); + ok(hr == S_OK || + broken(hr == AUDCLNT_E_DEVICE_INVALIDATED), /* Win10 >= 1607 */ + "Start on a doubly initialized stream returns %08x\n", hr); + IAudioClient_Release(ac); hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, @@ -406,9 +414,6 @@ static void test_audioclient(void) if(t2 == 0) win10 = TRUE; - hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL); - ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08x\n", hr); - hr = IAudioClient_SetEventHandle(ac, NULL); ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr);