Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a9b4f82c
Commit
a9b4f82c
authored
Oct 01, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Use URLDownloadToFile to download Gecko package file.
parent
1f716bcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
79 deletions
+13
-79
install.c
dlls/mshtml/install.c
+13
-79
No files found.
dlls/mshtml/install.c
View file @
a9b4f82c
...
@@ -63,30 +63,8 @@ static const WCHAR mshtml_keyW[] =
...
@@ -63,30 +63,8 @@ static const WCHAR mshtml_keyW[] =
'\\'
,
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
0
};
'\\'
,
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
0
};
static
HWND
install_dialog
=
NULL
;
static
HWND
install_dialog
=
NULL
;
static
LPWSTR
tmp_file_name
=
NULL
;
static
HANDLE
tmp_file
=
INVALID_HANDLE_VALUE
;
static
LPWSTR
url
=
NULL
;
static
LPWSTR
url
=
NULL
;
static
void
clean_up
(
void
)
{
if
(
tmp_file
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
tmp_file
);
if
(
tmp_file_name
)
{
DeleteFileW
(
tmp_file_name
);
heap_free
(
tmp_file_name
);
tmp_file_name
=
NULL
;
}
if
(
tmp_file
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
tmp_file
);
tmp_file
=
INVALID_HANDLE_VALUE
;
}
if
(
install_dialog
)
EndDialog
(
install_dialog
,
0
);
}
static
void
set_status
(
DWORD
id
)
static
void
set_status
(
DWORD
id
)
{
{
HWND
status
=
GetDlgItem
(
install_dialog
,
ID_DWL_STATUS
);
HWND
status
=
GetDlgItem
(
install_dialog
,
ID_DWL_STATUS
);
...
@@ -174,13 +152,10 @@ static BOOL install_cab(LPCWSTR file_name)
...
@@ -174,13 +152,10 @@ static BOOL install_cab(LPCWSTR file_name)
heap_free
(
file_name_a
);
heap_free
(
file_name_a
);
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
ERR
(
"Could not extract package: %08x
\n
"
,
hres
);
ERR
(
"Could not extract package: %08x
\n
"
,
hres
);
clean_up
();
return
FALSE
;
return
FALSE
;
}
}
set_registry
(
install_dir
);
set_registry
(
install_dir
);
clean_up
();
return
TRUE
;
return
TRUE
;
}
}
...
@@ -313,26 +288,7 @@ static ULONG WINAPI InstallCallback_Release(IBindStatusCallback *iface)
...
@@ -313,26 +288,7 @@ static ULONG WINAPI InstallCallback_Release(IBindStatusCallback *iface)
static
HRESULT
WINAPI
InstallCallback_OnStartBinding
(
IBindStatusCallback
*
iface
,
static
HRESULT
WINAPI
InstallCallback_OnStartBinding
(
IBindStatusCallback
*
iface
,
DWORD
dwReserved
,
IBinding
*
pib
)
DWORD
dwReserved
,
IBinding
*
pib
)
{
{
WCHAR
tmp_dir
[
MAX_PATH
];
set_status
(
IDS_DOWNLOADING
);
set_status
(
IDS_DOWNLOADING
);
GetTempPathW
(
sizeof
(
tmp_dir
)
/
sizeof
(
WCHAR
),
tmp_dir
);
tmp_file_name
=
heap_alloc
(
MAX_PATH
*
sizeof
(
WCHAR
));
GetTempFileNameW
(
tmp_dir
,
NULL
,
0
,
tmp_file_name
);
TRACE
(
"creating temp file %s
\n
"
,
debugstr_w
(
tmp_file_name
));
tmp_file
=
CreateFileW
(
tmp_file_name
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
tmp_file
==
INVALID_HANDLE_VALUE
)
{
ERR
(
"Could not create file: %d
\n
"
,
GetLastError
());
clean_up
();
return
E_FAIL
;
}
return
S_OK
;
return
S_OK
;
}
}
...
@@ -366,17 +322,10 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
...
@@ -366,17 +322,10 @@ static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
{
{
if
(
FAILED
(
hresult
))
{
if
(
FAILED
(
hresult
))
{
ERR
(
"Binding failed %08x
\n
"
,
hresult
);
ERR
(
"Binding failed %08x
\n
"
,
hresult
);
clean_up
();
return
S_OK
;
return
S_OK
;
}
}
CloseHandle
(
tmp_file
);
tmp_file
=
INVALID_HANDLE_VALUE
;
set_status
(
IDS_INSTALLING
);
set_status
(
IDS_INSTALLING
);
install_cab
(
tmp_file_name
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -391,21 +340,8 @@ static HRESULT WINAPI InstallCallback_GetBindInfo(IBindStatusCallback *iface,
...
@@ -391,21 +340,8 @@ static HRESULT WINAPI InstallCallback_GetBindInfo(IBindStatusCallback *iface,
static
HRESULT
WINAPI
InstallCallback_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
static
HRESULT
WINAPI
InstallCallback_OnDataAvailable
(
IBindStatusCallback
*
iface
,
DWORD
grfBSCF
,
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
DWORD
dwSize
,
FORMATETC
*
pformatetc
,
STGMEDIUM
*
pstgmed
)
{
{
IStream
*
str
=
pstgmed
->
u
.
pstm
;
ERR
(
"
\n
"
);
BYTE
buf
[
1024
];
return
E_NOTIMPL
;
DWORD
size
;
HRESULT
hres
;
do
{
DWORD
written
;
size
=
0
;
hres
=
IStream_Read
(
str
,
buf
,
sizeof
(
buf
),
&
size
);
if
(
size
)
WriteFile
(
tmp_file
,
buf
,
size
,
&
written
,
NULL
);
}
while
(
hres
==
S_OK
);
return
S_OK
;
}
}
static
HRESULT
WINAPI
InstallCallback_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
static
HRESULT
WINAPI
InstallCallback_OnObjectAvailable
(
IBindStatusCallback
*
iface
,
...
@@ -477,27 +413,23 @@ static LPWSTR get_url(void)
...
@@ -477,27 +413,23 @@ static LPWSTR get_url(void)
static
DWORD
WINAPI
download_proc
(
PVOID
arg
)
static
DWORD
WINAPI
download_proc
(
PVOID
arg
)
{
{
IMoniker
*
mon
;
WCHAR
tmp_dir
[
MAX_PATH
],
tmp_file
[
MAX_PATH
];
IBindCtx
*
bctx
;
IStream
*
str
=
NULL
;
HRESULT
hres
;
HRESULT
hres
;
CreateURLMoniker
(
NULL
,
url
,
&
mon
);
GetTempPathW
(
sizeof
(
tmp_dir
)
/
sizeof
(
WCHAR
),
tmp_dir
);
heap_free
(
url
);
GetTempFileNameW
(
tmp_dir
,
NULL
,
0
,
tmp_file
);
url
=
NULL
;
CreateAsyncBindCtx
(
0
,
&
InstallCallback
,
0
,
&
bctx
);
TRACE
(
"using temp file %s
\n
"
,
debugstr_w
(
tmp_file
)
);
hres
=
IMoniker_BindToStorage
(
mon
,
bctx
,
NULL
,
&
IID_IStream
,
(
void
**
)
&
str
);
hres
=
URLDownloadToFileW
(
NULL
,
url
,
tmp_file
,
0
,
&
InstallCallback
);
IBindCtx_Release
(
bctx
);
if
(
FAILED
(
hres
))
{
if
(
FAILED
(
hres
))
{
ERR
(
"
BindToStorag
e failed: %08x
\n
"
,
hres
);
ERR
(
"
URLDownloadToFil
e failed: %08x
\n
"
,
hres
);
return
0
;
return
0
;
}
}
i
f
(
str
)
i
nstall_cab
(
tmp_file
);
IStream_Release
(
str
);
DeleteFileW
(
tmp_file
);
EndDialog
(
install_dialog
,
0
);
return
0
;
return
0
;
}
}
...
@@ -552,6 +484,8 @@ BOOL install_wine_gecko(BOOL silent)
...
@@ -552,6 +484,8 @@ BOOL install_wine_gecko(BOOL silent)
DialogBoxW
(
hInst
,
MAKEINTRESOURCEW
(
ID_DWL_DIALOG
),
0
,
installer_proc
);
DialogBoxW
(
hInst
,
MAKEINTRESOURCEW
(
ID_DWL_DIALOG
),
0
,
installer_proc
);
}
}
heap_free
(
url
);
url
=
NULL
;
ReleaseSemaphore
(
hsem
,
1
,
NULL
);
ReleaseSemaphore
(
hsem
,
1
,
NULL
);
CloseHandle
(
hsem
);
CloseHandle
(
hsem
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment