Commit 9a4959de authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

ole32: Fix IsEqual() for antimoniker.

parent b9ce037a
...@@ -53,6 +53,7 @@ static inline AntiMonikerImpl *impl_from_IROTData(IROTData *iface) ...@@ -53,6 +53,7 @@ static inline AntiMonikerImpl *impl_from_IROTData(IROTData *iface)
return CONTAINING_RECORD(iface, AntiMonikerImpl, IROTData_iface); return CONTAINING_RECORD(iface, AntiMonikerImpl, IROTData_iface);
} }
static AntiMonikerImpl *unsafe_impl_from_IMoniker(IMoniker *iface);
/******************************************************************************* /*******************************************************************************
* AntiMoniker_QueryInterface * AntiMoniker_QueryInterface
...@@ -308,22 +309,20 @@ AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker ...@@ -308,22 +309,20 @@ AntiMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker
/****************************************************************************** /******************************************************************************
* AntiMoniker_IsEqual * AntiMoniker_IsEqual
******************************************************************************/ ******************************************************************************/
static HRESULT WINAPI static HRESULT WINAPI AntiMonikerImpl_IsEqual(IMoniker *iface, IMoniker *other)
AntiMonikerImpl_IsEqual(IMoniker* iface,IMoniker* pmkOtherMoniker)
{ {
DWORD mkSys; AntiMonikerImpl *moniker = impl_from_IMoniker(iface), *other_moniker;
TRACE("(%p,%p)\n",iface,pmkOtherMoniker);
if (pmkOtherMoniker==NULL) TRACE("%p, %p.\n", iface, other);
return S_FALSE;
IMoniker_IsSystemMoniker(pmkOtherMoniker,&mkSys); if (!other)
return E_INVALIDARG;
if (mkSys==MKSYS_ANTIMONIKER) other_moniker = unsafe_impl_from_IMoniker(other);
return S_OK; if (!other_moniker)
else
return S_FALSE; return S_FALSE;
return moniker->count == other_moniker->count ? S_OK : S_FALSE;
} }
/****************************************************************************** /******************************************************************************
...@@ -588,6 +587,13 @@ static const IMonikerVtbl VT_AntiMonikerImpl = ...@@ -588,6 +587,13 @@ static const IMonikerVtbl VT_AntiMonikerImpl =
AntiMonikerImpl_IsSystemMoniker AntiMonikerImpl_IsSystemMoniker
}; };
static AntiMonikerImpl *unsafe_impl_from_IMoniker(IMoniker *iface)
{
if (iface->lpVtbl != &VT_AntiMonikerImpl)
return NULL;
return CONTAINING_RECORD(iface, AntiMonikerImpl, IMoniker_iface);
}
/********************************************************************************/ /********************************************************************************/
/* Virtual function table for the IROTData class. */ /* Virtual function table for the IROTData class. */
static const IROTDataVtbl VT_ROTDataImpl = static const IROTDataVtbl VT_ROTDataImpl =
......
...@@ -2331,11 +2331,9 @@ todo_wine ...@@ -2331,11 +2331,9 @@ todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMoniker_IsEqual(moniker, moniker2); hr = IMoniker_IsEqual(moniker, moniker2);
todo_wine
ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
hr = IMoniker_IsEqual(moniker2, moniker); hr = IMoniker_IsEqual(moniker2, moniker);
todo_wine
ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
hr = IMoniker_Hash(moniker, &hash); hr = IMoniker_Hash(moniker, &hash);
...@@ -2374,11 +2372,9 @@ todo_wine ...@@ -2374,11 +2372,9 @@ todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMoniker_IsEqual(moniker, moniker2); hr = IMoniker_IsEqual(moniker, moniker2);
todo_wine
ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
hr = IMoniker_IsEqual(moniker2, moniker); hr = IMoniker_IsEqual(moniker2, moniker);
todo_wine
ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr); ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
hr = IMoniker_Hash(moniker, &hash); hr = IMoniker_Hash(moniker, &hash);
...@@ -2403,7 +2399,6 @@ todo_wine ...@@ -2403,7 +2399,6 @@ todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMoniker_IsEqual(moniker, NULL); hr = IMoniker_IsEqual(moniker, NULL);
todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
IStream_Release(stream); IStream_Release(stream);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment