summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-08-03 21:22:54 -0400
committera1xd <[email protected]>2020-08-03 21:22:54 -0400
commitb957eebe584f59f0c6ba78b2bd13c0d95d23ab0b (patch)
tree1d46775003b4a67bdd2c9e4f53bf6644357ce506 /common
parentMerge pull request #8 from a1xd/read (diff)
downloadrawaccel-b957eebe584f59f0c6ba78b2bd13c0d95d23ab0b.tar.xz
rawaccel-b957eebe584f59f0c6ba78b2bd13c0d95d23ab0b.zip
fix read function using direct io
Diffstat (limited to 'common')
-rw-r--r--common/rawaccel-io.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp
index 4050f07..fc64c7d 100644
--- a/common/rawaccel-io.hpp
+++ b/common/rawaccel-io.hpp
@@ -7,10 +7,11 @@
#include "rawaccel.hpp"
-#define RA_IOCTL CTL_CODE(0x8888, 0x888, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define RA_READ CTL_CODE(0x8888, 0x888, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
+#define RA_WRITE CTL_CODE(0x8888, 0x889, METHOD_BUFFERED, FILE_ANY_ACCESS)
#pragma warning(push)
-#pragma warning(disable:4245) // int -> DWORD conversion while passing RA_IOCTL
+#pragma warning(disable:4245) // int -> DWORD conversion while passing CTL_CODE
namespace rawaccel {
@@ -28,9 +29,9 @@ namespace rawaccel {
BOOL success = DeviceIoControl(
ra_handle,
- RA_IOCTL,
+ RA_READ,
NULL, // input buffer
- 0, // input buffer size
+ 0, // input buffer size
&mod, // output buffer
sizeof(mouse_modifier), // output buffer size
&dummy, // bytes returned
@@ -60,7 +61,7 @@ namespace rawaccel {
BOOL success = DeviceIoControl(
ra_handle,
- RA_IOCTL,
+ RA_WRITE,
&mod, // input buffer
sizeof(mouse_modifier), // input buffer size
NULL, // output buffer