[Mono-devel-list] CAS - Patch for metadata

Paolo Molaro lupus at ximian.com
Mon Nov 29 05:17:20 EST 2004


On 11/25/04 Sebastien Pouliot wrote:
> Index: mono/metadata/reflection.h
> ===================================================================
> --- mono/metadata/reflection.h	(revision 36573)
> +++ mono/metadata/reflection.h	(working copy)
> @@ -76,5 +76,32 @@
>  MonoCustomAttrInfo* mono_custom_attrs_from_param    (MonoMethod *method, guint32 param);
>  void                mono_custom_attrs_free          (MonoCustomAttrInfo *ainfo);
>  
> +
> +#define MONO_DECLSEC_ACTION_MIN		0x1
> +#define MONO_DECLSEC_ACTION_MAX		0x12
> +
> +#define MONO_DECLSEC_FLAG_REQUEST			0x00000001
> +#define MONO_DECLSEC_FLAG_DEMAND			0x00000002
> +#define MONO_DECLSEC_FLAG_ASSERT			0x00000004
> +#define MONO_DECLSEC_FLAG_DENY				0x00000008
> +#define MONO_DECLSEC_FLAG_PERMITONLY			0x00000010
> +#define MONO_DECLSEC_FLAG_LINKDEMAND			0x00000020
> +#define MONO_DECLSEC_FLAG_INHERITANCEDEMAND		0x00000040
> +#define MONO_DECLSEC_FLAG_REQUEST_MINIMUM		0x00000080
> +#define MONO_DECLSEC_FLAG_REQUEST_OPTIONAL		0x00000100
> +#define MONO_DECLSEC_FLAG_REQUEST_REFUSE		0x00000200
> +#define MONO_DECLSEC_FLAG_PREJIT_GRANT			0x00000400
> +#define MONO_DECLSEC_FLAG_PREJIT_DENY			0x00000800
> +#define MONO_DECLSEC_FLAG_NONCAS_DEMAND			0x00001000
> +#define MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND		0x00002000
> +#define MONO_DECLSEC_FLAG_NONCAS_INHERITANCEDEMAND	0x00004000
> +#define MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE		0x00008000
> +#define MONO_DECLSEC_FLAG_INHERITANCEDEMAND_CHOICE	0x00010000
> +#define MONO_DECLSEC_FLAG_DEMAND_CHOICE			0x00020000

Use an enum for all the MONO_DECLSEC_* values.

> Index: mono/metadata/reflection.c
> ===================================================================
> --- mono/metadata/reflection.c	(revision 36573)
> +++ mono/metadata/reflection.c	(working copy)
> @@ -8735,3 +8735,119 @@
>  	return result;
>  }
>  
> +
> +/* SECURITY_ACTION_* are defined in mono/metadata/tabledefs.h */
> +static guint32 declsec_flags_map[] = {

Make it const, so it doesn't take read-write memory at runtime.

After the changes feel free to commit.
Thanks!
lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list