+/**
+ * @name FormatMessageSafeW
+ * Loads and formats a message string. The function requires a message
+ * definition as input. The message definition can come from a buffer
+ * passed to the function. It can come from a message table resource in
+ * an already-loaded module, or the caller can ask the function to search
+ * the system's message table resource(s) for the message definition.
+ * Please refer to the Win32 FormatMessage() function for more details.
+ *
+ * @param[in] dwFlags
+ * The formatting options, and how to interpret the @p lpSource parameter.
+ * See FormatMessage() for more details.
+ *
+ * @param[in] lpSource
+ * The location of the message definition. The type of this parameter
+ * depends upon the settings in the @p dwFlags parameter.
+ *
+ * @param[in] dwMessageId
+ * The message identifier for the requested message. This parameter
+ * is ignored if @p dwFlags includes @b FORMAT_MESSAGE_FROM_STRING.
+ *
+ * @param[in] dwLanguageId
+ * The language identifier for the requested message. This parameter
+ * is ignored if @p dwFlags includes @b FORMAT_MESSAGE_FROM_STRING.
+ *
+ * @param[out] lpBuffer
+ * A pointer to a buffer that receives the null-terminated string that
+ * specifies the formatted message. If @p dwFlags includes
+ * @b FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer
+ * using the LocalAlloc() function, and places the pointer to the buffer
+ * at the address specified in @p lpBuffer.
+ * This buffer cannot be larger than 64kB.
+ *
+ * @param[in] nSize
+ * If the @b FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter
+ * specifies the size of the output buffer, in @b TCHARs.
+ * If @b FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies
+ * the minimum number of @b TCHARs to allocate for an output buffer.
+ * The output buffer cannot be larger than 64kB.
+ *
+ * @param[in] Arguments
+ * Optional pointer to an array of values describing a variable number of
+ * arguments, depending on the message string. Each argument is used to
+ * replace an <em>insert sequence</em> in the message string.
+ * By default, the @p Arguments parameter is of type @c va_list*, initialized
+ * with va_start(). The state of the @c va_list argument is undefined upon
+ * return from the function. To use the @c va_list again, destroy the variable
+ * argument list pointer using va_end() and reinitialize it with va_start().
+ * If you do not have a pointer of type @c va_list*, then specify the
+ * @b FORMAT_MESSAGE_ARGUMENT_ARRAY flag and pass a pointer to an array
+ * of @c DWORD_PTR values; those values are input to the message formatted
+ * as the insert values. Each insert must have a corresponding element in
+ * the array.
+ *
+ * @return
+ * If the function succeeds, the return value is the number of characters
+ * copied into the buffer, not including the terminating null character,
+ * or zero if the string resource does not exist. To get extended error
+ * information, call GetLastError().
+ *
+ * @remark
+ * This function is a "safe" version of FormatMessage(), that does not
+ * crash if a malformed source string is retrieved and then being used
+ * for formatting. It basically wraps calls to FormatMessage() within SEH.
+ *
+ * @see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx">FormatMessage() (on MSDN)</a>
+ **/