Commit e89bedb7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

scrrun/dictionary: Add support for hashing VT_NULL keys.

parent 92e2626e
...@@ -910,6 +910,7 @@ static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, V ...@@ -910,6 +910,7 @@ static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, V
case VT_R8: case VT_R8:
return get_flt_hash(V_VT(key) & VT_BYREF ? *V_R8REF(key) : V_R8(key), &V_I4(hash)); return get_flt_hash(V_VT(key) & VT_BYREF ? *V_R8REF(key) : V_R8(key), &V_I4(hash));
case VT_EMPTY: case VT_EMPTY:
case VT_NULL:
V_I4(hash) = 0; V_I4(hash) = 0;
return S_OK; return S_OK;
case VT_INT: case VT_INT:
......
...@@ -753,6 +753,14 @@ if (0) { /* crashes on native */ ...@@ -753,6 +753,14 @@ if (0) { /* crashes on native */
ok(V_VT(&hash) == VT_I4, "Unexpected hash type %d.\n", V_VT(&hash)); 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)); ok(V_I4(&hash) == 0, "Unexpected hash value %ld.\n", V_I4(&hash));
V_VT(&key) = VT_NULL;
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); 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