}
static int _hid_get_string_descriptor(struct hid_device_priv *dev, int _index,
- void *data, size_t *size)
+ void *data, size_t *size, HANDLE hid_handle)
{
void *tmp = NULL;
+ WCHAR string[MAX_USB_STRING_LENGTH];
size_t tmp_size = 0;
int i;
}
}
- if (i == 3) // not found
- return LIBUSB_ERROR_INVALID_PARAM;
+ if (i == 3) {
+ if (!HidD_GetIndexedString(hid_handle, _index, string, sizeof(string)))
+ return LIBUSB_ERROR_INVALID_PARAM;
+ tmp = string;
+ tmp_size = (_hid_wcslen(string) + 1) * sizeof(WCHAR);
+ }
}
if (!tmp_size)
return LIBUSB_ERROR_INVALID_PARAM;
case LIBUSB_DT_STRING:
usbi_dbg("LIBUSB_DT_STRING");
- return _hid_get_string_descriptor(dev, _index, data, size);
+ return _hid_get_string_descriptor(dev, _index, data, size, hid_handle);
case LIBUSB_DT_HID:
usbi_dbg("LIBUSB_DT_HID");
if (!_index)
DLL_LOAD_FUNC(hid, HidD_GetManufacturerString, TRUE);
DLL_LOAD_FUNC(hid, HidD_GetProductString, TRUE);
DLL_LOAD_FUNC(hid, HidD_GetSerialNumberString, TRUE);
+ DLL_LOAD_FUNC(hid, HidD_GetIndexedString, TRUE);
DLL_LOAD_FUNC(hid, HidP_GetCaps, TRUE);
DLL_LOAD_FUNC(hid, HidD_SetNumInputBuffers, TRUE);
DLL_LOAD_FUNC(hid, HidD_SetFeature, TRUE);
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetManufacturerString, (HANDLE, PVOID, ULONG));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetProductString, (HANDLE, PVOID, ULONG));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetSerialNumberString, (HANDLE, PVOID, ULONG));
+DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetIndexedString, (HANDLE, ULONG, PVOID, ULONG));
DLL_DECLARE_FUNC(WINAPI, LONG, HidP_GetCaps, (PHIDP_PREPARSED_DATA, PHIDP_CAPS));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_SetNumInputBuffers, (HANDLE, ULONG));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_SetFeature, (HANDLE, PVOID, ULONG));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_GetInputReport, (HANDLE, PVOID, ULONG));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_SetOutputReport, (HANDLE, PVOID, ULONG));
DLL_DECLARE_FUNC(WINAPI, BOOL, HidD_FlushQueue, (HANDLE));
-DLL_DECLARE_FUNC(WINAPI, BOOL, HidP_GetValueCaps, (HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PULONG, PHIDP_PREPARSED_DATA));
\ No newline at end of file
+DLL_DECLARE_FUNC(WINAPI, BOOL, HidP_GetValueCaps, (HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PULONG, PHIDP_PREPARSED_DATA));