Commit 2227facd authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

amstream: Return E_INVALIDARG if AMMSF_ADDDEFAULTRENDERER is requested with a…

amstream: Return E_INVALIDARG if AMMSF_ADDDEFAULTRENDERER is requested with a non-NULL ret_stream parameter. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3e6eaaa2
......@@ -307,6 +307,9 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac
{
IBaseFilter *dsound_render;
if (ret_stream)
return E_INVALIDARG;
if (!IsEqualGUID(PurposeId, &MSPID_PrimaryAudio))
{
WARN("AMMSF_ADDDEFAULTRENDERER requested with id %s, returning MS_E_PURPOSEID.\n", debugstr_guid(PurposeId));
......
......@@ -798,7 +798,7 @@ static void test_add_stream(void)
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo,
AMMSF_ADDDEFAULTRENDERER, &video_stream);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo,
AMMSF_ADDDEFAULTRENDERER, NULL);
......@@ -806,7 +806,7 @@ static void test_add_stream(void)
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryAudio,
AMMSF_ADDDEFAULTRENDERER, &audio_stream);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryAudio,
AMMSF_ADDDEFAULTRENDERER, NULL);
......@@ -827,9 +827,9 @@ static void test_add_stream(void)
hr = IGraphBuilder_EnumFilters(graph, &enum_filters);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Next(enum_filters, 3, filters, &count);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr);
todo_wine ok(count == 2, "Got count %u.\n", count);
todo_wine ok(filters[1] == (IBaseFilter *)stream_filter,
ok(hr == S_FALSE, "Got hr %#x.\n", hr);
ok(count == 2, "Got count %u.\n", count);
ok(filters[1] == (IBaseFilter *)stream_filter,
"Expected filter %p, got %p.\n", stream_filter, filters[1]);
hr = IBaseFilter_GetClassID(filters[0], &clsid);
ok(hr == S_OK, "Got hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment