| Index: src/plugin/PluginWbPassThrough.cpp |
| =================================================================== |
| --- a/src/plugin/PluginWbPassThrough.cpp |
| +++ b/src/plugin/PluginWbPassThrough.cpp |
| @@ -233,7 +233,7 @@ |
| } |
| *pcbRead = 0; |
| - if (PassthroughAPP::CustomSinkStartPolicy<WBPassthru, WBPassthruSink>::GetProtocol(this)->m_shouldSupplyCustomContent) |
| + if (PassthroughAPP::CustomSinkStartPolicy<WbPassthroughProtocol, WBPassthruSink>::GetProtocol(this)->m_shouldSupplyCustomContent) |
| { |
| ULONG blockedByABPPageSize = static_cast<ULONG>(g_blockedByABPPage.size()); |
| auto positionGrow = std::min<ULONG>(cb, static_cast<ULONG>(blockedByABPPageSize - m_currentPositionOfSentPage)); |
| @@ -417,13 +417,24 @@ |
| return BaseClass::ReportResult(hrResult, dwError, szResult); |
| } |
| - |
| -WBPassthru::WBPassthru() |
| - : m_shouldSupplyCustomContent(false) |
| +HRESULT WbPassthroughSinkStartPolicy::OnStart(LPCWSTR szUrl, |
| + IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, |
| + DWORD grfPI, HANDLE_PTR dwReserved, |
| + IInternetProtocol* pTargetProtocol) |
| { |
| + HRESULT hr = BaseClass::OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, pTargetProtocol); |
| + WBPassthruSink* pSink = GetSink(); |
| + if (hr == E_ABORT && pSink->m_isCustomResponse) |
|
Oleksandr
2015/12/16 13:33:30
I am actually not even sure we need this clause at
|
| + { |
| + GetProtocol(pSink)->m_shouldSupplyCustomContent = true; |
| + pSink->m_spInternetProtocolSink->ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE, L"text/html"); |
| + pSink->m_spInternetProtocolSink->ReportData(BSCF_FIRSTDATANOTIFICATION, 0, static_cast<ULONG>(g_blockedByABPPage.size())); |
| + return S_OK; |
| + } |
| + return hr; |
| } |
| -STDMETHODIMP WBPassthru::Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, |
| +STDMETHODIMP WbPassthroughProtocol::Start(LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, |
| IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved) |
| { |
| ATLASSERT(m_spInternetProtocol != 0); |
| @@ -435,7 +446,7 @@ |
| return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInternetProtocol); |
| } |
| -STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead) |
| +STDMETHODIMP WbPassthroughProtocol::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [out] */ ULONG *pcbRead) |
| { |
| WBPassthruSink* pSink = GetSink(); |
| return pSink->OnRead(pv, cb, pcbRead); |