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

Move BindToStorage hack to the separated function.

parent 58fdd892
...@@ -547,13 +547,12 @@ static void CALLBACK URLMON_InternetCallback(HINTERNET hinet, /*DWORD_PTR*/ DWOR ...@@ -547,13 +547,12 @@ static void CALLBACK URLMON_InternetCallback(HINTERNET hinet, /*DWORD_PTR*/ DWOR
/****************************************************************************** /******************************************************************************
* URLMoniker_BindToStorage * URLMoniker_BindToStorage
******************************************************************************/ ******************************************************************************/
static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, static HRESULT URLMonikerImpl_BindToStorage_hack(LPCWSTR URLName,
IBindCtx* pbc, IBindCtx* pbc,
IMoniker* pmkToLeft, IMoniker* pmkToLeft,
REFIID riid, REFIID riid,
VOID** ppvObject) VOID** ppvObject)
{ {
URLMonikerImpl *This = (URLMonikerImpl *)iface;
HRESULT hres; HRESULT hres;
BINDINFO bi; BINDINFO bi;
DWORD bindf; DWORD bindf;
...@@ -561,6 +560,9 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, ...@@ -561,6 +560,9 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
Binding *bind; Binding *bind;
int len; int len;
WARN("(%s %p %p %s %p)\n", debugstr_w(URLName), pbc, pmkToLeft, debugstr_guid(riid),
ppvObject);
if(pmkToLeft) { if(pmkToLeft) {
FIXME("pmkToLeft != NULL\n"); FIXME("pmkToLeft != NULL\n");
return E_NOTIMPL; return E_NOTIMPL;
...@@ -575,9 +577,9 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, ...@@ -575,9 +577,9 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
bind->ref = 1; bind->ref = 1;
URLMON_LockModule(); URLMON_LockModule();
len = lstrlenW(This->URLName)+1; len = lstrlenW(URLName)+1;
bind->URLName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); bind->URLName = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
memcpy(bind->URLName, This->URLName, len*sizeof(WCHAR)); memcpy(bind->URLName, URLName, len*sizeof(WCHAR));
hres = UMCreateStreamOnCacheFile(bind->URLName, 0, szFileName, &bind->hCacheFile, &bind->pstrCache); hres = UMCreateStreamOnCacheFile(bind->URLName, 0, szFileName, &bind->hCacheFile, &bind->pstrCache);
...@@ -855,6 +857,37 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface, ...@@ -855,6 +857,37 @@ static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
return hres; return hres;
} }
static HRESULT WINAPI URLMonikerImpl_BindToStorage(IMoniker* iface,
IBindCtx* pbc,
IMoniker* pmkToLeft,
REFIID riid,
VOID** ppvObject)
{
URLMonikerImpl *This = (URLMonikerImpl*)iface;
WCHAR schema[64];
BOOL bret;
URL_COMPONENTSW url = {sizeof(URL_COMPONENTSW), schema,
sizeof(schema)/sizeof(WCHAR), 0, NULL, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0};
bret = InternetCrackUrlW(This->URLName, 0, ICU_ESCAPE, &url);
if(!bret) {
ERR("InternetCrackUrl failed: %ld\n", GetLastError());
return E_FAIL;
}
if(url.nScheme == INTERNET_SCHEME_HTTP
|| url.nScheme== INTERNET_SCHEME_HTTPS
|| url.nScheme== INTERNET_SCHEME_FTP
|| url.nScheme == INTERNET_SCHEME_GOPHER
|| url.nScheme == INTERNET_SCHEME_FILE)
return URLMonikerImpl_BindToStorage_hack(This->URLName, pbc, pmkToLeft, riid, ppvObject);
FIXME("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
return E_NOTIMPL;
}
/****************************************************************************** /******************************************************************************
* URLMoniker_Reduce * URLMoniker_Reduce
******************************************************************************/ ******************************************************************************/
......
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