ole32/pointermoniker: Fix argument check in GetDisplayName().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-09-29 10:23:23 +03:00 committed by Alexandre Julliard
parent e12947c022
commit 01feab9ef4
2 changed files with 14 additions and 12 deletions

View File

@ -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;
}

View File

@ -3689,10 +3689,14 @@ todo_wine
hr = IMoniker_GetDisplayName(moniker, bindctx, NULL, &display_name);
ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
hr = IMoniker_GetDisplayName(moniker, NULL, NULL, &display_name);
todo_wine
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);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(!display_name, "Unexpected pointer.\n");
IBindCtx_Release(bindctx);
hr = IMoniker_IsDirty(moniker);