mirror of https://github.com/encounter/SDL.git
Allow vendor matching for hid_enumerate() on all backends
This commit is contained in:
parent
c360ca9928
commit
f6b1e028ab
|
@ -1089,8 +1089,8 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
|
||||||
for ( hid_device_ref<CHIDDevice> pDevice = g_Devices; pDevice; pDevice = pDevice->next )
|
for ( hid_device_ref<CHIDDevice> pDevice = g_Devices; pDevice; pDevice = pDevice->next )
|
||||||
{
|
{
|
||||||
const hid_device_info *info = pDevice->GetDeviceInfo();
|
const hid_device_info *info = pDevice->GetDeviceInfo();
|
||||||
if ( ( vendor_id == 0 && product_id == 0 ) ||
|
if ( ( vendor_id == 0x0 || info->vendor_id == vendor_id ) &&
|
||||||
( vendor_id == info->vendor_id && product_id == info->product_id ) )
|
( product_id == 0x0 || info->product_id == product_id ) )
|
||||||
{
|
{
|
||||||
hid_device_info *dev = CopyHIDDeviceInfo( info );
|
hid_device_info *dev = CopyHIDDeviceInfo( info );
|
||||||
dev->next = root;
|
dev->next = root;
|
||||||
|
|
|
@ -568,8 +568,8 @@ struct hid_device_info HID_API_EXPORT *hid_enumerate(unsigned short vendor_id,
|
||||||
dev_pid = get_product_id(dev);
|
dev_pid = get_product_id(dev);
|
||||||
|
|
||||||
/* Check the VID/PID against the arguments */
|
/* Check the VID/PID against the arguments */
|
||||||
if ((vendor_id == 0x0 && product_id == 0x0) ||
|
if ((vendor_id == 0x0 || dev_vid == vendor_id) &&
|
||||||
(vendor_id == dev_vid && product_id == dev_pid)) {
|
(product_id == 0x0 || dev_pid == product_id)) {
|
||||||
struct hid_device_info *tmp;
|
struct hid_device_info *tmp;
|
||||||
|
|
||||||
/* VID/PID match. Create the record. */
|
/* VID/PID match. Create the record. */
|
||||||
|
|
Loading…
Reference in New Issue