comsvcs: Implement Hash() for "new" moniker.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-11-03 22:30:58 +03:00 committed by Alexandre Julliard
parent 51d90cb843
commit ee94471625
2 changed files with 9 additions and 4 deletions

View File

@ -55,6 +55,7 @@ struct new_moniker
{
IMoniker IMoniker_iface;
LONG refcount;
CLSID clsid;
};
static HRESULT new_moniker_parse_displayname(IBindCtx *pbc, LPOLESTR name, ULONG *eaten, IMoniker **ret);
@ -556,9 +557,13 @@ static HRESULT WINAPI new_moniker_IsEqual(IMoniker *iface, IMoniker *other_monik
static HRESULT WINAPI new_moniker_Hash(IMoniker *iface, DWORD *hash)
{
FIXME("%p, %p.\n", iface, hash);
struct new_moniker *moniker = impl_from_IMoniker(iface);
return E_NOTIMPL;
TRACE("%p, %p.\n", iface, hash);
*hash = moniker->clsid.Data1;
return S_OK;
}
static HRESULT WINAPI new_moniker_IsRunning(IMoniker* iface, IBindCtx *pbc, IMoniker *pmkToLeft,
@ -748,6 +753,7 @@ static HRESULT new_moniker_parse_displayname(IBindCtx *pbc, LPOLESTR name, ULONG
moniker->IMoniker_iface.lpVtbl = &new_moniker_vtbl;
moniker->refcount = 1;
moniker->clsid = guid;
*ret = &moniker->IMoniker_iface;

View File

@ -327,10 +327,9 @@ static void test_new_moniker(void)
/* Hashing */
hash = 0;
hr = IMoniker_Hash(moniker, &hash);
todo_wine {
ok(hr == S_OK, "Failed to get a hash, hr %#x.\n", hr);
ok(hash == 0x20d04fe0, "Unexpected hash value %#x.\n", hash);
}
moniker_type = MKSYS_CLASSMONIKER;
hr = IMoniker_IsSystemMoniker(moniker, &moniker_type);
todo_wine {