Commit b7cab789 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32/pointermoniker: Fix argument handling in RelativePathTo().

parent 19df4c56
......@@ -368,20 +368,16 @@ static HRESULT WINAPI PointerMonikerImpl_CommonPrefixWith(IMoniker *iface, IMoni
return MK_E_NOPREFIX;
}
/******************************************************************************
* PointerMoniker_RelativePathTo
******************************************************************************/
static HRESULT WINAPI
PointerMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath)
static HRESULT WINAPI PointerMonikerImpl_RelativePathTo(IMoniker *iface, IMoniker *other, IMoniker **result)
{
TRACE("(%p,%p,%p)\n",iface,pmOther,ppmkRelPath);
TRACE("%p, %p, %p.\n", iface, other, result);
if (ppmkRelPath==NULL)
return E_POINTER;
if (!result)
return E_INVALIDARG;
*ppmkRelPath = NULL;
*result = NULL;
return E_NOTIMPL;
return other ? E_NOTIMPL : E_INVALIDARG;
}
/******************************************************************************
......
......@@ -3497,7 +3497,7 @@ todo_wine
static void test_pointer_moniker(void)
{
IMoniker *moniker, *moniker2, *prefix, *inverse, *anti, *c;
IMoniker *moniker, *moniker2, *moniker3, *prefix, *inverse, *anti, *c;
struct test_factory factory;
IEnumMoniker *enummoniker;
DWORD hash, size;
......@@ -3726,6 +3726,23 @@ todo_wine
IMoniker_Release(moniker2);
IMoniker_Release(c);
/* RelativePathTo() */
hr = create_moniker_from_desc("I1", &moniker3);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMoniker_RelativePathTo(moniker, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
moniker2 = (void *)0xdeadbeef;
hr = IMoniker_RelativePathTo(moniker, NULL, &moniker2);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(!moniker2, "Unexpected pointer.\n");
hr = IMoniker_RelativePathTo(moniker, moniker3, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
moniker2 = (void *)0xdeadbeef;
hr = IMoniker_RelativePathTo(moniker, moniker3, &moniker2);
ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
ok(!moniker2, "Unexpected pointer.\n");
IMoniker_Release(moniker3);
IMoniker_Release(moniker);
}
......
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