ole32: Fix (file 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-30 14:53:41 +03:00 committed by Alexandre Julliard
parent 7548238297
commit 69bb0c7765
2 changed files with 5 additions and 10 deletions

View file

@ -666,7 +666,7 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight,
static const WCHAR bkSlash[]={'\\',0};
IBindCtx *bind=0;
int i=0,j=0,lastIdx1=0,lastIdx2=0;
DWORD mkSys;
DWORD mkSys, order;
TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite);
@ -735,10 +735,9 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight,
return res;
}
else if(mkSys==MKSYS_ANTIMONIKER){
*ppmkComposite=NULL;
return S_OK;
else if (is_anti_moniker(pmkRight, &order))
{
return order > 1 ? create_anti_moniker(order - 1, ppmkComposite) : S_OK;
}
else if (fOnlyIfNotGeneric){

View file

@ -1958,16 +1958,12 @@ todo_wine
anti = create_antimoniker(2);
hr = IMoniker_ComposeWith(moniker1, anti, TRUE, &moniker2);
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);
hr = IMoniker_Hash(moniker2, &hash);
ok(hr == S_OK, "Failed to get hash, hr %#x.\n", hr);
ok(hash == 0x80000001, "Unexpected hash.\n");
IMoniker_Release(moniker2);
}
IMoniker_Release(anti);
IMoniker_Release(moniker1);