summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-04-26 22:06:28 -0400
committera1xd <[email protected]>2021-04-26 22:06:28 -0400
commit630760dc3106b8fd4b0622510d4e2af769a04df5 (patch)
treeec454dff70ab120a5fa9b5dbe659c9b847642e42
parentrefactor rawinput util (diff)
downloadrawaccel-630760dc3106b8fd4b0622510d4e2af769a04df5.tar.xz
rawaccel-630760dc3106b8fd4b0622510d4e2af769a04df5.zip
match error handling in MS raw input docs
-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 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");
}