So I am trying to manipulate several pinvoke functions right now and I can't figure out where I find the values for each flag in SECURITY_INFORMATION at?
Here is the link
I have already visited the PInvoke site and its definition of SECURITY_INFORMATION seems to be incorrect. Here
The reason I think it is incorrect is because I am throwing the following error when I try to call ConvertSecurityDescriptorToStringSecurityDescriptor method.
A call to PInvoke function 'ConvertSecurityDescriptorToStringSecurityDescriptor'
has unbalanced the stack. This is likely because the managed PInvoke signature
does not match the unmanaged target signature. Check that the calling
convention and parameters of the PInvoke signature match the target
unmanaged signature.
But again I am interested in figuring out how to find the Hexadecimal values of each flag listed in the MSDN article I supplied. Its as if people just magically generate the values and they are correct even though there is no sign of them anywhere documented in that article.
EDIT 1
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool ConvertSecurityDescriptorToStringSecurityDescriptor(IntPtr SecurityDescriptor,
uint RequestedStringSDRevision,
SECURITY_INFORMATION SecurityInformation,
out IntPtr StringSecurityDescriptor,
out int StringSecurityDescriptorLen);
[Flags]
public enum SECURITY_INFORMATION {
OWNER_SECURITY_INFORMATION = 0x00000001,
GROUP_SECURITY_INFORMATION = 0x00000002,
DACL_SECURITY_INFORMATION = 0x00000004,
SACL_SECURITY_INFORMATION = 0x00000008,
UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000,
UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000,
PROTECTED_SACL_SECURITY_INFORMATION = 0x40000000
}