From 040d41df2999b89817dd5aadc269bf00e143825b Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 9 May 2018 14:59:32 +0200 Subject: [PATCH] urlmon: Query for IWinInet[Http]Info on BindProtocol instead of protocol handler directly. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/urlmon/binding.c | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index 543c48289c6..c2879b21c5f 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -798,16 +798,11 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv); /* NOTE: This violidates COM rules, but tests prove that we should do it */ - if(!This->protocol->protocol_unk) - return E_NOINTERFACE; - - if(This->protocol->protocol_unk) { - hres = IUnknown_QueryInterface(This->protocol->protocol_unk, &IID_IWinInetInfo, - (void**)&wininet_info); - if(SUCCEEDED(hres)) { - IWinInetInfo_Release(wininet_info); - *ppv = &This->IWinInetHttpInfo_iface; - } + hres = IInternetProtocolEx_QueryInterface(&This->protocol->IInternetProtocolEx_iface, + &IID_IWinInetInfo, (void**)&wininet_info); + if(SUCCEEDED(hres)) { + IWinInetInfo_Release(wininet_info); + *ppv = &This->IWinInetHttpInfo_iface; } }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) { IWinInetHttpInfo *http_info; @@ -816,13 +811,11 @@ static HRESULT WINAPI Binding_QueryInterface(IBinding *iface, REFIID riid, void 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; - } + hres = IInternetProtocolEx_QueryInterface(&This->protocol->IInternetProtocolEx_iface, + &IID_IWinInetHttpInfo, (void**)&http_info); + if(SUCCEEDED(hres)) { + IWinInetHttpInfo_Release(http_info); + *ppv = &This->IWinInetHttpInfo_iface; } } @@ -1328,11 +1321,8 @@ static HRESULT WINAPI WinInetHttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD TRACE("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer); - if(!This->protocol->protocol_unk) - return E_FAIL; - - hres = IUnknown_QueryInterface(This->protocol->protocol_unk, &IID_IWinInetHttpInfo, - (void**)&wininet_info); + hres = IInternetProtocolEx_QueryInterface(&This->protocol->IInternetProtocolEx_iface, + &IID_IWinInetInfo, (void**)&wininet_info); if(FAILED(hres)) return E_FAIL; @@ -1350,11 +1340,8 @@ static HRESULT WINAPI WinInetHttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD d TRACE("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved); - if(!This->protocol->protocol_unk) - return E_FAIL; - - hres = IUnknown_QueryInterface(This->protocol->protocol_unk, &IID_IWinInetHttpInfo, - (void**)&http_info); + hres = IInternetProtocolEx_QueryInterface(&This->protocol->IInternetProtocolEx_iface, + &IID_IWinInetHttpInfo, (void**)&http_info); if(FAILED(hres)) return E_FAIL;