Merge pull request #10263 from AndreyBarmaley/rdpdr-devicelist-hashtable

[server,rdpdr] fixed HashTable equal keys func
This commit is contained in:
akallabeth 2024-06-07 10:24:11 +02:00 committed by GitHub
commit 8d20118de6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,6 +82,13 @@ static UINT32 rdpdr_deviceid_hash(const void* id)
return *((const UINT32*)id);
}
static BOOL rdpdr_device_equal(const void* v1, const void* v2)
{
const UINT32* p1 = (const UINT32*)v1;
const UINT32* p2 = (const UINT32*)v2;
return *p1 == *p2;
}
static RdpdrDevice* rdpdr_device_new(void)
{
return calloc(1, sizeof(RdpdrDevice));
@ -3532,6 +3539,9 @@ static RdpdrServerPrivate* rdpdr_server_private_new(void)
obj->fnObjectFree = rdpdr_device_free_h;
obj->fnObjectNew = rdpdr_device_clone;
obj = HashTable_KeyObject(priv->devicelist);
obj->fnObjectEquals = rdpdr_device_equal;
return priv;
fail:
rdpdr_server_private_free(priv);