Maybe the below articles from Microsft might help you with the answers you are searching for in the process involved in the Access Control Lists and Getting Information from an ACL.
Access Control Lists
https://learn.microsoft.com/en-us/windows/win32/secauthz/access-control-lists
Getting Information from an ACL
https://learn.microsoft.com/en-us/windows/win32/secauthz/getting-information-from-an-acl
Hope this resolves your Query!!
--
--If the reply is helpful, please Upvote and Accept it as an answer–