Lazy WinAPI
Macros | Functions
Error

This module provides utilities to handle WinAPI errors. More...

Macros

#define Error_get_last   GetLastError
 Alias to GetLastError() More...
 

Functions

const wchar_t * Error_get_desc (DWORD error, wchar_t *buffer, size_t size)
 Gets description of error. More...
 

Detailed Description

This module provides utilities to handle WinAPI errors.

You can find out meaning of error over there

Macro Definition Documentation

#define Error_get_last   GetLastError

Alias to GetLastError()

Returns
Last error code of the calling thread.

Function Documentation

const wchar_t* Error_get_desc ( DWORD  error,
wchar_t *  buffer,
size_t  size 
)

Gets description of error.

Note
Not all error code produces valid error message. "Unknown Error" is returned in case of that.
Warning
Underlying FormatMessageW will set new value of Error.
Parameters
[in]errorError code for which te get description.
[out]bufferMemory for string. Cannot be NULL.
[in]sizeSize of memory. Cannot be 0. Description is truncated in case of insufficient size.
Returns
Pointer to buffer.
Return values
NULLon invalid parameters.