Skip to content

Latest commit

 

History

History
161 lines (130 loc) · 5.36 KB

nf-wincred-credenumeratew.md

File metadata and controls

161 lines (130 loc) · 5.36 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:wincred.CredEnumerateW
CredEnumerateW function (wincred.h)
Enumerates the credentials from the user's credential set. (Unicode)
CRED_ENUMERATE_ALL_CREDENTIALS
CredEnumerate
CredEnumerate function [Security]
CredEnumerateW
_cred_credenumerate
security.credenumerate
wincred/CredEnumerate
wincred/CredEnumerateW
security\credenumerate.htm
security
ef0b7620-7b00-45f1-af16-141d2e940783
12/05/2018
CRED_ENUMERATE_ALL_CREDENTIALS, CredEnumerate, CredEnumerate function [Security], CredEnumerateA, CredEnumerateW, _cred_credenumerate, security.credenumerate, wincred/CredEnumerate, wincred/CredEnumerateA, wincred/CredEnumerateW
wincred.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
CredEnumerateW (Unicode) and CredEnumerateA (ANSI)
Advapi32.lib
Advapi32.dll
Windows
19H1
CredEnumerateW
wincred/CredEnumerateW
c++
APIRef
kbSyntax
DllExport
Advapi32.dll
API-MS-Win-DownLevel-AdvApi32-l2-1-0.dll
sechost.dll
API-MS-Win-DownLevel-AdvApi32-l2-1-1.dll
API-MS-Win-Security-credentials-l1-1-0.dll
CredEnumerate
CredEnumerateA
CredEnumerateW

CredEnumerateW function

-description

The CredEnumerate function enumerates the credentials from 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.

-parameters

-param Filter [in]

Pointer to a null-terminated string that contains the filter for the returned credentials. Only credentials with a TargetName matching the filter will be returned. The filter specifies a name prefix followed by an asterisk. For instance, the filter "FRED*" will return all credentials with a TargetName beginning with the string "FRED".

If NULL is specified, all credentials will be returned.

-param Flags [in]

The value of this parameter can be zero or more of the following values combined with a bitwise-OR operation.

Value Meaning
CRED_ENUMERATE_ALL_CREDENTIALS
0x1
This function enumerates all of the credentials in the user's credential set. The target name of each credential is returned in the "namespace:attribute=target" format. If this flag is set and the Filter parameter is not NULL, the function fails and returns ERROR_INVALID_FLAGS.

Windows Server 2003 and Windows XP:  This flag is not supported.

-param Count [out]

Count of the credentials returned in the Credentials array.

-param Credential [out]

Pointer to an array of pointers to credentials. The returned credential is a single allocated block. Any pointers contained within the buffer are pointers to locations within this single allocated block. The single returned buffer must be freed by calling CredFree.

-returns

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.

Return code/value Description
ERROR_NOT_FOUND
1168 (0x490)
No credential exists matching the specified Filter.
ERROR_NO_SUCH_LOGON_SESSION
1312 (0x520)
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.
ERROR_INVALID_FLAGS
1004 (0x3EC)
A flag that is not valid was specified for the Flags parameter, or CRED_ENUMERATE_ALL_CREDENTIALS is specified for the Flags parameter and the Filter parameter is not NULL.

-see-also

CredFree

GetLastError

-remarks

Note

The wincred.h header defines CredEnumerate 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.