From b957eebe584f59f0c6ba78b2bd13c0d95d23ab0b Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Mon, 3 Aug 2020 21:22:54 -0400 Subject: fix read function using direct io --- common/rawaccel-io.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'common') 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 -- cgit v1.2.3