chsvlib
chsv helper source code

◆ GetNameByPrincipalSid()

std::basic_string<wchar_t, traits_t, alloc_t> Chusov::Win32::Security::GetNameByPrincipalSid ( PSID  pPrincipalSid)

Returns a string describing domain and user names which correspond to the specified security identifier.

Template Parameters
traits_tis a type implementing character traits class of the returned wide string. The default value of the template parameter is std::char_traits<wchar_t>.
alloc_tis a type of an allocator used by the returned string object. The default template argument is the default allocator instantiated for the wide character type - std::allocator<wchar_t>.
Parameters
[in]pPrincipalSidis a pointer to a SID to be resolved to a wide string representation of the principal name and a name of a domain the principal belongs to.
Returns
Returns an std::basic_string object holding a wide string with a domain name and a user name corresponding the the specified security identifier, in the format "\\domain_name\user_name".
Exceptions
Chusov::Exceptions::ChsvCodeExceptionSystem-level error occurred.
Examples
chsvwinutilex\CreateDACL.cpp.