summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-04-25 21:50:57 -0400
committera1xd <[email protected]>2021-04-25 21:50:57 -0400
commitb24311e3ae47f6e68b63dcb5c9122a22cbce7757 (patch)
treefbdfe7bceeac2a5b6d6ea8d0d964ee8aea92fe2a /common
parentignore cfgmgr errors when retrieving device id (diff)
downloadrawaccel-b24311e3ae47f6e68b63dcb5c9122a22cbce7757.tar.xz
rawaccel-b24311e3ae47f6e68b63dcb5c9122a22cbce7757.zip
bugfix - rawinput
GetRawInputDeviceInfo requires character length to be passed, not byte count
Diffstat (limited to 'common')
-rw-r--r--common/utility-rawinput.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/utility-rawinput.hpp b/common/utility-rawinput.hpp
index 5506109..26e558f 100644
--- a/common/utility-rawinput.hpp
+++ b/common/utility-rawinput.hpp
@@ -61,9 +61,9 @@ void rawinput_foreach_with_interface(Func fn, DWORD input_type = RIM_TYPEMOUSE)
if (dev.dwType != input_type) continue;
WCHAR name[256] = {};
- UINT name_size = sizeof(name);
+ UINT len = 256;
- if (GetRawInputDeviceInfoW(dev.hDevice, RIDI_DEVICENAME, name, &name_size) == RI_ERROR) {
+ if (GetRawInputDeviceInfoW(dev.hDevice, RIDI_DEVICENAME, name, &len) == RI_ERROR) {
throw std::system_error(GetLastError(), std::system_category(), "GetRawInputDeviceInfoW failed");
}