-
Notifications
You must be signed in to change notification settings - Fork 0
/
moufiltr.h
136 lines (91 loc) · 2.47 KB
/
moufiltr.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*++
Copyright (c) 2008 Microsoft Corporation
Module Name:
moufiltr.h
Abstract:
This module contains the common private declarations for the mouse
packet filter
Environment:
kernel mode only
Notes:
Revision History:
--*/
#ifndef MOUFILTER_H
#define MOUFILTER_H
#include <ntddk.h>
#include <kbdmou.h>
#include <ntddmou.h>
#include <ntdd8042.h>
#include <ntstrsafe.h>
#include <wdf.h>
#if DBG
#define TRAP() DbgBreakPoint()
#define DebugPrint(_x_) DbgPrint _x_
#else // DBG
#define TRAP()
#define DebugPrint(_x_)
#endif
IO_WORKITEM_ROUTINE workItemRoutine;
typedef struct _DEVICE_EXTENSION
{
//
// Previous hook routine and context
//
PVOID UpperContext;
PI8042_MOUSE_ISR UpperIsrHook;
//
// Write to the mouse in the context of MouFilter_IsrHook
//
IN PI8042_ISR_WRITE_PORT IsrWritePort;
//
// Context for IsrWritePort, QueueMousePacket
//
IN PVOID CallContext;
//
// Queue the current packet (ie the one passed into MouFilter_IsrHook)
// to be reported to the class driver
//
IN PI8042_QUEUE_PACKET QueueMousePacket;
//
// The real connect data that this driver reports to
//
CONNECT_DATA UpperConnectData;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_EXTENSION,
FilterGetData)
typedef struct _WORKITEM_CONTEXT {
PIO_WORKITEM workItem;
PMOUSE_INPUT_DATA data;
}WORKITEM_CONTEXT, *PWORKITEM_CONTEXT;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(
WORKITEM_CONTEXT, GetWorkItemContext)
//
// Prototypes
//
DRIVER_INITIALIZE DriverEntry;
EVT_WDF_DRIVER_DEVICE_ADD MouFilter_EvtDeviceAdd;
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL MouFilter_EvtIoInternalDeviceControl;
VOID
MouFilter_DispatchPassThrough(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET Target
);
BOOLEAN
MouFilter_IsrHook (
PVOID DeviceExtension,
PMOUSE_INPUT_DATA CurrentInput,
POUTPUT_PACKET CurrentOutput,
UCHAR StatusByte,
PUCHAR DataByte,
PBOOLEAN ContinueProcessing,
PMOUSE_STATE MouseState,
PMOUSE_RESET_SUBSTATE ResetSubState
);
VOID
MouFilter_ServiceCallback(
IN PDEVICE_OBJECT DeviceObject,
IN PMOUSE_INPUT_DATA InputDataStart,
IN PMOUSE_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed
);
#endif // MOUFILTER_H