@@ -61,7 +61,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
61
61
using var namespaceKey = Registry . CurrentUser . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace" ) ;
62
62
using var syncRootManagerKey = Registry . LocalMachine . OpenSubKey ( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\SyncRootManager" ) ;
63
63
64
- foreach ( var subKeyName in namespaceKey ? . GetSubKeyNames ( ) ?? [ ] )
64
+ foreach ( var subKeyName in namespaceKey ? . GetSubKeyNames ( ) ?? [ ] )
65
65
{
66
66
using var clsidSubKey = SafetyExtensions . IgnoreExceptions ( ( ) => clsidKey ? . OpenSubKey ( subKeyName ) ) ;
67
67
if ( clsidSubKey is not null && ( int ? ) clsidSubKey . GetValue ( "System.IsPinnedToNameSpaceTree" ) is 1 )
@@ -90,6 +90,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
90
90
"ownCloud" => CloudProviders . ownCloud ,
91
91
"ProtonDrive" => CloudProviders . ProtonDrive ,
92
92
"kDrive" => CloudProviders . kDrive ,
93
+ "Lucid" => CloudProviders . LucidLink ,
93
94
_ => null ,
94
95
} ;
95
96
@@ -99,6 +100,7 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
99
100
var nextCloudValue = ( string ? ) namespaceSubKey ? . GetValue ( string . Empty ) ;
100
101
var ownCloudValue = ( string ? ) clsidSubKey ? . GetValue ( string . Empty ) ;
101
102
var kDriveValue = ( string ? ) clsidSubKey ? . GetValue ( string . Empty ) ;
103
+ var lucidLinkValue = ( string ? ) clsidSubKey ? . GetValue ( string . Empty ) ;
102
104
103
105
using var defaultIconKey = clsidSubKey ? . OpenSubKey ( @"DefaultIcon" ) ;
104
106
var iconPath = ( string ? ) defaultIconKey ? . GetValue ( string . Empty ) ;
@@ -116,21 +118,29 @@ private static Task<IEnumerable<ICloudProvider>> DetectGenericCloudDrive()
116
118
CloudProviders . ownCloud => ! string . IsNullOrEmpty ( ownCloudValue ) ? ownCloudValue : "ownCloud" ,
117
119
CloudProviders . ProtonDrive => $ "Proton Drive",
118
120
CloudProviders . kDrive => ! string . IsNullOrEmpty ( kDriveValue ) ? kDriveValue : "kDrive" ,
121
+ CloudProviders . LucidLink => ! string . IsNullOrEmpty ( lucidLinkValue ) ? lucidLinkValue : "lucidLink" ,
119
122
_ => null
120
123
} ,
121
124
SyncFolder = syncedFolder ,
122
- IconData = cloudProvider switch
123
- {
124
- CloudProviders . ProtonDrive => Win32Helper . ExtractSelectedIconsFromDLL ( iconPath , new List < int > ( ) { 32512 } ) . FirstOrDefault ( ) ? . IconData ,
125
- _ => null
126
- }
125
+ IconData = GetIconData ( iconPath )
127
126
} ) ;
128
127
}
129
128
}
130
129
131
130
return Task . FromResult < IEnumerable < ICloudProvider > > ( results ) ;
132
131
}
133
132
133
+ private static byte [ ] ? GetIconData ( string iconPath )
134
+ {
135
+ if ( string . IsNullOrEmpty ( iconPath ) || ! File . Exists ( iconPath ) )
136
+ return null ;
137
+
138
+ if ( iconPath . EndsWith ( ".dll" ) || iconPath . EndsWith ( ".exe" ) )
139
+ return Win32Helper . ExtractSelectedIconsFromDLL ( iconPath , new List < int > ( ) { 32512 } ) . FirstOrDefault ( ) ? . IconData ;
140
+
141
+ return File . ReadAllBytes ( iconPath ) ;
142
+ }
143
+
134
144
private static Task < IEnumerable < ICloudProvider > > DetectOneDrive ( )
135
145
{
136
146
using var oneDriveAccountsKey = Registry . CurrentUser . OpenSubKey ( @"SOFTWARE\Microsoft\OneDrive\Accounts" ) ;
0 commit comments