Export (0) Print
Expand All

HidD_GetFeature routine

The HidD_GetFeature routine returns a feature report from a specified top-level collection.

Syntax


BOOLEAN __stdcall HidD_GetFeature(
  _In_   HANDLE HidDeviceObject,
  _Out_  PVOID ReportBuffer,
  _In_   ULONG ReportBufferLength
);

Parameters

HidDeviceObject [in]

Specifies an open handle to a top-level collection.

ReportBuffer [out]

Pointer to a caller-allocated HID report buffer that the caller uses to specify a report ID. HidD_GetFeature uses ReportBuffer to return the specified feature report.

For more information about this parameter, see the Remarks section.

ReportBufferLength [in]

Specifies the size, in bytes, of the report buffer. The report buffer must be large enough to hold the feature report -- excluding its report ID, if report IDs are used -- plus one additional byte that specifies a nonzero report ID or zero.

Return value

If HidD_GetFeature succeeds, it returns TRUE; otherwise, it returns FALSE.

Remarks

Before it calls the HidD_GetFeature routine, the caller must do the following:

  • If the top-level collection includes report IDs, the caller must set the first byte of the ReportBuffer parameter to a nonzero report ID.

  • If the top-level collection does not include report IDs, the caller must set the first byte of the ReportBuffer parameter to zero.

The feature report is returned in the ReportBuffer parameter. Depending on the report ID, the caller parses the report by calling one of the following functions:

For an example of how to parse a HID report, see the HClient sample application. This sample is located in the MSDN Code Gallery.

Only user-mode applications can call HidD_GetFeature. Kernel-mode drivers can use an IOCTL_HID_GET_FEATURE request.

For more information, see the following topics:

Obtaining HID Reports

Interpreting HID Reports

Requirements

Version

Available in Windows 2000 and later versions of Windows.

Header

Hidsdi.h (include Hidsdi.h)

Library

Hid.lib

See also

HidD_SetFeature
HidD_GetInputReport
HidD_SetOutputReport
IOCTL_HID_GET_FEATURE
IOCTL_HID_GET_INPUT_REPORT
IOCTL_HID_SET_FEATURE
IOCTL_HID_SET_OUTPUT_REPORT

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft