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’tnullptr 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.
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 consolesSee also
Overview of GameInputIGameInputDevice
IGameInputDevice::GetDisplayName
IGameInputDevice::GetContainerId
