forked from RawAccelOfficial/rawaccel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdriver.h
64 lines (50 loc) · 1.45 KB
/
driver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
#include "rawaccel.hpp"
#include "rawaccel-io-def.h"
#include <kbdmou.h>
#include <wdf.h>
#if DBG
#define DebugPrint(_x_) DbgPrint _x_
#else
#define DebugPrint(_x_)
#endif
#define NTDEVICE_NAME L"\\Device\\rawaccel"
#define SYMBOLIC_NAME_STRING L"\\DosDevices\\rawaccel"
using counter_t = long long;
namespace ra = rawaccel;
typedef struct _DEVICE_EXTENSION {
bool enable;
bool keep_time;
bool set_extra_info;
double dpi_factor;
counter_t counter;
ra::time_clamp clamp;
ra::modifier mod;
vec2d carry;
CONNECT_DATA UpperConnectData;
ra::modifier_settings mod_settings;
ra::speed_processor speed_processor;
WCHAR dev_id[ra::MAX_DEV_ID_LEN];
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_EXTENSION, FilterGetData)
EXTERN_C_START
DRIVER_INITIALIZE DriverEntry;
EVT_WDF_DRIVER_DEVICE_ADD EvtDeviceAdd;
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL EvtIoInternalDeviceControl;
EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL RawaccelControl;
EVT_WDF_OBJECT_CONTEXT_CLEANUP DeviceCleanup;
VOID DeviceSetup(WDFOBJECT);
VOID WriteDelay(VOID);
VOID RawaccelInit(WDFDRIVER);
NTSTATUS CreateControlDevice(WDFDRIVER);
EXTERN_C_END
VOID RawaccelCallback(
IN PDEVICE_OBJECT DeviceObject,
IN PMOUSE_INPUT_DATA InputDataStart,
IN PMOUSE_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed
);
VOID DispatchPassThrough(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET Target
);