25 ULONG CollectionCount;
38 DebugFunction(
"[HIDPARSER] Failed to parse report descriptor with %x\n", ParserStatus);
46 if (CollectionCount == 0)
304#undef HidParser_GetButtonCaps
382 ULONG Index, SubIndex, bFound, BreakUsageIndex = 0, MakeUsageIndex = 0;
391 CurrentUsage = PreviousUsageList[
Index];
403 Usage = CurrentUsageList[SubIndex];
410 if (CurrentUsage ==
Usage)
425 BreakUsageList[BreakUsageIndex] = CurrentUsage;
439 CurrentUsage = CurrentUsageList[
Index];
451 Usage = PreviousUsageList[SubIndex];
458 if (CurrentUsage ==
Usage)
473 MakeUsageList[MakeUsageIndex] = CurrentUsage;
696 ULONG Index, SubIndex, BreakUsageListIndex = 0, MakeUsageListIndex = 0, bFound;
706 CurrentUsage = &PreviousUsageList[
Index];
718 Usage = &CurrentUsageList[SubIndex];
721 if (
Usage->Usage == 0 &&
Usage->UsagePage == 0)
739 BreakUsageList[BreakUsageListIndex].Usage = CurrentUsage->
Usage;
740 BreakUsageList[BreakUsageListIndex].UsagePage = CurrentUsage->
UsagePage;
741 BreakUsageListIndex++;
754 CurrentUsage = &CurrentUsageList[
Index];
766 Usage = &PreviousUsageList[SubIndex];
769 if (
Usage->Usage == 0 &&
Usage->UsagePage == 0)
787 MakeUsageList[MakeUsageListIndex].Usage = CurrentUsage->
Usage;
788 MakeUsageList[MakeUsageListIndex].UsagePage = CurrentUsage->
UsagePage;
789 MakeUsageListIndex++;
1125#undef HidParser_GetValueCaps
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
#define STATUS_NOT_IMPLEMENTED
VOID NTAPI ZeroFunction(IN PVOID Item, IN ULONG ItemSize)
VOID __cdecl DebugFunction(IN LPCSTR FormatStr,...)
PVOID NTAPI AllocFunction(IN ULONG ItemSize)
VOID NTAPI FreeFunction(IN PVOID Item)
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
HIDAPI NTSTATUS NTAPI HidParser_GetCaps(IN PVOID CollectionContext, OUT PHIDP_CAPS Capabilities)
HIDAPI NTSTATUS NTAPI HidParser_UsageListDifference(IN PUSAGE PreviousUsageList, IN PUSAGE CurrentUsageList, OUT PUSAGE BreakUsageList, OUT PUSAGE MakeUsageList, IN ULONG UsageListLength)
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)
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)
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)
NTSTATUS NTAPI HidParser_SysPowerCaps(IN PVOID CollectionContext, OUT PULONG OutputBuffer)
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)
NTSTATUS NTAPI HidParser_SysPowerEvent(IN PVOID CollectionContext, IN PCHAR HidPacket, IN USHORT HidPacketLength, OUT PULONG OutputBuffer)
NTSTATUS NTAPI HidParser_GetCollectionDescription(IN PHIDP_REPORT_DESCRIPTOR ReportDesc, IN ULONG DescLength, IN POOL_TYPE PoolType, OUT PHIDP_DEVICE_DESC DeviceDescription)
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)
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)
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)
HIDAPI NTSTATUS NTAPI HidParser_GetLinkCollectionNodes(IN PVOID CollectionContext, OUT PHIDP_LINK_COLLECTION_NODE LinkCollectionNodes, IN OUT PULONG LinkCollectionNodesLength)
HIDAPI NTSTATUS NTAPI HidParser_GetValueCaps(IN PVOID CollectionContext, HIDP_REPORT_TYPE ReportType, PHIDP_VALUE_CAPS ValueCaps, PULONG ValueCapsLength)
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)
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)
HIDAPI ULONG NTAPI HidParser_MaxUsageListLength(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN USAGE UsagePage OPTIONAL)
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)
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)
HIDAPI NTSTATUS NTAPI HidParser_InitializeReportForID(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN UCHAR ReportID, IN OUT PCHAR Report, IN ULONG ReportLength)
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)
HIDAPI NTSTATUS NTAPI HidParser_GetButtonCaps(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType, IN PHIDP_BUTTON_CAPS ButtonCaps, IN PUSHORT ButtonCapsLength)
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)
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 PULONG UsageLength, IN PCHAR Report, IN ULONG ReportLength)
HIDAPI ULONG NTAPI HidParser_MaxDataListLength(IN PVOID CollectionContext, IN HIDP_REPORT_TYPE ReportType)
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)
VOID NTAPI HidParser_FreeCollectionDescription(IN PHIDP_DEVICE_DESC DeviceDescription)
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)
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)
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)
struct _HIDP_COLLECTION_DESC * PHIDP_COLLECTION_DESC
struct _HIDP_REPORT_IDS * PHIDP_REPORT_IDS
#define HIDP_STATUS_INVALID_REPORT_TYPE
#define HIDP_STATUS_SUCCESS
_Must_inspect_result_ _In_ UCHAR ReportID
_Must_inspect_result_ _Inout_ PULONG LinkCollectionNodesLength
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_BUTTON_CAPS _Inout_ PUSHORT ButtonCapsLength
#define HIDP_LINK_COLLECTION_UNSPECIFIED
_Must_inspect_result_ _In_ USAGE UsagePage
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_BUTTON_CAPS ButtonCaps
BOOLEAN(NTAPI * PHIDP_INSERT_SCANCODES)(_In_opt_ PVOID Context, _In_reads_bytes_(Length) PCHAR NewScanCodes, _In_ ULONG Length)
_Must_inspect_result_ _In_ USHORT _Inout_updates_to_ UsageLength PUSAGE_AND_PAGE ButtonList
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_VALUE_CAPS _Inout_ PUSHORT ValueCapsLength
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES _Inout_ OUT PULONG LengthAttributes
_Must_inspect_result_ _In_ USHORT _Inout_updates_to_ UsageLength PUSAGE_AND_PAGE _Inout_ ULONG * UsageLength
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE _Out_ PHIDP_VALUE_CAPS ValueCaps
_Must_inspect_result_ _In_ ULONG UsageListLength
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG _In_ PHIDP_PREPARSED_DATA _In_ ULONG ReportLength
enum _HIDP_KEYBOARD_DIRECTION HIDP_KEYBOARD_DIRECTION
enum _HIDP_REPORT_TYPE HIDP_REPORT_TYPE
#define HIDP_STATUS_I8042_TRANS_UNKNOWN
PUCHAR PHIDP_REPORT_DESCRIPTOR
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA DataList
_Must_inspect_result_ _In_ USAGE _In_ USHORT LinkCollection
_Must_inspect_result_ _In_ USHORT DataIndex
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
#define HID_USAGE_PAGE_UNDEFINED
#define HID_USAGE_PAGE_KEYBOARD
#define HID_USAGE_PAGE_CONSUMER
ULONG HidParser_UsesReportId(IN PVOID CollectionContext, IN UCHAR ReportType)
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)
NTSTATUS HidParser_GetSpecificValueCapsWithReport(IN PVOID CollectionContext, IN UCHAR ReportType, IN USHORT UsagePage, IN USHORT Usage, OUT PHIDP_VALUE_CAPS ValueCaps, IN OUT PUSHORT ValueCapsLength)
NTSTATUS HidParser_GetUsageValueWithReport(IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, IN USAGE Usage, OUT PULONG UsageValue, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength)
NTSTATUS HidParser_GetUsagesWithReport(IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, OUT USAGE *UsageList, IN OUT PULONG UsageLength, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength)
ULONG HidParser_GetReportItemCountFromReportType(IN PVOID CollectionContext, IN UCHAR ReportType)
ULONG HidParser_GetReportLength(IN PVOID CollectionContext, IN UCHAR ReportType)
ULONG HidParser_GetMaxUsageListLengthWithReportAndPage(IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage OPTIONAL)
ULONG HidParser_GetReportItemTypeCountFromReportType(IN PVOID CollectionContext, IN UCHAR ReportType, IN ULONG bData)
NTSTATUS HidParser_GetScaledUsageValueWithReport(IN PVOID CollectionContext, IN UCHAR ReportType, IN USAGE UsagePage, IN USAGE Usage, OUT PLONG UsageValue, IN PCHAR ReportDescriptor, IN ULONG ReportDescriptorLength)
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)
NTSTATUS HidParser_GetCollectionUsagePage(IN PVOID CollectionContext, OUT PUSHORT Usage, OUT PUSHORT UsagePage)
ULONG HidParser_GetTotalCollectionCount(IN PVOID Context)
ULONG HidParser_GetContextSize(IN PVOID ParserContext, IN ULONG CollectionIndex)
NTSTATUS HidParser_BuildContext(IN PVOID ParserContext, IN ULONG CollectionIndex, IN ULONG ContextSize, OUT PVOID *CollectionContext)
NTSTATUS HidParser_ParseReportDescriptor(IN PUCHAR ReportDescriptor, IN ULONG ReportLength, OUT PVOID *OutParser)
ULONG HidParser_NumberOfTopCollections(IN PVOID ParserCtx)
PULONG MinorVersion OPTIONAL
USHORT NumberLinkCollectionNodes
USHORT NumberInputButtonCaps
USHORT NumberOutputButtonCaps
USHORT NumberFeatureButtonCaps
USHORT NumberInputValueCaps
USHORT FeatureReportByteLength
USHORT NumberOutputValueCaps
USHORT OutputReportByteLength
USHORT InputReportByteLength
USHORT NumberFeatureDataIndices
USHORT NumberInputDataIndices
USHORT NumberFeatureValueCaps
USHORT NumberOutputDataIndices
#define RtlZeroMemory(Destination, Length)
#define STATUS_NO_DATA_DETECTED
#define STATUS_INSUFFICIENT_RESOURCES
#define HID_REPORT_TYPE_INPUT
#define HID_REPORT_TYPE_FEATURE
#define HID_REPORT_TYPE_OUTPUT
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription