mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:00:30 +00:00
urlmon: Added IUriContainer stub implementation of URLMoniker object.
This commit is contained in:
parent
e3a5ba5478
commit
b6db01177c
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue