Skip to content

Commit d4f472a

Browse files
committed
Update AdjustTokenPrivileges PInvoke usage
Refactored the AdjustTokenPrivileges call to use null for the previous state and an out variable for the return length, improving compatibility with the PInvoke signature and aligning with recommended usage.
1 parent 97d7eab commit d4f472a

File tree

1 file changed

+1
-1
lines changed
  • Plugins/Flow.Launcher.Plugin.Sys

1 file changed

+1
-1
lines changed

Plugins/Flow.Launcher.Plugin.Sys/Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private static unsafe bool EnableShutdownPrivilege()
175175
Privileges = new() { e0 = new LUID_AND_ATTRIBUTES { Luid = luid, Attributes = TOKEN_PRIVILEGES_ATTRIBUTES.SE_PRIVILEGE_ENABLED } }
176176
};
177177

178-
if (!PInvoke.AdjustTokenPrivileges(tokenHandle, false, &privileges, 0, null, null))
178+
if (!PInvoke.AdjustTokenPrivileges(tokenHandle, false, &privileges, null, out var _))
179179
{
180180
return false;
181181
}

0 commit comments

Comments
 (0)