From 8646cd772b6ee06ffab9cd2eb96d8ab909cdf54a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 23 Jun 2011 13:44:57 +0200 Subject: [PATCH] urlmon: Use proper IUri in BindToObject implementation. --- dlls/urlmon/tests/url.c | 5 +++++ dlls/urlmon/umon.c | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c index 49241540f46..d7527592765 100644 --- a/dlls/urlmon/tests/url.c +++ b/dlls/urlmon/tests/url.c @@ -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); } diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 0e6c764a687..d3eb44e5ce5 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -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,