+2004-12-21 Sebastien Pouliot <sebastien@ximian.com>
+
+ * icall.c: Added an internal call to retrieve the position and length
+ of assembly-level declarative security attributes (RequestMinimum,
+ RequestOptional and RequestRefuse). This is used by the Assembly class
+ to re-create the corresponding permission sets.
Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
mono_image_close (image);
}
+static MonoBoolean
+ves_icall_System_Reflection_Assembly_LoadPermissions (MonoReflectionAssembly *assembly,
+ char **minimum, guint32 *minLength, char **optional, guint32 *optLength, char **refused, guint32 *refLength)
+{
+ MonoBoolean result = FALSE;
+ MonoDeclSecurityEntry entry;
+
+ /* SecurityAction.RequestMinimum */
+ if (mono_declsec_get_assembly_action (assembly->assembly, SECURITY_ACTION_REQMIN, &entry)) {
+ *minimum = entry.blob;
+ *minLength = entry.size;
+ result = TRUE;
+ }
+ /* SecurityAction.RequestOptional */
+ if (mono_declsec_get_assembly_action (assembly->assembly, SECURITY_ACTION_REQOPT, &entry)) {
+ *optional = entry.blob;
+ *optLength = entry.size;
+ result = TRUE;
+ }
+ /* SecurityAction.RequestRefuse */
+ if (mono_declsec_get_assembly_action (assembly->assembly, SECURITY_ACTION_REQREFUSE, &entry)) {
+ *refused = entry.blob;
+ *refLength = entry.size;
+ result = TRUE;
+ }
+
+ return result;
+}
+
static MonoArray*
mono_module_get_types (MonoDomain *domain, MonoImage *image,
MonoBoolean exportedOnly)
{"InternalGetType", ves_icall_System_Reflection_Assembly_InternalGetType},
{"InternalImageRuntimeVersion", ves_icall_System_Reflection_Assembly_InternalImageRuntimeVersion},
{"LoadFrom", ves_icall_System_Reflection_Assembly_LoadFrom},
+ {"LoadPermissions", ves_icall_System_Reflection_Assembly_LoadPermissions},
/*
* Private icalls for the Mono Debugger
*/