scrrun: Fix pointer hashing on 64-bit.

This commit is contained in:
Alexandre Julliard 2023-09-01 17:24:06 +02:00
parent 863c57e956
commit f69bb9d6c5
2 changed files with 10 additions and 2 deletions

View file

@ -846,7 +846,11 @@ static HRESULT get_flt_hash(FLOAT flt, LONG *hash)
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)

View file

@ -193,7 +193,11 @@ static DWORD get_num_hash(FLOAT num)
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