| 237 | } |
| 238 | |
| 239 | void printErrorInfo(unsigned long err) |
| 240 | { |
| 241 | if (!err) |
| 242 | err = GetLastError(); |
| 243 | LPWSTR mBuf = NULL; |
| 244 | if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 245 | NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&mBuf, 0, NULL)) |
| 246 | std::wcout << "Failed to format error message, last error was: " << err << '\n'; |
| 247 | else { |
| 248 | boost::trim_right(std::wstring(mBuf)); |
| 249 | std::wcout << mBuf << std::endl; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | std::wstring formatErrorInfo(unsigned long err) { |
| 254 | std::wostringstream out; |
no outgoing calls
no test coverage detected