From f7f598fef044c0f11169968070c41ae51dc6ade2 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Wed, 7 Oct 2020 05:17:24 -0400 Subject: Fixed anisotropy not loading correctly on save --- driver/driver.cpp | 9 ++++++--- grapher/Models/Options/ApplyOptions.cs | 3 ++- signed/driver/rawaccel.sys | Bin 0 -> 52560 bytes 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 signed/driver/rawaccel.sys diff --git a/driver/driver.cpp b/driver/driver.cpp index 5fa1dd1..778f3be 100644 --- a/driver/driver.cpp +++ b/driver/driver.cpp @@ -2,6 +2,9 @@ #include "driver.h" +#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) + #ifdef ALLOC_PRAGMA #pragma alloc_text (INIT, DriverEntry) #pragma alloc_text (PAGE, EvtDeviceAdd) @@ -144,13 +147,13 @@ Return Value: size_t size; UNREFERENCED_PARAMETER(Queue); - UNREFERENCED_PARAMETER(IoControlCode); + PAGED_CODE(); DebugPrint(("Ioctl received into filter control object.\n")); - if (InputBufferLength == sizeof(ra::settings)) { + if (IoControlCode == RA_WRITE && InputBufferLength == sizeof(ra::settings)) { LARGE_INTEGER interval; interval.QuadPart = static_cast(ra::WRITE_DELAY) * -10000; KeDelayExecutionThread(KernelMode, FALSE, &interval); @@ -180,7 +183,7 @@ Return Value: WdfRequestComplete(Request, STATUS_SUCCESS); } - else if (OutputBufferLength == sizeof(ra::settings)) { + else if (IoControlCode == RA_READ && OutputBufferLength == sizeof(ra::settings)) { status = WdfRequestRetrieveOutputBuffer( Request, sizeof(ra::settings), diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs index c2ed498..71e580d 100644 --- a/grapher/Models/Options/ApplyOptions.cs +++ b/grapher/Models/Options/ApplyOptions.cs @@ -114,9 +114,10 @@ namespace grapher.Models.Options Sensitivity.SetActiveValues(xSens, ySens); Rotation.SetActiveValue(rotation); OptionSetX.SetActiveValues(xMode, xArgs); - OptionSetY.SetActiveValues(yMode, yArgs); WholeVectorMenuItem.Checked = isWhole; ByComponentVectorMenuItem.Checked = !isWhole; + ByComponentVectorXYLock.Checked = xArgs.Equals(yArgs); + OptionSetY.SetActiveValues(yMode, yArgs); } public void SetActiveValues(DriverSettings settings) diff --git a/signed/driver/rawaccel.sys b/signed/driver/rawaccel.sys new file mode 100644 index 0000000..794158d Binary files /dev/null and b/signed/driver/rawaccel.sys differ -- cgit v1.2.3