// hidsdi.h
BOOLEAN HidD_GetFeature(
[in] HANDLE HidDeviceObject,
[out] PVOID ReportBuffer,
[in] ULONG ReportBufferLength
);
View the official Windows Driver Kit DDI referenceNo description available.
The HidD_GetFeature routine returns a feature report from a specified top-level collection.
HidDeviceObject [in]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]The size of the report buffer in bytes. The report buffer must be large enough to hold the feature report plus one additional byte that specifies a nonzero report ID. If report ID is not used, the ID value is zero.
If HidD_GetFeature succeeds, it returns TRUE; otherwise, it returns FALSE. Use GetLastError to get extended error information.
The correct _ReportBufferLength_ is specified by the _FeatureReportByteLength_ member of a top-level collection's HIDP_CAPS structure returned from HidP_GetCaps call.
Before it calls the HidD_GetFeature routine, the caller must do the following:
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.