Commit 0ac619ae authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

user32: Remove hardcoded devices from GetRawInputDeviceList.

parent f2759829
......@@ -408,29 +408,24 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
if (!devices)
{
*device_count = 2 + rawinput_devices_count;
*device_count = rawinput_devices_count;
return 0;
}
if (*device_count < 2 + rawinput_devices_count)
if (*device_count < rawinput_devices_count)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
*device_count = 2 + rawinput_devices_count;
*device_count = rawinput_devices_count;
return ~0U;
}
devices[0].hDevice = WINE_MOUSE_HANDLE;
devices[0].dwType = RIM_TYPEMOUSE;
devices[1].hDevice = WINE_KEYBOARD_HANDLE;
devices[1].dwType = RIM_TYPEKEYBOARD;
for (i = 0; i < rawinput_devices_count; ++i)
{
devices[2 + i].hDevice = rawinput_devices[i].handle;
devices[2 + i].dwType = rawinput_devices[i].info.dwType;
devices[i].hDevice = rawinput_devices[i].handle;
devices[i].dwType = rawinput_devices[i].info.dwType;
}
return 2 + rawinput_devices_count;
return rawinput_devices_count;
}
/***********************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment