Windows APIs are very well documented by Microsoft. The WinAPIs provides developers with a way for their applications to interact with the Windows Operating Systems.

Windows Data Types

Some common ones are -

  1. DWORD - 32 bit unsigned integer, on both 32-bit and 64-bit systems.

Eg.

DWORD dwVariable = 42;
  1. size_t

Used to represent size of an object. 32-bit System → 32-bit unsigned integer. 64-bit system → 64-bit unsigned integer.

SIZE_T sVariable = sizeof(int);
  1. void

Indicates the absence of a specific data type.

void* pVariable = NULL; //This is same as PVOID
  1. PVOID - A 32-bit pointer of any data type. 32-bit systems. 64-bit for 64-bit system.
PVOID pVariable = &someData;
  1. HANDLE - A value that specifies a particular object that the operating system is managing (eg. files, threads, processes, etc.)
HANDLE hFile = CreateFile(...);
  1. HMODULE - Handle to a module. This is the base address of the module in memory. An example of a MODULE can be a DLL or an EXE file.
HMODULE hModule = GetModuleHandle(...);
  1. LPCSTR/PCSTR - Pointer to a constant null-terminated string of 8-bit Windows characters (ANSI). L stands for Long which is derived from 16-bit Windows programming period. C stands for Constant. Equivalent to - const char*
LPCSTR lpcString = "Hello, World!";
PCSTR pcString = "Hello, World!";