Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetUserName()

static void System.Environment.GetUserName ( ref ValueStringBuilder builder)
inlinestaticprivate

Definition at line 636 of file Environment.cs.

637 {
638 uint lpnSize = 0u;
639 while (Interop.Secur32.GetUserNameExW(2, ref builder.GetPinnableReference(), ref lpnSize) == Interop.BOOLEAN.FALSE)
640 {
641 if (Marshal.GetLastPInvokeError() == 234)
642 {
643 builder.EnsureCapacity(checked((int)lpnSize));
644 continue;
645 }
646 builder.Length = 0;
647 return;
648 }
649 builder.Length = (int)lpnSize;
650 }
static BOOLEAN GetUserNameExW(int NameFormat, ref char lpNameBuffer, ref uint lpnSize)

References System.Runtime.InteropServices.Marshal.GetLastPInvokeError(), and Interop.Secur32.GetUserNameExW().