Commit 43c19928 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

urlmon: If ProtocolCF_CreateInstance doesn't support aggregation retry without it.

This patch fixes a regression caused by 097811f2. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47190Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 97529298
......@@ -509,15 +509,19 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
hres = IClassFactory_CreateInstance(cf, (IUnknown*)&This->IInternetBindInfo_iface,
&IID_IUnknown, (void**)&protocol_unk);
IClassFactory_Release(cf);
if(FAILED(hres))
return hres;
if(SUCCEEDED(hres)) {
hres = IUnknown_QueryInterface(protocol_unk, &IID_IInternetProtocol, (void**)&protocol);
if(FAILED(hres)) {
if(SUCCEEDED(hres))
This->protocol_unk = protocol_unk;
else
IUnknown_Release(protocol_unk);
return hres;
}
else if(hres == CLASS_E_NOAGGREGATION)
hres = IClassFactory_CreateInstance(cf, NULL, &IID_IInternetProtocol, (void**)&protocol);
IClassFactory_Release(cf);
if(FAILED(hres))
return hres;
}
StringFromCLSID(&clsid, &clsid_str);
......@@ -703,9 +707,12 @@ static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD
if(This->protocol) {
IInternetProtocol_Terminate(This->protocol, 0);
if (This->protocol_unk) {
IInternetProtocol_Release(This->protocol);
This->protocol = NULL;
}
}
set_binding_sink(This, NULL, NULL);
......
......@@ -3875,9 +3875,7 @@ static void test_CreateBinding(void)
trace("Start >\n");
expect_hrResult = S_OK;
hres = IInternetProtocol_Start(protocol, test_url, &protocol_sink, &bind_info, 0, 0);
todo_wine_if (no_aggregation)
ok(hres == S_OK, "Start failed: %08x\n", hres);
if (hres != S_OK) goto fail;
trace("Start <\n");
CHECK_CALLED(QueryService_InternetProtocol);
......@@ -4025,7 +4023,6 @@ todo_wine_if (no_aggregation)
ok(hres == MK_E_SYNTAX, "Start failed: %08x, expected MK_E_SYNTAX\n", hres);
CHECK_CALLED(QueryService_InternetProtocol);
fail:
IInternetProtocol_Release(protocol);
IInternetSession_Release(session);
......
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