Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does APIENTRY do?

Tags:

I encountered it first time and found no dedicated page on msdn. What does APIENTRY mean?

like image 975
lhj7362 Avatar asked Jan 17 '10 15:01

lhj7362


2 Answers

APIENTRY is an alias for WINAPI.

WINAPI itself is a definition for the type of calling convention used for windows API calls, the stdcall.

Basically this is explaining to the compiler how to handle the stack and arguments when calling this function. You don't usually need to worry about it unless you are making function pointers to these types of functions.

like image 95
SoapBox Avatar answered Oct 19 '22 20:10

SoapBox


It's just a #define for WINAPI, which is the standard decoration for a Windows entrypoint.

#define APIENTRY    WINAPI 
like image 24
Mark Wilkins Avatar answered Oct 19 '22 19:10

Mark Wilkins