From 630760dc3106b8fd4b0622510d4e2af769a04df5 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 26 Apr 2021 22:06:28 -0400 Subject: match error handling in MS raw input docs --- common/utility-rawinput.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/utility-rawinput.hpp b/common/utility-rawinput.hpp index f20d594..80d305b 100644 --- a/common/utility-rawinput.hpp +++ b/common/utility-rawinput.hpp @@ -18,9 +18,9 @@ void rawinput_foreach_dev_with_id(Func fn, bool with_instance_id = false, { const UINT RI_ERROR = -1; + // get number of devices UINT num_devs = 0; - - if (GetRawInputDeviceList(NULL, &num_devs, sizeof(RAWINPUTDEVICELIST)) == RI_ERROR) { + if (GetRawInputDeviceList(NULL, &num_devs, sizeof(RAWINPUTDEVICELIST)) != 0) { throw std::system_error(GetLastError(), std::system_category(), "GetRawInputDeviceList failed"); } -- cgit v1.2.3