C layer of the Diagnostics module: the last system error of the calling thread and its text, and the warning and error reports.
The warning and error reports are the ones of 'ETL_WARNING' and 'ETL_ERROR' in 'ethereal/cpp/diagnostics/error_inc.hpp': a line in the log, when it is enabled, and a message shown to the user. On Windows the message is a message box, on Linux and macOS a text on stderr, both from a separate thread.
Exceptions do not cross into C. 'ETL_ERROR' ends the program by throwing 'Exception::CException'. Here the exception is caught and ETLC_DiagnosticsError returns: the caller decides whether to stop, with abort() for example.
The system error is GetLastError() on Windows and errno on Linux and macOS. The codes of one do not mean the same on the other.
Text output always ends in '\0'. The size written does not count it. When the buffer is too small, the call writes the capacity needed (text plus '\0'), so 'uCap = 0' asks for it.
Every export returns 'int'. Zero is success, negative is an error. The values are part of the ABI.