From 18e909e6503310252793018da5253dcba0a88d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20B=C3=A9ron?= Date: Thu, 20 Oct 2005 13:20:03 +0000 Subject: [PATCH] Allow file:/// protocol to be used to download the Mozilla ActiveX control. --- dlls/shdocvw/shdocvw_main.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/dlls/shdocvw/shdocvw_main.c b/dlls/shdocvw/shdocvw_main.c index 3ff03b70dae..52fcde7bd10 100644 --- a/dlls/shdocvw/shdocvw_main.c +++ b/dlls/shdocvw/shdocvw_main.c @@ -307,6 +307,7 @@ static DWORD WINAPI ThreadFunc( LPVOID info ) { IBindStatusCallback *dl; static const WCHAR szUrlVal[] = {'M','o','z','i','l','l','a','U','r','l',0}; + static const WCHAR szFileProtocol[] = {'f','i','l','e',':','/','/','/',0}; WCHAR path[MAX_PATH], szUrl[MAX_PATH]; LPWSTR p; STARTUPINFOW si; @@ -330,22 +331,27 @@ static DWORD WINAPI ThreadFunc( LPVOID info ) if( r != ERROR_SUCCESS ) goto end; - /* built the path for the download */ - p = strrchrW( szUrl, '/' ); - if (!p) - goto end; - if (!GetTempPathW( MAX_PATH, path )) - goto end; - strcatW( path, p+1 ); + if( !strncmpW(szUrl, szFileProtocol, strlenW(szFileProtocol)) ) + lstrcpynW( path, szUrl+strlenW(szFileProtocol), MAX_PATH ); + else + { + /* built the path for the download */ + p = strrchrW( szUrl, '/' ); + if (!p) + goto end; + if (!GetTempPathW( MAX_PATH, path )) + goto end; + strcatW( path, p+1 ); - /* download it */ - bTempfile = TRUE; - dl = create_dl(info, &bCancelled); - r = URLDownloadToFileW( NULL, szUrl, path, 0, dl ); - if( dl ) - IBindStatusCallback_Release( dl ); - if( (r != S_OK) || bCancelled ) - goto end; + /* download it */ + bTempfile = TRUE; + dl = create_dl(info, &bCancelled); + r = URLDownloadToFileW( NULL, szUrl, path, 0, dl ); + if( dl ) + IBindStatusCallback_Release( dl ); + if( (r != S_OK) || bCancelled ) + goto end; + } /* run it */ memset( &si, 0, sizeof si );