Esempio n. 1
0
        public void SetNamedSecurityInfo(
            string objectName,
            SE_OBJECT_TYPE objectType,
            SECURITY_INFORMATION securityInfo)
        {
            Sid  ownerSid = (((securityInfo & SECURITY_INFORMATION.OWNER_SECURITY_INFORMATION) == 0) ? null : this.Owner);
            Sid  groupSid = (((securityInfo & SECURITY_INFORMATION.GROUP_SECURITY_INFORMATION) == 0) ? null : this.Group);
            Dacl dacl     = (((securityInfo & SECURITY_INFORMATION.DACL_SECURITY_INFORMATION) == 0) ? null : this.Dacl);
            Sacl sacl     = (((securityInfo & SECURITY_INFORMATION.SACL_SECURITY_INFORMATION) == 0) ? null : this.Sacl);

            Win32Helpers.SetNamedSecurityInfo(objectName, objectType, securityInfo,
                                              ownerSid, groupSid, dacl, sacl);
        }
Esempio n. 2
0
        public static SecurityDescriptor GetNamedSecurityInfo(
            string objectName,
            SE_OBJECT_TYPE objectType,
            SECURITY_INFORMATION securityInfo)
        {
            Sid  sidOwner;
            Sid  sidGroup;
            Dacl dacl;
            Sacl sacl;
            SecurityDescriptor secDesc;

            Win32Helpers.GetNamedSecurityInfo(objectName, objectType, securityInfo,
                                              out sidOwner, out sidGroup, out dacl, out sacl, out secDesc);

            return(secDesc);
        }