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

urlmon: Added IUriContainer stub implementation of URLMoniker object.

parent e3a5ba54
......@@ -37,7 +37,7 @@
static HRESULT (WINAPI *pCreateAsyncBindCtxEx)(IBindCtx *, DWORD,
IBindStatusCallback *, IEnumFORMATETC *, IBindCtx **, DWORD);
static HRESULT (WINAPI *pCreateUri)(LPCWSTR, DWORD, DWORD_PTR, IUri**);
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID(CLSID_IdentityUnmarshal,0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
......@@ -3157,6 +3157,22 @@ static void test_StdURLMoniker(void)
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &display_name);
ok(hres == E_OUTOFMEMORY, "GetDisplayName failed: %08x, expected E_OUTOFMEMORY\n", hres);
if(pCreateUri) {
IUriContainer *uri_container;
IUri *uri;
hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
ok(hres == S_OK, "Coud not get IUriMoniker iface: %08x\n", hres);
uri = (void*)0xdeadbeef;
hres = IUriContainer_GetIUri(uri_container, &uri);
ok(hres == S_FALSE, "GetIUri failed: %08x\n", hres);
ok(!uri, "uri = %p, expected NULL\n", uri);
IUriContainer_Release(uri_container);
}
IMoniker_Release(mon);
}
......@@ -3191,6 +3207,10 @@ START_TEST(url)
return;
}
pCreateUri = (void*) GetProcAddress(hurlmon, "CreateUri");
if(!pCreateUri)
win_skip("IUri not supported\n");
complete_event = CreateEvent(NULL, FALSE, FALSE, NULL);
complete_event2 = CreateEvent(NULL, FALSE, FALSE, NULL);
thread_id = GetCurrentThreadId();
......
......@@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
typedef struct {
const IMonikerVtbl *lpIMonikerVtbl;
IUriContainer IUriContainer_iface;
LONG ref;
......@@ -63,6 +64,9 @@ static HRESULT WINAPI URLMoniker_QueryInterface(IMoniker *iface, REFIID riid, vo
}else if(IsEqualIID(&IID_IAsyncMoniker, riid)) {
TRACE("(%p)->(IID_IAsyncMoniker %p)\n", This, ppv);
*ppv = iface;
}else if(IsEqualIID(&IID_IUriContainer, riid)) {
TRACE("(%p)->(IID_IUriContainer %p)\n", This, ppv);
*ppv = &This->IUriContainer_iface;
}else {
WARN("(%p)->(%s,%p)\n", This, debugstr_guid(riid), ppv);
*ppv = NULL;
......@@ -454,6 +458,46 @@ static const IMonikerVtbl URLMonikerVtbl =
URLMoniker_IsSystemMoniker
};
static inline URLMoniker *impl_from_IUriContainer(IUriContainer *iface)
{
return CONTAINING_RECORD(iface, URLMoniker, IUriContainer_iface);
}
static HRESULT WINAPI UriContainer_QueryInterface(IUriContainer *iface, REFIID riid, void **ppv)
{
URLMoniker *This = impl_from_IUriContainer(iface);
return IMoniker_QueryInterface((IMoniker*)&This->lpIMonikerVtbl, riid, ppv);
}
static ULONG WINAPI UriContainer_AddRef(IUriContainer *iface)
{
URLMoniker *This = impl_from_IUriContainer(iface);
return IMoniker_AddRef((IMoniker*)&This->lpIMonikerVtbl);
}
static ULONG WINAPI UriContainer_Release(IUriContainer *iface)
{
URLMoniker *This = impl_from_IUriContainer(iface);
return IMoniker_Release((IMoniker*)&This->lpIMonikerVtbl);
}
static HRESULT WINAPI UriContainer_GetIUri(IUriContainer *iface, IUri **ppIUri)
{
URLMoniker *This = impl_from_IUriContainer(iface);
FIXME("(%p)->(%p)\n", This, ppIUri);
*ppIUri = NULL;
return S_FALSE;
}
static const IUriContainerVtbl UriContainerVtbl = {
UriContainer_QueryInterface,
UriContainer_AddRef,
UriContainer_Release,
UriContainer_GetIUri
};
static URLMoniker *alloc_moniker(void)
{
URLMoniker *ret;
......@@ -463,6 +507,7 @@ static URLMoniker *alloc_moniker(void)
return NULL;
ret->lpIMonikerVtbl = &URLMonikerVtbl;
ret->IUriContainer_iface.lpVtbl = &UriContainerVtbl;
ret->ref = 1;
ret->URLName = NULL;
......
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