> ## 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.

# XtfCloseConsoleInfoList

> XtfCloseConsoleInfoList

# XtfCloseConsoleInfoList

[XtfGetConsoleInfoList](/reference/tools/xtf/xtfconsolecontrol/functions/xtfgetconsoleinfolist-xtfconsolecontrol-xbox-microsoft-m)가 반환한 **XtfConsoleInfo** 개체와 연결된 리소스를 해제합니다.

## Syntax

```cpp theme={null}
HRESULT XtfCloseConsoleInfoList(
         XtfConsoleInfo hConsoleInfo
)  
```

### Parameters

*hConsoleInfo*\
Type: XtfConsoleInfo

\[in] 해제할 XtfConsoleInfo 개체입니다.

### Return value

Type: HRESULT

반환 값 S\_OK는 함수가 성공했음을 나타냅니다. 다른 값은 예기치 않은 오류가 발생했음을 나타냅니다.

## Remarks

[XtfGetConsoleInfoList](/reference/tools/xtf/xtfconsolecontrol/functions/xtfgetconsoleinfolist-xtfconsolecontrol-xbox-microsoft-m)를 사용하여 **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>대상 콘솔이 프로비저닝되지 않은 경우 **DeviceID**는 빈 값을 반환합니다.</Note>

```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;
}  
```

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

**Supported platforms:** Windows(XBOX 콘솔 도구용)

## See also

[XTF Transport Errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors)\
[Additional Xtf APIs](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfGetConsoleInfoList](/ko/reference/tools/xtf/xtfconsolecontrol/functions/xtfgetconsoleinfolist-xtfconsolecontrol-xbox-microsoft-m.md)
- [XtfGetConsoleFieldValue](/ko/reference/tools/xtf/xtfapi/functions/xtfgetconsolefieldvalue-xbox-microsoft-m.md)
- [XtfCloseCredentialInfoList](/ko/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m.md)
- [XtfGetCredentialInfoList](/ko/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md)
- [XtfClosePackageInfo](/ko/reference/tools/xtf/xtfapi/functions/xtfclosepackageinfo-xtfapi-xbox-windows-m.md)
