chsvlib
chsv helper source code

◆ GetTokenUserName()

std::basic_string<wchar_t, traits_t, alloc_t> Chusov::Win32::Security::GetTokenUserName ( HANDLE  hToken)

Returns a name of a principal described by the specified token.

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]hTokenis a handle of a token describing a principal of the name to be retrieved.
Returns
Returns an std::basic_string object with a name of a principal described by the specified token.

Example code:

using namespace Chusov::Win32::Security;
std::wstring MyName()
{
}
std::basic_string< wchar_t, std::char_traits< wchar_t >, ::Chusov::Memory::allocator< wchar_t > > wstring
An instantiation of the standard basic_string class template for handling wide strings allocated and ...
Definition: chsvstringex.h:133
AutoToken GetCurrentImpersonationToken()
Returns a handle to an impersonation token of the calling thread. If the thread does not have one,...
Definition: chsvwinutilex.h:607
std::basic_string< wchar_t, traits_t, alloc_t > GetTokenUserName(HANDLE hToken)
Returns a name of a principal described by the specified token.
Definition: chsvwinutilex.h:801
A namespace containing mechanisms simplifying working with Windows security APIs, such as security de...
Definition: chsvwinutilex.h:447