2012-01-06 16:35:55 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define _HIDPI_NO_FUNCTION_MACROS_
|
|
|
|
#include <ntddk.h>
|
|
|
|
#include <hidclass.h>
|
|
|
|
#include <hidpddi.h>
|
|
|
|
#include <hidpi.h>
|
2012-02-12 03:48:54 +00:00
|
|
|
#define NDEBUG
|
2012-01-06 16:35:55 +00:00
|
|
|
#include <debug.h>
|
|
|
|
#include <kbdmou.h>
|
2012-01-20 21:19:37 +00:00
|
|
|
//#include <kbd.h>
|
|
|
|
#include <ntddkbd.h>
|
2012-01-06 16:35:55 +00:00
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// lower device object
|
|
|
|
//
|
|
|
|
PDEVICE_OBJECT NextDeviceObject;
|
|
|
|
|
|
|
|
//
|
|
|
|
// irp which is used for reading input reports
|
|
|
|
//
|
|
|
|
PIRP Irp;
|
|
|
|
|
|
|
|
//
|
2013-05-11 10:23:54 +00:00
|
|
|
// event
|
2012-01-06 16:35:55 +00:00
|
|
|
//
|
|
|
|
KEVENT ReadCompletionEvent;
|
|
|
|
|
|
|
|
//
|
|
|
|
// device object for class callback
|
|
|
|
//
|
|
|
|
PDEVICE_OBJECT ClassDeviceObject;
|
|
|
|
|
|
|
|
//
|
|
|
|
// class callback
|
|
|
|
//
|
|
|
|
PVOID ClassService;
|
|
|
|
|
2013-05-11 17:15:54 +00:00
|
|
|
//
|
|
|
|
// buffer for the four usage lists below
|
|
|
|
//
|
|
|
|
PVOID UsageListBuffer;
|
|
|
|
|
2012-01-06 16:35:55 +00:00
|
|
|
//
|
|
|
|
// usage list length
|
|
|
|
//
|
|
|
|
USHORT UsageListLength;
|
|
|
|
|
|
|
|
//
|
|
|
|
// current usage list length
|
|
|
|
//
|
|
|
|
PUSAGE_AND_PAGE CurrentUsageList;
|
|
|
|
|
|
|
|
//
|
|
|
|
// previous usage list
|
|
|
|
//
|
|
|
|
PUSAGE_AND_PAGE PreviousUsageList;
|
|
|
|
|
|
|
|
//
|
|
|
|
// removed usage item list
|
|
|
|
//
|
|
|
|
PUSAGE_AND_PAGE BreakUsageList;
|
|
|
|
|
|
|
|
//
|
|
|
|
// new item usage list
|
|
|
|
//
|
|
|
|
PUSAGE_AND_PAGE MakeUsageList;
|
|
|
|
|
|
|
|
//
|
|
|
|
// preparsed data
|
|
|
|
//
|
2012-01-20 21:19:37 +00:00
|
|
|
PHIDP_PREPARSED_DATA PreparsedData;
|
2012-01-06 16:35:55 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// mdl for reading input report
|
|
|
|
//
|
|
|
|
PMDL ReportMDL;
|
|
|
|
|
|
|
|
//
|
|
|
|
// input report buffer
|
|
|
|
//
|
2012-01-20 21:19:37 +00:00
|
|
|
PCHAR Report;
|
2012-01-06 16:35:55 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// input report length
|
|
|
|
//
|
|
|
|
ULONG ReportLength;
|
|
|
|
|
|
|
|
//
|
|
|
|
// file object the device is reading reports from
|
|
|
|
//
|
|
|
|
PFILE_OBJECT FileObject;
|
|
|
|
|
|
|
|
//
|
|
|
|
// report read is active
|
|
|
|
//
|
|
|
|
UCHAR ReadReportActive;
|
|
|
|
|
|
|
|
//
|
|
|
|
// stop reading flag
|
|
|
|
//
|
|
|
|
UCHAR StopReadReport;
|
|
|
|
|
2012-01-20 21:19:37 +00:00
|
|
|
//
|
|
|
|
// keyboard attributes
|
|
|
|
//
|
|
|
|
KEYBOARD_ATTRIBUTES Attributes;
|
|
|
|
|
|
|
|
//
|
|
|
|
// keyboard modifier state
|
|
|
|
//
|
|
|
|
HIDP_KEYBOARD_MODIFIER_STATE ModifierState;
|
|
|
|
|
2012-02-01 13:34:20 +00:00
|
|
|
//
|
|
|
|
// keyboard indicator state
|
|
|
|
//
|
|
|
|
KEYBOARD_INDICATOR_PARAMETERS KeyboardIndicator;
|
|
|
|
|
2012-02-01 14:28:02 +00:00
|
|
|
//
|
|
|
|
// keyboard type matic
|
|
|
|
//
|
|
|
|
KEYBOARD_TYPEMATIC_PARAMETERS KeyboardTypematic;
|
|
|
|
|
2013-05-11 12:30:52 +00:00
|
|
|
} KBDHID_DEVICE_EXTENSION, *PKBDHID_DEVICE_EXTENSION;
|
2012-01-06 16:35:55 +00:00
|
|
|
|
2012-01-20 21:19:37 +00:00
|
|
|
/* defaults from kbfiltr.h */
|
2013-05-11 10:23:54 +00:00
|
|
|
#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
|
2012-01-20 21:19:37 +00:00
|
|
|
|
|
|
|
/* FIXME: write kbd.h */
|
|
|
|
#define MICROSOFT_KBD_FUNC 12
|
|
|
|
#define KEYBOARD_TYPE_UNKNOWN (0x51)
|
|
|
|
#define MICROSOFT_KBD_101_TYPE 0
|
|
|
|
|
|
|
|
|
2012-01-06 16:35:55 +00:00
|
|
|
NTSTATUS
|
|
|
|
KbdHid_InitiateRead(
|
|
|
|
IN PKBDHID_DEVICE_EXTENSION DeviceExtension);
|
2013-05-11 12:30:52 +00:00
|
|
|
|
|
|
|
#define KBDHID_TAG 'diHK'
|