Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than credui, prefix the name with the module name and a period.
''' <summary>
''' Windows Platform function (called via pInvoke) which populates an authentication buffer with authentication details.
''' See http://msdn.microsoft.com/en-us/library/aa374802(v=vs.85).aspx
''' </summary>
''' <param name="dwFlags">RESERVED - must be zero.</param>
''' <param name="pszUserName">User Name.</param>
''' <param name="pszPassword">Password.</param>
''' <param name="pPackedCredentials">The buffer to be packed with credentials.</param>
''' <param name="pcbPackedCredentials">The the size of the buffer.</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 CredPackAuthenticationBuffer(ByVal dwFlags As UInt32, ByVal pszUserName As String, ByVal pszPassword As String, ByVal pPackedCredentials As IntPtr, ByRef pcbPackedCredentials 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:
To determine required buffer size, call first with pPackedCredentials = IntPtr.Zero. Should return error code 160, but pcbPackedCredentials will be populated with the expected buffer size. Use Marshal.AllocCoTaskMem() to allocate the appropriate buffer, then call again, this time passing the allocated buffer.
The CredPackAuthenticationBuffer function converts a string user name and password into an authentication buffer.
12/21/2012 11:58:45 PM - -208.107.125.70
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
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).