12.1 Map Definitions

Every symbol file contains a list that links two or more map definitions. Each map definition describes a module in the executable file.

The first map definition in the chain starts at the beginning of the file, as follows:

/* File is loaded at pFileBuffer. */

pMapDef = (MAPDEF *)pFileBuffer;

Each map definition (except the last) contains a pointer to the next map definition in the chain. This pointer is a 16-bit number that, when multiplied by 16, gives the byte offset of the next map definition in the file, as follows:

pNextMapDef = (MAPDEF *)(pFileBuffer + (pMapDef->ppNextMap * 16));

The pointer in the last map definition is zero.

The MAPDEF structure for each map definition (except the last) has the following form:

typedef struct {
    WORD ppNextMap;     /* paragraph pointer to next map        */
    BYTE bFlags;        /* symbol types                         */
    BYTE bReserved1;    /* reserved                             */
    WORD pSegEntry;     /* segment entry-point value            */
    WORD cConsts;       /* count of constants in map            */
    WORD pConstDef;     /* pointer to constant chain            */
    WORD cSegs;         /* count of segments in map             */
    WORD ppSegDef;      /* paragraph pointer to first segment   */
    BYTE cbMaxSym;      /* maximum symbol-name length           */
    BYTE cbModName;     /* length of module name                */
    char achModName[1]; /* n bytes of module-name member        */
} MAPDEF;

The last MAPDEF structure contains the version and release number for the version of Symbol File Generator used to create the symbol file. It has the following form:

typedef struct {
    WORD ppNextMap; /* always zero                           */
    BYTE release;   /* release number (minor version number) */
    BYTE version;   /* major version number                  */
} LAST_MAPDEF;

Following are the members of the MAPDEF structure:

ppNextMap

Specifies the offset from the beginning of the file to the next MAPDEF structure in the chain. Multiply the value of the ppNextMap member by 16 to obtain the offset.

bFlags

Specifies the type of symbols in the file. The bFlags member can be one or more of the following values:

Value Meaning

0 Contains 16-bit symbols.
1 Contains 32-bit symbols.
2 Includes alphabetic symbol table.

bReserved1

Reserved.

pSegEntry

Specifies the segment of the entry point for the application.

cConsts

Specifies the number of constants in this module.

pConstDef

Specifies a 16-bit offset from the beginning of the file to an array of pointers to constant definitions. This value is not multiplied by 16 to obtain the offset.

cSegs

Specifies the number of segments in this module.

ppSegDef

Specifies the offset from the beginning of the file to the first segment definition in this module. Multiply the value of the ppSegDef member by 16 to obtain the offset.

cbMaxSym

Specifies the length of the longest symbol name in this module.

cbModName

Specifies the length of the module name.

achModName

Specifies a variable-length array of characters containing the module name. The name is not null-terminated.