Skip to main content
Gets the Plug and Play (PnP) device path of the input device as a UTF-8 string.

Syntax

Parameters

bufferByteCount   _In_
Type: uint32_t
The size, in bytes, of the buffer pointed to by buffer. Pass 0 to query the required size. buffer   _Out_writes_bytes_opt_(bufferByteCount)
Type: char*
The buffer that receives the null-terminated UTF-8 PnP path. Pass nullptr to query the required size.

Return value

Type: uint32_t The size, in bytes, of the buffer required to hold the PnP path, including the null terminator.

Remarks

The method writes the PnP path to buffer only if buffer isn’t nullptr and bufferByteCount is greater than or equal to the required size. Otherwise, the buffer isn’t modified. To retrieve the path, call the method once with a bufferByteCount of 0 and a buffer of nullptr to get the required size, allocate a buffer of that size, and then call the method again. If the device doesn’t have a PnP path, the required size is 1, and the method writes an empty string. Use the PnP path to reference the underlying device through other APIs. Because the path is encoded as UTF-8, convert it to UTF-16 (for example, by using MultiByteToWideChar with CP_UTF8) before you pass it to Windows APIs that expect wide-character strings. The PnP path doesn’t change for the lifetime of the device object. The following example retrieves the PnP path of a device.
In GameInput v3 and earlier, this information was available from the pnpPath member of the GameInputDeviceInfo structure returned by IGameInputDevice::GetDeviceInfo.

Requirements

Header: GameInput.h Library: gameinput.lib Supported platforms: Windows, XBOX One family consoles and XBOX Series consoles

See also

Overview of GameInput
IGameInputDevice
IGameInputDevice::GetDisplayName
IGameInputDevice::GetContainerId

Version History

Last modified on November 5, 2026