CredUICredUIConfirmCredentials Method
The
CredUIConfirmCredentials(String, Boolean) function is called after
CredUIPromptForCredentials(CredUiInfo, String, IntPtr, Win32ErrorCode, StringBuilder, Int32, StringBuilder, Int32, Boolean, CredentialsDialogOptions) or
CredUICmdLinePromptForCredentials(String, IntPtr, Win32ErrorCode, StringBuilder, UInt32, StringBuilder, UInt32, Boolean, CredentialsDialogOptions),
to confirm the validity of the credential harvested.
CredUIConfirmCredentials(String, Boolean) must be called if the
ExpectConfirmation flag was passed to the "prompt" function,
either
CredUIPromptForCredentials(CredUiInfo, String, IntPtr, Win32ErrorCode, StringBuilder, Int32, StringBuilder, Int32, Boolean, CredentialsDialogOptions) or
CredUICmdLinePromptForCredentials(String, IntPtr, Win32ErrorCode, StringBuilder, UInt32, StringBuilder, UInt32, Boolean, CredentialsDialogOptions),
and the "prompt" function returned
ERROR_SUCCESS.
After calling the "prompt" function and before calling
CredUIConfirmCredentials(String, Boolean),
the caller must determine whether the credentials are actually valid by using the
credentials to access the resource specified by
targetName.
The results of that validation test are passed to
CredUIConfirmCredentials(String, Boolean)
in the
confirm parameter.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("CredUI.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
public static Win32ErrorCode CredUIConfirmCredentials(
string targetName,
bool confirm
)
<DllImportAttribute("CredUI.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function CredUIConfirmCredentials (
targetName As String,
confirm As Boolean
) As Win32ErrorCode
Dim targetName As String
Dim confirm As Boolean
Dim returnValue As Win32ErrorCode
returnValue = CredUI.CredUIConfirmCredentials(targetName,
confirm)
public:
[DllImportAttribute(L"CredUI.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static Win32ErrorCode CredUIConfirmCredentials(
String^ targetName,
bool confirm
)
[<DllImportAttribute("CredUI.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member CredUIConfirmCredentials :
targetName : string *
confirm : bool -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- targetName String
-
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 targetName to
CredUIPromptForCredentials(CredUiInfo, String, IntPtr, Win32ErrorCode, StringBuilder, Int32, StringBuilder, Int32, Boolean, CredentialsDialogOptions) or CredUICmdLinePromptForCredentials(String, IntPtr, Win32ErrorCode, StringBuilder, UInt32, StringBuilder, UInt32, Boolean, CredentialsDialogOptions).
- confirm Boolean
-
Specifies whether the credentials returned from the prompt function are valid.
If , the credentials are stored in the credential manager
as defined by CredUIPromptForCredentials(CredUiInfo, String, IntPtr, Win32ErrorCode, StringBuilder, Int32, StringBuilder, Int32, Boolean, CredentialsDialogOptions) or CredUICmdLinePromptForCredentials(String, IntPtr, Win32ErrorCode, StringBuilder, UInt32, StringBuilder, UInt32, Boolean, CredentialsDialogOptions).
If , the credentials are not stored and various pieces of memory are cleaned up.
Win32ErrorCode
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.