Share via


LPGET_STRING (Compact 2013)

3/26/2014

This function obtains a string from a HID device.

Syntax

typedef DWORD (*LPGET_STRING) (
  HID_HANDLE hDevice,
  HID_STRING_TYPE stringType,
  DWORD dwIdx,
  LPWSTR pszBuffer,
  DWORD cchBuffer,
  PDWORD pcchActual
);

Parameters

  • hDevice
    [in] Handle to a HID device.
  • stringType
    [in] String type to obtain. The HID_STRING_TYPE enumeration contains the types of strings.
  • dwIdx
    [in] Used when stringType is set to HID_STRING_INDEXED.
  • pszBuffer
    [in, out] Set to NULL to get the string's character count, and then add one for the NULL terminator. Otherwise, this is the buffer that stores the string obtained from the HID device.
  • cchBuffer
    [in] Number of characters that will fit into pszBuffer, including the NULL terminator.
  • pcchActual
    [in] Number of characters in the string, not including the NULL terminator.

Return Value

The following table shows the possible return values.

Value

Description

ERROR_GEN_FAILURE

USB device information was not obtained.

ERROR_NOT_FOUND

String type was not obtained because the specified string type does not exist.

ERROR_INVALID_PARAMETER

String index was too large or an exception occurred when writing to the user's buffer.

ERROR_SUCCESS

Function returned successfully.

Requirements

Header

hiddi.h

See Also

Reference

HID Driver Functions
HID_STRING_TYPE