You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
[Windows] Add support for handling network share paths.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user