ReactOS 0.4.16-dev-125-g798ea90
sermouse.h File Reference
#include <ntddk.h>
#include <ntddser.h>
#include <kbdmou.h>
Include dependency graph for sermouse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _SERMOUSE_DRIVER_EXTENSION
 
struct  _SERMOUSE_DEVICE_EXTENSION
 

Macros

#define SERMOUSE_TAG   'uoMS'
 
#define PACKET_BUFFER_SIZE   4
 
#define LEFT_BUTTON_MASK   0x20
 
#define LEFT_BUTTON_SHIFT   5
 
#define RIGHT_BUTTON_MASK   0x10
 
#define RIGHT_BUTTON_SHIFT   3
 
#define MIDDLE_BUTTON_MASK   0x20
 
#define MIDDLE_BUTTON_SHIFT   3
 
#define MOUSE_BUTTON_LEFT   0x01
 
#define MOUSE_BUTTON_RIGHT   0x02
 
#define MOUSE_BUTTON_MIDDLE   0x04
 

Typedefs

typedef struct _SERMOUSE_DRIVER_EXTENSION SERMOUSE_DRIVER_EXTENSION
 
typedef struct _SERMOUSE_DRIVER_EXTENSIONPSERMOUSE_DRIVER_EXTENSION
 
typedef struct _SERMOUSE_DEVICE_EXTENSION SERMOUSE_DEVICE_EXTENSION
 
typedef struct _SERMOUSE_DEVICE_EXTENSIONPSERMOUSE_DEVICE_EXTENSION
 

Enumerations

enum  SERMOUSE_DEVICE_STATE {
  dsStopped , dsStarted , dsPaused , dsRemoved ,
  dsSurpriseRemoved
}
 
enum  SERMOUSE_MOUSE_TYPE { mtNone , mtMicrosoft , mtLogitech , mtWheelZ }
 

Functions

SERMOUSE_MOUSE_TYPE SermouseDetectLegacyDevice (IN PDEVICE_OBJECT LowerDevice)
 
