From: Bernhard Übelacker <bernhardu@mailbox.org> Followup of fc627e04d3 and ebc31cfbee. --- dlls/dsound/tests/dsound.c | 9 ++++++++- dlls/dsound/tests/dsound8.c | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 44b5136d7be..ed5c1925e37 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -291,6 +291,9 @@ static void IDirectSound_tests(void) IDirectSound_Release(dso); } +#define AUDCLNT_ERR(n) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_AUDCLNT, n) +#define AUDCLNT_E_DEVICE_IN_USE AUDCLNT_ERR(0x0a) + static HRESULT test_dsound(LPGUID lpGuid) { HRESULT rc; @@ -327,7 +330,11 @@ static HRESULT test_dsound(LPGUID lpGuid) /* Create a second DirectSound object */ rc = DirectSoundCreate(lpGuid, &dso1, NULL); - ok(rc==DS_OK,"DirectSoundCreate() failed: %08lx\n",rc); + /* Running without pulseaudio can't open twice. */ + if (rc==AUDCLNT_E_DEVICE_IN_USE) + skip("Failed to open device a second time, skipping test.\n"); + else + ok(rc==DS_OK,"DirectSoundCreate() failed: %08lx\n",rc); if (rc==DS_OK) { /* Release the second DirectSound object */ ref=IDirectSound_Release(dso1); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index 07b10af45e0..1b363b9ad7b 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -311,7 +311,11 @@ static HRESULT test_dsound8(LPGUID lpGuid) /* Create a second DirectSound8 object */ rc = DirectSoundCreate8(lpGuid, &dso1, NULL); - ok(rc==DS_OK,"DirectSoundCreate8() failed: %08lx\n",rc); + /* Running without pulseaudio can't open twice. */ + if (rc==AUDCLNT_E_DEVICE_IN_USE) + skip("Failed to open device a second time, skipping test.\n"); + else + ok(rc==DS_OK,"DirectSoundCreate8() failed: %08lx\n",rc); if (rc==DS_OK) { /* Release the second DirectSound8 object */ ref=IDirectSound8_Release(dso1); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11080