CredUICredUnPackAuthenticationBuffer(CredentialsPackFlags, IntPtr, Int32, StringBuilder, Int32, StringBuilder, Int32, StringBuilder, Int32) Method
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, SetLastError = true)]
public static bool CredUnPackAuthenticationBuffer(
CredentialsPackFlags flags,
IntPtr authBuffer,
int authBufferSize,
StringBuilder userName,
ref int refUserNameSize,
StringBuilder domainName,
ref int refDomainNameSize,
StringBuilder password,
ref int refPasswordSize
)
<DllImportAttribute("CredUI.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function CredUnPackAuthenticationBuffer (
flags As CredentialsPackFlags,
authBuffer As IntPtr,
authBufferSize As Integer,
userName As StringBuilder,
ByRef refUserNameSize As Integer,
domainName As StringBuilder,
ByRef refDomainNameSize As Integer,
password As StringBuilder,
ByRef refPasswordSize As Integer
) As Boolean
Dim flags As CredentialsPackFlags
Dim authBuffer As IntPtr
Dim authBufferSize As Integer
Dim userName As StringBuilder
Dim refUserNameSize As Integer
Dim domainName As StringBuilder
Dim refDomainNameSize As Integer
Dim password As StringBuilder
Dim refPasswordSize As Integer
Dim returnValue As Boolean
returnValue = CredUI.CredUnPackAuthenticationBuffer(flags,
authBuffer, authBufferSize, userName,
refUserNameSize, domainName, refDomainNameSize,
password, refPasswordSize)
public:
[DllImportAttribute(L"CredUI.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool CredUnPackAuthenticationBuffer(
CredentialsPackFlags flags,
IntPtr authBuffer,
int authBufferSize,
StringBuilder^ userName,
int% refUserNameSize,
StringBuilder^ domainName,
int% refDomainNameSize,
StringBuilder^ password,
int% refPasswordSize
)
[<DllImportAttribute("CredUI.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member CredUnPackAuthenticationBuffer :
flags : CredentialsPackFlags *
authBuffer : IntPtr *
authBufferSize : int *
userName : StringBuilder *
refUserNameSize : int byref *
domainName : StringBuilder *
refDomainNameSize : int byref *
password : StringBuilder *
refPasswordSize : int byref -> bool
No code example is currently available or this language may not be supported.
- flags CredentialsPackFlags
-
Setting the value of this parameter to CRED_PACK_PROTECTED_CREDENTIALS specifies that the
function attempts to decrypt the credentials in the authentication buffer.
If the credential cannot be decrypted, the function returns ,
and a call to the GetLastError function will return the value ERROR_NOT_CAPABLE.
How the decryption is done depends on the format of the authentication buffer.
If the authentication buffer is a SEC_WINNT_AUTH_IDENTITY_EX2 structure,
the function can decrypt the buffer if it is encrypted by using
SspiEncryptAuthIdentityEx with the SEC_WINNT_AUTH_IDENTITY_ENCRYPT_SAME_LOGON option.
If the authentication buffer is one of the marshaled KERB_*_LOGON structures,
the function decrypts the password before returning it in the password buffer.
- authBuffer IntPtr
-
A pointer to the authentication buffer to be converted.
This buffer is typically the output of the
CredUIPromptForWindowsCredentials(CredUiInfo, Win32ErrorCode, UInt32, IntPtr, UInt32, IntPtr, UInt32, Boolean, WindowsCredentialsDialogOptions)
or CredPackAuthenticationBuffer(CredentialsPackFlags, String, String, IntPtr, Int32) function.
- authBufferSize Int32
-
The size, in bytes, of the authBuffer buffer.
- userName StringBuilder
-
A pointer to a null-terminated string that receives the user name.
This string can be a marshaled credential.
- refUserNameSize Int32
-
A pointer to a value that specifies the size, in characters, of the userName buffer.
On output, if the buffer is not of sufficient size, specifies the required size,
in characters, of the userName buffer. The size includes terminating null character.
- domainName StringBuilder
-
A pointer to a null-terminated string that receives the name of the user's domain.
- refDomainNameSize Int32
-
A pointer to a value that specifies the size, in characters, of the domainName buffer.
On output, if the buffer is not of sufficient size, specifies the required size, in characters,
of the domainName buffer. The size includes the terminating null character.
The required size can be zero if there is no domain name.
- password StringBuilder
-
A pointer to a null-terminated string that receives the password.
- refPasswordSize Int32
-
A pointer to a value that specifies the size, in characters, of the password buffer.
On output, if the buffer is not of sufficient size, specifies the required size, in characters,
of the password buffer. The size includes the terminating null character.
This string can be a marshaled credential.
Boolean if the function succeeds; otherwise,
.