Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

credunpackauthenticationbuffer (credui)
 
.
Summary
The CredUnPackAuthenticationBuffer function converts an authentication buffer returned by a call to the CredUIPromptForWindowsCredentials function into a string user name and password.

C# Signature:

[DllImport("credui.dll", SetLastError=true)]
static extern TODO CredUnPackAuthenticationBuffer(TODO);

VB Signature:

    ''' <summary>
    ''' Windows Platform function (called via pInvoke) which authentication details from a packed authentication buffer.
    ''' See http://msdn.microsoft.com/en-us/library/aa375185(v=vs.85).aspx
    ''' </summary>
    ''' <param name="dwFlags">Setting the value of this parameter to CRED_PACK_PROTECTED_CREDENTIALS (1)
    ''' specifies that the function attempts to decrypt the password before returning it in the pszPassword buffer.
    ''' If the password cannot be decrypted, the function returns FALSE, an a call to the GetLastError function will return the value ERROR_NOT_CAPABLE.</param>
    ''' <param name="pAuthBuffer">The packed authentication buffer containing credentials to be unpacked.</param>
    ''' <param name="cbAuthBuffer">The length of the authentication buffer.</param>
    ''' <param name="pszUserName">User Name variable which will populated from the buffer.</param>
    ''' <param name="pcchMaxUserName">The maximum length of the User Name variable.</param>
    ''' <param name="pszDomainName">Domain variable which will populated from the buffer.</param>
    ''' <param name="pcchMaxDomainName">The maximum length of the Domain variable.</param>
    ''' <param name="pszPassword">Password variable which will populated from the buffer.</param>
    ''' <param name="pcchMaxPassword">The maximum length of the Password variable.</param>
    ''' <returns><c>True</c> on success; otherwise <c>False</c>. For extended error information, call the GetLastError() function.</returns>
    <DllImport("credui.dll", CharSet:=CharSet.Unicode, SetLastError:=True)> <CLSCompliant(False)> _
    Public Shared Function CredUnPackAuthenticationBuffer(ByVal dwFlags As UInt32, _
                              ByVal pAuthBuffer As IntPtr, ByVal cbAuthBuffer As UInt32, _
                              ByVal pszUserName As StringBuilder, ByRef pcchMaxUserName As UInt32, _
                              ByVal pszDomainName As StringBuilder, ByRef pcchMaxDomainName As UInt32, _
                              ByVal pszPassword As StringBuilder, ByRef pcchMaxPassword As UInt32) As <MarshalAs(UnmanagedType.Bool)> Boolean
    End Function

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions