Gets the user name part of the credentials stored at an index in an XtfNetworkCredentials object returned by XtfGetCredentialInfoList.
HRESULT XtfGetCredentialUserName(
XtfNetworkCredentials credentialInfo,
UINT32 credentialIndex,
PWSTR userName,
UINT32 *userNameLength
)
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.
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.
Use XtfAddCredential to add credentials. Use XtfRemoveCredential to remove credentials. Use XtfGetCredentialInfoList, XtfGetCredentialCount, 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.
Note When the console is rebooted all stored credentials are lost and must be added again.
Header: Declared in XtfApi.h.
Library: Use XtfApi.lib.