urlmon: Use COM aggregation for urlmon protocols in BindProtocol::StartEx.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5082e4df25
commit
097811f251
|
@ -1510,7 +1510,7 @@ static HRESULT Binding_Create(IMoniker *mon, Binding *binding_ctx, IUri *uri, IB
|
|||
ret->protocol = binding_ctx->protocol;
|
||||
IInternetProtocolEx_AddRef(&ret->protocol->IInternetProtocolEx_iface);
|
||||
}else {
|
||||
hres = create_binding_protocol(TRUE, &ret->protocol);
|
||||
hres = create_binding_protocol(&ret->protocol);
|
||||
if(FAILED(hres)) {
|
||||
WARN("Could not get protocol handler\n");
|
||||
IBinding_Release(&ret->IBinding_iface);
|
||||
|
|
|
@ -528,25 +528,16 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
|
|||
if(FAILED(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,
|
||||
&IID_IUnknown, (void**)&protocol_unk);
|
||||
IClassFactory_Release(cf);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
hres = IClassFactory_CreateInstance(cf, (IUnknown*)&This->IInternetBindInfo_iface,
|
||||
&IID_IUnknown, (void**)&protocol_unk);
|
||||
IClassFactory_Release(cf);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
|
||||
if(FAILED(hres)) {
|
||||
IUnknown_Release(protocol_unk);
|
||||
return hres;
|
||||
}
|
||||
hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
|
||||
if(FAILED(hres)) {
|
||||
IUnknown_Release(protocol_unk);
|
||||
return hres;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1508,7 +1499,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
|
|||
BPServiceProvider_QueryService
|
||||
};
|
||||
|
||||
HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol)
|
||||
HRESULT create_binding_protocol(BindProtocol **protocol)
|
||||
{
|
||||
BindProtocol *ret = heap_alloc_zero(sizeof(BindProtocol));
|
||||
|
||||
|
@ -1523,7 +1514,6 @@ HRESULT create_binding_protocol(BOOL from_urlmon, BindProtocol **protocol)
|
|||
ret->default_protocol_handler.IInternetProtocolSink_iface.lpVtbl = &InternetProtocolSinkHandlerVtbl;
|
||||
|
||||
ret->ref = 1;
|
||||
ret->from_urlmon = from_urlmon;
|
||||
ret->apartment_thread = GetCurrentThreadId();
|
||||
ret->notif_hwnd = get_notif_hwnd();
|
||||
ret->protocol_handler = &ret->default_protocol_handler.IInternetProtocol_iface;
|
||||
|
|
|
@ -439,7 +439,7 @@ static HRESULT WINAPI InternetSession_CreateBinding(IInternetSession *iface,
|
|||
if(pBC || pUnkOuter || ppUnk || dwOption)
|
||||
FIXME("Unsupported arguments\n");
|
||||
|
||||
hres = create_binding_protocol(FALSE, &protocol);
|
||||
hres = create_binding_protocol(&protocol);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
|
|
|
@ -2402,8 +2402,8 @@ static HRESULT WINAPI ProtocolCF_CreateInstance(IClassFactory *iface, IUnknown *
|
|||
if(IsEqualGUID(&IID_IInternetProtocolInfo, riid))
|
||||
return E_NOINTERFACE;
|
||||
|
||||
todo_wine ok(outer != NULL, "outer == NULL\n");
|
||||
todo_wine ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
||||
ok(outer != NULL, "outer == NULL\n");
|
||||
ok(IsEqualGUID(&IID_IUnknown, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
|
||||
*ppv = &Protocol;
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -195,7 +195,6 @@ typedef struct {
|
|||
|
||||
BOOL reported_result;
|
||||
BOOL reported_mime;
|
||||
BOOL from_urlmon;
|
||||
DWORD pi;
|
||||
|
||||
DWORD bscf;
|
||||
|
@ -216,7 +215,7 @@ typedef struct {
|
|||
BSTR display_uri;
|
||||
} 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;
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Reference in New Issue