ReactOS 0.4.16-dev-340-g0540c21
kbdhid.h File Reference
#include <ntddk.h>
#include <hidclass.h>
#include <hidpddi.h>
#include <hidpi.h>
#include <debug.h>
#include <kbdmou.h>
#include <ntddkbd.h>
Include dependency graph for kbdhid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  KBDHID_DEVICE_EXTENSION
 

Macros

#define _HIDPI_NO_FUNCTION_MACROS_
 
#define NDEBUG
 
#define KEYBOARD_TYPEMATIC_RATE_MINIMUM   2
 
#define KEYBOARD_TYPEMATIC_RATE_MAXIMUM   30
 
#define KEYBOARD_TYPEMATIC_RATE_DEFAULT   30
 
#define KEYBOARD_TYPEMATIC_DELAY_MINIMUM   250
 
#define KEYBOARD_TYPEMATIC_DELAY_MAXIMUM   1000
 
#define KEYBOARD_TYPEMATIC_DELAY_DEFAULT   250
 
#define MICROSOFT_KBD_FUNC   12
 
#define KEYBOARD_TYPE_UNKNOWN   (0x51)
 
#define MICROSOFT_KBD_101_TYPE   0
 
#define KBDHID_TAG   'diHK'
 

Typedefs

typedef struct KBDHID_DEVICE_EXTENSIONPKBDHID_DEVICE_EXTENSION
 

Functions

NTSTATUS KbdHid_InitiateRead (IN PKBDHID_DEVICE_EXTENSION DeviceExtension)
 

Macro Definition Documentation

◆ _HIDPI_NO_FUNCTION_MACROS_

#define _HIDPI_NO_FUNCTION_MACROS_

Definition at line 3 of file kbdhid.h.

◆ KBDHID_TAG

#define KBDHID_TAG   'diHK'

Definition at line 148 of file kbdhid.h.

◆ KEYBOARD_TYPE_UNKNOWN

#define KEYBOARD_TYPE_UNKNOWN   (0x51)

Definition at line 140 of file kbdhid.h.

◆ KEYBOARD_TYPEMATIC_DELAY_DEFAULT

#define KEYBOARD_TYPEMATIC_DELAY_DEFAULT   250

Definition at line 136 of file kbdhid.h.

◆ KEYBOARD_TYPEMATIC_DELAY_MAXIMUM

#define KEYBOARD_TYPEMATIC_DELAY_MAXIMUM   1000

Definition at line 135 of file kbdhid.h.

◆ KEYBOARD_TYPEMATIC_DELAY_MINIMUM

#define KEYBOARD_TYPEMATIC_DELAY_MINIMUM   250

Definition at line 134 of file kbdhid.h.

◆ KEYBOARD_TYPEMATIC_RATE_DEFAULT

#define KEYBOARD_TYPEMATIC_RATE_DEFAULT   30

Definition at line 133 of file kbdhid.h.

◆ KEYBOARD_TYPEMATIC_RATE_MAXIMUM

#define KEYBOARD_TYPEMATIC_RATE_MAXIMUM   30

Definition at line 132 of file kbdhid.h.

◆ KEYBOARD_TYPEMATIC_RATE_MINIMUM

#define KEYBOARD_TYPEMATIC_RATE_MINIMUM   2

Definition at line 131 of file kbdhid.h.

◆ MICROSOFT_KBD_101_TYPE

#define MICROSOFT_KBD_101_TYPE   0

Definition at line 141 of file kbdhid.h.

◆ MICROSOFT_KBD_FUNC

#define MICROSOFT_KBD_FUNC   12

Definition at line 139 of file kbdhid.h.

◆ NDEBUG

#define NDEBUG

Definition at line 8 of file kbdhid.h.

Typedef Documentation

◆ PKBDHID_DEVICE_EXTENSION

Function Documentation

◆ KbdHid_InitiateRead()

NTSTATUS KbdHid_InitiateRead ( IN PKBDHID_DEVICE_EXTENSION  DeviceExtension)

Definition at line 201 of file kbdhid.c.

203{
204 PIO_STACK_LOCATION IoStack;
206
207 /* re-use irp */
208 IoReuseIrp(DeviceExtension->Irp, STATUS_SUCCESS);
209
210 /* init irp */
211 DeviceExtension->Irp->MdlAddress = DeviceExtension->ReportMDL;
212
213 /* get next stack location */
214 IoStack = IoGetNextIrpStackLocation(DeviceExtension->Irp);
215
216 /* init stack location */
217 IoStack->Parameters.Read.Length = DeviceExtension->ReportLength;
218 IoStack->Parameters.Read.Key = 0;
219 IoStack->Parameters.Read.ByteOffset.QuadPart = 0LL;
220 IoStack->MajorFunction = IRP_MJ_READ;
221 IoStack->FileObject = DeviceExtension->FileObject;
222
223 /* set completion routine */
224 IoSetCompletionRoutine(DeviceExtension->Irp, KbdHid_ReadCompletion, DeviceExtension, TRUE, TRUE, TRUE);
225
226 /* read is active */
227 DeviceExtension->ReadReportActive = TRUE;
228
229 /* start the read */
230 Status = IoCallDriver(DeviceExtension->NextDeviceObject, DeviceExtension->Irp);
231
232 /* done */
233 return Status;
234}
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
Status
Definition: gdiplustypes.h:25
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:490
NTSTATUS NTAPI KbdHid_ReadCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: kbdhid.c:109
VOID NTAPI IoReuseIrp(IN OUT PIRP Irp, IN NTSTATUS Status)
Definition: irp.c:1971
#define IoCallDriver
Definition: irp.c:1225
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define STATUS_SUCCESS
Definition: shellext.h:65
union _IO_STACK_LOCATION::@1581 Parameters
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
struct _IO_STACK_LOCATION::@3980::@3984 Read
#define LL
Definition: tui.h:167
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695

Referenced by KbdHid_Create(), and KbdHid_ReadCompletion().