Exemplo n.º 1
0
 public void Test(Flagged flags, LoaderOptimization optimization)
 {
     var noFlag   = optimization.HasFlag(LoaderOptimization.MultiDomain); // none-compliant. LoaderOptimization is not a flags enum.
     var hasNone  = flags.HasFlag(Flagged.None);                          //none-compliant, None is not a flag value.
     var hasOther = flags.HasFlag(LoaderOptimization.SingleDomain);       // not-compliant, enum types don't match
     var hasUS    = flags.HasFlag(Flagged.StarSpangledBanner);            // compliant
 }
Exemplo n.º 2
0
        internal AppDomainSetup(AppDomainSetup setup)
        {
            application_base           = setup.application_base;
            application_name           = setup.application_name;
            cache_path                 = setup.cache_path;
            configuration_file         = setup.configuration_file;
            dynamic_base               = setup.dynamic_base;
            license_file               = setup.license_file;
            private_bin_path           = setup.private_bin_path;
            private_bin_path_probe     = setup.private_bin_path_probe;
            shadow_copy_directories    = setup.shadow_copy_directories;
            shadow_copy_files          = setup.shadow_copy_files;
            publisher_policy           = setup.publisher_policy;
            path_changed               = setup.path_changed;
            loader_optimization        = setup.loader_optimization;
            disallow_binding_redirects = setup.disallow_binding_redirects;
            disallow_code_downloads    = setup.disallow_code_downloads;
//#if NET_2_0
            _activationArguments    = setup._activationArguments;
            domain_initializer      = setup.domain_initializer;
            domain_initializer_args = setup.domain_initializer_args;
            application_trust_xml   = setup.application_trust_xml;
            disallow_appbase_probe  = setup.disallow_appbase_probe;
            configuration_bytes     = setup.configuration_bytes;
//#endif
        }
Exemplo n.º 3
0
        internal AppDomainSetup(AppDomainSetup copy)
        {
            string[] mine = Value;
            if(copy != null) {
                string[] other = copy.Value;
                int size = _Entries.Length;
                for(int i = 0; i < size; i++) 
                    mine[i] = other[i];
                _LoaderOptimization = copy._LoaderOptimization;

            }
            else 
                _LoaderOptimization = LoaderOptimization.NotSpecified;

        }
Exemplo n.º 4
0
 internal AppDomainSetup(AppDomainSetup copy)
 {
     string[] mine = Value;
     if (copy != null)
     {
         string[] other = copy.Value;
         int      size  = _Entries.Length;
         for (int i = 0; i < size; i++)
         {
             mine[i] = other[i];
         }
         _LoaderOptimization = copy._LoaderOptimization;
     }
     else
     {
         _LoaderOptimization = LoaderOptimization.NotSpecified;
     }
 }
Exemplo n.º 5
0
        internal AppDomainSetup(AppDomainSetup copy, bool copyDomainBoundData)
        {
            string[] mine = Value;
            if (copy != null)
            {
                string[] other     = copy.Value;
                int      mineSize  = _Entries.Length;
                int      otherSize = other.Length;
                int      size      = (otherSize < mineSize) ? otherSize : mineSize;

                for (int i = 0; i < size; i++)
                {
                    mine[i] = other[i];
                }

                if (size < mineSize)
                {
                    for (int i = size; i < mineSize; i++)
                    {
                        mine[i] = null;
                    }
                }

                _LoaderOptimization = copy._LoaderOptimization;

                _AppDomainInitializerArguments = copy.AppDomainInitializerArguments;
                _ActivationArguments           = copy.ActivationArguments;
                if (copyDomainBoundData)
                {
                    _AppDomainInitializer = copy.AppDomainInitializer;
                }
                else
                {
                    _AppDomainInitializer = null;
                }

                _ConfigurationBytes = copy.GetConfigurationBytes();
            }
            else
            {
                _LoaderOptimization = LoaderOptimization.NotSpecified;
            }
        }
Exemplo n.º 6
0
 internal AppDomainSetup(AppDomainSetup setup)
 {
     this.application_base           = setup.application_base;
     this.application_name           = setup.application_name;
     this.cache_path                 = setup.cache_path;
     this.configuration_file         = setup.configuration_file;
     this.dynamic_base               = setup.dynamic_base;
     this.license_file               = setup.license_file;
     this.private_bin_path           = setup.private_bin_path;
     this.private_bin_path_probe     = setup.private_bin_path_probe;
     this.shadow_copy_directories    = setup.shadow_copy_directories;
     this.shadow_copy_files          = setup.shadow_copy_files;
     this.publisher_policy           = setup.publisher_policy;
     this.path_changed               = setup.path_changed;
     this.loader_optimization        = setup.loader_optimization;
     this.disallow_binding_redirects = setup.disallow_binding_redirects;
     this.disallow_code_downloads    = setup.disallow_code_downloads;
     this._activationArguments       = setup._activationArguments;
     this.domain_initializer         = setup.domain_initializer;
     this.domain_initializer_args    = setup.domain_initializer_args;
     this.application_trust_xml      = setup.application_trust_xml;
     this.disallow_appbase_probe     = setup.disallow_appbase_probe;
     this.configuration_bytes        = setup.configuration_bytes;
 }
