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

# XtfGetCredentialUserName

> XtfGetCredentialUserName

# XtfGetCredentialUserName

Obtém a parte do nome de usuário das credenciais armazenadas em um índice de um objeto XtfNetworkCredentials retornado por [XtfGetCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m).

<a id="syntaxSection" />

## Sintaxe

```cpp theme={null}
HRESULT XtfGetCredentialUserName(
         XtfNetworkCredentials credentialInfo,
         UINT32 credentialIndex,
         PWSTR userName,
         UINT32 *userNameLength
)  
```

<a id="ID4EK" />

### Parâmetros

*credentialInfo*<br />Tipo: XtfNetworkCredentials

\[in] Um objeto XtfNetworkCredentials criado chamando [XtfGetCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m).

*credentialIndex*<br />Tipo: UINT32

\[in] Índice do **userName** no objeto **credentialInfo**.

*userName*<br />Tipo: PWSTR

\[out] Nome de usuário no índice fornecido no objeto **credentialInfo**.

*userNameLength*<br />Tipo: UINT32 \*

\[in, out] Comprimento do buffer **userName** em WCHAR.

<a id="ID4ER" />

### Valor retornado

Tipo: HRESULT

Retorna **S\_OK** se for bem-sucedido. Retorna HRESULT\_FROM\_WIN32(ERROR\_MORE\_DATA) se **userName** não for grande o suficiente. O comprimento de buffer necessário é retornado em **userNameLength**.

<a id="remarks" />

## Comentários

Use [XtfAddCredential](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m) para adicionar credenciais. Use [XtfRemoveCredential](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m) para remover credenciais. Use [XtfGetCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m), [XtfGetCredentialInfoCount](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfocount-xtfapi-xbox-windows-m), [XtfGetCredentialServerName](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m) e [XtfGetCredentialUserName](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialusername-xtfapi-xbox-windows-m) para enumerar a lista atual de credenciais armazenadas. Use [XtfCloseCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m) para liberar o XtfNetworkCredentials retornado por [XtfGetCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m).

Confira [XtfGetCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m) para obter um exemplo de como usar essa API.

## Requisitos

**Cabeçalho:** xtfapi.h

**Biblioteca:** XtfApi.lib

**Plataformas com suporte:** Windows (para ferramentas de console XBOX)

## Confira também

[Implantação de execução a partir do PC (tópico sob NDA)](/pt-BR/home/setup-install/concepts/deployment)<br />[Erros de transporte do XTF (tópico sob NDA)](/pt-BR/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[APIs adicionais do Xtf](/pt-BR/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfGetCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md)
- [XtfGetCredentialServerName](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m.md)
- [XtfAddCredential](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m.md)
- [XtfRemoveCredential](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m.md)
- [XtfCloseCredentialInfoList](/pt-BR/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m.md)
