Share via


HidP_SetData

This function sets a specified set of HID control button and value usages in a HID report.

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 was successfully set.
    Index of the DataList member that caused the error. Control's data could not 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 Values

The following table shows the possible return values for this function.

Value Description
HIDP_STATUS_SUCCESS Successfully set the control data specified by DataList.
HIDP_STATUS_INVALID_PREPARSED_DATA Preparsed data specified by PreparsedData was not valid.
HIDP_STATUS_INVALID_REPORT_LENGTH Size, in bytes, of the HID report was not equal to the length specified in the collection's HIDP_CAPS structure for the specified report type.
HIDP_STATUS_INVALID_REPORT_TYPE Collection did not contain a report of the specified type.
HIDP_STATUS_REPORT_DOES_NOT_EXIST ReportType was not valid.
HIDP_STATUS_BUFFER_TOO_SMALL Button in an array was not set to ON (one) because the array fields were already used to index other buttons.
HIDP_STATUS_BUTTON_NOT_PRESSED DataList parameter set a button OFF (zero), but the button was already set to OFF.
HIDP_STATUS_DATA_INDEX_NOT_FOUND Data index of a DataList member was not valid.
HIDP_STATUS_INCOMPATIBLE_REPORT_ID Button or usage value was contained in a report, but it was not in the specified report.
HIDP_STATUS_IS_VALUE_ARRAY Data index specified 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

OS Versions: Windows CE .NET 4.2 and later.
Header: Hidpi.h.
Link Library: Hidparse_lib.lib.

See Also

HID Drivers | HIDP_DATA | HidP_GetData | HidP_SetButtons | HidP_SetUsages | HidP_SetUsageValueArray | HidP_UnsetButtons | HidP_UnsetUsages

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.