What is stdcall and what is it used for?

1

I have been looking for information on the official microsoft website and I understand that it is used for function calls and to clean the stack of the stack if I am not mistaken but what is the benefit of this?

    
asked by thc 03.09.2018 в 17:55
source

1 answer

4
  

I have been looking for information on the official Microsoft website and I understand that it is used for function calls and to clean the stack of the stack if I am not mistaken.

You're not wrong, but you've stayed with the form without getting to the bottom:

  

__stdcall

     

The call convention __stdcall is used to call functions of the Win32 API.

The official page indicates that it is a calling convention , the call conventions tell us:

  • The order in which the parameters are stored in memory.
  • How parameters are passed (are they stacked ?, are they passed in records ?).
  • Which records should preserve the function for use by the caller.
  • How the caller and the caller share the task of preparing and restoring the battery.

Implementations of those points can vary greatly between call conventions, giving rise to many different and incompatible conventions even among compilers; therefore (in general) to follow a standard model, certain call conventions are applied in the functions that are published in APIs or libraries.

In the case of Microsoft compilers, the default calling convention is __stdcall , but there are other conventions:

answered by 04.09.2018 / 10:56
source