Commit 73fd4b09 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Don't store IWinInetHttpInfo reference in BindProtocol.

parent 357da1e8
......@@ -800,13 +800,21 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void
*ppv = &This->IWinInetHttpInfo_iface;
}else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
IWinInetHttpInfo *http_info;
HRESULT hres;
if(!This->protocol->wininet_http_info)
return E_NOINTERFACE;
TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
/* NOTE: This violidates COM rules, but tests prove that we should do it */
if(This->protocol->protocol_unk) {
hres = IUnknown_QueryInterface(This->protocol->protocol_unk, &IID_IWinInetHttpInfo,
(void**)&http_info);
if(SUCCEEDED(hres)) {
IWinInetHttpInfo_Release(http_info);
*ppv = &This->IWinInetHttpInfo_iface;
}
}
}
if(*ppv) {
IBinding_AddRef(&This->IBinding_iface);
......@@ -1318,13 +1326,22 @@ static HRESULT WINAPI WinInetHttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD d
void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
{
Binding *This = impl_from_IWinInetHttpInfo(iface);
IWinInetHttpInfo *http_info;
HRESULT hres;
TRACE("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
if(!This->protocol->wininet_http_info)
if(!This->protocol->protocol_unk)
return E_FAIL;
return IWinInetHttpInfo_QueryInfo(This->protocol->wininet_http_info,
dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
hres = IUnknown_QueryInterface(This->protocol->protocol_unk, &IID_IWinInetHttpInfo,
(void**)&http_info);
if(FAILED(hres))
return E_FAIL;
hres = IWinInetHttpInfo_QueryInfo(http_info, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
IWinInetHttpInfo_Release(http_info);
return hres;
}
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = {
......
......@@ -334,10 +334,6 @@ static void release_protocol_handler(BindProtocol *This)
IWinInetInfo_Release(This->wininet_info);
This->wininet_info = NULL;
}
if(This->wininet_http_info) {
IWinInetHttpInfo_Release(This->wininet_http_info);
This->wininet_http_info = NULL;
}
if(This->protocol_unk) {
IUnknown_Release(This->protocol_unk);
This->protocol_unk = NULL;
......@@ -568,7 +564,6 @@ static HRESULT WINAPI BindProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
if(urlmon_protocol) {
IInternetProtocol_QueryInterface(protocol, &IID_IWinInetInfo, (void**)&This->wininet_info);
IInternetProtocol_QueryInterface(protocol, &IID_IWinInetHttpInfo, (void**)&This->wininet_http_info);
}
set_binding_sink(This, pOIProtSink, pOIBindInfo);
......
......@@ -179,7 +179,6 @@ typedef struct {
IUnknown *protocol_unk;
IInternetProtocol *protocol;
IWinInetInfo *wininet_info;
IWinInetHttpInfo *wininet_http_info;
IInternetBindInfo *bind_info;
IInternetProtocolSink *protocol_sink;
......
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