コード例 #1
0
		public AccessControlEntry(SecurityIdentifier trustee, AccessControlEntryType aceType, AccessMask accessMask)
		{
			// parameters validation
			if (trustee == null)
				throw new ArgumentNullException("trustee");

			_aceType = aceType;
			_aceFlags = AccessControlEntryFlags.Normal;
			_accessMask = accessMask;
			Trustee = trustee;
		}
コード例 #2
0
        public AccessControlEntry(SecurityIdentifier trustee, AccessControlEntryType aceType, AccessMask accessMask)
        {
            // parameters validation
            if (trustee == null)
            {
                throw new ArgumentNullException("trustee");
            }

            _aceType    = aceType;
            _aceFlags   = AccessControlEntryFlags.Normal;
            _accessMask = accessMask;
            Trustee     = trustee;
        }
コード例 #3
0
		internal AccessControlEntry(IntPtr pAce)
		{
			// parameters validation
			if (pAce == IntPtr.Zero)
				throw new ArgumentNullException("pAce");

			// read ACE properties
			_aceType = (AccessControlEntryType)MarshalHelper.ReadByte(pAce, typeof(SecurityNative.ACE), "AceType");
			_aceFlags = (AccessControlEntryFlags)MarshalHelper.ReadByte(pAce, typeof(SecurityNative.ACE), "AceFlags");
			_accessMask = (AccessMask)MarshalHelper.ReadInt32(pAce, typeof(SecurityNative.ACE), "AccessMask");

			// read SID
			IntPtr pSid = IntPtrHelper.Add(pAce, Marshal.OffsetOf(typeof(SecurityNative.ACE), "SidStart"));
			Trustee = new SecurityIdentifier(pSid, true);
		}
コード例 #4
0
        internal AccessControlEntry(IntPtr pAce)
        {
            // parameters validation
            if (pAce == IntPtr.Zero)
            {
                throw new ArgumentNullException("pAce");
            }

            // read ACE properties
            _aceType    = (AccessControlEntryType)MarshalHelper.ReadByte(pAce, typeof(SecurityNative.ACE), "AceType");
            _aceFlags   = (AccessControlEntryFlags)MarshalHelper.ReadByte(pAce, typeof(SecurityNative.ACE), "AceFlags");
            _accessMask = (AccessMask)MarshalHelper.ReadInt32(pAce, typeof(SecurityNative.ACE), "AccessMask");

            // read SID
            IntPtr pSid = IntPtrHelper.Add(pAce, Marshal.OffsetOf(typeof(SecurityNative.ACE), "SidStart"));

            Trustee = new SecurityIdentifier(pSid, true);
        }