mmdevapi: Implement SetClientProperties.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Andrew Eikum 2020-10-01 14:31:32 -05:00 committed by Alexandre Julliard
parent 530c79fba2
commit d8ae98d421
6 changed files with 105 additions and 10 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,