The RtlSetOwnerSecurityDescriptor routine sets the owner information of an absolute-format security descriptor. It replaces any owner information that is already present in the security descriptor.
NTSYSAPI NTSTATUS RtlSetOwnerSecurityDescriptor( PSECURITY_DESCRIPTOR SecurityDescriptor, PSID Owner, BOOLEAN OwnerDefaulted );
Pointer to the SECURITY_DESCRIPTOR structure whose owner is to be set. RtlSetOwnerSecurityDescriptor replaces any existing owner with the new owner.
Pointer to a security identifier (SID) structure for the security descriptor's new primary owner. This pointer, not the SID structure itself, is copied into the security descriptor. If this parameter is NULL, RtlSetOwnerSecurityDescriptor clears the security descriptor's owner information. This marks the security descriptor as having no owner.
Set to TRUE if the owner information is derived from a default mechanism. If this value is TRUE, it is default information. RtlSetOwnerSecurityDescriptor sets the SE_OWNER_DEFAULTED flag in the security descriptor's SECURITY_DESCRIPTOR_CONTROL field. If this parameter is FALSE, the SE_OWNER_DEFAULTED flag is cleared.
RtlSetOwnerSecurityDescriptor can return one of the following status codes:
||The owner was successfully set or reset.|
||The given security descriptor's version is not recognized by this routine.|
||The given security descriptor is not a valid absolute security descriptor.|
For more information about security and access control, see the documentation on these topics in the Microsoft Windows SDK.
|Header||ntifs.h (include Ntifs.h)|
|DLL||NtosKrnl.exe (kernel mode); Ntdll.dll (user mode)|