object IDynamicParameters.GetDynamicParameters()
        {
            _dict = new RuntimeDefinedParameterDictionary();
            Type access_type = GetNtType()?.AccessRightsType ?? typeof(GenericAccessRights);

            _dict.AddDynamicParameter("Access", access_type, false);
            return(_dict);
        }
        object IDynamicParameters.GetDynamicParameters()
        {
            _dict = new RuntimeDefinedParameterDictionary();
            Type access_type = GetNtType()?.AccessRightsType ?? typeof(GenericAccessRights);

            _dict.AddDynamicParameter("Access", access_type, false);

            if (Audit)
            {
                _dict.AddDynamicParameter("SubsystemName", typeof(string), true);
                _dict.AddDynamicParameter("HandleId", typeof(IntPtr), false);
                _dict.AddDynamicParameter("ObjectTypeName", typeof(string), true);
                _dict.AddDynamicParameter("ObjectName", typeof(string), true);
                _dict.AddDynamicParameter("ObjectCreation", typeof(SwitchParameter), false);
                _dict.AddDynamicParameter("AuditType", typeof(AuditEventType), false);
                _dict.AddDynamicParameter("AuditFlags", typeof(AuditAccessCheckFlags), false);
            }

            return(_dict);
        }
        object IDynamicParameters.GetDynamicParameters()
        {
            bool access_mandatory = !RawAccess.HasValue;

            _dict = new RuntimeDefinedParameterDictionary();
            if (NtSecurity.IsCallbackAceType(Type) || Type == AceType.AccessFilter)
            {
                _dict.AddDynamicParameter("Condition", typeof(string), false);
            }

            if (NtSecurity.IsObjectAceType(Type))
            {
                _dict.AddDynamicParameter("ObjectType", typeof(Guid?), false);
                _dict.AddDynamicParameter("InheritedObjectType", typeof(Guid?), false);
            }

            if (Type == AceType.AllowedCompound)
            {
                _dict.AddDynamicParameter("ServerSid", typeof(Sid), true);
            }

            if (Type == AceType.ResourceAttribute)
            {
                _dict.AddDynamicParameter("SecurityAttribute", typeof(ClaimSecurityAttribute), true);
                access_mandatory = false;
            }

            Type access_type = SecurityDescriptor?.AccessRightsType ?? typeof(GenericAccessRights);

            if (Type == AceType.MandatoryLabel)
            {
                access_type = typeof(MandatoryLabelPolicy);
            }
            _dict.AddDynamicParameter("Access", access_type, access_mandatory, 2);

            return(_dict);
        }