Skip to content

Commit 8aa4fb7

Browse files
Fix: Added conditional checking for virtual network path (#17664)
1 parent 50a82de commit 8aa4fb7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Files.App/Services/Storage/StorageNetworkService.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ public sealed partial class NetworkService : ObservableObject, INetworkService
1818

1919
private readonly static string guid = "::{f02c1a0d-be21-4350-88b0-7367fc96ef3c}";
2020

21+
// Virtual disk path prefixes that don't work with Windows networking APIs
22+
private readonly static string[] VirtualDiskPrefixes =
23+
[
24+
@"\\RaiDrive-",
25+
@"\\cryptomator-vault\",
26+
@"\\EgnyteDrive\"
27+
];
28+
2129

2230
private ObservableCollection<IFolder> _Computers = [];
2331
/// <inheritdoc/>
@@ -227,6 +235,13 @@ public async Task<bool> AuthenticateNetworkShare(string path)
227235

228236
}
229237

238+
// Skip authentication for virtual disk shares
239+
// These providers create virtual disk paths that don't work with Windows networking APIs
240+
if (VirtualDiskPrefixes.Any(prefix => path.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)))
241+
{
242+
return true;
243+
}
244+
230245
fixed (char* lpcPath = path)
231246
netRes.lpRemoteName = new PWSTR(lpcPath);
232247
}

0 commit comments

Comments
 (0)