urlmon: Make start_binding more generic.
This commit is contained in:
parent
785e98173f
commit
ed1c7f8135
|
@ -1219,14 +1219,12 @@ static HRESULT Binding_Create(LPCWSTR url, IBindCtx *pbc, REFIID riid, Binding *
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
|
||||
static HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, Binding **ret)
|
||||
{
|
||||
Binding *binding = NULL;
|
||||
HRESULT hres;
|
||||
MSG msg;
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
hres = Binding_Create(url, pbc, riid, &binding);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
@ -1242,6 +1240,8 @@ HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
|
|||
hres = IInternetProtocol_Start(binding->protocol, url, PROTSINK(binding),
|
||||
BINDINF(binding), 0, 0);
|
||||
|
||||
TRACE("start ret %08x\n", hres);
|
||||
|
||||
if(FAILED(hres)) {
|
||||
WARN("Start failed: %08x\n", hres);
|
||||
|
||||
|
@ -1261,6 +1261,21 @@ HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
|
|||
}
|
||||
}
|
||||
|
||||
*ret = binding;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv)
|
||||
{
|
||||
Binding *binding;
|
||||
HRESULT hres;
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
hres = start_binding(url, pbc, riid, &binding);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(binding->stream->init_buf) {
|
||||
if(binding->state & BINDING_LOCKED)
|
||||
IInternetProtocol_UnlockRequest(binding->protocol);
|
||||
|
|
|
@ -743,7 +743,7 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
|
|||
|
||||
TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
|
||||
|
||||
return start_binding(This->URLName, pbc, riid, ppvObject);
|
||||
return bind_to_storage(This->URLName, pbc, riid, ppvObject);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -68,7 +68,7 @@ void UMCloseCacheFileStream(IUMCacheStream *pstr);
|
|||
IInternetProtocolInfo *get_protocol_info(LPCWSTR url);
|
||||
HRESULT get_protocol_handler(LPCWSTR url, CLSID *clsid, IClassFactory **ret);
|
||||
|
||||
HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
|
||||
HRESULT bind_to_storage(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
|
||||
|
||||
HRESULT create_binding_protocol(LPCWSTR url, BOOL from_urlmon, IInternetProtocol **protocol);
|
||||
void set_binding_sink(IInternetProtocol *bind_protocol, IInternetProtocolSink *sink);
|
||||
|
|
Loading…
Reference in New Issue