ReactOS 0.4.15-dev-7889-g76290a6
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
20typedef enum
21{
26
27typedef enum
28{
33
34typedef 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
79CODE_SEG("INIT")
80DRIVER_INITIALIZE DriverEntry;
81
82CODE_SEG("PAGE")
83DRIVER_UNLOAD InPortUnload;
84
85CODE_SEG("PAGE")
86DRIVER_ADD_DEVICE InPortAddDevice;
87
90CODE_SEG("PAGE")
91DRIVER_DISPATCH_PAGED InPortCreateClose;
92
95
98
100CODE_SEG("PAGE")
101DRIVER_DISPATCH_PAGED InPortWmi;
102
104CODE_SEG("PAGE")
105DRIVER_DISPATCH_PAGED InPortPnp;
106
107KSERVICE_ROUTINE InPortIsr;
108
109IO_DPC_ROUTINE InPortDpcForIsr;
110
111KSYNCHRONIZE_ROUTINE InPortStartMouse;
112
113KSYNCHRONIZE_ROUTINE InPortStopMouse;
114
115CODE_SEG("PAGE")
117NTAPI
121
122CODE_SEG("PAGE")
124NTAPI
128
129CODE_SEG("PAGE")
130VOID
131NTAPI
133 _In_ PINPORT_DEVICE_EXTENSION DeviceExtension);
134
135CODE_SEG("PAGE")
137NTAPI
139 _Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
140
141CODE_SEG("PAGE")
143NTAPI
145 _Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension);
146
147CODE_SEG("PAGE")
149NTAPI
157
158CODE_SEG("PAGE")
160NTAPI
167 _Out_opt_ PULONG InstanceLengthArray,
170
172
173#endif /* _INPORT_H_ */
#define CODE_SEG(...)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define _Dispatch_type_(a)
Definition: btrfs_drv.h:204
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
Definition: bufpool.h:45
_In_ LPGUID _In_ ULONG InstanceIndex
Definition: classpnp.h:1251
_Out_ ULONG * RegFlags
Definition: classpnp.h:403
_In_ PIRP _In_ ULONG GuidIndex
Definition: classpnp.h:419
_In_ PIRP _In_ ULONG _In_ ULONG BufferAvail
Definition: classpnp.h:420
_In_ PIRP Irp
Definition: csq.h:116
ULONG_PTR KAFFINITY
Definition: compat.h:85
NTSTATUS NTAPI InPortInternalDeviceControl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: ioctl.c:19
NTSTATUS NTAPI InPortPnp(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:221
NTSTATUS NTAPI InPortWmi(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: wmi.c:152
UCHAR KIRQL
Definition: env_spec_w32.h:591
_Must_inspect_result_ _Inout_ PFLT_VOLUME _In_opt_ PCUNICODE_STRING InstanceName
Definition: fltkernel.h:1163
NTSTATUS NTAPI InPortCreateClose(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: inport.c:24
NTSTATUS NTAPI InPortPower(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: inport.c:174
KSERVICE_ROUTINE InPortIsr
Definition: inport.h:107
struct _INPORT_DEVICE_EXTENSION * PINPORT_DEVICE_EXTENSION
INPORT_DEVICE_STATE
Definition: inport.h:21
@ dsStopped
Definition: inport.h:22
@ dsStarted
Definition: inport.h:23
@ dsRemoved
Definition: inport.h:24
NTSTATUS NTAPI InPortRemoveDevice(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:177
KSYNCHRONIZE_ROUTINE InPortStopMouse
Definition: inport.h:113
struct _INPORT_RAW_DATA INPORT_RAW_DATA
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
DRIVER_INITIALIZE DriverEntry
Definition: inport.h:80
VOID NTAPI InPortInitializeMouse(_In_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: hardware.c:350
DRIVER_ADD_DEVICE InPortAddDevice
Definition: inport.h:86
NTSTATUS NTAPI InPortWmiRegistration(_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: wmi.c:118
KSYNCHRONIZE_ROUTINE InPortStartMouse
Definition: inport.h:111
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
UNICODE_STRING DriverRegistryPath
Definition: inport.c:17
NTSTATUS NTAPI InPortWmiDeRegistration(_Inout_ PINPORT_DEVICE_EXTENSION DeviceExtension)
Definition: wmi.c:140
IO_DPC_ROUTINE InPortDpcForIsr
Definition: inport.h:109
NTSTATUS NTAPI InPortStartDevice(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: pnp.c:20
INPORT_MOUSE_TYPE
Definition: inport.h:28
@ NecBusMouse
Definition: inport.h:29
@ MsInPortMouse
Definition: inport.h:30
@ LogitechBusMouse
Definition: inport.h:31
struct _INPORT_RAW_DATA * PINPORT_RAW_DATA
DRIVER_UNLOAD InPortUnload
Definition: inport.h:83
struct _INPORT_DEVICE_EXTENSION INPORT_DEVICE_EXTENSION
#define _Out_opt_
Definition: ms_sal.h:346
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
enum _KINTERRUPT_MODE KINTERRUPT_MODE
PDEVICE_OBJECT Ldo
Definition: inport.h:46
INPORT_MOUSE_TYPE MouseType
Definition: inport.h:51
KINTERRUPT_MODE InterruptMode
Definition: inport.h:57
PDEVICE_OBJECT Self
Definition: inport.h:44
IO_REMOVE_LOCK RemoveLock
Definition: inport.h:48
PDEVICE_OBJECT Pdo
Definition: inport.h:45
MOUSE_INPUT_DATA MouseInputData
Definition: inport.h:70
INPORT_RAW_DATA RawData
Definition: inport.h:62
PDEVICE_OBJECT ClassDeviceObject
Definition: inport.h:66
PKINTERRUPT InterruptObject
Definition: inport.h:54
MOUSE_ATTRIBUTES MouseAttributes
Definition: inport.h:76
BOOLEAN InterruptShared
Definition: inport.h:58
WMILIB_CONTEXT WmiLibInfo
Definition: inport.h:49
INPORT_DEVICE_STATE State
Definition: inport.h:47
CONNECT_DATA ConnectData
Definition: inport.h:65
KAFFINITY InterruptAffinity
Definition: inport.h:59
UCHAR Buttons
Definition: inport.h:38
ULONG ButtonDiff
Definition: inport.h:39
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING MofResourceName
Definition: wdfdevice.h:2464
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
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:72
_In_ ULONG InstanceCount
Definition: iofuncs.h:1323
DRIVER_DISPATCH DRIVER_DISPATCH_RAISED
Definition: iotypes.h:2263
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MJ_POWER
unsigned char UCHAR
Definition: xmlstorage.h:181
char CHAR
Definition: xmlstorage.h:175