Win32 API Error reporting and handling Introduction


The Windows API is provided by means of a C-callable interface. Success or failure of an API call is reported strictly through return values. Exceptions aren't part of the documented contract (although some API implementations can raise SEH exceptions, e.g. when passing a read-only lpCommandLine argument to CreateProcess).

Error reporting roughly falls into one of four categories:

The documentation for each API call explicitly calls out, how errors are reported. Always consult the documentation.