Module: wine Branch: master Commit: e89bedb70b63a3b28de6f835a37e403e3d88fc86 URL: https://gitlab.winehq.org/wine/wine/-/commit/e89bedb70b63a3b28de6f835a37e403...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Thu Jan 4 00:53:58 2024 +0100
scrrun/dictionary: Add support for hashing VT_NULL keys.
---
dlls/scrrun/dictionary.c | 1 + dlls/scrrun/tests/dictionary.c | 8 ++++++++ 2 files changed, 9 insertions(+)
diff --git a/dlls/scrrun/dictionary.c b/dlls/scrrun/dictionary.c index 650874dcf03..f4f1fa701f6 100644 --- a/dlls/scrrun/dictionary.c +++ b/dlls/scrrun/dictionary.c @@ -910,6 +910,7 @@ static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, V case VT_R8: return get_flt_hash(V_VT(key) & VT_BYREF ? *V_R8REF(key) : V_R8(key), &V_I4(hash)); case VT_EMPTY: + case VT_NULL: V_I4(hash) = 0; return S_OK; case VT_INT: diff --git a/dlls/scrrun/tests/dictionary.c b/dlls/scrrun/tests/dictionary.c index e7d39bc0336..4c103ff25bf 100644 --- a/dlls/scrrun/tests/dictionary.c +++ b/dlls/scrrun/tests/dictionary.c @@ -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_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); }