Exemplo n.º 7
0
 internal extern void UpdateLoaderOptimization(LoaderOptimization optimization);
Exemplo n.º 8
0
 public LoaderOptimizationAttribute(byte value)
 {
     this.value = (LoaderOptimization)(int)value;
 }
Exemplo n.º 9
0
 // Constructors.
 public LoaderOptimizationAttribute(LoaderOptimization value)
 {
     this.value = value;
 }
Exemplo n.º 10
0
 internal extern void UpdateLoaderOptimization(LoaderOptimization optimization);
Exemplo n.º 11
0
 public AppDomainSetup()
 {
     _LoaderOptimization = LoaderOptimization.NotSpecified;
 }
	// Constructors.
	public LoaderOptimizationAttribute(LoaderOptimization value)
			{
				this.value = value;
			}
Exemplo n.º 13
0
 public LoaderOptimizationAttribute(LoaderOptimization value)
 {
     lo = value;
 }
Exemplo n.º 14
0
 public LoaderOptimizationAttribute(LoaderOptimization value)
 {
     _val = (byte)value;
 }
Exemplo n.º 15
0
       private void SetupLoaderOptimization(LoaderOptimization policy)
        {
            if(policy != LoaderOptimization.NotSpecified) {
#if _DEBUG
                BCLDebug.Assert(FusionStore.LoaderOptimization == LoaderOptimization.NotSpecified,
                                "It is illegal to change the Loader optimization on a domain");
#endif
                FusionStore.LoaderOptimization = policy;
                UpdateLoaderOptimization((int) FusionStore.LoaderOptimization);
            }
        }
Exemplo n.º 16
0
        [System.Security.SecuritySafeCritical]  // auto-generated
        public AppDomainSetup (ActivationArguments activationArguments) {
            if (activationArguments == null)
                throw new ArgumentNullException("activationArguments");
            Contract.EndContractBlock();

            _LoaderOptimization = LoaderOptimization.NotSpecified;
            ActivationArguments = activationArguments;

            Contract.Assert(activationArguments.ActivationContext != null, "Cannot set base directory without activation context");
            string entryPointPath = CmsUtils.GetEntryPointFullPath(activationArguments);
            if (!String.IsNullOrEmpty(entryPointPath))
                SetupDefaults(entryPointPath);
            else
                ApplicationBase = activationArguments.ActivationContext.ApplicationDirectory;

        }
