Calls to IMFSourceResolver_CreateObjectFromURL with non existing files otherwise never return.
Street Fighter V tries to play an intro video file that does not exist and it blocks forever.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
The test cannot be added in a separate patch, as it would block forever.
I think maybe we should instead process the result normally, regardless or its success or failure, and otherwise we don't return the correct value --hence the todo_wine-- but I don't know this code so I did the smallest change instead.
dlls/mfplat/main.c | 4 ++++ dlls/mfplat/tests/mfplat.c | 6 ++++++ 2 files changed, 10 insertions(+)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 923905399b51..6a6b1443eebd 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -5941,7 +5941,11 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu } } else + { + RTWQASYNCRESULT *data = (RTWQASYNCRESULT *)inner_result; + if (data->hEvent) SetEvent(data->hEvent); heap_free(queued_result); + }
return S_OK; } diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 007db891c1f7..cdb80c05006e 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -421,6 +421,7 @@ static void test_source_resolver(void) WCHAR pathW[MAX_PATH]; int i, sample_count; WCHAR *filename; + WCHAR nonexisting[] = {'n','o','n','e','x','i','s','t','i','n','g','.','m','p','4',0}; PROPVARIANT var; HRESULT hr; GUID guid; @@ -604,6 +605,11 @@ skip_source_tests: /* Create from URL. */ callback.event = CreateEventA(NULL, FALSE, FALSE, NULL);
+ hr = IMFSourceResolver_CreateObjectFromURL(resolver, nonexisting, MF_RESOLUTION_BYTESTREAM, NULL, &obj_type, + (IUnknown **)&stream); + todo_wine + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Failed to resolve url, hr %#x.\n", hr); + hr = IMFSourceResolver_CreateObjectFromURL(resolver, filename, MF_RESOLUTION_BYTESTREAM, NULL, &obj_type, (IUnknown **)&stream); ok(hr == S_OK, "Failed to resolve url, hr %#x.\n", hr);