ReactOS  0.4.15-dev-2153-g62b4c61
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 #define INPORT_TAG 'tPnI'
17 
18 typedef enum
19 {
24 
25 typedef enum
26 {
31 
32 typedef struct _INPORT_RAW_DATA
33 {
39 
41 {
50 
51  /* Interrupt */
58 
59  /* Movement data and state of the mouse buttons */
61 
62  /* Mouclass */
66 
67  /* Mouse packet */
69 
70  /* Previous state */
72 
73  /* Mouse device attributes */
76 
77 DRIVER_INITIALIZE DriverEntry;
78 
79 DRIVER_UNLOAD InPortUnload;
80 
81 DRIVER_ADD_DEVICE InPortAddDevice;
82 
85 DRIVER_DISPATCH_PAGED InPortCreateClose;
86 
89 
92 
94 DRIVER_DISPATCH_PAGED InPortWmi;
95 
97 DRIVER_DISPATCH_PAGED InPortPnp;
98 
99 KSERVICE_ROUTINE InPortIsr;
100 
101 IO_DPC_ROUTINE InPortDpcForIsr;
102 
103 KSYNCHRONIZE_ROUTINE InPortStartMouse;
104 
105 KSYNCHRONIZE_ROUTINE InPortStopMouse;
106 
107 NTSTATUS
108 NTAPI
111  _Inout_ PIRP Irp);
112 
113 NTSTATUS
114 NTAPI
117  _Inout_ PIRP Irp);
118 
119 VOID
120 NTAPI
122  _In_ PINPORT_DEVICE_EXTENSION DeviceExtension);
123 
124 NTSTATUS
125 NTAPI
127  _Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
128 
129 NTSTATUS
130 NTAPI
132  _Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
133 
134 NTSTATUS
135 NTAPI
143 
144 NTSTATUS
145 NTAPI
148  _Inout_ PIRP Irp,
152  _Out_opt_ PULONG InstanceLengthArray,
155 
157 
158 #endif /* _INPORT_H_ */
PDEVICE_OBJECT Ldo
Definition: inport.h:44
INPORT_MOUSE_TYPE
Definition: inport.h:25
KSYNCHRONIZE_ROUTINE InPortStartMouse
Definition: inport.h:103
INPORT_DEVICE_STATE State
Definition: inport.h:45
UNICODE_STRING DriverRegistryPath
Definition: inport.c:24
MOUSE_INPUT_DATA MouseInputData
Definition: inport.h:68
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
PDEVICE_OBJECT ClassDeviceObject
Definition: inport.h:64
NTSTATUS NTAPI InPortWmiRegistration(_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: wmi.c:124
WMILIB_CONTEXT WmiLibInfo
Definition: inport.h:47
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:62
unsigned char * PUCHAR
Definition: retypes.h:3
char CHAR
Definition: xmlstorage.h:175
INPORT_DEVICE_STATE
Definition: inport.h:18
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
_Dispatch_type_(IRP_MJ_CREATE) _Dispatch_type_(IRP_MJ_CLOSE) DRIVER_DISPATCH_PAGED InPortCreateClose
Definition: create.c:4769
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:36
NTSTATUS NTAPI InPortCreateClose(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: inport.c:30
NTSTATUS NTAPI InPortInternalDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:19
KSERVICE_ROUTINE InPortIsr
Definition: inport.h:99
PDEVICE_OBJECT Self
Definition: inport.h:42
INPORT_MOUSE_TYPE MouseType
Definition: inport.h:49
DRIVER_INITIALIZE DriverEntry
Definition: inport.h:77
KINTERRUPT_MODE InterruptMode
Definition: inport.h:55
struct _INPORT_RAW_DATA INPORT_RAW_DATA
KSYNCHRONIZE_ROUTINE InPortStopMouse
Definition: inport.h:105
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:36
UCHAR KIRQL
Definition: env_spec_w32.h:591
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
ULONG ButtonDiff
Definition: inport.h:37
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:60
_In_ PIRP Irp
Definition: csq.h:116
IO_DPC_ROUTINE InPortDpcForIsr
Definition: inport.h:101
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:27
DRIVER_UNLOAD InPortUnload
Definition: inport.h:79
KAFFINITY InterruptAffinity
Definition: inport.h:57
unsigned char BOOLEAN
_Out_ ULONG * RegFlags
Definition: classpnp.h:403
enum _KINTERRUPT_MODE KINTERRUPT_MODE
_In_ PIRP _In_ ULONG GuidIndex
Definition: classpnp.h:418
VOID NTAPI InPortInitializeMouse(_In_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: hardware.c:343
Definition: bufpool.h:45
PKINTERRUPT InterruptObject
Definition: inport.h:52
#define _Out_opt_
Definition: no_sal2.h:214
struct _INPORT_DEVICE_EXTENSION * PINPORT_DEVICE_EXTENSION
CONNECT_DATA ConnectData
Definition: inport.h:63
NTSTATUS NTAPI InPortRemoveDevice(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:183
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define _Inout_
Definition: no_sal2.h:162
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:43
IO_REMOVE_LOCK RemoveLock
Definition: inport.h:46
NTSTATUS NTAPI InPortPnp(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:226
_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
#define _In_
Definition: no_sal2.h:158
MOUSE_ATTRIBUTES MouseAttributes
Definition: inport.h:74
ULONG_PTR KAFFINITY
Definition: compat.h:85
NTSTATUS NTAPI InPortWmi(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: wmi.c:156
struct _INPORT_RAW_DATA * PINPORT_RAW_DATA
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:1319
NTSTATUS NTAPI InPortPower(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: inport.c:178
DRIVER_DISPATCH DRIVER_DISPATCH_RAISED
Definition: iotypes.h:2260
DRIVER_ADD_DEVICE InPortAddDevice
Definition: inport.h:81
NTSTATUS NTAPI InPortWmiDeRegistration(_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: wmi.c:145
struct _INPORT_DEVICE_EXTENSION INPORT_DEVICE_EXTENSION
BOOLEAN InterruptShared
Definition: inport.h:56