An OS/2 program keeps its resources, such as its icons, menus, dialogs and string
tables, in its objects. The resource table, at the header’s resource table offset
(0x50, from the start of the LX header), says where each one is; the header’s
resource count (0x54) gives the number of entries.
Resource entry
Each entry is 14 bytes:
| Offset | Size | Field | Meaning |
|---|---|---|---|
| 0 | 2 | Type ID | The resource type, a number; below. |
| 2 | 2 | Name ID | The resource’s number. |
| 4 | 4 | Size | The size of the resource in bytes. |
| 8 | 2 | Object | The object that holds it, from 1. |
| 10 | 4 | Offset | Its offset in that object. |
IBM’s description says the entries are sorted by name within each type. Types and names are numbers only; OS/2 resources have no names as text.
A resource is found through its object: the offset gives the page of the object and the place in it, and the object page table gives where that page is in the file. The explorer finds the bytes this way when the pages the resource spans lie one after another in the file, and lists each resource with its type, number and size.
Resource types
LX files use OS/2’s type numbers, from its pmwin.h header. The first
ones are:
| Type | Resource |
|---|---|
| 1 | Pointer (mouse pointer) |
| 2 | Bitmap |
| 3 | Menu |
| 4 | Dialog |
| 5 | String table |
The explorer also names the higher numbers, up to 21, such as message tables and help tables; those names have not yet been checked against an OS/2 toolkit header. None of the LX files examined for this site has resources.