urlmon: Don't store IWinInetHttpInfo reference in BindProtocol.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-05-08 18:18:11 +02:00 committed by Alexandre Julliard
parent 357da1e8a6
commit 73fd4b09ae
3 changed files with 24 additions and 13 deletions

View File

@ -800,12 +800,20 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void
*ppv = &This->IWinInetHttpInfo_iface;
}else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
IWinInetHttpInfo *http_info;
HRESULT hres;
TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
if(!This->protocol->wininet_http_info)
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) {
@ -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 = {

View File

@ -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);

View File

@ -179,7 +179,6 @@ typedef struct {
IUnknown *protocol_unk;
IInternetProtocol *protocol;
IWinInetInfo *wininet_info;
IWinInetHttpInfo *wininet_http_info;
IInternetBindInfo *bind_info;
IInternetProtocolSink *protocol_sink;