GetRawInputDeviceInfoA function

Retrieves information about the raw input device.

Syntax

UINT GetRawInputDeviceInfoA(
  HANDLE hDevice,
  UINT   uiCommand,
  LPVOID pData,
  PUINT  pcbSize
);

Parameters

hDevice

Type: HANDLE

A handle to the raw input device. This comes from the hDevice member of RAWINPUTHEADER or from GetRawInputDeviceList.

uiCommand

Type: UINT

Specifies what data will be returned in pData. This parameter can be one of the following values.

Value Meaning
RIDI_DEVICENAME
0x20000007
pData points to a string that contains the device name.

For this uiCommand only, the value in pcbSize is the character count (not the byte count).

RIDI_DEVICEINFO
0x2000000b
pData points to an RID_DEVICE_INFO structure.
RIDI_PREPARSEDDATA
0x20000005
pData points to the previously parsed data.

pData

Type: LPVOID

A pointer to a buffer that contains the information specified by uiCommand. If uiCommand is RIDI_DEVICEINFO, set the cbSize member of RID_DEVICE_INFO to sizeof(RID_DEVICE_INFO) before calling GetRawInputDeviceInfo.

pcbSize

Type: PUINT

The size, in bytes, of the data in pData.

Return Value

Type: UINT

If successful, this function returns a non-negative number indicating the number of bytes copied to pData.

If pData is not large enough for the data, the function returns -1. If pData is NULL, the function returns a value of zero. In both of these cases, pcbSize is set to the minimum size required for the pData buffer.

Call GetLastError to identify any other errors.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

RAWINPUTHEADER

RID_DEVICE_INFO

Raw Input

Reference

WM_INPUT