Skip to content

Commit

Permalink
Marked ApplicationRestartFlags with Flags attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
DamirAinullin committed Feb 17, 2019
1 parent 0cb9158 commit 7ed2434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shadowsocks-csharp/Controller/System/AutoStartup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static bool Check()
[DllImport("kernel32.dll", SetLastError = true)]
static extern int UnregisterApplicationRestart();

[Flags]
enum ApplicationRestartFlags
{
RESTART_NO_CRASH = 1,
Expand All @@ -137,7 +138,7 @@ public static void RegisterForRestart(bool register)
string cmdline = string.Join(" ", args);
// first parameter is process command line parameter
// needn't include the name of the executable in the command line
RegisterApplicationRestart(cmdline, (int)ApplicationRestartFlags.RESTART_NO_CRASH | (int)ApplicationRestartFlags.RESTART_NO_HANG);
RegisterApplicationRestart(cmdline, (int)(ApplicationRestartFlags.RESTART_NO_CRASH | ApplicationRestartFlags.RESTART_NO_HANG));
Logging.Debug("Register restart after system reboot, command line:" + cmdline);
}
// requested unregister, which has no side effect
Expand Down

0 comments on commit 7ed2434

Please sign in to comment.