summaryrefslogtreecommitdiff
path: root/src/vm/comdelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm/comdelegate.cpp')
-rw-r--r--src/vm/comdelegate.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/vm/comdelegate.cpp b/src/vm/comdelegate.cpp
index 4c85a0216e..ae65afcde0 100644
--- a/src/vm/comdelegate.cpp
+++ b/src/vm/comdelegate.cpp
@@ -1098,7 +1098,6 @@ void COMDelegate::BindToMethod(DELEGATEREF *pRefThis,
GCPROTECT_END();
}
-#ifdef FEATURE_CORECLR
// On the CoreCLR, we don't allow non-fulltrust delegates to be marshaled out (or created: CorHost::CreateDelegate ensures that)
// This helper function checks if we have a full-trust delegate with AllowReversePInvokeCallsAttribute targets.
BOOL COMDelegate::IsFullTrustDelegate(DELEGATEREF pDelegate)
@@ -1218,7 +1217,6 @@ BOOL COMDelegate::IsMethodAllowedToSinkReversePInvoke(MethodDesc *pMD)
NULL));
#endif // FEATURE_WINDOWSPHONE
}
-#endif // FEATURE_CORECLR
// Marshals a managed method to an unmanaged callback provided the
// managed method is static and it's parameters require no marshalling.
@@ -1312,7 +1310,6 @@ LPVOID COMDelegate::ConvertToCallback(OBJECTREF pDelegateObj)
MethodTable* pMT = pDelegate->GetMethodTable();
DelegateEEClass* pClass = (DelegateEEClass*)(pMT->GetClass());
-#ifdef FEATURE_CORECLR
// On the CoreCLR, we only allow marshaling out delegates that we can guarantee are full-trust delegates
if (!IsFullTrustDelegate(pDelegate))
{
@@ -1320,7 +1317,6 @@ LPVOID COMDelegate::ConvertToCallback(OBJECTREF pDelegateObj)
TypeString::AppendType(strDelegateType, pMT, TypeString::FormatNamespace | TypeString::FormatAngleBrackets| TypeString::FormatSignature);
COMPlusThrow(kSecurityException, IDS_E_DELEGATE_FULLTRUST_ARPIC_1, strDelegateType.GetUnicode());
}
-#endif
if (pMT->HasInstantiation())
COMPlusThrowArgumentException(W("delegate"), W("Argument_NeedNonGenericType"));
@@ -1502,13 +1498,11 @@ OBJECTREF COMDelegate::ConvertToDelegate(LPVOID pCallback, MethodTable* pMT)
if (pUMEntryThunk->GetDomainId() != GetAppDomain()->GetId())
COMPlusThrow(kNotSupportedException, W("NotSupported_DelegateMarshalToWrongDomain"));
-#ifdef FEATURE_CORECLR
// On the CoreCLR, we only allow marshaling out delegates that we can guarantee are full-trust delegates
if (!IsFullTrustDelegate((DELEGATEREF)pDelegate))
{
COMPlusThrow(kSecurityException, IDS_E_DELEGATE_FULLTRUST_ARPIC_2);
}
-#endif
GCPROTECT_END();
return pDelegate;
@@ -1590,13 +1584,6 @@ OBJECTREF COMDelegate::ConvertToDelegate(LPVOID pCallback, MethodTable* pMT)
MethodDesc *pStubMD = pClass->m_pForwardStubMD;
_ASSERTE(pStubMD != NULL && pStubMD->IsILStub());
-#ifndef FEATURE_CORECLR
- if (pStubMD->AsDynamicMethodDesc()->HasCopyCtorArgs())
- {
- // static stub that gets its arguments in a thread-static field
- pInterceptStub = NDirect::GetStubForCopyCtor();
- }
-#endif // !FEATURE_CORECLR
#ifdef MDA_SUPPORTED
if (MDA_GET_ASSISTANT(PInvokeStackImbalance))
@@ -1630,13 +1617,11 @@ OBJECTREF COMDelegate::ConvertToDelegate(LPVOID pCallback, MethodTable* pMT)
GCPROTECT_END();
#endif // defined(_TARGET_X86_)
-#ifdef FEATURE_CORECLR
// On the CoreCLR, we only allow marshaling out delegates that we can guarantee are full-trust delegates
if (!IsFullTrustDelegate(delObj))
{
COMPlusThrow(kSecurityException, IDS_E_DELEGATE_FULLTRUST_ARPIC_2);
}
-#endif
return delObj;
}
@@ -2182,17 +2167,6 @@ void COMDelegate::DoUnmanagedCodeAccessCheck(MethodDesc* pMeth)
{
// Check whether this is actually a SuppressUnmanagedCodePermission attribute and
// if so, don't do a demand
-#ifndef FEATURE_CORECLR
- MethodTable* pMTMeth = pMeth->GetMethodTable();
- if (pMTMeth->GetMDImport()->GetCustomAttributeByName(pMeth->GetMethodTable()->GetCl(),
- COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI,
- NULL,
- NULL) == S_OK ||
- pMTMeth->GetMDImport()->GetCustomAttributeByName(pMeth->GetMemberDef(),
- COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI,
- NULL,
- NULL) == S_OK)
-#endif
{
return;
}
@@ -3800,7 +3774,6 @@ BOOL COMDelegate::ValidateSecurityTransparency(MethodDesc *pFtn, MethodTable *pd
{
WRAPPER_NO_CONTRACT;
-#ifdef FEATURE_CORECLR
if (GetAppDomain()->GetSecurityDescriptor()->IsFullyTrusted())
return TRUE;
@@ -3811,9 +3784,6 @@ BOOL COMDelegate::ValidateSecurityTransparency(MethodDesc *pFtn, MethodTable *pd
// 1. the delegate is critical and the target method is critical, or
// 2. the delegate is transparent/safecritical and the target method is transparent/safecritical
return (fCriticalDelegate == fCriticalTarget);
-#else
- return TRUE;
-#endif // !FEATURE_CORECLR
}