Frank is a Software Engineer with rich experiences on messeging system, embedded system and communication system development. This is his work notes.

Thursday, September 23, 2010

Argument Passing and Naming Conventions

The following calling conventions are supported by the Visual C/C++ compiler.

Keyword Stack cleanup Parameter passing
__cdecl Caller Pushes parameters on the stack, in reverse order (right to left)
__stdcall Callee Pushes parameters on the stack, in reverse order (right to left)
__fastcall Callee Stored in registers, then pushed on stack
thiscall
(not a keyword) Callee Pushed on stack; this pointer stored in ECX

No comments:

Followers