Module: wine Branch: master Commit: c519159f5da3715be9666cfb12fcc52078f98cbf URL: http://source.winehq.org/git/wine.git/?a=commit;h=c519159f5da3715be9666cfb12...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jun 23 13:43:47 2011 +0200
urlmon: Added CreateURLMonikerEx2 implementation.
---
dlls/urlmon/umon.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/urlmon.spec | 1 + 2 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index e65e1d1..f6e167c 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -638,6 +638,58 @@ HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker return S_OK; }
+/*********************************************************************** + * CreateURLMonikerEx2 (URLMON.@) + */ +HRESULT WINAPI CreateURLMonikerEx2(IMoniker *pmkContext, IUri *pUri, IMoniker **ppmk, DWORD dwFlags) +{ + IUri *context_uri = NULL, *uri; + IUriContainer *uri_container; + URLMoniker *ret; + HRESULT hres; + + TRACE("(%p %p %p %x)\n", pmkContext, pUri, ppmk, dwFlags); + + if (ppmk) + *ppmk = NULL; + + if (!pUri || !ppmk) + return E_INVALIDARG; + + if(dwFlags > sizeof(create_flags_map)/sizeof(*create_flags_map)) { + FIXME("Unsupported flags %x\n", dwFlags); + return E_INVALIDARG; + } + + if(pmkContext) { + hres = IMoniker_QueryInterface(pmkContext, &IID_IUriContainer, (void**)&uri_container); + if(SUCCEEDED(hres)) { + hres = IUriContainer_GetIUri(uri_container, &context_uri); + if(FAILED(hres)) + context_uri = NULL; + IUriContainer_Release(uri_container); + } + } + + if(context_uri) { + hres = CoInternetCombineIUri(context_uri, pUri, combine_flags_map[dwFlags], &uri, 0); + IUri_Release(context_uri); + if(FAILED(hres)) + return hres; + }else { + uri = pUri; + IUri_AddRef(uri); + } + + hres = create_moniker(uri, &ret); + IUri_Release(uri); + if(FAILED(hres)) + return hres; + + *ppmk = &ret->IMoniker_iface; + return S_OK; +} + /********************************************************************** * CreateURLMoniker (URLMON.@) * diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec index 58b3f33..9765167 100644 --- a/dlls/urlmon/urlmon.spec +++ b/dlls/urlmon/urlmon.spec @@ -36,6 +36,7 @@ @ stdcall CreateUriWithFragment(wstr wstr long long ptr) @ stdcall CreateURLMoniker(ptr wstr ptr) @ stdcall CreateURLMonikerEx(ptr wstr ptr long) +@ stdcall CreateURLMonikerEx2(ptr ptr ptr long) @ stdcall -private DllCanUnloadNow() @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllInstall(long wstr)