ReactOS  0.4.15-dev-3717-g292e6a4
inport.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS InPort (Bus) Mouse Driver
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: Main header file
5  * COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
6  */
7 
8 #ifndef _INPORT_H_
9 #define _INPORT_H_
10 
11 #include <wdm.h>
12 #include <wmilib.h>
13 #include <wmistr.h>
14 #include <kbdmou.h>
15 
16 #include <section_attribs.h>
17 
18 #define INPORT_TAG 'tPnI'
19 
20 typedef enum
21 {
26 
27 typedef enum
28 {
33 
34 typedef struct _INPORT_RAW_DATA
35 {
41 
43 {
52 
53  /* Interrupt */
60 
61  /* Movement data and state of the mouse buttons */
63 
64  /* Mouclass */
68 
69  /* Mouse packet */
71 
72  /* Previous state */
74 
75  /* Mouse device attributes */
78 
79 CODE_SEG("INIT")
80 DRIVER_INITIALIZE DriverEntry;
81 
82 CODE_SEG("PAGE")
83 DRIVER_UNLOAD InPortUnload;
84 
85 CODE_SEG("PAGE")
86 DRIVER_ADD_DEVICE InPortAddDevice;
87 
90 CODE_SEG("PAGE")
91 DRIVER_DISPATCH_PAGED InPortCreateClose;
92 
95 
98 
100 CODE_SEG("PAGE")
101 DRIVER_DISPATCH_PAGED InPortWmi;
102 
104 CODE_SEG("PAGE")
105 DRIVER_DISPATCH_PAGED InPortPnp;
106 
107 KSERVICE_ROUTINE InPortIsr;
108 
109 IO_DPC_ROUTINE InPortDpcForIsr;
110 
111 KSYNCHRONIZE_ROUTINE InPortStartMouse;
112 
113 KSYNCHRONIZE_ROUTINE InPortStopMouse;
114 
115 CODE_SEG("PAGE")
116 NTSTATUS
117 NTAPI
120  _Inout_ PIRP Irp);
121 
122 CODE_SEG("PAGE")
123 NTSTATUS
124 NTAPI
127  _Inout_ PIRP Irp);
128 
129 CODE_SEG("PAGE")
130 VOID
131 NTAPI
133  _In_ PINPORT_DEVICE_EXTENSION DeviceExtension);
134 
135 CODE_SEG("PAGE")
136 NTSTATUS
137 NTAPI
139  _Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
140 
141 CODE_SEG("PAGE")
142 NTSTATUS
143 NTAPI
145  _Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
146 
147 CODE_SEG("PAGE")
148 NTSTATUS
149 NTAPI
157 
158 CODE_SEG("PAGE")
159 NTSTATUS
160 NTAPI
163  _Inout_ PIRP Irp,
167  _Out_opt_ PULONG InstanceLengthArray,
170 
172 
173 #endif /* _INPORT_H_ */
PDEVICE_OBJECT Ldo
Definition: inport.h:46
INPORT_MOUSE_TYPE
Definition: inport.h:27
KSYNCHRONIZE_ROUTINE InPortStartMouse
Definition: inport.h:111
INPORT_DEVICE_STATE State
Definition: inport.h:47
UNICODE_STRING DriverRegistryPath
Definition: inport.c:17
MOUSE_INPUT_DATA MouseInputData
Definition: inport.h:70
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
PDEVICE_OBJECT ClassDeviceObject
Definition: inport.h:66
#define _Inout_
Definition: ms_sal.h:378
NTSTATUS NTAPI InPortWmiRegistration(_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: wmi.c:118
WMILIB_CONTEXT WmiLibInfo
Definition: inport.h:49
NTSTATUS NTAPI InPortQueryWmiDataBlock(_Inout_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _In_ ULONG GuidIndex, _In_ ULONG InstanceIndex, _In_ ULONG InstanceCount, _Out_opt_ PULONG InstanceLengthArray, _In_ ULONG BufferAvail, _Out_opt_ PUCHAR Buffer)
Definition: wmi.c:55
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
INPORT_DEVICE_STATE
Definition: inport.h:20
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
_Dispatch_type_(IRP_MJ_CREATE) _Dispatch_type_(IRP_MJ_CLOSE) DRIVER_DISPATCH_PAGED InPortCreateClose
Definition: isapnp.c:984
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
_In_ LPGUID _In_ ULONG InstanceIndex
Definition: classpnp.h:1250
UCHAR Buttons
Definition: inport.h:38
NTSTATUS NTAPI InPortCreateClose(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: inport.c:24
NTSTATUS NTAPI InPortInternalDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:19
KSERVICE_ROUTINE InPortIsr
Definition: inport.h:107
PDEVICE_OBJECT Self
Definition: inport.h:44
INPORT_MOUSE_TYPE MouseType
Definition: inport.h:51
DRIVER_INITIALIZE DriverEntry
Definition: inport.h:80
KINTERRUPT_MODE InterruptMode
Definition: inport.h:57
struct _INPORT_RAW_DATA INPORT_RAW_DATA
KSYNCHRONIZE_ROUTINE InPortStopMouse
Definition: inport.h:113
NTSTATUS NTAPI InPortQueryWmiRegInfo(_Inout_ PDEVICE_OBJECT DeviceObject, _Inout_ PULONG RegFlags, _Inout_ PUNICODE_STRING InstanceName, _Out_opt_ PUNICODE_STRING *RegistryPath, _Inout_ PUNICODE_STRING MofResourceName, _Out_opt_ PDEVICE_OBJECT *Pdo)
Definition: wmi.c:28
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
ULONG ButtonDiff
Definition: inport.h:39
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
INPORT_RAW_DATA RawData
Definition: inport.h:62
_In_ PIRP Irp
Definition: csq.h:116
IO_DPC_ROUTINE InPortDpcForIsr
Definition: inport.h:109
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:64
NTSTATUS NTAPI InPortStartDevice(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:20
DRIVER_UNLOAD InPortUnload
Definition: inport.h:83
KAFFINITY InterruptAffinity
Definition: inport.h:59
unsigned char BOOLEAN
_Out_ ULONG * RegFlags
Definition: classpnp.h:403
enum _KINTERRUPT_MODE KINTERRUPT_MODE
#define _In_
Definition: ms_sal.h:308
_In_ PIRP _In_ ULONG GuidIndex
Definition: classpnp.h:418
VOID NTAPI InPortInitializeMouse(_In_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: hardware.c:340
Definition: bufpool.h:45
PKINTERRUPT InterruptObject
Definition: inport.h:54
struct _INPORT_DEVICE_EXTENSION * PINPORT_DEVICE_EXTENSION
CONNECT_DATA ConnectData
Definition: inport.h:65
NTSTATUS NTAPI InPortRemoveDevice(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:177
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
unsigned char UCHAR
Definition: xmlstorage.h:181
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDEVICE_OBJECT Pdo
Definition: inport.h:45
IO_REMOVE_LOCK RemoveLock
Definition: inport.h:48
NTSTATUS NTAPI InPortPnp(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:221
_In_ PIRP _In_ ULONG _In_ ULONG BufferAvail
Definition: classpnp.h:418
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING MofResourceName
Definition: wdfdevice.h:2461
#define IRP_MJ_SYSTEM_CONTROL
MOUSE_ATTRIBUTES MouseAttributes
Definition: inport.h:76
ULONG_PTR KAFFINITY
Definition: compat.h:85
NTSTATUS NTAPI InPortWmi(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: wmi.c:152
struct _INPORT_RAW_DATA * PINPORT_RAW_DATA
#define _Out_opt_
Definition: ms_sal.h:346
unsigned int * PULONG
Definition: retypes.h:1
_Must_inspect_result_ _Inout_ PFLT_VOLUME _In_opt_ PCUNICODE_STRING InstanceName
Definition: fltkernel.h:1162
unsigned int ULONG
Definition: retypes.h:1
_In_ ULONG InstanceCount
Definition: iofuncs.h:1323
NTSTATUS NTAPI InPortPower(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: inport.c:174
DRIVER_DISPATCH DRIVER_DISPATCH_RAISED
Definition: iotypes.h:2263
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
DRIVER_ADD_DEVICE InPortAddDevice
Definition: inport.h:86
NTSTATUS NTAPI InPortWmiDeRegistration(_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: wmi.c:140
struct _INPORT_DEVICE_EXTENSION INPORT_DEVICE_EXTENSION
BOOLEAN InterruptShared
Definition: inport.h:58