RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::Security::Principal::WindowsIdentity Class Reference

Represents a Windows user More...

Public Member Functions

PISID GetUser ()
 Gets the security identifier (SID) for the user More...
 
 RLIB_PROPERTY_GET (PISID User, GetUser)
 Gets the security identifier (SID) for the user More...
 

Static Public Member Functions

static WindowsIdentityGetCurrent ()
 Returns a WindowsIdentity object that represents the current Windows user More...
 
static WindowsIdentityGetCurrent (bool ifImpersonating)
 Returns a WindowsIdentity object that represents the Windows identity for either the thread or the process, depending on the value of the ifImpersonating parameter More...
 
static String GetCurrentUser ()
 wmic useraccount get name, sid rrrfff S-1-5-21-2532220216-1092076848-2747801457-1001 More...
 

Public Attributes

 RLIB_DECLARE_DYNCREATE
 
TOKEN_USER m_user
 
TOKEN_USER user
 
DWORD authority [7]
 
struct {
   TOKEN_USER   user
 
   DWORD   authority [7]
 
m_data
 

Protected Member Functions

 WindowsIdentity (HANDLE token)
 

Protected Attributes

union {
   TOKEN_USER   m_user
 
   struct {
      TOKEN_USER   user
 
      DWORD   authority [7]
 
   }   m_data
 
}; 
 

Detailed Description

Represents a Windows user

Member Function Documentation

WindowsIdentity * WindowsIdentity::GetCurrent ( )
static

Returns a WindowsIdentity object that represents the current Windows user

WindowsIdentity * WindowsIdentity::GetCurrent ( bool  ifImpersonating)
static

Returns a WindowsIdentity object that represents the Windows identity for either the thread or the process, depending on the value of the ifImpersonating parameter

Parameters
ifImpersonatingtrue to return the WindowsIdentity only if the thread is currently impersonating; false to return the WindowsIdentity of the thread if it is impersonating or the WindowsIdentity of the process if the thread is not currently impersonating
Returns
If ifImpersonating is true and the thread is not impersonating, the returned WindowsIdentity object is nullptr.If ifImpersonating is false and the thread is impersonating, the WindowsIdentity for the thread is returned.If ifImpersonating is false and the thread is not impersonating, the WindowsIdentity for the process is returned
String WindowsIdentity::GetCurrentUser ( )
static

wmic useraccount get name, sid rrrfff S-1-5-21-2532220216-1092076848-2747801457-1001

PISID WindowsIdentity::GetUser ( )

Gets the security identifier (SID) for the user

System::Security::Principal::WindowsIdentity::RLIB_PROPERTY_GET ( PISID  User,
GetUser   
)

Gets the security identifier (SID) for the user


The documentation for this class was generated from the following files: