2006-10-10 Miguel de Icaza <miguel@novell.com>
[mono.git] / mono / metadata / cil-coff.h
index c20b6d0a5c9f012f2b4aa568e49662743231402c..098057f6fc36d310729c1a893764c69357b28b9e 100644 (file)
@@ -89,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;
@@ -156,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;
 
@@ -188,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__ */