CredUnmarshalCredentialA function

The CredUnmarshalCredential function transforms a marshaled credential back into its original form.

Syntax

BOOL CredUnmarshalCredentialA(
  LPCSTR             MarshaledCredential,
  PCRED_MARSHAL_TYPE CredType,
  PVOID              *Credential
);

Parameters

MarshaledCredential

Pointer to a null-terminated string that contains the marshaled credential.

CredType

Type of credential specified by MarshaledCredential.

This is one of the CRED_MARSHAL_TYPE values.

Credential

Pointer to the unmarshaled credential. If CredType returns CertCredential, the returned pointer is to a CERT_CREDENTIAL_INFO structure. If CredType returns UsernameTargetCredential, the returned pointer is to a USERNAME_TARGET_CREDENTIAL_INFO structure.

The caller should free the returned buffer using CredFree.

Return value

This 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 code can be returned:

ERROR_INVALID_PARAMETER

MarshaledCredential is not valid.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wincred.h
Library Advapi32.lib
DLL Advapi32.dll

See also

CERT_CREDENTIAL_INFO

CRED_MARSHAL_TYPE

CredFree

CredMarshalCredential

GetLastError

USERNAME_TARGET_CREDENTIAL_INFO