Commit 246b3002 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32/filemoniker: Fix argument handling in Reduce().

parent b7cab789
......@@ -608,21 +608,16 @@ FileMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLef
return E_NOTIMPL;
}
/******************************************************************************
* FileMoniker_Reduce
******************************************************************************/
static HRESULT WINAPI
FileMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar,
IMoniker** ppmkToLeft, IMoniker** ppmkReduced)
static HRESULT WINAPI FileMonikerImpl_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD howfar,
IMoniker **toleft, IMoniker **reduced)
{
TRACE("(%p,%p,%d,%p,%p)\n",iface,pbc,dwReduceHowFar,ppmkToLeft,ppmkReduced);
TRACE("%p, %p, %d, %p, %p.\n", iface, pbc, howfar, toleft, reduced);
if (ppmkReduced==NULL)
return E_POINTER;
if (!pbc || !reduced)
return E_INVALIDARG;
IMoniker_AddRef(iface);
*ppmkReduced=iface;
*reduced = iface;
return MK_S_REDUCED_TO_SELF;
}
......
......@@ -2098,7 +2098,7 @@ todo_wine
static void test_file_moniker(WCHAR* path)
{
IMoniker *moniker1 = NULL, *moniker2 = NULL, *inverse, *reduced, *anti;
IMoniker *moniker1 = NULL, *moniker2 = NULL, *m3, *inverse, *reduced, *anti;
IEnumMoniker *enummoniker;
IBindCtx *bind_ctx;
IStream *stream;
......@@ -2142,9 +2142,19 @@ static void test_file_moniker(WCHAR* path)
ok(hr == S_OK, "Failed to create bind context, hr %#x.\n", hr);
hr = IMoniker_Reduce(moniker1, NULL, MKRREDUCE_ALL, NULL, &reduced);
todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
hr = IMoniker_Reduce(moniker1, bind_ctx, MKRREDUCE_ALL, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
m3 = anti = create_antimoniker(1);
hr = IMoniker_Reduce(moniker1, bind_ctx, MKRREDUCE_ALL, &m3, &reduced);
ok(hr == MK_S_REDUCED_TO_SELF, "Unexpected hr %#x.\n", hr);
ok(reduced == moniker1, "Unexpected moniker.\n");
ok(m3 == anti, "Unexpected pointer.\n");
IMoniker_Release(reduced);
IMoniker_Release(anti);
hr = IMoniker_Reduce(moniker1, bind_ctx, MKRREDUCE_ALL, NULL, &reduced);
ok(hr == MK_S_REDUCED_TO_SELF, "Unexpected hr %#x.\n", hr);
ok(reduced == moniker1, "Unexpected moniker.\n");
......
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