io_win32: use try_func when dispatching mapped_file

This commit is contained in:
Danny Robson 2018-08-14 16:48:20 +10:00
parent d8f916a25b
commit 2eb1f2b919

View File

@ -110,13 +110,16 @@ mapped_file::mapped_file (::cruft::win32::handle &&src,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
mapped_file::mapped_file (const std::experimental::filesystem::path &path, mapped_file::mapped_file (
std::experimental::filesystem::path const &path,
int fflags, int fflags,
int mflags): int mflags
mapped_file ( )
: mapped_file (
::cruft::win32::handle ( ::cruft::win32::handle (
::CreateFile ( ::cruft::win32::error::try_call (
path.string ().c_str (), ::CreateFile,
path.u8string ().c_str (),
fflags_to_generic (fflags), fflags_to_generic (fflags),
fflags == O_RDONLY ? FILE_SHARE_READ : 0, fflags == O_RDONLY ? FILE_SHARE_READ : 0,
nullptr, nullptr,