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

# XtfGetCredentialInfoCount

> XtfGetCredentialInfoCount

Gets the count of credentials stored in an `XtfNetworkCredentials` object returned by [XtfGetCredentialInfoList](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md).

## Syntax

```cpp theme={null}
HRESULT XtfGetCredentialInfoCount(
         XtfNetworkCredentials credentialInfo,
         UINT32* count
)  
```

### Parameters

*credentialInfo*\
Type: XtfNetworkCredentials

\[in] An `XtfNetworkCredentials` object created by calling [XtfGetCredentialInfoList](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md).

*count*\
Type: UINT32\*

\[out] The number of credentials stored in *credentialInfo*.

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

## Remarks

Use this function to get the number of credentials stored in the `XtfNetworkCredentials` object returned by the [XtfGetCredentialInfoList](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md) function. Use this function with the `XtfGetCredentialInfoList`, [XtfGetCredentialServerName](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m.md), and [XtfGetCredentialUserName](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialusername-xtfapi-xbox-windows-m.md) functions to enumerate the current list of stored credentials on a console. You can also use [XtfAddCredential](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m.md) to add credentials and [XtfRemoveCredential](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m.md) to remove credentials.

When you're done, use [XtfCloseCredentialInfoList](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m.md) to free the `XtfNetworkCredentials` object returned by `XtfGetCredentialInfoList`.

For an example that demonstrates how to manage and enumerate stored credentials, see [XtfGetCredentialInfoList](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m.md).

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

**Supported platforms:** Windows (for XBOX console tools)

## See also

[Run from PC Deployment (NDA topic)](https://docs.xbox.com/home/setup-install/concepts/deployment.md)\
[XTF Transport Errors (NDA topic)](https://docs.xbox.com/tools/tools-console/commandlinetools/xtf-transport-errors.md)\
[Additional Xtf APIs](https://docs.xbox.com/reference/tools/xtf/xtfapi/atoc-xtfapi.md)


## Related topics

- [XtfAddCredential](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m.md)
- [XtfRemoveCredential](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m.md)
- [XtfCloseCredentialInfoList](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m.md)
- [XtfGetCredentialServerName](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m.md)
- [XtfGetCredentialUserName](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcredentialusername-xtfapi-xbox-windows-m.md)
