remove() implementation for Windows Vista and newer
| 2018 | |
| 2019 | //! remove() implementation for Windows Vista and newer |
| 2020 | inline bool remove_nt6_impl(path const& p, remove_impl_type impl, error_code* ec) |
| 2021 | { |
| 2022 | unique_handle h(create_file_handle( |
| 2023 | p, |
| 2024 | DELETE | FILE_READ_ATTRIBUTES | FILE_READ_EA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA, |
| 2025 | FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, |
| 2026 | nullptr, |
| 2027 | OPEN_EXISTING, |
| 2028 | FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT)); |
| 2029 | DWORD err = 0u; |
| 2030 | if (BOOST_UNLIKELY(!h)) |
| 2031 | { |
| 2032 | err = ::GetLastError(); |
| 2033 | |
| 2034 | return_error: |
| 2035 | if (!not_found_error(err)) |
| 2036 | emit_error(err, p, ec, "boost::filesystem::remove"); |
| 2037 | |
| 2038 | return false; |
| 2039 | } |
| 2040 | |
| 2041 | err = fs::detail::remove_nt6_by_handle(h.get(), impl); |
| 2042 | if (BOOST_UNLIKELY(err != 0u)) |
| 2043 | goto return_error; |
| 2044 | |
| 2045 | return true; |
| 2046 | } |
| 2047 | |
| 2048 | //! remove() implementation |
| 2049 | inline bool remove_impl(path const& p, error_code* ec) |
no test coverage detected