Platform SDK: Access Control |
The LookupSecurityDescriptorParts function retrieves security information from a self-relative security descriptor.
DWORD LookupSecurityDescriptorParts( PTRUSTEE *pOwner, // owner SID from SD PTRUSTEE *pGroup, // group SID from SD PULONG cCountOfAccessEntries, // number of access-control entries PEXPLICIT_ACCESS *pListOfAccessEntries, // DACL access-control array PULONG cCountOfAuditEntries, // number of audit-control entries PEXPLICIT_ACCESS *pListOfAuditEntries, // SACL audit-control array PSECURITY_DESCRIPTOR pSD // self-relative SD );
This parameter can be NULL if you are not interested in the name of the owner.
This parameter can be NULL if you are not interested in the name of the group.
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a nonzero error code defined in WINERROR.H.
The LookupSecurityDescriptorParts function retrieves the names of the owner and primary group of the security descriptor. It also returns descriptions of the access-control entries in the DACL and audit-control entries in the SACL of the security descriptor.
The parameters other than pSD can be NULL if you are not interested in the information. If you do not want information about the DACL, both pListOfAccessEntries and cCountOfAccessEntries must be NULL. If you do not want information about the SACL, both pListOfAuditEntries and cCountOfAuditEntries must be NULL. Similarly, if you do want DACL or SACL information, both of the corresponding parameters must be non-NULL.
You must call the LocalFree function to free any buffers returned by the pOwner, pGroup, pListOfAccessEntries, or pListOfAuditEntries parameters.
The LookupSecurityDescriptorParts function is intended for trusted servers that implement or expose security on their own objects. The function works with a self-relative security descriptor suitable for serializing into a stream and storing to disk, as a trusted server might require.
Windows NT/2000: Requires Windows NT 4.0 or later.
Header: Declared in Aclapi.h.
Library: Use Advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Client/Server Access Control Overview, Client/Server Access Control Functions, ACE, ACL, EXPLICIT_ACCESS, LocalFree, SECURITY_DESCRIPTOR, GetExplicitEntriesFromAcl, SID, TRUSTEE