diff options
| author | Jacob Palecki <[email protected]> | 2020-08-11 21:16:50 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-11 21:16:50 -0700 |
| commit | 319eb45dee5b805eee976d7c2d6be0a9d090d3ed (patch) | |
| tree | d164cf52ce420c2c51aee2e9c0fe67c5fe5b56c5 /common/rawaccel-io.hpp | |
| parent | Further comments (diff) | |
| parent | Merge pull request #13 from a1xd/write-cd (diff) | |
| download | rawaccel-319eb45dee5b805eee976d7c2d6be0a9d090d3ed.tar.xz rawaccel-319eb45dee5b805eee976d7c2d6be0a9d090d3ed.zip | |
Merge branch 'master' into GainCap
Diffstat (limited to 'common/rawaccel-io.hpp')
| -rw-r--r-- | common/rawaccel-io.hpp | 9 |
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(); } } |