CredRead (Windows CE 5.0)

This function retrieves credential information that is uniquely identified by the tuple that contains the credential type and the target ID associated with the credential. This function replaces CeCredRead.

Return Values

Remarks

There can be multiple credentials present for the same type. The default behavior of CredRead function is to return a credential in the following order of preference:

An exact credential match to the target.

The credential marked Default.

An implicit default credential.

If no matching credential is found for the specified tuple, and there is a default credential set for the type specified in the tuple, that default credential is returned. If there is no default credential then the implicit default is returned. dwFlags member of the returned credential can be used to determine the source of the credential and the caller can take appropriate action. If the caller is not trusted, the blob will be empty for trusted credentials.

In some cases you may want to receive only an exact match to the target. Depending on the case, set dwFlags to be either CRED_FLAG_NO_DEFAULT or CRED_FLAG_NO_IMPLICIT_DEFAULT.

Pointers contained in the single allocated block buffer to return the credential are pointers to locations within the single allocated block. This single returned buffer must be freed by calling CredFree, and cannot be NULL.

The dwFlags member of the returned credential can be used to figure out the source of the credential. If the CRED_FLAG_DEFAULT is set, it means no matching credential was found, but a default credential was found. If the CRED_FLAG_IMPLICIT_DEFAULT is set, then it means that there was no matching credential or default credential, and an implicit default credential was returned.