mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-30 10:19:51 +08:00
21 lines
784 B
C#
21 lines
784 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace MicaSetup.Shell.Dialogs;
|
|
|
|
public static class SystemProperties
|
|
{
|
|
public static ShellPropertyDescription GetPropertyDescription(PropertyKey propertyKey) => ShellPropertyDescriptionsCache.Cache.GetPropertyDescription(propertyKey);
|
|
|
|
public static ShellPropertyDescription GetPropertyDescription(string canonicalName)
|
|
{
|
|
var result = PropertySystemNativeMethods.PSGetPropertyKeyFromName(canonicalName, out var propKey);
|
|
|
|
if (!CoreErrorHelper.Succeeded(result))
|
|
{
|
|
throw new ArgumentException(LocalizedMessages.ShellInvalidCanonicalName, Marshal.GetExceptionForHR(result));
|
|
}
|
|
return ShellPropertyDescriptionsCache.Cache.GetPropertyDescription(propKey);
|
|
}
|
|
}
|