HidD_GetInputReport function

The HidD_GetInputReport routine returns an input reports from a top-level collection.


BOOLEAN HidD_GetInputReport(
  HANDLE HidDeviceObject,
  PVOID  ReportBuffer,
  ULONG  ReportBufferLength



Specifies an open handle to a top-level collection.


Pointer to a caller-allocated input report buffer that the caller uses to specify a HID report ID and HidD_GetInputReport uses to return the specified input report.

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


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

Return value

HidD_GetInputReport returns TRUE if it succeeds; otherwise, it returns FALSE. Use GetLastError to get extended error information.


Before it calls the HidD_GetInputReport 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 input 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_GetInputReport. Kernel-mode drivers can use an IOCTL_HID_GET_INPUT_REPORT request.

For more information, see <a href="https://docs.microsoft.com/windows-hardware/drivers/hid/interpreting-hid-reports">Interpreting HID Reports</a>.


Minimum supported client Available in Windows XP and later versions of Windows.
Target Platform Universal
Header hidsdi.h (include Hidsdi.h)
Library Hid.lib
DLL Hid.dll

See also