I’m searching for the solution for hours, but the documentation being sparse, I’m unable to find what I need.
If I have a file or a directory, how can I, in C# with P/Invoke, duplicate the permissions (ie. the owner and SIDs with their permissions) from one file to another or from one directory to another, assuming that those files and directories are either on the same machine or the network controlled by the same Active Directory server?
Here’s an example using GetNamedSecurityInfo and
SetNamedSecurityInfo.