Jacek Caban : urlmon: Make start_binding more generic.
Alexandre Julliard
julliard at winehq.org
Mon Dec 31 12:32:20 CST 2007
Module: wine
Branch: master
Commit: ed1c7f8135c940190b869c47e87112ed0ec44d1f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ed1c7f8135c940190b869c47e87112ed0ec44d1f
Author: Jacek Caban <jacek at codeweavers.com>
Date: Sun Dec 30 17:42:17 2007 +0100
urlmon: Make start_binding more generic.
---
dlls/urlmon/binding.c | 21 ++++++++++++++++++---
dlls/urlmon/umon.c | 2 +-
dlls/urlmon/urlmon_main.h | 2 +-
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c
index 4c2de3c..ca83537 100644
--- a/dlls/urlmon/binding.c
+++ b/dlls/urlmon/binding.c
@@ -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);
diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c
index 7b4a772..51ad270 100644
--- a/dlls/urlmon/umon.c
+++ b/dlls/urlmon/umon.c
@@ -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);
}
/******************************************************************************
diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h
index 0c64124..6508049 100644
--- a/dlls/urlmon/urlmon_main.h
+++ b/dlls/urlmon/urlmon_main.h
@@ -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);
More information about the wine-cvs
mailing list