ole32: Fix (item moniker + antimoniker) composing.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-01-29 16:57:04 +03:00 committed by Alexandre Julliard
parent c94b31ee91
commit 3f10a59ff1
2 changed files with 7 additions and 13 deletions

View File

@ -518,7 +518,7 @@ static HRESULT WINAPI ItemMonikerImpl_ComposeWith(IMoniker* iface,
IMoniker** ppmkComposite) IMoniker** ppmkComposite)
{ {
HRESULT res=S_OK; HRESULT res=S_OK;
DWORD mkSys,mkSys2; DWORD mkSys,mkSys2, order;
IEnumMoniker* penumMk=0; IEnumMoniker* penumMk=0;
IMoniker *pmostLeftMk=0; IMoniker *pmostLeftMk=0;
IMoniker* tempMkComposite=0; IMoniker* tempMkComposite=0;
@ -530,16 +530,14 @@ static HRESULT WINAPI ItemMonikerImpl_ComposeWith(IMoniker* iface,
*ppmkComposite=0; *ppmkComposite=0;
IMoniker_IsSystemMoniker(pmkRight,&mkSys); if (is_anti_moniker(pmkRight, &order))
{
/* If pmkRight is an anti-moniker, the returned moniker is NULL */ return order > 1 ? create_anti_moniker(order - 1, ppmkComposite) : S_OK;
if(mkSys==MKSYS_ANTIMONIKER) }
return res;
else else
/* if pmkRight is a composite whose leftmost component is an anti-moniker, */ /* if pmkRight is a composite whose leftmost component is an anti-moniker, */
/* the returned moniker is the composite after the leftmost anti-moniker is removed. */ /* the returned moniker is the composite after the leftmost anti-moniker is removed. */
IMoniker_IsSystemMoniker(pmkRight,&mkSys);
if(mkSys==MKSYS_GENERICCOMPOSITE){ if(mkSys==MKSYS_GENERICCOMPOSITE){
res=IMoniker_Enum(pmkRight,TRUE,&penumMk); res=IMoniker_Enum(pmkRight,TRUE,&penumMk);

View File

@ -2414,16 +2414,12 @@ todo_wine
anti = create_antimoniker(2); anti = create_antimoniker(2);
hr = IMoniker_ComposeWith(moniker, anti, TRUE, &moniker2); hr = IMoniker_ComposeWith(moniker, anti, TRUE, &moniker2);
ok(hr == S_OK, "Failed to compose, hr %#x.\n", hr); ok(hr == S_OK, "Failed to compose, hr %#x.\n", hr);
todo_wine
ok(!!moniker2, "Unexpected pointer.\n");
if (moniker2)
{
TEST_MONIKER_TYPE(moniker2, MKSYS_ANTIMONIKER); TEST_MONIKER_TYPE(moniker2, MKSYS_ANTIMONIKER);
hr = IMoniker_Hash(moniker2, &hash); hr = IMoniker_Hash(moniker2, &hash);
ok(hr == S_OK, "Failed to get hash, hr %#x.\n", hr); ok(hr == S_OK, "Failed to get hash, hr %#x.\n", hr);
ok(hash == 0x80000001, "Unexpected hash.\n"); ok(hash == 0x80000001, "Unexpected hash.\n");
IMoniker_Release(moniker2); IMoniker_Release(moniker2);
}
IMoniker_Release(anti); IMoniker_Release(anti);
IMoniker_Release(moniker); IMoniker_Release(moniker);