urlmon: Use proper IUri in BindToStorage implementation.

This commit is contained in:
Jacek Caban 2011-06-23 13:44:38 +02:00 committed by Alexandre Julliard
parent 649c1793c0
commit cca52128bd
2 changed files with 15 additions and 9 deletions

View file

@ -3582,6 +3582,8 @@ static void test_StdURLMoniker(void)
{
IMoniker *mon, *async_mon;
LPOLESTR display_name;
IBindCtx *bctx;
IUnknown *unk;
HRESULT hres;
hres = CoCreateInstance(&IID_IInternet, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
@ -3614,6 +3616,16 @@ static void test_StdURLMoniker(void)
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);
}

View file

@ -252,8 +252,6 @@ static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc,
IMoniker* pmkToLeft, REFIID riid, void **ppvObject)
{
URLMoniker *This = impl_from_IMoniker(iface);
IUri *uri;
HRESULT hres;
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,
if(pmkToLeft)
FIXME("Unsupported pmkToLeft\n");
hres = CreateUri(This->URLName, Uri_CREATE_FILE_USE_DOS_PATH, 0, &uri);
if(FAILED(hres))
return hres;
if(!This->uri)
return MK_E_SYNTAX;
hres = bind_to_storage(uri, pbc, riid, ppvObject);
IUri_Release(uri);
return hres;
return bind_to_storage(This->uri, pbc, riid, ppvObject);
}
static HRESULT WINAPI URLMoniker_Reduce(IMoniker *iface, IBindCtx *pbc,