浏览代码

!2 add firewall modify

chenliangyu 4 月之前
父节点
当前提交
1a2989da48
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      Framework/spshell/spshell.cpp

+ 2 - 4
Framework/spshell/spshell.cpp

@@ -277,11 +277,12 @@ static bool AddFirewallRules()
 	*strrchr(szBinDir, SPLIT_SLASH) = 0;
 
 	int nRet = (int)ShellExecute(NULL, "open", "cmd.exe", "/s /c  \"netsh advfirewall firewall delete rule name=\"\"SpShell\"\"", NULL, SW_HIDE);
-	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", "/s /c  \"netsh advfirewall firewall delete rule name=\"\"SpShell\"\"", NULL, SW_HIDE);
+	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", "/s /c  \"netsh advfirewall firewall delete rule name=\"\"SpHost_re\"\"", NULL, SW_HIDE);
 	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", "/s /c  \"netsh advfirewall firewall delete rule name=\"\"SpHost\"\"", NULL, SW_HIDE);
 	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", "/s /c  \"netsh advfirewall firewall delete rule name=\"\"SpGuardian\"\"", NULL, SW_HIDE);
 	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", "/s /c  \"netsh advfirewall firewall delete rule name=\"\"cefclient\"\"", NULL, SW_HIDE);
 
+
 	char szParam[1024] = {};
 	sprintf_s(szParam, 1024, "/s /c  \"netsh advfirewall firewall add rule name=\"\"SpShell\"\" dir=out program=\"\"%s\\spshell.exe\"\" action=allow\"", szBinDir);
 	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", szParam, NULL, SW_HIDE);
@@ -289,9 +290,6 @@ static bool AddFirewallRules()
 	sprintf_s(szParam, 1024, "/s /c  \"netsh advfirewall firewall add rule name=\"\"SpHost\"\" dir=out program=\"\"%s\\sphost.exe\"\" action=allow\"", szBinDir);
 	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", szParam, NULL, SW_HIDE);
 
-	sprintf_s(szParam, 1024, "/s /c  \"netsh advfirewall firewall add rule name=\"\"SpHost_re\"\" dir=out program=\"\"%s\\sphost_re.exe\"\" action=allow\"", szBinDir);
-	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", szParam, NULL, SW_HIDE);
-
 	sprintf_s(szParam, 1024, "/s /c  \"netsh advfirewall firewall add rule name=\"\"SpGuardian\"\" dir=out program=\"\"%s\\guardian.exe\"\" action=allow\"", szBinDir);
 	nRet = (int)ShellExecute(NULL, "open", "cmd.exe", szParam, NULL, SW_HIDE);