mirror of https://github.com/PCSX2/pcsx2.git
USB: check that HidD_GetPreparsedData succeeded
This commit is contained in:
parent
5927cef89f
commit
52d88a7282
|
@ -301,14 +301,21 @@ namespace usb_pad
|
|||
|
||||
if (usbHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
Console.Warning("Could not open device %i\n", i);
|
||||
Console.Warning("Could not open device %i", i);
|
||||
free(didData);
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
HidD_GetAttributes(usbHandle, &attr);
|
||||
HidD_GetPreparsedData(usbHandle, &pPreparsedData);
|
||||
if (!HidD_GetPreparsedData(usbHandle, &pPreparsedData))
|
||||
{
|
||||
Console.Warning("Could not get preparsed data from %04x:%04x", attr.VendorID, attr.ProductID);
|
||||
free(didData);
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
HidP_GetCaps(pPreparsedData, &caps);
|
||||
|
||||
if (caps.UsagePage == HID_USAGE_PAGE_GENERIC &&
|
||||
|
|
Loading…
Reference in New Issue