17#if defined(_WIN32) && !defined(CPPPARSER)
20typedef 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)
31#define HID_USAGE_PAGE_DIGITIZER ((USAGE) 0x0d)
33#define HID_USAGE_GENERIC_POINTER ((USAGE) 0x01)
34#define HID_USAGE_GENERIC_MOUSE ((USAGE) 0x02)
35#define HID_USAGE_GENERIC_JOYSTICK ((USAGE) 0x04)
36#define HID_USAGE_GENERIC_GAMEPAD ((USAGE) 0x05)
37#define HID_USAGE_GENERIC_KEYBOARD ((USAGE) 0x06)
38#define HID_USAGE_GENERIC_KEYPAD ((USAGE) 0x07)
39#define HID_USAGE_GENERIC_SYSTEM_CTL ((USAGE) 0x80)
41#define HID_USAGE_GENERIC_X ((USAGE) 0x30)
42#define HID_USAGE_GENERIC_Y ((USAGE) 0x31)
43#define HID_USAGE_GENERIC_Z ((USAGE) 0x32)
44#define HID_USAGE_GENERIC_RX ((USAGE) 0x33)
45#define HID_USAGE_GENERIC_RY ((USAGE) 0x34)
46#define HID_USAGE_GENERIC_RZ ((USAGE) 0x35)
47#define HID_USAGE_GENERIC_SLIDER ((USAGE) 0x36)
48#define HID_USAGE_GENERIC_DIAL ((USAGE) 0x37)
49#define HID_USAGE_GENERIC_WHEEL ((USAGE) 0x38)
50#define HID_USAGE_GENERIC_HATSWITCH ((USAGE) 0x39)
53#define HIDP_STATUS_SUCCESS ((NTSTATUS)(0x11 << 16))
55typedef enum _HIDP_REPORT_TYPE {
61typedef struct _HIDP_BUTTON_CAPS {
66 USHORT LinkCollection;
70 BOOLEAN IsStringRange;
71 BOOLEAN IsDesignatorRange;
76 USAGE UsageMin, UsageMax;
77 USHORT StringMin, StringMax;
78 USHORT DesignatorMin, DesignatorMax;
79 USHORT DataIndexMin, DataIndexMax;
82 USAGE Usage, Reserved1;
83 USHORT StringIndex, Reserved2;
84 USHORT DesignatorIndex, Reserved3;
85 USHORT DataIndex, Reserved4;
88} HIDP_BUTTON_CAPS, *PHIDP_BUTTON_CAPS;
90typedef struct _HIDP_VALUE_CAPS {
95 USHORT LinkCollection;
99 BOOLEAN IsStringRange;
100 BOOLEAN IsDesignatorRange;
109 LONG LogicalMin, LogicalMax;
110 LONG PhysicalMin, PhysicalMax;
113 USAGE UsageMin, UsageMax;
114 USHORT StringMin, StringMax;
115 USHORT DesignatorMin, DesignatorMax;
116 USHORT DataIndexMin, DataIndexMax;
119 USAGE Usage, Reserved1;
120 USHORT StringIndex, Reserved2;
121 USHORT DesignatorIndex, Reserved3;
122 USHORT DataIndex, Reserved4;
125} HIDP_VALUE_CAPS, *PHIDP_VALUE_CAPS;
127typedef PUCHAR PHIDP_REPORT_DESCRIPTOR;
128typedef struct _HIDP_PREPARSED_DATA *PHIDP_PREPARSED_DATA;
130typedef struct _HIDP_CAPS {
133 USHORT InputReportByteLength;
134 USHORT OutputReportByteLength;
135 USHORT FeatureReportByteLength;
137 USHORT NumberLinkCollectionNodes;
138 USHORT NumberInputButtonCaps;
139 USHORT NumberInputValueCaps;
140 USHORT NumberInputDataIndices;
141 USHORT NumberOutputButtonCaps;
142 USHORT NumberOutputValueCaps;
143 USHORT NumberOutputDataIndices;
144 USHORT NumberFeatureButtonCaps;
145 USHORT NumberFeatureValueCaps;
146 USHORT NumberFeatureDataIndices;
147} HIDP_CAPS, *PHIDP_CAPS;
149typedef struct _HIDP_DATA {
156} HIDP_DATA, *PHIDP_DATA;
158typedef LONG NTSTATUS;
159typedef NTSTATUS (__stdcall *pHidP_GetCaps)(PHIDP_PREPARSED_DATA, PHIDP_CAPS);
160typedef NTSTATUS (__stdcall *pHidP_GetButtonCaps)(HIDP_REPORT_TYPE, PHIDP_BUTTON_CAPS, PUSHORT, PHIDP_PREPARSED_DATA);
161typedef NTSTATUS (__stdcall *pHidP_GetValueCaps)(HIDP_REPORT_TYPE, PHIDP_VALUE_CAPS, PUSHORT, PHIDP_PREPARSED_DATA);
162typedef NTSTATUS (__stdcall *pHidP_GetData)(HIDP_REPORT_TYPE, PHIDP_DATA, PULONG, PHIDP_PREPARSED_DATA, PCHAR, ULONG);
163typedef ULONG (__stdcall *pHidP_MaxDataListLength)(HIDP_REPORT_TYPE, PHIDP_PREPARSED_DATA);