Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfmediaengine/main.c | 4 ++++ dlls/mfmediaengine/tests/mfmediaengine.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/mfmediaengine/main.c b/dlls/mfmediaengine/main.c index 5c00c10f718..99beb17e429 100644 --- a/dlls/mfmediaengine/main.c +++ b/dlls/mfmediaengine/main.c @@ -1464,11 +1464,15 @@ static HRESULT WINAPI media_engine_GetCurrentSource(IMFMediaEngineEx *iface, BST *url = NULL;
EnterCriticalSection(&engine->cs); + + if (engine->flags & FLAGS_ENGINE_SHUT_DOWN) + hr = MF_E_SHUTDOWN; if (engine->current_source) { if (!(*url = SysAllocString(engine->current_source))) hr = E_OUTOFMEMORY; } + LeaveCriticalSection(&engine->cs);
return hr; diff --git a/dlls/mfmediaengine/tests/mfmediaengine.c b/dlls/mfmediaengine/tests/mfmediaengine.c index 8584554a2b6..6448e7f2169 100644 --- a/dlls/mfmediaengine/tests/mfmediaengine.c +++ b/dlls/mfmediaengine/tests/mfmediaengine.c @@ -319,7 +319,6 @@ static void test_Shutdown(void) ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
hr = IMFMediaEngine_GetCurrentSource(media_engine, &str); -todo_wine ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#x.\n", hr);
state = IMFMediaEngine_GetNetworkState(media_engine);