chsvlib
chsv helper source code

◆ CreateAccessAllowedACE() [1/2]

AutoAccessAllowedACE Chusov::Win32::Security::CreateAccessAllowedACE ( const ACCESS_ALLOWED_ACE_INFO ace_info)

A wrap over the CreateACE(const ACE_INFO<ACCESS_ALLOWED_ACE_TYPE>&) function creating an access access-allowed control entry (ACE) to be used in a discretionary access control list, from a high-level definition of the ACE. .

Parameters
[in]ace_infois a reference to an object of the ACCESS_ALLOWED_ACE_INFO structure type, specifying a high-level definition of the created ACE by a fully or partially qualified principal name and a combination (bit mask) of Windows API access control values. See ACE_INFO definition for more detailed explanation.
Returns
The function returns a smart AutoAccessAllowedACE pointer to the created ACE of the ACCESS_ALLOWED_ACE type. The returned value points to data of this type with the SID, partially occupying a space that contiguously follows the fields described by the structure.
Exceptions
std::bad_allocCould not allocate a sufficient amount of memory to complete the request.
Chusov::Exceptions::InvalidParameterExceptionA parameter has an invalid value.
Chusov::Exceptions::ChsvCodeExceptiona system-level error occurred. If an invalid SID was specified, the function throws an exception corresponding to the ERROR_INVALID_SID Windows error code.
See also
CreateAccessDeniedACE - a counterpart for access-denied ACEs;
CreateACE - a function template creating an ACE of type that depends upon a template parameter;
CreateAccessAllowedACE - an overload creating an access-allowed ACE from a SID and an access-control mask.