The following list shows the implementation of this calling convention.
|
Element
|
Implementation
|
| Argument-passing order | Right to left. |
| Argument-passing convention | By value, unless a pointer or reference type is passed. |
| Stack-maintenance responsibility | Called function pops its own arguments from the stack. |
| Name-decoration convention | An underscore (_) is prefixed to the name. The name is followed by the at sign (@) followed by the number of bytes (in decimal) in the argument list. Therefore, the function declared as int func( int a, double b ) is decorated as follows: _func@12 |
| Case-translation convention | None |
The /Gz compiler option specifies __stdcall for all functions not explicitly declared with a different calling convention.
Functions declared using the __stdcall modifier return values the same way as functions declared using __cdecl.
On Itanium Processor Family (IPF) and x64 processors, __stdcall is accepted and ignored by the compiler; on IPF, by convention, parameters are passed in register.
For non-static class functions, if the function is defined out-of-line, the calling convention modifier does not have to be specified on the out-of-line definition. That is, for class non-static member methods, the calling convention specified during declaration is assumed at the point of definition. Given this class definition,
struct CMyClass {
void __stdcall mymethod();
}; this
void CMyClass::mymethod() { return; } is equivalent to this
void __stdcall CMyClass::mymethod() { return; }