summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-08-24 04:24:33 -0400
committera1xd <[email protected]>2020-08-24 04:24:33 -0400
commit313ab92531fbfacb955f9de85d3fc611f8064154 (patch)
tree4986f8f58b4144a4ec7e85ae14af045b7c12b3da /common
parentMerge pull request #16 from JacobPalecki/Misc (diff)
downloadrawaccel-313ab92531fbfacb955f9de85d3fc611f8064154.tar.xz
rawaccel-313ab92531fbfacb955f9de85d3fc611f8064154.zip
clean up wrapper, minimize heap alloc
Diffstat (limited to 'common')
-rw-r--r--common/rawaccel-io.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp
index 7f55392..582ea68 100644
--- a/common/rawaccel-io.hpp
+++ b/common/rawaccel-io.hpp
@@ -48,7 +48,7 @@ namespace rawaccel {
}
- void write(mouse_modifier mod) {
+ void write(const mouse_modifier& mod) {
HANDLE ra_handle = INVALID_HANDLE_VALUE;
ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
@@ -62,12 +62,12 @@ namespace rawaccel {
BOOL success = DeviceIoControl(
ra_handle,
RA_WRITE,
- &mod, // input buffer
- sizeof(mouse_modifier), // input buffer size
- NULL, // output buffer
- 0, // output buffer size
- &dummy, // bytes returned
- NULL // overlapped structure
+ const_cast<mouse_modifier*>(&mod), // input buffer
+ sizeof(mouse_modifier), // input buffer size
+ NULL, // output buffer
+ 0, // output buffer size
+ &dummy, // bytes returned
+ NULL // overlapped structure
);
CloseHandle(ra_handle);