diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-04-09 21:03:08 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-04-09 21:03:08 +0200 |
| commit | 6131e4d722156be55c79311c7030d76f7b065884 (patch) | |
| tree | 1bf1baeb96d3082af2999aef3947c172db70533f /src/server/shared/Debugging | |
| parent | 980c175df114857bfc6c6d56355cc5ef9bafec43 (diff) | |
| parent | b36e7c0211aa263835732e37cec0ac14906557b2 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Handlers/ChatHandler.cpp
Diffstat (limited to 'src/server/shared/Debugging')
| -rw-r--r-- | src/server/shared/Debugging/WheatyExceptionReport.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index 1afe688c942..3b6bd3d2cc8 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -29,15 +29,23 @@ inline LPTSTR ErrorMessage(DWORD dw) { LPVOID lpMsgBuf; - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - dw, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, NULL); - return (LPTSTR)lpMsgBuf; + DWORD formatResult = FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + dw, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &lpMsgBuf, + 0, NULL); + if (formatResult != 0) + return (LPTSTR)lpMsgBuf; + else + { + LPTSTR msgBuf = (LPTSTR)LocalAlloc(LPTR, 30); + sprintf(msgBuf, "Unknown error: %u", dw); + return msgBuf; + } + } //============================== Global Variables ============================= |
