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
d2243989
Commit
d2243989
authored
Feb 18, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: URLDownloadToFileA code clean up.
parent
5ca20089
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
47 deletions
+48
-47
download.c
dlls/urlmon/download.c
+35
-0
umon.c
dlls/urlmon/umon.c
+0
-47
urlmon_main.h
dlls/urlmon/urlmon_main.h
+13
-0
No files found.
dlls/urlmon/download.c
View file @
d2243989
...
...
@@ -368,3 +368,38 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFi
return
hres
==
MK_S_ASYNCHRONOUS
?
S_OK
:
hres
;
}
/***********************************************************************
* URLDownloadToFileA (URLMON.@)
*
* Downloads URL szURL to rile szFileName and call lpfnCB callback to
* report progress.
*
* PARAMS
* pCaller [I] controlling IUnknown interface.
* szURL [I] URL of the file to download
* szFileName [I] file name to store the content of the URL
* dwReserved [I] reserved - set to 0
* lpfnCB [I] callback for progress report
*
* RETURNS
* S_OK on success
*/
HRESULT
WINAPI
URLDownloadToFileA
(
LPUNKNOWN
pCaller
,
LPCSTR
szURL
,
LPCSTR
szFileName
,
DWORD
dwReserved
,
LPBINDSTATUSCALLBACK
lpfnCB
)
{
LPWSTR
urlW
,
file_nameW
;
HRESULT
hres
;
TRACE
(
"(%p %s %s %d %p)
\n
"
,
pCaller
,
debugstr_a
(
szURL
),
debugstr_a
(
szFileName
),
dwReserved
,
lpfnCB
);
urlW
=
heap_strdupAtoW
(
szURL
);
file_nameW
=
heap_strdupAtoW
(
szFileName
);
hres
=
URLDownloadToFileW
(
pCaller
,
urlW
,
file_nameW
,
dwReserved
,
lpfnCB
);
heap_free
(
urlW
);
heap_free
(
file_nameW
);
return
hres
;
}
dlls/urlmon/umon.c
View file @
d2243989
...
...
@@ -1207,53 +1207,6 @@ HRESULT WINAPI MkParseDisplayNameEx(IBindCtx *pbc, LPCWSTR szDisplayName, ULONG
/***********************************************************************
* URLDownloadToFileA (URLMON.@)
*
* Downloads URL szURL to rile szFileName and call lpfnCB callback to
* report progress.
*
* PARAMS
* pCaller [I] controlling IUnknown interface.
* szURL [I] URL of the file to download
* szFileName [I] file name to store the content of the URL
* dwReserved [I] reserved - set to 0
* lpfnCB [I] callback for progress report
*
* RETURNS
* S_OK on success
* E_OUTOFMEMORY when going out of memory
*/
HRESULT
WINAPI
URLDownloadToFileA
(
LPUNKNOWN
pCaller
,
LPCSTR
szURL
,
LPCSTR
szFileName
,
DWORD
dwReserved
,
LPBINDSTATUSCALLBACK
lpfnCB
)
{
UNICODE_STRING
szURL_w
,
szFileName_w
;
if
((
szURL
==
NULL
)
||
(
szFileName
==
NULL
))
{
FIXME
(
"(%p,%s,%s,%08x,%p) cannot accept NULL strings !
\n
"
,
pCaller
,
debugstr_a
(
szURL
),
debugstr_a
(
szFileName
),
dwReserved
,
lpfnCB
);
return
E_INVALIDARG
;
/* The error code is not specified in this case... */
}
if
(
RtlCreateUnicodeStringFromAsciiz
(
&
szURL_w
,
szURL
))
{
if
(
RtlCreateUnicodeStringFromAsciiz
(
&
szFileName_w
,
szFileName
))
{
HRESULT
ret
=
URLDownloadToFileW
(
pCaller
,
szURL_w
.
Buffer
,
szFileName_w
.
Buffer
,
dwReserved
,
lpfnCB
);
RtlFreeUnicodeString
(
&
szURL_w
);
RtlFreeUnicodeString
(
&
szFileName_w
);
return
ret
;
}
else
{
RtlFreeUnicodeString
(
&
szURL_w
);
}
}
FIXME
(
"(%p,%s,%s,%08x,%p) could not allocate W strings !
\n
"
,
pCaller
,
szURL
,
szFileName
,
dwReserved
,
lpfnCB
);
return
E_OUTOFMEMORY
;
}
/***********************************************************************
* URLDownloadToCacheFileA (URLMON.@)
*/
HRESULT
WINAPI
URLDownloadToCacheFileA
(
LPUNKNOWN
lpUnkCaller
,
LPCSTR
szURL
,
LPSTR
szFileName
,
...
...
dlls/urlmon/urlmon_main.h
View file @
d2243989
...
...
@@ -110,4 +110,17 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
return
ret
;
}
static
inline
LPWSTR
heap_strdupAtoW
(
const
char
*
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
#endif
/* __WINE_URLMON_MAIN_H */
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