| 33 | } |
| 34 | |
| 35 | std::string GetLastErrorString(std::string FailedFunctionName, DWORD dwLastError) |
| 36 | { |
| 37 | auto sErrorText = w_FormatMessageA( |
| 38 | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 39 | nullptr, |
| 40 | dwLastError, |
| 41 | LANG_SYSTEM_DEFAULT, |
| 42 | 0, |
| 43 | nullptr); |
| 44 | |
| 45 | std::ostringstream oss; |
| 46 | oss << FailedFunctionName << " failed: " << sErrorText; |
| 47 | return oss.str(); |
| 48 | } |
no test coverage detected