NTSTATUS NTAPI ForwardIrpAndForget (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
VOID NTAPI SermouseDeviceWorker (PVOID Context)
 

Variables

DRIVER_DISPATCH SermouseCreate
 
DRIVER_DISPATCH SermouseClose
 
DRIVER_DISPATCH SermouseCleanup
 
DRIVER_ADD_DEVICE SermouseAddDevice
 
DRIVER_DISPATCH SermousePnp
 
DRIVER_DISPATCH SermouseInternalDeviceControl
 

Macro Definition Documentation

◆ LEFT_BUTTON_MASK

#define LEFT_BUTTON_MASK   0x20

Definition at line 31 of file sermouse.h.

◆ LEFT_BUTTON_SHIFT

#define LEFT_BUTTON_SHIFT   5

Definition at line 33 of file sermouse.h.

◆ MIDDLE_BUTTON_MASK

#define MIDDLE_BUTTON_MASK   0x20

Definition at line 39 of file sermouse.h.

◆ MIDDLE_BUTTON_SHIFT

#define MIDDLE_BUTTON_SHIFT   3

Definition at line 41 of file sermouse.h.

◆ MOUSE_BUTTON_LEFT

#define MOUSE_BUTTON_LEFT   0x01

Definition at line 44 of file sermouse.h.

◆ MOUSE_BUTTON_MIDDLE

#define MOUSE_BUTTON_MIDDLE   0x04

Definition at line 48 of file sermouse.h.

◆ MOUSE_BUTTON_RIGHT

#define MOUSE_BUTTON_RIGHT   0x02

Definition at line 46 of file sermouse.h.

◆ PACKET_BUFFER_SIZE

#define PACKET_BUFFER_SIZE   4

Definition at line 28 of file sermouse.h.

◆ RIGHT_BUTTON_MASK

#define RIGHT_BUTTON_MASK   0x10

Definition at line 35 of file sermouse.h.

◆ RIGHT_BUTTON_SHIFT

#define RIGHT_BUTTON_SHIFT   3

Definition at line 37 of file sermouse.h.

◆ SERMOUSE_TAG

#define SERMOUSE_TAG   'uoMS'

Definition at line 8 of file sermouse.h.

Typedef Documentation

◆ PSERMOUSE_DEVICE_EXTENSION

◆ PSERMOUSE_DRIVER_EXTENSION

◆ SERMOUSE_DEVICE_EXTENSION

◆ SERMOUSE_DRIVER_EXTENSION

Enumeration Type Documentation

◆ SERMOUSE_DEVICE_STATE

Enumerator
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 

Definition at line 10 of file sermouse.h.

11{
SERMOUSE_DEVICE_STATE
Definition: sermouse.h:11
@ dsSurpriseRemoved
Definition: sermouse.h:16
@ dsStopped
Definition: sermouse.h:12
@ dsPaused
Definition: sermouse.h:14
@ dsStarted
Definition: sermouse.h:13
@ dsRemoved
Definition: sermouse.h:15

◆ SERMOUSE_MOUSE_TYPE

Enumerator
mtNone 
mtMicrosoft 
mtLogitech 
mtWheelZ 

Definition at line 19 of file sermouse.h.

20{
21 mtNone, /* No Mouse */
22 mtMicrosoft, /* Microsoft Mouse with 2 buttons */
23 mtLogitech, /* Logitech Mouse with 3 buttons */
24 mtWheelZ /* Microsoft Wheel Mouse (aka Z Mouse) */
SERMOUSE_MOUSE_TYPE
Definition: sermouse.h:20
@ mtMicrosoft
Definition: sermouse.h:22
@ mtNone
Definition: sermouse.h:21
@ mtLogitech
Definition: sermouse.h:23
@ mtWheelZ
Definition: sermouse.h:24

Function Documentation

◆ ForwardIrpAndForget()

NTSTATUS NTAPI ForwardIrpAndForget ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 18 of file misc.c.

21{
22 PDEVICE_OBJECT LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
23
24 ASSERT(LowerDevice);
25
27 return IoCallDriver(LowerDevice, Irp);
28}
_In_ PIRP Irp
Definition: csq.h:116
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
#define ASSERT(a)
Definition: mode.c:44
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCallDriver
Definition: irp.c:1225
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

◆ SermouseDetectLegacyDevice()

SERMOUSE_MOUSE_TYPE SermouseDetectLegacyDevice ( IN PDEVICE_OBJECT  LowerDevice)

Definition at line 117 of file detect.c.

119{
121 ULONG Fcr, Mcr;
122 ULONG BaudRate;
124 SERIAL_TIMEOUTS Timeouts;
126 ULONG_PTR i, Count = 0;
127 UCHAR Buffer[16];
128 SERMOUSE_MOUSE_TYPE MouseType = mtNone;
130
131 TRACE_(SERMOUSE, "SermouseDetectLegacyDevice(LowerDevice %p)\n", LowerDevice);
132
133 RtlZeroMemory(Buffer, sizeof(Buffer));
134
135 /* Open port */
137 LowerDevice,
139 NULL,
140 0,
141 NULL,
143 &Handle);
144 if (!NT_SUCCESS(Status)) return mtNone;
145
146 /* Reset UART */
147 TRACE_(SERMOUSE, "Reset UART\n");
148 Mcr = 0; /* MCR: DTR/RTS/OUT2 off */
150 &Mcr, sizeof(Mcr), NULL, NULL);
151 if (!NT_SUCCESS(Status)) goto ByeBye;
152
153 /* Set communications parameters */
154 TRACE_(SERMOUSE, "Set communications parameters\n");
155 /* DLAB off */
156 Fcr = 0;
158 &Fcr, sizeof(Fcr), NULL, NULL);
159 if (!NT_SUCCESS(Status)) goto ByeBye;
160 /* Set serial port speed */
161 BaudRate = 1200;
163 &BaudRate, sizeof(BaudRate), NULL, NULL);
164 if (!NT_SUCCESS(Status)) goto ByeBye;
165 /* Set LCR */
166 LCR.WordLength = 7;
167 LCR.Parity = NO_PARITY;
168 LCR.StopBits = STOP_BITS_2;
170 &LCR, sizeof(LCR), NULL, NULL);
171 if (!NT_SUCCESS(Status)) goto ByeBye;
172
173 /* Flush receive buffer */
174 TRACE_(SERMOUSE, "Flush receive buffer\n");
177 &Command, sizeof(Command), NULL, NULL);
178 if (!NT_SUCCESS(Status)) goto ByeBye;
179 /* Wait 100 ms */
180 Wait(100);
181
182 /* Enable DTR/RTS */
183 TRACE_(SERMOUSE, "Enable DTR/RTS\n");
185 NULL, 0, NULL, NULL);
186 if (!NT_SUCCESS(Status)) goto ByeBye;
188 NULL, 0, NULL, NULL);
189 if (!NT_SUCCESS(Status)) goto ByeBye;
190
191 /* Set timeout to 500 microseconds */
192 TRACE_(SERMOUSE, "Set timeout to 500 microseconds\n");
193 Timeouts.ReadIntervalTimeout = 100;
194 Timeouts.ReadTotalTimeoutMultiplier = 0;
195 Timeouts.ReadTotalTimeoutConstant = 500;
198 &Timeouts, sizeof(Timeouts), NULL, NULL);
199 if (!NT_SUCCESS(Status)) goto ByeBye;
200
201 /* Fill the read buffer */
202 TRACE_(SERMOUSE, "Fill the read buffer\n");
203 Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count);
204 if (!NT_SUCCESS(Status)) goto ByeBye;
205
206 for (i = 0; i < Count; i++)
207 {
208 if (Buffer[i] == 'B')
209 {
210 /* Sign for Microsoft Ballpoint */
211 ERR_(SERMOUSE, "Microsoft Ballpoint device detected. THIS DEVICE IS NOT YET SUPPORTED");
212 MouseType = mtNone;
213 goto ByeBye;
214 }
215 else if (Buffer[i] == 'M')
216 {
217 /* Sign for Microsoft Mouse protocol followed by button specifier */
218 if (i == sizeof(Buffer) - 1)
219 {
220 /* Overflow Error */
221 goto ByeBye;
222 }
223 switch (Buffer[i + 1])
224 {
225 case '3':
226 INFO_(SERMOUSE, "Microsoft Mouse with 3-buttons detected\n");
227 MouseType = mtLogitech;
228 break;
229 case 'Z':
230 INFO_(SERMOUSE, "Microsoft Wheel Mouse detected\n");
231 MouseType = mtWheelZ;
232 break;
233 default:
234 INFO_(SERMOUSE, "Microsoft Mouse with 2-buttons detected\n");
235 MouseType = mtMicrosoft;
236 break;
237 }
238 goto ByeBye;
239 }
240 }
241
242ByeBye:
243 /* Close port */
244 if (Handle)
246 return MouseType;
247}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define TRACE_(x)
Definition: compat.h:76
static NTSTATUS DeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG CtlCode, IN PVOID InputBuffer OPTIONAL, IN SIZE_T InputBufferSize, IN OUT PVOID OutputBuffer OPTIONAL, IN OUT PSIZE_T OutputBufferSize)
Definition: detect.c:19
static NTSTATUS ReadBytes(IN PDEVICE_OBJECT LowerDevice, OUT PUCHAR Buffer, IN ULONG BufferSize, OUT PULONG_PTR FilledBytes)
Definition: detect.c:67
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
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
Definition: glfuncs.h:248
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define STOP_BITS_2
Definition: serial.c:87
#define SERIAL_PURGE_RXCLEAR
Definition: serial.c:96
#define NO_PARITY
Definition: serial.c:89
#define KernelMode
Definition: asm.h:34
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
int Count
Definition: noreturn.cpp:7
#define IOCTL_SERIAL_SET_LINE_CONTROL
Definition: ntddser.h:96
#define IOCTL_SERIAL_SET_TIMEOUTS
Definition: ntddser.h:104
#define IOCTL_SERIAL_SET_MODEM_CONTROL
Definition: ntddser.h:98
#define IOCTL_SERIAL_SET_FIFO_CONTROL
Definition: ntddser.h:92
#define IOCTL_SERIAL_SET_BAUD_RATE
Definition: ntddser.h:82
#define IOCTL_SERIAL_SET_DTR
Definition: ntddser.h:90
#define IOCTL_SERIAL_SET_RTS
Definition: ntddser.h:102
NTSTATUS NTAPI ObOpenObjectByPointer(IN PVOID Object, IN ULONG HandleAttributes, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PHANDLE Handle)
Definition: obhandle.c:2742
#define INFO_(ch,...)
Definition: debug.h:159
#define ERR_(ch,...)
Definition: debug.h:156
Definition: shell.h:41
ULONG WriteTotalTimeoutMultiplier
Definition: ntddser.h:306
ULONG ReadTotalTimeoutConstant
Definition: ntddser.h:305
ULONG WriteTotalTimeoutConstant
Definition: ntddser.h:307
ULONG ReadTotalTimeoutMultiplier
Definition: ntddser.h:304
ULONG ReadIntervalTimeout
Definition: ntddser.h:303
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by SermouseStartDevice().

