amstream: Return E_INVALIDARG if AMMSF_ADDDEFAULTRENDERER is requested with a non-NULL ret_stream parameter.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-03 17:19:16 -06:00 committed by Alexandre Julliard
parent 3e6eaaa2c5
commit 2227facdd6
2 changed files with 8 additions and 5 deletions

View File

@ -307,6 +307,9 @@ static HRESULT WINAPI multimedia_stream_AddMediaStream(IAMMultiMediaStream *ifac
{ {
IBaseFilter *dsound_render; IBaseFilter *dsound_render;
if (ret_stream)
return E_INVALIDARG;
if (!IsEqualGUID(PurposeId, &MSPID_PrimaryAudio)) if (!IsEqualGUID(PurposeId, &MSPID_PrimaryAudio))
{ {
WARN("AMMSF_ADDDEFAULTRENDERER requested with id %s, returning MS_E_PURPOSEID.\n", debugstr_guid(PurposeId)); WARN("AMMSF_ADDDEFAULTRENDERER requested with id %s, returning MS_E_PURPOSEID.\n", debugstr_guid(PurposeId));

View File

@ -798,7 +798,7 @@ static void test_add_stream(void)
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo, hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo,
AMMSF_ADDDEFAULTRENDERER, &video_stream); 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, hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryVideo,
AMMSF_ADDDEFAULTRENDERER, NULL); AMMSF_ADDDEFAULTRENDERER, NULL);
@ -806,7 +806,7 @@ static void test_add_stream(void)
hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryAudio, hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryAudio,
AMMSF_ADDDEFAULTRENDERER, &audio_stream); 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, hr = IAMMultiMediaStream_AddMediaStream(mmstream, NULL, &MSPID_PrimaryAudio,
AMMSF_ADDDEFAULTRENDERER, NULL); AMMSF_ADDDEFAULTRENDERER, NULL);
@ -827,9 +827,9 @@ static void test_add_stream(void)
hr = IGraphBuilder_EnumFilters(graph, &enum_filters); hr = IGraphBuilder_EnumFilters(graph, &enum_filters);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IEnumFilters_Next(enum_filters, 3, filters, &count); hr = IEnumFilters_Next(enum_filters, 3, filters, &count);
todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr); ok(hr == S_FALSE, "Got hr %#x.\n", hr);
todo_wine ok(count == 2, "Got count %u.\n", count); ok(count == 2, "Got count %u.\n", count);
todo_wine ok(filters[1] == (IBaseFilter *)stream_filter, ok(filters[1] == (IBaseFilter *)stream_filter,
"Expected filter %p, got %p.\n", stream_filter, filters[1]); "Expected filter %p, got %p.\n", stream_filter, filters[1]);
hr = IBaseFilter_GetClassID(filters[0], &clsid); hr = IBaseFilter_GetClassID(filters[0], &clsid);
ok(hr == S_OK, "Got hr %#x.\n", hr); ok(hr == S_OK, "Got hr %#x.\n", hr);