Nikolay Sivov : comsvcs: Implement Hash() for "new" moniker.
Alexandre Julliard
julliard at winehq.org
Mon Nov 4 16:40:25 CST 2019
Module: wine
Branch: master
Commit: ee9447162518be0a91f1e580f8f246f1785eeee6
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ee9447162518be0a91f1e580f8f246f1785eeee6
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun Nov 3 22:30:58 2019 +0300
comsvcs: Implement Hash() for "new" moniker.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 101af6f071..7addd1ee80 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 b377a9a515..cbe338872a 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 {
More information about the wine-cvs
mailing list