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,
|
FILE_SHARE_READ,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if TORRENT_USE_WSTRING
|
#if TORRENT_USE_UNC_PATHS
|
||||||
#define CreateFile_ CreateFileW
|
// UNC paths must be absolute
|
||||||
m_path = convert_to_wstring(path);
|
std::string p = "\\\\?\\" + (is_complete(path) ? path : combine_path(current_working_directory(), path));
|
||||||
#else
|
#else
|
||||||
#define CreateFile_ CreateFileA
|
std::string const& p = path;
|
||||||
m_path = convert_to_native(path);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if TORRENT_USE_UNC_PATHS
|
|
||||||
#if TORRENT_USE_WSTRING
|
#if TORRENT_USE_WSTRING
|
||||||
m_path = L"\\\\?\\" + m_path;
|
#define CreateFile_ CreateFileW
|
||||||
|
m_path = convert_to_wstring(p);
|
||||||
#else
|
#else
|
||||||
m_path = "\\\\?\\" + m_path;
|
#define CreateFile_ CreateFileA
|
||||||
#endif // TORRENT_USE_WSTRING
|
m_path = convert_to_native(p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TORRENT_ASSERT((mode & rw_mask) < sizeof(mode_array)/sizeof(mode_array[0]));
|
TORRENT_ASSERT((mode & rw_mask) < sizeof(mode_array)/sizeof(mode_array[0]));
|
||||||
|
|
Loading…
Reference in New Issue