DesirePRG
DesirePRG

Reputation: 6378

what is BOOL WINAPI return type

I came across a function definition in c++ as follows: (source)

BOOL WINAPI GetProcessMemoryInfo(
  _In_   HANDLE Process,
  _Out_  PPROCESS_MEMORY_COUNTERS ppsmemCounters,
  _In_   DWORD cb
);

What is the return type here. Is it BOOL WINAPI or BOOL? Where is this type defined?

Upvotes: 6

Views: 6669

Answers (1)

user1508519
user1508519

Reputation:

BOOL is a typedef for int. WINAPI is a macro specifying the calling convention (__stdcall, __cdecl etc.) of the function.

typedef int BOOL;
#define WINAPI __stdcall

See MSDN for details.

It's basically equivalent to:

int __stdcall ...

Upvotes: 12

Related Questions