Hi,
When using pinvoke to get an access control list (ACL) and from that ACL
getting every entry (ACE) I need to get the SID for wich this ACE concerns:
ACE (for allowed access) structure looks like:
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct ACCESS_ALLOWED_ACE
{
public ACE_HEADER Header;
public ACE_ACCESS_MASK Mask;
public int SidStart;
}
The SidStart member should be a pointer (as a DWORD) telling me the address
where the SID starts and is also the first 4 bytes of the SID
MSDN tells me that SidStart is:
The first DWORD of a trustee's SID. The remaining bytes of the SID are
stored in contiguous memory after the SidStart member. This SID can be
appended with application data.
In C++ you would do this to get the SID
SID *sid = (SID *) &ace->Header->SidStart;
How is the above statement done in managed C# ??
I've tried numerous ways, but cannot get a valid SID.
Kr.
Soren
|