CredFindBestCredentialA function (wincred.h)
The CredFindBestCredential function searches the Credentials Management (CredMan) database for the set of generic credentials that are associated with the current logon session and that best match the specified target resource.
BOOL CredFindBestCredentialA( LPCSTR TargetName, DWORD Type, DWORD Flags, PCREDENTIALA *Credential );
A pointer to a null-terminated string that contains the name of the target resource for which to find credentials.
The type of credentials to search for. Currently, this function supports only CRED_TYPE_GENERIC.
The address of a pointer to a CREDENTIAL structure that specifies the set of credentials this function finds.
When you have finished using this structure, free it by calling the CredFree function.
If the function succeeds, it returns TRUE.
If the function fails, it returns FALSE. To get extended error information, call GetLastError.
The wincred.h header defines CredFindBestCredential 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 Vista [desktop apps only]|
|Minimum supported server||Windows Server 2008 [desktop apps only]|