ole32/filemoniker: Fix argument handling in Reduce().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b7cab78974
commit
246b3002a4
|
@ -608,21 +608,16 @@ FileMonikerImpl_BindToStorage(IMoniker* iface, IBindCtx* pbc, IMoniker* pmkToLef
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
static HRESULT WINAPI FileMonikerImpl_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD howfar,
|
||||||
* FileMoniker_Reduce
|
IMoniker **toleft, IMoniker **reduced)
|
||||||
******************************************************************************/
|
|
||||||
static HRESULT WINAPI
|
|
||||||
FileMonikerImpl_Reduce(IMoniker* iface, IBindCtx* pbc, DWORD dwReduceHowFar,
|
|
||||||
IMoniker** ppmkToLeft, IMoniker** ppmkReduced)
|
|
||||||
{
|
{
|
||||||
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)
|
if (!pbc || !reduced)
|
||||||
return E_POINTER;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
IMoniker_AddRef(iface);
|
IMoniker_AddRef(iface);
|
||||||
|
*reduced = iface;
|
||||||
*ppmkReduced=iface;
|
|
||||||
|
|
||||||
return MK_S_REDUCED_TO_SELF;
|
return MK_S_REDUCED_TO_SELF;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2098,7 +2098,7 @@ todo_wine
|
||||||
|
|
||||||
static void test_file_moniker(WCHAR* path)
|
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;
|
IEnumMoniker *enummoniker;
|
||||||
IBindCtx *bind_ctx;
|
IBindCtx *bind_ctx;
|
||||||
IStream *stream;
|
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);
|
ok(hr == S_OK, "Failed to create bind context, hr %#x.\n", hr);
|
||||||
|
|
||||||
hr = IMoniker_Reduce(moniker1, NULL, MKRREDUCE_ALL, NULL, &reduced);
|
hr = IMoniker_Reduce(moniker1, NULL, MKRREDUCE_ALL, NULL, &reduced);
|
||||||
todo_wine
|
|
||||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
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);
|
hr = IMoniker_Reduce(moniker1, bind_ctx, MKRREDUCE_ALL, NULL, &reduced);
|
||||||
ok(hr == MK_S_REDUCED_TO_SELF, "Unexpected hr %#x.\n", hr);
|
ok(hr == MK_S_REDUCED_TO_SELF, "Unexpected hr %#x.\n", hr);
|
||||||
ok(reduced == moniker1, "Unexpected moniker.\n");
|
ok(reduced == moniker1, "Unexpected moniker.\n");
|
||||||
|
|
Loading…
Reference in New Issue