Thunk Compiler

This overview describes how to use the thunk compiler so that your Win32-based application running on Microsoft® Windows® 95 can take advantage of 16-bit components. In addition, this overview discusses related issues you should consider before choosing to use the thunk compiler.

Windows 95 implements a thunking model called flat thunks. Flat thunks allow 32-bit code to call functions implemented in 16-bit code. They also allow 16-bit code to call functions implemented in 32-bit code. Windows NT does not support flat thunks. Therefore, if you use flat thunks, your application cannot run on Windows NT unless you isolate your thunking code into platform-specific DLLs.

Windows NT uses a different thunking model. Windows NT supports generic thunks, which allow 16-bit code to call functions implemented in 32-bit code. Although Windows 95 supports generic thunks, it does not support the underlying process model used by Windows NT. This means that generic thunking code might not work identically under Windows 95 and Windows NT. For more information, see Generic Thunks.

The Platform Software Development Kit (SDK) includes a sample application that illustrates the use of the thunk compiler. This application, APP32.EXE, simply passes basic types from the 32-bit side to the 16-bit side of the thunk. This sample is an important supplement to the information in this overview.