GetRawInputBuffer function
Performs a buffered read of the raw input data.
Syntax
UINT WINAPI GetRawInputBuffer( _Out_opt_ PRAWINPUT pData, _Inout_ PUINT pcbSize, _In_ UINT cbSizeHeader );
Parameters
- pData [out, optional]
-
Type: PRAWINPUT
A pointer to a buffer of RAWINPUT structures that contain the raw input data. If NULL, the minimum required buffer, in bytes, is returned in *pcbSize.
- pcbSize [in, out]
-
Type: PUINT
The size, in bytes, of a RAWINPUT structure.
- cbSizeHeader [in]
-
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 zero. If pData is not NULL and the function is successful, the return value is the number of RAWINPUT structures written to pData.
If an error occurs, the return value is (UINT)-1. Call GetLastError for the error code.
Remarks
Using GetRawInputBuffer, the raw input data is buffered in the array of RAWINPUT structures. For an unbuffered read, use the GetMessage function to read in the raw input data.
The NEXTRAWINPUTBLOCK macro allows an application to traverse an array of RAWINPUT structures.
[StructLayout(LayoutKind.Explicit)]
internal struct RAWINPUT
{
[FieldOffset(0)]
public RAWINPUTHEADER header;
[FieldOffset(16+8)]
public RAWMOUSE mouse;
[FieldOffset(16+8)]
public RAWKEYBOARD keyboard;
[FieldOffset(16+8)]
public RAWHID hid;
}
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- Reference
- GetMessage
- RAWINPUT
- RAWINPUTHEADER
- NEXTRAWINPUTBLOCK
- Conceptual
- Raw Input