2 * declsec.h: Declarative Security support
5 * Sebastien Pouliot <sebastien@ximian.com>
7 * (C) 2004-2005 Novell (http://www.novell.com)
10 #ifndef _MONO_MINI_DECLSEC_H_
11 #define _MONO_MINI_DECLSEC_H_
15 #include "mono/metadata/class-internals.h"
16 #include "mono/metadata/domain-internals.h"
17 #include "mono/metadata/object.h"
18 #include "mono/metadata/tabledefs.h"
19 #include "mono/metadata/marshal.h"
20 #include "mono/metadata/security-manager.h"
21 #include "mono/metadata/exception.h"
26 #define MONO_SECMAN_FLAG_INIT(x) (x & 0x2)
27 #define MONO_SECMAN_FLAG_GET_VALUE(x) (x & 0x1)
28 #define MONO_SECMAN_FLAG_SET_VALUE(x,y) do { x = ((y) ? 0x3 : 0x2); } while (0)
30 #define MONO_CAS_INITIAL_STACK_SIZE 6
33 /* keep in synch with RuntimeSecurityFrame in /mcs/class/corlib/System.Security/SecurityFrame.cs */
36 MonoAppDomain *domain;
37 MonoReflectionMethod *method;
38 MonoDeclSecurityEntry assert;
39 MonoDeclSecurityEntry deny;
40 MonoDeclSecurityEntry permitonly;
44 /* limited flags used in MonoJitInfo for stack modifiers */
46 MONO_JITINFO_STACKMOD_ASSERT = 0x01,
47 MONO_JITINFO_STACKMOD_DENY = 0x02,
48 MONO_JITINFO_STACKMOD_PERMITONLY = 0x04
52 MONO_JIT_SECURITY_OK = 0x00,
53 MONO_JIT_LINKDEMAND_PERMISSION = 0x01,
54 MONO_JIT_LINKDEMAND_APTC = 0x02,
55 MONO_JIT_LINKDEMAND_ECMA = 0x04,
56 MONO_JIT_LINKDEMAND_PINVOKE = 0x08
60 MonoBoolean mono_method_has_declsec (MonoMethod *method);
61 void mono_declsec_cache_stack_modifiers (MonoJitInfo *jinfo);
62 MonoSecurityFrame* mono_declsec_create_frame (MonoDomain *domain, MonoJitInfo *jinfo);
64 guint32 mono_declsec_linkdemand (MonoDomain *domain, MonoMethod *caller, MonoMethod *callee);
66 #endif /* _MONO_MINI_DECLSEC_H_ */