diff --git a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs index f6117aab9..3bda99e71 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Sys/Main.cs @@ -22,7 +22,6 @@ namespace Flow.Launcher.Plugin.Sys private PluginInitContext context; private Dictionary KeywordTitleMappings = new Dictionary(); - private const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege"; // SHTDN_REASON_MAJOR_OTHER indicates a generic shutdown reason that isn't categorized under hardware failure, software updates, or other predefined reasons. // SHTDN_REASON_FLAG_PLANNED marks the shutdown as planned rather than an unexpected shutdown or failure private const SHUTDOWN_REASON REASON = SHUTDOWN_REASON.SHTDN_REASON_MAJOR_OTHER | SHUTDOWN_REASON.SHTDN_REASON_FLAG_PLANNED; @@ -116,7 +115,7 @@ namespace Flow.Launcher.Plugin.Sys return false; } - if (!PInvoke.LookupPrivilegeValue(null, SE_SHUTDOWN_NAME, out var luid)) + if (!PInvoke.LookupPrivilegeValue(null, PInvoke.SE_SHUTDOWN_NAME, out var luid)) { return false; } diff --git a/Plugins/Flow.Launcher.Plugin.Sys/NativeMethods.txt b/Plugins/Flow.Launcher.Plugin.Sys/NativeMethods.txt index 6159c725b..4567e46a3 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/NativeMethods.txt +++ b/Plugins/Flow.Launcher.Plugin.Sys/NativeMethods.txt @@ -8,4 +8,5 @@ OpenProcessToken WIN32_ERROR LookupPrivilegeValue AdjustTokenPrivileges -TOKEN_PRIVILEGES \ No newline at end of file +TOKEN_PRIVILEGES +SE_SHUTDOWN_NAME \ No newline at end of file