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 | 28 +++++++++++++++++++++++----- dlls/mmdevapi/tests/render.c | 7 ------- 3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/dlls/mmdevapi/mmdevdrv.h b/dlls/mmdevapi/mmdevdrv.h index 115c5e32fcc..d4060fa304f 100644 --- a/dlls/mmdevapi/mmdevdrv.h +++ b/dlls/mmdevapi/mmdevdrv.h @@ -31,6 +31,7 @@ typedef struct audio_session { BOOL mute;
WCHAR *display_name; + WCHAR *icon_path;
struct list entry; } AudioSession; diff --git a/dlls/mmdevapi/session.c b/dlls/mmdevapi/session.c index 6f45ab120c0..89d2544c293 100644 --- a/dlls/mmdevapi/session.c +++ b/dlls/mmdevapi/session.c @@ -186,16 +186,34 @@ static HRESULT WINAPI control_SetDisplayName(IAudioSessionControl2 *iface, const static HRESULT WINAPI control_GetIconPath(IAudioSessionControl2 *iface, WCHAR **path) { struct audio_session_wrapper *This = impl_from_IAudioSessionControl2(iface); - FIXME("(%p)->(%p) - stub\n", This, path); - return E_NOTIMPL; + struct audio_session *session = This->session; + + TRACE("(%p)->(%p) - stub\n", This, path); + + if (!path) + return E_POINTER; + + *path = duplicate_wstr(session->icon_path); + + return S_OK; }
static HRESULT WINAPI control_SetIconPath(IAudioSessionControl2 *iface, const WCHAR *path, - const GUID *session) + const GUID *event_context) { struct audio_session_wrapper *This = impl_from_IAudioSessionControl2(iface); - FIXME("(%p)->(%s, %s) - stub\n", This, debugstr_w(path), debugstr_guid(session)); - return E_NOTIMPL; + struct audio_session *session = This->session; + + TRACE("(%p)->(%s, %s) - stub\n", This, debugstr_w(path), debugstr_guid(event_context)); + FIXME("Ignoring session_guid\n"); + + if (!path) + return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER); + + CoTaskMemFree(session->icon_path); + session->icon_path = duplicate_wstr(path); + + return S_OK; }
static HRESULT WINAPI control_GetGroupingParam(IAudioSessionControl2 *iface, GUID *group) diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 6d76bff8b22..64bb2799705 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -1605,31 +1605,24 @@ static void test_session(void) /* Test GetIconPath / SetIconPath */
hr = IAudioSessionControl2_GetIconPath(ses1_ctl2, NULL); - todo_wine ok(hr == E_POINTER, "GetIconPath failed: %08lx\n", hr);
str = NULL; hr = IAudioSessionControl2_GetIconPath(ses1_ctl2, &str); - todo_wine ok(hr == S_OK, "GetIconPath failed: %08lx\n", hr); - todo_wine ok(str && !wcscmp(str, L""), "Got %s\n", wine_dbgstr_w(str)); if(str) CoTaskMemFree(str);
hr = IAudioSessionControl2_SetIconPath(ses1_ctl2, NULL, NULL); - todo_wine ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "SetIconPath failed: %08lx\n", hr);
hr = IAudioSessionControl2_SetIconPath(ses1_ctl2, L"WineIconPath", NULL); - todo_wine ok(hr == S_OK, "SetIconPath failed: %08lx\n", hr);
str = NULL; hr = IAudioSessionControl2_GetIconPath(ses1_ctl2, &str); - todo_wine ok(hr == S_OK, "GetIconPath failed: %08lx\n", hr); - todo_wine ok(str && !wcscmp(str, L"WineIconPath"), "Got %s\n", wine_dbgstr_w(str)); if (str) CoTaskMemFree(str);