Skip to content

Commit e45416e

Browse files
committed
Fix knownfolder name
1 parent 68d8cb7 commit e45416e

File tree

4 files changed

+132
-132
lines changed

4 files changed

+132
-132
lines changed

src/Meziantou.Framework.FullPath/FullPath.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ public FullPath ChangeExtension(string? extension)
184184
public static FullPath GetFolderPath(Environment.SpecialFolder folder) => FromPath(Environment.GetFolderPath(folder));
185185

186186
[SupportedOSPlatform("windows6.0.6000")]
187-
public static unsafe FullPath GetShellFolderPath(ShellFolder shellFolder)
187+
public static unsafe FullPath GetKnownFolderPath(KnownFolder knownFolder)
188188
{
189-
var result = PInvoke.SHGetKnownFolderPath(shellFolder.FolderId, Windows.Win32.UI.Shell.KNOWN_FOLDER_FLAG.KF_FLAG_DEFAULT, hToken: null, out var path);
189+
var result = PInvoke.SHGetKnownFolderPath(knownFolder.FolderId, Windows.Win32.UI.Shell.KNOWN_FOLDER_FLAG.KF_FLAG_DEFAULT, hToken: null, out var path);
190190
if (result.Succeeded)
191191
{
192192
var expandedValue = Environment.ExpandEnvironmentVariables(path.ToString());
@@ -195,7 +195,7 @@ public static unsafe FullPath GetShellFolderPath(ShellFolder shellFolder)
195195
}
196196

197197
Marshal.FreeCoTaskMem((nint)path.Value);
198-
throw new Win32Exception(result.Value, $"Failed to get shell folder path for {shellFolder}");
198+
throw new Win32Exception(result.Value, $"Failed to get shell folder path for {knownFolder}");
199199
}
200200

201201
public static FullPath CurrentDirectory() => FromPath(Environment.CurrentDirectory);

0 commit comments

Comments
 (0)