SetSecurityDescriptorOwner

  BOOL SetSecurityDescriptorOwner(SecurityDescriptor, Owner, OwnerDefaulted)    
  PSECURITY_DESCRIPTOR SecurityDescriptor;    
  PSID Owner;    
  BOOL OwnerDefaulted;    

The SetSecurityDescriptorOwner function sets an absolute format security descriptor's owner. The function replaces any owner information already present in the security descriptor.

Parameters

SecurityDescriptor

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

Owner

Pointer to an SID data structure that specifies the owner for the security descriptor. The SID is referenced by, not copied into, the security descriptor. This parameter is optional; if it is NULL, then the security descriptor's owner information is cleared, indicating that the security descriptor has no owner.

OwnerDefaulted

Specifies, if TRUE, that the owner was picked up from some default mechanism; if FALSE, that the owner was explicitly specified by a user. The function will store this value into the security descriptor's OwnerDefaulted control flag. This parameter is optional; if it is not passed, the OwnerDefaulted 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, IsValidSecurityDescriptor, SetSecurityDescriptorDacl, SetSecurityDescriptorGroup, SetSecurityDescriptorSacl