CredUICredUIParseUserName Method
Extracts the domain and user account name from a fully qualified user name.
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 CredUIParseUserName(
string userName,
StringBuilder userBuffer,
int userBufferSize,
StringBuilder domainName,
int domainNameSize
)
<DllImportAttribute("CredUI.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function CredUIParseUserName (
userName As String,
userBuffer As StringBuilder,
userBufferSize As Integer,
domainName As StringBuilder,
domainNameSize As Integer
) As Win32ErrorCode
Dim userName As String
Dim userBuffer As StringBuilder
Dim userBufferSize As Integer
Dim domainName As StringBuilder
Dim domainNameSize As Integer
Dim returnValue As Win32ErrorCode
returnValue = CredUI.CredUIParseUserName(userName,
userBuffer, userBufferSize, domainName,
domainNameSize)
public:
[DllImportAttribute(L"CredUI.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static Win32ErrorCode CredUIParseUserName(
String^ userName,
StringBuilder^ userBuffer,
int userBufferSize,
StringBuilder^ domainName,
int domainNameSize
)
[<DllImportAttribute("CredUI.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member CredUIParseUserName :
userName : string *
userBuffer : StringBuilder *
userBufferSize : int *
domainName : StringBuilder *
domainNameSize : int -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- userName String
-
Pointer to a null-terminated string that contains the user name to be parsed.
The name must be in UPN or down-level format, or a certificate.
Typically, userName is received from the
CredUIPromptForCredentials(CredUiInfo, String, IntPtr, Win32ErrorCode, StringBuilder, Int32, StringBuilder, Int32, Boolean, CredentialsDialogOptions) or CredUICmdLinePromptForCredentials(String, IntPtr, Win32ErrorCode, StringBuilder, UInt32, StringBuilder, UInt32, Boolean, CredentialsDialogOptions).
- userBuffer StringBuilder
-
Pointer to a null-terminated string that receives the user account name.
- userBufferSize Int32
-
Maximum number of characters to write to the pszUser string including the terminating null character.
- domainName StringBuilder
-
Pointer to a null-terminated string that receives the domain name.
If userName specifies a certificate, domainName will be NULL.
- domainNameSize Int32
-
Maximum number of characters to write to the domainName string
including the terminating null character.
Win32ErrorCode
Returns
ERROR_SUCCESS on success, or a
Win32ErrorCode error code on failure.