From 81a89007536686ad4f95a43641cbe8482e4b74ac Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Sun, 5 Mar 2017 17:27:36 -0800 Subject: [PATCH] Delete IsNonW8PFrameworkAPI checks (dotnet/coreclr#9964) Dead code in CoreCLR Commit migrated from https://github.com/dotnet/coreclr/commit/118f88dc17c75800ca249330ea41a963d3bae306 --- src/coreclr/src/inc/appxutil.h | 6 -- src/coreclr/src/inc/clrconfigvalues.h | 3 - src/coreclr/src/mscorlib/src/System/AppDomain.cs | 22 +--- src/coreclr/src/mscorlib/src/System/Delegate.cs | 13 --- .../System/Globalization/CultureInfo.Windows.cs | 22 ---- .../src/mscorlib/src/System/Reflection/Assembly.cs | 21 +--- .../src/System/Reflection/ConstructorInfo.cs | 47 -------- .../src/System/Reflection/Emit/AssemblyBuilder.cs | 23 +--- .../System/Reflection/Emit/DynamicILGenerator.cs | 77 -------------- .../src/System/Reflection/Emit/DynamicMethod.cs | 118 +++++---------------- .../src/System/Reflection/Emit/ModuleBuilder.cs | 36 ------- .../mscorlib/src/System/Reflection/FieldInfo.cs | 46 -------- .../mscorlib/src/System/Reflection/MethodBase.cs | 2 +- .../mscorlib/src/System/Reflection/MethodInfo.cs | 50 --------- .../src/System/Resources/ResourceManager.cs | 2 +- src/coreclr/src/mscorlib/src/System/RtType.cs | 78 +------------- src/coreclr/src/vm/appdomain.cpp | 4 - src/coreclr/src/vm/appdomainnative.cpp | 28 +---- src/coreclr/src/vm/eeconfig.cpp | 4 - src/coreclr/src/vm/eeconfig.h | 8 -- src/coreclr/src/vm/mscorlib.h | 3 - src/coreclr/src/vm/object.h | 3 - 22 files changed, 35 insertions(+), 581 deletions(-) diff --git a/src/coreclr/src/inc/appxutil.h b/src/coreclr/src/inc/appxutil.h index 893c429..312c486 100644 --- a/src/coreclr/src/inc/appxutil.h +++ b/src/coreclr/src/inc/appxutil.h @@ -33,12 +33,6 @@ namespace AppX // On CoreCLR, the host is in charge of determining whether the process is AppX or not. void SetIsAppXProcess(bool); - inline bool IsAppXNGen() - { - WRAPPER_NO_CONTRACT; - return false; - } - #ifdef DACCESS_COMPILE bool DacIsAppXProcess(); #endif // DACCESS_COMPILE diff --git a/src/coreclr/src/inc/clrconfigvalues.h b/src/coreclr/src/inc/clrconfigvalues.h index 6a30af1..6160f20 100644 --- a/src/coreclr/src/inc/clrconfigvalues.h +++ b/src/coreclr/src/inc/clrconfigvalues.h @@ -156,9 +156,6 @@ RETAIL_CONFIG_DWORD_INFO(EXTERNAL_DateTime_NetFX40AmPmParseAdjustment, W("Enable #ifdef FEATURE_RANDOMIZED_STRING_HASHING RETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseRandomizedStringHashAlgorithm, W("UseRandomizedStringHashAlgorithm"), 0, "Flag to use a string hashing algorithm who's behavior differs between AppDomains") #endif // FEATURE_RANDOMIZED_STRING_HASHING -#ifdef FEATURE_APPX -RETAIL_CONFIG_DWORD_INFO(INTERNAL_Windows8ProfileAPICheckFlag, W("Windows8ProfileAPICheckFlag"), 0, "Windows 8 Profile API check behavior (non-W8P framework APIs cannot be accessed through Reflection and RefEmit). 0: normal (only check in non-dev-mode APPX). 1: always check. 2: never check."); -#endif // // Conditional breakpoints diff --git a/src/coreclr/src/mscorlib/src/System/AppDomain.cs b/src/coreclr/src/mscorlib/src/System/AppDomain.cs index 9a3d70a..4db0c15 100644 --- a/src/coreclr/src/mscorlib/src/System/AppDomain.cs +++ b/src/coreclr/src/mscorlib/src/System/AppDomain.cs @@ -286,12 +286,8 @@ namespace System APPX_FLAGS_APPX_MODEL = 0x02, APPX_FLAGS_APPX_DESIGN_MODE = 0x04, - APPX_FLAGS_APPX_NGEN = 0x08, APPX_FLAGS_APPX_MASK = APPX_FLAGS_APPX_MODEL | - APPX_FLAGS_APPX_DESIGN_MODE | - APPX_FLAGS_APPX_NGEN, - - APPX_FLAGS_API_CHECK = 0x10, + APPX_FLAGS_APPX_DESIGN_MODE, } private static APPX_FLAGS Flags @@ -305,22 +301,6 @@ namespace System return s_flags; } } - - internal static bool ProfileAPICheck - { - get - { - return (Flags & APPX_FLAGS.APPX_FLAGS_API_CHECK) != 0; - } - } - - internal static bool IsAppXNGen - { - get - { - return (Flags & APPX_FLAGS.APPX_FLAGS_APPX_NGEN) != 0; - } - } #endif // FEATURE_APPX [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] diff --git a/src/coreclr/src/mscorlib/src/System/Delegate.cs b/src/coreclr/src/mscorlib/src/System/Delegate.cs index bd7a1f2..5f01773 100644 --- a/src/coreclr/src/mscorlib/src/System/Delegate.cs +++ b/src/coreclr/src/mscorlib/src/System/Delegate.cs @@ -628,19 +628,6 @@ namespace System { Debug.Assert((flags & DelegateBindingFlags.SkipSecurityChecks) == 0); -#if FEATURE_APPX - bool nonW8PMethod = (rtMethod.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0; - bool nonW8PType = (rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0; - if (nonW8PMethod || nonW8PType) - { - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException( - Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", - nonW8PMethod ? rtMethod.FullName : rtType.FullName)); - } -#endif - return UnsafeCreateDelegate(rtType, rtMethod, firstArgument, flags); } diff --git a/src/coreclr/src/mscorlib/src/System/Globalization/CultureInfo.Windows.cs b/src/coreclr/src/mscorlib/src/System/Globalization/CultureInfo.Windows.cs index 941b9d6..a7f43f2 100644 --- a/src/coreclr/src/mscorlib/src/System/Globalization/CultureInfo.Windows.cs +++ b/src/coreclr/src/mscorlib/src/System/Globalization/CultureInfo.Windows.cs @@ -235,17 +235,6 @@ namespace System.Globalization return null; } - // If running within a compilation process (mscorsvw.exe, for example), it is illegal to - // load any non-mscorlib assembly for execution. Since WindowsRuntimeResourceManager lives - // in System.Runtime.WindowsRuntime, caller will need to fall back to default Win32 value, - // which should be fine because we should only ever need to access FX resources during NGEN. - // FX resources are always loaded from satellite assemblies - even in AppX processes (see the - // comments in code:System.Resources.ResourceManager.SetAppXConfiguration for more details). - if (AppDomain.IsAppXNGen) - { - return null; - } - CultureInfo toReturn = null; try @@ -269,17 +258,6 @@ namespace System.Globalization internal static bool SetCultureInfoForUserPreferredLanguageInAppX(CultureInfo ci) { - // If running within a compilation process (mscorsvw.exe, for example), it is illegal to - // load any non-mscorlib assembly for execution. Since WindowsRuntimeResourceManager lives - // in System.Runtime.WindowsRuntime, caller will need to fall back to default Win32 value, - // which should be fine because we should only ever need to access FX resources during NGEN. - // FX resources are always loaded from satellite assemblies - even in AppX processes (see the - // comments in code:System.Resources.ResourceManager.SetAppXConfiguration for more details). - if (AppDomain.IsAppXNGen) - { - return false; - } - if (s_WindowsRuntimeResourceManager == null) { s_WindowsRuntimeResourceManager = ResourceManager.GetWinRTResourceManager(); diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs index 37698f6..57ea5ca 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Assembly.cs @@ -772,7 +772,6 @@ namespace System.Reflection ASSEMBLY_FLAGS_UNKNOWN = 0x00000000, ASSEMBLY_FLAGS_INITIALIZED = 0x01000000, ASSEMBLY_FLAGS_FRAMEWORK = 0x02000000, - ASSEMBLY_FLAGS_SAFE_REFLECTION = 0x04000000, ASSEMBLY_FLAGS_TOKEN_MASK = 0x00FFFFFF, } #endif // FEATURE_APPX @@ -793,16 +792,6 @@ namespace System.Reflection #endregion #if FEATURE_APPX - internal int InvocableAttributeCtorToken - { - get - { - int token = (int)(Flags & ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_TOKEN_MASK); - - return token | (int)MetadataTokenType.MethodDef; - } - } - private ASSEMBLY_FLAGS Flags { get @@ -810,7 +799,7 @@ namespace System.Reflection if ((m_flags & ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_INITIALIZED) == 0) { ASSEMBLY_FLAGS flags = ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_UNKNOWN - | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_FRAMEWORK | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_SAFE_REFLECTION; + | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_FRAMEWORK; m_flags = flags | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_INITIALIZED; } @@ -1211,14 +1200,6 @@ namespace System.Reflection ASSEMBLY_FLAGS flags = Flags; return (flags & ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_FRAMEWORK) != 0; } - - // Returns true if we want to allow this assembly to invoke non-W8P - // framework APIs through reflection. - internal bool IsSafeForReflection() - { - ASSEMBLY_FLAGS flags = Flags; - return (flags & ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_SAFE_REFLECTION) != 0; - } #endif [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/ConstructorInfo.cs b/src/coreclr/src/mscorlib/src/System/Reflection/ConstructorInfo.cs index 6249a6a..284134a 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/ConstructorInfo.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/ConstructorInfo.cs @@ -109,28 +109,6 @@ namespace System.Reflection private volatile Signature m_signature; private INVOCATION_FLAGS m_invocationFlags; -#if FEATURE_APPX - private bool IsNonW8PFrameworkAPI() - { - if (DeclaringType.IsArray && IsPublic && !IsStatic) - return false; - - RuntimeAssembly rtAssembly = GetRuntimeAssembly(); - if (rtAssembly.IsFrameworkAssembly()) - { - int ctorToken = rtAssembly.InvocableAttributeCtorToken; - if (System.Reflection.MetadataToken.IsNullToken(ctorToken) || - !CustomAttribute.IsAttributeDefined(GetRuntimeModule(), MetadataToken, ctorToken)) - return true; - } - - if (GetRuntimeType().IsNonW8PFrameworkAPI()) - return true; - - return false; - } -#endif // FEATURE_APPX - internal INVOCATION_FLAGS InvocationFlags { get @@ -174,11 +152,6 @@ namespace System.Reflection invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_IS_DELEGATE_CTOR; } -#if FEATURE_APPX - if (AppDomain.ProfileAPICheck && IsNonW8PFrameworkAPI()) - invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API; -#endif // FEATURE_APPX - m_invocationFlags = invocationFlags | INVOCATION_FLAGS.INVOCATION_FLAGS_INITIALIZED; } @@ -469,16 +442,6 @@ namespace System.Reflection // check basic method consistency. This call will throw if there are problems in the target/method relationship CheckConsistency(obj); -#if FEATURE_APPX - if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", FullName)); - } -#endif - if (obj != null) { // For unverifiable code, we require the caller to be critical. @@ -553,16 +516,6 @@ namespace System.Reflection if ((invocationFlags & (INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE | INVOCATION_FLAGS.INVOCATION_FLAGS_CONTAINS_STACK_POINTERS | INVOCATION_FLAGS.INVOCATION_FLAGS_NO_CTOR_INVOKE)) != 0) ThrowNoInvokeException(); -#if FEATURE_APPX - if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", FullName)); - } -#endif - // get the signature Signature sig = Signature; diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs index ca273d6..2ff87a0 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -177,10 +177,6 @@ namespace System.Reflection.Emit private bool m_fManifestModuleUsedAsDefinedModule; internal const string MANIFEST_MODULE_NAME = "RefEmit_InMemoryManifestModule"; -#if FEATURE_APPX - private bool m_profileAPICheck; -#endif - internal ModuleBuilder GetModuleBuilder(InternalModuleBuilder module) { Contract.Requires(module != null); @@ -216,16 +212,6 @@ namespace System.Reflection.Emit { return InternalAssembly.GetNativeHandle(); } - -#if FEATURE_APPX - internal bool ProfileAPICheck - { - get - { - return m_profileAPICheck; - } - } -#endif #endregion #region Constructor @@ -301,14 +287,7 @@ namespace System.Reflection.Emit name.Name, access, dir); -#if FEATURE_APPX - if (AppDomain.ProfileAPICheck) - { - RuntimeAssembly creator = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (creator != null && !creator.IsFrameworkAssembly()) - m_profileAPICheck = true; - } -#endif + // Make sure that ManifestModule is properly initialized // We need to do this before setting any CustomAttribute InitManifestModule(); diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs index f0a5945..ec725ac 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -42,16 +42,6 @@ namespace System.Reflection.Emit new DynamicResolver(this)); } -#if FEATURE_APPX - private bool ProfileAPICheck - { - get - { - return ((DynamicMethod)m_methodBuilder).ProfileAPICheck; - } - } -#endif // FEATURE_APPX - // *** ILGenerator api *** public override LocalBuilder DeclareLocal(Type localType, bool pinned) @@ -66,11 +56,6 @@ namespace System.Reflection.Emit if (rtType == null) throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); -#if FEATURE_APPX - if (ProfileAPICheck && (rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName)); -#endif - localBuilder = new LocalBuilder(m_localCount, localType, m_methodBuilder); // add the localType to local signature m_localSignature.AddArgument(localType, pinned); @@ -496,94 +481,36 @@ namespace System.Reflection.Emit #region GetTokenFor helpers private int GetTokenFor(RuntimeType rtType) { -#if FEATURE_APPX - if (ProfileAPICheck && (rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName)); -#endif - return m_scope.GetTokenFor(rtType.TypeHandle); } private int GetTokenFor(RuntimeFieldInfo runtimeField) { -#if FEATURE_APPX - if (ProfileAPICheck) - { - RtFieldInfo rtField = runtimeField as RtFieldInfo; - if (rtField != null && (rtField.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtField.FullName)); - } -#endif - return m_scope.GetTokenFor(runtimeField.FieldHandle); } private int GetTokenFor(RuntimeFieldInfo runtimeField, RuntimeType rtType) { -#if FEATURE_APPX - if (ProfileAPICheck) - { - RtFieldInfo rtField = runtimeField as RtFieldInfo; - if (rtField != null && (rtField.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtField.FullName)); - - if ((rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName)); - } -#endif - return m_scope.GetTokenFor(runtimeField.FieldHandle, rtType.TypeHandle); } private int GetTokenFor(RuntimeConstructorInfo rtMeth) { -#if FEATURE_APPX - if (ProfileAPICheck && (rtMeth.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtMeth.FullName)); -#endif - return m_scope.GetTokenFor(rtMeth.MethodHandle); } private int GetTokenFor(RuntimeConstructorInfo rtMeth, RuntimeType rtType) { -#if FEATURE_APPX - if (ProfileAPICheck) - { - if ((rtMeth.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtMeth.FullName)); - - if ((rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName)); - } -#endif - return m_scope.GetTokenFor(rtMeth.MethodHandle, rtType.TypeHandle); } private int GetTokenFor(RuntimeMethodInfo rtMeth) { -#if FEATURE_APPX - if (ProfileAPICheck && (rtMeth.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtMeth.FullName)); -#endif - return m_scope.GetTokenFor(rtMeth.MethodHandle); } private int GetTokenFor(RuntimeMethodInfo rtMeth, RuntimeType rtType) { -#if FEATURE_APPX - if (ProfileAPICheck) - { - if ((rtMeth.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtMeth.FullName)); - - if ((rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName)); - } -#endif - return m_scope.GetTokenFor(rtMeth.MethodHandle, rtType.TypeHandle); } @@ -594,10 +521,6 @@ namespace System.Reflection.Emit private int GetTokenForVarArgMethod(RuntimeMethodInfo rtMeth, SignatureHelper sig) { -#if FEATURE_APPX - if (ProfileAPICheck && (rtMeth.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtMeth.FullName)); -#endif VarArgMethod varArgMeth = new VarArgMethod(rtMeth, sig); return m_scope.GetTokenFor(varArgMeth); } diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs index 9aae25c..540a5b7 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs @@ -42,13 +42,6 @@ namespace System.Reflection.Emit // assigned by the DynamicResolver ctor internal DynamicResolver m_resolver; - // Always false unless we are in an immersive (non dev mode) process. -#if FEATURE_APPX - private bool m_profileAPICheck; - - private RuntimeAssembly m_creatorAssembly; -#endif - internal bool m_restrictedSkipVisibility; // The context when the method was created. We use this to do the RestrictedMemberAccess checks. // These checks are done when the method is compiled. This can happen at an arbitrary time, @@ -65,13 +58,10 @@ namespace System.Reflection.Emit private DynamicMethod() { } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, Type returnType, Type[] parameterTypes) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - Init(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, @@ -80,18 +70,14 @@ namespace System.Reflection.Emit null, // owner null, // m false, // skipVisibility - true, - ref stackMark); // transparentMethod + true); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, Type returnType, Type[] parameterTypes, bool restrictedSkipVisibility) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - Init(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, @@ -100,18 +86,17 @@ namespace System.Reflection.Emit null, // owner null, // m restrictedSkipVisibility, - true, - ref stackMark); // transparentMethod + true); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Module m) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - PerformSecurityCheck(m, ref stackMark, false); + if (m == null) + throw new ArgumentNullException(nameof(m)); + Init(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, @@ -120,19 +105,18 @@ namespace System.Reflection.Emit null, // owner m, // m false, // skipVisibility - false, - ref stackMark); // transparentMethod + false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Module m, bool skipVisibility) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - PerformSecurityCheck(m, ref stackMark, skipVisibility); + if (m == null) + throw new ArgumentNullException(nameof(m)); + Init(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, @@ -141,11 +125,9 @@ namespace System.Reflection.Emit null, // owner m, // m skipVisibility, - false, - ref stackMark); // transparentMethod + false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, @@ -154,8 +136,9 @@ namespace System.Reflection.Emit Module m, bool skipVisibility) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - PerformSecurityCheck(m, ref stackMark, skipVisibility); + if (m == null) + throw new ArgumentNullException(nameof(m)); + Init(name, attributes, callingConvention, @@ -164,18 +147,17 @@ namespace System.Reflection.Emit null, // owner m, // m skipVisibility, - false, - ref stackMark); // transparentMethod + false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - PerformSecurityCheck(owner, ref stackMark, false); + if (owner == null) + throw new ArgumentNullException(nameof(owner)); + Init(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, @@ -184,19 +166,18 @@ namespace System.Reflection.Emit owner, // owner null, // m false, // skipVisibility - false, - ref stackMark); // transparentMethod + false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, Type returnType, Type[] parameterTypes, Type owner, bool skipVisibility) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - PerformSecurityCheck(owner, ref stackMark, skipVisibility); + if (owner == null) + throw new ArgumentNullException(nameof(owner)); + Init(name, MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard, @@ -205,11 +186,9 @@ namespace System.Reflection.Emit owner, // owner null, // m skipVisibility, - false, - ref stackMark); // transparentMethod + false); } - [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod public DynamicMethod(string name, MethodAttributes attributes, CallingConventions callingConvention, @@ -218,8 +197,9 @@ namespace System.Reflection.Emit Type owner, bool skipVisibility) { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - PerformSecurityCheck(owner, ref stackMark, skipVisibility); + if (owner == null) + throw new ArgumentNullException(nameof(owner)); + Init(name, attributes, callingConvention, @@ -228,8 +208,7 @@ namespace System.Reflection.Emit owner, // owner null, // m skipVisibility, - false, - ref stackMark); // transparentMethod + false); } // helpers for intialization @@ -298,8 +277,7 @@ namespace System.Reflection.Emit Type owner, Module m, bool skipVisibility, - bool transparentMethod, - ref StackCrawlMark stackMark) + bool transparentMethod) { DynamicMethod.CheckConsistency(attributes, callingConvention); @@ -337,7 +315,7 @@ namespace System.Reflection.Emit } else { - Debug.Assert(m != null || owner != null, "PerformSecurityCheck should ensure that either m or owner is set"); + Debug.Assert(m != null || owner != null, "Constructor should ensure that either m or owner is set"); Debug.Assert(m == null || !m.Equals(s_anonymouslyHostedDynamicMethodsModule), "The user cannot explicitly use this assembly"); Debug.Assert(m == null || owner == null, "m and owner cannot both be set"); @@ -371,33 +349,9 @@ namespace System.Reflection.Emit if (name == null) throw new ArgumentNullException(nameof(name)); -#if FEATURE_APPX - if (AppDomain.ProfileAPICheck) - { - if (m_creatorAssembly == null) - m_creatorAssembly = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - - if (m_creatorAssembly != null && !m_creatorAssembly.IsFrameworkAssembly()) - m_profileAPICheck = true; - } -#endif // FEATURE_APPX - m_dynMethod = new RTDynamicMethod(this, name, attributes, callingConvention); } - private void PerformSecurityCheck(Module m, ref StackCrawlMark stackMark, bool skipVisibility) - { - if (m == null) - throw new ArgumentNullException(nameof(m)); - Contract.EndContractBlock(); - } - - private void PerformSecurityCheck(Type owner, ref StackCrawlMark stackMark, bool skipVisibility) - { - if (owner == null) - throw new ArgumentNullException(nameof(owner)); - } - // // Delegate and method creation // @@ -432,22 +386,6 @@ namespace System.Reflection.Emit return d; } -#if FEATURE_APPX - internal bool ProfileAPICheck - { - get - { - return m_profileAPICheck; - } - - [FriendAccessAllowed] - set - { - m_profileAPICheck = value; - } - } -#endif - // This is guaranteed to return a valid handle internal unsafe RuntimeMethodHandle GetMethodDescriptor() { diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs index 2d19203..2dc9f51 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -178,14 +178,6 @@ namespace System.Reflection.Emit { Debug.Assert(method != null); -#if FEATURE_APPX - if (ContainingAssemblyBuilder.ProfileAPICheck) - { - if ((method.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", method.FullName)); - } -#endif - return GetMemberRefOfMethodInfo(GetNativeHandle(), tr, method); } @@ -193,14 +185,6 @@ namespace System.Reflection.Emit { Debug.Assert(method != null); -#if FEATURE_APPX - if (ContainingAssemblyBuilder.ProfileAPICheck) - { - if ((method.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", method.FullName)); - } -#endif - return GetMemberRefOfMethodInfo(GetNativeHandle(), tr, method); } @@ -212,15 +196,6 @@ namespace System.Reflection.Emit { Debug.Assert(runtimeField != null); -#if FEATURE_APPX - if (ContainingAssemblyBuilder.ProfileAPICheck) - { - RtFieldInfo rtField = runtimeField as RtFieldInfo; - if (rtField != null && (rtField.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtField.FullName)); - } -#endif - return GetMemberRefOfFieldInfo(GetNativeHandle(), tkType, declaringType, runtimeField.MetadataToken); } @@ -285,17 +260,6 @@ namespace System.Reflection.Emit Debug.Assert(!type.IsByRef, "Must not be ByRef."); Debug.Assert(!type.IsGenericType || type.IsGenericTypeDefinition, "Must not have generic arguments."); -#if FEATURE_APPX - if (ContainingAssemblyBuilder.ProfileAPICheck) - { - RuntimeType rtType = type as RuntimeType; - if (rtType != null && (rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName)); - } - } -#endif - return GetTypeRef(GetNativeHandle(), typeName, GetRuntimeModuleFromModule(refedModule).GetNativeHandle(), strRefedModuleFileName, tkResolution); } diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/FieldInfo.cs b/src/coreclr/src/mscorlib/src/System/Reflection/FieldInfo.cs index 3ff0f7d..511fef5 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/FieldInfo.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/FieldInfo.cs @@ -323,29 +323,6 @@ namespace System.Reflection private RuntimeType m_fieldType; private INVOCATION_FLAGS m_invocationFlags; -#if FEATURE_APPX - private bool IsNonW8PFrameworkAPI() - { - if (GetRuntimeType().IsNonW8PFrameworkAPI()) - return true; - - // Allow "value__" - if (m_declaringType.IsEnum) - return false; - - RuntimeAssembly rtAssembly = GetRuntimeAssembly(); - if (rtAssembly.IsFrameworkAssembly()) - { - int ctorToken = rtAssembly.InvocableAttributeCtorToken; - if (System.Reflection.MetadataToken.IsNullToken(ctorToken) || - !CustomAttribute.IsAttributeDefined(GetRuntimeModule(), MetadataToken, ctorToken)) - return true; - } - - return false; - } -#endif - internal INVOCATION_FLAGS InvocationFlags { get @@ -390,11 +367,6 @@ namespace System.Reflection invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_FIELD_SPECIAL_CAST; } -#if FEATURE_APPX - if (AppDomain.ProfileAPICheck && IsNonW8PFrameworkAPI()) - invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API; -#endif // FEATURE_APPX - // must be last to avoid threading problems m_invocationFlags = invocationFlags | INVOCATION_FLAGS.INVOCATION_FLAGS_INITIALIZED; } @@ -483,15 +455,6 @@ namespace System.Reflection value = fieldType.CheckValue(value, binder, culture, invokeAttr); #region Security Check -#if FEATURE_APPX - if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", FullName)); - } -#endif - if ((invocationFlags & (INVOCATION_FLAGS.INVOCATION_FLAGS_SPECIAL_FIELD | INVOCATION_FLAGS.INVOCATION_FLAGS_NEED_SECURITY)) != 0) PerformVisibilityCheckOnField(m_fieldHandle, obj, m_declaringType, m_fieldAttributes, (uint)m_invocationFlags); #endregion @@ -556,15 +519,6 @@ namespace System.Reflection CheckConsistency(obj); -#if FEATURE_APPX - if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", FullName)); - } -#endif - RuntimeType fieldType = (RuntimeType)FieldType; if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NEED_SECURITY) != 0) PerformVisibilityCheckOnField(m_fieldHandle, obj, m_declaringType, m_fieldAttributes, (uint)(m_invocationFlags & ~INVOCATION_FLAGS.INVOCATION_FLAGS_SPECIAL_FIELD)); diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/MethodBase.cs b/src/coreclr/src/mscorlib/src/System/Reflection/MethodBase.cs index f80c170..afccf27 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/MethodBase.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/MethodBase.cs @@ -33,7 +33,7 @@ namespace System.Reflection // method INVOCATION_FLAGS_IS_CTOR = 0x00000010, INVOCATION_FLAGS_RISKY_METHOD = 0x00000020, - INVOCATION_FLAGS_NON_W8P_FX_API = 0x00000040, + /* unused 0x00000040 */ INVOCATION_FLAGS_IS_DELEGATE_CTOR = 0x00000080, INVOCATION_FLAGS_CONTAINS_STACK_POINTERS = 0x00000100, // field diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/MethodInfo.cs b/src/coreclr/src/mscorlib/src/System/Reflection/MethodInfo.cs index 89c608b..2205dda 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/MethodInfo.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/MethodInfo.cs @@ -98,37 +98,6 @@ namespace System.Reflection private object m_keepalive; private INVOCATION_FLAGS m_invocationFlags; -#if FEATURE_APPX - private bool IsNonW8PFrameworkAPI() - { - if (m_declaringType.IsArray && IsPublic && !IsStatic) - return false; - - RuntimeAssembly rtAssembly = GetRuntimeAssembly(); - if (rtAssembly.IsFrameworkAssembly()) - { - int ctorToken = rtAssembly.InvocableAttributeCtorToken; - if (System.Reflection.MetadataToken.IsNullToken(ctorToken) || - !CustomAttribute.IsAttributeDefined(GetRuntimeModule(), MetadataToken, ctorToken)) - return true; - } - - if (GetRuntimeType().IsNonW8PFrameworkAPI()) - return true; - - if (IsGenericMethod && !IsGenericMethodDefinition) - { - foreach (Type t in GetGenericArguments()) - { - if (((RuntimeType)t).IsNonW8PFrameworkAPI()) - return true; - } - } - - return false; - } -#endif - internal INVOCATION_FLAGS InvocationFlags { get @@ -179,11 +148,6 @@ namespace System.Reflection } } -#if FEATURE_APPX - if (AppDomain.ProfileAPICheck && IsNonW8PFrameworkAPI()) - invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API; -#endif // FEATURE_APPX - m_invocationFlags = invocationFlags | INVOCATION_FLAGS.INVOCATION_FLAGS_INITIALIZED; } @@ -591,20 +555,6 @@ namespace System.Reflection { object[] arguments = InvokeArgumentsCheck(obj, invokeAttr, binder, parameters, culture); - #region Security Check - INVOCATION_FLAGS invocationFlags = InvocationFlags; - -#if FEATURE_APPX - if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", FullName)); - } -#endif - #endregion - return UnsafeInvokeInternal(obj, parameters, arguments); } diff --git a/src/coreclr/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/coreclr/src/mscorlib/src/System/Resources/ResourceManager.cs index 94bc720..c60e822 100644 --- a/src/coreclr/src/mscorlib/src/System/Resources/ResourceManager.cs +++ b/src/coreclr/src/mscorlib/src/System/Resources/ResourceManager.cs @@ -953,7 +953,7 @@ namespace System.Resources { // Cannot load the WindowsRuntimeResourceManager when in a compilation process, since it // lives in System.Runtime.WindowsRuntime and only mscorlib may be loaded for execution. - if (AppDomain.IsAppXModel() && !AppDomain.IsAppXNGen) + if (AppDomain.IsAppXModel()) { s_IsAppXModel = true; diff --git a/src/coreclr/src/mscorlib/src/System/RtType.cs b/src/coreclr/src/mscorlib/src/System/RtType.cs index 047e2e2..9bdeab0 100644 --- a/src/coreclr/src/mscorlib/src/System/RtType.cs +++ b/src/coreclr/src/mscorlib/src/System/RtType.cs @@ -2431,65 +2431,6 @@ namespace System private IntPtr m_cache; internal IntPtr m_handle; -#if FEATURE_APPX - private INVOCATION_FLAGS m_invocationFlags; - - internal bool IsNonW8PFrameworkAPI() - { - if (IsGenericParameter) - return false; - - if (HasElementType) - return ((RuntimeType)GetElementType()).IsNonW8PFrameworkAPI(); - - if (IsSimpleTypeNonW8PFrameworkAPI()) - return true; - - if (IsGenericType && !IsGenericTypeDefinition) - { - foreach (Type t in GetGenericArguments()) - { - if (((RuntimeType)t).IsNonW8PFrameworkAPI()) - return true; - } - } - - return false; - } - - private bool IsSimpleTypeNonW8PFrameworkAPI() - { - RuntimeAssembly rtAssembly = GetRuntimeAssembly(); - if (rtAssembly.IsFrameworkAssembly()) - { - int ctorToken = rtAssembly.InvocableAttributeCtorToken; - if (System.Reflection.MetadataToken.IsNullToken(ctorToken) || - !CustomAttribute.IsAttributeDefined(GetRuntimeModule(), MetadataToken, ctorToken)) - return true; - } - - return false; - } - - internal INVOCATION_FLAGS InvocationFlags - { - get - { - if ((m_invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_INITIALIZED) == 0) - { - INVOCATION_FLAGS invocationFlags = INVOCATION_FLAGS.INVOCATION_FLAGS_UNKNOWN; - - if (AppDomain.ProfileAPICheck && IsNonW8PFrameworkAPI()) - invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API; - - m_invocationFlags = invocationFlags | INVOCATION_FLAGS.INVOCATION_FLAGS_INITIALIZED; - } - - return m_invocationFlags; - } - } -#endif // FEATURE_APPX - internal static readonly RuntimeType ValueType = (RuntimeType)typeof(System.ValueType); internal static readonly RuntimeType EnumType = (RuntimeType)typeof(System.Enum); @@ -4859,28 +4800,11 @@ namespace System RuntimeMethodHandleInternal runtime_ctor = default(RuntimeMethodHandleInternal); bool bNeedSecurityCheck = true; bool bCanBeCached = false; - bool bSecurityCheckOff = false; + bool bSecurityCheckOff; if (!skipCheckThis) CreateInstanceCheckThis(); - if (!fillCache) - bSecurityCheckOff = true; - -#if FEATURE_APPX - INVOCATION_FLAGS invocationFlags = InvocationFlags; - if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0) - { - RuntimeAssembly caller = RuntimeAssembly.GetExecutingAssembly(ref stackMark); - if (caller != null && !caller.IsSafeForReflection()) - throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", this.FullName)); - - // Allow it because the caller is framework code, but don't cache the result - // because we need to do the stack walk every time this type is instantiated. - bSecurityCheckOff = false; - bCanBeCached = false; - } -#endif bSecurityCheckOff = true; // CoreCLR does not use security at all. Object instance = RuntimeTypeHandle.CreateInstance(this, publicOnly, bSecurityCheckOff, ref bCanBeCached, ref runtime_ctor, ref bNeedSecurityCheck); diff --git a/src/coreclr/src/vm/appdomain.cpp b/src/coreclr/src/vm/appdomain.cpp index e63890f..127dbba 100644 --- a/src/coreclr/src/vm/appdomain.cpp +++ b/src/coreclr/src/vm/appdomain.cpp @@ -2747,10 +2747,6 @@ void SystemDomain::LoadBaseSystemClasses() _ASSERTE(!g_pEnumClass->IsValueType()); // Load System.RuntimeType - // We need to load this after ValueType and Enum because RuntimeType now - // contains an enum field (m_invocationFlags). Otherwise INVOCATION_FLAGS - // would be treated as a reference type and clr!SigPointer::GetTypeHandleThrowing - // throws an exception. g_pRuntimeTypeClass = MscorlibBinder::GetClass(CLASS__CLASS); _ASSERTE(g_pRuntimeTypeClass->IsFullyLoaded()); diff --git a/src/coreclr/src/vm/appdomainnative.cpp b/src/coreclr/src/vm/appdomainnative.cpp index 7ac3b18..de97fc5 100644 --- a/src/coreclr/src/vm/appdomainnative.cpp +++ b/src/coreclr/src/vm/appdomainnative.cpp @@ -387,12 +387,8 @@ enum APPX_FLAGS_APPX_MODEL = 0x02, APPX_FLAGS_APPX_DESIGN_MODE = 0x04, - APPX_FLAGS_APPX_NGEN = 0x08, APPX_FLAGS_APPX_MASK = APPX_FLAGS_APPX_MODEL | - APPX_FLAGS_APPX_DESIGN_MODE | - APPX_FLAGS_APPX_NGEN, - - APPX_FLAGS_API_CHECK = 0x10, + APPX_FLAGS_APPX_DESIGN_MODE, }; // static @@ -410,28 +406,6 @@ INT32 QCALLTYPE AppDomainNative::GetAppXFlags() if (AppX::IsAppXDesignMode()) flags |= APPX_FLAGS_APPX_DESIGN_MODE; - else - flags |= APPX_FLAGS_API_CHECK; - - if (AppX::IsAppXNGen()) - flags |= APPX_FLAGS_APPX_NGEN; - } - - // - // 0: normal (only check in non-dev-mode APPX) - // 1: always check - // 2: never check - // - switch (g_pConfig->GetWindows8ProfileAPICheckFlag()) - { - case 1: - flags |= APPX_FLAGS_API_CHECK; - break; - case 2: - flags &= ~APPX_FLAGS_API_CHECK; - break; - default: - break; } END_QCALL; diff --git a/src/coreclr/src/vm/eeconfig.cpp b/src/coreclr/src/vm/eeconfig.cpp index a44039d..b881c43 100644 --- a/src/coreclr/src/vm/eeconfig.cpp +++ b/src/coreclr/src/vm/eeconfig.cpp @@ -1281,10 +1281,6 @@ HRESULT EEConfig::sync() dwSleepOnExit = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_SleepOnExit); -#ifdef FEATURE_APPX - dwWindows8ProfileAPICheckFlag = CLRConfig::GetConfigValue(CLRConfig::INTERNAL_Windows8ProfileAPICheckFlag); -#endif - return hr; } diff --git a/src/coreclr/src/vm/eeconfig.h b/src/coreclr/src/vm/eeconfig.h index 8e21c44..2e89116 100644 --- a/src/coreclr/src/vm/eeconfig.h +++ b/src/coreclr/src/vm/eeconfig.h @@ -1262,14 +1262,6 @@ private: public: DWORD GetSleepOnExit() { return dwSleepOnExit; } - -#if FEATURE_APPX -private: - DWORD dwWindows8ProfileAPICheckFlag; - -public: - DWORD GetWindows8ProfileAPICheckFlag() { return dwWindows8ProfileAPICheckFlag; } -#endif }; diff --git a/src/coreclr/src/vm/mscorlib.h b/src/coreclr/src/vm/mscorlib.h index f0850b7..244b690 100644 --- a/src/coreclr/src/vm/mscorlib.h +++ b/src/coreclr/src/vm/mscorlib.h @@ -226,9 +226,6 @@ DEFINE_CLASS_U(System, RuntimeType, ReflectClassBaseO DEFINE_FIELD_U(m_cache, ReflectClassBaseObject, m_cache) DEFINE_FIELD_U(m_handle, ReflectClassBaseObject, m_typeHandle) DEFINE_FIELD_U(m_keepalive, ReflectClassBaseObject, m_keepalive) -#ifdef FEATURE_APPX -DEFINE_FIELD_U(m_invocationFlags, ReflectClassBaseObject, m_invocationFlags) -#endif DEFINE_CLASS(CLASS, System, RuntimeType) DEFINE_FIELD(CLASS, TYPEHANDLE, m_handle) DEFINE_METHOD(CLASS, GET_PROPERTIES, GetProperties, IM_BindingFlags_RetArrPropertyInfo) diff --git a/src/coreclr/src/vm/object.h b/src/coreclr/src/vm/object.h index 65969bf..fad5f74 100644 --- a/src/coreclr/src/vm/object.h +++ b/src/coreclr/src/vm/object.h @@ -1284,9 +1284,6 @@ protected: OBJECTREF m_keepalive; OBJECTREF m_cache; TypeHandle m_typeHandle; -#ifdef FEATURE_APPX - UINT32 m_invocationFlags; -#endif #ifdef _DEBUG void TypeCheck() -- 2.7.4