HidP_SetData (Compact 2013)
3/26/2014
This function sets a specified set of HID control button and value usages in a HID report.
Syntax
NTSTATUS HidP_SetData(
HIDP_REPORT_TYPE ReportType,
PHIDP_DATA DataList,
OUT PULONG DataLength,
PHIDP_PREPARSED_DATA PreparsedData,
PCHAR Report,
ULONG ReportLength
);
Parameters
- ReportType
[in] HIDP_REPORT_TYPE enumerator value that indicates the type of HID report located at Report.
- DataList
[in] Pointer to a caller-allocated array of HIDP_DATA structures that specify which buttons and usage values to set.
DataLength
[in, out] On input, the number of members in the DataList array. On output, the following table shows the possible values.Value
Description
Input value is unchanged.
ReportType, PreparsedData, Report, or ReportLength are not valid.
Input value is unchanged.
Control data is successfully set.
Index of the DataList member that caused the error.
Control data cannot be set.
- PreparsedData
[in] Pointer to a top-level's preparsed data.
- Report
[in, out] On input, an initialized HID report. On output, a pointer to a HID report.
- ReportLength
[in] Size, in bytes, of the HID report located at Report, which must be equal to the report length for the specified report type that the HidP_GetCaps function returns in a collection's HIDP_CAPS structure.
Return Value
The following table shows the possible return values.
Value |
Description |
---|---|
HIDP_STATUS_SUCCESS |
Successfully set the control data specified by DataList. |
HIDP_STATUS_INVALID_PREPARSED_DATA |
Preparsed data specified by PreparsedData is not valid. |
HIDP_STATUS_INVALID_REPORT_LENGTH |
Size, in bytes, of the HID report is not equal to the length specified in the collection's HIDP_CAPS structure for the specified report type. |
HIDP_STATUS_INVALID_REPORT_TYPE |
Collection does not contain a report of the specified type. |
HIDP_STATUS_REPORT_DOES_NOT_EXIST |
ReportType is not valid. |
HIDP_STATUS_BUFFER_TOO_SMALL |
Button in an array is not set to On (one) because the array fields are already used to index other buttons. |
HIDP_STATUS_BUTTON_NOT_PRESSED |
DataList parameter has set a button to Off (zero), but the button is already set to Off. |
HIDP_STATUS_DATA_INDEX_NOT_FOUND |
Data index of a DataList member is not valid. |
HIDP_STATUS_INCOMPATIBLE_REPORT_ID |
Button or usage value is contained in a report, but is not in the specified report. |
HIDP_STATUS_IS_VALUE_ARRAY |
Data index specifies a usage value array. |
Remarks
Except for usage value arrays, a HID client can use HidP_SetData to set buttons and usage values in a report. To set a usage value array, an application or driver must use the HidP_SetUsageValueArray function.
Requirements
Header |
hidpi.h |
Library |
Hidparse_lib.lib |
See Also
Reference
HID Parser Functions
HIDP_DATA
HidP_GetData
HidP_SetButtons
HidP_SetUsages
HidP_SetUsageValueArray
HidP_UnsetButtons
HidP_UnsetUsages