Opening HID collections

This section describes how a HID Client can communicate with the HID Class driver (HIDClass) to operate the device's HID collections.

HID Clients can operate in the following modes:

  • Use- Mode Application/Driver
  • Kernel-Mode Driver

The following sections identify how the HID Client can communicate with HIDClass using either mode in the preceding list.

This section describes how user-mode applications and kernel-mode drivers operate HID collections.

In general, a user-mode application does the following:

  • Calls device installation functions (SetupDiXxx functions) to find and identify a HID collection.

  • Calls CreateFile to open a file on a HID collection.

  • Calls **HidD_**Xxx HID support routines to obtain a HID collection's preparsed data and information about the HID collection.

  • Calls ReadFile to read input reports and WriteFile to send output reports.

  • Calls **HidP_**Xxx HID support routines to interpret HID reports.

In general, a kernel-mode driver does the following:

  • Finds and identifies a HID collection

    If the driver is a function or filter driver, it is already attached to the collection's device stack. However, if the driver is not attached to the collection's device stack, the driver can use Plug and Play notification.

  • Uses an IRP_MJ_CREATE request to open the HID collection

  • Uses IOCTL_HID_Xxx requests to obtain the HID collection's preparsed data and information about the HID collection

  • Uses IRP_MJ_READ requests to read input reports and IRP_MJ_WRITE requests to send output reports

  • Calls **HidP_**Xxx HID support routines to interpret HID reports

See also