[HIDPARSE]
[reactos.git] / drivers / usb / hidparse / hidparse.c
1 /*
2 * PROJECT: ReactOS Universal Serial Bus Bulk Enhanced Host Controller Interface
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/usb/hidparse/hidparse.c
5 * PURPOSE: HID Parser
6 * PROGRAMMERS:
7 * Michael Martin (michael.martin@reactos.org)
8 * Johannes Anderwald (johannes.anderwald@reactos.org)
9 */
10
11 #include "hidparse.h"
12
13
14 VOID
15 HidP_FreeCollectionDescription (
16 IN PHIDP_DEVICE_DESC DeviceDescription)
17 {
18 DPRINT1("HidP_FreeCollectionDescription DeviceDescription %p\n", DeviceDescription);
19
20 //
21 // free collection
22 //
23 ExFreePool(DeviceDescription->CollectionDesc);
24
25 //
26 // free report ids
27 //
28 ExFreePool(DeviceDescription->ReportIDs);
29
30 //
31 // free description itself
32 //
33 ExFreePool(DeviceDescription);
34
35 }
36
37 HIDAPI
38 NTSTATUS
39 NTAPI
40 HidP_GetButtonCaps(
41 HIDP_REPORT_TYPE ReportType,
42 PHIDP_BUTTON_CAPS ButtonCaps,
43 PUSHORT ButtonCapsLength,
44 PHIDP_PREPARSED_DATA PreparsedData)
45 {
46 return HidP_GetSpecificButtonCaps(ReportType, 0, 0, 0, ButtonCaps, (PULONG)ButtonCapsLength, PreparsedData);
47 }
48
49 HIDAPI
50 NTSTATUS
51 NTAPI
52 HidP_GetSpecificButtonCaps(
53 IN HIDP_REPORT_TYPE ReportType,
54 IN USAGE UsagePage,
55 IN USHORT LinkCollection,
56 IN USAGE Usage,
57 OUT PHIDP_BUTTON_CAPS ButtonCaps,
58 IN OUT PULONG ButtonCapsLength,
59 IN PHIDP_PREPARSED_DATA PreparsedData)
60 {
61 UNIMPLEMENTED
62 ASSERT(FALSE);
63 return STATUS_NOT_IMPLEMENTED;
64 }
65
66
67 HIDAPI
68 NTSTATUS
69 NTAPI
70 HidP_GetCaps(
71 IN PHIDP_PREPARSED_DATA PreparsedData,
72 OUT PHIDP_CAPS Capabilities)
73 {
74 UNIMPLEMENTED
75 ASSERT(FALSE);
76 return STATUS_NOT_IMPLEMENTED;
77 }
78
79 NTSTATUS
80 HidP_GetCollectionDescription(
81 IN PHIDP_REPORT_DESCRIPTOR ReportDesc,
82 IN ULONG DescLength,
83 IN POOL_TYPE PoolType,
84 OUT PHIDP_DEVICE_DESC DeviceDescription)
85 {
86 UNIMPLEMENTED
87 ASSERT(FALSE);
88 return STATUS_NOT_IMPLEMENTED;
89 }
90
91 HIDAPI
92 NTSTATUS
93 NTAPI
94 HidP_GetData(
95 IN HIDP_REPORT_TYPE ReportType,
96 OUT PHIDP_DATA DataList,
97 IN OUT PULONG DataLength,
98 IN PHIDP_PREPARSED_DATA PreparsedData,
99 IN PCHAR Report,
100 IN ULONG ReportLength)
101 {
102 UNIMPLEMENTED
103 ASSERT(FALSE);
104 return STATUS_NOT_IMPLEMENTED;
105 }
106
107 HIDAPI
108 NTSTATUS
109 NTAPI
110 HidP_GetExtendedAttributes(
111 IN HIDP_REPORT_TYPE ReportType,
112 IN USHORT DataIndex,
113 IN PHIDP_PREPARSED_DATA PreparsedData,
114 OUT PHIDP_EXTENDED_ATTRIBUTES Attributes,
115 IN OUT PULONG LengthAttributes)
116 {
117 UNIMPLEMENTED
118 ASSERT(FALSE);
119 return STATUS_NOT_IMPLEMENTED;
120 }
121
122 HIDAPI
123 NTSTATUS
124 NTAPI
125 HidP_GetLinkCollectionNodes(
126 OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
127 IN OUT PULONG LinkCollectionNodesLength,
128 IN PHIDP_PREPARSED_DATA PreparsedData)
129 {
130 UNIMPLEMENTED
131 ASSERT(FALSE);
132 return STATUS_NOT_IMPLEMENTED;
133 }
134
135 HIDAPI
136 NTSTATUS
137 NTAPI
138 HidP_GetScaledUsageValue(
139 IN HIDP_REPORT_TYPE ReportType,
140 IN USAGE UsagePage,
141 IN USHORT LinkCollection OPTIONAL,
142 IN USAGE Usage,
143 OUT PLONG UsageValue,
144 IN PHIDP_PREPARSED_DATA PreparsedData,
145 IN PCHAR Report,
146 IN ULONG ReportLength)
147 {
148 UNIMPLEMENTED
149 ASSERT(FALSE);
150 return STATUS_NOT_IMPLEMENTED;
151 }
152
153 HIDAPI
154 NTSTATUS
155 NTAPI
156 HidP_GetUsageValue(
157 IN HIDP_REPORT_TYPE ReportType,
158 IN USAGE UsagePage,
159 IN USHORT LinkCollection,
160 IN USAGE Usage,
161 OUT PULONG UsageValue,
162 IN PHIDP_PREPARSED_DATA PreparsedData,
163 IN PCHAR Report,
164 IN ULONG ReportLength)
165 {
166 UNIMPLEMENTED
167 ASSERT(FALSE);
168 return STATUS_NOT_IMPLEMENTED;
169 }
170
171
172
173 HIDAPI
174 NTSTATUS
175 NTAPI
176 HidP_UsageListDifference(
177 IN PUSAGE PreviousUsageList,
178 IN PUSAGE CurrentUsageList,
179 OUT PUSAGE BreakUsageList,
180 OUT PUSAGE MakeUsageList,
181 IN ULONG UsageListLength)
182 {
183 UNIMPLEMENTED
184 ASSERT(FALSE);
185 return STATUS_NOT_IMPLEMENTED;
186 }
187
188 HIDAPI
189 NTSTATUS
190 NTAPI
191 HidP_GetSpecificValueCaps(
192 IN HIDP_REPORT_TYPE ReportType,
193 IN USAGE UsagePage,
194 IN USHORT LinkCollection,
195 IN USAGE Usage,
196 OUT PHIDP_VALUE_CAPS ValueCaps,
197 IN OUT PULONG ValueCapsLength,
198 IN PHIDP_PREPARSED_DATA PreparsedData)
199 {
200 UNIMPLEMENTED
201 ASSERT(FALSE);
202 return STATUS_NOT_IMPLEMENTED;
203 }
204
205 HIDAPI
206 ULONG
207 NTAPI
208 HidP_MaxUsageListLength(
209 IN HIDP_REPORT_TYPE ReportType,
210 IN USAGE UsagePage OPTIONAL,
211 IN PHIDP_PREPARSED_DATA PreparsedData)
212 {
213 UNIMPLEMENTED
214 ASSERT(FALSE);
215 return STATUS_NOT_IMPLEMENTED;
216 }
217
218 HIDAPI
219 NTSTATUS
220 NTAPI
221 HidP_GetUsages(
222 IN HIDP_REPORT_TYPE ReportType,
223 IN USAGE UsagePage,
224 IN USHORT LinkCollection OPTIONAL,
225 OUT USAGE *UsageList,
226 IN OUT ULONG *UsageLength,
227 IN PHIDP_PREPARSED_DATA PreparsedData,
228 IN PCHAR Report,
229 IN ULONG ReportLength)
230 {
231 UNIMPLEMENTED
232 ASSERT(FALSE);
233 return STATUS_NOT_IMPLEMENTED;
234 }
235
236 NTSTATUS
237 HidP_SysPowerEvent (
238 IN PCHAR HidPacket,
239 IN USHORT HidPacketLength,
240 IN PHIDP_PREPARSED_DATA Ppd,
241 OUT PULONG OutputBuffer)
242 {
243 UNIMPLEMENTED
244 ASSERT(FALSE);
245 return STATUS_NOT_IMPLEMENTED;
246 }
247
248 NTSTATUS
249 HidP_SysPowerCaps (
250 IN PHIDP_PREPARSED_DATA Ppd,
251 OUT PULONG OutputBuffer)
252 {
253 UNIMPLEMENTED
254 ASSERT(FALSE);
255 return STATUS_NOT_IMPLEMENTED;
256 }
257
258 HIDAPI
259 NTSTATUS
260 NTAPI
261 HidP_GetUsageValueArray(
262 IN HIDP_REPORT_TYPE ReportType,
263 IN USAGE UsagePage,
264 IN USHORT LinkCollection OPTIONAL,
265 IN USAGE Usage,
266 OUT PCHAR UsageValue,
267 IN USHORT UsageValueByteLength,
268 IN PHIDP_PREPARSED_DATA PreparsedData,
269 IN PCHAR Report,
270 IN ULONG ReportLength)
271 {
272 UNIMPLEMENTED
273 ASSERT(FALSE);
274 return STATUS_NOT_IMPLEMENTED;
275 }
276
277 HIDAPI
278 NTSTATUS
279 NTAPI
280 HidP_GetUsagesEx(
281 IN HIDP_REPORT_TYPE ReportType,
282 IN USHORT LinkCollection,
283 OUT PUSAGE_AND_PAGE ButtonList,
284 IN OUT ULONG *UsageLength,
285 IN PHIDP_PREPARSED_DATA PreparsedData,
286 IN PCHAR Report,
287 IN ULONG ReportLength)
288 {
289 UNIMPLEMENTED
290 ASSERT(FALSE);
291 return STATUS_NOT_IMPLEMENTED;
292 }
293
294
295 HIDAPI
296 NTSTATUS
297 NTAPI
298 HidP_UsageAndPageListDifference(
299 IN PUSAGE_AND_PAGE PreviousUsageList,
300 IN PUSAGE_AND_PAGE CurrentUsageList,
301 OUT PUSAGE_AND_PAGE BreakUsageList,
302 OUT PUSAGE_AND_PAGE MakeUsageList,
303 IN ULONG UsageListLength)
304 {
305 UNIMPLEMENTED
306 ASSERT(FALSE);
307 return STATUS_NOT_IMPLEMENTED;
308 }
309
310 HIDAPI
311 NTSTATUS
312 NTAPI
313 HidP_UnsetUsages(
314 IN HIDP_REPORT_TYPE ReportType,
315 IN USAGE UsagePage,
316 IN USHORT LinkCollection,
317 IN PUSAGE UsageList,
318 IN OUT PULONG UsageLength,
319 IN PHIDP_PREPARSED_DATA PreparsedData,
320 IN OUT PCHAR Report,
321 IN ULONG ReportLength)
322 {
323 UNIMPLEMENTED
324 ASSERT(FALSE);
325 return STATUS_NOT_IMPLEMENTED;
326 }
327
328 HIDAPI
329 NTSTATUS
330 NTAPI
331 HidP_TranslateUsagesToI8042ScanCodes(
332 IN PUSAGE ChangedUsageList,
333 IN ULONG UsageListLength,
334 IN HIDP_KEYBOARD_DIRECTION KeyAction,
335 IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
336 IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
337 IN PVOID InsertCodesContext)
338 {
339 UNIMPLEMENTED
340 ASSERT(FALSE);
341 return STATUS_NOT_IMPLEMENTED;
342 }
343
344 HIDAPI
345 NTSTATUS
346 NTAPI
347 HidP_TranslateUsageAndPagesToI8042ScanCodes(
348 IN PUSAGE_AND_PAGE ChangedUsageList,
349 IN ULONG UsageListLength,
350 IN HIDP_KEYBOARD_DIRECTION KeyAction,
351 IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
352 IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
353 IN PVOID InsertCodesContext)
354 {
355 UNIMPLEMENTED
356 ASSERT(FALSE);
357 return STATUS_NOT_IMPLEMENTED;
358 }
359
360 HIDAPI
361 NTSTATUS
362 NTAPI
363 HidP_SetUsages(
364 IN HIDP_REPORT_TYPE ReportType,
365 IN USAGE UsagePage,
366 IN USHORT LinkCollection,
367 IN PUSAGE UsageList,
368 IN OUT PULONG UsageLength,
369 IN PHIDP_PREPARSED_DATA PreparsedData,
370 IN OUT PCHAR Report,
371 IN ULONG ReportLength)
372 {
373 UNIMPLEMENTED
374 ASSERT(FALSE);
375 return STATUS_NOT_IMPLEMENTED;
376 }
377
378 HIDAPI
379 NTSTATUS
380 NTAPI
381 HidP_SetUsageValueArray(
382 IN HIDP_REPORT_TYPE ReportType,
383 IN USAGE UsagePage,
384 IN USHORT LinkCollection OPTIONAL,
385 IN USAGE Usage,
386 IN PCHAR UsageValue,
387 IN USHORT UsageValueByteLength,
388 IN PHIDP_PREPARSED_DATA PreparsedData,
389 OUT PCHAR Report,
390 IN ULONG ReportLength)
391 {
392 UNIMPLEMENTED
393 ASSERT(FALSE);
394 return STATUS_NOT_IMPLEMENTED;
395 }
396
397 HIDAPI
398 NTSTATUS
399 NTAPI
400 HidP_SetUsageValue(
401 IN HIDP_REPORT_TYPE ReportType,
402 IN USAGE UsagePage,
403 IN USHORT LinkCollection,
404 IN USAGE Usage,
405 IN ULONG UsageValue,
406 IN PHIDP_PREPARSED_DATA PreparsedData,
407 IN OUT PCHAR Report,
408 IN ULONG ReportLength)
409 {
410 UNIMPLEMENTED
411 ASSERT(FALSE);
412 return STATUS_NOT_IMPLEMENTED;
413 }
414
415 HIDAPI
416 NTSTATUS
417 NTAPI
418 HidP_SetScaledUsageValue(
419 IN HIDP_REPORT_TYPE ReportType,
420 IN USAGE UsagePage,
421 IN USHORT LinkCollection OPTIONAL,
422 IN USAGE Usage,
423 IN LONG UsageValue,
424 IN PHIDP_PREPARSED_DATA PreparsedData,
425 IN OUT PCHAR Report,
426 IN ULONG ReportLength)
427 {
428 UNIMPLEMENTED
429 ASSERT(FALSE);
430 return STATUS_NOT_IMPLEMENTED;
431 }
432
433 HIDAPI
434 NTSTATUS
435 NTAPI
436 HidP_SetData(
437 IN HIDP_REPORT_TYPE ReportType,
438 IN PHIDP_DATA DataList,
439 IN OUT PULONG DataLength,
440 IN PHIDP_PREPARSED_DATA PreparsedData,
441 IN OUT PCHAR Report,
442 IN ULONG ReportLength)
443 {
444 UNIMPLEMENTED
445 ASSERT(FALSE);
446 return STATUS_NOT_IMPLEMENTED;
447 }
448
449 HIDAPI
450 ULONG
451 NTAPI
452 HidP_MaxDataListLength(
453 IN HIDP_REPORT_TYPE ReportType,
454 IN PHIDP_PREPARSED_DATA PreparsedData)
455 {
456 UNIMPLEMENTED
457 ASSERT(FALSE);
458 return STATUS_NOT_IMPLEMENTED;
459 }
460
461 HIDAPI
462 NTSTATUS
463 NTAPI
464 HidP_InitializeReportForID(
465 IN HIDP_REPORT_TYPE ReportType,
466 IN UCHAR ReportID,
467 IN PHIDP_PREPARSED_DATA PreparsedData,
468 IN OUT PCHAR Report,
469 IN ULONG ReportLength)
470 {
471 UNIMPLEMENTED
472 ASSERT(FALSE);
473 return STATUS_NOT_IMPLEMENTED;
474 }
475
476 HIDAPI
477 NTSTATUS
478 NTAPI
479 HidP_GetValueCaps(
480 HIDP_REPORT_TYPE ReportType,
481 PHIDP_VALUE_CAPS ValueCaps,
482 PULONG ValueCapsLength,
483 PHIDP_PREPARSED_DATA PreparsedData)
484 {
485 UNIMPLEMENTED
486 ASSERT(FALSE);
487 return STATUS_NOT_IMPLEMENTED;
488 }
489
490 NTSTATUS
491 NTAPI
492 DriverEntry(
493 IN PDRIVER_OBJECT DriverObject,
494 IN PUNICODE_STRING RegPath)
495 {
496
497 DPRINT1("********* HID PARSE *********\n");
498 return STATUS_SUCCESS;
499 }