The thunk compiler takes a thunk script as input, then produces an assembly-language file that implements one or more thunks. These thunks are code that allows 32-bit code to call 16-bit code and vice-versa. The following steps briefly describe how to use the thunk compiler to create a flat thunk.
The DLLs you create using these steps implement flat thunks. They can provide multiple thunks. If the DLLs implement thunks from 16-bit code to 32-bit code and thunks from 32-bit code to 16-bit code, you will need to create two thunk scripts, one for each direction.
To use the thunk DLLs, simply call the function you want to use. For example, suppose your Win32-based application is calling MyFunction, which is implemented in a 16-bit DLL. The application calls a function implemented in the Win32-based thunk DLL that in turn calls the thunk function, MyFunction. When MyFunction is called in the 32-bit thunk DLL, the code generated by the thunk compiler calls the MyFunction implemented in the 16-bit thunk DLL.