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

# XtfGetCredentialInfoCount

> XtfGetCredentialInfoCount

# XtfGetCredentialInfoCount

获取 [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m) 返回的 `XtfNetworkCredentials` 对象中存储的凭据数量。

<a id="syntaxSection" />

## 语法

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

<a id="parametersSection" />

### 参数

*credentialInfo*<br />类型：XtfNetworkCredentials

\[in] 通过调用 [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m) 创建的 `XtfNetworkCredentials` 对象。

*count*<br />类型：UINT32\*

\[out] *credentialInfo* 中存储的凭据数量。

<a id="retvalSection" />

### 返回值

类型：HRESULT

成功时返回 `S_OK`；否则返回一个 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

使用此函数获取 [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m) 函数返回的 `XtfNetworkCredentials` 对象中存储的凭据数量。将此函数与 `XtfGetCredentialInfoList`、[XtfGetCredentialServerName](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialtargetname-xtfapi-xbox-windows-m) 和 [XtfGetCredentialUserName](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialusername-xtfapi-xbox-windows-m) 函数一起使用，以枚举主机上当前存储的凭据列表。你还可以使用 [XtfAddCredential](/reference/tools/xtf/xtfapi/functions/xtfaddcredential-xtfapi-xbox-windows-m) 添加凭据，使用 [XtfRemoveCredential](/reference/tools/xtf/xtfapi/functions/xtfremovecredential-xtfapi-xbox-windows-m) 移除凭据。

完成后，使用 [XtfCloseCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfclosecredentialinfo-xtfapi-xbox-windows-m) 释放由 `XtfGetCredentialInfoList` 返回的 `XtfNetworkCredentials` 对象。

有关演示如何管理和枚举已存储凭据的示例，请参阅 [XtfGetCredentialInfoList](/reference/tools/xtf/xtfapi/functions/xtfgetcredentialinfolist-xtfapi-xbox-windows-m)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[Run from PC Deployment (NDA 主题)](/home/setup-install/concepts/deployment)<br />[XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[其他 Xtf API](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

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