ReactOS  0.4.14-dev-1007-g90d795b
hidparser.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS HID Parser Library
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 #include "parser.h"
12 
13 #define NDEBUG
14 #include <debug.h>
15 
19 {
20  switch(Status)
21  {
39  return HIDP_STATUS_NOT_IMPLEMENTED; //FIXME
42  }
43  DPRINT1("TranslateHidParserStatus Status %ld not implemented\n", Status);
45 }
46 
48 NTAPI
50  IN PHID_PARSER Parser,
51  IN PHIDP_REPORT_DESCRIPTOR ReportDesc,
52  IN ULONG DescLength,
55 {
56  HIDPARSER_STATUS ParserStatus;
57  ULONG CollectionCount;
58  ULONG Index;
59  PVOID ParserContext;
60 
61  //
62  // first parse the report descriptor
63  //
64  ParserStatus = HidParser_ParseReportDescriptor(Parser, ReportDesc, DescLength, &ParserContext);
65  if (ParserStatus != HIDPARSER_STATUS_SUCCESS)
66  {
67  //
68  // failed to parse report descriptor
69  //
70  Parser->Debug("[HIDPARSER] Failed to parse report descriptor with %x\n", ParserStatus);
71  return ParserStatus;
72  }
73 
74  //
75  // get collection count
76  //
77  CollectionCount = HidParser_NumberOfTopCollections(ParserContext);
78  if (CollectionCount == 0)
79  {
80  //
81  // no top level collections found
82  //
83  ASSERT(FALSE);
85  }
86 
87  //
88  // zero description
89  //
90  Parser->Zero(DeviceDescription, sizeof(HIDP_DEVICE_DESC));
91 
92  //
93  // allocate collection
94  //
95  DeviceDescription->CollectionDesc = (PHIDP_COLLECTION_DESC)Parser->Alloc(sizeof(HIDP_COLLECTION_DESC) * CollectionCount);
96  if (!DeviceDescription->CollectionDesc)
97  {
98  //
99  // no memory
100  //
102  }
103 
104  //
105  // allocate report description
106  //
107  DeviceDescription->ReportIDs = (PHIDP_REPORT_IDS)Parser->Alloc(sizeof(HIDP_REPORT_IDS) * CollectionCount);
108  if (!DeviceDescription->ReportIDs)
109  {
110  //
111  // no memory
112  //
113  Parser->Free(DeviceDescription->CollectionDesc);
115  }
116 
117  for(Index = 0; Index < CollectionCount; Index++)
118  {
119  //
120  // set preparsed data length
121  //
122  DeviceDescription->CollectionDesc[Index].PreparsedDataLength = HidParser_GetContextSize(Parser, ParserContext, Index);
123  ParserStatus = HidParser_BuildContext(Parser, ParserContext, Index, DeviceDescription->CollectionDesc[Index].PreparsedDataLength, (PVOID*)&DeviceDescription->CollectionDesc[Index].PreparsedData);
124  if (ParserStatus != HIDPARSER_STATUS_SUCCESS)
125  {
126  //
127  // no memory
128  //
129  Parser->Free(DeviceDescription->CollectionDesc);
130  Parser->Free(DeviceDescription->ReportIDs);
131  return ParserStatus;
132  }
133 
134  //
135  // init report description
136  //
137  DeviceDescription->ReportIDs[Index].CollectionNumber = Index + 1;
138  DeviceDescription->ReportIDs[Index].ReportID = Index; //FIXME
139  DeviceDescription->ReportIDs[Index].InputLength = HidParser_GetReportLength((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_INPUT);
140  DeviceDescription->ReportIDs[Index].OutputLength = HidParser_GetReportLength((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_OUTPUT);
141  DeviceDescription->ReportIDs[Index].FeatureLength = HidParser_GetReportLength((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_FEATURE);
142 
143 
144  DeviceDescription->ReportIDs[Index].InputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_INPUT) ? 1 : 0);
145  DeviceDescription->ReportIDs[Index].OutputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_OUTPUT) ? 1 : 0);
146  DeviceDescription->ReportIDs[Index].FeatureLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_FEATURE) ? 1 : 0);
147 
148 
149  //
150  // init collection description
151  //
152  DeviceDescription->CollectionDesc[Index].CollectionNumber = Index + 1;
153 
154  //
155  // get collection usage page
156  //
157  ParserStatus = HidParser_GetCollectionUsagePage((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, &DeviceDescription->CollectionDesc[Index].Usage, &DeviceDescription->CollectionDesc[Index].UsagePage);
158  if (ParserStatus != HIDPARSER_STATUS_SUCCESS)
159  {
160  // collection not found
161  Parser->Free(DeviceDescription->CollectionDesc);
162  Parser->Free(DeviceDescription->ReportIDs);
163  return ParserStatus;
164  }
165 
166  //
167  // windows seems to prepend the report id, regardless if it is required
168  //
169  DeviceDescription->CollectionDesc[Index].CollectionNumber = Index + 1;
170  DeviceDescription->CollectionDesc[Index].InputLength = DeviceDescription->ReportIDs[Index].InputLength;
171  DeviceDescription->CollectionDesc[Index].OutputLength = DeviceDescription->ReportIDs[Index].OutputLength;
172  DeviceDescription->CollectionDesc[Index].FeatureLength = DeviceDescription->ReportIDs[Index].FeatureLength;
173 
174  DeviceDescription->CollectionDesc[Index].InputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_INPUT) == FALSE ? 1 : 0);
175  DeviceDescription->CollectionDesc[Index].OutputLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_OUTPUT) == FALSE ? 1 : 0);
176  DeviceDescription->CollectionDesc[Index].FeatureLength += (HidParser_UsesReportId((PVOID)DeviceDescription->CollectionDesc[Index].PreparsedData, HID_REPORT_TYPE_FEATURE) == FALSE ? 1 : 0);
177 
178 
179  }
180 
181  //
182  // store collection & report count
183  //
184  DeviceDescription->CollectionDescLength = CollectionCount;
185  DeviceDescription->ReportIDsLength = CollectionCount;
186 
187  //
188  // done
189  //
190  return STATUS_SUCCESS;
191 }
192 
193 VOID
194 NTAPI
196  IN PHID_PARSER Parser,
198 {
199  ULONG Index;
200 
201  //
202  // first free all context
203  //
204  for(Index = 0; Index < DeviceDescription->CollectionDescLength; Index++)
205  {
206  //
207  // free collection context
208  //
209  Parser->Free(DeviceDescription->CollectionDesc[Index].PreparsedData);
210  }
211 
212  //
213  // now free collection description
214  //
215  Parser->Free(DeviceDescription->CollectionDesc);
216 
217  //
218  // free report description
219  //
220  Parser->Free(DeviceDescription->ReportIDs);
221 }
222 
223 HIDAPI
224 NTSTATUS
225 NTAPI
227  IN PHID_PARSER Parser,
228  IN PVOID CollectionContext,
230 {
231  //
232  // zero capabilities
233  //
234  Parser->Zero(Capabilities, sizeof(HIDP_CAPS));
235 
236  //
237  // init capabilities
238  //
243 
244  //
245  // always pre-prend report id
246  //
250 
251  //
252  // get number of link collection nodes
253  //
255 
256  //
257  // get data indices
258  //
262 
263  //
264  // get value caps
265  //
269 
270 
271  //
272  // get button caps
273  //
277 
278  //
279  // done
280  //
281  return HIDP_STATUS_SUCCESS;
282 }
283 
284 HIDAPI
285 ULONG
286 NTAPI
288  IN PHID_PARSER Parser,
289  IN PVOID CollectionContext,
290  IN HIDP_REPORT_TYPE ReportType,
292 {
293  //
294  // FIXME test what should be returned when usage page is not defined
295  //
297  {
298  //
299  // implement me
300  //
302 
303  //
304  // invalid report
305  //
306  return 0;
307  }
308 
309  if (ReportType == HidP_Input)
310  {
311  //
312  // input report
313  //
315  }
316  else if (ReportType == HidP_Output)
317  {
318  //
319  // input report
320  //
322  }
323  else if (ReportType == HidP_Feature)
324  {
325  //
326  // input report
327  //
329  }
330  else
331  {
332  //
333  // invalid report type
334  //
335  return 0;
336  }
337 }
338 
339 #undef HidParser_GetButtonCaps
340 
341 HIDAPI
342 NTSTATUS
343 NTAPI
345  IN PHID_PARSER Parser,
346  IN PVOID CollectionContext,
347  IN HIDP_REPORT_TYPE ReportType,
350 {
352 }
353 
354 HIDAPI
355 NTSTATUS
356 NTAPI
358  IN PHID_PARSER Parser,
359  IN PVOID CollectionContext,
360  IN HIDP_REPORT_TYPE ReportType,
363  IN USAGE Usage,
366 {
367  HIDPARSER_STATUS ParserStatus;
368 
369  //
370  // FIXME: implement searching in specific collection
371  //
373 
374  if (ReportType == HidP_Input)
375  {
376  //
377  // input report
378  //
380  }
381  else if (ReportType == HidP_Output)
382  {
383  //
384  // input report
385  //
387  }
388  else if (ReportType == HidP_Feature)
389  {
390  //
391  // input report
392  //
394  }
395  else
396  {
397  //
398  // invalid report type
399  //
401  }
402 
403 
404  if (ParserStatus == HIDPARSER_STATUS_SUCCESS)
405  {
406  //
407  // success
408  //
409  return HIDP_STATUS_SUCCESS;
410  }
411 
412  //
413  // translate error
414  //
415  return TranslateHidParserStatus(ParserStatus);
416 }
417 
418 HIDAPI
419 NTSTATUS
420 NTAPI
422  IN PUSAGE PreviousUsageList,
423  IN PUSAGE CurrentUsageList,
424  OUT PUSAGE BreakUsageList,
425  OUT PUSAGE MakeUsageList,
427 {
428  ULONG Index, SubIndex, bFound, BreakUsageIndex = 0, MakeUsageIndex = 0;
429  USAGE CurrentUsage, Usage;
430 
431  if (UsageListLength)
432  {
433  Index = 0;
434  do
435  {
436  /* get current usage */
437  CurrentUsage = PreviousUsageList[Index];
438 
439  /* is the end of list reached? */
440  if (!CurrentUsage)
441  break;
442 
443  /* start searching in current usage list */
444  SubIndex = 0;
445  bFound = FALSE;
446  do
447  {
448  /* get usage of current list */
449  Usage = CurrentUsageList[SubIndex];
450 
451  /* end of list reached? */
452  if (!Usage)
453  break;
454 
455  /* check if it matches the current one */
456  if (CurrentUsage == Usage)
457  {
458  /* it does */
459  bFound = TRUE;
460  break;
461  }
462 
463  /* move to next usage */
464  SubIndex++;
465  }while(SubIndex < UsageListLength);
466 
467  /* was the usage found ?*/
468  if (!bFound)
469  {
470  /* store it in the break usage list */
471  BreakUsageList[BreakUsageIndex] = CurrentUsage;
472  BreakUsageIndex++;
473  }
474 
475  /* move to next usage */
476  Index++;
477 
478  }while(Index < UsageListLength);
479 
480  /* now process the new items */
481  Index = 0;
482  do
483  {
484  /* get current usage */
485  CurrentUsage = CurrentUsageList[Index];
486 
487  /* is the end of list reached? */
488  if (!CurrentUsage)
489  break;
490 
491  /* start searching in current usage list */
492  SubIndex = 0;
493  bFound = FALSE;
494  do
495  {
496  /* get usage of previous list */
497  Usage = PreviousUsageList[SubIndex];
498 
499  /* end of list reached? */
500  if (!Usage)
501  break;
502 
503  /* check if it matches the current one */
504  if (CurrentUsage == Usage)
505  {
506  /* it does */
507  bFound = TRUE;
508  break;
509  }
510 
511  /* move to next usage */
512  SubIndex++;
513  }while(SubIndex < UsageListLength);
514 
515  /* was the usage found ?*/
516  if (!bFound)
517  {
518  /* store it in the make usage list */
519  MakeUsageList[MakeUsageIndex] = CurrentUsage;
520  MakeUsageIndex++;
521  }
522 
523  /* move to next usage */
524  Index++;
525 
526  }while(Index < UsageListLength);
527  }
528 
529  /* does the break list contain empty entries */
530  if (BreakUsageIndex < UsageListLength)
531  {
532  /* zeroize entries */
533  RtlZeroMemory(&BreakUsageList[BreakUsageIndex], sizeof(USAGE) * (UsageListLength - BreakUsageIndex));
534  }
535 
536  /* does the make usage list contain empty entries */
537  if (MakeUsageIndex < UsageListLength)
538  {
539  /* zeroize entries */
540  RtlZeroMemory(&MakeUsageList[MakeUsageIndex], sizeof(USAGE) * (UsageListLength - MakeUsageIndex));
541  }
542 
543  /* done */
544  return HIDP_STATUS_SUCCESS;
545 }
546 
547 HIDAPI
548 NTSTATUS
549 NTAPI
551  IN PHID_PARSER Parser,
552  IN PVOID CollectionContext,
553  IN HIDP_REPORT_TYPE ReportType,
556  OUT USAGE *UsageList,
558  IN PCHAR Report,
560 {
561  HIDPARSER_STATUS ParserStatus;
562 
563  //
564  // FIXME: implement searching in specific collection
565  //
567 
568  if (ReportType == HidP_Input)
569  {
570  //
571  // input report
572  //
573  ParserStatus = HidParser_GetUsagesWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, UsageList, UsageLength, Report, ReportLength);
574  }
575  else if (ReportType == HidP_Output)
576  {
577  //
578  // input report
579  //
580  ParserStatus = HidParser_GetUsagesWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, UsageList, UsageLength, Report, ReportLength);
581  }
582  else if (ReportType == HidP_Feature)
583  {
584  //
585  // input report
586  //
587  ParserStatus = HidParser_GetUsagesWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, UsageList, UsageLength, Report, ReportLength);
588  }
589  else
590  {
591  //
592  // invalid report type
593  //
595  }
596 
597  if (ParserStatus == HIDPARSER_STATUS_SUCCESS)
598  {
599  //
600  // success
601  //
602  return HIDP_STATUS_SUCCESS;
603  }
604 
605  //
606  // translate error
607  //
608  return TranslateHidParserStatus(ParserStatus);
609 }
610 
611 HIDAPI
612 NTSTATUS
613 NTAPI
615  IN PHID_PARSER Parser,
616  IN PVOID CollectionContext,
617  IN HIDP_REPORT_TYPE ReportType,
620  IN USAGE Usage,
621  OUT PLONG UsageValue,
622  IN PCHAR Report,
624 {
625  HIDPARSER_STATUS ParserStatus;
626 
627  //
628  // FIXME: implement searching in specific collection
629  //
631 
632  if (ReportType == HidP_Input)
633  {
634  //
635  // input report
636  //
637  ParserStatus = HidParser_GetScaledUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength);
638  }
639  else if (ReportType == HidP_Output)
640  {
641  //
642  // input report
643  //
644  ParserStatus = HidParser_GetScaledUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength);
645  }
646  else if (ReportType == HidP_Feature)
647  {
648  //
649  // input report
650  //
651  ParserStatus = HidParser_GetScaledUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength);
652  }
653  else
654  {
655  //
656  // invalid report type
657  //
659  }
660 
661  if (ParserStatus == HIDPARSER_STATUS_SUCCESS)
662  {
663  //
664  // success
665  //
666  return HIDP_STATUS_SUCCESS;
667  }
668 
669  //
670  // translate error
671  //
672  return TranslateHidParserStatus(ParserStatus);
673 }
674 
675 HIDAPI
676 NTSTATUS
677 NTAPI
679  IN PHID_PARSER Parser,
680  IN PUSAGE_AND_PAGE ChangedUsageList,
682  IN HIDP_KEYBOARD_DIRECTION KeyAction,
683  IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
684  IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
685  IN PVOID InsertCodesContext)
686 {
687  ULONG Index;
689 
690  for(Index = 0; Index < UsageListLength; Index++)
691  {
692  //
693  // check current usage
694  //
695  if (ChangedUsageList[Index].UsagePage == HID_USAGE_PAGE_KEYBOARD)
696  {
697  //
698  // process keyboard usage
699  //
700  Status = HidParser_TranslateKbdUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext);
701  }
702  else if (ChangedUsageList[Index].UsagePage == HID_USAGE_PAGE_CONSUMER)
703  {
704  //
705  // process consumer usage
706  //
707  Status = HidParser_TranslateCustUsage(Parser, ChangedUsageList[Index].Usage, KeyAction, ModifierState, InsertCodesProcedure, InsertCodesContext);
708  }
709  else
710  {
711  //
712  // invalid page / end of usage list page
713  //
715  }
716 
717  //
718  // check status
719  //
721  {
722  //
723  // failed
724  //
726  }
727  }
728 
730  {
731  //
732  // failed
733  //
735  }
736 
737  //
738  // done
739  //
740  return HIDP_STATUS_SUCCESS;
741 }
742 
743 
744 HIDAPI
745 NTSTATUS
746 NTAPI
748  IN PHID_PARSER Parser,
749  IN PVOID CollectionContext,
750  IN HIDP_REPORT_TYPE ReportType,
754  IN PCHAR Report,
756 {
757  return HidParser_GetUsages(Parser, CollectionContext, ReportType, HID_USAGE_PAGE_UNDEFINED, LinkCollection, (PUSAGE)ButtonList, UsageLength, Report, ReportLength);
758 }
759 
760 HIDAPI
761 NTSTATUS
762 NTAPI
764  IN PUSAGE_AND_PAGE PreviousUsageList,
765  IN PUSAGE_AND_PAGE CurrentUsageList,
766  OUT PUSAGE_AND_PAGE BreakUsageList,
767  OUT PUSAGE_AND_PAGE MakeUsageList,
769 {
770  ULONG Index, SubIndex, BreakUsageListIndex = 0, MakeUsageListIndex = 0, bFound;
771  PUSAGE_AND_PAGE CurrentUsage, Usage;
772 
773  if (UsageListLength)
774  {
775  /* process removed usages */
776  Index = 0;
777  do
778  {
779  /* get usage from current index */
780  CurrentUsage = &PreviousUsageList[Index];
781 
782  /* end of list reached? */
783  if (CurrentUsage->Usage == 0 && CurrentUsage->UsagePage == 0)
784  break;
785 
786  /* search in current list */
787  SubIndex = 0;
788  bFound = FALSE;
789  do
790  {
791  /* get usage */
792  Usage = &CurrentUsageList[SubIndex];
793 
794  /* end of list reached? */
795  if (Usage->Usage == 0 && Usage->UsagePage == 0)
796  break;
797 
798  /* does it match */
799  if (Usage->Usage == CurrentUsage->Usage && Usage->UsagePage == CurrentUsage->UsagePage)
800  {
801  /* found match */
802  bFound = TRUE;
803  }
804 
805  /* move to next index */
806  SubIndex++;
807 
808  }while(SubIndex < UsageListLength);
809 
810  if (!bFound)
811  {
812  /* store it in break usage list */
813  BreakUsageList[BreakUsageListIndex].Usage = CurrentUsage->Usage;
814  BreakUsageList[BreakUsageListIndex].UsagePage = CurrentUsage->UsagePage;
815  BreakUsageListIndex++;
816  }
817 
818  /* move to next index */
819  Index++;
820 
821  }while(Index < UsageListLength);
822 
823  /* process new usages */
824  Index = 0;
825  do
826  {
827  /* get usage from current index */
828  CurrentUsage = &CurrentUsageList[Index];
829 
830  /* end of list reached? */
831  if (CurrentUsage->Usage == 0 && CurrentUsage->UsagePage == 0)
832  break;
833 
834  /* search in current list */
835  SubIndex = 0;
836  bFound = FALSE;
837  do
838  {
839  /* get usage */
840  Usage = &PreviousUsageList[SubIndex];
841 
842  /* end of list reached? */
843  if (Usage->Usage == 0 && Usage->UsagePage == 0)
844  break;
845 
846  /* does it match */
847  if (Usage->Usage == CurrentUsage->Usage && Usage->UsagePage == CurrentUsage->UsagePage)
848  {
849  /* found match */
850  bFound = TRUE;
851  }
852 
853  /* move to next index */
854  SubIndex++;
855 
856  }while(SubIndex < UsageListLength);
857 
858  if (!bFound)
859  {
860  /* store it in break usage list */
861  MakeUsageList[MakeUsageListIndex].Usage = CurrentUsage->Usage;
862  MakeUsageList[MakeUsageListIndex].UsagePage = CurrentUsage->UsagePage;
863  MakeUsageListIndex++;
864  }
865 
866  /* move to next index */
867  Index++;
868  }while(Index < UsageListLength);
869  }
870 
871  /* are there remaining free list entries */
872  if (BreakUsageListIndex < UsageListLength)
873  {
874  /* zero them */
875  RtlZeroMemory(&BreakUsageList[BreakUsageListIndex], (UsageListLength - BreakUsageListIndex) * sizeof(USAGE_AND_PAGE));
876  }
877 
878  /* are there remaining free list entries */
879  if (MakeUsageListIndex < UsageListLength)
880  {
881  /* zero them */
882  RtlZeroMemory(&MakeUsageList[MakeUsageListIndex], (UsageListLength - MakeUsageListIndex) * sizeof(USAGE_AND_PAGE));
883  }
884 
885  /* done */
886  return HIDP_STATUS_SUCCESS;
887 }
888 
889 HIDAPI
890 NTSTATUS
891 NTAPI
893  IN PHID_PARSER Parser,
894  IN PVOID CollectionContext,
895  IN HIDP_REPORT_TYPE ReportType,
898  IN USAGE Usage,
901 {
903  ASSERT(FALSE);
904  return STATUS_NOT_IMPLEMENTED;
905 }
906 
907 
908 HIDAPI
909 NTSTATUS
910 NTAPI
912  IN PHID_PARSER Parser,
913  IN PVOID CollectionContext,
914  IN HIDP_REPORT_TYPE ReportType,
917  IN PCHAR Report,
919 {
921  ASSERT(FALSE);
922  return STATUS_NOT_IMPLEMENTED;
923 }
924 
925 HIDAPI
926 NTSTATUS
927 NTAPI
929  IN PHID_PARSER Parser,
930  IN PVOID CollectionContext,
931  IN HIDP_REPORT_TYPE ReportType,
935 {
937  ASSERT(FALSE);
938  return STATUS_NOT_IMPLEMENTED;
939 }
940 
941 HIDAPI
942 NTSTATUS
943 NTAPI
945  IN PHID_PARSER Parser,
946  IN PVOID CollectionContext,
947  OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes,
949 {
951  ASSERT(FALSE);
952  return STATUS_NOT_IMPLEMENTED;
953 }
954 
955 HIDAPI
956 NTSTATUS
957 NTAPI
959  IN PHID_PARSER Parser,
960  IN PVOID CollectionContext,
961  IN HIDP_REPORT_TYPE ReportType,
964  IN USAGE Usage,
965  OUT PULONG UsageValue,
966  IN PCHAR Report,
968 {
969  HIDPARSER_STATUS ParserStatus;
970 
971  //
972  // FIXME: implement searching in specific collection
973  //
975 
976  if (ReportType == HidP_Input)
977  {
978  //
979  // input report
980  //
981  ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_INPUT, UsagePage, Usage, UsageValue, Report, ReportLength);
982  }
983  else if (ReportType == HidP_Output)
984  {
985  //
986  // input report
987  //
988  ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_OUTPUT, UsagePage, Usage, UsageValue, Report, ReportLength);
989  }
990  else if (ReportType == HidP_Feature)
991  {
992  //
993  // input report
994  //
995  ParserStatus = HidParser_GetUsageValueWithReport(Parser, CollectionContext, HID_REPORT_TYPE_FEATURE, UsagePage, Usage, UsageValue, Report, ReportLength);
996  }
997  else
998  {
999  //
1000  // invalid report type
1001  //
1003  }
1004 
1005  if (ParserStatus == HIDPARSER_STATUS_SUCCESS)
1006  {
1007  //
1008  // success
1009  //
1010  return HIDP_STATUS_SUCCESS;
1011  }
1012 
1013  //
1014  // translate error
1015  //
1016  return TranslateHidParserStatus(ParserStatus);
1017 }
1018 
1019 NTSTATUS
1020 NTAPI
1022  IN PHID_PARSER Parser,
1023  IN PVOID CollectionContext,
1024  IN PCHAR HidPacket,
1025  IN USHORT HidPacketLength,
1027 {
1028  UNIMPLEMENTED;
1029  ASSERT(FALSE);
1030  return STATUS_NOT_IMPLEMENTED;
1031 }
1032 
1033 NTSTATUS
1034 NTAPI
1036  IN PHID_PARSER Parser,
1037  IN PVOID CollectionContext,
1039 {
1040  UNIMPLEMENTED;
1041  ASSERT(FALSE);
1042  return STATUS_NOT_IMPLEMENTED;
1043 }
1044 
1045 HIDAPI
1046 NTSTATUS
1047 NTAPI
1049  IN PHID_PARSER Parser,
1050  IN PVOID CollectionContext,
1051  IN HIDP_REPORT_TYPE ReportType,
1052  IN USAGE UsagePage,
1054  IN USAGE Usage,
1055  OUT PCHAR UsageValue,
1056  IN USHORT UsageValueByteLength,
1057  IN PCHAR Report,
1059 {
1060  UNIMPLEMENTED;
1061  ASSERT(FALSE);
1062  return STATUS_NOT_IMPLEMENTED;
1063 }
1064 
1065 HIDAPI
1066 NTSTATUS
1067 NTAPI
1069  IN PHID_PARSER Parser,
1070  IN PVOID CollectionContext,
1071  IN HIDP_REPORT_TYPE ReportType,
1072  IN USAGE UsagePage,
1074  IN PUSAGE UsageList,
1076  IN OUT PCHAR Report,
1078 {
1079  UNIMPLEMENTED;
1080  ASSERT(FALSE);
1081  return STATUS_NOT_IMPLEMENTED;
1082 }
1083 
1084 HIDAPI
1085 NTSTATUS
1086 NTAPI
1088  IN PUSAGE ChangedUsageList,
1090  IN HIDP_KEYBOARD_DIRECTION KeyAction,
1091  IN OUT PHIDP_KEYBOARD_MODIFIER_STATE ModifierState,
1092  IN PHIDP_INSERT_SCANCODES InsertCodesProcedure,
1093  IN PVOID InsertCodesContext)
1094 {
1095  UNIMPLEMENTED;
1096  ASSERT(FALSE);
1097  return STATUS_NOT_IMPLEMENTED;
1098 }
1099 
1100 HIDAPI
1101 NTSTATUS
1102 NTAPI
1104  IN PHID_PARSER Parser,
1105  IN PVOID CollectionContext,
1106  IN HIDP_REPORT_TYPE ReportType,
1107  IN USAGE UsagePage,
1109  IN PUSAGE UsageList,
1111  IN OUT PCHAR Report,
1113 {
1114  UNIMPLEMENTED;
1115  ASSERT(FALSE);
1116  return STATUS_NOT_IMPLEMENTED;
1117 }
1118 
1119 HIDAPI
1120 NTSTATUS
1121 NTAPI
1123  IN PHID_PARSER Parser,
1124  IN PVOID CollectionContext,
1125  IN HIDP_REPORT_TYPE ReportType,
1126  IN USAGE UsagePage,
1128  IN USAGE Usage,
1129  IN PCHAR UsageValue,
1130  IN USHORT UsageValueByteLength,
1131  OUT PCHAR Report,
1133 {
1134  UNIMPLEMENTED;
1135  ASSERT(FALSE);
1136  return STATUS_NOT_IMPLEMENTED;
1137 }
1138 
1139 HIDAPI
1140 NTSTATUS
1141 NTAPI
1143  IN PHID_PARSER Parser,
1144  IN PVOID CollectionContext,
1145  IN HIDP_REPORT_TYPE ReportType,
1146  IN USAGE UsagePage,
1148  IN USAGE Usage,
1149  IN ULONG UsageValue,
1150  IN OUT PCHAR Report,
1152 {
1153  UNIMPLEMENTED;
1154  ASSERT(FALSE);
1155  return STATUS_NOT_IMPLEMENTED;
1156 }
1157 
1158 HIDAPI
1159 NTSTATUS
1160 NTAPI
1162  IN PHID_PARSER Parser,
1163  IN PVOID CollectionContext,
1164  IN HIDP_REPORT_TYPE ReportType,
1165  IN USAGE UsagePage,
1167  IN USAGE Usage,
1168  IN LONG UsageValue,
1169  IN OUT PCHAR Report,
1171 {
1172  UNIMPLEMENTED;
1173  ASSERT(FALSE);
1174  return STATUS_NOT_IMPLEMENTED;
1175 }
1176 
1177 HIDAPI
1178 NTSTATUS
1179 NTAPI
1181  IN PHID_PARSER Parser,
1182  IN PVOID CollectionContext,
1183  IN HIDP_REPORT_TYPE ReportType,
1186  IN OUT PCHAR Report,
1188 {
1189  UNIMPLEMENTED;
1190  ASSERT(FALSE);
1191  return STATUS_NOT_IMPLEMENTED;
1192 }
1193 
1194 HIDAPI
1195 ULONG
1196 NTAPI
1198  IN PHID_PARSER Parser,
1199  IN PVOID CollectionContext,
1200  IN HIDP_REPORT_TYPE ReportType)
1201 {
1202  UNIMPLEMENTED;
1203  ASSERT(FALSE);
1204  return 0;
1205 }
1206 
1207 HIDAPI
1208 NTSTATUS
1209 NTAPI
1211  IN PHID_PARSER Parser,
1212  IN PVOID CollectionContext,
1213  IN HIDP_REPORT_TYPE ReportType,
1214  IN UCHAR ReportID,
1215  IN OUT PCHAR Report,
1217 {
1218  UNIMPLEMENTED;
1219  ASSERT(FALSE);
1220  return STATUS_NOT_IMPLEMENTED;
1221 }
1222 
1223 #undef HidParser_GetValueCaps
1224 
1225 HIDAPI
1226 NTSTATUS
1227 NTAPI
1229  IN PHID_PARSER Parser,
1230  IN PVOID CollectionContext,
1231  HIDP_REPORT_TYPE ReportType,
1234 {
1235  UNIMPLEMENTED;
1236  ASSERT(FALSE);
1237  return STATUS_NOT_IMPLEMENTED;
1238 }
signed char * PCHAR
Definition: retypes.h:7
#define HIDP_STATUS_USAGE_NOT_FOUND
Definition: hidpi.h:253
HIDAPI ULONG NTAPI HidParser_MaxUsageListLength(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage OPTIONAL)
Definition: hidparser.c:287
VOID NTAPI HidParser_FreeCollectionDescription(IN PHID_PARSER Parser, IN PHIDP_DEVICE_DESC DeviceDescription)
Definition: hidparser.c:195
USHORT NumberInputButtonCaps
Definition: hidpi.h:157
HIDPARSER_STATUS HidParser_GetSpecificValueCapsWithReport(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USHORT UsagePage, IN USHORT Usage, OUT PHIDP_VALUE_CAPS ValueCaps, IN OUT PUSHORT ValueCapsLength)
Definition: api.c:271
HIDAPI NTSTATUS NTAPI HidParser_SetUsageValue(IN PHID_PARSER Parser, 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:1142
#define IN
Definition: typedefs.h:39
ULONG HidParser_UsesReportId(IN PVOID CollectionContext, IN UCHAR ReportType)
Definition: api.c:543
USHORT NumberInputValueCaps
Definition: hidpi.h:158
#define TRUE
Definition: types.h:120
#define HIDP_STATUS_I8042_TRANS_UNKNOWN
Definition: hidpi.h:258
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
USAGE UsagePage
Definition: hidpi.h:80
BOOLEAN(NTAPI * PHIDP_INSERT_SCANCODES)(_In_opt_ PVOID Context, _In_reads_bytes_(Length) PCHAR NewScanCodes, _In_ ULONG Length)
Definition: hidpi.h:73
USHORT NumberOutputButtonCaps
Definition: hidpi.h:160
HIDPARSER_STATUS HidParser_GetUsageValueWithReport(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, IN USAGE Usage, OUT PULONG UsageValue, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength)
Definition: api.c:569
HIDAPI NTSTATUS NTAPI HidParser_UsageListDifference(IN PUSAGE PreviousUsageList, IN PUSAGE CurrentUsageList, OUT PUSAGE BreakUsageList, OUT PUSAGE MakeUsageList, IN ULONG UsageListLength)
Definition: hidparser.c:421
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
USHORT OutputReportByteLength
Definition: hidpi.h:153
USHORT NumberLinkCollectionNodes
Definition: hidpi.h:156
HIDAPI NTSTATUS NTAPI HidParser_GetData(IN PHID_PARSER Parser, 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:911
_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_SetScaledUsageValue(IN PHID_PARSER Parser, 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:1161
HIDAPI NTSTATUS NTAPI HidParser_GetExtendedAttributes(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USHORT DataIndex, OUT PHIDP_EXTENDED_ATTRIBUTES Attributes, IN OUT PULONG LengthAttributes)
Definition: hidparser.c:928
USAGE Usage
Definition: hidpi.h:79
#define HIDP_STATUS_BUFFER_TOO_SMALL
Definition: hidpi.h:256
#define HIDP_STATUS_BAD_LOG_PHY_VALUES
Definition: hidpi.h:255
LONG NTSTATUS
Definition: precomp.h:26
HIDPARSER_STATUS HidParser_GetUsagesWithReport(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, OUT USAGE *UsageList, IN OUT PULONG UsageLength, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength)
Definition: api.c:361
HIDAPI NTSTATUS NTAPI HidParser_SetData(IN PHID_PARSER Parser, 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:1180
struct _HIDP_COLLECTION_DESC * PHIDP_COLLECTION_DESC
USHORT NumberFeatureButtonCaps
Definition: hidpi.h:163
#define HID_USAGE_PAGE_CONSUMER
Definition: hidusage.h:186
_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
HIDPARSER_STATUS HidParser_BuildContext(IN PHID_PARSER Parser, IN PVOID ParserContext, IN ULONG CollectionIndex, IN ULONG ContextSize, OUT PVOID *CollectionContext)
Definition: parser.c:1315
NTSTATUS NTAPI HidParser_GetCollectionDescription(IN PHID_PARSER Parser, IN PHIDP_REPORT_DESCRIPTOR ReportDesc, IN ULONG DescLength, IN POOL_TYPE PoolType, OUT PHIDP_DEVICE_DESC DeviceDescription)
Definition: hidparser.c:49
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 TranslateHidParserStatus(IN HIDPARSER_STATUS Status)
Definition: hidparser.c:17
ULONG HidParser_NumberOfTopCollections(IN PVOID ParserCtx)
Definition: parser.c:1291
HIDAPI NTSTATUS NTAPI HidParser_GetUsagesEx(IN PHID_PARSER Parser, 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:747
#define HIDP_STATUS_NOT_IMPLEMENTED
Definition: hidpi.h:266
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
ULONG HidParser_GetReportItemCountFromReportType(IN PVOID CollectionContext, IN UCHAR ReportType)
Definition: api.c:132
HIDAPI ULONG NTAPI HidParser_MaxDataListLength(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType)
Definition: hidparser.c:1197
#define HID_USAGE_PAGE_KEYBOARD
Definition: hidusage.h:181
HIDPARSER_STATUS HidParser_TranslateCustUsage(IN PHID_PARSER Parser, 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:935
HIDPARSER_STATUS HidParser_TranslateKbdUsage(IN PHID_PARSER Parser, 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:872
#define HIDAPI
Definition: hidpi.h:35
enum _HIDP_REPORT_TYPE HIDP_REPORT_TYPE
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA DataList
Definition: hidpi.h:333
HIDAPI NTSTATUS NTAPI HidParser_GetSpecificButtonCaps(IN PHID_PARSER Parser, 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:892
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
#define HIDP_STATUS_INTERNAL_ERROR
Definition: hidpi.h:257
USHORT NumberFeatureDataIndices
Definition: hidpi.h:165
#define HID_REPORT_TYPE_INPUT
HIDPARSER_STATUS HidParser_GetScaledUsageValueWithReport(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, IN USAGE Usage, OUT PLONG UsageValue, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength)
Definition: api.c:666
USHORT NumberOutputValueCaps
Definition: hidpi.h:161
HIDAPI NTSTATUS NTAPI HidParser_GetUsageValue(IN PHID_PARSER Parser, 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:958
_Must_inspect_result_ _In_ USAGE UsagePage
Definition: hidpi.h:382
ULONG HidParser_GetReportLength(IN PVOID CollectionContext, IN UCHAR ReportType)
Definition: api.c:93
#define HID_REPORT_TYPE_OUTPUT
_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION DeviceDescription
Definition: iofuncs.h:1015
NTSTATUS NTAPI HidParser_SysPowerEvent(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN PCHAR HidPacket, IN USHORT HidPacketLength, OUT PULONG OutputBuffer)
Definition: hidparser.c:1021
#define HID_REPORT_TYPE_FEATURE
USHORT * PUSAGE
Definition: hidusage.h:30
HIDAPI NTSTATUS NTAPI HidParser_GetLinkCollectionNodes(IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, IN OUT PULONG LinkCollectionNodesLength)
Definition: hidparser.c:944
HIDAPI NTSTATUS NTAPI HidParser_GetScaledUsageValue(IN PHID_PARSER Parser, 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:614
HIDAPI NTSTATUS NTAPI HidParser_GetSpecificValueCaps(IN PHID_PARSER Parser, 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:357
USAGE UsagePage
Definition: hidpi.h:151
USHORT FeatureReportByteLength
Definition: hidpi.h:154
INT POOL_TYPE
Definition: typedefs.h:77
USHORT NumberFeatureValueCaps
Definition: hidpi.h:164
#define HIDP_STATUS_INVALID_REPORT_TYPE
Definition: hidpi.h:251
HIDAPI NTSTATUS NTAPI HidParser_GetButtonCaps(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN PHIDP_BUTTON_CAPS ButtonCaps, IN PUSHORT ButtonCapsLength)
Definition: hidparser.c:344
#define HIDP_STATUS_REPORT_DOES_NOT_EXIST
Definition: hidpi.h:265
USHORT NumberOutputDataIndices
Definition: hidpi.h:162
static const UCHAR Index[8]
Definition: usbohci.c:18
USHORT USAGE
Definition: hidusage.h:30
HIDPARSER_STATUS HidParser_ParseReportDescriptor(IN PHID_PARSER Parser, IN PUCHAR ReportDescriptor, IN ULONG ReportLength, OUT PVOID *OutParser)
Definition: parser.c:717
_Must_inspect_result_ _In_ USHORT _Inout_updates_to_ UsageLength PUSAGE_AND_PAGE ButtonList
Definition: hidpi.h:425
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
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:763
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG HidParser_GetMaxUsageListLengthWithReportAndPage(IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage OPTIONAL)
Definition: api.c:227
_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
#define STATUS_NO_DATA_DETECTED
Definition: udferr_usr.h:131
HIDPARSER_STATUS HidParser_GetCollectionUsagePage(IN PVOID CollectionContext, OUT PUSHORT Usage, OUT PUSHORT UsagePage)
Definition: api.c:65
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:1087
#define HIDP_STATUS_INVALID_REPORT_LENGTH
Definition: hidpi.h:252
Status
Definition: gdiplustypes.h:24
_Must_inspect_result_ _Inout_ PULONG LinkCollectionNodesLength
Definition: hidpi.h:358
_Must_inspect_result_ _In_ USAGE _In_ USHORT LinkCollection
Definition: hidpi.h:382
#define HIDP_LINK_COLLECTION_UNSPECIFIED
Definition: hidpi.h:185
_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
HIDAPI NTSTATUS NTAPI HidParser_GetUsageValueArray(IN PHID_PARSER Parser, 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:1048
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
HIDAPI NTSTATUS NTAPI HidParser_SetUsages(IN PHID_PARSER Parser, 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:1103
#define HID_USAGE_PAGE_UNDEFINED
Definition: hidusage.h:175
long HIDPARSER_STATUS
Definition: hidparser.h:25
USAGE Usage
Definition: hidpi.h:150
unsigned short USHORT
Definition: pedump.c:61
HIDAPI NTSTATUS NTAPI HidParser_GetCaps(IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PHIDP_CAPS Capabilities)
Definition: hidparser.c:226
HIDAPI NTSTATUS NTAPI HidParser_TranslateUsageAndPagesToI8042ScanCodes(IN PHID_PARSER Parser, 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:678
unsigned int * PULONG
Definition: retypes.h:1
_Must_inspect_result_ _In_ USHORT DataIndex
Definition: hidpi.h:346
ULONG HidParser_GetContextSize(IN PHID_PARSER Parser, IN PVOID ParserContext, IN ULONG CollectionIndex)
Definition: parser.c:1364
#define DPRINT1
Definition: precomp.h:8
ULONG HidParser_GetTotalCollectionCount(IN PVOID Context)
Definition: context.c:332
HIDAPI NTSTATUS NTAPI HidParser_SetUsageValueArray(IN PHID_PARSER Parser, 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:1122
struct _HIDP_REPORT_IDS * PHIDP_REPORT_IDS
HIDAPI NTSTATUS NTAPI HidParser_GetValueCaps(IN PHID_PARSER Parser, IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, PULONG ValueCapsLength)
Definition: hidparser.c:1228
_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
USHORT NumberInputDataIndices
Definition: hidpi.h:159
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:114
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define HIDP_STATUS_SUCCESS
Definition: hidpi.h:248
HIDAPI NTSTATUS NTAPI HidParser_InitializeReportForID(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN UCHAR ReportID, IN OUT PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:1210
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333
return STATUS_SUCCESS
Definition: btrfs.c:2938
HIDAPI NTSTATUS NTAPI HidParser_UnsetUsages(IN PHID_PARSER Parser, 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:1068
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
HIDAPI NTSTATUS NTAPI HidParser_GetUsages(IN PHID_PARSER Parser, IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage, IN USHORT LinkCollection OPTIONAL, OUT USAGE *UsageList, IN OUT PULONG UsageLength, IN PCHAR Report, IN ULONG ReportLength)
Definition: hidparser.c:550
signed int * PLONG
Definition: retypes.h:5
unsigned short * PUSHORT
Definition: retypes.h:2
USHORT InputReportByteLength
Definition: hidpi.h:152
ULONG HidParser_GetReportItemTypeCountFromReportType(IN PVOID CollectionContext, IN UCHAR ReportType, IN ULONG bData)
Definition: api.c:158
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_VALUE_CAPS _Inout_ PUSHORT ValueCapsLength
Definition: hidpi.h:396
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
NTSTATUS NTAPI HidParser_SysPowerCaps(IN PHID_PARSER Parser, IN PVOID CollectionContext, OUT PULONG OutputBuffer)
Definition: hidparser.c:1035