PRB: 16-Bit Resource Table Limitation Under Win32sID: Q150617
|
When a 32-bit application is initialized or a DLL file is loaded, Win32s dynamically creates a 16-bit resource table. Because some of the 32-bit functions that handle resources, such as LoadIcon and LoadMenu, are thunked to the 16-bit side, Windows 3.1 uses this table to handle the resources. This table contains information on all the 32-bit resources that have been converted to the 16-bit form for use by Windows.
There is a limitation in Windows 3.1 that the 16-bit resource table created
by Win32s cannot exceed 32K. If this 16-bit table limit is exceeded, the
debug version of Win32s generates the following assertion failure when the
application is initialized.
"OFFSETOF(pResWrite) < 0xfffc" or "OFFSETOF(pResWrite) < 0xfffe"
A workaround is to split the resources to more than one module.
This behavior is by design.
Note that the limitation discussed in this article is the size of the 16-
bit resource table created by Win32s and not the size of the resource data
section. In Win32s version 1.15a and earlier, there is a limitation on the
resource data section to be less than 64K, but that limit is eliminated in
Win32s versions 1.20 and later.
The size of the resource data section is determined by using the DUMPBIN
tool on the 32-bit side. The following line appears:
xxxx .rsrc
2 + (N1 * 8) + (N2 * 16) + N3 + N4
N1 = Number of resource types (icon, menu, etc.)
N2 = Number of resources (all resource types)
N3 = Sum of the lengths of all string IDs (including resource types
that have string IDs)
N4 = Number of string IDs
Additional query words: 1.30 win32s
Keywords :
Version : 1.30 | 1.30
Platform : NT WINDOWS
Issue type :
Last Reviewed: March 10, 1999