66{
77 ULONG ButtonsDifference;
86
87 TRACE_(SERMOUSE,
"SermouseDeviceWorker() called\n");
88
93
95
96
100
101
102 Fcr = 0;
106
109 &BaudRate,
sizeof(BaudRate),
NULL,
NULL);
111
118
119
124 &Timeouts,
sizeof(Timeouts),
NULL,
NULL);
126
127
130 {
138 {
139
141 break;
142 }
143
147 LowerDevice,
151 &ioStatus);
153 {
154
155 INFO_(SERMOUSE,
"No memory actually, trying again\n");
157 continue;
158 }
159
162 {
165 }
166
168 continue;
169
170
172 {
174 INFO_(SERMOUSE,
"ReceivedByte 0x%02x\n", ReceivedByte);
175
176
177 if ((ReceivedByte & 0x40) == 0x40)
179
182
183
185 {
187
188
190 continue;
191
193
195 {
196
197 Input->LastX = (
signed char)(PacketBuffer[1] | ((PacketBuffer[0] & 0x03) << 6));
198 Input->LastY = (
signed char)(PacketBuffer[2] | ((PacketBuffer[0] & 0x0c) << 4));
199
200
204 }
206 {
208
211 {
215 }
216 else
217 {
218 continue;
219 }
220 }
221
222
223 Input->ButtonFlags = 0;
225
226 if (ButtonsDifference != 0)
227 {
230 {
233 else
235 }
236
239 {
242 else
244 }
245
248 {
251 else
253 }
254 }
255
256
258
268
269
271 }
272 }
273 }
274
276}
#define InterlockedIncrement
#define NT_SUCCESS(StatCode)
#define KeRaiseIrql(irql, oldIrql)
#define KeLowerIrql(oldIrql)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID(STDAPICALLTYPE * PSERVICE_CALLBACK_ROUTINE)(IN PVOID NormalContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2, IN OUT PVOID SystemArgument3)
#define KeStallExecutionProcessor(MicroSeconds)
#define MOUSE_LEFT_BUTTON_DOWN
#define MOUSE_LEFT_BUTTON_UP
#define MOUSE_MIDDLE_BUTTON_DOWN
#define MOUSE_RIGHT_BUTTON_UP
#define MOUSE_MIDDLE_BUTTON_UP
#define MOUSE_RIGHT_BUTTON_DOWN
#define IOCTL_SERIAL_SET_LINE_CONTROL
#define IOCTL_SERIAL_SET_TIMEOUTS
#define IOCTL_SERIAL_SET_FIFO_CONTROL
#define IOCTL_SERIAL_SET_BAUD_RATE
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
static NTSTATUS SermouseDeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG CtlCode, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer OPTIONAL, IN OUT PULONG OutputBufferSize)
#define MIDDLE_BUTTON_SHIFT
#define RIGHT_BUTTON_MASK
struct _SERMOUSE_DEVICE_EXTENSION * PSERMOUSE_DEVICE_EXTENSION
#define MOUSE_BUTTON_LEFT
#define MIDDLE_BUTTON_MASK
#define PACKET_BUFFER_SIZE
#define RIGHT_BUTTON_SHIFT
#define MOUSE_BUTTON_MIDDLE
#define MOUSE_BUTTON_RIGHT
#define LEFT_BUTTON_SHIFT
PDEVICE_OBJECT ClassDeviceObject
ULONG WriteTotalTimeoutMultiplier
ULONG ReadTotalTimeoutConstant
ULONG WriteTotalTimeoutConstant
ULONG ReadTotalTimeoutMultiplier
ULONG ReadIntervalTimeout
KEVENT StopWorkerThreadEvent
PDEVICE_OBJECT LowerDevice
ULONG PacketBufferPosition
MOUSE_ATTRIBUTES AttributesInformation
UCHAR PacketBuffer[PACKET_BUFFER_SIZE]
MOUSE_INPUT_DATA MouseInputData[2]
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql