X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=lib%2Fdrivers%2Fhidparser%2Fparser.h;h=24a6aab50f18a9bc101fcc6a25b922e85acbd2aa;hp=1a633a9fba22f8a778a868ab87854e64d4a6770e;hb=277b8f08718c6b59df1c707b5aec8acd947f1cc9;hpb=f53d09f118c4a46c9d020f8b830d8073ecd6161f diff --git a/lib/drivers/hidparser/parser.h b/lib/drivers/hidparser/parser.h index 1a633a9fba2..24a6aab50f1 100644 --- a/lib/drivers/hidparser/parser.h +++ b/lib/drivers/hidparser/parser.h @@ -199,23 +199,19 @@ struct _HID_REPORT; typedef struct __HID_COLLECTION__ { - struct __HID_COLLECTION__ * Root; - UCHAR Type; ULONG Usage; UCHAR StringID; UCHAR PhysicalID; + ULONG ReportCount; ULONG NodeCount; - struct __HID_COLLECTION__ ** Nodes; - ULONG ItemCount; - ULONG ItemCountAllocated; - - PHID_REPORT_ITEM * Items; - - ULONG ReportCount; + struct __HID_COLLECTION__ ** Nodes; + struct __HID_COLLECTION__ * Root; struct _HID_REPORT ** Reports; + ULONG Offsets[1]; + }HID_COLLECTION, *PHID_COLLECTION; typedef struct _HID_REPORT @@ -223,11 +219,9 @@ typedef struct _HID_REPORT UCHAR Type; UCHAR ReportID; ULONG ReportSize; - ULONG ItemCount; ULONG ItemAllocated; - PHID_REPORT_ITEM* Items; - + HID_REPORT_ITEM Items[1]; }HID_REPORT, *PHID_REPORT; typedef struct @@ -259,32 +253,20 @@ typedef struct }HID_PARSER_CONTEXT, *PHID_PARSER_CONTEXT; -HIDPARSER_STATUS -HidParser_ParseReportDescriptor( - PHID_PARSER Parser, - PUCHAR Report, - ULONG ReportSize); - -ULONG -HidParser_NumberOfTopCollections( - IN PHID_PARSER Parser); - #define HID_REPORT_TYPE_INPUT 0x01 #define HID_REPORT_TYPE_OUTPUT 0x02 #define HID_REPORT_TYPE_FEATURE 0x04 HIDPARSER_STATUS HidParser_GetCollectionUsagePage( - IN PHID_PARSER Parser, - IN ULONG CollectionNumber, + IN PVOID CollectionContext, OUT PUSHORT Usage, OUT PUSHORT UsagePage); ULONG HidParser_GetReportLength( - IN PHID_PARSER Parser, - IN ULONG CollectionIndex, - IN ULONG ReportType); + IN PVOID CollectionContext, + IN UCHAR ReportType); UCHAR HidParser_IsReportIDUsed( @@ -292,44 +274,26 @@ HidParser_IsReportIDUsed( ULONG HidParser_GetReportItemCountFromReportType( - IN PHID_PARSER Parser, - IN ULONG CollectionNumber, - IN ULONG ReportType); + IN PVOID CollectionContext, + IN UCHAR ReportType); ULONG HidParser_GetReportItemTypeCountFromReportType( - IN PHID_PARSER Parser, - IN ULONG CollectionNumber, - IN ULONG ReportType, + IN PVOID CollectionContext, + IN UCHAR ReportType, IN ULONG bData); -ULONG -HidParser_GetContextSize( - IN PHID_PARSER Parser, - IN ULONG CollectionNumber); - -VOID -HidParser_FreeContext( - IN PHID_PARSER Parser, - IN PUCHAR Context, - IN ULONG ContextLength); - -ULONG -HidParser_GetTotalCollectionCount( - IN PHID_PARSER Parser); - ULONG HidParser_GetMaxUsageListLengthWithReportAndPage( - IN PHID_PARSER Parser, - IN ULONG CollectionNumber, - IN ULONG ReportType, + IN PVOID CollectionContext, + IN UCHAR ReportType, IN USAGE UsagePage OPTIONAL); HIDPARSER_STATUS HidParser_GetSpecificValueCapsWithReport( IN PHID_PARSER Parser, - IN ULONG CollectionNumber, - IN ULONG ReportType, + IN PVOID CollectionContext, + IN UCHAR ReportType, IN USHORT UsagePage, IN USHORT Usage, OUT PHIDP_VALUE_CAPS ValueCaps, @@ -339,8 +303,8 @@ HidParser_GetSpecificValueCapsWithReport( HIDPARSER_STATUS HidParser_GetUsagesWithReport( IN PHID_PARSER Parser, - IN ULONG CollectionNumber, - IN ULONG ReportType, + IN PVOID CollectionContext, + IN UCHAR ReportType, IN USAGE UsagePage, OUT USAGE *UsageList, IN OUT PULONG UsageLength, @@ -350,15 +314,64 @@ HidParser_GetUsagesWithReport( HIDPARSER_STATUS HidParser_GetScaledUsageValueWithReport( IN PHID_PARSER Parser, - IN ULONG CollectionNumber, - IN ULONG ReportType, + IN PVOID CollectionContext, + IN UCHAR ReportType, IN USAGE UsagePage, IN USAGE Usage, OUT PLONG UsageValue, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength); +/* parser.c */ + +HIDPARSER_STATUS +HidParser_BuildContext( + IN PHID_PARSER Parser, + IN PVOID ParserContext, + IN ULONG CollectionIndex, + IN ULONG ContextSize, + OUT PVOID *CollectionContext); + ULONG -HidParser_GetCollectionNumberFromParserContext( - IN PHID_PARSER Parser); +HidParser_CalculateContextSize( + IN PHID_COLLECTION Collection); + +HIDPARSER_STATUS +HidParser_ParseReportDescriptor( + PHID_PARSER Parser, + PUCHAR Report, + ULONG ReportSize, + OUT PVOID *ParserContext); +ULONG +HidParser_NumberOfTopCollections( + IN PVOID ParserContext); + +ULONG +HidParser_GetContextSize( + IN PHID_PARSER Parser, + IN PVOID ParserContext, + IN ULONG CollectionNumber); + + +/* context.c */ + +PHID_COLLECTION +HidParser_GetCollectionFromContext( + IN PVOID Context); + +ULONG +HidParser_GetTotalCollectionCount( + IN PVOID CollectionContext); + +HIDPARSER_STATUS +HidParser_BuildCollectionContext( + IN PHID_PARSER Parser, + IN PHID_COLLECTION RootCollection, + IN PVOID Context, + IN ULONG ContextSize); + +PHID_REPORT +HidParser_GetReportInCollection( + IN PVOID Context, + IN UCHAR ReportType);