dinput: Pass buffer byte length to HidD_GetProductString.

Instead of then number of WCHAR.

Signed-off-by: Ivo Ivanov <logos128@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ivo Ivanov 2021-11-12 09:49:46 +01:00 committed by Alexandre Julliard
parent 6501968dd8
commit 16bc6b053d
1 changed files with 2 additions and 2 deletions

View File

@ -1239,8 +1239,8 @@ static BOOL hid_joystick_device_try_open( UINT32 handle, const WCHAR *path, HAND
if (caps->UsagePage != HID_USAGE_PAGE_GENERIC) goto failed; if (caps->UsagePage != HID_USAGE_PAGE_GENERIC) goto failed;
if (caps->Usage != HID_USAGE_GENERIC_GAMEPAD && caps->Usage != HID_USAGE_GENERIC_JOYSTICK) goto failed; if (caps->Usage != HID_USAGE_GENERIC_GAMEPAD && caps->Usage != HID_USAGE_GENERIC_JOYSTICK) goto failed;
if (!HidD_GetProductString( device_file, instance->tszInstanceName, MAX_PATH )) goto failed; if (!HidD_GetProductString( device_file, instance->tszInstanceName, MAX_PATH * sizeof(WCHAR) )) goto failed;
if (!HidD_GetProductString( device_file, instance->tszProductName, MAX_PATH )) goto failed; if (!HidD_GetProductString( device_file, instance->tszProductName, MAX_PATH * sizeof(WCHAR) )) goto failed;
instance->guidInstance = hid_joystick_guid; instance->guidInstance = hid_joystick_guid;
instance->guidInstance.Data1 ^= handle; instance->guidInstance.Data1 ^= handle;