Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/ole32/pointermoniker.c | 18 ++++++++---------- dlls/ole32/tests/moniker.c | 6 +++++- 2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index aa4a01d9e75..051d42aca6d 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -380,19 +380,17 @@ static HRESULT WINAPI PointerMonikerImpl_RelativePathTo(IMoniker *iface, IMonike return other ? E_NOTIMPL : E_INVALIDARG; }
-/****************************************************************************** - * PointerMoniker_GetDisplayName - ******************************************************************************/ -static HRESULT WINAPI -PointerMonikerImpl_GetDisplayName(IMoniker* iface, IBindCtx* pbc, - IMoniker* pmkToLeft, LPOLESTR *ppszDisplayName) +static HRESULT WINAPI PointerMonikerImpl_GetDisplayName(IMoniker *iface, IBindCtx *pbc, + IMoniker *toleft, LPOLESTR *name) { - TRACE("(%p,%p,%p,%p)\n",iface,pbc,pmkToLeft,ppszDisplayName); + TRACE("%p, %p, %p, %p.\n", iface, pbc, toleft, name);
- if (ppszDisplayName==NULL) - return E_POINTER; + if (!name || !pbc) + { + if (name) *name = NULL; + return E_INVALIDARG; + }
- *ppszDisplayName = NULL; return E_NOTIMPL; }
diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index fcd8dd8310d..a7c0714a5d7 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -3689,9 +3689,13 @@ todo_wine hr = IMoniker_GetDisplayName(moniker, bindctx, NULL, &display_name); ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+ hr = IMoniker_GetDisplayName(moniker, bindctx, NULL, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + + display_name = (void *)0xdeadbeef; hr = IMoniker_GetDisplayName(moniker, NULL, NULL, &display_name); -todo_wine ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + ok(!display_name, "Unexpected pointer.\n");
IBindCtx_Release(bindctx);