[MMEBUDDY]
[reactos.git] / reactos / drivers / input / mouclass / mouclass.h
1 #include <ntifs.h>
2 #include <kbdmou.h>
3 #include <ntddkbd.h>
4 #include <stdio.h>
5 #include <pseh/pseh2.h>
6
7 #include <debug.h>
8
9 #define MAX_PATH 260
10
11 #define MIN(a, b) ((a) < (b) ? (a) : (b))
12
13 #define CLASS_TAG 'CuoM'
14 #define DPFLTR_CLASS_NAME_ID DPFLTR_MOUCLASS_ID
15
16 typedef enum
17 {
18 dsStopped,
19 dsStarted,
20 dsPaused,
21 dsRemoved,
22 dsSurpriseRemoved
23 } PORT_DEVICE_STATE;
24
25 typedef struct _CLASS_DRIVER_EXTENSION
26 {
27 UNICODE_STRING RegistryPath;
28
29 /* Registry settings */
30 ULONG ConnectMultiplePorts;
31 ULONG DataQueueSize;
32 UNICODE_STRING DeviceBaseName;
33
34 PDEVICE_OBJECT MainClassDeviceObject;
35 } CLASS_DRIVER_EXTENSION, *PCLASS_DRIVER_EXTENSION;
36
37 typedef struct _COMMON_DEVICE_EXTENSION
38 {
39 BOOLEAN IsClassDO;
40 } COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
41
42 typedef struct _PORT_DEVICE_EXTENSION
43 {
44 COMMON_DEVICE_EXTENSION Common;
45
46 LIST_ENTRY ListEntry;
47 PDEVICE_OBJECT DeviceObject;
48 PORT_DEVICE_STATE PnpState;
49 PDEVICE_OBJECT LowerDevice;
50 PDEVICE_OBJECT ClassDO;
51 UNICODE_STRING InterfaceName;
52 } PORT_DEVICE_EXTENSION, *PPORT_DEVICE_EXTENSION;
53
54 typedef struct _CLASS_DEVICE_EXTENSION
55 {
56 COMMON_DEVICE_EXTENSION Common;
57
58 PCLASS_DRIVER_EXTENSION DriverExtension;
59
60 LIST_ENTRY ListHead;
61 KSPIN_LOCK ListSpinLock;
62 KSPIN_LOCK SpinLock;
63 PIRP PendingIrp;
64 SIZE_T InputCount;
65 PMOUSE_INPUT_DATA PortData;
66 LPCWSTR DeviceName;
67 } CLASS_DEVICE_EXTENSION, *PCLASS_DEVICE_EXTENSION;
68
69 /* misc.c */
70
71 NTSTATUS
72 ForwardIrpAndWait(
73 IN PDEVICE_OBJECT DeviceObject,
74 IN PIRP Irp);
75
76 DRIVER_DISPATCH ForwardIrpAndForget;
77
78 NTSTATUS
79 DuplicateUnicodeString(
80 IN ULONG Flags,
81 IN PCUNICODE_STRING SourceString,
82 OUT PUNICODE_STRING DestinationString);