- call is a native CPU instruction in x86 Intel syntax
- invoke is a macro that uses pascal calling convention and does an indirect call (i.e. it uses "call [...]")
- stdcall is a macro that uses pascal calling convention and does a direct call (i.e. it uses "call ...")
- cinvoke is a macro that uses C-call convention and and does an indirect call (i.e. it uses "call [...]")
- ccall is a macro that uses C-call convention and and does a direct call (i.e. it uses "call ...")
- Use call if you need just the native CPU instruction
- Use invoke to call all Windows APIs (except wsprintf) and all DLL functions that use pascal convention
- Use stdcall to call functions you have defined with the proc macro
- Use cinvoke to call the Windows wsprintf API and all DLL functions that use C-call convention (e.g. MSVCRT)
- Use ccall to call functions you have statically linked that use the C-call convention and functions you have defined with "proc <func> c ..."
How to you recognize in which calling convention a function is created?
If the symbol begins with a _ but has no @, then it's __cdecl. If it begins with _ and has a @ it's __stdcall. If it begins with @ and has another @, it's __fastcall.
64 bits:
On 64 bits, all calls are fastcall, so cinvoke is the same as invoke.
Geen opmerkingen:
Een reactie posten