| 14 | constexpr DWORD kMaxWin32PathBuffer = 32768; |
| 15 | |
| 16 | std::string WidePathToUtf8(std::wstring_view path, const char* operation) { |
| 17 | std::string result = Encoding::WideToUtf8(path); |
| 18 | if (result.empty() && !path.empty()) { |
| 19 | OSTP_LOG_DEBUG("{}: failed to convert path to UTF-8", operation); |
| 20 | } |
| 21 | return result; |
| 22 | } |
| 23 | |
| 24 | std::filesystem::path ModuleFilePath(HMODULE module, const char* operation) { |
| 25 | for (DWORD capacity = MAX_PATH; capacity <= kMaxWin32PathBuffer; capacity *= 2) { |
no test coverage detected