XtfGetCredentialUserName
获取 XtfGetCredentialInfoList 返回的 XtfNetworkCredentials 对象中某索引处存储的凭据的用户名部分。
语法
HRESULT XtfGetCredentialUserName(
XtfNetworkCredentials credentialInfo,
UINT32 credentialIndex,
PWSTR userName,
UINT32 *userNameLength
)
参数
credentialInfo
类型:XtfNetworkCredentials
[in] 通过调用 XtfGetCredentialInfoList 创建的 XtfNetworkCredentials 对象。
credentialIndex
类型:UINT32
[in] credentialInfo 对象中 userName 的索引。
userName
类型:PWSTR
[out] credentialInfo 对象中给定索引处的用户名。
userNameLength
类型:UINT32 *
[in, out] userName 缓冲区长度 (WCHAR)。
返回值
类型:HRESULT
成功时返回 S_OK。 如果 userName 不够大,则返回 HRESULT_FROM_WIN32(ERROR_MORE_DATA)。 所需的缓冲区长度在 userNameLength 中返回。
备注
使用 XtfAddCredential 来添加凭据。 使用 XtfRemoveCredential 来删除凭据。 使用 XtfGetCredentialInfoList、XtfGetCredentialInfoCount、XtfGetCredentialServerName 和 XtfGetCredentialUserName 来枚举存储的凭据的当前列表。 使用 XtfCloseCredentialInfoList 来释放 XtfGetCredentialInfoList 返回的 XtfNetworkCredentials。
有关如何使用此 API 的示例,请参阅 XtfGetCredentialInfoList。
要求
头文件:xtfapi.h
库:XtfApi.lib
支持平台:Windows(适用于 Xbox 主机工具)