forked from premiere/premiere-libtorrent
attempt to fix unc paths on windows
This commit is contained in:
parent
5a8037dba2
commit
92fba05040
17
src/file.cpp
17
src/file.cpp
|
@ -801,20 +801,19 @@ namespace libtorrent
|
|||
FILE_SHARE_READ,
|
||||
};
|
||||
|
||||
#if TORRENT_USE_WSTRING
|
||||
#define CreateFile_ CreateFileW
|
||||
m_path = convert_to_wstring(path);
|
||||
#if TORRENT_USE_UNC_PATHS
|
||||
// UNC paths must be absolute
|
||||
std::string p = "\\\\?\\" + (is_complete(path) ? path : combine_path(current_working_directory(), path));
|
||||
#else
|
||||
#define CreateFile_ CreateFileA
|
||||
m_path = convert_to_native(path);
|
||||
std::string const& p = path;
|
||||
#endif
|
||||
|
||||
#if TORRENT_USE_UNC_PATHS
|
||||
#if TORRENT_USE_WSTRING
|
||||
m_path = L"\\\\?\\" + m_path;
|
||||
#define CreateFile_ CreateFileW
|
||||
m_path = convert_to_wstring(p);
|
||||
#else
|
||||
m_path = "\\\\?\\" + m_path;
|
||||
#endif // TORRENT_USE_WSTRING
|
||||
#define CreateFile_ CreateFileA
|
||||
m_path = convert_to_native(p);
|
||||
#endif
|
||||
|
||||
TORRENT_ASSERT((mode & rw_mask) < sizeof(mode_array)/sizeof(mode_array[0]));
|
||||
|
|
Loading…
Reference in New Issue