urlmon: Call IInternetProtocolSink_AddRef in HttpProtocol where native does (but just once).

This commit is contained in:
Misha Koshelev 2007-08-16 00:02:06 -05:00 committed by Alexandre Julliard
parent 5cdfee8153
commit c8ab2a947c
1 changed files with 6 additions and 6 deletions

View File

@ -321,6 +321,9 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink, TRACE("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink,
pOIBindInfo, grfPI, dwReserved); pOIBindInfo, grfPI, dwReserved);
IInternetProtocolSink_AddRef(pOIProtSink);
This->protocol_sink = pOIProtSink;
memset(&This->bind_info, 0, sizeof(This->bind_info)); memset(&This->bind_info, 0, sizeof(This->bind_info));
This->bind_info.cbSize = sizeof(BINDINFO); This->bind_info.cbSize = sizeof(BINDINFO);
hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &This->grfBINDF, &This->bind_info); hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &This->grfBINDF, &This->bind_info);
@ -354,7 +357,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
url.nPort = INTERNET_DEFAULT_HTTP_PORT; url.nPort = INTERNET_DEFAULT_HTTP_PORT;
if(!(This->grfBINDF & BINDF_FROMURLMON)) if(!(This->grfBINDF & BINDF_FROMURLMON))
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DIRECTBIND, NULL); IInternetProtocolSink_ReportProgress(This->protocol_sink, BINDSTATUS_DIRECTBIND, NULL);
hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT, &user_agent, hres = IInternetBindInfo_GetBindString(pOIBindInfo, BINDSTRING_USER_AGENT, &user_agent,
1, &num); 1, &num);
@ -393,9 +396,6 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
goto done; goto done;
} }
IInternetProtocolSink_AddRef(pOIProtSink);
This->protocol_sink = pOIProtSink;
/* Native does not check for success of next call, so we won't either */ /* Native does not check for success of next call, so we won't either */
InternetSetStatusCallbackW(This->internet, HTTPPROTOCOL_InternetStatusCallback); InternetSetStatusCallbackW(This->internet, HTTPPROTOCOL_InternetStatusCallback);
@ -434,7 +434,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
goto done; goto done;
} }
hres = IInternetProtocolSink_QueryInterface(pOIProtSink, &IID_IServiceProvider, hres = IInternetProtocolSink_QueryInterface(This->protocol_sink, &IID_IServiceProvider,
(void **)&service_provider); (void **)&service_provider);
if (hres != S_OK) if (hres != S_OK)
{ {
@ -533,7 +533,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
done: done:
if (hres != S_OK) if (hres != S_OK)
{ {
IInternetProtocolSink_ReportResult(pOIProtSink, hres, 0, NULL); IInternetProtocolSink_ReportResult(This->protocol_sink, hres, 0, NULL);
HTTPPROTOCOL_Close(This); HTTPPROTOCOL_Close(This);
} }