1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#![cfg(windows)]
extern crate winapi;
use winapi::*;
extern "system" {
pub fn HidD_FlushQueue(HidDeviceObject: HANDLE) -> BOOLEAN;
pub fn HidD_FreePreparsedData(PreparsedData: PHIDP_PREPARSED_DATA) -> BOOLEAN;
pub fn HidD_GetAttributes(
HidDeviceObject: HANDLE, Attributes: PHIDD_ATTRIBUTES,
) -> BOOLEAN;
pub fn HidD_GetConfiguration(
HidDeviceObject: HANDLE, Configuration: PHIDD_CONFIGURATION, ConfigurationLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetFeature(
HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetHidGuid(HidGuid: LPGUID);
pub fn HidD_GetIndexedString(
HidDeviceObject: HANDLE, StringIndex: ULONG, Buffer: PVOID, BufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetInputReport(
HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetManufacturerString(
HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetMsGenreDescriptor(
HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetNumInputBuffers(
HidDeviceObject: HANDLE, NumberBuffers: PULONG,
) -> BOOLEAN;
pub fn HidD_GetPhysicalDescriptor(
HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetPreparsedData(
HidDeviceObject: HANDLE, PreparsedData: *mut PHIDP_PREPARSED_DATA,
) -> BOOLEAN;
pub fn HidD_GetProductString(
HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_GetSerialNumberString(
HidDeviceObject: HANDLE, Buffer: PVOID, BufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_SetConfiguration(
HidDeviceObject: HANDLE, Configuration: PHIDD_CONFIGURATION, ConfigurationLength: ULONG,
) -> BOOLEAN;
pub fn HidD_SetFeature(
HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG,
) -> BOOLEAN;
pub fn HidD_SetNumInputBuffers(
HidDeviceObject: HANDLE, NumberBuffers: ULONG,
) -> BOOLEAN;
pub fn HidD_SetOutputReport(
HidDeviceObject: HANDLE, ReportBuffer: PVOID, ReportBufferLength: ULONG,
) -> BOOLEAN;
pub fn HidP_GetButtonCaps(
ReportType: HIDP_REPORT_TYPE, ButtonCaps: PHIDP_BUTTON_CAPS,
ButtonCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA,
) -> NTSTATUS;
pub fn HidP_GetCaps(
PreparsedData: PHIDP_PREPARSED_DATA, Capabilities: PHIDP_CAPS,
) -> NTSTATUS;
pub fn HidP_GetData(
ReportType: HIDP_REPORT_TYPE, DataList: PHIDP_DATA, DataLength: PULONG,
PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR,ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_GetExtendedAttributes(
ReportType: HIDP_REPORT_TYPE, DataIndex: USHORT,
PreparsedData: PHIDP_PREPARSED_DATA, Attributes: PHIDP_EXTENDED_ATTRIBUTES,
LengthAttributes: PULONG,
) -> NTSTATUS;
pub fn HidP_GetLinkCollectionNodes(
LinkCollectionNodes: PHIDP_LINK_COLLECTION_NODE,
LinkCollectionNodesLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA,
) -> NTSTATUS;
pub fn HidP_GetScaledUsageValue(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, UsageValue: PLONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_GetSpecificButtonCaps(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, ButtonCaps: PHIDP_BUTTON_CAPS, ButtonCapsLength: PUSHORT,
PreparsedData: PHIDP_PREPARSED_DATA,
) -> NTSTATUS;
pub fn HidP_GetSpecificValueCaps(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, ValueCaps: PHIDP_VALUE_CAPS, ValueCapsLength: PUSHORT,
PreparsedData: PHIDP_PREPARSED_DATA,
) -> NTSTATUS;
pub fn HidP_GetUsageValue(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, UsageValue: PULONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_GetUsageValueArray(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, UsageValue: PCHAR, UsageValueByteLength: USHORT,
PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_GetUsages(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
UsageList: PUSAGE, UsageLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_GetUsagesEx(
ReportType: HIDP_REPORT_TYPE, LinkCollection: USHORT, ButtonList: PUSAGE_AND_PAGE,
UsageLength: *mut ULONG, PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR,
ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_GetValueCaps(
ReportType: HIDP_REPORT_TYPE, ValueCaps: PHIDP_VALUE_CAPS,
ValueCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA,
) -> NTSTATUS;
pub fn HidP_InitializeReportForID(
ReportType: HIDP_REPORT_TYPE, ReportID: UCHAR,
PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_MaxDataListLength(
ReportType: HIDP_REPORT_TYPE, PreparsedData: PHIDP_PREPARSED_DATA,
) -> ULONG;
pub fn HidP_MaxUsageListLength(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE,
PreparsedData: PHIDP_PREPARSED_DATA,
) -> ULONG;
pub fn HidP_SetData(
ReportType: HIDP_REPORT_TYPE, DataList: PHIDP_DATA, DataLength: PULONG,
PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_SetScaledUsageValue(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, UsageValue: LONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_SetUsageValue(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, UsageValue: ULONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_SetUsageValueArray(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
Usage: USAGE, UsageValue: PCHAR, UsageValueByteLength: USHORT,
PreparsedData: PHIDP_PREPARSED_DATA, Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_SetUsages(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
UsageList: PUSAGE, UsageLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_TranslateUsagesToI8042ScanCodes(
ChangedUsageList: PUSAGE, UsageListLength: ULONG, KeyAction: HIDP_KEYBOARD_DIRECTION,
ModifierState: PHIDP_KEYBOARD_MODIFIER_STATE, InsertCodesProcedure: PHIDP_INSERT_SCANCODES,
InsertCodesContext: PVOID,
) -> NTSTATUS;
pub fn HidP_UnsetUsages(
ReportType: HIDP_REPORT_TYPE, UsagePage: USAGE, LinkCollection: USHORT,
UsageList: PUSAGE, UsageLength: PULONG, PreparsedData: PHIDP_PREPARSED_DATA,
Report: PCHAR, ReportLength: ULONG,
) -> NTSTATUS;
pub fn HidP_UsageListDifference(
PreviousUsageList: PUSAGE, CurrentUsageList: PUSAGE, BreakUsageList: PUSAGE,
MakeUsageList: PUSAGE, UsageListLength: ULONG,
) -> NTSTATUS;
}