Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin committed Dec 21, 2024
1 parent 82e2ba9 commit 8aa16d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/dll/detail/windows/path_from_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace boost { namespace dll { namespace detail {
ec = boost::dll::detail::last_error_code();
for (unsigned i = 2; i < 1025 && static_cast<boost::winapi::DWORD_>(ec.value()) == ERROR_INSUFFICIENT_BUFFER_; i *= 2) {
std::wstring p(DEFAULT_PATH_SIZE_ * i, L'\0');
const std::size_t size = boost::winapi::GetModuleFileNameW(handle, p.data(), p.size());
const std::size_t size = boost::winapi::GetModuleFileNameW(handle, &p[0], p.size());
if (size != 0 && size < p.size()) {
// On success, GetModuleFileNameW() doesn't reset last error to ERROR_SUCCESS. Resetting it manually.
ec.clear();
Expand Down

0 comments on commit 8aa16d3

Please sign in to comment.