S
S
sddvxd2018-04-26 14:10:27
C++ / C#
sddvxd, 2018-04-26 14:10:27

What is WINAPI, CALLBACK before function names?

I started to study WinApi and often see the following entry:
int WINAPI ...
in the names of functions. Can you tell me what this might mean?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2018-04-26
@sddvxd

On x86, both are macros for a non-standard calling convention __stdcall.
On ARM they don't do anything.
The calling convention is…
• how we call a function at the register level;
• who cleans up the stack after the caller;
• who is responsible for restoring registers if they have changed (or there is a risk that they have changed).
stdcall - call through the stack, from right to left, the function is responsible for clearing the stack, the result is in eax (rax), the function is responsible for restoring the segment registers, esp and ebp, the program is responsible for the rest.
On ARM, the cdecl convention is used. The same thing, but the program is responsible for clearing the stack (I don’t know what registers are on ARM).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question