I'm toying with code from here that uses RawSecurityDescriptor
class to read a security descriptor from Windows registry, alter it and then store the altered descriptor back. That's basically the same as what "dcomperm" Microsoft SDK sample does.
Yet "dcomperm" sample does two conversions - once the descriptor is read from the registry it is converted from "selt-relative" to "absolute" using MakeAbsoluteSD()
and then altered in that form and once the alteration is complete it is converted back to "self-relative" using MakeSelfRelativeSD()
and stored in "self-relative" form.
In the code I link to there're no such conversions.
How are they done in C#? Are they done internally by the .NET framework or do I have to do them on my own with P/Invoke?