An NE module has two name tables. Both give names to ordinals, the numbers of the entry points in the entry table, so that other modules can import a function by name. The resident table stays in memory while the module is loaded; the non-resident table stays in the file and is read only when a name in it is needed. The first entry of each is special.
Entries
Both tables are runs of entries of the same form, ended by a length of 0:
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 1 | length | The length of the name in bytes; 0 ends the table. |
| 1 | length | name | The name, with no zero at the end. |
| 1 + length | 2 | ordinal | The entry point’s ordinal; 0 for the first entry. |
The explorer uses the names to label the exported functions in its Entry points table and in the code.
Resident names
The resident name table is at ne_restab
from the start of the NE header. Its first entry is the module name, with ordinal 0:
the name other modules use to import from it, such as KERNEL or
USER. The rest name exports that are kept resident.
00000164 05 54 45 53 54 31 00 00 00 .TEST1...
TEST1 with ordinal 0, then the 0 that ends the tableNon-resident names
The non-resident name table is at the file offset
ne_nrestab, and
is ne_cbnrestab bytes
long. Its first entry is the module’s description, the text the linker was given as
its DESCRIPTION, with ordinal 0. The rest are exported names that Windows
reads from the file only when they are needed.
0000059B 10 4D 69 6E 65 73 77 65 65 70 65 72 20 76 33 2E .Minesweeper v3.
000005AB 31 00 00 0B 4D 41 49 4E 57 4E 44 50 52 4F 43 01 1...MAINWNDPROC.
000005BB 00 0B 50 52 45 46 44 4C 47 50 52 4F 43 02 00 0B ..PREFDLGPROC...
000005CB 42 45 53 54 44 4C 47 50 52 4F 43 03 00 0C 45 4E BESTDLGPROC...EN
000005DB 54 45 52 44 4C 47 50 52 4F 43 04 00 00 TERDLGPROC...
WINMINE.EXE’s resident table, at 0x540, holds only its module name,
Minesweeper.