stdcall and cdecl

Raymond Chen gives a nice overview of what __stdcall and __cdecl does. (1) The caller “knows” to clean up the stack after calling a function because the compiler knows the calling convention of that function and generates the necessary code. void __stdcall StdcallFunc() {} void __cdecl CdeclFunc() { // The compiler knows that StdcallFunc() uses … Read more

What is __stdcall?

__stdcall is the calling convention used for the function. This tells the compiler the rules that apply for setting up the stack, pushing arguments and getting a return value. There are a number of other calling conventions, __cdecl, __thiscall, __fastcall and the wonderfully named __declspec(naked). __stdcall is the standard calling convention for Win32 system calls. … Read more