Commit 097811f2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Use COM aggregation for urlmon protocols in BindProtocol::StartEx.

parent 5082e4df
...@@ -1510,7 +1510,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB ...@@ -1510,7 +1510,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB
ret->protocol = binding_ctx->protocol; ret->protocol = binding_ctx->protocol;
IInternetProtocolEx_AddRef(&ret->protocol->IInternetProtocolEx_iface); IInternetProtocolEx_AddRef(&ret->protocol->IInternetProtocolEx_iface);
}else { }else {
hres = create_binding_protocol(TRUE, &ret->protocol); hres = create_binding_protocol(&ret->protocol);
if(FAILED(hres)) { if(FAILED(hres)) {
WARN("Could not get protocol handler\n"); WARN("Could not get protocol handler\n");
IBinding_Release(&ret->IBinding_iface); IBinding_Release(&ret->IBinding_iface);
......
...@@ -528,14 +528,6 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr ...@@ -528,14 +528,6 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
if(This->from_urlmon) {
hres = IClassFactory_CreateInstance(cf, NULL, &IID_IInternetProtocol, (void**)&protocol);
IClassFactory_Release(cf);
if(FAILED(hres))
return hres;
protocol_unk = (IUnknown*)protocol;
IUnknown_AddRef(protocol_unk);
}else {
hres = IClassFactory_CreateInstance(cf, (IUnknown*)&This->IInternetBindInfo_iface, hres = IClassFactory_CreateInstance(cf, (IUnknown*)&This->IInternetBindInfo_iface,
&IID_IUnknown, (void**)&protocol_unk); &IID_IUnknown, (void**)&protocol_unk);
IClassFactory_Release(cf); IClassFactory_Release(cf);
...@@ -548,7 +540,6 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr ...@@ -548,7 +540,6 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
return hres; return hres;
} }
} }
}
StringFromCLSID(&clsid, &clsid_str); StringFromCLSID(&clsid, &clsid_str);
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_PROTOCOLCLASSID, clsid_str); IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_PROTOCOLCLASSID, clsid_str);
...@@ -1508,7 +1499,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = { ...@@ -1508,7 +1499,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
BPServiceProvider_QueryService BPServiceProvider_QueryService
}; };
HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol) HRESULT create_binding_protocol(BindProtocol **protocol)
{ {
BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol)); BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol));
...@@ -1523,7 +1514,6 @@ HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol) ...@@ -1523,7 +1514,6 @@ HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol)
ret->default_protocol_handler.IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkHandlerVtbl; ret->default_protocol_handler.IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkHandlerVtbl;
ret->ref = 1; ret->ref = 1;
ret->from_urlmon = from_urlmon;
ret->apartment_thread = GetCurrentThreadId(); ret->apartment_thread = GetCurrentThreadId();
ret->notif_hwnd = get_notif_hwnd(); ret->notif_hwnd = get_notif_hwnd();
ret->protocol_handler = &ret->default_protocol_handler.IInternetProtocol_iface; ret->protocol_handler = &ret->default_protocol_handler.IInternetProtocol_iface;
......
...@@ -439,7 +439,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface, ...@@ -439,7 +439,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
if(pBC || pUnkOuter || ppUnk || dwOption) if(pBC || pUnkOuter || ppUnk || dwOption)
FIXME("Unsupported arguments\n"); FIXME("Unsupported arguments\n");
hres = create_binding_protocol(FALSE, &protocol); hres = create_binding_protocol(&protocol);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -2402,8 +2402,8 @@ static HRESULT WINAPI ProtocolCF_CreateInstance(IClassFactory *iface, IUnknown * ...@@ -2402,8 +2402,8 @@ static HRESULT WINAPI ProtocolCF_CreateInstance(IClassFactory *iface, IUnknown *
if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
return E_NOINTERFACE; return E_NOINTERFACE;
todo_wine ok(outer != NULL, "outer == NULL\n"); ok(outer != NULL, "outer == NULL\n");
todo_wine ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid)); ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
*ppv = &Protocol; *ppv = &Protocol;
return S_OK; return S_OK;
} }
......
...@@ -195,7 +195,6 @@ typedef struct { ...@@ -195,7 +195,6 @@ typedef struct {
BOOL reported_result; BOOL reported_result;
BOOL reported_mime; BOOL reported_mime;
BOOL from_urlmon;
DWORD pi; DWORD pi;
DWORD bscf; DWORD bscf;
...@@ -216,7 +215,7 @@ typedef struct { ...@@ -216,7 +215,7 @@ typedef struct {
BSTR display_uri; BSTR display_uri;
} BindProtocol; } BindProtocol;
HRESULT create_binding_protocol(BOOL,BindProtocol**) DECLSPEC_HIDDEN; HRESULT create_binding_protocol(BindProtocol**) DECLSPEC_HIDDEN;
void set_binding_sink(BindProtocol*,IInternetProtocolSink*,IInternetBindInfo*) DECLSPEC_HIDDEN; void set_binding_sink(BindProtocol*,IInternetProtocolSink*,IInternetBindInfo*) DECLSPEC_HIDDEN;
typedef struct { typedef struct {
......
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