From: Nikolay Sivov nsivov@codeweavers.com
--- dlls/scrrun/dictionary.c | 3 +++ dlls/scrrun/tests/dictionary.c | 8 ++++++++ 2 files changed, 11 insertions(+)
diff --git a/dlls/scrrun/dictionary.c b/dlls/scrrun/dictionary.c index 364d8b52ff6..650874dcf03 100644 --- a/dlls/scrrun/dictionary.c +++ b/dlls/scrrun/dictionary.c @@ -909,6 +909,9 @@ static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, V case VT_R8|VT_BYREF: case VT_R8: return get_flt_hash(V_VT(key) & VT_BYREF ? *V_R8REF(key) : V_R8(key), &V_I4(hash)); + case VT_EMPTY: + V_I4(hash) = 0; + return S_OK; case VT_INT: case VT_UINT: case VT_I1: diff --git a/dlls/scrrun/tests/dictionary.c b/dlls/scrrun/tests/dictionary.c index a6369b77831..e7d39bc0336 100644 --- a/dlls/scrrun/tests/dictionary.c +++ b/dlls/scrrun/tests/dictionary.c @@ -745,6 +745,14 @@ if (0) { /* crashes on native */ ok(V_VT(&hash) == VT_I4, "got %d\n", V_VT(&hash)); ok(V_I4(&hash) == expected, "got hash %#lx, expected %#lx\n", V_I4(&hash), expected);
+ V_VT(&key) = VT_EMPTY; + V_I4(&key) = 1234; + V_I4(&hash) = 5678; + hr = IDictionary_get_HashVal(dict, &key, &hash); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(V_VT(&hash) == VT_I4, "Unexpected hash type %d.\n", V_VT(&hash)); + ok(V_I4(&hash) == 0, "Unexpected hash value %ld.\n", V_I4(&hash)); + IDictionary_Release(dict); }