GetUserName function advapi32
Retrieves the name of the user associated with the current thread.
To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-getusernamew.
Implementation
Win32Result<bool> GetUserName(PWSTR? lpBuffer, Pointer<Uint32> pcbBuffer) {
final result_ = GetUserNameW_Wrapper(lpBuffer ?? nullptr, pcbBuffer);
return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}