17 #if defined(_WIN32) && !defined(CPPPARSER) 20 typedef USHORT USAGE, *PUSAGE;
22 #define HID_USAGE_PAGE_UNDEFINED ((USAGE) 0x00) 23 #define HID_USAGE_PAGE_GENERIC ((USAGE) 0x01) 24 #define HID_USAGE_PAGE_SIMULATION ((USAGE) 0x02) 25 #define HID_USAGE_PAGE_VR ((USAGE) 0x03) 26 #define HID_USAGE_PAGE_SPORT ((USAGE) 0x04) 27 #define HID_USAGE_PAGE_GAME ((USAGE) 0x05) 28 #define HID_USAGE_PAGE_KEYBOARD ((USAGE) 0x07) 29 #define HID_USAGE_PAGE_LED ((USAGE) 0x08) 30 #define HID_USAGE_PAGE_BUTTON ((USAGE) 0x09) 32 #define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01) 33 #define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02) 34 #define HID_USAGE_GENERIC_JOYSTICK ((USAGE) 0x04) 35 #define HID_USAGE_GENERIC_GAMEPAD ((USAGE) 0x05) 36 #define HID_USAGE_GENERIC_KEYBOARD ((USAGE) 0x06) 37 #define HID_USAGE_GENERIC_KEYPAD ((USAGE) 0x07) 38 #define HID_USAGE_GENERIC_SYSTEM_CTL ((USAGE) 0x80) 40 #define HID_USAGE_GENERIC_X ((USAGE) 0x30) 41 #define HID_USAGE_GENERIC_Y ((USAGE) 0x31) 42 #define HID_USAGE_GENERIC_Z ((USAGE) 0x32) 43 #define HID_USAGE_GENERIC_RX ((USAGE) 0x33) 44 #define HID_USAGE_GENERIC_RY ((USAGE) 0x34) 45 #define HID_USAGE_GENERIC_RZ ((USAGE) 0x35) 46 #define HID_USAGE_GENERIC_SLIDER ((USAGE) 0x36) 47 #define HID_USAGE_GENERIC_DIAL ((USAGE) 0x37) 48 #define HID_USAGE_GENERIC_WHEEL ((USAGE) 0x38) 49 #define HID_USAGE_GENERIC_HATSWITCH ((USAGE) 0x39) 52 #define HIDP_STATUS_SUCCESS ((NTSTATUS)(0x11 << 16)) 54 typedef enum _HIDP_REPORT_TYPE {
60 typedef struct _HIDP_BUTTON_CAPS {
65 USHORT LinkCollection;
69 BOOLEAN IsStringRange;
70 BOOLEAN IsDesignatorRange;
75 USAGE UsageMin, UsageMax;
76 USHORT StringMin, StringMax;
77 USHORT DesignatorMin, DesignatorMax;
78 USHORT DataIndexMin, DataIndexMax;
81 USAGE Usage, Reserved1;
82 USHORT StringIndex, Reserved2;
83 USHORT DesignatorIndex, Reserved3;
84 USHORT DataIndex, Reserved4;
87 } HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
89 typedef struct _HIDP_VALUE_CAPS {
94 USHORT LinkCollection;
98 BOOLEAN IsStringRange;
99 BOOLEAN IsDesignatorRange;
108 LONG LogicalMin, LogicalMax;
109 LONG PhysicalMin, PhysicalMax;
112 USAGE UsageMin, UsageMax;
113 USHORT StringMin, StringMax;
114 USHORT DesignatorMin, DesignatorMax;
115 USHORT DataIndexMin, DataIndexMax;
118 USAGE Usage, Reserved1;
119 USHORT StringIndex, Reserved2;
120 USHORT DesignatorIndex, Reserved3;
121 USHORT DataIndex, Reserved4;
124 } HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
126 typedef PUCHAR PHIDP_REPORT_DESCRIPTOR;
127 typedef struct _HIDP_PREPARSED_DATA *PHIDP_PREPARSED_DATA;
129 typedef struct _HIDP_CAPS {
132 USHORT InputReportByteLength;
133 USHORT OutputReportByteLength;
134 USHORT FeatureReportByteLength;
136 USHORT NumberLinkCollectionNodes;
137 USHORT NumberInputButtonCaps;
138 USHORT NumberInputValueCaps;
139 USHORT NumberInputDataIndices;
140 USHORT NumberOutputButtonCaps;
141 USHORT NumberOutputValueCaps;
142 USHORT NumberOutputDataIndices;
143 USHORT NumberFeatureButtonCaps;
144 USHORT NumberFeatureValueCaps;
145 USHORT NumberFeatureDataIndices;
146 } HIDP_CAPS, *PHIDP_CAPS;
148 typedef struct _HIDP_DATA {
155 } HIDP_DATA, *PHIDP_DATA;
157 typedef LONG NTSTATUS;
158 typedef NTSTATUS (__stdcall *pHidP_GetCaps)(PHIDP_PREPARSED_DATA, PHIDP_CAPS);
159 typedef NTSTATUS (__stdcall *pHidP_GetButtonCaps)(HIDP_REPORT_TYPE, PHIDP_BUTTON_CAPS, PUSHORT, PHIDP_PREPARSED_DATA);
160 typedef NTSTATUS (__stdcall *pHidP_GetValueCaps)(HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PUSHORT, PHIDP_PREPARSED_DATA);
161 typedef NTSTATUS (__stdcall *pHidP_GetData)(HIDP_REPORT_TYPE, PHIDP_DATA, PULONG, PHIDP_PREPARSED_DATA, PCHAR, ULONG);
162 typedef ULONG (__stdcall *pHidP_MaxDataListLength)(HIDP_REPORT_TYPE, PHIDP_PREPARSED_DATA);