Supercedes: https://source.winehq.org/patches/data/152523
Includes a test case.
Signed-off-by: Roger Zoellner zoellner.roger@gmail.com --- dlls/xaudio2_7/tests/xaudio2.c | 3 +++ dlls/xaudio2_7/xaudio_dll.c | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 66097532c5..0c1d9a7805 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -1273,6 +1273,9 @@ START_TEST(xaudio2) if(hr == S_OK){ xaudio27 = TRUE;
+ hr = IXAudio27_QueryInterface(xa27, &IID_IXAudio28, (void**) &xa); + ok(hr != S_OK, "QueryInterface with IID_IXAudio28 on IXAudio27 object returned success. Expected to fail\n"); + hr = IXAudio27_Initialize(xa27, 0, XAUDIO2_ANY_PROCESSOR); ok(hr == S_OK, "Initialize failed: %08x\n", hr);
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index 28cf98565b..461ac56ffe 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -1262,7 +1262,9 @@ static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid, TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) || +#if XAUDIO2_VER == 8 IsEqualGUID(riid, &IID_IXAudio28) || +#endif IsEqualGUID(riid, &IID_IXAudio2)) *ppvObject = &This->IXAudio2_iface; else if(IsEqualGUID(riid, &IID_IXAudio27)){
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43660 Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Fri, Oct 12, 2018 at 09:05:24PM +0200, Roger Zoellner wrote:
Supercedes: https://source.winehq.org/patches/data/152523
Includes a test case.
Signed-off-by: Roger Zoellner zoellner.roger@gmail.com
dlls/xaudio2_7/tests/xaudio2.c | 3 +++ dlls/xaudio2_7/xaudio_dll.c | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/dlls/xaudio2_7/tests/xaudio2.c b/dlls/xaudio2_7/tests/xaudio2.c index 66097532c5..0c1d9a7805 100644 --- a/dlls/xaudio2_7/tests/xaudio2.c +++ b/dlls/xaudio2_7/tests/xaudio2.c @@ -1273,6 +1273,9 @@ START_TEST(xaudio2) if(hr == S_OK){ xaudio27 = TRUE;
hr = IXAudio27_QueryInterface(xa27, &IID_IXAudio28, (void**) &xa);
ok(hr != S_OK, "QueryInterface with IID_IXAudio28 on IXAudio27 object returned success. Expected to fail\n");
hr = IXAudio27_Initialize(xa27, 0, XAUDIO2_ANY_PROCESSOR); ok(hr == S_OK, "Initialize failed: %08x\n", hr);
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index 28cf98565b..461ac56ffe 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -1262,7 +1262,9 @@ static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid, TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject);
if(IsEqualGUID(riid, &IID_IUnknown) ||
+#if XAUDIO2_VER == 8 IsEqualGUID(riid, &IID_IXAudio28) || +#endif IsEqualGUID(riid, &IID_IXAudio2)) *ppvObject = &This->IXAudio2_iface; else if(IsEqualGUID(riid, &IID_IXAudio27)){ -- 2.19.0