Commit b54ac3c6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Store BindProtocol as IInternetProtocolEx.

parent 5c61a34a
......@@ -42,7 +42,7 @@ typedef struct {
LONG ref;
IInternetProtocol *protocol;
IInternetProtocolEx *protocol;
BYTE buf[1024*8];
DWORD size;
......@@ -88,7 +88,7 @@ struct Binding {
LONG ref;
IBindStatusCallback *callback;
IInternetProtocol *protocol;
IInternetProtocolEx *protocol;
IServiceProvider *service_provider;
stgmed_buf_t *stgmed_buf;
......@@ -427,7 +427,7 @@ static const IUnknownVtbl StgMedUnkVtbl = {
StgMedUnk_Release
};
static stgmed_buf_t *create_stgmed_buf(IInternetProtocol *protocol)
static stgmed_buf_t *create_stgmed_buf(IInternetProtocolEx *protocol)
{
stgmed_buf_t *ret = heap_alloc(sizeof(*ret));
......@@ -1487,7 +1487,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, LPCWSTR url,
ret->protocol = binding_ctx->protocol;
IInternetProtocol_AddRef(ret->protocol);
}else {
hres = create_binding_protocol(url, TRUE, &ret->protocol);
hres = create_binding_protocol(TRUE, &ret->protocol);
if(FAILED(hres)) {
WARN("Could not get protocol handler\n");
IBinding_Release(BINDING(ret));
......
......@@ -388,7 +388,7 @@ static ULONG WINAPI BindProtocol_Release(IInternetProtocolEx *iface)
if(This->uri)
IUri_Release(This->uri);
set_binding_sink((IInternetProtocol*)PROTOCOLEX(This), NULL, NULL);
set_binding_sink(PROTOCOLEX(This), NULL, NULL);
if(This->notif_hwnd)
release_notif_hwnd(This->notif_hwnd);
......@@ -581,7 +581,7 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
if(urlmon_protocol)
IInternetProtocol_QueryInterface(protocol, &IID_IWinInetInfo, (void**)&This->wininet_info);
set_binding_sink((IInternetProtocol*)PROTOCOLEX(This), pOIProtSink, pOIBindInfo);
set_binding_sink(PROTOCOLEX(This), pOIProtSink, pOIBindInfo);
hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetPriority, (void**)&priority);
if(SUCCEEDED(hres)) {
......@@ -607,7 +607,7 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
return hres;
}
void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
void set_binding_sink(IInternetProtocolEx *bind_protocol, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
{
BindProtocol *This = PROTOCOL_THIS(bind_protocol);
IInternetProtocolSink *prev_sink;
......@@ -632,7 +632,7 @@ void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *s
IInternetBindInfo_Release(bind_info);
}
IWinInetInfo *get_wininet_info(IInternetProtocol *bind_protocol)
IWinInetInfo *get_wininet_info(IInternetProtocolEx *bind_protocol)
{
BindProtocol *This = PROTOCOL_THIS(bind_protocol);
......@@ -728,7 +728,7 @@ static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD
This->filter_proxy = NULL;
}
set_binding_sink((IInternetProtocol*)PROTOCOLEX(This), NULL, NULL);
set_binding_sink(PROTOCOLEX(This), NULL, NULL);
if(This->bind_info) {
IInternetBindInfo_Release(This->bind_info);
......@@ -1340,7 +1340,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
BPServiceProvider_QueryService
};
HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol **protocol)
HRESULT create_binding_protocol(BOOL from_urlmon, IInternetProtocolEx **protocol)
{
BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol));
......@@ -1361,6 +1361,6 @@ HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol
URLMON_LockModule();
*protocol = (IInternetProtocol*)PROTOCOLEX(ret);
*protocol = PROTOCOLEX(ret);
return S_OK;
}
......@@ -421,13 +421,21 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
LPBC pBC, LPCWSTR szUrl, IUnknown *pUnkOuter, IUnknown **ppUnk,
IInternetProtocol **ppOInetProt, DWORD dwOption)
{
IInternetProtocolEx *protocol;
HRESULT hres;
TRACE("(%p %s %p %p %p %08x)\n", pBC, debugstr_w(szUrl), pUnkOuter, ppUnk,
ppOInetProt, dwOption);
if(pBC || pUnkOuter || ppUnk || dwOption)
FIXME("Unsupported arguments\n");
return create_binding_protocol(szUrl, FALSE, ppOInetProt);
hres = create_binding_protocol(FALSE, &protocol);
if(FAILED(hres))
return hres;
*ppOInetProt = (IInternetProtocol*)protocol;
return S_OK;
}
static HRESULT WINAPI InternetSession_SetSessionOption(IInternetSession *iface,
......
......@@ -77,9 +77,9 @@ void free_session(void);
HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
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_binding_protocol(BOOL,IInternetProtocolEx**);
void set_binding_sink(IInternetProtocolEx*,IInternetProtocolSink*,IInternetBindInfo*);
IWinInetInfo *get_wininet_info(IInternetProtocolEx*);
HRESULT create_default_callback(IBindStatusCallback**);
HRESULT wrap_callback(IBindStatusCallback*,IBindStatusCallback**);
......
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