2011-12-26 03:37:22 +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
|
2011-12-26 03:37:22 +00:00
|
|
|
#include <debug.h>
|
|
|
|
#include <ntddmou.h>
|
|
|
|
#include <kbdmou.h>
|
2011-12-28 16:35:41 +00:00
|
|
|
#include <debug.h>
|
2011-12-26 03:37:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2011-12-28 11:36:05 +00:00
|
|
|
//
|
|
|
|
// lower device object
|
|
|
|
//
|
2011-12-26 03:37:22 +00:00
|
|
|
PDEVICE_OBJECT NextDeviceObject;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// irp which is used for reading input reports
|
|
|
|
//
|
2011-12-26 03:37:22 +00:00
|
|
|
PIRP Irp;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
2013-05-11 10:23:54 +00:00
|
|
|
// event
|
2011-12-28 11:36:05 +00:00
|
|
|
//
|
2011-12-28 16:35:41 +00:00
|
|
|
KEVENT ReadCompletionEvent;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// device object for class callback
|
|
|
|
//
|
2011-12-26 03:37:22 +00:00
|
|
|
PDEVICE_OBJECT ClassDeviceObject;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// class callback
|
|
|
|
//
|
2011-12-26 03:37:22 +00:00
|
|
|
PVOID ClassService;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// mouse type
|
|
|
|
//
|
2011-12-26 03:37:22 +00:00
|
|
|
USHORT MouseIdentifier;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// wheel usage page
|
|
|
|
//
|
2011-12-26 03:37:22 +00:00
|
|
|
USHORT WheelUsagePage;
|
2011-12-27 00:46:10 +00:00
|
|
|
|
2013-05-11 17:15:54 +00:00
|
|
|
//
|
|
|
|
// buffer for the four usage lists below
|
|
|
|
//
|
|
|
|
PVOID UsageListBuffer;
|
|
|
|
|
2011-12-28 11:36:05 +00:00
|
|
|
//
|
|
|
|
// usage list length
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
USHORT UsageListLength;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// current usage list length
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
PUSAGE CurrentUsageList;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// previous usage list
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
PUSAGE PreviousUsageList;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// removed usage item list
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
PUSAGE BreakUsageList;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// new item usage list
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
PUSAGE MakeUsageList;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// preparsed data
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
PVOID PreparsedData;
|
|
|
|
|
2011-12-28 11:36:05 +00:00
|
|
|
//
|
|
|
|
// mdl for reading input report
|
|
|
|
//
|
2011-12-27 00:46:10 +00:00
|
|
|
PMDL ReportMDL;
|
2011-12-28 11:36:05 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// input report buffer
|
|
|
|
//
|
2012-01-20 22:17:32 +00:00
|
|
|
PCHAR Report;
|
2011-12-27 00:46:10 +00:00
|
|
|
|
2011-12-28 11:36:05 +00:00
|
|
|
//
|
|
|
|
// input report length
|
|
|
|
//
|
|
|
|
ULONG ReportLength;
|
2011-12-27 00:46:10 +00:00
|
|
|
|
2011-12-28 11:36:05 +00:00
|
|
|
//
|
|
|
|
// file object the device is reading reports from
|
|
|
|
//
|
2011-12-27 02:35:03 +00:00
|
|
|
PFILE_OBJECT FileObject;
|
|
|
|
|
2011-12-28 16:35:41 +00:00
|
|
|
//
|
|
|
|
// report read is active
|
|
|
|
//
|
|
|
|
UCHAR ReadReportActive;
|
|
|
|
|
|
|
|
//
|
|
|
|
// stop reading flag
|
|
|
|
//
|
|
|
|
UCHAR StopReadReport;
|
|
|
|
|
2012-10-22 21:18:30 +00:00
|
|
|
//
|
|
|
|
// mouse absolute
|
|
|
|
//
|
|
|
|
UCHAR MouseAbsolute;
|
|
|
|
|
|
|
|
//
|
|
|
|
// value caps x
|
|
|
|
//
|
|
|
|
HIDP_VALUE_CAPS ValueCapsX;
|
|
|
|
|
|
|
|
//
|
|
|
|
// value caps y button
|
|
|
|
//
|
|
|
|
HIDP_VALUE_CAPS ValueCapsY;
|
|
|
|
|
2013-05-11 12:30:52 +00:00
|
|
|
} MOUHID_DEVICE_EXTENSION, *PMOUHID_DEVICE_EXTENSION;
|
2011-12-27 02:35:03 +00:00
|
|
|
|
2012-01-26 02:50:15 +00:00
|
|
|
#define WHEEL_DELTA 120
|
2013-05-19 17:29:15 +00:00
|
|
|
#define VIRTUAL_SCREEN_SIZE_X (65536)
|
|
|
|
#define VIRTUAL_SCREEN_SIZE_Y (65536)
|
2011-12-27 02:35:03 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
MouHid_InitiateRead(
|
2011-12-28 16:35:41 +00:00
|
|
|
IN PMOUHID_DEVICE_EXTENSION DeviceExtension);
|
2013-05-11 12:30:52 +00:00
|
|
|
|
|
|
|
#define MOUHID_TAG 'diHM'
|