scrrun/dictionary: Add support for hashing VT_EMPTY keys.
This commit is contained in:
parent
7ea0a3609c
commit
92e2626e9d
2 changed files with 11 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue