CredRenameA function (wincred.h)
[CredRename is no longer supported. Starting with Windows Vista, calls to CredRename always return ERROR_NOT_SUPPORTED.]
The CredRename function renames a credential in the user's credential set. The credential set used is the one associated with the logon session of the current token. The token must not have the user's SID disabled.
BOOL CredRenameA( LPCSTR OldTargetName, LPCSTR NewTargetName, DWORD Type, DWORD Flags );
Pointer to a null-terminated string that contains the current name of the credential to be renamed.
Pointer to a null-terminated string that contains the new name for the credential.
Type of the credential to rename. Must be one of the CRED_TYPE_* defines.
Flags to control the operation of the function. Currently reserved and must be zero.
The function returns TRUE on success and FALSE on failure. The GetLastError function can be called to get a more specific status code. The following status codes can be returned:
There is no credential with the specified OldTargetName.
There is already a credential or type Type and named NewTargetName.
The logon session does not exist or there is no credential set associated with this logon session. Network logon sessions do not have an associated credential set.
A flag that is not valid was specified for the Flags parameter.
The wincred.h header defines CredRename as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|