Commit 39f2c630 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Replace also bind_info in set_binding_sink.

parent 93e6ca87
...@@ -1077,8 +1077,11 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres ...@@ -1077,8 +1077,11 @@ static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progres
} }
if(This->to_object) { if(This->to_object) {
if(!(This->state & BINDING_OBJAVAIL)) if(!(This->state & BINDING_OBJAVAIL)) {
IBinding_AddRef(BINDING(This));
create_object(This); create_object(This);
IBinding_Release(BINDING(This));
}
}else { }else {
STGMEDIUM stgmed; STGMEDIUM stgmed;
HRESULT hres; HRESULT hres;
...@@ -1519,7 +1522,7 @@ static HRESULT start_binding(IMoniker *mon, Binding *binding_ctx, LPCWSTR url, I ...@@ -1519,7 +1522,7 @@ static HRESULT start_binding(IMoniker *mon, Binding *binding_ctx, LPCWSTR url, I
} }
if(binding_ctx) { if(binding_ctx) {
set_binding_sink(binding->protocol, PROTSINK(binding)); set_binding_sink(binding->protocol, PROTSINK(binding), BINDINF(binding));
if(binding_ctx->redirect_url) if(binding_ctx->redirect_url)
IBindStatusCallback_OnProgress(binding->callback, 0, 0, BINDSTATUS_REDIRECTING, binding_ctx->redirect_url); IBindStatusCallback_OnProgress(binding->callback, 0, 0, BINDSTATUS_REDIRECTING, binding_ctx->redirect_url);
report_data(binding, 0, 0, 0); report_data(binding, 0, 0, 0);
......
...@@ -382,7 +382,7 @@ static ULONG WINAPI BindProtocol_Release(IInternetProtocol *iface) ...@@ -382,7 +382,7 @@ static ULONG WINAPI BindProtocol_Release(IInternetProtocol *iface)
if(This->filter_proxy) if(This->filter_proxy)
IInternetProtocol_Release(PROTOCOL(This->filter_proxy)); IInternetProtocol_Release(PROTOCOL(This->filter_proxy));
set_binding_sink(PROTOCOL(This), NULL); set_binding_sink(PROTOCOL(This), NULL, NULL);
if(This->notif_hwnd) if(This->notif_hwnd)
release_notif_hwnd(This->notif_hwnd); release_notif_hwnd(This->notif_hwnd);
...@@ -488,7 +488,7 @@ static HRESULT WINAPI BindProtocol_UnlockRequest(IInternetProtocol *iface) ...@@ -488,7 +488,7 @@ static HRESULT WINAPI BindProtocol_UnlockRequest(IInternetProtocol *iface)
return IInternetProtocol_UnlockRequest(This->protocol_handler); return IInternetProtocol_UnlockRequest(This->protocol_handler);
} }
void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink) void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink, IInternetBindInfo *bind_info)
{ {
BindProtocol *This = PROTOCOL_THIS(bind_protocol); BindProtocol *This = PROTOCOL_THIS(bind_protocol);
IInternetProtocolSink *prev_sink; IInternetProtocolSink *prev_sink;
...@@ -505,6 +505,12 @@ void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *s ...@@ -505,6 +505,12 @@ void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *s
service_provider = InterlockedExchangePointer((void**)&This->service_provider, service_provider); service_provider = InterlockedExchangePointer((void**)&This->service_provider, service_provider);
if(service_provider) if(service_provider)
IServiceProvider_Release(service_provider); IServiceProvider_Release(service_provider);
if(bind_info)
IInternetBindInfo_AddRef(bind_info);
bind_info = InterlockedExchangePointer((void**)&This->bind_info, bind_info);
if(bind_info)
IInternetBindInfo_Release(bind_info);
} }
IWinInetInfo *get_wininet_info(IInternetProtocol *bind_protocol) IWinInetInfo *get_wininet_info(IInternetProtocol *bind_protocol)
...@@ -619,10 +625,7 @@ static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR sz ...@@ -619,10 +625,7 @@ static HRESULT WINAPI ProtocolHandler_Start(IInternetProtocol *iface, LPCWSTR sz
if(urlmon_protocol) if(urlmon_protocol)
IInternetProtocol_QueryInterface(protocol, &IID_IWinInetInfo, (void**)&This->wininet_info); IInternetProtocol_QueryInterface(protocol, &IID_IWinInetInfo, (void**)&This->wininet_info);
IInternetBindInfo_AddRef(pOIBindInfo); set_binding_sink(PROTOCOL(This), pOIProtSink, pOIBindInfo);
This->bind_info = pOIBindInfo;
set_binding_sink(PROTOCOL(This), pOIProtSink);
hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetPriority, (void**)&priority); hres = IInternetProtocol_QueryInterface(protocol, &IID_IInternetPriority, (void**)&priority);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
...@@ -670,7 +673,7 @@ static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD ...@@ -670,7 +673,7 @@ static HRESULT WINAPI ProtocolHandler_Terminate(IInternetProtocol *iface, DWORD
This->filter_proxy = NULL; This->filter_proxy = NULL;
} }
set_binding_sink(PROTOCOL(This), NULL); set_binding_sink(PROTOCOL(This), NULL, NULL);
if(This->bind_info) { if(This->bind_info) {
IInternetBindInfo_Release(This->bind_info); IInternetBindInfo_Release(This->bind_info);
......
...@@ -2674,13 +2674,11 @@ static void test_BindToObject(int protocol, DWORD flags) ...@@ -2674,13 +2674,11 @@ static void test_BindToObject(int protocol, DWORD flags)
CHECK_CALLED(Obj_OnStopBinding); CHECK_CALLED(Obj_OnStopBinding);
} }
if(test_protocol != HTTP_TEST || emulate_protocol || !(bindf & BINDF_ASYNCHRONOUS)) { ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n"); if(test_protocol != HTTP_TEST || emulate_protocol || !(bindf & BINDF_ASYNCHRONOUS))
ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n"); ok(IBindCtx_Release(bctx) == 0, "bctx should be destroyed here\n");
}else { else
todo_wine ok(IMoniker_Release(mon) == 0, "mon should be destroyed here\n");
IBindCtx_Release(bctx); IBindCtx_Release(bctx);
}
if(emulate_protocol) if(emulate_protocol)
CoRevokeClassObject(regid); CoRevokeClassObject(regid);
......
...@@ -78,7 +78,7 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv); ...@@ -78,7 +78,7 @@ HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv); HRESULT bind_to_object(IMoniker *mon, LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol **protocol); HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol **protocol);
void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink); void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink, IInternetBindInfo *bind_info);
IWinInetInfo *get_wininet_info(IInternetProtocol*); IWinInetInfo *get_wininet_info(IInternetProtocol*);
typedef struct ProtocolVtbl ProtocolVtbl; typedef struct ProtocolVtbl ProtocolVtbl;
......
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