summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authora1xd <[email protected]>2020-08-01 21:08:47 -0400
committerGitHub <[email protected]>2020-08-01 21:08:47 -0400
commit1d9fb1f9007cca7ffa69b408ab7945926bbce673 (patch)
treead50871f3067dbca729e3ecfe6307fc774004b4d
parentMerge pull request #7 from JacobPalecki/GUI (diff)
parentmove clipp/parse logic into console project (diff)
downloadrawaccel-1d9fb1f9007cca7ffa69b408ab7945926bbce673.tar.xz
rawaccel-1d9fb1f9007cca7ffa69b408ab7945926bbce673.zip
Merge pull request #8 from a1xd/read
Read ioctl
-rw-r--r--common/common.vcxitems3
-rw-r--r--common/external/nillable.h30
-rw-r--r--common/rawaccel-io.hpp81
-rw-r--r--common/rawaccel-userspace.hpp128
-rw-r--r--common/rawaccel.hpp2
-rw-r--r--common/tagged-union-single.h (renamed from common/external/tagged-union-single.h)2
-rw-r--r--console/console.cpp10
-rw-r--r--console/console.vcxproj5
-rw-r--r--console/console_write.cpp32
-rw-r--r--console/console_write.hpp14
-rw-r--r--console/external/clipp.h (renamed from common/external/clipp.h)0
-rw-r--r--console/parse.hpp128
-rw-r--r--driver/driver.cpp63
-rw-r--r--rawaccel.sln1
-rw-r--r--wrapper/wrapper.cpp1
-rw-r--r--wrapper/wrapper.hpp14
-rw-r--r--wrapper/wrapper.vcxproj1
-rw-r--r--wrapper/wrapper_writer.cpp4
-rw-r--r--wrapper/wrapper_writer.hpp2
19 files changed, 273 insertions, 248 deletions
diff --git a/common/common.vcxitems b/common/common.vcxitems
index d1e8db0..7102164 100644
--- a/common/common.vcxitems
+++ b/common/common.vcxitems
@@ -23,8 +23,9 @@
<ClInclude Include="$(MSBuildThisFileDirectory)accel-power.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-sigmoid.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)accel-error.hpp" />
- <ClInclude Include="$(MSBuildThisFileDirectory)rawaccel-userspace.hpp" />
+ <ClInclude Include="$(MSBuildThisFileDirectory)rawaccel-io.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)rawaccel.hpp" />
+ <ClInclude Include="$(MSBuildThisFileDirectory)tagged-union-single.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)x64-util.hpp" />
<ClInclude Include="$(MSBuildThisFileDirectory)vec2.h" />
</ItemGroup>
diff --git a/common/external/nillable.h b/common/external/nillable.h
deleted file mode 100644
index 40cf01c..0000000
--- a/common/external/nillable.h
+++ /dev/null
@@ -1,30 +0,0 @@
-inline constexpr struct nil_t {} nil;
-
-// Requirements: T is default-constructible and trivially-destructible
-template<typename T>
-struct nillable {
- bool has_value = false;
- T value;
-
- nillable() = default;
-
- nillable(nil_t) : nillable() {}
- nillable(const T& v) : has_value(true), value(v) {}
-
- nillable& operator=(nil_t) {
- has_value = false;
- return *this;
- }
- nillable& operator=(const T& v) {
- value = v;
- has_value = true;
- return *this;
- }
-
- const T* operator->() const { return &value; }
- T* operator->() { return &value; }
-
- explicit operator bool() const { return has_value; }
-};
-
-template<typename T> nillable(T)->nillable<T>;
diff --git a/common/rawaccel-io.hpp b/common/rawaccel-io.hpp
new file mode 100644
index 0000000..4050f07
--- /dev/null
+++ b/common/rawaccel-io.hpp
@@ -0,0 +1,81 @@
+#pragma once
+
+#include <system_error>
+
+#define NOMINMAX
+#include <Windows.h>
+
+#include "rawaccel.hpp"
+
+#define RA_IOCTL CTL_CODE(0x8888, 0x888, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+#pragma warning(push)
+#pragma warning(disable:4245) // int -> DWORD conversion while passing RA_IOCTL
+
+namespace rawaccel {
+
+ mouse_modifier read() {
+ HANDLE ra_handle = INVALID_HANDLE_VALUE;
+
+ ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
+
+ if (ra_handle == INVALID_HANDLE_VALUE) {
+ throw std::system_error(GetLastError(), std::system_category(), "CreateFile failed");
+ }
+
+ mouse_modifier mod;
+ DWORD dummy;
+
+ BOOL success = DeviceIoControl(
+ ra_handle,
+ RA_IOCTL,
+ NULL, // input buffer
+ 0, // input buffer size
+ &mod, // output buffer
+ sizeof(mouse_modifier), // output buffer size
+ &dummy, // bytes returned
+ NULL // overlapped structure
+ );
+
+ CloseHandle(ra_handle);
+
+ if (!success) {
+ throw std::system_error(GetLastError(), std::system_category(), "DeviceIoControl failed");
+ }
+
+ return mod;
+ }
+
+
+ void write(mouse_modifier mod) {
+ HANDLE ra_handle = INVALID_HANDLE_VALUE;
+
+ ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
+
+ if (ra_handle == INVALID_HANDLE_VALUE) {
+ throw std::system_error(GetLastError(), std::system_category(), "CreateFile failed");
+ }
+
+ DWORD dummy;
+
+ BOOL success = DeviceIoControl(
+ ra_handle,
+ RA_IOCTL,
+ &mod, // input buffer
+ sizeof(mouse_modifier), // input buffer size
+ NULL, // output buffer
+ 0, // output buffer size
+ &dummy, // bytes returned
+ NULL // overlapped structure
+ );
+
+ CloseHandle(ra_handle);
+
+ if (!success) {
+ throw std::system_error(GetLastError(), std::system_category(), "DeviceIoControl failed");
+ }
+ }
+
+}
+
+#pragma warning(pop)
diff --git a/common/rawaccel-userspace.hpp b/common/rawaccel-userspace.hpp
deleted file mode 100644
index c80262c..0000000
--- a/common/rawaccel-userspace.hpp
+++ /dev/null
@@ -1,128 +0,0 @@
-#pragma once
-
-#include <iostream>
-
-#include "external/clipp.h"
-
-#include "accel-error.hpp"
-#include "rawaccel.hpp"
-
-namespace rawaccel {
-
-inline constexpr int SYSTEM_ERROR = -1;
-inline constexpr int PARSE_ERROR = 1;
-inline constexpr int INVALID_ARGUMENT = 2;
-
-template<typename Accel, typename StrFirst, typename... StrRest>
-clipp::parameter make_accel_cmd(modifier_args& args, StrFirst&& first_flag, StrRest&&... rest) {
- return clipp::command(first_flag, rest...)
- .set(args.acc_fn_args.accel_mode, accel_impl_t::id<Accel>);
-}
-
-mouse_modifier parse(int argc, char** argv) {
- modifier_args args{};
-
- auto make_opt_vec = [](vec2d& v, auto first_flag, auto... rest) {
- return clipp::option(first_flag, rest...) & (
- clipp::number("xy", v.x, v.y) | (
- (clipp::required("x") & clipp::number("num", v.x)),
- (clipp::required("y") & clipp::number("num", v.y))
- )
- );
- };
-
- auto make_doc_fmt = [] {
- return clipp::doc_formatting{}
- .first_column(4)
- .doc_column(28)
- .last_column(80)
- // min value to not split optional vec2 alternatives
- .alternatives_min_split_size(5);
- };
-
- // default options
- auto opt_sens = "sensitivity (default = 1)" % make_opt_vec(args.sens, "sens");
-
- auto opt_rot = "counter-clockwise rotation (default = 0)" % (
- clipp::option("rotate") &
- clipp::number("degrees", args.degrees)
- );
-
- // mode-independent accel options
- auto opt_weight = "accel multiplier (default = 1)" %
- make_opt_vec(args.acc_fn_args.acc_args.weight, "weight");
-
- auto opt_offset = "speed (dots/ms) where accel kicks in (default = 0)" % (
- clipp::option("offset") & clipp::number("speed", args.acc_fn_args.acc_args.offset)
- );
-
- auto opt_cap = "accel scale cap (default = 9)" %
- make_opt_vec(args.acc_fn_args.cap, "cap");
-
- auto opt_tmin = "minimum time between polls (default = 0.4)" % (
- clipp::option("tmin") &
- clipp::number("ms", args.acc_fn_args.time_min)
- );
-
- auto accel_var = (clipp::required("accel") & clipp::number("num", args.acc_fn_args.acc_args.accel)) % "ramp rate";
- auto limit_var = (clipp::required("limit") & clipp::number("scale", args.acc_fn_args.acc_args.limit)) % "limit";
- auto exp_var = (clipp::required("exponent") & clipp::number("num", args.acc_fn_args.acc_args.exponent)) % "exponent";
-
- // modes
- auto noaccel_mode = "no-accel mode" % make_accel_cmd<accel_noaccel>(args, "off", "noaccel");
-
- auto lin_mode = "linear accel mode:" % (
- make_accel_cmd<accel_linear>(args, "linear"),
- accel_var
- );
- auto classic_mode = "classic accel mode:" % (
- make_accel_cmd<accel_classic>(args, "classic"),
- accel_var,
- exp_var
- );
- auto nat_mode = "natural accel mode:" % (
- make_accel_cmd<accel_natural>(args, "natural"),
- accel_var,
- limit_var
- );
- auto log_mode = "logarithmic accel mode:" % (
- make_accel_cmd<accel_logarithmic>(args, "logarithmic"),
- accel_var
- );
- auto sig_mode = "sigmoid accel mode:" % (
- make_accel_cmd<accel_sigmoid>(args, "sigmoid"),
- accel_var,
- limit_var,
- (clipp::required("midpoint") & clipp::number("speed", args.acc_fn_args.acc_args.midpoint)) % "midpoint"
- );
- auto pow_mode = "power accel mode:" % (
- make_accel_cmd<accel_power>(args, "power"),
- exp_var,
- (clipp::option("scale") & clipp::number("num", args.acc_fn_args.acc_args.power_scale)) % "scale factor"
- );
-
- auto accel_mode_exclusive = (lin_mode | classic_mode | nat_mode | log_mode | sig_mode | pow_mode);
- auto accel_opts = "mode-independent accel options:" % (opt_cap, opt_weight, opt_offset, opt_tmin);
-
- bool help = false;
-
- auto cli = clipp::group(clipp::command("help").set(help)) | (
- noaccel_mode | (accel_mode_exclusive, accel_opts),
- opt_sens,
- opt_rot
- );
-
- if (!clipp::parse(argc, argv, cli)) {
- std::cout << clipp::usage_lines(cli, "rawaccel", make_doc_fmt());
- std::exit(PARSE_ERROR);
- }
-
- if (help) {
- std::cout << clipp::make_man_page(cli, "rawaccel", make_doc_fmt());
- std::exit(0);
- }
-
- return mouse_modifier(args);
-}
-
-} // rawaccel
diff --git a/common/rawaccel.hpp b/common/rawaccel.hpp
index 59a0360..474f2aa 100644
--- a/common/rawaccel.hpp
+++ b/common/rawaccel.hpp
@@ -4,7 +4,7 @@
#include <math.h>
#include "x64-util.hpp"
-#include "external/tagged-union-single.h"
+#include "tagged-union-single.h"
#include "accel-linear.hpp"
#include "accel-classic.hpp"
diff --git a/common/external/tagged-union-single.h b/common/tagged-union-single.h
index 3353325..f0de097 100644
--- a/common/external/tagged-union-single.h
+++ b/common/tagged-union-single.h
@@ -137,7 +137,7 @@ struct tagged_union {
int tag = 0;
struct storage_t {
- alignas(max_align_of<First, Rest...>) char bytes[max_size_of<First, Rest...>] = "";
+ alignas(max_align_of<First, Rest...>) char bytes[max_size_of<First, Rest...>] = {};
template <typename T>
inline constexpr T& as() {
diff --git a/console/console.cpp b/console/console.cpp
index 549cb68..9a1d66f 100644
--- a/console/console.cpp
+++ b/console/console.cpp
@@ -1,14 +1,14 @@
#include <iostream>
-#define NOMINMAX
-#include <Windows.h>
+#include <rawaccel-io.hpp>
-#include <rawaccel-userspace.hpp>
-#include "console_write.hpp"
+#include "parse.hpp"
+
+namespace ra = rawaccel;
int main(int argc, char** argv) {
try {
- write(ra::parse(argc, argv));
+ ra::write(ra::parse(argc, argv));
}
catch (std::domain_error e) {
std::cerr << e.what() << '\n';
diff --git a/console/console.vcxproj b/console/console.vcxproj
index 05780cd..0f87d94 100644
--- a/console/console.vcxproj
+++ b/console/console.vcxproj
@@ -90,8 +90,9 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="console.cpp" />
- <ClCompile Include="console_write.cpp" />
- <ClCompile Include="console_write.hpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="parse.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/console/console_write.cpp b/console/console_write.cpp
deleted file mode 100644
index 3240ea5..0000000
--- a/console/console_write.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once
-
-#include "console_write.hpp"
-
-void write(ra::mouse_modifier vars) {
- HANDLE ra_handle = INVALID_HANDLE_VALUE;
-
- ra_handle = CreateFileW(L"\\\\.\\rawaccel", 0, 0, 0, OPEN_EXISTING, 0, 0);
-
- if (ra_handle == INVALID_HANDLE_VALUE) {
- throw std::system_error(GetLastError(), std::system_category(), "CreateFile failed");
- }
-
- DWORD dummy;
-
- BOOL success = DeviceIoControl(
- ra_handle,
- RA_WRITE,
- &vars,
- sizeof(ra::mouse_modifier),
- NULL, // output buffer
- 0, // output buffer size
- &dummy, // bytes returned
- NULL // overlapped structure
- );
-
- CloseHandle(ra_handle);
-
- if (!success) {
- throw std::system_error(GetLastError(), std::system_category(), "DeviceIoControl failed");
- }
-}
diff --git a/console/console_write.hpp b/console/console_write.hpp
deleted file mode 100644
index 31eb575..0000000
--- a/console/console_write.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-#include <iostream>
-
-#define NOMINMAX
-#include <Windows.h>
-
-#include "..\common\rawaccel.hpp"
-
-#define RA_WRITE CTL_CODE(0x8888, 0x888, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-namespace ra = rawaccel;
-
-void write(ra::mouse_modifier vars); \ No newline at end of file
diff --git a/common/external/clipp.h b/console/external/clipp.h
index cca1554..cca1554 100644
--- a/common/external/clipp.h
+++ b/console/external/clipp.h
diff --git a/console/parse.hpp b/console/parse.hpp
new file mode 100644
index 0000000..1cdb3fb
--- /dev/null
+++ b/console/parse.hpp
@@ -0,0 +1,128 @@
+#pragma once
+
+#include <iostream>
+
+#include <rawaccel.hpp>
+#include <accel-error.hpp>
+
+#include "external/clipp.h"
+
+namespace rawaccel {
+
+ inline constexpr int SYSTEM_ERROR = -1;
+ inline constexpr int PARSE_ERROR = 1;
+ inline constexpr int INVALID_ARGUMENT = 2;
+
+ template<typename Accel, typename StrFirst, typename... StrRest>
+ clipp::parameter make_accel_cmd(modifier_args& args, StrFirst&& first_flag, StrRest&&... rest) {
+ return clipp::command(first_flag, rest...)
+ .set(args.acc_fn_args.accel_mode, accel_impl_t::id<Accel>);
+ }
+
+ mouse_modifier parse(int argc, char** argv) {
+ modifier_args args{};
+
+ auto make_opt_vec = [](vec2d& v, auto first_flag, auto... rest) {
+ return clipp::option(first_flag, rest...) & (
+ clipp::number("xy", v.x, v.y) | (
+ (clipp::required("x") & clipp::number("num", v.x)),
+ (clipp::required("y") & clipp::number("num", v.y))
+ )
+ );
+ };
+
+ auto make_doc_fmt = [] {
+ return clipp::doc_formatting{}
+ .first_column(4)
+ .doc_column(28)
+ .last_column(80)
+ // min value to not split optional vec2 alternatives
+ .alternatives_min_split_size(5);
+ };
+
+ // default options
+ auto opt_sens = "sensitivity (default = 1)" % make_opt_vec(args.sens, "sens");
+
+ auto opt_rot = "counter-clockwise rotation (default = 0)" % (
+ clipp::option("rotate") &
+ clipp::number("degrees", args.degrees)
+ );
+
+ // mode-independent accel options
+ auto opt_weight = "accel multiplier (default = 1)" %
+ make_opt_vec(args.acc_fn_args.acc_args.weight, "weight");
+
+ auto opt_offset = "speed (dots/ms) where accel kicks in (default = 0)" % (
+ clipp::option("offset") & clipp::number("speed", args.acc_fn_args.acc_args.offset)
+ );
+
+ auto opt_cap = "accel scale cap (default = 9)" %
+ make_opt_vec(args.acc_fn_args.cap, "cap");
+
+ auto opt_tmin = "minimum time between polls (default = 0.4)" % (
+ clipp::option("tmin") &
+ clipp::number("ms", args.acc_fn_args.time_min)
+ );
+
+ auto accel_var = (clipp::required("accel") & clipp::number("num", args.acc_fn_args.acc_args.accel)) % "ramp rate";
+ auto limit_var = (clipp::required("limit") & clipp::number("scale", args.acc_fn_args.acc_args.limit)) % "limit";
+ auto exp_var = (clipp::required("exponent") & clipp::number("num", args.acc_fn_args.acc_args.exponent)) % "exponent";
+
+ // modes
+ auto noaccel_mode = "no-accel mode" % make_accel_cmd<accel_noaccel>(args, "off", "noaccel");
+
+ auto lin_mode = "linear accel mode:" % (
+ make_accel_cmd<accel_linear>(args, "linear"),
+ accel_var
+ );
+ auto classic_mode = "classic accel mode:" % (
+ make_accel_cmd<accel_classic>(args, "classic"),
+ accel_var,
+ exp_var
+ );
+ auto nat_mode = "natural accel mode:" % (
+ make_accel_cmd<accel_natural>(args, "natural"),
+ accel_var,
+ limit_var
+ );
+ auto log_mode = "logarithmic accel mode:" % (
+ make_accel_cmd<accel_logarithmic>(args, "logarithmic"),
+ accel_var
+ );
+ auto sig_mode = "sigmoid accel mode:" % (
+ make_accel_cmd<accel_sigmoid>(args, "sigmoid"),
+ accel_var,
+ limit_var,
+ (clipp::required("midpoint") & clipp::number("speed", args.acc_fn_args.acc_args.midpoint)) % "midpoint"
+ );
+ auto pow_mode = "power accel mode:" % (
+ make_accel_cmd<accel_power>(args, "power"),
+ exp_var,
+ (clipp::option("scale") & clipp::number("num", args.acc_fn_args.acc_args.power_scale)) % "scale factor"
+ );
+
+ auto accel_mode_exclusive = (lin_mode | classic_mode | nat_mode | log_mode | sig_mode | pow_mode);
+ auto accel_opts = "mode-independent accel options:" % (opt_cap, opt_weight, opt_offset, opt_tmin);
+
+ bool help = false;
+
+ auto cli = clipp::group(clipp::command("help").set(help)) | (
+ noaccel_mode | (accel_mode_exclusive, accel_opts),
+ opt_sens,
+ opt_rot
+ );
+
+ if (!clipp::parse(argc, argv, cli)) {
+ std::cout << clipp::usage_lines(cli, "rawaccel", make_doc_fmt());
+ std::exit(PARSE_ERROR);
+ }
+
+ if (help) {
+ std::cout << clipp::make_man_page(cli, "rawaccel", make_doc_fmt());
+ std::exit(0);
+ }
+
+ return mouse_modifier(args);
+ }
+
+} // rawaccel
diff --git a/driver/driver.cpp b/driver/driver.cpp
index 1f9cebd..c893b8b 100644
--- a/driver/driver.cpp
+++ b/driver/driver.cpp
@@ -143,41 +143,60 @@ Return Value:
--*/
{
NTSTATUS status;
- void* input_buffer;
- size_t input_size;
+ void* buffer;
+ size_t size;
UNREFERENCED_PARAMETER(Queue);
- UNREFERENCED_PARAMETER(OutputBufferLength);
UNREFERENCED_PARAMETER(IoControlCode);
PAGED_CODE();
DebugPrint(("Ioctl received into filter control object.\n"));
- if (InputBufferLength != sizeof(ra::mouse_modifier)) {
- DebugPrint(("Received unknown request of %u bytes\n", InputBufferLength));
- // status maps to win32 error code 1784: ERROR_INVALID_USER_BUFFER
- WdfRequestComplete(Request, STATUS_INVALID_BUFFER_SIZE);
- return;
- }
+ if (InputBufferLength == sizeof(ra::mouse_modifier)) {
+ status = WdfRequestRetrieveInputBuffer(
+ Request,
+ sizeof(ra::mouse_modifier),
+ &buffer,
+ &size
+ );
- status = WdfRequestRetrieveInputBuffer(
- Request,
- sizeof(ra::mouse_modifier),
- &input_buffer,
- &input_size
- );
+ if (!NT_SUCCESS(status)) {
+ DebugPrint(("RetrieveInputBuffer failed: 0x%x\n", status));
+ // status maps to win32 error code 1359: ERROR_INTERNAL_ERROR
+ WdfRequestComplete(Request, STATUS_MESSAGE_LOST);
+ return;
+ }
- if (!NT_SUCCESS(status)) {
- DebugPrint(("RetrieveInputBuffer failed: 0x%x\n", status));
- // status maps to win32 error code 1359: ERROR_INTERNAL_ERROR
- WdfRequestComplete(Request, STATUS_MESSAGE_LOST);
- return;
+ global.modifier = *reinterpret_cast<ra::mouse_modifier*>(buffer);
+
+ WdfRequestComplete(Request, STATUS_SUCCESS);
}
+ else if (OutputBufferLength == sizeof(ra::mouse_modifier)) {
+ status = WdfRequestRetrieveOutputBuffer(
+ Request,
+ sizeof(ra::mouse_modifier),
+ &buffer,
+ &size
+ );
+
+ if (!NT_SUCCESS(status)) {
+ DebugPrint(("RetrieveOutputBuffer failed: 0x%x\n", status));
+ // status maps to win32 error code 1359: ERROR_INTERNAL_ERROR
+ WdfRequestComplete(Request, STATUS_MESSAGE_LOST);
+ return;
+ }
+
+ *reinterpret_cast<ra::mouse_modifier*>(buffer) = global.modifier;
- global.modifier = *reinterpret_cast<ra::mouse_modifier*>(input_buffer);
+ WdfRequestComplete(Request, STATUS_SUCCESS);
+ }
+ else {
+ DebugPrint(("Received unknown request: in %uB, out %uB\n", InputBufferLength, OutputBufferLength));
+ // status maps to win32 error code 1784: ERROR_INVALID_USER_BUFFER
+ WdfRequestComplete(Request, STATUS_INVALID_BUFFER_SIZE);
+ }
- WdfRequestComplete(Request, STATUS_SUCCESS);
}
#pragma warning(pop) // enable 28118 again
diff --git a/rawaccel.sln b/rawaccel.sln
index 2235818..3325e47 100644
--- a/rawaccel.sln
+++ b/rawaccel.sln
@@ -23,7 +23,6 @@ Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
common-install\common-install.vcxitems*{058d66c6-d88b-4fdb-b0e4-0a6fe7483b95}*SharedItemsImports = 9
common\common.vcxitems*{24b4226f-1461-408f-a1a4-1371c97153ea}*SharedItemsImports = 9
- common\common.vcxitems*{60d6c942-ac20-4c05-a2be-54b5c966534d}*SharedItemsImports = 4
common-install\common-install.vcxitems*{896950d1-520a-420a-b6b1-73014b92a68c}*SharedItemsImports = 4
common-install\common-install.vcxitems*{a4097ff6-a6f0-44e8-b8d0-538d0fb75936}*SharedItemsImports = 4
common\common.vcxitems*{ab7b3759-b85f-4067-8935-fb4539b41869}*SharedItemsImports = 4
diff --git a/wrapper/wrapper.cpp b/wrapper/wrapper.cpp
index ceee1a1..bd0574f 100644
--- a/wrapper/wrapper.cpp
+++ b/wrapper/wrapper.cpp
@@ -1,6 +1,7 @@
#pragma once
#include "wrapper.hpp"
+
using namespace rawaccel;
using namespace System;
diff --git a/wrapper/wrapper.hpp b/wrapper/wrapper.hpp
index 870aca7..e8f100d 100644
--- a/wrapper/wrapper.hpp
+++ b/wrapper/wrapper.hpp
@@ -1,16 +1,14 @@
#pragma once
-#include "wrapper_writer.hpp"
-#include "..\common\rawaccel.hpp";
-#include "..\common\accel-error.hpp";
#include <iostream>
-using namespace rawaccel;
-using namespace System;
+#include <rawaccel.hpp>
+#include <accel-error.hpp>
-public value struct ArgsWrapper {
- int a;
-};
+#include "wrapper_writer.hpp"
+
+using namespace rawaccel;
+using namespace System;
public ref class ManagedAccel
{
diff --git a/wrapper/wrapper.vcxproj b/wrapper/wrapper.vcxproj
index 28acbe7..bffbf8b 100644
--- a/wrapper/wrapper.vcxproj
+++ b/wrapper/wrapper.vcxproj
@@ -59,6 +59,7 @@
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
+ <Import Project="..\common\common.vcxitems" Label="Shared" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
diff --git a/wrapper/wrapper_writer.cpp b/wrapper/wrapper_writer.cpp
index 0a74105..da7c9bf 100644
--- a/wrapper/wrapper_writer.cpp
+++ b/wrapper/wrapper_writer.cpp
@@ -1,9 +1,9 @@
#pragma once
-#include "..\console\console_write.cpp"
+#include <rawaccel-io.hpp>
#include "wrapper_writer.hpp"
void writer::writeToDriver(rawaccel::mouse_modifier* modifier)
{
- write(*modifier);
+ rawaccel::write(*modifier);
}
diff --git a/wrapper/wrapper_writer.hpp b/wrapper/wrapper_writer.hpp
index 591f62f..dcbef10 100644
--- a/wrapper/wrapper_writer.hpp
+++ b/wrapper/wrapper_writer.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "..\common\rawaccel.hpp"
+#include <rawaccel.hpp>
struct writer {
void writeToDriver(rawaccel::mouse_modifier* modifier);