SetSecurityDescriptorGroup

  BOOL SetSecurityDescriptorGroup(SecurityDescriptor, Group, GroupDefaulted)    
  PSECURITY_DESCRIPTOR SecurityDescriptor;    
  PSID Group;    
  BOOL GroupDefaulted;    

The SetSecurityDescriptorGroup function sets the primary group information of an absolute format security descriptor. If there is already a primary group present in the security descriptor, it is replaced.

Parameters

SecurityDescriptor

Pointer to the SECURITY_DESCRIPTOR data structure whose primary group the function will set. The function will replace any existing primary group with the new primary group.

Group

Pointer to an SID data structure that the function will set as the security descriptor's primary group. The SID is referenced by, not copied into, the security descriptor. This parameter may be NULL. In that case, the function clears the security descriptor's primary group information, thus marking the security descriptor as having no primary group.

GroupDefaulted

Specifies, if TRUE, that the group was picked up from some default mechanism; if FALSE, that the group was explicitly specified by a user. The function will store this value into the security descriptor's GroupDefaulted control flag. This parameter is optional; if it is not passed, the GroupDefaulted flag will be cleared.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

See Also

GetSecurityDescriptorGroup, GetSecurityDescriptorControl, GetSecurityDescriptorDacl, GetSecurityDescriptorLength, GetSecurityDescriptorOwner, GetSecurityDescriptorSacl, InitializeSecurityDescriptor, SetSecurityDescriptorDacl, SetSecurityDescriptorOwner, SetSecurityDescriptorSacl