Commit f69bb9d6 authored by Alexandre Julliard's avatar Alexandre Julliard

scrrun: Fix pointer hashing on 64-bit.

parent 863c57e9
...@@ -846,7 +846,11 @@ static HRESULT get_flt_hash(FLOAT flt, LONG *hash) ...@@ -846,7 +846,11 @@ static HRESULT get_flt_hash(FLOAT flt, LONG *hash)
static DWORD get_ptr_hash(void *ptr) static DWORD get_ptr_hash(void *ptr)
{ {
return PtrToUlong(ptr) % DICT_HASH_MOD; DWORD hash = PtrToUlong(ptr);
#ifdef _WIN64
hash ^= (ULONG_PTR)ptr >> 32;
#endif
return hash % 1201;
} }
static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, VARIANT *hash) static HRESULT WINAPI dictionary_get_HashVal(IDictionary *iface, VARIANT *key, VARIANT *hash)
......
...@@ -193,7 +193,11 @@ static DWORD get_num_hash(FLOAT num) ...@@ -193,7 +193,11 @@ static DWORD get_num_hash(FLOAT num)
static DWORD get_ptr_hash(void *ptr) static DWORD get_ptr_hash(void *ptr)
{ {
return PtrToUlong(ptr) % 1201; DWORD hash = PtrToUlong(ptr);
#ifdef _WIN64
hash ^= (ULONG_PTR)ptr >> 32;
#endif
return hash % 1201;
} }
typedef union typedef union
......
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