Skip to content

Commit

Permalink
Fixed anisotropy not loading correctly on save
Browse files Browse the repository at this point in the history
  • Loading branch information
a1xd committed Oct 7, 2020
1 parent f62dc2e commit f7f598f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions driver/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<LONGLONG>(ra::WRITE_DELAY) * -10000;
KeDelayExecutionThread(KernelMode, FALSE, &interval);
Expand Down Expand Up @@ -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),
Expand Down
3 changes: 2 additions & 1 deletion grapher/Models/Options/ApplyOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ public void SetActiveValues(
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)
Expand Down
Binary file added signed/driver/rawaccel.sys
Binary file not shown.

0 comments on commit f7f598f

Please sign in to comment.