From: Fabian Maurer dark.shadow4@web.de
--- dlls/mmdevapi/tests/render.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index a7da68ec3f1..4ec2b5e3f04 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -1453,6 +1453,7 @@ static void test_session(void) WAVEFORMATEX *pwfx; ULONG ref; HRESULT hr; + WCHAR *str;
hr = CoCreateGuid(&ses1_guid); ok(hr == S_OK, "CoCreateGuid failed: %08lx\n", hr); @@ -1575,6 +1576,40 @@ static void test_session(void) ok(hr == S_OK, "GetState failed: %08lx\n", hr); ok(state == AudioSessionStateInactive, "Got wrong state: %d\n", state);
+ /* Test GetDisplayName / SetDisplayName */ + + hr = IAudioSessionControl2_GetDisplayName(ses1_ctl2, NULL); + todo_wine + ok(hr == E_POINTER, "GetDisplayName failed: %08lx\n", hr); + + str = NULL; + hr = IAudioSessionControl2_GetDisplayName(ses1_ctl2, &str); + todo_wine + ok(hr == S_OK, "GetDisplayName failed: %08lx\n", hr); + todo_wine + ok(str && !wcscmp(str, L""), "Got %s\n", wine_dbgstr_w(str)); + if (str) + CoTaskMemFree(str); + + hr = IAudioSessionControl2_SetDisplayName(ses1_ctl2, NULL, NULL); + todo_wine + ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "SetDisplayName failed: %08lx\n", hr); + + hr = IAudioSessionControl2_SetDisplayName(ses1_ctl2, L"WineDisplayName", NULL); + todo_wine + ok(hr == S_OK, "SetDisplayName failed: %08lx\n", hr); + + str = NULL; + hr = IAudioSessionControl2_GetDisplayName(ses1_ctl2, &str); + todo_wine + ok(hr == S_OK, "GetDisplayName failed: %08lx\n", hr); + todo_wine + ok(str && !wcscmp(str, L"WineDisplayName"), "Got %s\n", wine_dbgstr_w(str)); + if (str) + CoTaskMemFree(str); + + /* Test capture */ + if(cap_ctl){ hr = IAudioSessionControl2_GetState(cap_ctl, &state); ok(hr == S_OK, "GetState failed: %08lx\n", hr);