The cdecl call Convention, also known as the C call Convention, is the default call Convention of C language. Its definition syntax is:
Int func (int x, int y) // default C call Convention
Int _ cdecl func (int x, int y) // specify C call conventions
This call Convention follows the following rules:
Parameter stack order:From right to left
Stack restoration:The caller can modify the stack, so the Variable Parameter Function is supported because the stack balance can be restored.
The format stated by the stdcall call Convention. The default format of the driver is the stdcall call Convention:
Int _ stdcall func (int x, int y)
The call conventions of stdcall mean:
Parameter stack inbound rules: ParametersFrom right to leftPush into Stack
Stack restoration:Stack modified by the called Function
The Declaration Syntax of fastcall is:
Int fastcall func (int x, int y)
This call Convention follows the following rules:
Parameter stack order: function'sThe first and second parameters are passed through ECx and EDX., Remaining ParametersFrom right to leftInbound Stack
Stack restoration:CalledFunction itselfModify Stack
Thiscall is the default call Convention for C ++ class member functions, but it does not display the declaration form. Thiscall means:
Parameter stack entry: the parameter is fromRight-to-left inbound Stack
This pointer goes into the stack: if the number of parameters is determined, this pointer is passed to the caller through ECx; if the number of parameters is not determined, this pointer is pushed to the stack after all parameter stacks are pressed.
Stack recovery:The number of parameters is not fixed,The caller clears the stack.,Otherwise, the function clears the stack by itself.
Nakedcall...