> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::GetPnpPath

> 입력 장치의 플러그 앤 플레이 장치 경로를 UTF-8 문자열로 가져옵니다.

입력 장치의 플러그 앤 플레이(PnP) 장치 경로를 UTF-8 문자열로 가져옵니다.

## 구문

```cpp theme={null}
uint32_t GetPnpPath(
    uint32_t bufferByteCount,
    char* buffer
);
```

### 매개변수

*bufferByteCount*   \_In\_\
형식: uint32\_t

*buffer*가 가리키는 버퍼의 크기(바이트)입니다. 필요한 크기를 쿼리하려면 0을 전달하세요.

*buffer*   \_Out\_writes\_bytes\_opt\_(bufferByteCount)\
형식: char\*

null로 끝나는 UTF-8 PnP 경로를 받는 버퍼입니다. 필요한 크기를 쿼리하려면 `nullptr`을 전달하세요.

### 반환값

형식: uint32\_t

null 종결자를 포함하여 PnP 경로를 저장하는 데 필요한 버퍼의 크기(바이트)입니다.

## 설명

이 메서드는 *buffer*가 `nullptr`이 아니고 *bufferByteCount*가 필요한 크기 이상인 경우에만 *buffer*에 PnP 경로를 기록합니다. 그렇지 않으면 버퍼가 수정되지 않습니다. 경로를 검색하려면 *bufferByteCount*를 0으로, *buffer*를 `nullptr`로 지정하여 메서드를 한 번 호출해 필요한 크기를 가져오고, 해당 크기의 버퍼를 할당한 다음, 메서드를 다시 호출하세요.

장치에 PnP 경로가 없으면 필요한 크기는 1이며, 메서드는 빈 문자열을 기록합니다.

PnP 경로를 사용하여 다른 API를 통해 기본 장치를 참조하세요. 경로는 UTF-8로 인코딩되어 있으므로 와이드 문자 문자열이 필요한 Windows API에 전달하기 전에 UTF-16으로 변환하세요(예: `CP_UTF8`과 함께 `MultiByteToWideChar` 사용).

PnP 경로는 장치 개체의 수명 동안 변경되지 않습니다.

다음 예제는 장치의 PnP 경로를 검색합니다.

```cpp theme={null}
std::string GetDevicePnpPath(IGameInputDevice* device)
{
    const uint32_t size = device->GetPnpPath(0, nullptr);
    if (size == 0)
    {
        return {};
    }

    std::vector<char> buffer(size);
    device->GetPnpPath(size, buffer.data());

    return std::string(buffer.data());
}
```

GameInput v3 이하에서는 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)가 반환하는 [GameInputDeviceInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 구조체의 `pnpPath` 멤버에서 이 정보를 얻을 수 있었습니다.

## 요구 사항

**헤더:** GameInput.h

**라이브러리:** gameinput.lib

**지원되는 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[GameInput 개요](https://docs.xbox.com/ko/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[IGameInputDevice::GetDisplayName](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdisplayname.md)\
[IGameInputDevice::GetContainerId](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontainerid.md)

## 버전 기록

| 버전 | 변경 사항 |
| - | - |
| **v4** | 도입됨. |


## Related topics

- [IGameInputDevice::GetDisplayName](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdisplayname.md)
- [IGameInputDevice::GetContainerId](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontainerid.md)
- [GameInput 자주 묻는 질문](https://docs.xbox.com/ko/build/core-features/common/input/overviews/input-faq.md)
- [기존 입력 스택과 GameInput 결합](https://docs.xbox.com/ko/build/core-features/common/input/porting/input-porting.md)
- [IGameInputDevice::GetDeviceFamily](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getdevicefamily.md)
