Merge pull request #57116 from bruvzg/win_net_share
This commit is contained in:
commit
9686d680b7
8 changed files with 69 additions and 16 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue