Windows 95 improves system performance by supporting late loading for thunk DLLs. In a 16-bit to 32-bit thunk, the system loads the 32-bit DLL when the application calls the first 16-bit to 32-bit thunk. It does not load the 32-bit DLL when the 16-bit DLL is loaded.
Late loading has the following implications:
int Sample(void)
{
faulterrorcode = -1;
}
Although late loading is a valuable optimization for a 16-bit DLL that can execute autonomously from its 32-bit counterpart, it does complicate error recovery. You can disable late loading by including the following line in the thunk script:
preload32 = true;
If you use this option, the 16-bit subsystem will be released during the loading of your 16-bit DLL, possibly causing other 16-bit code to be reentered. For this reason, the preload32 keyword is not available if your thunk script requires the win31compat keyword. For more information about the win31compat keyword, see Compatibility with Existing 16-Bit DLLs.
Although the thunk compiler supports a preload16 keyword, late loading of 16-bit DLLs is neither currently supported nor planned for a future version of Windows.