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

# XtfGetConsoleInfoList

> XtfGetConsoleInfoList

# XtfGetConsoleInfoList

콘솔에 대한 정보를 포함하는 `XtfConsoleInfo` 객체를 반환합니다.

<a id="syntaxSection" />

## 구문

```cpp theme={null}
HRESULT XtfGetConsoleInfoList(
         PCWSTR address,
         XtfConsoleInfo *hConsoleInfo
)  
```

<a id="parametersSection" />

### 매개 변수

*address*\
형식: PCWSTR

\[in] 콘솔의 주소입니다.

*hConsoleInfo*\
형식: XtfConsoleInfo\*

\[out] 콘솔에 대한 정보를 검색하기 위해 [XtfGetConsoleFieldValue](/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m) 함수와 함께 사용할 포인터입니다.

<a id="retvalSection" />

### 반환 값

형식: HRESULT

함수가 성공하고 [XtfGetConsoleFieldValue](/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m)를 사용하여 **hConsoleInfo**에서 값을 검색할 수 있으면 `S_OK`를 반환합니다. 그렇지 않으면 HRESULT 오류 코드를 반환합니다.

<a id="remarksSection" />

## 설명

콘솔에 대한 정보를 검색하려면 먼저 이 함수를 사용하여 `XtfConsoleInfo` 포인터를 가져온 다음 [XtfGetConsoleFieldValue](/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m)를 사용하여 해당 포인터에서 콘솔에 대한 정보를 검색합니다. 필요한 정보를 검색한 후에는 [XtfCloseConsoleInfoList](/reference/tools/xtf/xtfapi/functions/xtfcloseconsoleinfolist-xbox-microsoft-m)를 사용하여 반환된 `XtfConsoleInfo` 포인터와 관련된 리소스를 해제합니다.

<Note>`XtfGetConsoleInfoList`는 콘솔의 모든 정보를 검색하고 해당 정보에 대한 포인터를 제공합니다. [XtfGetConsoleFieldValue](/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m)는 검색된 정보만 반복합니다. 콘솔에 대한 정보를 검색하려면 두 함수를 함께 사용해야 합니다.</Note>

<Note>이 함수의 `address`에 지정된 대상 콘솔이 프로비저닝되지 않은 경우, `field`에 [XtfConsoleFieldId::DeviceID](/reference/tools/xtf/xtfapi/enums/xtfconsolefieldid-xbox-windows-t)가 지정되어 있으면 [XtfGetConsoleFieldValue](/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m) 함수는 빈 값을 반환합니다.</Note>

다음 코드 샘플은 개발 콘솔의 콘솔 ID를 검색하기 위해 `XtfGetConsoleInfoList`와 `XtfGetConsoleFieldValue` 함수를 함께 사용하는 방법을 보여 줍니다.

```cpp theme={null}
int wmain(int argc, wchar_t **argv)
{
  HRESULT             hr             = S_OK;
  PCWSTR              consoleAddress = L" 190.167.10.18";
  XtfConsoleInfo      hConsoleInfo   = nullptr;
  XtfConsoleFieldType fieldType      = XtfConsoleFieldType::FieldTypeUINT32;
  BYTE *              pValueBuffer   = nullptr;
  UINT32              bufferSize     = 0;

  hr = XtfGetConsoleInfoList(consoleAddress, &hConsoleInfo);
  if (FAILED(hr))
  {
    wprintf(L"\n\n*** XtfGetConsoleInfoList failed 0x%x", hr);
    return hr;
  }

  hr = XtfGetConsoleFieldValue(hConsoleInfo, XtfConsoleFieldId::ConsoleId, &fieldType, nullptr, &bufferSize);
  if (hr != HRESULT_FROM_WIN32(ERROR_MORE_DATA))
  {
    XtfCloseConsoleInfoList(hConsoleInfo);
    wprintf(L"\n\n*** XtfGetConsoleFieldValue failed 0x%x", hr);
    return hr;
  }

  pValueBuffer = new BYTE[bufferSize];

  hr  = XtfGetConsoleFieldValue(hConsoleInfo, XtfConsoleFieldId::ConsoleId, &fieldType, pValueBuffer, &bufferSize);
  if (SUCCEEDED(hr))
  {
    PWCHAR consoleId = (PWCHAR)pValueBuffer;
    wprintf(L"\n\n*** Console ID is %s", consoleId);
  }
  else
  {
    wprintf(L"\n\n*** XtfGetConsoleFieldValue failed 0x%x", hr);
  }

  XtfCloseConsoleInfoList(hConsoleInfo);
  delete[] pValueBuffer;

  return hr;
}  
```

<a id="requirementsSection" />

## 요구 사항

**헤더:** xtfapi.h

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

**지원 플랫폼:** Windows(XBOX 콘솔 도구용)

<a id="seealsoSection" />

## 함께 보기

[XtfConsoleControl](/reference/tools/xtf/xtfconsolecontrol/xtfconsolecontrol_members)\
[XBOX Tools Framework](/reference/tools/xtf/atoc-xbox-tools-framework)


## Related topics

- [XtfCloseConsoleInfoList](/ko/reference/tools/xtf/xtfapi/functions/xtfcloseconsoleinfolist-xbox-microsoft-m.md)
- [XtfGetConsoleFieldValue](/ko/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m.md)
- [XtfGetCredentialInfoList](/ko/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md)
- [XtfCloseCredentialInfoList](/ko/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m.md)
- [XtfGetCredentialInfoCount](/ko/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfocount-xtfapi-xbox-windows-m.md)
