Commit da6dbedb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Release protocol sink in Terminate.

parent 2afdc8f5
...@@ -36,6 +36,8 @@ typedef struct { ...@@ -36,6 +36,8 @@ typedef struct {
IServiceProvider *service_provider; IServiceProvider *service_provider;
LONG priority; LONG priority;
BOOL reported_result;
} BindProtocol; } BindProtocol;
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl) #define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
...@@ -205,7 +207,18 @@ static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocol *iface, DWORD dwO ...@@ -205,7 +207,18 @@ static HRESULT WINAPI BindProtocol_Terminate(IInternetProtocol *iface, DWORD dwO
TRACE("(%p)->(%08x)\n", This, dwOptions); TRACE("(%p)->(%08x)\n", This, dwOptions);
if(!This->reported_result)
return E_FAIL;
IInternetProtocol_Terminate(This->protocol, 0); IInternetProtocol_Terminate(This->protocol, 0);
set_binding_sink(PROTOCOL(This), NULL);
if(This->bind_info) {
IInternetBindInfo_Release(This->bind_info);
This->bind_info = NULL;
}
return S_OK; return S_OK;
} }
...@@ -440,6 +453,14 @@ static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface ...@@ -440,6 +453,14 @@ static HRESULT WINAPI BPInternetProtocolSink_Switch(IInternetProtocolSink *iface
TRACE("(%p)->(%p)\n", This, pProtocolData); TRACE("(%p)->(%p)\n", This, pProtocolData);
TRACE("flags %x state %x data %p cb %u\n", pProtocolData->grfFlags, pProtocolData->dwState,
pProtocolData->pData, pProtocolData->cbData);
if(!This->protocol_sink) {
IInternetProtocol_Continue(This->protocol, pProtocolData);
return S_OK;
}
return IInternetProtocolSink_Switch(This->protocol_sink, pProtocolData); return IInternetProtocolSink_Switch(This->protocol_sink, pProtocolData);
} }
...@@ -482,6 +503,9 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *i ...@@ -482,6 +503,9 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportData(IInternetProtocolSink *i
TRACE("(%p)->(%d %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax); TRACE("(%p)->(%d %u %u)\n", This, grfBSCF, ulProgress, ulProgressMax);
if(!This->protocol_sink)
return S_OK;
return IInternetProtocolSink_ReportData(This->protocol_sink, grfBSCF, ulProgress, ulProgressMax); return IInternetProtocolSink_ReportData(This->protocol_sink, grfBSCF, ulProgress, ulProgressMax);
} }
...@@ -492,6 +516,11 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink ...@@ -492,6 +516,11 @@ static HRESULT WINAPI BPInternetProtocolSink_ReportResult(IInternetProtocolSink
TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult)); TRACE("(%p)->(%08x %d %s)\n", This, hrResult, dwError, debugstr_w(szResult));
if(!This->protocol_sink)
return E_FAIL;
This->reported_result = TRUE;
return IInternetProtocolSink_ReportResult(This->protocol_sink, hrResult, dwError, szResult); return IInternetProtocolSink_ReportResult(This->protocol_sink, hrResult, dwError, szResult);
} }
......
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