[PATCH 0/1] MR9713: xaudio2_7/tests: Dynamically load function XAudio2CreateWithVersionInfo.
Make the test run again with win10-1709 and before. Followup to e04f84dc4c. [Test pattern page](https://test.winehq.org/data/patterns.html#xaudio2_8:xaudio2) [Testbot run with this patch](https://testbot.winehq.org/JobDetails.pl?Key=161206) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9713
From: Bernhard Übelacker <bernhardu(a)mailbox.org> Followup to e04f84dc4c. --- dlls/xaudio2_7/tests/xaudio2.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 1165db2a1f6..115616cf764 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -1444,12 +1444,20 @@ static void test_XAudio2CreateWithVersionInfo(void) { IXAudio2 *audio; HRESULT hr; + HMODULE mod = GetModuleHandleA("xaudio2_8.dll"); + HRESULT (WINAPI *pXAudio2CreateWithVersionInfo)(IXAudio2**, UINT32, XAUDIO2_PROCESSOR, DWORD); + pXAudio2CreateWithVersionInfo = (void *)GetProcAddress(mod, "XAudio2CreateWithVersionInfo"); - hr = XAudio2CreateWithVersionInfo(&audio, 0, XAUDIO2_DEFAULT_PROCESSOR, 0); + if(!pXAudio2CreateWithVersionInfo){ /* not available up to win10-1709 */ + win_skip("Function XAudio2CreateWithVersionInfo not present in xaudio2_8.dll\n"); + return; + } + + hr = pXAudio2CreateWithVersionInfo(&audio, 0, XAUDIO2_DEFAULT_PROCESSOR, 0); ok(hr == S_OK, "got %#lx.\n", hr); IXAudio2_Release(audio); - hr = XAudio2CreateWithVersionInfo(&audio, 0, XAUDIO2_DEFAULT_PROCESSOR, ~0); + hr = pXAudio2CreateWithVersionInfo(&audio, 0, XAUDIO2_DEFAULT_PROCESSOR, ~0); ok(hr == S_OK, "got %#lx.\n", hr); IXAudio2_Release(audio); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9713
participants (1)
-
Bernhard Übelacker