Boost C++ Libraries: Ticket #13455: path_from_handle using GetModuleFileNameW in wrong way https://svn.boost.org/trac10/ticket/13455 <p> boost\dll\detail\windows\path_from_handle.hpp </p> <pre class="wiki"> boost::detail::winapi::GetModuleFileNameW(handle, path_hldr, DEFAULT_PATH_SIZE_); ec = last_error_code(); if (!ec) { return boost::filesystem::path(path_hldr); } </pre><p> The problem here is that code doesn't analyze return code. If <a class="missing wiki">GetLastError</a>() 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. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13455 Trac 1.4.3 Andrey Semashev Wed, 21 Feb 2018 14:49:17 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/13455#comment:1 https://svn.boost.org/trac10/ticket/13455#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Please, report this to Boost.DLL: <a class="ext-link" href="https://github.com/boostorg/dll/issues"><span class="icon">​</span>https://github.com/boostorg/dll/issues</a> </p> Ticket