#endregion
#region FCalls
+#if FEATURE_CAS_POLICY
[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.InternalCall)]
unsafe private static extern void _GetSecurityAttributes(RuntimeModule module, int token, bool assembly, out object[] securityAttributes);
{
_GetSecurityAttributes(module.GetNativeHandle(), token, assembly, out securityAttributes);
}
+#else
+ internal static void GetSecurityAttributes(RuntimeModule module, int token, bool assembly, out object[] securityAttributes)
+ {
+ securityAttributes = null;
+ }
+#endif
#endregion
#region Static Constructor
//AllowMultiple is true for TypeForwardedToAttribute
//Contract.Assert(usage.AllowMultiple == false, "Pseudo CA Error");
}
- #endregion
+#endregion
- #region Internal Static
+#region Internal Static
internal static bool IsSecurityAttribute(RuntimeType type)
{
#pragma warning disable 618
{
return false;
}
- #endregion
+#endregion
}
}
}
FCIMPLEND
+#ifdef FEATURE_CAS_POLICY
FCIMPL4(VOID, COMCustomAttribute::GetSecurityAttributes, ReflectModuleBaseObject *pModuleUNSAFE, DWORD tkToken, CLR_BOOL fAssembly, PTRARRAYREF* ppArray)
{
FCALL_CONTRACT;
HELPER_METHOD_FRAME_END();
}
FCIMPLEND
+#endif // FEATURE_CAS_POLICY
FCIMPL7(void, COMCustomAttribute::GetPropertyOrFieldData, ReflectModuleBaseObject *pModuleUNSAFE, BYTE** ppBlobStart, BYTE* pBlobEnd, STRINGREF* pName, CLR_BOOL* pbIsProperty, OBJECTREF* pType, OBJECTREF* value)
{
FCFuncElement("ParseAttributeArguments", Attribute::ParseAttributeArguments)
FCFuncEnd()
+#ifdef FEATURE_CAS_POLICY
FCFuncStart(gPseudoCustomAttribute)
FCFuncElement("_GetSecurityAttributes", COMCustomAttribute::GetSecurityAttributes)
FCFuncEnd()
+#endif
FCFuncStart(gCOMCustomAttributeFuncs)
FCFuncElement("_ParseAttributeUsageAttribute", COMCustomAttribute::ParseAttributeUsageAttribute)
FCClassElement("ProfileOptimization", "System.Runtime", gProfileOptimizationFuncs)
#endif // defined(FEATURE_MULTICOREJIT) && !defined(FEATURE_CORECLR)
+#ifdef FEATURE_CAS_POLICY
FCClassElement("PseudoCustomAttribute", "System.Reflection", gPseudoCustomAttribute)
+#endif
#ifdef FEATURE_CORECLR
FCClassElement("PunkSafeHandle", "System.Reflection.Emit", gSymWrapperCodePunkSafeHandleFuncs)
#endif
ppbData,
pcbData);
}
-#endif // FEATURE_CAS_POLICY
-#ifdef FEATURE_CAS_POLICY
static void SetupRestrictSecAttributes()
{
CONTRACTL {
}
EX_END_CATCH(RethrowTerminalExceptions)
}
-#endif // FEATURE_CAS_POLICY
Assembly* SecurityAttributes::LoadAssemblyFromToken(IMetaDataAssemblyImport *pImport, mdAssemblyRef tkAssemblyRef)
{
COMPlusThrowHR(hr);
}
-#ifdef FEATURE_CAS_POLICY
HRESULT SecurityAttributes::TranslateSecurityAttributesHelper(
CORSEC_ATTRSET *pAttrSet,
BYTE **ppbOutput,
EX_CATCH_HRESULT(hr);
return hr;
}
-#endif // FEATURE_CAS_POLICY
// Call into managed code to group permissions into a PermissionSet and serialize it to XML
void SecurityAttributes::AttrArrayToPermissionSet(OBJECTREF* attrArray,
GCPROTECT_END();
}
-
+#endif // FEATURE_CAS_POLICY
//
// This is a public exported method
MODE_COOPERATIVE;
} CONTRACTL_END;
+#ifdef FEATURE_CAS_POLICY
OBJECTREF orRet;
orRet = GetManagedPsetObject();
} else {
-#ifdef FEATURE_CAS_POLICY
SecurityAttributes::XmlToPermissionSet(m_pKey->m_pbPset,
m_pKey->m_cbPset,
&gc.pset,
0,
&gc.orNonCasPset,
&gc.orNonCasEncoding);
-#else
- // The v1.x serialized permission set format is not supported on CoreCLR
- COMPlusThrowHR(CORSECATTR_E_BAD_ATTRIBUTE);
-#endif //FEATURE_CAS_POLICY
}
StoreFirstObjectInHandle(m_handle, gc.pset);
orRet = GetManagedPsetObject();
return orRet;
+#else
+ return NULL;
+#endif
}
#endif // CROSSGEN_COMPILE