Commit fa62cde3 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

amstream: Forbid changing the graph in IAMMultiMediaStream::Initialize().

parent 20004d15
......@@ -244,6 +244,12 @@ static HRESULT WINAPI multimedia_stream_Initialize(IAMMultiMediaStream *iface,
TRACE("mmstream %p, type %u, flags %#x, graph %p.\n", mmstream, type, flags, graph);
if (graph && mmstream->graph)
{
WARN("Graph already initialized, returning E_INVALIDARG.\n");
return E_INVALIDARG;
}
if (graph && FAILED(hr = create_graph(mmstream, graph)))
return hr;
......
......@@ -1646,6 +1646,15 @@ static void test_initialize(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(!got_add_filter, "Got %d calls to IGraphBuilder::AddFilter().\n", got_add_filter);
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_READ, 0, (IGraphBuilder *)&graph);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_READ, 0, NULL);
ok(hr == S_OK, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_WRITE, 0, NULL);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
hr = IAMMultiMediaStream_Initialize(mmstream, STREAMTYPE_TRANSFORM, 0, NULL);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
IMediaStreamFilter_Release(filter);
ref = IAMMultiMediaStream_Release(mmstream);
ok(!ref, "Got outstanding refcount %d.\n", ref);
......
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