From ee9447162518be0a91f1e580f8f246f1785eeee6 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 3 Nov 2019 22:30:58 +0300 Subject: [PATCH] comsvcs: Implement Hash() for "new" moniker. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/comsvcs/main.c | 10 ++++++++-- dlls/comsvcs/tests/comsvcs.c | 3 +-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/comsvcs/main.c b/dlls/comsvcs/main.c index 101af6f0710..7addd1ee80a 100644 --- a/dlls/comsvcs/main.c +++ b/dlls/comsvcs/main.c @@ -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; diff --git a/dlls/comsvcs/tests/comsvcs.c b/dlls/comsvcs/tests/comsvcs.c index b377a9a5150..cbe338872a9 100644 --- a/dlls/comsvcs/tests/comsvcs.c +++ b/dlls/comsvcs/tests/comsvcs.c @@ -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 { -- 2.11.4.GIT