IOCTL_HID_SET_FEATURE IOCTL

The IOCTL_HID_SET_FEATURE request sends a feature report to a top-level collection.

For general information about HIDClass devices, see HID Collections.

Major code

IRP_MJ_DEVICE_CONTROL

Input buffer

The Parameters.DeviceIoControl.InputBufferLength member is set to the size, in bytes, of a requester-allocated input buffer that contains a HID class feature report.

The input buffer size, in bytes, 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.

The Irp->AssociatedIrp.SystemBuffer member points to the input buffer that contains a feature report. If the collection includes report IDs, the requester must set the first byte of the buffer to a nonzero report ID; otherwise the requester must set the first byte to zero. The feature report -- excluding its report ID, if report IDs are used - is located at ((PUCHAR)ReportBuffer + 1).

Minidriver handling

Irp->UserBuffer points to a HID_XFER_PACKET structure that the HID class driver uses to input the following members:

Input buffer length

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

Minidriver handling

The size of a HID_XFER_PACKET structure.

Output buffer

None.

Output buffer length

None.

Status block

The HID class driver sets the following fields of Irp->IoStatus:

  • Information is set to zero.
  • Status is set to STATUS_SUCCESS if the transfer completed without error. Otherwise, it is set to an appropriate NTSTATUS error code.
Minidriver handling
   HID minidrivers that carry out the I/O to the device set the following fields of <b>Irp->IoStatus</b>:
  • Information is set to the number of bytes transferred to the device.
  • Status is set to STATUS_SUCCESS if the transfer completed without error. Otherwise, it is set to an appropriate NTSTATUS error code.
HID minidrivers that call other drivers with this IOCTL to carry out the I/O, should ensure that the Information field of the status block is correct and not change the contents of the Status field.

Requirements

   
Header hidclass.h (include Hidclass.h)

See also

HidD_GetFeature

HidD_GetInputReport

HidD_SetFeature

HidD_SetOutputReport

IOCTL_HID_GET_INPUT_REPORT

IOCTL_HID_SET_OUTPUT_REPORT