Skip to content

Latest commit

 

History

History
108 lines (85 loc) · 4.86 KB

nf-hidsdi-hidd_getfeature.md

File metadata and controls

108 lines (85 loc) · 4.86 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:hidsdi.HidD_GetFeature
HidD_GetFeature function (hidsdi.h)
The HidD_GetFeature routine returns a feature report from a specified top-level collection.
hid\hidd_getfeature.htm
hid
04/28/2022
HidD_GetFeature function
HidD_GetFeature, HidD_GetFeature routine [Human Input Devices], hid.hidd_getfeature, hidfunc_2992bcaf-4ca6-4b6f-9a85-d0add8c7fe99.xml, hidsdi/HidD_GetFeature
hidsdi.h
Hidsdi.h
Universal
Available in Windows 2000 and later versions of Windows.
Hid.lib
Hid.dll
Windows
HidD_GetFeature
hidsdi/HidD_GetFeature
APIRef
kbSyntax
DllExport
Hid.dll
HidD_GetFeature

HidD_GetFeature function

-description

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

-parameters

-param HidDeviceObject [in]

An open handle to a top-level collection.

-param 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.

-param 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.

-returns

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

-remarks

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:

  • 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.

-see-also