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

urlmon: Use proper IUri in BindToStorage implementation.

parent 649c1793
...@@ -3582,6 +3582,8 @@ static void test_StdURLMoniker(void) ...@@ -3582,6 +3582,8 @@ static void test_StdURLMoniker(void)
{ {
IMoniker *mon, *async_mon; IMoniker *mon, *async_mon;
LPOLESTR display_name; LPOLESTR display_name;
IBindCtx *bctx;
IUnknown *unk;
HRESULT hres; HRESULT hres;
hres = CoCreateInstance(&IID_IInternet, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, hres = CoCreateInstance(&IID_IInternet, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
...@@ -3614,6 +3616,16 @@ static void test_StdURLMoniker(void) ...@@ -3614,6 +3616,16 @@ static void test_StdURLMoniker(void)
IUriContainer_Release(uri_container); IUriContainer_Release(uri_container);
} }
SET_EXPECT(QueryInterface_IServiceProvider);
hres = CreateAsyncBindCtx(0, (IBindStatusCallback*)&bsc, NULL, &bctx);
ok(hres == S_OK, "CreateAsyncBindCtx failed: %08x\n\n", hres);
CHECK_CALLED(QueryInterface_IServiceProvider);
unk = (void*)0xdeadbeef;
hres = IMoniker_BindToStorage(mon, bctx, NULL, &IID_IStream, (void**)&unk);
ok(hres == MK_E_SYNTAX, "BindToStorage failed: %08x, expected MK_E_SYNTAX\n", hres);
ok(!unk, "unk = %p\n", unk);
IMoniker_Release(mon); IMoniker_Release(mon);
} }
......
...@@ -252,8 +252,6 @@ static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc, ...@@ -252,8 +252,6 @@ static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc,
IMoniker* pmkToLeft, REFIID riid, void **ppvObject) IMoniker* pmkToLeft, REFIID riid, void **ppvObject)
{ {
URLMoniker *This = impl_from_IMoniker(iface); URLMoniker *This = impl_from_IMoniker(iface);
IUri *uri;
HRESULT hres;
TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject); TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObject);
...@@ -264,14 +262,10 @@ static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc, ...@@ -264,14 +262,10 @@ static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc,
if(pmkToLeft) if(pmkToLeft)
FIXME("Unsupported pmkToLeft\n"); FIXME("Unsupported pmkToLeft\n");
hres = CreateUri(This->URLName, Uri_CREATE_FILE_USE_DOS_PATH, 0, &uri); if(!This->uri)
if(FAILED(hres)) return MK_E_SYNTAX;
return hres;
hres = bind_to_storage(uri, pbc, riid, ppvObject);
IUri_Release(uri); return bind_to_storage(This->uri, pbc, riid, ppvObject);
return hres;
} }
static HRESULT WINAPI URLMoniker_Reduce(IMoniker *iface, IBindCtx *pbc, static HRESULT WINAPI URLMoniker_Reduce(IMoniker *iface, IBindCtx *pbc,
......
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