X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fcil-coff.h;h=098057f6fc36d310729c1a893764c69357b28b9e;hb=94d44cb64a97e7252140bf7dd8e77071eda8480d;hp=1393c801306c8daf26e4319a1dc65ec5f386c64f;hpb=cfd0ebeef7cc4f49e09058b2f03b9746c284bbd1;p=mono.git diff --git a/mono/metadata/cil-coff.h b/mono/metadata/cil-coff.h index 1393c801306..098057f6fc3 100644 --- a/mono/metadata/cil-coff.h +++ b/mono/metadata/cil-coff.h @@ -29,7 +29,10 @@ /* 128 bytes */ typedef struct { - char msdos_header [60]; + char msdos_sig [2]; + guint16 nlast_page; + guint16 npages; + char msdos_header [54]; guint32 pe_offset; char msdos_header2 [64]; } MonoMSDOSHeader; @@ -86,6 +89,74 @@ typedef struct { guint32 pe_data_dir_count; } MonoPEHeaderNT; +typedef struct { + guint32 rde_data_offset; + guint32 rde_size; + guint32 rde_codepage; + guint32 rde_reserved; +} MonoPEResourceDataEntry; + +#define MONO_PE_RESOURCE_ID_CURSOR 0x01 +#define MONO_PE_RESOURCE_ID_BITMAP 0x02 +#define MONO_PE_RESOURCE_ID_ICON 0x03 +#define MONO_PE_RESOURCE_ID_MENU 0x04 +#define MONO_PE_RESOURCE_ID_DIALOG 0x05 +#define MONO_PE_RESOURCE_ID_STRING 0x06 +#define MONO_PE_RESOURCE_ID_FONTDIR 0x07 +#define MONO_PE_RESOURCE_ID_FONT 0x08 +#define MONO_PE_RESOURCE_ID_ACCEL 0x09 +#define MONO_PE_RESOURCE_ID_RCDATA 0x0a +#define MONO_PE_RESOURCE_ID_MESSAGETABLE 0x0b +#define MONO_PE_RESOURCE_ID_GROUP_CURSOR 0x0c +#define MONO_PE_RESOURCE_ID_GROUP_ICON 0x0d +#define MONO_PE_RESOURCE_ID_VERSION 0x10 +#define MONO_PE_RESOURCE_ID_DLGINCLUDE 0x11 +#define MONO_PE_RESOURCE_ID_PLUGPLAY 0x13 +#define MONO_PE_RESOURCE_ID_VXD 0x14 +#define MONO_PE_RESOURCE_ID_ANICURSOR 0x15 +#define MONO_PE_RESOURCE_ID_ANIICON 0x16 +#define MONO_PE_RESOURCE_ID_HTML 0x17 + +typedef struct { + /* If the MSB is set, then the other 31 bits store the RVA of + * the unicode string containing the name. Otherwise, the + * other 31 bits contain the ID of this entry. + */ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN + guint32 name_offset:31; + guint32 name_is_string:1; +#else + guint32 name_is_string:1; + guint32 name_offset:31; +#endif + + /* If the MSB is set, then the other 31 bits store the RVA of + * another subdirectory. Otherwise, the other 31 bits store + * the RVA of the resource data entry leaf node. + */ +#if G_BYTE_ORDER == G_LITTLE_ENDIAN + guint32 dir_offset:31; + guint32 is_dir:1; +#else + guint32 is_dir:1; + guint32 dir_offset:31; +#endif +} MonoPEResourceDirEntry; + +typedef struct +{ + guint32 res_characteristics; + guint32 res_date_stamp; + guint16 res_major; + guint16 res_minor; + guint16 res_named_entries; + guint16 res_id_entries; + /* Directory entries follow on here. The array is + * res_named_entries + res_id_entries long, containing all + * named entries first. + */ +} MonoPEResourceDir; + typedef struct { guint32 rva; guint32 size; @@ -153,6 +224,7 @@ typedef struct { #define CLI_FLAGS_ILONLY 0x01 #define CLI_FLAGS_32BITREQUIRED 0x02 +#define CLI_FLAGS_STRONGNAMESIGNED 0x8 #define CLI_FLAGS_TRACKDEBUGDATA 0x00010000 guint32 ch_flags; @@ -185,6 +257,5 @@ typedef struct { } MonoCLIImageInfo; guint32 mono_cli_rva_image_map (MonoCLIImageInfo *iinfo, guint32 rva); -char *mono_cli_rva_map (MonoCLIImageInfo *iinfo, guint32 rva); #endif /* __MONO_CIL_COFF_H__ */