XtfGetCredentialUserName

Gets the user name part of the credentials stored at an index in an XtfNetworkCredentials object returned by XtfGetCredentialInfoList.

Syntax

HRESULT XtfGetCredentialUserName(
         XtfNetworkCredentials credentialInfo,
         UINT32 credentialIndex,
         PWSTR userName,
         UINT32 *userNameLength
)  

Parameters

credentialInfo
Type: XtfNetworkCredentials

[in] An XtfNetworkCredentials object created by calling XtfGetCredentialInfoList.

credentialIndex
Type: UINT32

[in] Index of the userName in the credentialInfo object.

userName
Type: PWSTR

[out] User name at the given index in the credentialInfo object.

userNameLength
Type: UINT32 *

[in, out] Length of userName buffer in WCHAR.

Return value

Type: HRESULT

Returns S_OK if successful. Returns HRESULT_FROM_WIN32(ERROR_MORE_DATA) if userName is not large enough. The required buffer length is returned in userNameLength.

Remarks

Use XtfAddCredential to add credentials. Use XtfRemoveCredential to remove credentials. Use XtfGetCredentialInfoList, XtfGetCredentialInfoCount, XtfGetCredentialServerName, and XtfGetCredentialUserName to enumerate the current list of stored credentials. Use XtfCloseCredentialInfoList to free the XtfNetworkCredentials returned by XtfGetCredentialInfoList.

See XtfGetCredentialInfoList for an example of how to use this API.

Requirements

Header: xtfapi.h

Library: XtfApi.lib

Supported platforms: Windows (for Xbox console tools)

See also

Run from PC Deployment (NDA topic)Authorization required
XTF Transport Errors (NDA topic)Authorization required
Additional Xtf APIs