Esempio n. 1
0
        public static IntPtr AllocateAndInitializeSid()
        {
            SID_IDENTIFIER_AUTHORITY pIdentifierAuthority = new SID_IDENTIFIER_AUTHORITY
            {
                Value = new byte[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x10 }
            };
            byte   nSubAuthorityCount = 1;
            IntPtr pSid = new IntPtr();

            if (!Natives.AllocateAndInitializeSid(ref pIdentifierAuthority, nSubAuthorityCount, 0x2000, 0, 0, 0, 0, 0, 0, 0, out pSid))
            {
                return(IntPtr.Zero);
            }
            return(pSid);
        }