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

# XtfGetCredentialInfoList

> XtfGetCredentialInfoList

# XtfGetCredentialInfoList

콘솔에 현재 저장된 자격 증명 목록을 포함하는 `XtfNetworkCredentials` 개체를 반환합니다.

<a id="syntaxSection" />

## 구문

```cpp theme={null}
HRESULT XtfGetCredentialInfoList(
         LPCWSTR address,
         XtfNetworkCredentials* credentialInfo
)  
```

<a id="ID4EG" />

### 매개 변수

*address*<br />형식: LPCWSTR

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

*credentialInfo*<br />형식: XtfNetworkCredentials\*

\[out] 콘솔에 현재 저장된 자격 증명 목록을 포함하는 `XtfNetworkCredentials` 개체입니다.

<a id="ID4EN" />

### 반환값

형식: HRESULT

반환값이 `S_OK`이면 함수가 성공했으며 **credentialInfo** 개체에서 자격 증명 정보를 검색할 수 있음을 나타냅니다. 다른 값은 예기치 않은 오류가 발생했음을 나타냅니다.

<a id="remarks" />

## 설명

[XtfAddCredential](/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m)을 사용하여 자격 증명을 추가합니다. [XtfRemoveCredential](/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m)을 사용하여 자격 증명을 제거합니다. [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m), [XtfGetCredentialInfoCount](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfocount-xtfapi-xbox-windows-m), [XtfGetCredentialServerName](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m), [XtfGetCredentialUserName](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialusername-xtfapi-xbox-windows-m)을 사용하여 저장된 자격 증명의 현재 목록을 열거합니다. [XtfCloseCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m)를 사용하여 [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m)가 반환한 `XtfNetworkCredentials`를 해제합니다.

<Note>
  [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m)는 콘솔의 모든 정보를 검색합니다. [XtfGetCredentialServerName](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m)과 [XtfGetCredentialUserName](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialusername-xtfapi-xbox-windows-m)은 단순히 그렇게 검색된 정보를 순회할 뿐입니다.
</Note>

<Note>
  필요한 값을 검색한 후에는 [XtfCloseCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m)를 사용하여 반환된 XtfNetworkCredentials 개체와 관련된 리소스를 해제하세요.
</Note>

<a id="ID4ETC" />

```cpp theme={null}
HRESULT               hr                = S_OK;
PCWSTR                consoleAddress    = L"190.167.10.182";
XtfNetworkCredentials credentialInfo    = nullptr;
UINT32                count             = 0;
PWSTR                 pServerNameBuffer = nullptr;
PWSTR                 pUserNameBuffer   = nullptr;
UINT32                bufferSize        = 0;

hr = XtfAddCredential(consoleAddress, L"devpc001", L"devpc001\\test", L"test");
if (FAILED(hr))
{
    wprintf(L"\n\n*** XtfAddCredential failed 0x%x", hr);
    return hr;
}

hr = XtfAddCredential(consoleAddress, L"devpc002", L"devpc002\\test1", L"test1");
if (FAILED(hr))
{
    wprintf(L"\n\n*** XtfAddCredential failed 0x%x", hr);
    return hr;
}

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

hr = XtfGetCredentialInfoCount(credentialInfo, &count);
if (FAILED(hr))
{
    wprintf(L"\n\n*** XtfGetCredentialInfoCount failed 0x%x", hr);
    return hr;
}

wprintf(L"\n\n*** List of Users:");
wprintf(L"\n\t*** Number of users: %d", count);


for (UINT32 i=0; i < count ; i++)
{
    bufferSize=0;
    hr = XtfGetCredentialServerName(credentialInfo, i, nullptr, &bufferSize);
    if (hr != HRESULT_FROM_WIN32(ERROR_MORE_DATA))
    {
        wprintf(L"\n\n*** XtfGetCredentialServerName failed 0x%x", hr);
        return hr;
    }

    pServerNameBuffer = new WCHAR[bufferSize];

    hr = XtfGetCredentialServerName(credentialInfo, i, pServerNameBuffer, &bufferSize);
    if (FAILED(hr))
    {
        wprintf(L"\n\n*** XtfGetCredentialServerName failed 0x%x", hr);
        return hr;
    }

    bufferSize=0;
    hr = XtfGetCredentialUserName(credentialInfo, i, nullptr, &bufferSize);
    if (hr != HRESULT_FROM_WIN32(ERROR_MORE_DATA))
    {
        wprintf(L"\n\n*** XtfGetCredentialUserName failed 0x%x", hr);
        return hr;
    }

    pUserNameBuffer = new WCHAR[bufferSize];

    hr = XtfGetCredentialUserName(credentialInfo, i, pUserNameBuffer, &bufferSize);
    if (FAILED(hr))
    {
        wprintf(L"\n\n*** XtfGetCredentialUserName failed 0x%x", hr);
        return hr;
    }

    wprintf(L"\n\t Server: %ls, User: %ls", pServerNameBuffer, pUserNameBuffer);
    delete[] pServerNameBuffer;
    delete[] pUserNameBuffer;
}

XtfCloseCredentialInfoList(credentialInfo);

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

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

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

hr = XtfGetCredentialInfoCount(credentialInfo, &count);
if (FAILED(hr))
{
    wprintf(L"\n\n*** XtfGetCredentialInfoCount failed 0x%x", hr);
    return hr;
}

wprintf(L"\n\n*** Number of users: %d", count);
XtfCloseCredentialInfoList(credentialInfo);

wprintf(L"\n\n");
return hr;  
```

## 요구 사항

**헤더:** xtfapi.h

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

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

## 참고 항목

[Run from PC Deployment (NDA topic)](/home/setup-install/concepts/deployment)<br />[XTF Transport Errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[Additional Xtf APIs](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [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)
- [XtfRemoveCredential](/ko/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m.md)
- [XtfAddCredential](/ko/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m.md)
- [XtfGetCredentialServerName](/ko/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m.md)
