summaryrefslogtreecommitdiff
path: root/common/rawaccel-io.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/rawaccel-io.hpp')
-rw-r--r--common/rawaccel-io.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp
index fc64c7d..7f55392 100644
--- a/common/rawaccel-io.hpp
+++ b/common/rawaccel-io.hpp
@@ -21,7 +21,7 @@ namespace rawaccel {
ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
if (ra_handle == INVALID_HANDLE_VALUE) {
- throw std::system_error(GetLastError(), std::system_category(), "CreateFile failed");
+ throw install_error();
}
mouse_modifier mod;
@@ -54,7 +54,7 @@ namespace rawaccel {
ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
if (ra_handle == INVALID_HANDLE_VALUE) {
- throw std::system_error(GetLastError(), std::system_category(), "CreateFile failed");
+ throw install_error();
}
DWORD dummy;
@@ -73,7 +73,10 @@ namespace rawaccel {
CloseHandle(ra_handle);
if (!success) {
- throw std::system_error(GetLastError(), std::system_category(), "DeviceIoControl failed");
+ if (auto err = GetLastError(); err != ERROR_BUSY) {
+ throw std::system_error(err, std::system_category(), "DeviceIoControl failed");
+ }
+ throw cooldown_error();
}
}