Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/main.c | 8 ++------ dlls/mf/mf.idl | 4 ++-- dlls/mfuuid/mfuuid.c | 1 + 3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/dlls/mf/main.c b/dlls/mf/main.c index 01fe17866c..15c9e5e3c9 100644 --- a/dlls/mf/main.c +++ b/dlls/mf/main.c @@ -26,11 +26,6 @@ #include "mfidl.h" #include "rpcproxy.h"
-#include "initguid.h" -#include "mf.h" - -#undef INITGUID -#include <guiddef.h> #include "mfapi.h" #include "mferror.h"
@@ -43,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
static HINSTANCE mf_instance; +extern const GUID CLSID_FileSchemePlugin;
struct activate_object { @@ -1032,7 +1028,7 @@ static const struct class_object } class_objects[] = { - { &CLSID_FileSchemeHandler, &file_scheme_handler_factory.IClassFactory_iface }, + { &CLSID_FileSchemePlugin, &file_scheme_handler_factory.IClassFactory_iface }, };
/******************************************************************************* diff --git a/dlls/mf/mf.idl b/dlls/mf/mf.idl index 824c246d30..289a521b4f 100644 --- a/dlls/mf/mf.idl +++ b/dlls/mf/mf.idl @@ -16,11 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#pragma makedep header register +#pragma makedep register
[ helpstring("File scheme handler"), threading(both), uuid(477ec299-1421-4bdd-971f-7ccb933f21ad) ] -coclass FileSchemeHandler { } +coclass FileSchemePlugin { } diff --git a/dlls/mfuuid/mfuuid.c b/dlls/mfuuid/mfuuid.c index 8801eac8b8..537eaef642 100644 --- a/dlls/mfuuid/mfuuid.c +++ b/dlls/mfuuid/mfuuid.c @@ -34,3 +34,4 @@ #include "mfmediaengine.h"
DEFINE_GUID(MF_SCRUBBING_SERVICE, 0xdd0ac3d8,0x40e3,0x4128,0xac,0x48,0xc0,0xad,0xd0,0x67,0xb7,0x14); +DEFINE_GUID(CLSID_FileSchemePlugin, 0x477ec299,0x1421,0x4bdd,0x97,0x1f,0x7c,0xcb,0x93,0x3f,0x21,0xad);
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 007db891c1..e623b4c0ed 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -49,7 +49,8 @@ DEFINE_GUID(DUMMY_CLSID, 0x12345678,0x1234,0x1234,0x12,0x13,0x14,0x15,0x16,0x17, DEFINE_GUID(DUMMY_GUID1, 0x12345678,0x1234,0x1234,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21); DEFINE_GUID(DUMMY_GUID2, 0x12345678,0x1234,0x1234,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22); DEFINE_GUID(DUMMY_GUID3, 0x12345678,0x1234,0x1234,0x23,0x23,0x23,0x23,0x23,0x23,0x23,0x23); -DEFINE_GUID(CLSID_FileSchemeHandler, 0x477ec299, 0x1421, 0x4bdd, 0x97, 0x1f, 0x7c, 0xcb, 0x93, 0x3f, 0x21, 0xad); + +extern const CLSID CLSID_FileSchemePlugin;
DEFINE_MEDIATYPE_GUID(MFVideoFormat_IMC1, MAKEFOURCC('I','M','C','1')); DEFINE_MEDIATYPE_GUID(MFVideoFormat_IMC2, MAKEFOURCC('I','M','C','2')); @@ -634,7 +635,7 @@ skip_source_tests: ok(SUCCEEDED(hr), "Failed to initialize, hr %#x.\n", hr); do_uninit = hr == S_OK;
- hr = CoCreateInstance(&CLSID_FileSchemeHandler, NULL, CLSCTX_INPROC_SERVER, &IID_IMFSchemeHandler, + hr = CoCreateInstance(&CLSID_FileSchemePlugin, NULL, CLSCTX_INPROC_SERVER, &IID_IMFSchemeHandler, (void **)&scheme_handler); ok(hr == S_OK, "Failed to create handler object, hr %#x.\n", hr);
From: "Rémi Bernon" rbernon@codeweavers.com
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Supersedes 184179.
dlls/mfplat/main.c | 45 +++++++++++++++++--------------------- dlls/mfplat/tests/mfplat.c | 4 ++++ 2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index 923905399b..0a5958acb2 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -5883,6 +5883,7 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu IRtwqAsyncResult *result) { IRtwqAsyncResult *inner_result = (IRtwqAsyncResult *)IRtwqAsyncResult_GetStateNoAddRef(result); + RTWQASYNCRESULT *data = (RTWQASYNCRESULT *)inner_result; struct resolver_queued_result *queued_result; union { @@ -5891,7 +5892,8 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu IMFSchemeHandler *scheme_handler; } handler;
- queued_result = heap_alloc_zero(sizeof(*queued_result)); + if (!(queued_result = heap_alloc_zero(sizeof(*queued_result)))) + return E_OUTOFMEMORY;
IRtwqAsyncResult_GetObject(inner_result, &handler.handler);
@@ -5911,37 +5913,30 @@ static HRESULT resolver_handler_end_create(struct source_resolver *resolver, enu
IUnknown_Release(handler.handler);
- if (SUCCEEDED(queued_result->hr)) + if (data->hEvent) { - RTWQASYNCRESULT *data = (RTWQASYNCRESULT *)inner_result; + queued_result->inner_result = inner_result; + IRtwqAsyncResult_AddRef(queued_result->inner_result); + }
- if (data->hEvent) - { - queued_result->inner_result = inner_result; - IRtwqAsyncResult_AddRef(queued_result->inner_result); - } + /* Push resolved object type and created object, so we don't have to guess on End*() call. */ + EnterCriticalSection(&resolver->cs); + list_add_tail(&resolver->pending, &queued_result->entry); + LeaveCriticalSection(&resolver->cs);
- /* Push resolved object type and created object, so we don't have to guess on End*() call. */ - EnterCriticalSection(&resolver->cs); - list_add_tail(&resolver->pending, &queued_result->entry); - LeaveCriticalSection(&resolver->cs); + if (data->hEvent) + SetEvent(data->hEvent); + else + { + IUnknown *caller_state = IRtwqAsyncResult_GetStateNoAddRef(inner_result); + IRtwqAsyncResult *caller_result;
- if (data->hEvent) - SetEvent(data->hEvent); - else + if (SUCCEEDED(RtwqCreateAsyncResult(queued_result->object, data->pCallback, caller_state, &caller_result))) { - IUnknown *caller_state = IRtwqAsyncResult_GetStateNoAddRef(inner_result); - IRtwqAsyncResult *caller_result; - - if (SUCCEEDED(RtwqCreateAsyncResult(queued_result->object, data->pCallback, caller_state, &caller_result))) - { - RtwqInvokeCallback(caller_result); - IRtwqAsyncResult_Release(caller_result); - } + RtwqInvokeCallback(caller_result); + IRtwqAsyncResult_Release(caller_result); } } - else - heap_free(queued_result);
return S_OK; } diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index e623b4c0ed..4bc0813624 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -605,6 +605,10 @@ skip_source_tests: /* Create from URL. */ callback.event = CreateEventA(NULL, FALSE, FALSE, NULL);
+ hr = IMFSourceResolver_CreateObjectFromURL(resolver, L"nonexisting.mp4", MF_RESOLUTION_BYTESTREAM, NULL, &obj_type, + (IUnknown **)&stream); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Unexpected 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);