[USB]
[reactos.git] / reactos / drivers / input / kbdclass / kbdclass.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 'CdbK'
14 #define DPFLTR_CLASS_NAME_ID DPFLTR_KBDCLASS_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 HANDLE FileHandle;
52 UNICODE_STRING InterfaceName;
53 } PORT_DEVICE_EXTENSION, *PPORT_DEVICE_EXTENSION;
54
55 typedef struct _CLASS_DEVICE_EXTENSION
56 {
57 COMMON_DEVICE_EXTENSION Common;
58
59 PCLASS_DRIVER_EXTENSION DriverExtension;
60
61 LIST_ENTRY ListHead;
62 KSPIN_LOCK ListSpinLock;
63 KSPIN_LOCK SpinLock;
64 PIRP PendingIrp;
65 SIZE_T InputCount;
66 PKEYBOARD_INPUT_DATA PortData;
67 LPCWSTR DeviceName;
68 } CLASS_DEVICE_EXTENSION, *PCLASS_DEVICE_EXTENSION;
69
70 /* misc.c */
71
72 NTSTATUS
73 ForwardIrpAndWait(
74 IN PDEVICE_OBJECT DeviceObject,
75 IN PIRP Irp);
76
77 DRIVER_DISPATCH ForwardIrpAndForget;
78
79 NTSTATUS
80 DuplicateUnicodeString(
81 IN ULONG Flags,
82 IN PCUNICODE_STRING SourceString,
83 OUT PUNICODE_STRING DestinationString);
84
85 /* setup.c */
86 BOOLEAN
87 IsFirstStageSetup(
88 VOID);
89
90 VOID NTAPI
91 Send8042StartDevice(
92 IN PDRIVER_OBJECT DriverObject,
93 IN PDEVICE_OBJECT Pdo);