ReactOS  0.4.15-dev-1377-ga59cecd
hidparser.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: lib/drivers/hidparser/hidparser.c
5  * PURPOSE: HID Parser
6  * PROGRAMMERS:
7  * Michael Martin (michael.martin@reactos.org)
8  * Johannes Anderwald (johannes.anderwald@reactos.org)
9  */
10 
11 #pragma once
12 
14 NTAPI
16  IN PHIDP_REPORT_DESCRIPTOR ReportDesc,
17  IN ULONG DescLength,
20 
21 VOID
22 NTAPI
25 
26 HIDAPI
28 NTAPI
30  IN PVOID CollectionContext,
32 
33 HIDAPI
35 NTAPI
37  IN PVOID CollectionContext,
38  IN HIDP_REPORT_TYPE ReportType,
41  IN USAGE Usage,
44 
45 
46 HIDAPI
48 NTAPI
50  IN PVOID CollectionContext,
51  HIDP_REPORT_TYPE ReportType,
54 
55 HIDAPI
57 NTAPI
59  IN PVOID CollectionContext,
60  IN HIDP_REPORT_TYPE ReportType,
63  IN USAGE Usage,
66 
67 HIDAPI
69 NTAPI
71  IN PVOID CollectionContext,
72  IN HIDP_REPORT_TYPE ReportType,
75  IN USAGE Usage,
76  OUT PLONG UsageValue,
77  IN PCHAR Report,
79 
80 
81 HIDAPI
83 NTAPI
85  IN PVOID CollectionContext,
86  IN HIDP_REPORT_TYPE ReportType,
89  IN PCHAR Report,
91 
92 HIDAPI
94 NTAPI
96  IN PVOID CollectionContext,
97  IN HIDP_REPORT_TYPE ReportType,
101 
102 HIDAPI
103 NTSTATUS
104 NTAPI
106  IN PVOID CollectionContext,
107  OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
109 
110 
111 HIDAPI
112 NTSTATUS
113 NTAPI
115  IN PVOID CollectionContext,
116  IN HIDP_REPORT_TYPE ReportType,
119  IN USAGE Usage,
120  OUT PULONG UsageValue,
121  IN PCHAR Report,
123 
124 HIDAPI
125 NTSTATUS
126 NTAPI
128  IN PUSAGE PreviousUsageList,
129  IN PUSAGE CurrentUsageList,
130  OUT PUSAGE BreakUsageList,
131  OUT PUSAGE MakeUsageList,
133 
134 
135 HIDAPI
136 ULONG
137 NTAPI
139  IN PVOID CollectionContext,
140  IN HIDP_REPORT_TYPE ReportType,
142 
143 HIDAPI
144 NTSTATUS
145 NTAPI
147  IN PVOID CollectionContext,
148  IN HIDP_REPORT_TYPE ReportType,
151  OUT USAGE *UsageList,
153  IN PCHAR Report,
155 
156 HIDAPI
157 NTSTATUS
158 NTAPI
160  IN PVOID CollectionContext,
161  IN HIDP_REPORT_TYPE ReportType,
165  IN PCHAR Report,
167 
168 
169 NTSTATUS
170 NTAPI
172  IN PVOID CollectionContext,
173  IN PCHAR HidPacket,
174  IN USHORT HidPacketLength,
176 
177 NTSTATUS
178 NTAPI
180  IN PVOID CollectionContext,
182 
183 HIDAPI
184 NTSTATUS
185 NTAPI
187  IN PVOID CollectionContext,
188  IN HIDP_REPORT_TYPE ReportType,
191  IN USAGE Usage,
192  OUT PCHAR UsageValue,
193  IN USHORT UsageValueByteLength,
194  IN PCHAR Report,
196 
197 
198 HIDAPI
199 NTSTATUS
200 NTAPI
202  IN PUSAGE_AND_PAGE PreviousUsageList,
203  IN PUSAGE_AND_PAGE CurrentUsageList,
204  OUT PUSAGE_AND_PAGE BreakUsageList,
205  OUT PUSAGE_AND_PAGE MakeUsageList,
207 
208 HIDAPI
209 NTSTATUS
210 NTAPI
212  IN PVOID CollectionContext,
213  IN HIDP_REPORT_TYPE ReportType,
216  IN PUSAGE UsageList,
218  IN OUT PCHAR Report,
220 
221 HIDAPI
222 NTSTATUS
223 NTAPI
225  IN PUSAGE ChangedUsageList,
227  IN HIDP_KEYBOARD_DIRECTION KeyAction,
228  IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
229  IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
230  IN PVOID InsertCodesContext);
231 
232 HIDAPI
233 NTSTATUS
234 NTAPI
236  IN PUSAGE_AND_PAGE ChangedUsageList,
238  IN HIDP_KEYBOARD_DIRECTION KeyAction,
239  IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
240  IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
241  IN PVOID InsertCodesContext);
242 
243 HIDAPI
244 NTSTATUS
245 NTAPI
247  IN PVOID CollectionContext,
248  IN HIDP_REPORT_TYPE ReportType,
251  IN PUSAGE UsageList,
253  IN OUT PCHAR Report,
255 
256 HIDAPI
257 NTSTATUS
258 NTAPI
260  IN PVOID CollectionContext,
261  IN HIDP_REPORT_TYPE ReportType,
264  IN USAGE Usage,
265  IN PCHAR UsageValue,
266  IN USHORT UsageValueByteLength,
267  OUT PCHAR Report,
269 
270 HIDAPI
271 NTSTATUS
272 NTAPI
274  IN PVOID CollectionContext,
275  IN HIDP_REPORT_TYPE ReportType,
278  IN USAGE Usage,
279  IN ULONG UsageValue,
280  IN OUT PCHAR Report,
282 
283 HIDAPI
284 NTSTATUS
285 NTAPI
287  IN PVOID CollectionContext,
288  IN HIDP_REPORT_TYPE ReportType,
291  IN USAGE Usage,
292  IN LONG UsageValue,
293  IN OUT PCHAR Report,
295 
296 HIDAPI
297 NTSTATUS
298 NTAPI
300  IN PVOID CollectionContext,
301  IN HIDP_REPORT_TYPE ReportType,
304  IN OUT PCHAR Report,
306 
307 HIDAPI
308 ULONG
309 NTAPI
311  IN PVOID CollectionContext,
312  IN HIDP_REPORT_TYPE ReportType);
313 
314 HIDAPI
315 NTSTATUS
316 NTAPI
318  IN PVOID CollectionContext,
319  IN HIDP_REPORT_TYPE ReportType,
320  IN UCHAR ReportID,
321  IN OUT PCHAR Report,
323 
324 NTSTATUS
326  IN USAGE Usage,
327  IN HIDP_KEYBOARD_DIRECTION KeyAction,
328  IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
329  IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
330  IN PVOID InsertCodesContext);
331 
332 NTSTATUS
334  IN USAGE Usage,
335  IN HIDP_KEYBOARD_DIRECTION KeyAction,
336  IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
337  IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
338  IN PVOID InsertCodesContext);
339 
340 HIDAPI
341 NTSTATUS
342 NTAPI
344  IN PVOID CollectionContext,
345  HIDP_REPORT_TYPE ReportType,
signed char * PCHAR
Definition: retypes.h:7
HIDAPI NTSTATUS NTAPI HidParser_UnsetUsages(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection, IN PUSAGE UsageList, IN OUT PULONG UsageLength, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:978
#define IN
Definition: typedefs.h:39
HIDAPI NTSTATUS NTAPI HidParser_GetUsageValueArray(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, IN USAGE Usage, OUT PCHAR UsageValue, IN USHORT UsageValueByteLength, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:959
BOOLEAN(NTAPI * PHIDP_INSERT_SCANCODES)(_In_opt_ PVOID Context, _In_reads_bytes_(Length) PCHAR NewScanCodes, _In_ ULONG Length)
Definition: hidpi.h:73
HIDAPI NTSTATUS NTAPI HidParser_UsageAndPageListDifference(IN PUSAGE_AND_PAGE PreviousUsageList, IN PUSAGE_AND_PAGE CurrentUsageList, OUT PUSAGE_AND_PAGE BreakUsageList, OUT PUSAGE_AND_PAGE MakeUsageList, IN ULONG UsageListLength)
Definition: hidparser.c:689
HIDAPI NTSTATUS NTAPI HidParser_SetUsages(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection, IN PUSAGE UsageList, IN OUT PULONG UsageLength, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1012
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_BUTTON_CAPS _Inout_ PUSHORT ButtonCapsLength
Definition: hidpi.h:382
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
HIDAPI NTSTATUS NTAPI HidParser_GetSpecificValueCaps(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection, IN USAGE Usage, OUT PHIDP_VALUE_CAPS ValueCaps, IN OUT PUSHORT ValueCapsLength)
Definition: hidparser.c:321
LONG NTSTATUS
Definition: precomp.h:26
HIDAPI NTSTATUS NTAPI HidParser_SetUsageValueArray(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, IN USAGE Usage, IN PCHAR UsageValue, IN USHORT UsageValueByteLength, OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1030
HIDAPI NTSTATUS NTAPI HidParser_TranslateUsagesToI8042ScanCodes(IN PUSAGE ChangedUsageList, IN ULONG UsageListLength, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, IN PVOID InsertCodesContext)
Definition: hidparser.c:996
_Must_inspect_result_ _In_ USHORT _Inout_updates_to_ UsageLength PUSAGE_AND_PAGE _Inout_ ULONG * UsageLength
Definition: hidpi.h:425
PUCHAR PHIDP_REPORT_DESCRIPTOR
Definition: hidpi.h:38
HIDAPI NTSTATUS NTAPI HidParser_SetScaledUsageValue(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, IN USAGE Usage, IN LONG UsageValue, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1067
HIDAPI ULONG NTAPI HidParser_MaxUsageListLength(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage OPTIONAL)
Definition: hidparser.c:253
enum _HIDP_KEYBOARD_DIRECTION HIDP_KEYBOARD_DIRECTION
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_VALUE_CAPS ValueCaps
Definition: hidpi.h:396
NTSTATUS NTAPI HidParser_SysPowerCaps(IN PVOID CollectionContext, OUT PULONG OutputBuffer)
Definition: hidparser.c:947
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:430
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
long LONG
Definition: pedump.c:60
HIDAPI NTSTATUS NTAPI HidParser_GetCaps(IN PVOID CollectionContext, OUT PHIDP_CAPS Capabilities)
Definition: hidparser.c:193
#define HIDAPI
Definition: hidpi.h:35
HIDAPI ULONG NTAPI HidParser_MaxDataListLength(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType)
Definition: hidparser.c:1101
NTSTATUS NTAPI HidParser_GetCollectionDescription(IN PHIDP_REPORT_DESCRIPTOR ReportDesc, IN ULONG DescLength, IN POOL_TYPE PoolType, OUT PHIDP_DEVICE_DESC DeviceDescription)
Definition: hidparser.c:18
enum _HIDP_REPORT_TYPE HIDP_REPORT_TYPE
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA DataList
Definition: hidpi.h:333
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1437
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:859
_Must_inspect_result_ _In_ USAGE UsagePage
Definition: hidpi.h:382
HIDAPI NTSTATUS NTAPI HidParser_GetValueCaps(IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, PULONG ValueCapsLength)
Definition: hidparser.c:1130
HIDAPI NTSTATUS NTAPI HidParser_TranslateUsageAndPagesToI8042ScanCodes(IN PUSAGE_AND_PAGE ChangedUsageList, IN ULONG UsageListLength, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, IN PVOID InsertCodesContext)
Definition: hidparser.c:614
USHORT * PUSAGE
Definition: hidusage.h:30
HIDAPI NTSTATUS NTAPI HidParser_GetUsagesEx(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT LinkCollection, OUT PUSAGE_AND_PAGE ButtonList, IN OUT ULONG *UsageLength, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:674
NTSTATUS HidParser_TranslateKbdUsage(IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, IN PVOID InsertCodesContext)
Definition: api.c:851
HIDAPI NTSTATUS NTAPI HidParser_GetExtendedAttributes(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT DataIndex, OUT PHIDP_EXTENDED_ATTRIBUTES Attributes, IN OUT PULONG LengthAttributes)
Definition: hidparser.c:852
VOID NTAPI HidParser_FreeCollectionDescription(IN PHIDP_DEVICE_DESC DeviceDescription)
Definition: hidparser.c:163
HIDAPI NTSTATUS NTAPI HidParser_SetData(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN PHIDP_DATA DataList, IN OUT PULONG DataLength, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1085
INT POOL_TYPE
Definition: typedefs.h:78
HIDAPI NTSTATUS NTAPI HidParser_SetUsageValue(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection, IN USAGE Usage, IN ULONG UsageValue, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1049
NTSTATUS NTAPI HidParser_SysPowerEvent(IN PVOID CollectionContext, IN PCHAR HidPacket, IN USHORT HidPacketLength, OUT PULONG OutputBuffer)
Definition: hidparser.c:934
USHORT USAGE
Definition: hidusage.h:30
_Must_inspect_result_ _In_ USHORT _Inout_updates_to_ UsageLength PUSAGE_AND_PAGE ButtonList
Definition: hidpi.h:425
HIDAPI NTSTATUS NTAPI HidParser_GetUsages(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, OUT USAGE *UsageList, IN OUT ULONG *UsageLength, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:504
unsigned char UCHAR
Definition: xmlstorage.h:181
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG _In_ PHIDP_PREPARSED_DATA _In_ ULONG ReportLength
Definition: hidpi.h:337
_Must_inspect_result_ _In_ ULONG UsageListLength
Definition: hidpi.h:647
HIDAPI NTSTATUS NTAPI HidParser_InitializeReportForID(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN UCHAR ReportID, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1113
HIDAPI NTSTATUS NTAPI HidParser_GetButtonCaps(IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_BUTTON_CAPS ButtonCaps, PUSHORT ButtonCapsLength)
_Must_inspect_result_ _Inout_ PULONG LinkCollectionNodesLength
Definition: hidpi.h:358
_Must_inspect_result_ _In_ USAGE _In_ USHORT LinkCollection
Definition: hidpi.h:382
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_BUTTON_CAPS ButtonCaps
Definition: hidpi.h:382
_Must_inspect_result_ _In_ UCHAR ReportID
Definition: hidpi.h:482
unsigned short USHORT
Definition: pedump.c:61
HIDAPI NTSTATUS NTAPI HidParser_GetSpecificButtonCaps(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection, IN USAGE Usage, OUT PHIDP_BUTTON_CAPS ButtonCaps, IN OUT PULONG ButtonCapsLength)
Definition: hidparser.c:818
unsigned int * PULONG
Definition: retypes.h:1
_Must_inspect_result_ _In_ USHORT DataIndex
Definition: hidpi.h:346
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES _Inout_ OUT PULONG LengthAttributes
Definition: hidpi.h:348
#define OUT
Definition: typedefs.h:40
HIDAPI NTSTATUS NTAPI HidParser_GetScaledUsageValue(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, IN USAGE Usage, OUT PLONG UsageValue, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:559
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5
NTSTATUS HidParser_TranslateCustUsage(IN USAGE Usage, IN HIDP_KEYBOARD_DIRECTION KeyAction, IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState, IN PHIDP_INSERT_SCANCODES InsertCodesProcedure, IN PVOID InsertCodesContext)
Definition: api.c:913
HIDAPI NTSTATUS NTAPI HidParser_GetUsageValue(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection, IN USAGE Usage, OUT PULONG UsageValue, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:880
unsigned short * PUSHORT
Definition: retypes.h:2
HIDAPI NTSTATUS NTAPI HidParser_UsageListDifference(IN PUSAGE PreviousUsageList, IN PUSAGE CurrentUsageList, OUT PUSAGE BreakUsageList, OUT PUSAGE MakeUsageList, IN ULONG UsageListLength)
Definition: hidparser.c:375
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_VALUE_CAPS _Inout_ PUSHORT ValueCapsLength
Definition: hidpi.h:396
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
HIDAPI NTSTATUS NTAPI HidParser_GetLinkCollectionNodes(IN PVOID CollectionContext, OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, IN OUT PULONG LinkCollectionNodesLength)
Definition: hidparser.c:867
HIDAPI NTSTATUS NTAPI HidParser_GetData(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, OUT PHIDP_DATA DataList, IN OUT PULONG DataLength, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:836
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68