From 31890bcf9307bfc3662dac5c2ca773b034098750 Mon Sep 17 00:00:00 2001 From: Nicholas Chin Date: Sat, 20 Sep 2025 16:23:30 +0800 Subject: [PATCH 1/2] Added conditional checking for RaiDrive drive path - RaiDrive seems to use a custom UNC path with the format of \\RaiDrive-{user}\{drive-custom-name} --- src/Files.App/Services/Storage/StorageNetworkService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Files.App/Services/Storage/StorageNetworkService.cs b/src/Files.App/Services/Storage/StorageNetworkService.cs index 5cea00e864a1..7e140e8c8a04 100644 --- a/src/Files.App/Services/Storage/StorageNetworkService.cs +++ b/src/Files.App/Services/Storage/StorageNetworkService.cs @@ -227,6 +227,14 @@ public async Task AuthenticateNetworkShare(string path) } + // Skip authentication for RaiDrive virtual shares + // RaiDrive creates virtual UNC paths that don't work with Windows networking APIs + // Format is \\RaiDrive-{user}\{drive-custom-name}\ + if (path.StartsWith(@"\\RaiDrive-", StringComparison.OrdinalIgnoreCase)) + { + return true; + } + fixed (char* lpcPath = path) netRes.lpRemoteName = new PWSTR(lpcPath); } From f1efa0ad6ada5e5ff63c333d8756f4217231bdd5 Mon Sep 17 00:00:00 2001 From: Nicholas Chin Date: Sat, 27 Sep 2025 09:58:25 +0800 Subject: [PATCH 2/2] Updated conditional checking for virtual disk providers - Added constant array of virtual disk providers --- .../Services/Storage/StorageNetworkService.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Files.App/Services/Storage/StorageNetworkService.cs b/src/Files.App/Services/Storage/StorageNetworkService.cs index 7e140e8c8a04..bcfd16519a21 100644 --- a/src/Files.App/Services/Storage/StorageNetworkService.cs +++ b/src/Files.App/Services/Storage/StorageNetworkService.cs @@ -18,6 +18,14 @@ public sealed partial class NetworkService : ObservableObject, INetworkService private readonly static string guid = "::{f02c1a0d-be21-4350-88b0-7367fc96ef3c}"; + // Virtual disk path prefixes that don't work with Windows networking APIs + private readonly static string[] VirtualDiskPrefixes = + [ + @"\\RaiDrive-", + @"\\cryptomator-vault\", + @"\\EgnyteDrive\" + ]; + private ObservableCollection _Computers = []; /// @@ -227,10 +235,9 @@ public async Task AuthenticateNetworkShare(string path) } - // Skip authentication for RaiDrive virtual shares - // RaiDrive creates virtual UNC paths that don't work with Windows networking APIs - // Format is \\RaiDrive-{user}\{drive-custom-name}\ - if (path.StartsWith(@"\\RaiDrive-", StringComparison.OrdinalIgnoreCase)) + // Skip authentication for virtual disk shares + // These providers create virtual disk paths that don't work with Windows networking APIs + if (VirtualDiskPrefixes.Any(prefix => path.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))) { return true; }