diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c index 1e945f9a5f5..6310a5acd5c 100644 --- a/dlls/ole32/filemoniker.c +++ b/dlls/ole32/filemoniker.c @@ -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){ diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index ea1e5b19332..7b2dfcfe084 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -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);