This documentation is archived and is not being maintained.


Call this function to set the system access-control list (SACL) information of a specified object.

inline bool AtlSetSacl(
   HANDLE hObject,
   SE_OBJECT_TYPE ObjectType,
   const CSacl& rSacl,
   DWORD dwInheritanceFlowControl = 0,
   bool bRequestNeededPrivileges = true
) throw(...);



Handle to the object for which to set security information.


Specifies a value from the SE_OBJECT_TYPE enumeration that indicates the type of object identified by the hObject parameter.


The SACL containing the new security information.


The inheritance flow control. This value can be 0 (the default), PROTECTED_SACL_SECURITY_INFORMATION or UNPROTECTED_SACL_SECURITY_INFORMATION.


If true, the function will attempt to enable the SE_SECURITY_NAME privilege, and restore it on completion.

Returns true on success, false on failure.

In debug builds, an assertion error will occur if hObject is invalid, or if dwInheritanceFlowControl is not one of the three permitted values.

If AtlSetSacl is to be called many times on many different objects, it will be more efficient to enable the SE_SECURITY_NAME privilege once before calling the function, with bRequestNeededPrivileges set to false.