diff options
| author | a1xd <[email protected]> | 2021-03-29 18:01:20 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-03-29 18:01:20 -0400 |
| commit | ed0bbc22681681a16b7d45b05133c38a0b82006f (patch) | |
| tree | 3c883ad3c85608cd167efded8cce09733527f835 /common/rawaccel-io.hpp | |
| parent | refactor common/settings (diff) | |
| download | rawaccel-ed0bbc22681681a16b7d45b05133c38a0b82006f.tar.xz rawaccel-ed0bbc22681681a16b7d45b05133c38a0b82006f.zip | |
formatting + file renames
Diffstat (limited to 'common/rawaccel-io.hpp')
| -rw-r--r-- | common/rawaccel-io.hpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp index 703ea92..0d3ddee 100644 --- a/common/rawaccel-io.hpp +++ b/common/rawaccel-io.hpp @@ -6,7 +6,7 @@ #include <Windows.h> #include "rawaccel-io-def.h" -#include "rawaccel-settings.h" +#include "rawaccel-base.hpp" #include "rawaccel-version.h" #include "rawaccel-error.hpp" @@ -15,7 +15,8 @@ namespace rawaccel { - void io_control(DWORD code, void* in, DWORD in_size, void* out, DWORD out_size) { + inline void io_control(DWORD code, void* in, DWORD in_size, void* out, DWORD out_size) + { HANDLE ra_handle = INVALID_HANDLE_VALUE; ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0); @@ -44,19 +45,22 @@ namespace rawaccel { } } - settings read() { + inline settings read() + { settings args; io_control(RA_READ, NULL, 0, &args, sizeof(settings)); return args; } - void write(const settings& args) { + inline void write(const settings& args) + { auto in_ptr = const_cast<settings*>(&args); io_control(RA_WRITE, in_ptr, sizeof(settings), NULL, 0); } - version_t get_version() { + inline version_t get_version() + { version_t ver; io_control(RA_GET_VERSION, NULL, 0, &ver, sizeof(version_t)); return ver; |