CredUICredUIPromptForWindowsCredentials Method
Creates and displays a configurable dialog box that allows users to
supply credential information by using any credential provider installed on the local computer
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 CredUIPromptForWindowsCredentials(
ref CredUiInfo refiInfo,
Win32ErrorCode authError,
ref uint refAuthPackage,
IntPtr inAuthBuffer,
uint inAuthBufferSize,
out IntPtr refOutAuthBuffer,
out uint refOutAuthBufferSize,
ref bool refSave,
WindowsCredentialsDialogOptions flags
)
<DllImportAttribute("CredUI.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function CredUIPromptForWindowsCredentials (
ByRef refiInfo As CredUiInfo,
authError As Win32ErrorCode,
ByRef refAuthPackage As UInteger,
inAuthBuffer As IntPtr,
inAuthBufferSize As UInteger,
<OutAttribute> ByRef refOutAuthBuffer As IntPtr,
<OutAttribute> ByRef refOutAuthBufferSize As UInteger,
ByRef refSave As Boolean,
flags As WindowsCredentialsDialogOptions
) As Win32ErrorCode
Dim refiInfo As CredUiInfo
Dim authError As Win32ErrorCode
Dim refAuthPackage As UInteger
Dim inAuthBuffer As IntPtr
Dim inAuthBufferSize As UInteger
Dim refOutAuthBuffer As IntPtr
Dim refOutAuthBufferSize As UInteger
Dim refSave As Boolean
Dim flags As WindowsCredentialsDialogOptions
Dim returnValue As Win32ErrorCode
returnValue = CredUI.CredUIPromptForWindowsCredentials(refiInfo,
authError, refAuthPackage, inAuthBuffer,
inAuthBufferSize, refOutAuthBuffer,
refOutAuthBufferSize, refSave, flags)
public:
[DllImportAttribute(L"CredUI.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static Win32ErrorCode CredUIPromptForWindowsCredentials(
CredUiInfo% refiInfo,
Win32ErrorCode authError,
unsigned int% refAuthPackage,
IntPtr inAuthBuffer,
unsigned int inAuthBufferSize,
[OutAttribute] IntPtr% refOutAuthBuffer,
[OutAttribute] unsigned int% refOutAuthBufferSize,
bool% refSave,
WindowsCredentialsDialogOptions flags
)
[<DllImportAttribute("CredUI.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member CredUIPromptForWindowsCredentials :
refiInfo : CredUiInfo byref *
authError : Win32ErrorCode *
refAuthPackage : uint32 byref *
inAuthBuffer : IntPtr *
inAuthBufferSize : uint32 *
refOutAuthBuffer : IntPtr byref *
refOutAuthBufferSize : uint32 byref *
refSave : bool byref *
flags : WindowsCredentialsDialogOptions -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- refiInfo CredUiInfo
-
A CredUiInfo structure that contains information for customizing the appearance of the dialog box.
If the Parent member is not Zero,
this function displays a modal dialog box centered on the parent window.
If the Parent member is Zero,
the function displays a dialog box centered on the screen.
This function ignores the Banner member.
- authError Win32ErrorCode
-
A Windows error code that is displayed in the dialog box.
If credentials previously collected were not valid,
the caller uses this parameter to pass the error message from the API that collected the credentials
(for example, Winlogon) to this function.
The corresponding error message is formatted and displayed in the dialog box.
Set the value of this parameter to zero to display no error message.
- refAuthPackage UInt32
-
On input, the value of this parameter is used to specify the authentication package for which the
credentials in the pvInAuthBuffer buffer are serialized.
If the value of inAuthBuffer is NULL and the
AuthPackageOnly flag is set in the flags parameter,
only credential providers capable of serializing credentials for the
specified authentication package are to be enumerated.
To get the appropriate value to use for this parameter on input,
call the LsaLookupAuthenticationPackage function and use the value of the
AuthenticationPackage parameter of that function.
On output, this parameter specifies the authentication package for which the
credentials in the refOutAuthBuffer buffer are serialized.
- inAuthBuffer IntPtr
-
A pointer to a credential BLOB that is used to populate the credential fields in the dialog box.
Set the value of this parameter to NULL to leave the credential fields empty.
- inAuthBufferSize UInt32
-
The size, in bytes, of the inAuthBuffer buffer.
- refOutAuthBuffer IntPtr
-
The address of a pointer that, on output, specifies the credential BLOB.
For Kerberos, NTLM, or Negotiate credentials,
call the CredUnPackAuthenticationBuffer(CredentialsPackFlags, IntPtr, Int32, IntPtr, Int32, IntPtr, Int32, IntPtr, Int32) function to convert this
BLOB to string representations of the credentials.
When you have finished using the credential BLOB,
clear it from memory by calling the SecureZeroMemory function,
and free it by calling the CoTaskMemFree(IntPtr) function.
- refOutAuthBufferSize UInt32
-
The size, in bytes, of the refOutAuthBuffer buffer.
- refSave Boolean
-
A pointer to a Boolean value that, on input, specifies whether the
Save check box is selected in the dialog box that this function displays.
On output, the value of this parameter specifies whether the
Save check box was selected when the user clicks the Submit button in the dialog box.
Set this parameter to NULL to ignore the Save check box.
- flags WindowsCredentialsDialogOptions
-
A value that specifies behavior for this function.
Win32ErrorCode
If the function succeeds, the function returns
ERROR_SUCCESS.
If the function is canceled by the user, it returns
ERROR_CANCELLED.
Any other
Win32ErrorCode value indicates that the function failed to load.