Exemplo n.º 17
0
        internal AppDomainSetup(AppDomainSetup copy, bool copyDomainBoundData)
        {
            string[] mine = Value;
            if(copy != null) {
                string[] other = copy.Value;
                int mineSize = _Entries.Length;
                int otherSize = other.Length;
                int size = (otherSize < mineSize) ? otherSize : mineSize;

                for (int i = 0; i < size; i++)
                    mine[i] = other[i];

                if (size < mineSize)
                {
                    // This case can happen when the copy is a deserialized version of
                    // an AppDomainSetup object serialized by Everett.
                    for (int i = size; i < mineSize; i++)
                        mine[i] = null;
                }

                _LoaderOptimization = copy._LoaderOptimization;

                _AppDomainInitializerArguments = copy.AppDomainInitializerArguments;
#if FEATURE_CLICKONCE
                _ActivationArguments = copy.ActivationArguments;
#endif
                _ApplicationTrust = copy._ApplicationTrust;
                if (copyDomainBoundData)
                    _AppDomainInitializer = copy.AppDomainInitializer;
                else
                    _AppDomainInitializer = null;

                _ConfigurationBytes = copy.GetConfigurationBytes();
#if FEATURE_COMINTEROP
                _DisableInterfaceCache = copy._DisableInterfaceCache;
#endif // FEATURE_COMINTEROP
                _AppDomainManagerAssembly = copy.AppDomainManagerAssembly;
                _AppDomainManagerType = copy.AppDomainManagerType;
#if FEATURE_APTCA
                _AptcaVisibleAssemblies = copy.PartialTrustVisibleAssemblies;
#endif

                if (copy._CompatFlags != null)
                {
                    SetCompatibilitySwitches(copy._CompatFlags.Keys);
                }

#if !FEATURE_CORECLR
                if(copy._AppDomainSortingSetupInfo != null)
                {
                    _AppDomainSortingSetupInfo = new AppDomainSortingSetupInfo(copy._AppDomainSortingSetupInfo);
                }
#endif
                _TargetFrameworkName = copy._TargetFrameworkName;

#if FEATURE_RANDOMIZED_STRING_HASHING
                _UseRandomizedStringHashing = copy._UseRandomizedStringHashing;
#endif

            }
            else 
                _LoaderOptimization = LoaderOptimization.NotSpecified;
        }
        internal AppDomainSetup(AppDomainSetup copy, bool copyDomainBoundData)
        {
            string[] mine = Value;
            if(copy != null) {
                string[] other = copy.Value;
                int mineSize = _Entries.Length;
                int otherSize = other.Length;
                int size = (otherSize < mineSize) ? otherSize : mineSize;

                for (int i = 0; i < size; i++)
                    mine[i] = other[i];

                if (size < mineSize)
                {
                    for (int i = size; i < mineSize; i++)
                        mine[i] = null;
                }

                _LoaderOptimization = copy._LoaderOptimization;

                _AppDomainInitializerArguments = copy.AppDomainInitializerArguments;
                _ActivationArguments = copy.ActivationArguments;
                if (copyDomainBoundData)
                    _AppDomainInitializer = copy.AppDomainInitializer;
                else
                    _AppDomainInitializer = null;

                _ConfigurationBytes = copy.GetConfigurationBytes();
            }
            else 
                _LoaderOptimization = LoaderOptimization.NotSpecified;
        }
	public LoaderOptimizationAttribute(byte value)
			{
				this.value = (LoaderOptimization)(int)value;
			}
		internal AppDomainSetup (AppDomainSetup setup)
		{
			application_base = setup.application_base;
			application_name = setup.application_name;
			cache_path = setup.cache_path;
			configuration_file = setup.configuration_file;
			dynamic_base = setup.dynamic_base;
			license_file = setup.license_file;
			private_bin_path = setup.private_bin_path;
			private_bin_path_probe = setup.private_bin_path_probe;
			shadow_copy_directories = setup.shadow_copy_directories;
			shadow_copy_files = setup.shadow_copy_files;
			publisher_policy = setup.publisher_policy;
			path_changed = setup.path_changed;
			loader_optimization = setup.loader_optimization;
			disallow_binding_redirects = setup.disallow_binding_redirects;
			disallow_code_downloads = setup.disallow_code_downloads;
			_activationArguments = setup._activationArguments;
			domain_initializer = setup.domain_initializer;
			application_trust = setup.application_trust;
			domain_initializer_args = setup.domain_initializer_args;
			disallow_appbase_probe = setup.disallow_appbase_probe;
			configuration_bytes = setup.configuration_bytes;
		}
Exemplo n.º 21
0
 private void SetupLoaderOptimization(LoaderOptimization policy)
 {
     if (policy != LoaderOptimization.NotSpecified)
     {
         this.FusionStore.LoaderOptimization = policy;
         this.UpdateLoaderOptimization((int) this.FusionStore.LoaderOptimization);
     }
 }
 /// <summary>Initializes a new instance of the <see cref="T:System.LoaderOptimizationAttribute" /> class to the specified value.</summary><param name="value">A <see cref="T:System.LoaderOptimization" /> constant. </param>
 public LoaderOptimizationAttribute(LoaderOptimization value)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 23
0
 // Constructors
 public LoaderOptimizationAttribute(byte value)
 {
     lo = (LoaderOptimization)value;
 }
		internal AppDomainSetup(AppDomainSetup copy, bool copyDomainBoundData)
		{
			string[] value = this.Value;
			if (copy != null)
			{
				string[] value2 = copy.Value;
				int num = this._Entries.Length;
				int num2 = value2.Length;
				int num3 = (num2 < num) ? num2 : num;
				for (int i = 0; i < num3; i++)
				{
					value[i] = value2[i];
				}
				if (num3 < num)
				{
					for (int j = num3; j < num; j++)
					{
						value[j] = null;
					}
				}
				this._LoaderOptimization = copy._LoaderOptimization;
				this._AppDomainInitializerArguments = copy.AppDomainInitializerArguments;
				this._ActivationArguments = copy.ActivationArguments;
				this._ApplicationTrust = copy._ApplicationTrust;
				if (copyDomainBoundData)
				{
					this._AppDomainInitializer = copy.AppDomainInitializer;
				}
				else
				{
					this._AppDomainInitializer = null;
				}
				this._ConfigurationBytes = copy.GetConfigurationBytes();
				this._DisableInterfaceCache = copy._DisableInterfaceCache;
				this._AppDomainManagerAssembly = copy.AppDomainManagerAssembly;
				this._AppDomainManagerType = copy.AppDomainManagerType;
				this._AptcaVisibleAssemblies = copy.PartialTrustVisibleAssemblies;
				if (copy._CompatFlags != null)
				{
					this._CompatFlags = new Dictionary<string, object>(copy._CompatFlags);
					return;
				}
			}
			else
			{
				this._LoaderOptimization = LoaderOptimization.NotSpecified;
			}
		}
 public LoaderOptimizationAttribute(LoaderOptimization value)
 {
 }
		public AppDomainSetup()
		{
			this._LoaderOptimization = LoaderOptimization.NotSpecified;
		}
