Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/pointermoniker.c | 16 ++++++---------- dlls/ole32/tests/moniker.c | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index 14cf8af9eaa..aa4a01d9e75 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -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; }
/****************************************************************************** diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index a9660354b01..91382da6a02 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -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); }