diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-05-06 11:03:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-06 11:03:27 -0700 |
commit | 3ababc21ab334a2e37c6ba4115c946ea26a6f2fb (patch) | |
tree | dd98aaa1ebd60ff099c50003da37262211e315bb | |
parent | 278837ee1072f60a01663dcf09367bd2fd86dcae (diff) | |
download | coreclr-3ababc21ab334a2e37c6ba4115c946ea26a6f2fb.tar.gz coreclr-3ababc21ab334a2e37c6ba4115c946ea26a6f2fb.tar.bz2 coreclr-3ababc21ab334a2e37c6ba4115c946ea26a6f2fb.zip |
Delete dead code (#11431)
32 files changed, 0 insertions, 786 deletions
diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index 945738e3a6..426ae7d601 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -344,9 +344,7 @@ <Compile Include="$(BclSourcesRoot)\System\MissingMemberException.cs" /> <Compile Include="$(BclSourcesRoot)\System\NonSerializedAttribute.cs" /> <Compile Include="$(BclSourcesRoot)\System\Number.cs" /> - <Compile Include="$(BclSourcesRoot)\System\OperatingSystem.cs" /> <Compile Include="$(BclSourcesRoot)\System\ParseNumbers.cs" /> - <Compile Include="$(BclSourcesRoot)\System\PlatformID.cs" /> <Compile Include="$(BclSourcesRoot)\System\ResId.cs" /> <Compile Include="$(BclSourcesRoot)\System\RtType.cs" /> <Compile Include="$(BclSourcesRoot)\System\RuntimeArgumentHandle.cs" /> @@ -592,9 +590,6 @@ <Compile Include="$(BclSourcesRoot)\System\Runtime\Serialization\SerializationInfo.cs" /> </ItemGroup> <ItemGroup> - <Compile Include="$(BclSourcesRoot)\System\Runtime\Remoting\ObjectHandle.cs" /> - </ItemGroup> - <ItemGroup> <Compile Include="$(BclSourcesRoot)\System\Text\DecoderNLS.cs" /> <Compile Include="$(BclSourcesRoot)\System\Text\DecoderBestFitFallback.cs" /> <Compile Include="$(BclSourcesRoot)\System\Text\DecoderExceptionFallback.cs" /> diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs index 8145a9537c..94e990ad80 100644 --- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs +++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs @@ -93,7 +93,6 @@ namespace Microsoft.Win32 using System.Security; using System.Text; using System.Configuration.Assemblies; - using System.Runtime.Remoting; using System.Runtime.InteropServices; using System.Threading; using Microsoft.Win32.SafeHandles; diff --git a/src/mscorlib/src/System/Activator.cs b/src/mscorlib/src/System/Activator.cs index 34c6ea5874..d11739b826 100644 --- a/src/mscorlib/src/System/Activator.cs +++ b/src/mscorlib/src/System/Activator.cs @@ -16,7 +16,6 @@ namespace System { using System; using System.Reflection; - using System.Runtime.Remoting; using System.Security; using CultureInfo = System.Globalization.CultureInfo; using Evidence = System.Security.Policy.Evidence; @@ -113,47 +112,6 @@ namespace System return Activator.CreateInstance(type, false); } - /* - * Create an instance using the name of type and the assembly where it exists. This allows - * types to be created remotely without having to load the type locally. - */ - - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - static public ObjectHandle CreateInstance(String assemblyName, - String typeName) - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return CreateInstance(assemblyName, - typeName, - false, - Activator.ConstructorDefault, - null, - null, - null, - null, - null, - ref stackMark); - } - - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - static public ObjectHandle CreateInstance(String assemblyName, - String typeName, - Object[] activationAttributes) - - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return CreateInstance(assemblyName, - typeName, - false, - Activator.ConstructorDefault, - null, - null, - null, - activationAttributes, - null, - ref stackMark); - } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod static public Object CreateInstance(Type type, bool nonPublic) { @@ -185,221 +143,5 @@ namespace System // Skip the CreateInstanceCheckThis call to avoid perf cost and to maintain compatibility with V2 (throwing the same exceptions). return (T)rt.CreateInstanceDefaultCtor(true /*publicOnly*/, true /*skipCheckThis*/, true /*fillCache*/, ref stackMark); } - - static public ObjectHandle CreateInstanceFrom(String assemblyFile, - String typeName) - - { - return CreateInstanceFrom(assemblyFile, typeName, null); - } - - static public ObjectHandle CreateInstanceFrom(String assemblyFile, - String typeName, - Object[] activationAttributes) - - { - return CreateInstanceFrom(assemblyFile, - typeName, - false, - Activator.ConstructorDefault, - null, - null, - null, - activationAttributes); - } - - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - public static ObjectHandle CreateInstance(string assemblyName, - string typeName, - bool ignoreCase, - BindingFlags bindingAttr, - Binder binder, - object[] args, - CultureInfo culture, - object[] activationAttributes) - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - return CreateInstance(assemblyName, - typeName, - ignoreCase, - bindingAttr, - binder, - args, - culture, - activationAttributes, - null, - ref stackMark); - } - - static internal ObjectHandle CreateInstance(String assemblyString, - String typeName, - bool ignoreCase, - BindingFlags bindingAttr, - Binder binder, - Object[] args, - CultureInfo culture, - Object[] activationAttributes, - Evidence securityInfo, - ref StackCrawlMark stackMark) - { - Type type = null; - Assembly assembly = null; - if (assemblyString == null) - { - assembly = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - } - else - { - RuntimeAssembly assemblyFromResolveEvent; - AssemblyName assemblyName = RuntimeAssembly.CreateAssemblyName(assemblyString, false /*forIntrospection*/, out assemblyFromResolveEvent); - if (assemblyFromResolveEvent != null) - { - // Assembly was resolved via AssemblyResolve event - assembly = assemblyFromResolveEvent; - } - else if (assemblyName.ContentType == AssemblyContentType.WindowsRuntime) - { - // WinRT type - we have to use Type.GetType - type = Type.GetType(typeName + ", " + assemblyString, true /*throwOnError*/, ignoreCase); - } - else - { - // Classic managed type - assembly = RuntimeAssembly.InternalLoadAssemblyName( - assemblyName, securityInfo, null, ref stackMark, - true /*thrownOnFileNotFound*/, false /*forIntrospection*/); - } - } - - if (type == null) - { - // It's classic managed type (not WinRT type) - Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyString); - if (assembly == null) return null; - - type = assembly.GetType(typeName, true /*throwOnError*/, ignoreCase); - } - - Object o = Activator.CreateInstance(type, - bindingAttr, - binder, - args, - culture, - activationAttributes); - - Log(o != null, "CreateInstance:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName); - if (o == null) - return null; - else - { - ObjectHandle Handle = new ObjectHandle(o); - return Handle; - } - } - - public static ObjectHandle CreateInstanceFrom(string assemblyFile, - string typeName, - bool ignoreCase, - BindingFlags bindingAttr, - Binder binder, - object[] args, - CultureInfo culture, - object[] activationAttributes) - { - return CreateInstanceFromInternal(assemblyFile, - typeName, - ignoreCase, - bindingAttr, - binder, - args, - culture, - activationAttributes, - null); - } - - private static ObjectHandle CreateInstanceFromInternal(String assemblyFile, - String typeName, - bool ignoreCase, - BindingFlags bindingAttr, - Binder binder, - Object[] args, - CultureInfo culture, - Object[] activationAttributes, - Evidence securityInfo) - { -#pragma warning disable 618 - Assembly assembly = Assembly.LoadFrom(assemblyFile, securityInfo); -#pragma warning restore 618 - Type t = assembly.GetType(typeName, true, ignoreCase); - - Object o = Activator.CreateInstance(t, - bindingAttr, - binder, - args, - culture, - activationAttributes); - - Log(o != null, "CreateInstanceFrom:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName); - if (o == null) - return null; - else - { - ObjectHandle Handle = new ObjectHandle(o); - return Handle; - } - } - - public static ObjectHandle CreateComInstanceFrom(String assemblyName, - String typeName) - { - return CreateComInstanceFrom(assemblyName, - typeName, - null, - AssemblyHashAlgorithm.None); - } - - public static ObjectHandle CreateComInstanceFrom(String assemblyName, - String typeName, - byte[] hashValue, - AssemblyHashAlgorithm hashAlgorithm) - { - Assembly assembly = Assembly.LoadFrom(assemblyName, hashValue, hashAlgorithm); - - Type t = assembly.GetType(typeName, true, false); - - Object[] Attr = t.GetCustomAttributes(typeof(ComVisibleAttribute), false); - if (Attr.Length > 0) - { - if (((ComVisibleAttribute)Attr[0]).Value == false) - throw new TypeLoadException(SR.Argument_TypeMustBeVisibleFromCom); - } - - Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyName); - - if (assembly == null) return null; - - - Object o = Activator.CreateInstance(t, - Activator.ConstructorDefault, - null, - null, - null, - null); - - Log(o != null, "CreateInstance:: ", "Created Instance of class " + typeName, "Failed to create instance of class " + typeName); - if (o == null) - return null; - else - { - ObjectHandle Handle = new ObjectHandle(o); - return Handle; - } - } - - [System.Diagnostics.Conditional("_DEBUG")] - private static void Log(bool test, string title, string success, string failure) - { - } } } - diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs index 02a473c993..edd53b22da 100644 --- a/src/mscorlib/src/System/AppDomain.cs +++ b/src/mscorlib/src/System/AppDomain.cs @@ -25,7 +25,6 @@ namespace System using System.Collections.Generic; using System.Threading; using System.Runtime.InteropServices; - using System.Runtime.Remoting; using System.Reflection.Emit; using CultureInfo = System.Globalization.CultureInfo; using System.IO; @@ -258,18 +257,6 @@ namespace System private static extern APPX_FLAGS nGetAppXFlags(); #endif - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] - private static extern void GetAppDomainManagerType(AppDomainHandle domain, - StringHandleOnStack retAssembly, - StringHandleOnStack retType); - - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] - private static extern void SetAppDomainManagerType(AppDomainHandle domain, - string assembly, - string type); - [SuppressUnmanagedCodeSecurity] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private static extern void SetSecurityHomogeneousFlag(AppDomainHandle domain, @@ -328,54 +315,6 @@ namespace System SetupBindingPaths(trustedPlatformAssemblies, platformResourceRoots, appPaths, appNiPaths, appLocalWinMD); } - string domainManagerAssembly; - string domainManagerType; - GetAppDomainManagerType(out domainManagerAssembly, out domainManagerType); - - if (domainManagerAssembly != null && domainManagerType != null) - { - try - { - _domainManager = CreateInstanceAndUnwrap(domainManagerAssembly, domainManagerType) as AppDomainManager; - } - catch (FileNotFoundException e) - { - throw new TypeLoadException(SR.Argument_NoDomainManager, e); - } - catch (SecurityException e) - { - throw new TypeLoadException(SR.Argument_NoDomainManager, e); - } - catch (TypeLoadException e) - { - throw new TypeLoadException(SR.Argument_NoDomainManager, e); - } - - if (_domainManager == null) - { - throw new TypeLoadException(SR.Argument_NoDomainManager); - } - - // If this domain was not created by a managed call to CreateDomain, then the AppDomainSetup - // will not have the correct values for the AppDomainManager set. - FusionStore.AppDomainManagerAssembly = domainManagerAssembly; - FusionStore.AppDomainManagerType = domainManagerType; - - bool notifyFusion = _domainManager.GetType() != typeof(System.AppDomainManager) && !DisableFusionUpdatesFromADManager(); - - - - AppDomainSetup FusionStoreOld = null; - if (notifyFusion) - FusionStoreOld = new AppDomainSetup(FusionStore, true); - - // Initialize the AppDomainMAnager and register the instance with the native host if requested - _domainManager.InitializeNewDomain(FusionStore); - - if (notifyFusion) - SetupFusionStore(_FusionStore, FusionStoreOld); // Notify Fusion about the changes the user implementation of InitializeNewDomain may have made to the FusionStore object. - } - InitializeCompatibilityFlags(); } @@ -485,34 +424,6 @@ namespace System } /// <summary> - /// Get the name of the assembly and type that act as the AppDomainManager for this domain - /// </summary> - internal void GetAppDomainManagerType(out string assembly, out string type) - { - // We can't just use our parameters because we need to ensure that the strings used for hte QCall - // are on the stack. - string localAssembly = null; - string localType = null; - - GetAppDomainManagerType(GetNativeHandle(), - JitHelpers.GetStringHandleOnStack(ref localAssembly), - JitHelpers.GetStringHandleOnStack(ref localType)); - - assembly = localAssembly; - type = localType; - } - - /// <summary> - /// Set the assembly and type which act as the AppDomainManager for this domain - /// </summary> - private void SetAppDomainManagerType(string assembly, string type) - { - Debug.Assert(assembly != null, "assembly != null"); - Debug.Assert(type != null, "type != null"); - SetAppDomainManagerType(GetNativeHandle(), assembly, type); - } - - /// <summary> /// Called for every AppDomain (including the default domain) to initialize the security of the AppDomain) /// </summary> private void InitializeDomainSecurity(Evidence providedSecurityInfo, @@ -584,23 +495,6 @@ namespace System } } - - public ObjectHandle CreateInstance(String assemblyName, - String typeName) - - { - // jit does not check for that, so we should do it ... - if (this == null) - throw new NullReferenceException(); - - if (assemblyName == null) - throw new ArgumentNullException(nameof(assemblyName)); - Contract.EndContractBlock(); - - return Activator.CreateInstance(assemblyName, - typeName); - } - public static AppDomain CurrentDomain { get @@ -1158,12 +1052,6 @@ namespace System } #endif // FEATURE_COMINTEROP - // set up the AppDomainManager for this domain and initialize security. - if (adSetup.AppDomainManagerAssembly != null && adSetup.AppDomainManagerType != null) - { - ad.SetAppDomainManagerType(adSetup.AppDomainManagerAssembly, adSetup.AppDomainManagerType); - } - ad.CreateAppDomainManager(); // could modify FusionStore's object ad.InitializeDomainSecurity(providedSecurityInfo, creatorsSecurityInfo, @@ -1301,16 +1189,6 @@ namespace System } } - public Object CreateInstanceAndUnwrap(String assemblyName, - String typeName) - { - ObjectHandle oh = CreateInstance(assemblyName, typeName); - if (oh == null) - return null; - - return oh.Unwrap(); - } // CreateInstanceAndUnwrap - public Int32 Id { get diff --git a/src/mscorlib/src/System/BCLDebug.cs b/src/mscorlib/src/System/BCLDebug.cs index 67f7c9a0f7..12a0d55995 100644 --- a/src/mscorlib/src/System/BCLDebug.cs +++ b/src/mscorlib/src/System/BCLDebug.cs @@ -15,7 +15,6 @@ namespace System { using System.IO; using System.Text; - using System.Runtime.Remoting; using System.Diagnostics; using Microsoft.Win32; using System.Runtime.CompilerServices; diff --git a/src/mscorlib/src/System/DelegateSerializationHolder.cs b/src/mscorlib/src/System/DelegateSerializationHolder.cs index d7ad827673..17e2dd9be2 100644 --- a/src/mscorlib/src/System/DelegateSerializationHolder.cs +++ b/src/mscorlib/src/System/DelegateSerializationHolder.cs @@ -5,7 +5,6 @@ using System; using System.Reflection; -using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Globalization; using System.Diagnostics.Contracts; diff --git a/src/mscorlib/src/System/Diagnostics/log.cs b/src/mscorlib/src/System/Diagnostics/log.cs index b62ea493e7..9ec0cfc7fb 100644 --- a/src/mscorlib/src/System/Diagnostics/log.cs +++ b/src/mscorlib/src/System/Diagnostics/log.cs @@ -4,7 +4,6 @@ namespace System.Diagnostics { - using System.Runtime.Remoting; using System; using System.IO; using System.Collections; diff --git a/src/mscorlib/src/System/Empty.cs b/src/mscorlib/src/System/Empty.cs index 502e8dfea7..7c4503ef29 100644 --- a/src/mscorlib/src/System/Empty.cs +++ b/src/mscorlib/src/System/Empty.cs @@ -9,7 +9,6 @@ using System.Diagnostics.Contracts; using System; -using System.Runtime.Remoting; using System.Runtime.Serialization; namespace System diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs index dddbdc242d..257deb27eb 100644 --- a/src/mscorlib/src/System/Environment.cs +++ b/src/mscorlib/src/System/Environment.cs @@ -77,9 +77,6 @@ namespace System } } - - private static volatile OperatingSystem m_os; // Cached OperatingSystem value - /*==================================TickCount=================================== **Action: Gets the number of ticks since the system was started. **Returns: The number of ticks since the system was started. diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs index b049eaf45d..dedcab58a7 100644 --- a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs +++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs @@ -3,7 +3,6 @@ // See the LICENSE file in the project root for more information. using System.Text; -using System.Runtime.Remoting; using System; using System.Security; diff --git a/src/mscorlib/src/System/IO/__Error.cs b/src/mscorlib/src/System/IO/__Error.cs index 70f83261ed..1af195ef77 100644 --- a/src/mscorlib/src/System/IO/__Error.cs +++ b/src/mscorlib/src/System/IO/__Error.cs @@ -206,11 +206,5 @@ namespace System.IO { throw new NotSupportedException(SR.NotSupported_UnwritableStream); } - - // From WinError.h - internal const int ERROR_FILE_NOT_FOUND = Win32Native.ERROR_FILE_NOT_FOUND; - internal const int ERROR_PATH_NOT_FOUND = Win32Native.ERROR_PATH_NOT_FOUND; - internal const int ERROR_ACCESS_DENIED = Win32Native.ERROR_ACCESS_DENIED; - internal const int ERROR_INVALID_PARAMETER = Win32Native.ERROR_INVALID_PARAMETER; } } diff --git a/src/mscorlib/src/System/MissingFieldException.cs b/src/mscorlib/src/System/MissingFieldException.cs index 5668f9e9b3..39f66a2b37 100644 --- a/src/mscorlib/src/System/MissingFieldException.cs +++ b/src/mscorlib/src/System/MissingFieldException.cs @@ -11,7 +11,6 @@ using System; -using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Globalization; diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs index 51150e113c..0b8342f3c6 100644 --- a/src/mscorlib/src/System/MissingMemberException.cs +++ b/src/mscorlib/src/System/MissingMemberException.cs @@ -13,7 +13,6 @@ using System; -using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Globalization; diff --git a/src/mscorlib/src/System/OperatingSystem.cs b/src/mscorlib/src/System/OperatingSystem.cs deleted file mode 100644 index 5eb1253fa5..0000000000 --- a/src/mscorlib/src/System/OperatingSystem.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** -** -** Purpose: -** -** -===========================================================*/ - -using System.Runtime.Serialization; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Diagnostics.Contracts; - -namespace System -{ - [Serializable] - internal sealed class OperatingSystem : ICloneable, ISerializable - { - private Version _version; - private PlatformID _platform; - private string _servicePack; - private string _versionString; - - private OperatingSystem() - { - } - - internal OperatingSystem(PlatformID platform, Version version, string servicePack) - { - if (platform < PlatformID.Win32S || platform > PlatformID.MacOSX) - { - throw new ArgumentException( - SR.Format(SR.Arg_EnumIllegalVal, (int)platform), - nameof(platform)); - } - - if ((Object)version == null) - throw new ArgumentNullException(nameof(version)); - Contract.EndContractBlock(); - - _platform = platform; - _version = (Version)version.Clone(); - _servicePack = servicePack; - } - - private OperatingSystem(SerializationInfo info, StreamingContext context) - { - SerializationInfoEnumerator enumerator = info.GetEnumerator(); - while (enumerator.MoveNext()) - { - switch (enumerator.Name) - { - case "_version": - _version = (Version)info.GetValue("_version", typeof(Version)); - break; - case "_platform": - _platform = (PlatformID)info.GetValue("_platform", typeof(PlatformID)); - break; - case "_servicePack": - _servicePack = info.GetString("_servicePack"); - break; - } - } - - if (_version == null) - { - throw new SerializationException(SR.Format(SR.Serialization_MissField, "_version")); - } - } - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - if (info == null) - { - throw new ArgumentNullException(nameof(info)); - } - Contract.EndContractBlock(); - - info.AddValue("_version", _version); - info.AddValue("_platform", _platform); - info.AddValue("_servicePack", _servicePack); - } - - public Version Version - { - get { return _version; } - } - - public Object Clone() - { - return new OperatingSystem(_platform, - _version, _servicePack); - } - - public override String ToString() - { - return VersionString; - } - - public String VersionString - { - get - { - if (_versionString != null) - { - return _versionString; - } - - String os; - switch (_platform) - { - case PlatformID.Win32NT: - os = "Microsoft Windows NT "; - break; - case PlatformID.Win32Windows: - if ((_version.Major > 4) || - ((_version.Major == 4) && (_version.Minor > 0))) - os = "Microsoft Windows 98 "; - else - os = "Microsoft Windows 95 "; - break; - case PlatformID.Win32S: - os = "Microsoft Win32S "; - break; - case PlatformID.WinCE: - os = "Microsoft Windows CE "; - break; - case PlatformID.MacOSX: - os = "Mac OS X "; - break; - default: - os = "<unknown> "; - break; - } - - if (String.IsNullOrEmpty(_servicePack)) - { - _versionString = os + _version.ToString(); - } - else - { - _versionString = os + _version.ToString(3) + " " + _servicePack; - } - - return _versionString; - } - } - } -} diff --git a/src/mscorlib/src/System/PlatformID.cs b/src/mscorlib/src/System/PlatformID.cs deleted file mode 100644 index dfab2175ab..0000000000 --- a/src/mscorlib/src/System/PlatformID.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** -** -** Purpose: Defines IDs for supported platforms -** -** -===========================================================*/ - -namespace System -{ - [Serializable] - internal enum PlatformID - { - Win32S = 0, - Win32Windows = 1, - Win32NT = 2, - WinCE = 3, - Unix = 4, - Xbox = 5, - MacOSX = 6 - } -} diff --git a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs index cfb36e7f6d..9d34b48177 100644 --- a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs +++ b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs @@ -87,26 +87,6 @@ namespace System.Reflection return AssemblyLoadContext.Default.LoadFromAssemblyPath(fullPath); } - // Evidence is protected in Assembly.Load() - [Obsolete("This method is obsolete and will be removed in a future release of the .NET Framework. Please use an overload of LoadFrom which does not take an Evidence parameter. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")] - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - internal static Assembly LoadFrom(String assemblyFile, - Evidence securityEvidence) - { - Contract.Ensures(Contract.Result<Assembly>() != null); - - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - - return RuntimeAssembly.InternalLoadFrom( - assemblyFile, - securityEvidence, - null, // hashValue - AssemblyHashAlgorithm.None, - false,// forIntrospection); - ref stackMark); - } - - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public static Assembly LoadFrom(String assemblyFile, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm) diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs index 4632525453..cb2d156521 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs @@ -320,26 +320,6 @@ namespace System.Reflection return CustomAttributeData.GetCustomAttributesInternal(this); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod - internal static RuntimeAssembly InternalLoadFrom(String assemblyFile, - Evidence securityEvidence, - byte[] hashValue, - AssemblyHashAlgorithm hashAlgorithm, - bool forIntrospection, - ref StackCrawlMark stackMark) - { - if (assemblyFile == null) - throw new ArgumentNullException(nameof(assemblyFile)); - - Contract.EndContractBlock(); - - AssemblyName an = new AssemblyName(); - an.CodeBase = assemblyFile; - an.SetHashControl(hashValue, hashAlgorithm); - // The stack mark is used for MDA filtering - return InternalLoadAssemblyName(an, securityEvidence, null, ref stackMark, true /*thrownOnFileNotFound*/, forIntrospection); - } - // Wrapper function to wrap the typical use of InternalLoad. internal static RuntimeAssembly InternalLoad(String assemblyString, Evidence assemblySecurity, diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs index 3ae2e04e2a..b64f95bb6a 100644 --- a/src/mscorlib/src/System/RtType.cs +++ b/src/mscorlib/src/System/RtType.cs @@ -23,7 +23,6 @@ using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Security; using System.Text; -using System.Runtime.Remoting; using MdSigCallingConvention = System.Signature.MdSigCallingConvention; using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; using System.Runtime.InteropServices; diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs index c050000169..97365b0f22 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs @@ -13,7 +13,6 @@ using System; using System.Runtime.Serialization; -using System.Runtime.Remoting; using System.Diagnostics.Contracts; namespace System.Runtime.CompilerServices diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs index 8198d9fd18..fe69f619fe 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsHelper.cs @@ -99,7 +99,6 @@ // code:ComEventsMethod.Invoke using System; -using System.Runtime.Remoting; namespace System.Runtime.InteropServices { diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs index 97f1bc5432..13eb953b41 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs @@ -22,7 +22,6 @@ namespace System.Runtime.InteropServices using System.Security; using System.Text; using System.Threading; - using System.Runtime.Remoting; using System.Runtime.CompilerServices; using System.Globalization; using System.Runtime.ConstrainedExecution; diff --git a/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs b/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs deleted file mode 100644 index e76882d6df..0000000000 --- a/src/mscorlib/src/System/Runtime/Remoting/ObjectHandle.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/*============================================================ -** -** -** -** ObjectHandle wraps object references. A Handle allows a -** marshal by value object to be returned through an -** indirection allowing the caller to control when the -** object is loaded into their domain. -** -** -===========================================================*/ - -using System; -using System.Runtime.InteropServices; - -namespace System.Runtime.Remoting -{ - public class ObjectHandle - { - private Object WrappedObject; - - private ObjectHandle() - { - } - - internal ObjectHandle(Object o) - { - WrappedObject = o; - } - - internal Object Unwrap() - { - return WrappedObject; - } - } -} diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs index 18139324a3..b49b372b4b 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs @@ -17,7 +17,6 @@ using System.Reflection; using System.Collections; using System.Collections.Generic; using System.Security; -using System.Runtime.Remoting; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading; diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs index 7fc3ce27d9..8fb54c79a7 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs @@ -15,7 +15,6 @@ using System; using System.Collections.Generic; using System.Reflection; -using System.Runtime.Remoting; using System.Globalization; using System.Diagnostics; using System.Diagnostics.Contracts; diff --git a/src/mscorlib/src/System/SharedStatics.cs b/src/mscorlib/src/System/SharedStatics.cs index a6a04d9614..5c37f25446 100644 --- a/src/mscorlib/src/System/SharedStatics.cs +++ b/src/mscorlib/src/System/SharedStatics.cs @@ -12,7 +12,6 @@ =============================================================================*/ using System.Threading; -using System.Runtime.Remoting; using System.Security; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; diff --git a/src/mscorlib/src/System/Text/Encoding.cs b/src/mscorlib/src/System/Text/Encoding.cs index 159123495b..5788051e23 100644 --- a/src/mscorlib/src/System/Text/Encoding.cs +++ b/src/mscorlib/src/System/Text/Encoding.cs @@ -8,7 +8,6 @@ namespace System.Text using System.Collections; using System.Collections.Generic; using System.Runtime; - using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Globalization; using System.Security; diff --git a/src/mscorlib/src/System/Threading/Monitor.cs b/src/mscorlib/src/System/Threading/Monitor.cs index 3ace3335aa..0df64a5e5c 100644 --- a/src/mscorlib/src/System/Threading/Monitor.cs +++ b/src/mscorlib/src/System/Threading/Monitor.cs @@ -17,7 +17,6 @@ using System; using System.Runtime; -using System.Runtime.Remoting; using System.Threading; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; diff --git a/src/mscorlib/src/System/Threading/WaitHandle.cs b/src/mscorlib/src/System/Threading/WaitHandle.cs index f3412d264f..da4856ee96 100644 --- a/src/mscorlib/src/System/Threading/WaitHandle.cs +++ b/src/mscorlib/src/System/Threading/WaitHandle.cs @@ -15,7 +15,6 @@ namespace System.Threading { using System.Threading; - using System.Runtime.Remoting; using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/src/mscorlib/src/System/TypeLoadException.cs b/src/mscorlib/src/System/TypeLoadException.cs index 85e1da5920..339ba08e7b 100644 --- a/src/mscorlib/src/System/TypeLoadException.cs +++ b/src/mscorlib/src/System/TypeLoadException.cs @@ -13,7 +13,6 @@ using System; using System.Globalization; -using System.Runtime.Remoting; using System.Runtime.Serialization; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp index 702c255c97..e9bcc2366b 100644 --- a/src/vm/assemblynative.cpp +++ b/src/vm/assemblynative.cpp @@ -326,110 +326,6 @@ Assembly* AssemblyNative::LoadFromBuffer(BOOL fForIntrospection, const BYTE* pAs return pAssembly; } -FCIMPL6(Object*, AssemblyNative::LoadImage, U1Array* PEByteArrayUNSAFE, - U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE, - StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource) -{ - FCALL_CONTRACT; - - struct _gc - { - U1ARRAYREF PEByteArray; - U1ARRAYREF SymByteArray; - OBJECTREF security; - OBJECTREF Throwable; - OBJECTREF refRetVal; - } gc; - - gc.PEByteArray = (U1ARRAYREF) PEByteArrayUNSAFE; - gc.SymByteArray = (U1ARRAYREF) SymByteArrayUNSAFE; - gc.security = (OBJECTREF) securityUNSAFE; - gc.Throwable = NULL; - gc.refRetVal = NULL; - - HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); - - - if (gc.PEByteArray == NULL) - COMPlusThrow(kArgumentNullException, W("ArgumentNull_Array")); - - NewArrayHolder<BYTE> pbSyms; - DWORD cbSyms = 0; - -#ifdef DEBUGGING_SUPPORTED - // If we were given symbols, save a copy of them. - // the debugger, load them now). - if (gc.SymByteArray != NULL) - { - Security::CopyByteArrayToEncoding(&gc.SymByteArray, - &pbSyms, &cbSyms); - - } -#endif // DEBUGGING_SUPPORTED - - Assembly* pAssembly = NULL; - // Pin byte array for loading - { - Wrapper<OBJECTHANDLE, DoNothing, DestroyPinningHandle> handle( - GetAppDomain()->CreatePinningHandle(gc.PEByteArray)); - - const BYTE *pbImage = gc.PEByteArray->GetDirectConstPointerToNonObjectElements(); - DWORD cbImage = gc.PEByteArray->GetNumComponents(); - pAssembly = LoadFromBuffer(fForIntrospection, pbImage, cbImage, pbSyms, cbSyms, stackMark, OBJECTREFToObject(gc.security), securityContextSource); - } - - - if (pAssembly != NULL) - gc.refRetVal = pAssembly->GetExposedObject(); - - HELPER_METHOD_FRAME_END(); - - return OBJECTREFToObject(gc.refRetVal); -} -FCIMPLEND - -FCIMPL2(Object*, AssemblyNative::LoadFile, StringObject* pathUNSAFE, Object* securityUNSAFE) -{ - FCALL_CONTRACT; - - struct _gc { - OBJECTREF refRetVal; - OBJECTREF refSecurity; - STRINGREF strPath; - } gc; - - gc.refRetVal = NULL; - gc.refSecurity = ObjectToOBJECTREF(securityUNSAFE); - gc.strPath = ObjectToSTRINGREF(pathUNSAFE); - - HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc); - - if(CorHost2::IsLoadFromBlocked()) - COMPlusThrow(kFileLoadException, FUSION_E_LOADFROM_BLOCKED); - - if (pathUNSAFE == NULL) - COMPlusThrow(kArgumentNullException, W("ArgumentNull_Path")); - - StackSString path; - gc.strPath->GetSString(path); - - Assembly *pAssembly = AssemblySpec::LoadAssembly(path); - - LOG((LF_CLASSLOADER, - LL_INFO100, - "\tLoaded assembly from a file\n")); - - - if (pAssembly != NULL) - gc.refRetVal = (ASSEMBLYREF) pAssembly->GetExposedObject(); - - HELPER_METHOD_FRAME_END(); - - return OBJECTREFToObject(gc.refRetVal); -} -FCIMPLEND - - /* static */ Assembly* AssemblyNative::LoadFromPEImage(ICLRPrivBinder* pBinderContext, PEImage *pILImage, PEImage *pNIImage) { diff --git a/src/vm/assemblynative.hpp b/src/vm/assemblynative.hpp index 514589fb4c..71e8b51181 100644 --- a/src/vm/assemblynative.hpp +++ b/src/vm/assemblynative.hpp @@ -46,10 +46,6 @@ public: static void QCALLTYPE GetExecutingAssembly(QCall::StackCrawlMarkHandle stackMark, QCall::ObjectHandleOnStack retAssembly); - static FCDECL2(Object*, LoadFile, StringObject* pathUNSAFE, - Object* securityUNSAFE); - static FCDECL6(Object*, LoadImage, U1Array* PEByteArrayUNSAFE, U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE, StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource); - static FCDECL10(Object*, Load, AssemblyNameBaseObject* assemblyNameUNSAFE, StringObject* codeBaseUNSAFE, Object* securityUNSAFE, @@ -61,9 +57,6 @@ public: CLR_BOOL fSuppressSecurityChecks, INT_PTR ptrLoadContextBinder); - static FCDECL1(FC_BOOL_RET, IsFrameworkAssembly, AssemblyNameBaseObject* refAssemblyNameUNSAFE); - static FCDECL1(FC_BOOL_RET, IsNewPortableAssembly, AssemblyNameBaseObject* refAssemblyNameUNSAFE); - // // instance FCALLs // diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h index 81bc6568a7..cc6966ed8e 100644 --- a/src/vm/ecalllist.h +++ b/src/vm/ecalllist.h @@ -594,7 +594,6 @@ FCFuncStart(gAssemblyFuncs) QCFuncElement("GetVersion", AssemblyNative::GetVersion) FCFuncElement("FCallIsDynamic", AssemblyNative::IsDynamic) FCFuncElement("_nLoad", AssemblyNative::Load) - FCFuncElement("nLoadImage", AssemblyNative::LoadImage) QCFuncElement("GetType", AssemblyNative::GetType) QCFuncElement("GetManifestResourceInfo", AssemblyNative::GetManifestResourceInfo) QCFuncElement("GetModules", AssemblyNative::GetModules) |