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 secur32, prefix the name with the module name and a period.
GetUserNameEx (secur32)
.
C# Signature:
public enum ExtendedNameFormat
{
/// <summary>
/// An unknown name type.
/// </summary>
NameUnknown = 0,
/// <summary>
/// The fully qualified distinguished name
/// (for example, CN=Jeff Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com).
/// </summary>
NameFullyQualifiedDN = 1,
/// <summary>
/// A legacy account name (for example, Engineering\JSmith).
/// The domain-only version includes trailing backslashes (\\).
/// </summary>
NameSamCompatible = 2,
/// <summary>
/// A "friendly" display name (for example, Jeff Smith).
/// The display name is not necessarily the defining relative distinguished name (RDN).
/// </summary>
NameDisplay = 3,
/// <summary>
/// A GUID string that the IIDFromString function returns
/// (for example, {4fa050f0-f561-11cf-bdd9-00aa003a77b6}).
/// </summary>
NameUniqueId = 6,
/// <summary>
/// The complete canonical name (for example, engineering.microsoft.com/software/someone).
/// The domain-only version includes a trailing forward slash (/).
/// </summary>
NameCanonical = 7,
/// <summary>
/// The user principal name (for example, someone@example.com).
/// </summary>
NameUserPrincipal = 8,
/// <summary>
/// The same as NameCanonical except that the rightmost forward slash (/)
/// is replaced with a new line character (\n), even in a domain-only case
/// (for example, engineering.microsoft.com/software\nJSmith).
/// </summary>
NameCanonicalEx = 9,
/// <summary>
/// The generalized service principal name
/// (for example, www/www.microsoft.com@microsoft.com).
/// </summary>
NameServicePrincipal = 10,
/// <summary>
/// The DNS domain name followed by a backward-slash and the SAM user name.
/// </summary>
NameDnsDomain = 12
}
[DllImport("secur32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern byte GetUserNameEx (ExtendedNameFormat nameFormat,
StringBuilder userName, ref int userNameSize);
VB Signature:
Declare Function GetUserNameEx Lib "secur32.dll" (nameFormat As Integer, _
userName As StringBuilder, ByRef userNameSize As Integer) As Byte
User-Defined Types:
None.
Notes:
This may be required because System.Environment.UserDomainName is broken. If the local machine has a user account that is the same name as a logged in domain user (machineName\bob & domainName\bob) UserDomainName returns the machine name, not the domain name.
Declare Function GetUserNameExA Lib "secur32.dll" (ByVal nameFormat As Integer, _
ByVal userName As System.Text.StringBuilder, ByRef userNameSize As Integer) As Byte
' GetUserNameExA for ANSI
' GetUserNameExW for UNICODE
The Process Tried To Load Dynamically One Or More Functions.
Yara Detected Something
The Process Attempted To Bypass The DEP System By Marking A Part Of The Heap As Executable
The Process Tried To Collect Informations About The System Reading Some Known Registry Keys
ACTION GRAPH
ANALYZE
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).