TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WheatyExceptionReport.cpp File Reference
#include "CompilerDefs.h"
#include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
#include <tchar.h>
#include <dbghelp.h>
#include "WheatyExceptionReport.h"
#include "Common.h"
#include "GitRevision.h"
+ Include dependency graph for WheatyExceptionReport.cpp:

Classes

struct  CSymbolInfoPackage
 

Macros

#define WIN32_LEAN_AND_MEAN
 
#define _NO_CVCONST_H
 
#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], std::true_type)
 
template<size_t size>
void ToTchar (wchar_t const *src, TCHAR(&dst)[size], std::false_type)
 

Variables

WheatyExceptionReport g_WheatyExceptionReport
 

Macro Definition Documentation

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

Function Documentation

LPTSTR ErrorMessage ( DWORD  dw)
inline
29 {
30  LPVOID lpMsgBuf;
31  DWORD formatResult = FormatMessage(
32  FORMAT_MESSAGE_ALLOCATE_BUFFER |
33  FORMAT_MESSAGE_FROM_SYSTEM,
34  NULL,
35  dw,
36  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
37  (LPTSTR) &lpMsgBuf,
38  0, NULL);
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 }
arena_t NULL
Definition: jemalloc_internal.h:624
std::string sprintf(CStringRef format, ArgList args)
Definition: format.h:3096
unsigned int DWORD
Definition: CascPort.h:139
#define LANG_NEUTRAL
Definition: CascLib.h:114

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<size_t size>
void ToTchar ( wchar_t const src,
TCHAR(&)  dst[size],
std::true_type   
)
215 {
216  wcstombs_s(nullptr, dst, src, size);
217 }

+ Here is the caller graph for this function:

template<size_t size>
void ToTchar ( wchar_t const src,
TCHAR(&)  dst[size],
std::false_type   
)
221 {
222  wcscpy_s(dst, src);
223 }

Variable Documentation

WheatyExceptionReport g_WheatyExceptionReport