Exemplo n.º 27
0
        internal AppDomainSetup(AppDomainSetup copy, bool copyDomainBoundData)
        {
            string[] mine = Value;
            if (copy != null)
            {
                string[] other     = copy.Value;
                int      mineSize  = _Entries.Length;
                int      otherSize = other.Length;
                int      size      = (otherSize < mineSize) ? otherSize : mineSize;

                for (int i = 0; i < size; i++)
                {
                    mine[i] = other[i];
                }

                if (size < mineSize)
                {
                    // This case can happen when the copy is a deserialized version of
                    // an AppDomainSetup object serialized by Everett.
                    for (int i = size; i < mineSize; i++)
                    {
                        mine[i] = null;
                    }
                }

                _LoaderOptimization = copy._LoaderOptimization;

                _AppDomainInitializerArguments = copy.AppDomainInitializerArguments;
                _ApplicationTrust = copy._ApplicationTrust;

                if (copyDomainBoundData)
                {
                    _AppDomainInitializer = copy.AppDomainInitializer;
                }
                else
                {
                    _AppDomainInitializer = null;
                }

                _ConfigurationBytes = copy.GetConfigurationBytes();
#if FEATURE_COMINTEROP
                _DisableInterfaceCache = copy._DisableInterfaceCache;
#endif // FEATURE_COMINTEROP
                _AppDomainManagerAssembly = copy.AppDomainManagerAssembly;
                _AppDomainManagerType     = copy.AppDomainManagerType;

                if (copy._CompatFlags != null)
                {
                    SetCompatibilitySwitches(copy._CompatFlags.Keys);
                }

                _TargetFrameworkName = copy._TargetFrameworkName;

#if FEATURE_RANDOMIZED_STRING_HASHING
                _UseRandomizedStringHashing = copy._UseRandomizedStringHashing;
#endif
            }
            else
            {
                _LoaderOptimization = LoaderOptimization.NotSpecified;
            }
        }
		public AppDomainSetup(ActivationArguments activationArguments)
		{
			if (activationArguments == null)
			{
				throw new ArgumentNullException("activationArguments");
			}
			this._LoaderOptimization = LoaderOptimization.NotSpecified;
			this.ActivationArguments = activationArguments;
			string entryPointFullPath = CmsUtils.GetEntryPointFullPath(activationArguments);
			if (!string.IsNullOrEmpty(entryPointFullPath))
			{
				this.SetupDefaults(entryPointFullPath);
				return;
			}
			this.ApplicationBase = activationArguments.ActivationContext.ApplicationDirectory;
		}
Exemplo n.º 29
0
       [System.Security.SecurityCritical]  // auto-generated
       private void SetupLoaderOptimization(LoaderOptimization policy)
        {
            if(policy != LoaderOptimization.NotSpecified) {
                Contract.Assert(FusionStore.LoaderOptimization == LoaderOptimization.NotSpecified,
                                "It is illegal to change the Loader optimization on a domain");

                FusionStore.LoaderOptimization = policy;
                UpdateLoaderOptimization(FusionStore.LoaderOptimization);
            }
        }
Exemplo n.º 30
0
		// Constructors
		public LoaderOptimizationAttribute (byte value)
		{
			lo = (LoaderOptimization) value;
		}
Exemplo n.º 31
0
 /// <include file='doc\AppDomainAttributes.uex' path='docs/doc[@for="LoaderOptimizationAttribute.LoaderOptimizationAttribute1"]/*' />
 public LoaderOptimizationAttribute(LoaderOptimization value)
 {
     _val = (byte) value;
 }
Exemplo n.º 32
0
        } // InternalSetupRemoteDomain

        // This routine is called from unmanaged code to 
        // set the default fusion context.
        private void SetupDomain(LoaderOptimization policy)
        {
            // It is possible that we could have multple threads initializing
            // the default domain. We will just take the winner of these two.
            // (eg. one thread doing a com call and another doing attach for IJW)
            if(_FusionStore == null) {
                lock (this) {
                    if(_FusionStore == null) {
                        SetupFusionStore(new AppDomainSetup());
                    }
                }
            }

            if(policy != LoaderOptimization.NotSpecified) {
#if _DEBUG
                BCLDebug.Assert(FusionStore.LoaderOptimization == LoaderOptimization.NotSpecified,
                                "It is illegal to change the Loader optimization on a domain");
#endif
                FusionStore.LoaderOptimization = policy;
                UpdateLoaderOptimization((int) FusionStore.LoaderOptimization);
            }
        }