Browse Source

Change requirements

- Running on Windows Vista or above

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
tags/3.3
Syrone Wong 8 years ago
parent
commit
3417a984fa
3 changed files with 13 additions and 0 deletions
  1. +1
    -0
      shadowsocks-csharp/Data/cn.txt
  2. +8
    -0
      shadowsocks-csharp/Program.cs
  3. +4
    -0
      shadowsocks-csharp/Util/Util.cs

+ 1
- 0
shadowsocks-csharp/Data/cn.txt View File

@@ -113,5 +113,6 @@ Failed to update registry=无法修改注册表
System Proxy On: =系统代理已启用:
Running: Port {0}=正在运行:端口 {0}
Unexpected error, shadowsocks will exit. Please report to=非预期错误,Shadowsocks将退出。请提交此错误到
Unsupported operating system, use Windows Vista at least.=不支持的操作系统版本,最低需求为Windows Vista。
Proxy request failed=代理请求失败
Proxy handshake failed=代理握手失败

+ 8
- 0
shadowsocks-csharp/Program.cs View File

@@ -18,6 +18,14 @@ namespace Shadowsocks
[STAThread]
static void Main()
{
// Check OS since we are using dual-mode socket
if (!Utils.IsWinVistaOrHigher())
{
MessageBox.Show(I18N.GetString("Unsupported operating system, use Windows Vista at least."),
"Shadowsocks Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
Utils.ReleaseMemory(true);
using (Mutex mutex = new Mutex(false, "Global\\Shadowsocks_" + Application.StartupPath.GetHashCode()))
{


+ 4
- 0
shadowsocks-csharp/Util/Util.cs View File

@@ -157,6 +157,10 @@ namespace Shadowsocks.Util
return userKey;
}
public static bool IsWinVistaOrHigher() {
return Environment.OSVersion.Version.Major > 5;
}
[DllImport("kernel32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetProcessWorkingSetSize(IntPtr process,


Loading…
Cancel
Save