diff options
Diffstat (limited to 'drivers/windows/dir_access_windows.cpp')
-rw-r--r-- | drivers/windows/dir_access_windows.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 6cd21b5615..6f3bad12c1 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -165,8 +165,11 @@ Error DirAccessWindows::make_dir(String p_dir) { bool success; int err; - p_dir = "\\\\?\\" + p_dir; //done according to - // https://msdn.microsoft.com/en-us/library/windows/desktop/aa363855(v=vs.85).aspx + if (!p_dir.is_network_share_path()) { + p_dir = "\\\\?\\" + p_dir; + // Add "\\?\" to the path to extend max. path length past 248, if it's not a network share UNC path. + // See https://msdn.microsoft.com/en-us/library/windows/desktop/aa363855(v=vs.85).aspx + } success = CreateDirectoryW((LPCWSTR)(p_dir.utf16().get_data()), nullptr); err = GetLastError(); @@ -349,6 +352,10 @@ String DirAccessWindows::get_filesystem_type() const { ERR_FAIL_COND_V(unit_end == -1, String()); String unit = path.substr(0, unit_end + 1) + "\\"; + if (path.is_network_share_path()) { + return "Network Share"; + } + WCHAR szVolumeName[100]; WCHAR szFileSystemName[10]; DWORD dwSerialNumber = 0; |