comsvcs: Add Reduce() for "new" moniker.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0fbf3688e9
commit
015ad98f54
|
@ -600,9 +600,15 @@ static HRESULT WINAPI new_moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc,
|
||||||
static HRESULT WINAPI new_moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD flags, IMoniker **ppmkToLeft,
|
static HRESULT WINAPI new_moniker_Reduce(IMoniker *iface, IBindCtx *pbc, DWORD flags, IMoniker **ppmkToLeft,
|
||||||
IMoniker **ret)
|
IMoniker **ret)
|
||||||
{
|
{
|
||||||
FIXME("%p, %p, %d, %p, %p.\n", iface, pbc, flags, ppmkToLeft, ret);
|
TRACE("%p, %p, %d, %p, %p.\n", iface, pbc, flags, ppmkToLeft, ret);
|
||||||
|
|
||||||
return E_NOTIMPL;
|
if (!ret)
|
||||||
|
return E_POINTER;
|
||||||
|
|
||||||
|
*ret = iface;
|
||||||
|
IMoniker_AddRef(iface);
|
||||||
|
|
||||||
|
return MK_S_REDUCED_TO_SELF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI new_moniker_ComposeWith(IMoniker *iface, IMoniker *mkRight, BOOL fOnlyIfNotGeneric,
|
static HRESULT WINAPI new_moniker_ComposeWith(IMoniker *iface, IMoniker *mkRight, BOOL fOnlyIfNotGeneric,
|
||||||
|
|
|
@ -295,7 +295,7 @@ static void create_dispenser(void)
|
||||||
|
|
||||||
static void test_new_moniker(void)
|
static void test_new_moniker(void)
|
||||||
{
|
{
|
||||||
IMoniker *moniker, *moniker2, *inverse, *class_moniker;
|
IMoniker *moniker, *moniker2, *inverse, *class_moniker, *moniker_left;
|
||||||
IRunningObjectTable *rot;
|
IRunningObjectTable *rot;
|
||||||
IUnknown *obj, *obj2;
|
IUnknown *obj, *obj2;
|
||||||
BIND_OPTS2 bind_opts;
|
BIND_OPTS2 bind_opts;
|
||||||
|
@ -356,6 +356,22 @@ static void test_new_moniker(void)
|
||||||
|
|
||||||
IMoniker_Release(class_moniker);
|
IMoniker_Release(class_moniker);
|
||||||
|
|
||||||
|
/* Reducing. */
|
||||||
|
moniker_left = (void *)0xdeadbeef;
|
||||||
|
hr = IMoniker_Reduce(moniker, bindctx, MKRREDUCE_ONE, &moniker_left, &moniker2);
|
||||||
|
ok(hr == MK_S_REDUCED_TO_SELF, "Unexpected hr %#x.\n", hr);
|
||||||
|
ok(moniker_left == (void *)0xdeadbeef, "Unexpected left moniker.\n");
|
||||||
|
ok(moniker2 == moniker, "Unexpected returned moniker.\n");
|
||||||
|
IMoniker_Release(moniker2);
|
||||||
|
|
||||||
|
hr = IMoniker_Reduce(moniker, bindctx, MKRREDUCE_ONE, NULL, &moniker2);
|
||||||
|
ok(hr == MK_S_REDUCED_TO_SELF, "Unexpected hr %#x.\n", hr);
|
||||||
|
ok(moniker2 == moniker, "Unexpected returned moniker.\n");
|
||||||
|
IMoniker_Release(moniker2);
|
||||||
|
|
||||||
|
hr = IMoniker_Reduce(moniker, bindctx, MKRREDUCE_ONE, NULL, NULL);
|
||||||
|
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
/* Hashing */
|
/* Hashing */
|
||||||
hash = 0;
|
hash = 0;
|
||||||
hr = IMoniker_Hash(moniker, &hash);
|
hr = IMoniker_Hash(moniker, &hash);
|
||||||
|
|
Loading…
Reference in New Issue