What is the difference between a function pointer and a WINAPI function pointer?

I came across a piece of code that determines if an application is running in an x32 emulation environment on an x64 computer here

In general, I understand this code, but there is one thing that I am not getting:

1) typedef BOOL (WINAPI * LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);

Why should WINAPI be there? Why is it so important to know that a pointer does not point to my specific function, but to WINAPI? Will these two pointers be different? (depending on size, place where they are created, etc.)

Thank,

Kra

+3
source share
3 answers

WINAPI __stdcall ( - ), , , __cdecl. , __stdcall , __cdecl . __stdcall varadic (Variable length length) , __cdecl, __stdcall .

+4

WINAPI - , , WinAPI. . , , WinAPI.

, WINAPI, . A, HELLO_WORLD - . WINAPI , , , WinAPI, - .

, .

+1

. BTW , __cdecl - "" C/++.

, __cdecl , __stdcall, . , __cdecl , . shoule IMHO , ....

For example, for the call (aka thiscall) member functions, Msvc does just that: it uses a __stdcall-like calling convention if the function does not accept variable arguments. (In addition, it thisis transmitted through the register ECX).

0
source

Source: https://habr.com/ru/post/1750785/


All Articles