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