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
a3aa115a
Commit
a3aa115a
authored
Oct 06, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Use default binding callback if no callback is provided.
parent
428c1bba
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
17 deletions
+39
-17
bindctx.c
dlls/urlmon/bindctx.c
+1
-1
binding.c
dlls/urlmon/binding.c
+5
-5
download.c
dlls/urlmon/download.c
+31
-11
urlmon_main.h
dlls/urlmon/urlmon_main.h
+2
-0
No files found.
dlls/urlmon/bindctx.c
View file @
a3aa115a
...
...
@@ -477,7 +477,7 @@ static void set_callback(BindStatusCallback *This, IBindStatusCallback *bsc)
This
->
serv_prov
=
hres
==
S_OK
?
serv_prov
:
NULL
;
}
static
HRESULT
wrap_callback
(
IBindStatusCallback
*
bsc
,
IBindStatusCallback
**
ret_iface
)
HRESULT
wrap_callback
(
IBindStatusCallback
*
bsc
,
IBindStatusCallback
**
ret_iface
)
{
BindStatusCallback
*
ret
;
...
...
dlls/urlmon/binding.c
View file @
a3aa115a
...
...
@@ -1369,12 +1369,12 @@ static HRESULT get_callback(IBindCtx *pbc, IBindStatusCallback **callback)
HRESULT
hres
;
hres
=
IBindCtx_GetObjectParam
(
pbc
,
bscb_holderW
,
&
unk
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
callback
);
IUnknown_Release
(
unk
);
}
if
(
FAILED
(
hres
))
return
create_default_callback
(
callback
);
return
SUCCEEDED
(
hres
)
?
S_OK
:
INET_E_DATA_NOT_AVAILABLE
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IBindStatusCallback
,
(
void
**
)
callback
);
IUnknown_Release
(
unk
);
return
hres
;
}
static
BOOL
is_urlmon_protocol
(
LPCWSTR
url
)
...
...
dlls/urlmon/download.c
View file @
a3aa115a
...
...
@@ -171,14 +171,16 @@ static HRESULT WINAPI DownloadBSC_OnStopBinding(IBindStatusCallback *iface,
TRACE
(
"(%p)->(%08x %s)
\n
"
,
This
,
hresult
,
debugstr_w
(
szError
));
if
(
This
->
cache_file
)
{
BOOL
b
;
b
=
CopyFileW
(
This
->
cache_file
,
This
->
file_name
,
FALSE
);
if
(
!
b
)
FIXME
(
"CopyFile failed: %u
\n
"
,
GetLastError
());
}
else
{
FIXME
(
"No cache file
\n
"
);
if
(
This
->
file_name
)
{
if
(
This
->
cache_file
)
{
BOOL
b
;
b
=
CopyFileW
(
This
->
cache_file
,
This
->
file_name
,
FALSE
);
if
(
!
b
)
FIXME
(
"CopyFile failed: %u
\n
"
,
GetLastError
());
}
else
{
FIXME
(
"No cache file
\n
"
);
}
}
if
(
This
->
callback
)
...
...
@@ -301,7 +303,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
DwlServiceProvider_QueryService
};
static
IBindStatusCallback
*
DownloadBSC_Create
(
IBindStatusCallback
*
callback
,
LPCWSTR
file_name
)
static
HRESULT
DownloadBSC_Create
(
IBindStatusCallback
*
callback
,
LPCWSTR
file_name
,
IBindStatusCallback
**
ret_callback
)
{
DownloadBSC
*
ret
=
heap_alloc
(
sizeof
(
*
ret
));
...
...
@@ -315,7 +317,22 @@ static IBindStatusCallback *DownloadBSC_Create(IBindStatusCallback *callback, LP
IBindStatusCallback_AddRef
(
callback
);
ret
->
callback
=
callback
;
return
STATUSCLB
(
ret
);
*
ret_callback
=
STATUSCLB
(
ret
);
return
S_OK
;
}
HRESULT
create_default_callback
(
IBindStatusCallback
**
ret
)
{
IBindStatusCallback
*
callback
;
HRESULT
hres
;
hres
=
DownloadBSC_Create
(
NULL
,
NULL
,
&
callback
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
wrap_callback
(
callback
,
ret
);
IBindStatusCallback_Release
(
callback
);
return
hres
;
}
/***********************************************************************
...
...
@@ -348,7 +365,10 @@ HRESULT WINAPI URLDownloadToFileW(LPUNKNOWN pCaller, LPCWSTR szURL, LPCWSTR szFi
if
(
pCaller
)
FIXME
(
"pCaller not supported
\n
"
);
callback
=
DownloadBSC_Create
(
lpfnCB
,
szFileName
);
hres
=
DownloadBSC_Create
(
lpfnCB
,
szFileName
,
&
callback
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
CreateAsyncBindCtx
(
0
,
callback
,
NULL
,
&
bindctx
);
IBindStatusCallback_Release
(
callback
);
if
(
FAILED
(
hres
))
...
...
dlls/urlmon/urlmon_main.h
View file @
a3aa115a
...
...
@@ -80,6 +80,8 @@ HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, v
HRESULT
create_binding_protocol
(
LPCWSTR
url
,
BOOL
from_urlmon
,
IInternetProtocol
**
protocol
);
void
set_binding_sink
(
IInternetProtocol
*
bind_protocol
,
IInternetProtocolSink
*
sink
,
IInternetBindInfo
*
bind_info
);
IWinInetInfo
*
get_wininet_info
(
IInternetProtocol
*
);
HRESULT
create_default_callback
(
IBindStatusCallback
**
);
HRESULT
wrap_callback
(
IBindStatusCallback
*
,
IBindStatusCallback
**
);
typedef
struct
ProtocolVtbl
ProtocolVtbl
;
...
...
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