GetRawInputData function (winuser.h)

Retrieves the raw input from the specified device.

Syntax

UINT GetRawInputData(
  [in]            HRAWINPUT hRawInput,
  [in]            UINT      uiCommand,
  [out, optional] LPVOID    pData,
  [in, out]       PUINT     pcbSize,
  [in]            UINT      cbSizeHeader
);

Parameters

[in] hRawInput

Type: HRAWINPUT

A handle to the RAWINPUT structure. This comes from the lParam in WM_INPUT.

[in] uiCommand

Type: UINT

The command flag. This parameter can be one of the following values.

Value Meaning
RID_HEADER
0x10000005
Get the header information from the RAWINPUT structure.
RID_INPUT
0x10000003
Get the raw data from the RAWINPUT structure.

[out, optional] pData

Type: LPVOID

A pointer to the data that comes from the RAWINPUT structure. This depends on the value of uiCommand. If pData is NULL, the required size of the buffer is returned in *pcbSize.

[in, out] pcbSize

Type: PUINT

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

[in] cbSizeHeader

Type: UINT

The size, in bytes, of the RAWINPUTHEADER structure.

Return value

Type: UINT

If pData is NULL and the function is successful, the return value is 0. If pData is not NULL and the function is successful, the return value is the number of bytes copied into pData.

If there is an error, the return value is (UINT)-1.

Remarks

GetRawInputData gets the raw input one RAWINPUT structure at a time. In contrast, GetRawInputBuffer gets an array of RAWINPUT structures.

Requirements

Requirement Value
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
API set ext-ms-win-ntuser-rawinput-l1-1-0 (introduced in Windows 10, version 10.0.14393)

See also

Conceptual

GetRawInputBuffer

RAWINPUT

RAWINPUTHEADER

Raw Input

Reference