MySQL 9.0.0
Source Code Documentation
Sid Class Reference

Sid class. More...

#include <common.h>

Public Member Functions

 Sid (const wchar_t *)
 Sid class. More...
 
 Sid (HANDLE sec_token)
 Create Sid object corresponding to a given security token. More...
 
 ~Sid ()
 
bool is_valid (void) const
 Check if Sid object is valid. More...
 
bool is_group (void) const
 
bool is_user (void) const
 
bool operator== (const Sid &) const
 
 operator PSID () const
 
const char * as_string ()
 Produces string representation of the SID. More...
 

Private Attributes

TOKEN_USER * m_data
 Pointer to structure holding identifier's data. More...
 
SID_NAME_USE m_type
 Type of identified entity. More...
 
char * m_as_string
 Cached string representation of the SID. More...
 

Detailed Description

Sid class.

Class for storing and manipulating Windows security identifiers (SIDs).

Constructor & Destructor Documentation

◆ Sid() [1/2]

Sid::Sid ( const wchar_t *  account_name)
explicit

Sid class.

Create Sid object corresponding to a given account name.

Parameters
[in]account_namename of a Windows account

The account name can be in any form accepted by LookupAccountName() function.

Note
In case of errors created object is invalid and its is_valid() method returns false.

◆ Sid() [2/2]

Sid::Sid ( HANDLE  token)
explicit

Create Sid object corresponding to a given security token.

Parameters
[in]tokensecurity token of a Windows account
Note
In case of errors created object is invalid and its is_valid() method returns false.

◆ ~Sid()

Sid::~Sid ( )

Member Function Documentation

◆ as_string()

const char * Sid::as_string ( )

Produces string representation of the SID.

Returns
String representation of the SID or nullptr in case of errors.
Note
Memory allocated for the string is automatically freed in Sid's destructor.

◆ is_group()

bool Sid::is_group ( void  ) const
inline

◆ is_user()

bool Sid::is_user ( void  ) const
inline

◆ is_valid()

bool Sid::is_valid ( void  ) const

Check if Sid object is valid.

◆ operator PSID()

Sid::operator PSID ( ) const
inline

◆ operator==()

bool Sid::operator== ( const Sid other) const

Member Data Documentation

◆ m_as_string

char* Sid::m_as_string
private

Cached string representation of the SID.

◆ m_data

TOKEN_USER* Sid::m_data
private

Pointer to structure holding identifier's data.

◆ m_type

SID_NAME_USE Sid::m_type
private

Type of identified entity.


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