1 #pragma once 2 3 #define _HIDPI_NO_FUNCTION_MACROS_ 4 #include <ntddk.h> 5 #include <hidclass.h> 6 #include <hidpddi.h> 7 #include <hidpi.h> 8 #define NDEBUG 9 #include <debug.h> 10 #include <ntddmou.h> 11 #include <kbdmou.h> 12 #include <debug.h> 13 14 15 typedef struct 16 { 17 // 18 // lower device object 19 // 20 PDEVICE_OBJECT NextDeviceObject; 21 22 // 23 // irp which is used for reading input reports 24 // 25 PIRP Irp; 26 27 // 28 // event 29 // 30 KEVENT ReadCompletionEvent; 31 32 // 33 // device object for class callback 34 // 35 PDEVICE_OBJECT ClassDeviceObject; 36 37 // 38 // class callback 39 // 40 PVOID ClassService; 41 42 // 43 // mouse type 44 // 45 USHORT MouseIdentifier; 46 47 // 48 // wheel usage page 49 // 50 USHORT WheelUsagePage; 51 52 // 53 // buffer for the four usage lists below 54 // 55 PVOID UsageListBuffer; 56 57 // 58 // usage list length 59 // 60 USHORT UsageListLength; 61 62 // 63 // current usage list length 64 // 65 PUSAGE CurrentUsageList; 66 67 // 68 // previous usage list 69 // 70 PUSAGE PreviousUsageList; 71 72 // 73 // removed usage item list 74 // 75 PUSAGE BreakUsageList; 76 77 // 78 // new item usage list 79 // 80 PUSAGE MakeUsageList; 81 82 // 83 // preparsed data 84 // 85 PVOID PreparsedData; 86 87 // 88 // mdl for reading input report 89 // 90 PMDL ReportMDL; 91 92 // 93 // input report buffer 94 // 95 PCHAR Report; 96 97 // 98 // input report length 99 // 100 ULONG ReportLength; 101 102 // 103 // file object the device is reading reports from 104 // 105 PFILE_OBJECT FileObject; 106 107 // 108 // report read is active 109 // 110 UCHAR ReadReportActive; 111 112 // 113 // stop reading flag 114 // 115 UCHAR StopReadReport; 116 117 // 118 // mouse absolute 119 // 120 UCHAR MouseAbsolute; 121 122 // 123 // value caps x 124 // 125 HIDP_VALUE_CAPS ValueCapsX; 126 127 // 128 // value caps y button 129 // 130 HIDP_VALUE_CAPS ValueCapsY; 131 132 } MOUHID_DEVICE_EXTENSION, *PMOUHID_DEVICE_EXTENSION; 133 134 #define WHEEL_DELTA 120 135 #define VIRTUAL_SCREEN_SIZE_X (65536) 136 #define VIRTUAL_SCREEN_SIZE_Y (65536) 137 138 NTSTATUS 139 MouHid_InitiateRead( 140 IN PMOUHID_DEVICE_EXTENSION DeviceExtension); 141 142 #define MOUHID_TAG 'diHM' 143