MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / UserName

Method UserName

WinSysCore/Sid.cpp:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40std::wstring Sid::UserName(PSID_NAME_USE use) const {
41 WCHAR name[64], domain[64];
42 DWORD lname = _countof(name), ldomain = _countof(domain);
43 std::wstring userName;
44 SID_NAME_USE dummy;
45 if (use == nullptr)
46 use = &dummy;
47 if (::LookupAccountSid(nullptr, (PSID)_buffer, name, &lname,domain, &ldomain, use))
48 return std::wstring(domain) + L"\\" + name;
49 return L"";
50}

Callers 3

InitProcessMethod · 0.80
ParseTableEntryMethod · 0.80
EnumGroupsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected