The SECURITY_DESCRIPTOR structure contains the security information of an object. This information includes the object's owner, a Discretionary Access Control List (DACL), and a System Access Control List (SACL).
Use this structure to retrieve or set the security descriptor for securable objects.
typedef struct _SECURITY_DESCRIPTOR {
DWORD Revision;
LPSTR Owner;
LPSTR Group;
PACL Sacl;
PACL Dacl;
} SECURITY_DESCRIPTOR, *PSECURITY_DESCRIPTOR;
A security descriptor can be created in self-relative format or absolute format. The IsValidSecurityDescriptor function can be used to determine if the security descriptor is valid.
When working with security descriptors, it is important to manage memory correctly. Functions like InitializeSecurityDescriptor, SetSecurityDescriptorOwner, SetSecurityDescriptorDacl, and FreeSid are commonly used.
Access Control, Security Descriptors