Skip to content

Commit 42401af

Browse files
authored
Merge pull request shadowsocks#2222 from DamirAinullin/enum_flags
Marked ApplicationRestartFlags with Flags attribute
2 parents fdd068c + 5a2adf7 commit 42401af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shadowsocks-csharp/Controller/System/AutoStartup.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ public static bool Check()
115115
[DllImport("kernel32.dll", SetLastError = true)]
116116
static extern int UnregisterApplicationRestart();
117117

118+
[Flags]
118119
enum ApplicationRestartFlags
119120
{
121+
RESTART_ALWAYS = 0,
120122
RESTART_NO_CRASH = 1,
121123
RESTART_NO_HANG = 2,
122124
RESTART_NO_PATCH = 4,
@@ -137,7 +139,7 @@ public static void RegisterForRestart(bool register)
137139
string cmdline = string.Join(" ", args);
138140
// first parameter is process command line parameter
139141
// needn't include the name of the executable in the command line
140-
RegisterApplicationRestart(cmdline, (int)ApplicationRestartFlags.RESTART_NO_CRASH | (int)ApplicationRestartFlags.RESTART_NO_HANG);
142+
RegisterApplicationRestart(cmdline, (int)(ApplicationRestartFlags.RESTART_NO_CRASH | ApplicationRestartFlags.RESTART_NO_HANG));
141143
Logging.Debug("Register restart after system reboot, command line:" + cmdline);
142144
}
143145
// requested unregister, which has no side effect

0 commit comments

Comments
 (0)