Visible to Intel only — GUID: GUID-5FBBE942-D8DB-4522-8A64-A8086573C8BC
Visible to Intel only — GUID: GUID-5FBBE942-D8DB-4522-8A64-A8086573C8BC
Stack Considerations in Calling Conventions on Windows
In the C calling convention, which is the default, the calling routine always adjusts the stack immediately after the called routine returns control. This process produces slightly larger object code because the code that restores the stack must exist at every point a procedure is called.
For 32-bit applications, use of the STDCALL calling convention means that the called procedure controls the stack. The code to restore the stack resides in the called procedure, so the code needs to appear only once. For 64-bit applications, the stack adjustment and @n name suffix features of STDCALL are not used.
The C calling convention makes calling with a variable number of arguments possible. In the C calling convention, the caller cleans up the stack, so it is possible to write a routine with a variable number of arguments. Therefore, the return point has the same address relative to the frame pointer, regardless of how many arguments are actually passed. The calling routine controls the stack, knows how many arguments it passed, how big they are, and where they reside in the stack. It can skip passing an argument and still keep track.
You can call routines with a variable number of arguments by including the ATTRIBUTES C option in your interface to a routine.