io_win32: use try_func when dispatching mapped_file
This commit is contained in:
parent
d8f916a25b
commit
2eb1f2b919
39
io_win32.cpp
39
io_win32.cpp
@ -110,24 +110,27 @@ mapped_file::mapped_file (::cruft::win32::handle &&src,
|
|||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
mapped_file::mapped_file (const std::experimental::filesystem::path &path,
|
mapped_file::mapped_file (
|
||||||
int fflags,
|
std::experimental::filesystem::path const &path,
|
||||||
int mflags):
|
int fflags,
|
||||||
mapped_file (
|
int mflags
|
||||||
::cruft::win32::handle (
|
)
|
||||||
::CreateFile (
|
: mapped_file (
|
||||||
path.string ().c_str (),
|
::cruft::win32::handle (
|
||||||
fflags_to_generic (fflags),
|
::cruft::win32::error::try_call (
|
||||||
fflags == O_RDONLY ? FILE_SHARE_READ : 0,
|
::CreateFile,
|
||||||
nullptr,
|
path.u8string ().c_str (),
|
||||||
OPEN_EXISTING,
|
fflags_to_generic (fflags),
|
||||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
|
fflags == O_RDONLY ? FILE_SHARE_READ : 0,
|
||||||
nullptr
|
nullptr,
|
||||||
)
|
OPEN_EXISTING,
|
||||||
),
|
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,
|
||||||
fflags,
|
nullptr
|
||||||
mflags
|
)
|
||||||
)
|
),
|
||||||
|
fflags,
|
||||||
|
mflags
|
||||||
|
)
|
||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user