Share via


CredWrite (Windows Embedded CE 6.0)

1/6/2010

The CredWrite function creates a credential that is uniquely identified by the tuple that contains the credential type and the target ID associated with the credential. If there is already a credential corresponding to that tuple, then it is updated, unless flags explicitly override that behavior. This function replaces CeCredWrite.

Syntax

DWORD CredWrite(
  PCRED pCred,
  DWORD dwFlags
);

Parameters

  • pCred
    [in] Pointer to the credential that has to be added.

    For more information about the credential structure used, please see the CRED structure.

  • dwFlags
    [in] Flags that determine behavior when credential already exists, and can be one of the following flags.

    Flag Description

    CRED_FLAG_FAIL_IF_EXISTING

    If credential already exists then the call to CredWrite will fail.

    CRED_FLAG_NO_BLOB_HANDLING

    Meant for use by privileged SSPs. For more information, see HandleBlob.

Return Value

ERROR_SUCCESS is returned upon success. For a list of error codes, see Credential Manager Error Codes.

Remarks

The credential that has to be created must have wszTarget, wszUser, and pBlob values that are not NULL.

Requirements

Header cred.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Credential Manager Functions
CRED