Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion asio/include/asio/detail/impl/win_iocp_file_service.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ asio::error_code win_iocp_file_service::open(
flags |= FILE_FLAG_WRITE_THROUGH;

impl.offset_ = 0;
HANDLE handle = ::CreateFileA(path, access, share, 0, disposition, flags, 0);
size_t len = std::strlen(path) + 1;
auto wpath = std::make_unique<wchar_t[]>(len);
std::mbstowcs(wpath.get(), path, len);
HANDLE handle = ::CreateFileW(wpath.get(), access, share, 0, disposition, flags, 0);
if (handle != INVALID_HANDLE_VALUE)
{
if (disposition == OPEN_ALWAYS)
Expand Down