TrinityCore
Loading...
Searching...
No Matches
WheatyExceptionReport.cpp File Reference
#include "WheatyExceptionReport.h"
#include "Errors.h"
#include "GitRevision.h"
#include <algorithm>
#include <ehdata.h>
#include <rttidata.h>
#include <tlhelp32.h>
#include <tchar.h>
#include <comdef.h>
#include <WbemIdl.h>
+ Include dependency graph for WheatyExceptionReport.cpp:

Go to the source code of this file.

Classes

struct  CSymbolInfoPackage
 

Macros

#define CrashFolder   _T("Crashes")
 
#define EXCEPTION(x)   case EXCEPTION_##x: return _T(#x);
 

Functions

LPTSTR ErrorMessage (DWORD dw)
 
template<size_t size>
void ToTchar (wchar_t const *src, TCHAR(&dst)[size])
 

Variables

WheatyExceptionReport g_WheatyExceptionReport
 

Macro Definition Documentation

◆ CrashFolder

#define CrashFolder   _T("Crashes")

Definition at line 24 of file WheatyExceptionReport.cpp.

◆ EXCEPTION

#define EXCEPTION (   x)    case EXCEPTION_##x: return _T(#x);

Function Documentation

◆ ErrorMessage()

LPTSTR ErrorMessage ( DWORD  dw)
inline

Definition at line 28 of file WheatyExceptionReport.cpp.

29{
30 LPVOID lpMsgBuf;
31 DWORD formatResult = FormatMessage(
32 FORMAT_MESSAGE_ALLOCATE_BUFFER |
33 FORMAT_MESSAGE_FROM_SYSTEM,
34 nullptr,
35 dw,
36 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
37 (LPTSTR) &lpMsgBuf,
38 0, nullptr);
39 if (formatResult != 0)
40 return (LPTSTR)lpMsgBuf;
41 else
42 {
43 LPTSTR msgBuf = (LPTSTR)LocalAlloc(LPTR, 30);
44 sprintf(msgBuf, "Unknown error: %u", dw);
45 return msgBuf;
46 }
47
48}
+ Here is the caller graph for this function:

◆ ToTchar()

template<size_t size>
void ToTchar ( wchar_t const *  src,
TCHAR(&)  dst[size] 
)

Definition at line 226 of file WheatyExceptionReport.cpp.

227{
228 if constexpr (std::is_same_v<TCHAR, char>)
229 ::wcstombs_s(nullptr, dst, src, size);
230 else
231 ::wcscpy_s(dst, size, src);
232}
+ Here is the caller graph for this function:

Variable Documentation

◆ g_WheatyExceptionReport

WheatyExceptionReport g_WheatyExceptionReport

Definition at line 72 of file WheatyExceptionReport.cpp.