/* * Title * * exe386.h * (C) Copyright Microsoft Corp 1988-1990 * * Description * * Data structure definitions for the OS/2 * executable file format (flat model). * * Modification History * * 90/07/30 Wieslaw Kalkus Modified linear-executable * 88/08/05 Wieslaw Kalkus Initial version */ /*_________________________________________________________________* | | | | | OS/2 .EXE FILE HEADER DEFINITION - 386 version 0:32 | | | |_________________________________________________________________| * */ #define BITPERBYTE 8 /* Should never change */ #define BITPERWORD 16 /* I'm not sure about this one */ #define OBJPAGELEN 4096 /* Memory page size in bytes */ #define E32RESBYTES1 1 /* First bytes reserved */ #define E32RESBYTES2 0 /* Second bytes reserved */ #define E32RESBYTES3 8 /* Third bytes reserved */ #define E32RESBYTES4 28 #define STD_EXTRA 7 /* Standard number of extra information*/ /* units palced in the header; this */ /* includes the following tables: */ /* - export, import, resource, */ /* exception, security, fixup and */ /* debug information */ #define EXP 0 /* Export table position */ #define IMP 1 /* Import table position */ #define RES 2 /* Resource table position */ #define EXC 3 /* Exception table position */ #define SEC 4 /* Security table position */ #define FIX 5 /* Fixup table position */ #define DEB 6 /* Debug table position */ struct info /* Extra information header block */ { unsigned long rva; /* Virtual relative address of info */ unsigned long size; /* Size of information block */ }; struct e32_exe /* LE 32-bit .EXE header */ { unsigned char e32_magic[4]; /* Magic number E32_MAGIC */ unsigned char e32_bworder; /* The byte/word ordering for the .EXE */ unsigned char e32_res1[E32RESBYTES1]; /* Reserved bytes - must be zero */ unsigned short e32_cpu; /* The CPU type */ unsigned short e32_os; /* The OS type */ unsigned short e32_subsys; /* The subsystem type */ unsigned short e32_osmajor; /* The operating system major ver. no. */ unsigned short e32_osminor; /* The operating system minor ver. no. */ unsigned short e32_linkmajor; /* The linker major version number */ unsigned short e32_linkminor; /* The linker minor version number */ unsigned short e32_usermajor; /* The user major version number */ unsigned short e32_userminor; /* The user minor version number */ unsigned long e32_mflags; /* Module flags */ unsigned long e32_vpages; /* Number of pages in memory image */ unsigned long e32_filechksum; /* Checksum for entire file */ unsigned long e32_entryrva; /* Relative virt. addr. of entry point */ unsigned long e32_vbase; /* Virtual base address of module */ unsigned long e32_vsize; /* Virtual size of the entire image */ unsigned long e32_hdrsize; /* Header information size */ unsigned long e32_filealign; /* Alignment factor used to */ /* align/truncate image pages */ unsigned long e32_pagesize; /* The size of one page for this module*/ unsigned long e32_timestamp; /* Time the .EXE file was created/modified*/ unsigned long e32_stackmax; /* Maximum stack size */ unsigned long e32_stackinit; /* Initial committed stack size */ unsigned long e32_heapmax; /* Maximum heap size */ unsigned long e32_heapinit; /* Initial committed heap size */ unsigned long e32_objcnt; /* Number of memory objects */ unsigned long e32_objtab; /* Object table offset */ unsigned long e32_dircnt; /* Number of module directives */ unsigned long e32_dirtab; /* Module format directives table off */ unsigned char e32_res3[E32RESBYTES3]; /* Reserved bytes - must be zero */ unsigned long e32_rescnt; /* Number of resources */ unsigned long e32_hdrextra; /* Number of extra info units in header*/ struct info e32_unit[STD_EXTRA]; /* Array of extra info units */ unsigned char e32_res4[E32RESBYTES4]; }; #define E32HDR_SIZE sizeof(struct e32_exe) #define E32_MAGIC(x) ((unsigned short)((x).e32_magic[0]<