Platform SDK: Win32 API |
The thunk compiler supports thunk functions that follow these guidelines for calling convention and parameters:
If you try to build a thunk that uses an unsupported calling convention, the linker will return the error "unresolved external" because the function names produced by the C/C++ compiler will not match the names produced by the thunk compiler. Although the thunk must use the __pascal and __stdcall calling conventions, the thunk may call or be called by functions that use other calling conventions.
To thunk to a function that uses the __cdecl or __fastcall calling convention, you must create the thunk function with a supported calling convention. Then make the thunk function call the target function.