| 10 | namespace |
| 11 | { |
| 12 | std::string WidestringToString(std::wstring const& wstr) |
| 13 | { |
| 14 | if (wstr.empty()) |
| 15 | return {}; |
| 16 | |
| 17 | int size = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, &wstr[0], static_cast<int>(wstr.size()), NULL, 0, NULL, NULL); |
| 18 | std::string ret(size, 0); |
| 19 | WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, &wstr[0], static_cast<int>(wstr.size()), &ret[0], size, NULL, NULL); |
| 20 | return ret; |
| 21 | } |
| 22 | |
| 23 | bool IsElevated() noexcept |
| 24 | { |