AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
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 "Errors.h"
#include "GitRevision.h"
#include <algorithm>

Go to the source code of this file.

Classes

struct  CSymbolInfoPackage
 

Macros

#define WIN32_LEAN_AND_MEAN
 
#define _NO_CVCONST_H
 
#define CrashFolder   _T("Crashes")
 
#define EXCEPTION(x)   case EXCEPTION_##x: return LPTSTR(_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

◆ _NO_CVCONST_H

#define _NO_CVCONST_H

◆ CrashFolder

#define CrashFolder   _T("Crashes")

◆ EXCEPTION

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

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Function Documentation

◆ ErrorMessage()

LPTSTR ErrorMessage ( DWORD  dw)
inline
33{
34 LPVOID lpMsgBuf;
35 DWORD formatResult = FormatMessage(
36 FORMAT_MESSAGE_ALLOCATE_BUFFER |
37 FORMAT_MESSAGE_FROM_SYSTEM,
38 nullptr,
39 dw,
40 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
41 (LPTSTR) &lpMsgBuf,
42 0, nullptr);
43 if (formatResult != 0)
44 {
45 return (LPTSTR)lpMsgBuf;
46 }
47 else
48 {
49 LPTSTR msgBuf = (LPTSTR)LocalAlloc(LPTR, 30);
50 sprintf(msgBuf, "Unknown error: %u", dw);
51 return msgBuf;
52 }
53}

Referenced by WheatyExceptionReport::GenerateExceptionReport().

◆ ToTchar() [1/2]

template<size_t size>
void ToTchar ( wchar_t const *  src,
TCHAR(&)  dst[size],
std::false_type   
)
271{
272 wcscpy_s(dst, src);
273}

◆ ToTchar() [2/2]

template<size_t size>
void ToTchar ( wchar_t const *  src,
TCHAR(&)  dst[size],
std::true_type   
)
265{
266 wcstombs_s(nullptr, dst, src, size);
267}

Referenced by WheatyExceptionReport::_GetWindowsVersion().

Variable Documentation

◆ g_WheatyExceptionReport

WheatyExceptionReport g_WheatyExceptionReport