Commit 92e2626e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

scrrun/dictionary: Add support for hashing VT_EMPTY keys.

parent 7ea0a360
......@@ -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:
......
......@@ -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);
}
......
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