Nikolay Sivov : mfplat: Give priority to local scheme handlers.
Alexandre Julliard
julliard at winehq.org
Tue Jun 11 16:54:07 CDT 2019
Module: wine
Branch: master
Commit: 5f4cf1363096e53057242581954eef8af5c6271d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5f4cf1363096e53057242581954eef8af5c6271d
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Jun 11 15:40:02 2019 +0300
mfplat: Give priority to local scheme handlers.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mfplat/main.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index f759b5c..c24407f 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -5092,12 +5092,34 @@ static HRESULT resolver_create_scheme_handler(const WCHAR *scheme, DWORD flags,
{
static const char schemehandlerspath[] = "Software\\Microsoft\\Windows Media Foundation\\SchemeHandlers";
static const HKEY hkey_roots[2] = { HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE };
+ HRESULT hr = MF_E_UNSUPPORTED_SCHEME;
unsigned int i;
- HRESULT hr;
TRACE("%s, %#x, %p.\n", debugstr_w(scheme), flags, handler);
- /* FIXME: check local handlers first */
+ *handler = NULL;
+
+ if (!(flags & MF_RESOLUTION_DISABLE_LOCAL_PLUGINS))
+ {
+ struct local_handler *local_handler;
+
+ EnterCriticalSection(&local_handlers_section);
+
+ LIST_FOR_EACH_ENTRY(local_handler, &local_scheme_handlers, struct local_handler, entry)
+ {
+ if (!lstrcmpiW(scheme, local_handler->u.scheme))
+ {
+ if (SUCCEEDED(hr = IMFActivate_ActivateObject(local_handler->activate, &IID_IMFSchemeHandler,
+ (void **)handler)))
+ break;
+ }
+ }
+
+ LeaveCriticalSection(&local_handlers_section);
+
+ if (*handler)
+ return hr;
+ }
for (i = 0; i < ARRAY_SIZE(hkey_roots); ++i)
{
More information about the wine-cvs
mailing list