Signed-off-by: Andrew Eikum aeikum@codeweavers.com --- dlls/mmdevapi/tests/render.c | 25 +++++++++++++++++++++++++ dlls/winealsa.drv/mmdevdrv.c | 18 ++++++++++++++++-- dlls/wineandroid.drv/mmdevdrv.c | 18 ++++++++++++++++-- dlls/winecoreaudio.drv/mmdevdrv.c | 18 ++++++++++++++++-- dlls/wineoss.drv/mmdevdrv.c | 18 ++++++++++++++++-- dlls/winepulse.drv/mmdevdrv.c | 18 ++++++++++++++++-- 6 files changed, 105 insertions(+), 10 deletions(-)
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index e58cc449d86..a4f271e557e 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -141,6 +141,7 @@ static void test_audioclient(void) REFERENCE_TIME t1, t2; HANDLE handle; BOOL offload_capable; + AudioClientProperties client_props;
hr = IMMDevice_Activate(dev, &IID_IAudioClient2, CLSCTX_INPROC_SERVER, NULL, (void**)&ac2); @@ -260,6 +261,30 @@ static void test_audioclient(void) hr = IAudioClient2_IsOffloadCapable(ac2, AudioCategory_BackgroundCapableMedia, &offload_capable); ok(hr == S_OK, "IsOffloadCapable failed: %08x\n", hr);
+ hr = IAudioClient2_SetClientProperties(ac2, NULL); + ok(hr == E_POINTER, "SetClientProperties with NULL props gave wrong error: %08x\n", hr); + + client_props.cbSize = 0; + client_props.bIsOffload = FALSE; + client_props.eCategory = AudioCategory_BackgroundCapableMedia; + client_props.Options = 0; + + hr = IAudioClient2_SetClientProperties(ac2, &client_props); + ok(hr == E_INVALIDARG, "SetClientProperties with invalid cbSize gave wrong error: %08x\n", hr); + + client_props.cbSize = sizeof(client_props); + client_props.bIsOffload = TRUE; + + hr = IAudioClient2_SetClientProperties(ac2, &client_props); + if(!offload_capable) + ok(hr == AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE, "SetClientProperties(offload) gave wrong error: %08x\n", hr); + else + ok(hr == S_OK, "SetClientProperties(offload) failed: %08x\n", hr); + + client_props.bIsOffload = FALSE; + hr = IAudioClient2_SetClientProperties(ac2, &client_props); + ok(hr == S_OK, "SetClientProperties failed: %08x\n", hr); + IAudioClient2_Release(ac2);
test_uninitialized(ac); diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 233b0dfda11..04f90d0d168 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -2676,9 +2676,23 @@ static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface, { ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(%p)\n", This, prop); + TRACE("(%p)->(%p)\n", This, prop);
- return E_NOTIMPL; + if(!prop) + return E_POINTER; + + if(prop->cbSize != sizeof(*prop)) + return E_INVALIDARG; + + TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", + prop->bIsOffload, + prop->eCategory, + prop->Options); + + if(prop->bIsOffload) + return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; + + return S_OK; }
static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface, diff --git a/dlls/wineandroid.drv/mmdevdrv.c b/dlls/wineandroid.drv/mmdevdrv.c index 8ee1bb12d35..aa32c491855 100644 --- a/dlls/wineandroid.drv/mmdevdrv.c +++ b/dlls/wineandroid.drv/mmdevdrv.c @@ -1635,9 +1635,23 @@ static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface, { ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(%p)\n", This, prop); + TRACE("(%p)->(%p)\n", This, prop);
- return E_NOTIMPL; + if(!prop) + return E_POINTER; + + if(prop->cbSize != sizeof(*prop)) + return E_INVALIDARG; + + TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", + prop->bIsOffload, + prop->eCategory, + prop->Options); + + if(prop->bIsOffload) + return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; + + return S_OK; }
static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface, diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index f32c1d5e417..f065d5bc1ef 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -2243,9 +2243,23 @@ static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface, { ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(%p)\n", This, prop); + TRACE("(%p)->(%p)\n", This, prop);
- return E_NOTIMPL; + if(!prop) + return E_POINTER; + + if(prop->cbSize != sizeof(*prop)) + return E_INVALIDARG; + + TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", + prop->bIsOffload, + prop->eCategory, + prop->Options); + + if(prop->bIsOffload) + return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; + + return S_OK; }
static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface, diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 9b1cdf3fa7c..3a3cb57b642 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -1800,9 +1800,23 @@ static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface, { ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(%p)\n", This, prop); + TRACE("(%p)->(%p)\n", This, prop);
- return E_NOTIMPL; + if(!prop) + return E_POINTER; + + if(prop->cbSize != sizeof(*prop)) + return E_INVALIDARG; + + TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", + prop->bIsOffload, + prop->eCategory, + prop->Options); + + if(prop->bIsOffload) + return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; + + return S_OK; }
static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface, diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index e384955b019..91b8230bd85 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -2248,9 +2248,23 @@ static HRESULT WINAPI AudioClient_SetClientProperties(IAudioClient2 *iface, { ACImpl *This = impl_from_IAudioClient2(iface);
- FIXME("(%p)->(%p)\n", This, prop); + TRACE("(%p)->(%p)\n", This, prop);
- return E_NOTIMPL; + if(!prop) + return E_POINTER; + + if(prop->cbSize != sizeof(*prop)) + return E_INVALIDARG; + + TRACE("{ bIsOffload: %u, eCategory: 0x%x, Options: 0x%x }\n", + prop->bIsOffload, + prop->eCategory, + prop->Options); + + if(prop->bIsOffload) + return AUDCLNT_E_ENDPOINT_OFFLOAD_NOT_CAPABLE; + + return S_OK; }
static HRESULT WINAPI AudioClient_GetBufferSizeLimits(IAudioClient2 *iface,
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=79728
Your paranoid android.
=== w1064v1507 (32 bit report) ===
mmdevapi: render.c:1294: Test failed: GetBuffer large (20671) at iteration 2 render.c:1294: Test failed: GetBuffer large (20671) at iteration 7
=== w1064v1809 (32 bit report) ===
mmdevapi: render.c:1294: Test failed: GetBuffer large (20671) at iteration 3
=== w10pro64 (32 bit report) ===
mmdevapi: render.c:1335: Test failed: Position 518400 at end vs. 66240 submitted frames
=== w10pro64_2scr (32 bit report) ===
mmdevapi: render.c:1334: Test failed: GetCurrentPadding returned 1440, should be 0 render.c:1335: Test failed: Position 410880 at end vs. 52800 submitted frames
=== w10pro64_ar (32 bit report) ===
mmdevapi: render.c:1334: Test failed: GetCurrentPadding returned 480, should be 0 render.c:1335: Test failed: Position 433920 at end vs. 54720 submitted frames
=== w10pro64_he (32 bit report) ===
mmdevapi: render.c:1294: Test failed: GetBuffer large (22500) at iteration 2
=== w10pro64_ja (32 bit report) ===
mmdevapi: render.c:1335: Test failed: Position 353280 at end vs. 50880 submitted frames render.c:1294: Test failed: GetBuffer large (22500) at iteration 2
=== w10pro64_zh_CN (32 bit report) ===
mmdevapi: render.c:1334: Test failed: GetCurrentPadding returned 4800, should be 0 render.c:1335: Test failed: Position 560640 at end vs. 74880 submitted frames render.c:1294: Test failed: GetBuffer large (22500) at iteration 3
=== w864 (64 bit report) ===
mmdevapi: render.c:1294: Test failed: GetBuffer large (20671) at iteration 1 render.c:1294: Test failed: GetBuffer large (20671) at iteration 4
=== w1064v1507 (64 bit report) ===
mmdevapi: render.c:1294: Test failed: GetBuffer large (20671) at iteration 3
=== w1064v1809 (64 bit report) ===
mmdevapi: render.c:1068: Test failed: Position 6592 too far after playing 100ms
=== w10pro64_ar (64 bit report) ===
mmdevapi: render.c:1334: Test failed: GetCurrentPadding returned 960, should be 0 render.c:1335: Test failed: Position 433920 at end vs. 55200 submitted frames
=== w10pro64_he (64 bit report) ===
mmdevapi: render.c:1334: Test failed: GetCurrentPadding returned 960, should be 0 render.c:1335: Test failed: Position 522240 at end vs. 66240 submitted frames
=== w10pro64_ja (64 bit report) ===
mmdevapi: render.c:1334: Test failed: GetCurrentPadding returned 960, should be 0 render.c:1335: Test failed: Position 591360 at end vs. 74880 submitted frames
=== w10pro64_zh_CN (64 bit report) ===
mmdevapi: render.c:1335: Test failed: Position 437760 at end vs. 59520 submitted frames