Esempio n. 1
0
        internal static SecurityDescriptor FromSddl(string sddl)
        {
            SecurityDescriptor desc;
            int size;

            if (!SecurityDescriptorNativeMethods.ConvertStringSecurityDescriptorToSecurityDescriptor(sddl, SDDL_REVISION_1, out desc, out size))
            {
                throw new Win32Exception();
            }

            return(desc);
        }
Esempio n. 2
0
        internal bool CheckAccess(IntPtr clientToken, int desiredAccess, SecurityDescriptorNativeMethods.GENERIC_MAPPING genericMapping)
        {
            SecurityDescriptorNativeMethods.PRIVILEGE_SET privilege = new SecurityDescriptorNativeMethods.PRIVILEGE_SET();
            int  privilegeSize = SecurityDescriptorNativeMethods.PRIVILEGE_SET.Size;
            int  grantedAccess;
            bool result;

            if (!SecurityDescriptorNativeMethods.AccessCheck(this, clientToken, desiredAccess, genericMapping, privilege, ref privilegeSize, out grantedAccess, out result))
            {
                throw new Win32Exception();
            }

            return(result);
        }
Esempio n. 3
0
 protected override bool ReleaseHandle()
 {
     SecurityDescriptorNativeMethods.LocalFree(this.handle);
     return(true);
 }