Unstandard

Functions for throwing exceptions on WinAPI errors.

License
Boost License 1.0.
Authors
Denis Shelomovskij

class  WinAPIException: object.Exception;

Exception thrown on WinAPI errors.


auto  enforceWinAPI(alias func)(ParameterTypeTuple!func args, in string file = __FILE__, in size_t line = __LINE__) if (functionLinkage!func == "Windows");

Convinient template to call WinAPI function and throw WinAPIException on error.

Examples
HANDLE processHeap = enforceWinAPI!GetProcessHeap();
assert(processHeap); // Will always pass.