Unused Entry.
16-bit Entry.
286 Call Gate Entry.
32-bit Entry.
Forwarder Entry.
The bundled entry table has the following format
ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 00h ³ CNT ³TYPE ³ BUNDLE INFO . . ³ ÀÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
CNT = DB Number of entries. This is the number of entries in this bundle. A zero value for the number of entries identifies the end of the entry table. There is no further bundle information when the number of entries is zero. In other words the entry table is terminated by a single zero byte.
TYPE = DB Bundle type. This defines the bundle type which determines the contents of the BUNDLE INFO. The follow types are defined
00h = Unused Entry.
01h = 16-bit Entry.
02h = 286 Call Gate Entry.
03h = 32-bit Entry.
04h = Forwarder Entry.
80h = Parameter Typing Information Present. This bit signifies that additional
information is contained in the linear EXE module and will be used in the
future for parameter type checking.
ÚÄÄÄÄÄÂÄÄÄÄÄ¿ 00h ³ CNT ³TYPE ³ ÀÄÄÄÄÄÁÄÄÄÄÄÙ
CNT = DB Number of entries. This is the number of unused entries to skip.
TYPE = DB 0 (Unused Entry)
ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ¿ 00h ³ CNT ³TYPE ³ OBJECT ³ ÃÄÄÄÄÄÅÄÄÄÄÄÁÄÄÄÄÄÂÄÄÄÄÄÙ 04h ³FLAGS³ OFFSET ³ ÃÄÄÄÄÄÅÄÄÄÄÄÂÄÄÄÄÄ´ 07h ³ ... ³ . ³ . ³
CNT = DB Number of entries. This is the number of 16-bit entries in this bundle. The flags and offset value are repeated this number of times.
TYPE = DB 1 (16-bit Entry)
OBJECT = DW Object number. This is the object number for the entries in this bundle.
FLAGS = DB Entry flags. These are the flags for this entry point. They have the following definition.
01h = Exported entry flag.
F8h = Parameter word count mask.
ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ¿ 00h ³ CNT ³TYPE ³ OBJECT ³ ÃÄÄÄÄÄÅÄÄÄÄÄÁÄÄÄÄÄÂÄÄÄÄÄÁÄÄÄÄÄ¿ 04h ³FLAGS³ OFFSET ³ CALLGATE ³ ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄ´ 09h ³ ... ³ . . . ³ . . . ³
CNT = DB Number of entries. This is the number of 286 call gate entries in this bundle. The flags, callgate, and offset value are repeated this number of times.
TYPE = DB 2 (286 Call Gate Entry) The 286 Call Gate Entry Point type is needed by the loader only if ring 2 segments are to be supported. 286 Call Gate entries contain 2 extra bytes which are used by the loader to store an LDT callgate selector value.
OBJECT = DW Object number. This is the object number for the entries in this bundle.
FLAGS = DB Entry flags. These are the flags for this entry point. They have the following definition.
01h = Exported entry flag.
F8h = Parameter word count mask.
CALLGATE = DW Callgate selector. The callgate selector is a reserved field used by the loader to store a call gate selector value for references to ring 2 entry points. When a ring 3 reference to a ring 2 entry point is made, the callgate selector with a zero offset is place in the relocation fixup address. The segment number and offset in segment is placed in the LDT callgate.
ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ¿ 00h ³ CNT ³TYPE ³ OBJECT ³ ÃÄÄÄÄÄÅÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄ¿ 04h ³FLAGS³ OFFSET ³ ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ 09h ³ ... ³ . . . ³
CNT = DB Number of entries. This is the number of 32-bit entries in this bundle. The flags and offset value are repeated this number of times.
TYPE = DB 3 (32-bit Entry) The 32-bit Entry type will only be defined by the linker when the offset in the object can not be specified by a 16-bit offset.
OBJECT = DW Object number. This is the object number for the entries in this bundle.
FLAGS = DB Entry flags. These are the flags for this entry point. They have the following definition.
01h = Exported entry flag.
F8h = Parameter dword count mask.
ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄ¿ 00h ³ CNT ³TYPE ³ RESERVED ³ ÃÄÄÄÄÄÅÄÄÄÄÄÁÄÄÄÄÄÂÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 04h ³FLAGS³ MOD ORD# ³ OFFSET / ORDNUM ³ ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ 09h ³ ... ³ ... ³ ... ³
CNT = DB Number of entries. This is the number of forwarder entries in this bundle. The FLAGS, MOD ORD#, and OFFSET/ORDNUM values are repeated this number of times.
TYPE = DB 4 (Forwarder Entry)
RESERVED = DW 0 This field is reserved for future use.
FLAGS = DB Forwarder flags. These are the flags for this entry point. They have the following definition.
01h = Import by ordinal.
F7h = Reserved for future use; should be zero.
OFFSET / ORDNUM = DD Procedure Name Offset or Import
Ordinal Number If the FLAGS field indicates import by ordinal, then this
field is the ordinal number into the Entry Table of the target module, otherwise
this field is the offset into the Procedure Names Table of the target module.
A Forwarder entry (type = 4) is an entry point whose value is an imported reference. When a load time fixup occurs whose target is a forwarder, the loader obtains the address imported by the forwarder and uses that imported address to resolve the fixup.
A forwarder may refer to an entry point in another module which is itself a forwarder, so there can be a chain of forwarders. The loader will traverse the chain until it finds a non-forwarded entry point which terminates the chain , and use this to resolve the original fixup. Circular chains are detected by the loader and result in a load time error. A maximum of 1024 forwarders is allowed in a chain; more than this results in a load time error.
Forwarders are useful for merging and recombining API calls into different sets of libraries, while maintaining compatibility with applications. For example, if one wanted to combine MONCALLS, MOUCALLS, and VIOCALLS into a single libraries, one could provide entry points for the three libraries that are forwarders pointing to the common implementation.