From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56763 --- dlls/mmdevapi/mmdevdrv.h | 1 + dlls/mmdevapi/session.c | 29 ++++++++++++++++++++++++----- dlls/mmdevapi/tests/render.c | 7 ------- 3 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/dlls/mmdevapi/mmdevdrv.h b/dlls/mmdevapi/mmdevdrv.h index d4060fa304f..42b01443ff0 100644 --- a/dlls/mmdevapi/mmdevdrv.h +++ b/dlls/mmdevapi/mmdevdrv.h @@ -32,6 +32,7 @@ typedef struct audio_session {
WCHAR *display_name; WCHAR *icon_path; + GUID grouping_param;
struct list entry; } AudioSession; diff --git a/dlls/mmdevapi/session.c b/dlls/mmdevapi/session.c index 89d2544c293..899221ec04c 100644 --- a/dlls/mmdevapi/session.c +++ b/dlls/mmdevapi/session.c @@ -219,16 +219,33 @@ static HRESULT WINAPI control_SetIconPath(IAudioSessionControl2 *iface, const WC static HRESULT WINAPI control_GetGroupingParam(IAudioSessionControl2 *iface, GUID *group) { struct audio_session_wrapper *This = impl_from_IAudioSessionControl2(iface); - FIXME("(%p)->(%p) - stub\n", This, group); - return E_NOTIMPL; + struct audio_session *session = This->session; + + TRACE("(%p)->(%p) - stub\n", This, group); + + if (!group) + return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER); + + *group = session->grouping_param; + + return S_OK; }
static HRESULT WINAPI control_SetGroupingParam(IAudioSessionControl2 *iface, const GUID *group, - const GUID *session) + const GUID *event_context) { struct audio_session_wrapper *This = impl_from_IAudioSessionControl2(iface); - FIXME("(%p)->(%s, %s) - stub\n", This, debugstr_guid(group), debugstr_guid(session)); - return E_NOTIMPL; + struct audio_session *session = This->session; + + TRACE("(%p)->(%s, %s) - stub\n", This, debugstr_guid(group), debugstr_guid(event_context)); + FIXME("Ignoring session_guid\n"); + + if (!group) + return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER); + + session->grouping_param = *group; + + return S_OK; }
static HRESULT WINAPI control_RegisterAudioSessionNotification(IAudioSessionControl2 *iface, @@ -631,6 +648,8 @@ static struct audio_session *session_create(const GUID *guid, IMMDevice *device,
ret->master_vol = 1.f;
+ CoCreateGuid(&ret->grouping_param); + return ret; }
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 64bb2799705..b8ef4b5a549 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -1630,30 +1630,23 @@ static void test_session(void) /* Test GetGroupingParam / SetGroupingParam */
hr = IAudioSessionControl2_GetGroupingParam(ses1_ctl2, NULL); - todo_wine ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "GetGroupingParam failed: %08lx\n", hr);
hr = IAudioSessionControl2_GetGroupingParam(ses1_ctl2, &guid1); - todo_wine ok(hr == S_OK, "GetGroupingParam failed: %08lx\n", hr); - todo_wine ok(!IsEqualGUID(&guid1, &guid2), "Expected non null GUID\n"); /* MSDN is wrong here, it is not GUID_NULL */
hr = IAudioSessionControl2_SetGroupingParam(ses1_ctl2, NULL, NULL); - todo_wine ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "SetGroupingParam failed: %08lx\n", hr);
hr = CoCreateGuid(&guid2); ok(hr == S_OK, "CoCreateGuid failed: %08lx\n", hr);
hr = IAudioSessionControl2_SetGroupingParam(ses1_ctl2, &guid2, NULL); - todo_wine ok(hr == S_OK, "SetGroupingParam failed: %08lx\n", hr);
hr = IAudioSessionControl2_GetGroupingParam(ses1_ctl2, &guid1); - todo_wine ok(hr == S_OK, "GetGroupingParam failed: %08lx\n", hr); - todo_wine ok(IsEqualGUID(&guid1, &guid2), "Got %s\n", wine_dbgstr_guid(&guid1));
/* Test capture */