chsvlib
chsv helper source code

◆ GetWellKnownSid() [9/9]

AutoSID Chusov::Win32::Security::GetWellKnownSid ( WELL_KNOWN_SID_TYPE  type,
PSID  pDomainSid = NULL 
)

Creates a well-known Windows security-identifier, possibly with a relation to the specified domain, and with respect to the values of the WELL_KNOWN_SID_TYPE enumeration.

Parameters
typeis a value of the WELL_KNOWN_SID_TYPE enumeration which specifies what the created SID will identify.
pDomainSidis an optional pointer to a SID identifying the domain of the created SID. The default value of NULL causes creation of the SID defined for the local computer.
Returns
A managed pointer of the AutoSID type to the created security identifier. In case of error the function throws corresponding exception as defined by the Chusov::Win32::Exceptions::ChsvExceptionByWin32Code function.
Note
The function is a wrapper over Windows API CreateWellKnownSid function.