Thunk Script Keywords

You can use keywords in the thunk script to provide information to the thunk compiler beyond that which the C-style type definitions and function prototypes provide. These keywords enable you to optimize DLL loading and parameter translation. The thunk compiler supports the following keywords in the thunk script.

Keyword Meaning
enablemapdirect1632=true; Specifies a 16-bit to 32-bit thunk.
enablemapdirect3216=true; Specifies a 32-bit to 16-bit thunk.
input The parameter is used for input only; it is translated when the function is called.
output The parameter is used for output only; it is translated when the function returns.
inout The parameter is used for input and output; it is translated when the function is called and when it returns.
faulterrorcode Specifies the error code when a 16-bit to 32-bit thunk fails because the 32-bit DLL cannot load or initialize. This value is returned when the application calls the first thunk. For more information, see Late Loading.
preload32 Forces the 32-bit thunk DLL to load when the 16-bit thunk DLL is loaded in a 16-bit to 32-bit thunk.
preload16 Not used. Late loading of a 16-bit DLL in a 32-bit to 16-bit thunk is not supported.
win31compat Defers unloading a 32-bit thunk DLL until the process terminates. For more information, see Compatibility with Existing 16-bit DLLs.