Opened 5 years ago
Closed 5 years ago
#13455 closed Bugs (invalid)
path_from_handle using GetModuleFileNameW in wrong way
Reported by: | Owned by: | Andrey Semashev | |
---|---|---|---|
Milestone: | To Be Determined | Component: | winapi |
Version: | Boost 1.66.0 | Severity: | Problem |
Keywords: | Cc: |
Description
boost\dll\detail\windows\path_from_handle.hpp
boost::detail::winapi::GetModuleFileNameW(handle, path_hldr, DEFAULT_PATH_SIZE_); ec = last_error_code(); if (!ec) { return boost::filesystem::path(path_hldr); }
The problem here is that code doesn't analyze return code. If GetLastError() was dirty before a call this code will fail even if GetModuleFileNameW() will success. Yes, on success, GetModuleFileNameW() doesn't reset last error to ERROR_SUCCESS.
Note:
See TracTickets
for help on using tickets.
Please, report this to Boost.DLL: https://github.com/boostorg/dll/issues