9 /* FIXME: these prototypes MUST NOT be here! */
11 IoAttachDeviceToDeviceStackSafe(
12 IN PDEVICE_OBJECT SourceDevice
,
13 IN PDEVICE_OBJECT TargetDevice
,
14 OUT PDEVICE_OBJECT
*AttachedToDeviceObject
);
15 #elif defined(_MSC_VER)
17 IoAttachDeviceToDeviceStackSafe(
18 IN PDEVICE_OBJECT SourceDevice
,
19 IN PDEVICE_OBJECT TargetDevice
,
20 OUT PDEVICE_OBJECT
*AttachedToDeviceObject
);
22 #error Unknown compiler!
32 } SERMOUSE_DEVICE_STATE
;
36 mtNone
, /* No Mouse */
37 mtMicrosoft
, /* Microsoft Mouse with 2 buttons */
38 mtLogitech
, /* Logitech Mouse with 3 buttons */
39 mtWheelZ
/* Microsoft Wheel Mouse (aka Z Mouse) */
40 } SERMOUSE_MOUSE_TYPE
;
42 /* Size for packet buffer used in interrupt routine */
43 #define PACKET_BUFFER_SIZE 4
45 /* Hardware byte mask for left button */
46 #define LEFT_BUTTON_MASK 0x20
47 /* Hardware to Microsoft specific code byte shift for left button */
48 #define LEFT_BUTTON_SHIFT 5
49 /* Hardware byte mask for right button */
50 #define RIGHT_BUTTON_MASK 0x10
51 /* Hardware to Microsoft specific code byte shift for right button */
52 #define RIGHT_BUTTON_SHIFT 3
53 /* Hardware byte mask for middle button */
54 #define MIDDLE_BUTTON_MASK 0x20
55 /* Hardware to Microsoft specific code byte shift for middle button */
56 #define MIDDLE_BUTTON_SHIFT 3
58 /* Microsoft byte mask for left button */
59 #define MOUSE_BUTTON_LEFT 0x01
60 /* Microsoft byte mask for right button */
61 #define MOUSE_BUTTON_RIGHT 0x02
62 /* Microsoft byte mask for middle button */
63 #define MOUSE_BUTTON_MIDDLE 0x04
65 typedef struct _SERMOUSE_DRIVER_EXTENSION
67 ULONG MouseDataQueueSize
;
68 ULONG NumberOfButtons
;
69 UNICODE_STRING PointerDeviceBaseName
;
71 } SERMOUSE_DRIVER_EXTENSION
, *PSERMOUSE_DRIVER_EXTENSION
;
73 typedef struct _SERMOUSE_DEVICE_EXTENSION
75 PDEVICE_OBJECT LowerDevice
;
76 SERMOUSE_DEVICE_STATE PnpState
;
77 SERMOUSE_MOUSE_TYPE MouseType
;
78 PSERMOUSE_DRIVER_EXTENSION DriverExtension
;
80 HANDLE WorkerThreadHandle
;
81 KEVENT StopWorkerThreadEvent
;
84 ULONG InputDataCount
[2];
85 CONNECT_DATA ConnectData
;
86 MOUSE_INPUT_DATA
* MouseInputData
[2];
87 UCHAR PacketBuffer
[PACKET_BUFFER_SIZE
];
88 ULONG PacketBufferPosition
;
89 ULONG PreviousButtons
;
90 MOUSE_ATTRIBUTES AttributesInformation
;
91 } SERMOUSE_DEVICE_EXTENSION
, *PSERMOUSE_DEVICE_EXTENSION
;
93 /************************************ createclose.c */
97 IN PDEVICE_OBJECT DeviceObject
,
102 IN PDEVICE_OBJECT DeviceObject
,
107 IN PDEVICE_OBJECT DeviceObject
,
110 /************************************ detect.c */
113 SermouseDetectLegacyDevice(
114 IN PDEVICE_OBJECT LowerDevice
);
116 /************************************ fdo.c */
120 IN PDRIVER_OBJECT DriverObject
,
121 IN PDEVICE_OBJECT Pdo
);
125 IN PDEVICE_OBJECT DeviceObject
,
128 /************************************ internaldevctl.c */
131 SermouseInternalDeviceControl(
132 IN PDEVICE_OBJECT DeviceObject
,
135 /************************************ misc.c */
139 IN PDEVICE_OBJECT DeviceObject
,
144 IN PDEVICE_OBJECT DeviceObject
,
147 /************************************ readmouse.c */
150 SermouseDeviceWorker(