ISecurityInformation::SetSecurity method (aclui.h)

The SetSecurity method provides a security descriptor containing the security information the user wants to apply to the securable object. The access control editor calls this method when the user clicks Okay or Apply.

Syntax

HRESULT SetSecurity(
  [in] SECURITY_INFORMATION SecurityInformation,
  [in] PSECURITY_DESCRIPTOR pSecurityDescriptor
);

Parameters

[in] SecurityInformation

A set of SECURITY_INFORMATION bit flags that indicate the parts of the security descriptor to set. This parameter can be a combination of the following values.

Value Meaning
OWNER_SECURITY_INFORMATION
The security descriptor contains the SID of the object's owner.
GROUP_SECURITY_INFORMATION
The security descriptor contains the SID of the object's primary group.
DACL_SECURITY_INFORMATION
The security descriptor contains the object's DACL.
SACL_SECURITY_INFORMATION
The security descriptor contains the object's SACL.

[in] pSecurityDescriptor

A pointer to a security descriptor containing the new security information. Do not assume the security descriptor is in self-relative form; it can be either absolute or self-relative.

Return value

Returns S_OK if successful.

Returns a nonzero error code if an error occurs.

Remarks

To build a complete security descriptor for the object, the application must merge the new security descriptor parts, as defined by the SecurityInformation parameter, into the object's existing security descriptor.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header aclui.h

See also

Access Control Editor

Access Control Editor Functions

ISecurityInformation

SECURITY_INFORMATION