Commit 18e909e6 authored by Vincent Béron's avatar Vincent Béron Committed by Alexandre Julliard

Allow file:/// protocol to be used to download the Mozilla ActiveX

control.
parent c02356b8
...@@ -307,6 +307,7 @@ static DWORD WINAPI ThreadFunc( LPVOID info ) ...@@ -307,6 +307,7 @@ static DWORD WINAPI ThreadFunc( LPVOID info )
{ {
IBindStatusCallback *dl; IBindStatusCallback *dl;
static const WCHAR szUrlVal[] = {'M','o','z','i','l','l','a','U','r','l',0}; 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]; WCHAR path[MAX_PATH], szUrl[MAX_PATH];
LPWSTR p; LPWSTR p;
STARTUPINFOW si; STARTUPINFOW si;
...@@ -330,22 +331,27 @@ static DWORD WINAPI ThreadFunc( LPVOID info ) ...@@ -330,22 +331,27 @@ static DWORD WINAPI ThreadFunc( LPVOID info )
if( r != ERROR_SUCCESS ) if( r != ERROR_SUCCESS )
goto end; goto end;
/* built the path for the download */ if( !strncmpW(szUrl, szFileProtocol, strlenW(szFileProtocol)) )
p = strrchrW( szUrl, '/' ); lstrcpynW( path, szUrl+strlenW(szFileProtocol), MAX_PATH );
if (!p) else
goto end; {
if (!GetTempPathW( MAX_PATH, path )) /* built the path for the download */
goto end; p = strrchrW( szUrl, '/' );
strcatW( path, p+1 ); if (!p)
goto end;
/* download it */ if (!GetTempPathW( MAX_PATH, path ))
bTempfile = TRUE; goto end;
dl = create_dl(info, &bCancelled); strcatW( path, p+1 );
r = URLDownloadToFileW( NULL, szUrl, path, 0, dl );
if( dl ) /* download it */
IBindStatusCallback_Release( dl ); bTempfile = TRUE;
if( (r != S_OK) || bCancelled ) dl = create_dl(info, &bCancelled);
goto end; r = URLDownloadToFileW( NULL, szUrl, path, 0, dl );
if( dl )
IBindStatusCallback_Release( dl );
if( (r != S_OK) || bCancelled )
goto end;
}
/* run it */ /* run it */
memset( &si, 0, sizeof si ); memset( &si, 0, sizeof si );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment