urlmon: Use proper IUri in BindToObject implementation.

This commit is contained in:
Jacek Caban 2011-06-23 13:44:57 +02:00 committed by Alexandre Julliard
parent cca52128bd
commit 8646cd772b
2 changed files with 10 additions and 8 deletions

View File

@ -3626,6 +3626,11 @@ static void test_StdURLMoniker(void)
ok(hres == MK_E_SYNTAX, "BindToStorage failed: %08x, expected MK_E_SYNTAX\n", hres);
ok(!unk, "unk = %p\n", unk);
unk = (void*)0xdeadbeef;
hres = IMoniker_BindToObject(mon, bctx, NULL, &IID_IUnknown, (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

@ -227,7 +227,6 @@ static HRESULT WINAPI URLMoniker_BindToObject(IMoniker *iface, IBindCtx* pbc, IM
{
URLMoniker *This = impl_from_IMoniker(iface);
IRunningObjectTable *obj_tbl;
IUri *uri;
HRESULT hres;
TRACE("(%p)->(%p,%p,%s,%p): stub\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppv);
@ -238,14 +237,12 @@ static HRESULT WINAPI URLMoniker_BindToObject(IMoniker *iface, IBindCtx* pbc, IM
IRunningObjectTable_Release(obj_tbl);
}
hres = CreateUri(This->URLName, Uri_CREATE_FILE_USE_DOS_PATH, 0, &uri);
if(FAILED(hres))
return hres;
if(!This->uri) {
*ppv = NULL;
return MK_E_SYNTAX;
}
hres = bind_to_object(iface, uri, pbc, riid, ppv);
IUri_Release(uri);
return hres;
return bind_to_object(&This->IMoniker_iface, This->uri, pbc, riid, ppv);
}
static HRESULT WINAPI URLMoniker_BindToStorage(IMoniker* iface, IBindCtx* pbc,