Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CredUIConfirmCredentials function

The CredUIConfirmCredentials function is called after CredUIPromptForCredentials or CredUICmdLinePromptForCredentials, to confirm the validity of the credential harvested. CredUIConfirmCredentials must be called if the CREDUI_FLAGS_EXPECT_CONFIRMATION flag was passed to the "prompt" function, either CredUIPromptForCredentials or CredUICmdLinePromptForCredentials, and the "prompt" function returned NO_ERROR.

After calling the "prompt" function and before calling CredUIConfirmCredentials, the caller must determine whether the credentials are actually valid by using the credentials to access the resource specified by pszTargetName. The results of that validation test are passed to CredUIConfirmCredentials in the bConfirm parameter.


DWORD WINAPI CredUIConfirmCredentials(
  _In_ PCTSTR pszTargetName,
  _In_ BOOL   bConfirm


pszTargetName [in]

Pointer to a null-terminated string that contains the name of the target for the credentials, typically a domain or server application name. This must be the same value passed as pszTargetName to CredUIPromptForCredentials or CredUICmdLinePromptForCredentials

bConfirm [in]

Specifies whether the credentials returned from the prompt function are valid. If TRUE, the credentials are stored in the credential manager as defined by CredUIPromptForCredentials or CredUICmdLinePromptForCredentials. If FALSE, the credentials are not stored and various pieces of memory are cleaned up.

Return value

Status of the operation is returned. The caller can check this status to determine whether the credential confirm operation succeeded. Most applications ignore this status code because the application's connection to the resource has already been done. The operation can fail because the credential was not found on the list of credentials awaiting confirmation, or because the attempt to write or delete the credential failed. Failure to find the credential on the list can occur because the credential was never queued or as a result of too many credentials being queued. Up to five credentials can be queued before older ones are discarded as newer ones are queued.

Return codeDescription
NO_ERROR - (zero)

Confirm operation succeeded.


The subject credential could not be found on the confirmation waiting list.


An attempt to confirm a waiting credential failed because the credential contained data that was not valid or was inconsistent.



Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]







Unicode and ANSI names

CredUIConfirmCredentialsW (Unicode) and CredUIConfirmCredentialsA (ANSI)



© 2018 Microsoft