| 15 | } |
| 16 | |
| 17 | wil::unique_hlocal_string Error::impl::FormatMessageForLanguage(HRESULT result, DWORD langId, DWORD &count) |
| 18 | { |
| 19 | wil::unique_hlocal_string error; |
| 20 | count = FormatMessage( |
| 21 | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, |
| 22 | nullptr, |
| 23 | result, |
| 24 | langId, |
| 25 | reinterpret_cast<wchar_t*>(error.put()), |
| 26 | 0, |
| 27 | nullptr |
| 28 | ); |
| 29 | |
| 30 | return error; |
| 31 | } |
| 32 | |
| 33 | std::wstring Error::MessageFromHRESULT(HRESULT result) |
| 34 | { |