summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-03-29 17:14:49 -0400
committera1xd <[email protected]>2021-03-29 17:14:49 -0400
commit16dc4df3d438142ae378c9c6983585d06e0c6a33 (patch)
tree1080b11b6ec98d6f47509ced922f2c338e0068bd /driver
parentMerge pull request #81 from a1xd/log-unhandled-ex (diff)
downloadrawaccel-16dc4df3d438142ae378c9c6983585d06e0c6a33.tar.xz
rawaccel-16dc4df3d438142ae378c9c6983585d06e0c6a33.zip
refactor common/settings
only driver compiles remove accel-base types merge linear + classic move gain cap logic into classic impl, cap is now set in terms of output use cap/limit to determine negation remove weight, add replacement for power mode only remove legacy offset option remove naturalgain mode add legacy mode flag naturalgain -> natural natural -> natural + legacy flag add dpi setting and more accel args + defaults (prep for ips mode) replace output speed cap with input cap
Diffstat (limited to 'driver')
-rw-r--r--driver/driver.cpp11
-rw-r--r--driver/driver.h3
2 files changed, 7 insertions, 7 deletions
diff --git a/driver/driver.cpp b/driver/driver.cpp
index 0c21f34..235571c 100644
--- a/driver/driver.cpp
+++ b/driver/driver.cpp
@@ -1,8 +1,9 @@
+#include "driver.h"
+
#include <rawaccel.hpp>
#include <rawaccel-io-def.h>
#include <rawaccel-version.h>
-#include "driver.h"
#ifdef ALLOC_PRAGMA
#pragma alloc_text (INIT, DriverEntry)
@@ -11,8 +12,6 @@
#pragma alloc_text (PAGE, RawaccelControl)
#endif
-namespace ra = rawaccel;
-
using milliseconds = double;
using lut_value_t = ra::si_pair;
@@ -21,7 +20,7 @@ struct {
milliseconds tick_interval = 0; // set in DriverEntry
ra::mouse_modifier modifier;
vec2<lut_value_t*> lookups = {};
-} global;
+} global = {};
VOID
RawaccelCallback(
@@ -59,7 +58,7 @@ Arguments:
bool any = num_packets > 0;
bool rel_move = !(InputDataStart->Flags & MOUSE_MOVE_ABSOLUTE);
bool dev_match = global.args.device_id[0] == 0 ||
- wcsncmp(devExt->dev_id, global.args.device_id, MAX_DEV_ID_LEN) == 0;
+ wcsncmp(devExt->dev_id, global.args.device_id, ra::MAX_DEV_ID_LEN) == 0;
if (any && rel_move && dev_match) {
// if IO is backed up to the point where we get more than 1 packet here
@@ -507,7 +506,7 @@ Return Value:
if (NT_SUCCESS(nts)) {
auto* id_ptr = reinterpret_cast<WCHAR*>(iosb.Information);
- wcsncpy(FilterGetData(hDevice)->dev_id, id_ptr, MAX_DEV_ID_LEN);
+ wcsncpy(FilterGetData(hDevice)->dev_id, id_ptr, ra::MAX_DEV_ID_LEN);
DebugPrint(("Device ID = %ws\n", id_ptr));
ExFreePool(id_ptr);
}
diff --git a/driver/driver.h b/driver/driver.h
index a0381fb..ba575d3 100644
--- a/driver/driver.h
+++ b/driver/driver.h
@@ -16,12 +16,13 @@
#define SYMBOLIC_NAME_STRING L"\\DosDevices\\rawaccel"
using counter_t = long long;
+namespace ra = rawaccel;
typedef struct _DEVICE_EXTENSION {
counter_t counter;
vec2d carry;
CONNECT_DATA UpperConnectData;
- WCHAR dev_id[MAX_DEV_ID_LEN];
+ WCHAR dev_id[ra::MAX_DEV_ID_LEN];
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_EXTENSION, FilterGetData)