◆ SermouseDeviceWorker()

VOID NTAPI SermouseDeviceWorker ( PVOID  Context)

Definition at line 64 of file readmouse.c.

66{
67 PSERMOUSE_DEVICE_EXTENSION DeviceExtension;
68 PDEVICE_OBJECT LowerDevice;
70 PIRP Irp;
71 IO_STATUS_BLOCK ioStatus;
73 PUCHAR PacketBuffer;
74 UCHAR ReceivedByte;
77 ULONG ButtonsDifference;
79 ULONG i;
80 ULONG Fcr;
81 ULONG BaudRate;
82 SERIAL_TIMEOUTS Timeouts;
86
87 TRACE_(SERMOUSE, "SermouseDeviceWorker() called\n");
88
89 DeviceExtension = (PSERMOUSE_DEVICE_EXTENSION)((PDEVICE_OBJECT)Context)->DeviceExtension;
90 LowerDevice = DeviceExtension->LowerDevice;
91 Zero.QuadPart = 0;
92 PacketBuffer = DeviceExtension->PacketBuffer;
93
94 ASSERT(LowerDevice);
95
96 /* Initialize device extension */
97 DeviceExtension->ActiveQueue = 0;
98 DeviceExtension->PacketBufferPosition = 0;
99 DeviceExtension->PreviousButtons = 0;
100
101 /* Initialize serial port */
102 Fcr = 0;
104 &Fcr, sizeof(Fcr), NULL, NULL);
106 /* Set serial port speed */
107 BaudRate = DeviceExtension->AttributesInformation.SampleRate * 8;
109 &BaudRate, sizeof(BaudRate), NULL, NULL);
111 /* Set LCR */
112 LCR.WordLength = 7;
113 LCR.Parity = NO_PARITY;
114 LCR.StopBits = STOP_BIT_1;
116 &LCR, sizeof(LCR), NULL, NULL);
118
119 /* Set timeouts */
121 Timeouts.ReadIntervalTimeout = 100;
124 &Timeouts, sizeof(Timeouts), NULL, NULL);
126
127 /* main read loop */
129 while (TRUE)
130 {
132 &DeviceExtension->StopWorkerThreadEvent,
133 Executive,
135 TRUE,
136 &Zero);
137 if (Status != STATUS_TIMEOUT)
138 {
139 /* we need to stop the worker thread */
140 KeClearEvent(&DeviceExtension->StopWorkerThreadEvent);
141 break;
142 }
143
147 LowerDevice,
149 &Zero,
150 &event,
151 &ioStatus);
152 if (!Irp)
153 {
154 /* No memory actually, try later */
155 INFO_(SERMOUSE, "No memory actually, trying again\n");
157 continue;
158 }
159
160 Status = IoCallDriver(LowerDevice, Irp);
161 if (Status == STATUS_PENDING)
162 {
164 Status = ioStatus.Status;
165 }
166
167 if (!NT_SUCCESS(Status))
168 continue;
169
170 /* Read all available data and process */
171 for (i = 0; i < ioStatus.Information; i++)
172 {
173 ReceivedByte = Buffer[i];
174 INFO_(SERMOUSE, "ReceivedByte 0x%02x\n", ReceivedByte);
175
176 /* Synchronize */
177 if ((ReceivedByte & 0x40) == 0x40)
178 DeviceExtension->PacketBufferPosition = 0;
179
180 PacketBuffer[DeviceExtension->PacketBufferPosition] = ReceivedByte & 0x7f;
181 DeviceExtension->PacketBufferPosition++;
182
183 /* Process packet if complete */
184 if (DeviceExtension->PacketBufferPosition >= 3)
185 {
186 Queue = DeviceExtension->ActiveQueue % 2;
187
188 /* Prevent buffer overflow */
189 if (DeviceExtension->InputDataCount[Queue] == 1)
190 continue;
191
192 Input = &DeviceExtension->MouseInputData[Queue];
193
194 if (DeviceExtension->PacketBufferPosition == 3)
195 {
196 /* Retrieve change in x and y from packet */
197 Input->LastX = (signed char)(PacketBuffer[1] | ((PacketBuffer[0] & 0x03) << 6));
198 Input->LastY = (signed char)(PacketBuffer[2] | ((PacketBuffer[0] & 0x0c) << 4));
199
200 /* Determine the current state of the buttons */
201 Input->RawButtons = (DeviceExtension->PreviousButtons & MOUSE_BUTTON_MIDDLE) |
202 ((UCHAR)(PacketBuffer[0] & LEFT_BUTTON_MASK) >> LEFT_BUTTON_SHIFT) |
203 ((UCHAR)(PacketBuffer[0] & RIGHT_BUTTON_MASK) >> RIGHT_BUTTON_SHIFT);
204 }
205 else if (DeviceExtension->PacketBufferPosition == 4)
206 {
207 DeviceExtension->PacketBufferPosition = 0;
208 /* If middle button state changed than report event */
209 if (((UCHAR)(PacketBuffer[3] & MIDDLE_BUTTON_MASK) >> MIDDLE_BUTTON_SHIFT) ^
210 (DeviceExtension->PreviousButtons & MOUSE_BUTTON_MIDDLE))
211 {
212 Input->RawButtons ^= MOUSE_BUTTON_MIDDLE;
213 Input->LastX = 0;
214 Input->LastY = 0;
215 }
216 else
217 {
218 continue;
219 }
220 }
221
222 /* Determine ButtonFlags */
223 Input->ButtonFlags = 0;
224 ButtonsDifference = DeviceExtension->PreviousButtons ^ Input->RawButtons;
225
226 if (ButtonsDifference != 0)
227 {
228 if (ButtonsDifference & MOUSE_BUTTON_LEFT
229 && DeviceExtension->AttributesInformation.NumberOfButtons >= 1)
230 {
231 if (Input->RawButtons & MOUSE_BUTTON_LEFT)
232 Input->ButtonFlags |= MOUSE_LEFT_BUTTON_DOWN;
233 else
234 Input->ButtonFlags |= MOUSE_LEFT_BUTTON_UP;
235 }
236
237 if (ButtonsDifference & MOUSE_BUTTON_RIGHT
238 && DeviceExtension->AttributesInformation.NumberOfButtons >= 2)
239 {
240 if (Input->RawButtons & MOUSE_BUTTON_RIGHT)
241 Input->ButtonFlags |= MOUSE_RIGHT_BUTTON_DOWN;
242 else
243 Input->ButtonFlags |= MOUSE_RIGHT_BUTTON_UP;
244 }
245
246 if (ButtonsDifference & MOUSE_BUTTON_MIDDLE
247 && DeviceExtension->AttributesInformation.NumberOfButtons >= 3)
248 {
249 if (Input->RawButtons & MOUSE_BUTTON_MIDDLE)
250 Input->ButtonFlags |= MOUSE_MIDDLE_BUTTON_DOWN;
251 else
252 Input->ButtonFlags |= MOUSE_MIDDLE_BUTTON_UP;
253 }
254 }
255
256 /* Send the Input data to the Mouse Class driver */
257 DeviceExtension->InputDataCount[Queue]++;
258
260 InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
262 DeviceExtension->ConnectData.ClassDeviceObject,
263 &DeviceExtension->MouseInputData[Queue],
264 &DeviceExtension->MouseInputData[Queue] + 1,
265 &DeviceExtension->InputDataCount[Queue]);
267 DeviceExtension->InputDataCount[Queue] = 0;
268
269 /* Copy RawButtons to Previous Buttons for Input */
270 DeviceExtension->PreviousButtons = Input->RawButtons;
271 }
272 }
273 }
274
276}
#define InterlockedIncrement
Definition: armddk.h:53
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned char
Definition: typeof.h:29
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
VOID NTAPI KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:419
struct _cl_event * event
Definition: glext.h:7739
VOID(STDAPICALLTYPE * PSERVICE_CALLBACK_ROUTINE)(IN PVOID NormalContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2, IN OUT PVOID SystemArgument3)
Definition: kbdmou.h:86
#define KeStallExecutionProcessor(MicroSeconds)
Definition: precomp.h:27
#define MOUSE_LEFT_BUTTON_DOWN
Definition: ntddmou.h:46
#define MOUSE_LEFT_BUTTON_UP
Definition: ntddmou.h:47
#define MOUSE_MIDDLE_BUTTON_DOWN
Definition: ntddmou.h:50
#define MOUSE_RIGHT_BUTTON_UP
Definition: ntddmou.h:49
#define MOUSE_MIDDLE_BUTTON_UP
Definition: ntddmou.h:51
#define MOUSE_RIGHT_BUTTON_DOWN
Definition: ntddmou.h:48
#define STOP_BIT_1
Definition: ntddser.h:215
@ NotificationEvent
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)
Definition: irp.c:1069
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
Definition: kill.c:1145
#define STATUS_TIMEOUT
Definition: ntstatus.h:81
#define STATUS_PENDING
Definition: ntstatus.h:82
#define IRP_MJ_READ
Definition: rdpdr.c:46
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)
Definition: readmouse.c:16
@ Input
Definition: arc.h:84
#define LEFT_BUTTON_MASK
Definition: sermouse.h:31
#define MIDDLE_BUTTON_SHIFT
Definition: sermouse.h:41
#define RIGHT_BUTTON_MASK
Definition: sermouse.h:35
struct _SERMOUSE_DEVICE_EXTENSION * PSERMOUSE_DEVICE_EXTENSION
#define MOUSE_BUTTON_LEFT
Definition: sermouse.h:44
#define MIDDLE_BUTTON_MASK
Definition: sermouse.h:39
#define PACKET_BUFFER_SIZE
Definition: sermouse.h:28
#define RIGHT_BUTTON_SHIFT
Definition: sermouse.h:37
#define MOUSE_BUTTON_MIDDLE
Definition: sermouse.h:48
#define MOUSE_BUTTON_RIGHT
Definition: sermouse.h:46
#define LEFT_BUTTON_SHIFT
Definition: sermouse.h:33
#define STATUS_SUCCESS
Definition: shellext.h:65
PVOID ClassService
Definition: kbdmou.h:82
PDEVICE_OBJECT ClassDeviceObject
Definition: kbdmou.h:81
USHORT SampleRate
Definition: ntddmou.h:111
USHORT NumberOfButtons
Definition: ntddmou.h:110
CONNECT_DATA ConnectData
Definition: sermouse.h:67
PDEVICE_OBJECT LowerDevice
Definition: sermouse.h:57
MOUSE_ATTRIBUTES AttributesInformation
Definition: sermouse.h:72
UCHAR PacketBuffer[PACKET_BUFFER_SIZE]
Definition: sermouse.h:69
MOUSE_INPUT_DATA MouseInputData[2]
Definition: sermouse.h:68
int32_t * PLONG
Definition: typedefs.h:58
unsigned char * PUCHAR
Definition: typedefs.h:53
_Must_inspect_result_ _In_ WDFDEVICE _In_ PIRP _In_ WDFQUEUE Queue
Definition: wdfdevice.h:2225
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
@ Suspended
Definition: ketypes.h:420
@ Executive
Definition: ketypes.h:415

Referenced by SermouseStartDevice().

Variable Documentation

◆ SermouseAddDevice

DRIVER_ADD_DEVICE SermouseAddDevice

Definition at line 91 of file sermouse.h.

Referenced by DriverEntry().

◆ SermouseCleanup

DRIVER_DISPATCH SermouseCleanup

Definition at line 81 of file sermouse.h.

Referenced by DriverEntry().

◆ SermouseClose

DRIVER_DISPATCH SermouseClose

Definition at line 79 of file sermouse.h.

Referenced by DriverEntry().

◆ SermouseCreate

DRIVER_DISPATCH SermouseCreate

Definition at line 77 of file sermouse.h.

Referenced by DriverEntry().

◆ SermouseInternalDeviceControl

DRIVER_DISPATCH SermouseInternalDeviceControl

Definition at line 97 of file sermouse.h.

Referenced by DriverEntry().

◆ SermousePnp

DRIVER_DISPATCH SermousePnp

Definition at line 93 of file sermouse.h.

Referenced by DriverEntry().