diff options
author | danmosemsft <danmose@microsoft.com> | 2017-02-10 17:12:53 -0800 |
---|---|---|
committer | danmosemsft <danmose@microsoft.com> | 2017-02-10 21:36:06 -0800 |
commit | 54891e0650e69f08832f75a40dc102efc6115d38 (patch) | |
tree | 0e032a0b337767801f696cbaeacded267c694f32 /src/vm/invokeutil.cpp | |
parent | 396f7d43b3c0f3ca7034a6d1d9cd7d6914778a1e (diff) | |
download | coreclr-54891e0650e69f08832f75a40dc102efc6115d38.tar.gz coreclr-54891e0650e69f08832f75a40dc102efc6115d38.tar.bz2 coreclr-54891e0650e69f08832f75a40dc102efc6115d38.zip |
Remove always defined FEATURE_CORECLR
Diffstat (limited to 'src/vm/invokeutil.cpp')
-rw-r--r-- | src/vm/invokeutil.cpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/src/vm/invokeutil.cpp b/src/vm/invokeutil.cpp index f53c8fe546..63979a3b21 100644 --- a/src/vm/invokeutil.cpp +++ b/src/vm/invokeutil.cpp @@ -1551,14 +1551,6 @@ void InvokeUtil::CanAccessClass(RefSecContext* pCtx, InvokeUtil::CheckAccessClass(pCtx, pClass, checkAccessForImplicitValueTypeCtor); -#ifndef FEATURE_CORECLR - // Reflection invocation should turn critical method access into a full demand of full trust - // for level 2 assemblies. - if (InvokeUtil::IsCriticalWithConversionToFullDemand(pClass)) - { - Security::SpecialDemand(SSWT_LATEBOUND_LINKDEMAND, SECURITY_FULL_TRUST); - } -#endif //FEATURE_CORECLR } #ifndef DACCESS_COMPILE @@ -1579,30 +1571,12 @@ void InvokeUtil::CanAccessMethod(MethodDesc* pMeth, } CONTRACTL_END; -#ifndef FEATURE_CORECLR - // Security checks are expensive as they involve stack walking. Avoid them if we can. - // In immersive we don't allow private reflection to framework code. So we need to perform - // the access check even if all the domains on the stack are fully trusted. - if (Security::AllDomainsOnStackFullyTrusted() && !AppX::IsAppXProcess() && !pParentMT->GetAssembly()->IsDisabledPrivateReflection()) - return; -#endif // FEATURE_CORECLR InvokeUtil::CheckAccessMethod(pSCtx, pParentMT, pInstanceMT, pMeth); -#ifndef FEATURE_CORECLR - // Reflection invocation should turn critical method access into a full demand of full trust - // for level 2 assemblies. - if (fCriticalToFullDemand && InvokeUtil::IsCriticalWithConversionToFullDemand(pMeth, pParentMT)) - { - Security::SpecialDemand(SSWT_LATEBOUND_LINKDEMAND, SECURITY_FULL_TRUST); - - // No need to do any more checks if a full trust full demand has succeeded. - return; - } -#endif //FEATURE_CORECLR if (pMeth->RequiresLinktimeCheck()) { @@ -1648,7 +1622,6 @@ void InvokeUtil::CanAccessMethod(MethodDesc* pMeth, GCPROTECT_END(); -#ifdef FEATURE_CORECLR if (pMeth->IsNDirect() || (pMeth->IsComPlusCall() && !pMeth->IsInterface())) { @@ -1664,27 +1637,6 @@ void InvokeUtil::CanAccessMethod(MethodDesc* pMeth, } } -#else // FEATURE_CORECLR - // We perform automatic linktime checks for UnmanagedCode in three cases: - // o P/Invoke calls. - // o Calls through an interface that have a suppress runtime check - // attribute on them (these are almost certainly interop calls). - // o Interop calls made through method impls. - if (pMeth->IsNDirect() || - (pMeth->IsInterface() && - (pMeth->GetMDImport()->GetCustomAttributeByName(pParentMT->GetCl(), - COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI, - NULL, - NULL) == S_OK || - pMeth->GetMDImport()->GetCustomAttributeByName(pMeth->GetMemberDef(), - COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI, - NULL, - NULL) == S_OK) ) || - (pMeth->IsComPlusCall() && !pMeth->IsInterface())) - { - Security::SpecialDemand(SSWT_LATEBOUND_LINKDEMAND, SECURITY_UNMANAGED_CODE); - } -#endif // FEATURE_CORECLR } // @todo: @@ -1712,9 +1664,6 @@ void InvokeUtil::CanAccessMethod(MethodDesc* pMeth, } } -#ifndef FEATURE_CORECLR - Security::SpecialDemand(SSWT_LATEBOUND_LINKDEMAND, SECURITY_SKIP_VER); -#endif // !FEATURE_CORECLR } } #endif // #ifndef DACCESS_COMPILE @@ -1734,14 +1683,6 @@ void InvokeUtil::CanAccessField(RefSecContext* pCtx, InvokeUtil::CheckAccessField(pCtx, pTargetMT, pInstanceMT, pTargetField); -#ifndef FEATURE_CORECLR - // Reflection invocation should turn critical method access into a full demand of full trust - // for level 2 assemblies. - if (InvokeUtil::IsCriticalWithConversionToFullDemand(pTargetField, pInstanceMT)) - { - Security::SpecialDemand(SSWT_LATEBOUND_LINKDEMAND, SECURITY_FULL_TRUST); - } -#endif //FEATURE_CORECLR } // @@ -1990,7 +1931,6 @@ AccessCheckOptions::AccessCheckType InvokeUtil::GetInvocationAccessCheckType(BOO AppDomain * pAppDomain = GetAppDomain(); -#ifdef FEATURE_CORECLR if (pAppDomain->GetSecurityDescriptor()->IsFullyTrusted()) // Ignore transparency so that reflection invocation is consistenct with LCG. @@ -1999,14 +1939,6 @@ AccessCheckOptions::AccessCheckType InvokeUtil::GetInvocationAccessCheckType(BOO return AccessCheckOptions::kMemberAccess; -#else // !FEATURE_CORECLR - return - AppX::IsAppXProcess() ? - (Security::AllDomainsOnStackFullyTrusted() ? - AccessCheckOptions::kUserCodeOnlyRestrictedMemberAccessNoTransparency : - AccessCheckOptions::kUserCodeOnlyRestrictedMemberAccess) : - AccessCheckOptions::kRestrictedMemberAccess; -#endif //FEATURE_CORECLR } #endif // CROSSGEN_COMPILE |