7 #define SERMOUSE_TAG 'uoMS'
16 } SERMOUSE_DEVICE_STATE
;
20 mtNone
, /* No Mouse */
21 mtMicrosoft
, /* Microsoft Mouse with 2 buttons */
22 mtLogitech
, /* Logitech Mouse with 3 buttons */
23 mtWheelZ
/* Microsoft Wheel Mouse (aka Z Mouse) */
24 } SERMOUSE_MOUSE_TYPE
;
26 /* Size for packet buffer used in interrupt routine */
27 #define PACKET_BUFFER_SIZE 4
29 /* Hardware byte mask for left button */
30 #define LEFT_BUTTON_MASK 0x20
31 /* Hardware to Microsoft specific code byte shift for left button */
32 #define LEFT_BUTTON_SHIFT 5
33 /* Hardware byte mask for right button */
34 #define RIGHT_BUTTON_MASK 0x10
35 /* Hardware to Microsoft specific code byte shift for right button */
36 #define RIGHT_BUTTON_SHIFT 3
37 /* Hardware byte mask for middle button */
38 #define MIDDLE_BUTTON_MASK 0x20
39 /* Hardware to Microsoft specific code byte shift for middle button */
40 #define MIDDLE_BUTTON_SHIFT 3
42 /* Microsoft byte mask for left button */
43 #define MOUSE_BUTTON_LEFT 0x01
44 /* Microsoft byte mask for right button */
45 #define MOUSE_BUTTON_RIGHT 0x02
46 /* Microsoft byte mask for middle button */
47 #define MOUSE_BUTTON_MIDDLE 0x04
49 typedef struct _SERMOUSE_DRIVER_EXTENSION
51 USHORT NumberOfButtons
;
52 } SERMOUSE_DRIVER_EXTENSION
, *PSERMOUSE_DRIVER_EXTENSION
;
54 typedef struct _SERMOUSE_DEVICE_EXTENSION
56 PDEVICE_OBJECT LowerDevice
;
57 SERMOUSE_DEVICE_STATE PnpState
;
58 SERMOUSE_MOUSE_TYPE MouseType
;
59 PSERMOUSE_DRIVER_EXTENSION DriverExtension
;
61 HANDLE WorkerThreadHandle
;
62 KEVENT StopWorkerThreadEvent
;
65 ULONG InputDataCount
[2];
66 CONNECT_DATA ConnectData
;
67 MOUSE_INPUT_DATA MouseInputData
[2];
68 UCHAR PacketBuffer
[PACKET_BUFFER_SIZE
];
69 ULONG PacketBufferPosition
;
70 ULONG PreviousButtons
;
71 MOUSE_ATTRIBUTES AttributesInformation
;
72 } SERMOUSE_DEVICE_EXTENSION
, *PSERMOUSE_DEVICE_EXTENSION
;
74 /************************************ createclose.c */
76 DRIVER_DISPATCH SermouseCreate
;
78 DRIVER_DISPATCH SermouseClose
;
80 DRIVER_DISPATCH SermouseCleanup
;
82 /************************************ detect.c */
85 SermouseDetectLegacyDevice(
86 IN PDEVICE_OBJECT LowerDevice
);
88 /************************************ fdo.c */
90 DRIVER_ADD_DEVICE SermouseAddDevice
;
92 DRIVER_DISPATCH SermousePnp
;
94 /************************************ internaldevctl.c */
96 DRIVER_DISPATCH SermouseInternalDeviceControl
;
98 /************************************ misc.c */
102 IN PDEVICE_OBJECT DeviceObject
,
107 IN PDEVICE_OBJECT DeviceObject
,
110 /************************************ readmouse.c */
113 SermouseDeviceWorker(