Platform SDK: Access Control

ISecurityInformation::SetSecurity

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 the Okay or Apply buttons.

HRESULT SetSecurity(
  SECURITY_INFORMATION SecurityInformation,
  PSECURITY_DESCRIPTOR pSecurityDescriptor
);

Parameters

SecurityInformation
[in] 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 If this flag is set, the security descriptor contains the SID of the object's owner.
GROUP_SECURITY_INFORMATION If this flag is set, the security descriptor contains the SID of the object's primary group.
DACL_SECURITY_INFORMATION If this flag is set, the security descriptor contains the object's DACL.
SACL_SECURITY_INFORMATION If this flag is set, the security descriptor contains the object's SACL.

pSecurityDescriptor
[in] Pointer to a security descriptor containing the new security information. Do not assume the security descriptor is in self-relative form; it may be either absolute or self-relative.

Return Values

Return S_OK if successful.

Return 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

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Aclui.h.

See Also

Access Control Editor Overview, Access Control Editor Interfaces, SECURITY_INFORMATION