CLashConfig.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. #include "stdafx.h"
  2. #include "CLashConfig.h"
  3. #include "CApp.h"
  4. #include "comm.h"
  5. #include "FileOperate.h"
  6. #include "SysProxy.h"
  7. CLashConfig::CLashConfig() : m_socks_port(9200), m_http_port(9300), m_c_port(9090), m_process(nullptr), m_Asyntask(1), m_AsyntaskProcessMonitor(1), m_is_qut(false)
  8. {
  9. SNotifyCenter::getSingleton().addEvent(EVENTID(EventClashPreOceeQut));
  10. }
  11. CLashConfig::~CLashConfig(void)
  12. {
  13. if (m_process)
  14. {
  15. delete m_process;
  16. m_process = nullptr;
  17. }
  18. }
  19. BOOL CLashConfig::MakeClash()
  20. {
  21. buildRules();
  22. YAML::Node root;
  23. root["port"] = m_http_port;
  24. root["socks-port"] = m_socks_port;
  25. root["allow-lan"] = true;
  26. root["external-controller"] = "127.0.0.1:" + std::to_string(m_c_port);
  27. if (CApp::getSingletonPtr()->GetRouteMode() == ROUT_MODE::cn_mode)
  28. {
  29. root["mode"] = "rule";
  30. }
  31. else {
  32. root["mode"] = "rule";
  33. }
  34. #ifdef _DEBUG
  35. root["log-level"] = "debug";
  36. #else
  37. root["log-level"] = "info";
  38. #endif
  39. root["dns"] = buildDnsConfig();
  40. if (CApp::getSingletonPtr()->GetSysMode() == PROXY_MODE::tun_mode)
  41. {
  42. root["tun"] = builTunConfig();
  43. }
  44. //proxys.reserve(0);
  45. //CList_node::getSingletonPtr()->listnode;
  46. YAML::Node proxies;
  47. for each (auto node in CApp::getSingletonPtr()->GetServerList()->vectlistmode)
  48. {
  49. if (node.type == "shadowsocks") {
  50. proxies.push_back(buildShadowsocks(&node));
  51. }
  52. else if (node.type == "trojan") {
  53. proxies.push_back(buildtrojan(&node));
  54. }
  55. else if (node.type == "v2ray") {
  56. proxies.push_back(buildv2ray(&node));
  57. }
  58. }
  59. root["proxies"] = proxies;
  60. //root["proxy-providers"] = buildProxyproviders();
  61. root["proxy-groups"] = buildProxyGroups();
  62. YAML::Node reject;
  63. YAML::Node google;
  64. YAML::Node gfw;
  65. YAML::Node proxy;
  66. YAML::Node cncidr;
  67. reject["type"] = "http";
  68. reject["behavior"] = "domain";
  69. reject["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt";
  70. reject["path"] = "./ruleset/reject.yaml";
  71. reject["interval"] = 86400;
  72. google["type"] = "http";
  73. google["behavior"] = "domain";
  74. google["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt";
  75. google["path"] = "./ruleset/google.yaml";
  76. google["interval"] = 86400;
  77. gfw["type"] = "http";
  78. gfw["behavior"] = "domain";
  79. gfw["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt";
  80. gfw["path"] = "./ruleset/gfw.yaml";
  81. gfw["interval"] = 86400;
  82. proxy["type"] = "http";
  83. proxy["behavior"] = "domain";
  84. proxy["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt";
  85. proxy["path"] = "./ruleset/proxy.yaml";
  86. proxy["interval"] = 86400;
  87. cncidr["type"] = "http";
  88. cncidr["behavior"] = "domain";
  89. cncidr["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt";
  90. cncidr["path"] = "./ruleset/cncidr.yaml";
  91. cncidr["interval"] = 86400;
  92. if (CApp::getSingletonPtr()->GetRouteMode() == ROUT_MODE::cn_mode)
  93. {
  94. root["rule-providers"]["reject"] = reject;
  95. root["rule-providers"]["cncidr"] = cncidr;
  96. root["rule-providers"]["proxy"] = proxy;
  97. root["rule-providers"]["gfw"] = gfw;
  98. root["rule-providers"]["google"] = google;
  99. }
  100. root["rules"] = m_rules;
  101. auto name_file = DSPROXY_CONFIG_ClASH_NAME;
  102. if (CApp::getSingletonPtr()->GetSysMode() == PROXY_MODE::tun_mode) {
  103. name_file = DSPROXY_CONFIG_TUN_ClASH_NAME;
  104. }
  105. try
  106. {
  107. m_run_config = CApp::getSingletonPtr()->GetConfigPath() / name_file;
  108. std::ofstream ofstream(CApp::getSingletonPtr()->GetConfigPath() / name_file);
  109. ofstream << root;
  110. ofstream.close();
  111. }
  112. catch (const std::exception& e) {
  113. LOG_CAUGHT_EXCEPTION();
  114. return FALSE;
  115. }
  116. return TRUE;
  117. }
  118. BOOL CLashConfig::InitClash()
  119. {
  120. if (!m_process)
  121. {
  122. m_process = new CProcess();
  123. }
  124. m_http_port = CTool::getSingletonPtr()->FindAvailableTcpPort(9300,9500);
  125. m_socks_port = CTool::getSingletonPtr()->FindAvailableTcpPort(9600,9800);
  126. m_c_port = CTool::getSingletonPtr()->FindAvailableTcpPort(9900);
  127. auto name_file = DSPROXY_CONFIG_INIT_ClASH_NAME;
  128. if (CApp::getSingletonPtr()->GetSysMode() == PROXY_MODE::tun_mode) {
  129. /*name_file = dir + "\\" + CLASHCONFIINIT;*/
  130. name_file = DSPROXY_CONFIG_TUN_ClASH_NAME;
  131. }
  132. YAML::Node root;
  133. root["port"] = m_http_port;
  134. root["socks-port"] = m_socks_port;
  135. root["allow-lan"] = true;
  136. root["external-controller"] = "127.0.0.1:" + std::to_string(m_c_port);
  137. try
  138. {
  139. std::ofstream ofstream(CApp::getSingletonPtr()->GetConfigPath() / name_file);
  140. ofstream << root << std::endl;
  141. ofstream.close();
  142. return TRUE;
  143. }
  144. catch (const std::exception& e)
  145. {
  146. Logger::getSingletonPtr()->INFO(e.what());
  147. LOG_CAUGHT_EXCEPTION();
  148. return FALSE;
  149. }
  150. return TRUE;
  151. }
  152. BOOL CLashConfig::StartClash()
  153. {
  154. auto assetsDir = std::filesystem::current_path() / CLASH_ASSETS_DIR_NAME;
  155. auto confg_path = CApp::getSingletonPtr()->GetConfigPath() / DSPROXY_CONFIG_INIT_ClASH_NAME;
  156. CProcessManager::getSingletonPtr()->SetArgs(assetsDir / DSPROXY_EXE_NAME, assetsDir, std::move(confg_path));
  157. /*ProcessManager::SetConfigFile(confg_path / DSPROXY_CONFIG_INIT_ClASH_NAME);*/
  158. /* m_Asyntask.AddTask(&CLashConfig::ThreadFun_process_Config, this, (LPARAM)CProcessManager::getSingletonPtr());*/
  159. if (CProcessManager::getSingletonPtr()->Start())
  160. {
  161. CApp::getSingletonPtr()->SetCLashRuning(true);
  162. m_AsyntaskProcessMonitor.AddTask(&CLashConfig::ThreadFun_ProcessMonitor_Config, this, (LPARAM)CProcessManager::getSingletonPtr());
  163. }
  164. /*if (m_process)
  165. {
  166. m_process->Create(CProcess::ASYNC);
  167. if (m_process->Execute(path_config.GetBuffer(0)))
  168. {
  169. }
  170. }*/
  171. return 0;
  172. }
  173. BOOL CLashConfig::StopClash()
  174. {
  175. m_is_qut = true;
  176. /*SetEvent(_hEvent.get());*/
  177. //char ch[MAX_PATH];
  178. //memset(ch, 0, MAX_PATH);
  179. //sprintf_s(ch, "ok\n");
  180. //m_process->WriteSome(ch, sizeof(ch));
  181. return 0;
  182. }
  183. int CLashConfig::GetHttpPort()
  184. {
  185. return m_http_port;
  186. }
  187. int CLashConfig::GetSocketPort()
  188. {
  189. return m_socks_port;
  190. }
  191. int CLashConfig::GetClasApiPort()
  192. {
  193. return m_c_port;
  194. }
  195. std::filesystem::path CLashConfig::GetRunConfig()
  196. {
  197. return m_run_config;
  198. }
  199. YAML::Node CLashConfig::buildShadowsocks(CServerListMode* node)
  200. {
  201. YAML::Node t_map;
  202. if (!node)
  203. {
  204. return t_map;
  205. }
  206. t_map["name"] = node->name;
  207. t_map["type"] = std::string("ss");
  208. t_map["server"] = node->host;
  209. t_map["port"] = std::to_string(node->port);
  210. t_map["cipher"] = node->method;
  211. t_map["password"] = CApp::getSingletonPtr()->GetUserinfo()->uuid;
  212. t_map["udp"] = true;
  213. return t_map;
  214. return YAML::Node();
  215. }
  216. YAML::Node CLashConfig::buildtrojan(CServerListMode* node)
  217. {
  218. YAML::Node t_map;
  219. if (!node)
  220. {
  221. return t_map;
  222. }
  223. t_map["name"] = node->name;
  224. t_map["type"] = std::string("trojan");
  225. t_map["server"] = node->host;
  226. t_map["port"] = std::to_string(node->port);
  227. t_map["password"] = CApp::getSingletonPtr()->GetUserinfo()->uuid;
  228. if (!node->serverName.empty()) {
  229. t_map["serverName"] = node->serverName;
  230. }
  231. t_map["udp"] = true;
  232. return t_map;
  233. return YAML::Node();
  234. }
  235. YAML::Node CLashConfig::buildv2ray(CServerListMode* node)
  236. {
  237. YAML::Node t_map;
  238. if (!node)
  239. {
  240. return t_map;
  241. }
  242. std::vector<YAML::Node> p;
  243. t_map["name"] = node->name;
  244. t_map["type"] = std::string("vmess");
  245. t_map["server"] = node->host;
  246. t_map["port"] = std::to_string(node->port);
  247. t_map["uuid"] = CApp::getSingletonPtr()->GetUserinfo()->uuid;
  248. t_map["cipher"] = "auto";
  249. t_map["alterId"] = 0;
  250. t_map["udp"] = true;
  251. if (node->tls == 1) {
  252. t_map["tls"] = true;
  253. }
  254. if (node->network == "tcp") {
  255. t_map["skip-cert-verify"] = false;
  256. t_map["network"] = node->network;
  257. if (!node->serverName.empty()) {
  258. t_map["servername"] = node->serverName;
  259. }
  260. }
  261. //else if (node->v2_net == "ws") {
  262. // YAML::Node t_host;
  263. // t_map["skip-cert-verify"] = false;
  264. // /*
  265. // max-early-data: 2048
  266. // early-data-header-name: Sec-WebSocket-Protocol
  267. // *
  268. // */
  269. // t_host["host"] = node->v2_host;
  270. // t_map["network"] = node->v2_net;
  271. // t_map["ws-opts"]["headers"] = t_host;
  272. // t_map["ws-opts"]["path"] = node->v2_path;
  273. // t_map["ws-opts"]["max-early-data"] = 2048;
  274. // t_map["ws-opts"]["early-data-header-name"] = "Sec-WebSocket-Protocol";
  275. // /*t_map["ws-path"] = node->v2_path;
  276. // t_map["ws-headers"] = t_host;*/
  277. //}
  278. return t_map;
  279. }
  280. std::vector<YAML::Node> CLashConfig::buildv2rayHost(CServerListMode* node)
  281. {
  282. std::vector<YAML::Node> p;
  283. if (node) {
  284. YAML::Node t_map;
  285. //t_map["host"] = node->v2_host;
  286. p.push_back(t_map);
  287. }
  288. return p;
  289. }
  290. YAML::Node CLashConfig::builTunConfig()
  291. {
  292. std::vector<std::string> dns;
  293. dns.push_back("198.18.0.2:53");
  294. YAML::Node node;
  295. node["enable"] = true;
  296. node["stack"] = "gvisor";
  297. node["dns-hijack"] = dns;
  298. node["auto-route"] = true;
  299. node["auto-detect-interface"] = true;
  300. return node;
  301. }
  302. YAML::Node CLashConfig::buildDnsConfig()
  303. {
  304. YAML::Node dns;
  305. std::vector<std::string> dns_arr;
  306. if (CApp::getSingletonPtr()->GetSysMode() == PROXY_MODE::tun_mode)
  307. {
  308. dns["enhanced-mode"] = "redir-host";
  309. }
  310. dns_arr.push_back("114.114.114.114");
  311. dns_arr.push_back("8.8.8.8");
  312. dns_arr.push_back("tls://dns.rubyfish.cn:853");
  313. dns_arr.push_back("https://1.1.1.1/dns-query");
  314. /*if (CApp::getSingletonPtr()->GetRouteMode() == ROUT_MODE::qg_mode)
  315. {
  316. dns["enable"] = false;
  317. }
  318. else {
  319. dns["enable"] = true;
  320. }*/
  321. dns["enable"] = true;
  322. dns["nameserver"] = dns_arr;
  323. //dns["use-hosts"] = true;
  324. return dns;
  325. }
  326. std::vector<YAML::Node> CLashConfig::buildProxyGroups()
  327. {
  328. std::vector<YAML::Node> dns_arr;
  329. std::vector<std::string> proxy;
  330. YAML::Node proxies;
  331. for each (auto node in CApp::getSingletonPtr()->GetServerList()->vectlistmode)
  332. {
  333. proxy.push_back(node.name.c_str());
  334. }
  335. YAML::Node li;
  336. li["name"] = "Proxy";
  337. li["type"] = "select";
  338. li["proxies"] = proxy;
  339. dns_arr.push_back(li);
  340. /*proxy.push_back("foo");
  341. YAML::Node li;
  342. li["name"] = "Proxy";
  343. li["type"] = "select";
  344. li["use"] = proxy;
  345. dns_arr.push_back(li);*/
  346. return dns_arr;
  347. }
  348. YAML::Node CLashConfig::buildProxyproviders()
  349. {
  350. YAML::Node p;
  351. YAML::Node healthCheck;
  352. p["foo"]["type"] = "http";
  353. p["foo"]["path"] = "./profiles/proxies/foo.yaml";
  354. p["foo"]["url"] = CApp::getSingletonPtr()->GetUserinfo()->clash_config;
  355. p["foo"]["interval"] = "3600";
  356. healthCheck["enable"] = true;
  357. healthCheck["url"] = "http://www.gstatic.com/generate_204";
  358. healthCheck["interval"] = "3600";
  359. p["foo"]["health-check"] = healthCheck;
  360. return p;
  361. }
  362. std::vector<YAML::Node> CLashConfig::buildRules()
  363. {
  364. std::vector<YAML::Node> p;
  365. m_rules.clear();
  366. if (CApp::getSingletonPtr()->GetRouteMode() == ROUT_MODE::cn_mode)
  367. {
  368. m_rules.push_back("RULE-SET,proxy,Proxy");
  369. m_rules.push_back("RULE-SET,google,Proxy");
  370. m_rules.push_back("RULE-SET,gfw,Proxy");
  371. m_rules.push_back("RULE-SET,cncidr,DIRECT");
  372. m_rules.push_back("GEOIP,CN,DIRECT");
  373. m_rules.push_back("IP-CIDR,127.0.0.0/8,DIRECT");
  374. m_rules.push_back("IP-CIDR,172.16.0.0/12,DIRECT");
  375. m_rules.push_back("IP-CIDR,192.168.0.0/16,DIRECT");
  376. m_rules.push_back("IP-CIDR,10.0.0.0/8,DIRECT");
  377. m_rules.push_back("IP-CIDR,100.64.0.0/10,DIRECT");
  378. }
  379. else
  380. {
  381. // m_rules.push_back("RULE-SET,proxy,Proxy");
  382. // m_rules.push_back("RULE-SET,google,Proxy");
  383. // m_rules.push_back("RULE-SET,gfw,Proxy");
  384. // m_rules.push_back("RULE-SET,cncidr,Proxy");
  385. //m_rules.push_back("GEOIP,CN,Proxy");
  386. m_rules.push_back("IP-CIDR,127.0.0.0/8,DIRECT");
  387. m_rules.push_back("IP-CIDR,172.16.0.0/12,DIRECT");
  388. m_rules.push_back("IP-CIDR,192.168.0.0/16,DIRECT");
  389. m_rules.push_back("IP-CIDR,10.0.0.0/8,DIRECT");
  390. m_rules.push_back("IP-CIDR,100.64.0.0/10,DIRECT");
  391. }
  392. m_rules.push_back("MATCH,Proxy");
  393. return p;
  394. }
  395. std::vector<YAML::Node> CLashConfig::buildruleproviders()
  396. {
  397. std::vector<YAML::Node> pp;
  398. YAML::Node node;
  399. YAML::Node reject;
  400. YAML::Node google;
  401. YAML::Node gfw;
  402. YAML::Node proxy;
  403. YAML::Node cncidr;
  404. reject["type"] = "http";
  405. reject["behavior"] = "domain";
  406. reject["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt";
  407. reject["path"] = "./ruleset/reject.yaml";
  408. reject["interval"] = 86400;
  409. node["reject"] = reject;
  410. pp.push_back(node);
  411. google["type"] = "http";
  412. google["behavior"] = "domain";
  413. google["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt";
  414. google["path"] = "./ruleset/google.yaml";
  415. google["interval"] = 86400;
  416. node["google"] = google;
  417. pp.push_back(node);
  418. gfw["type"] = "http";
  419. gfw["behavior"] = "domain";
  420. gfw["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt";
  421. gfw["path"] = "./ruleset/gfw.yaml";
  422. gfw["interval"] = 86400;
  423. node["gfw"] = gfw;
  424. pp.push_back(node);
  425. proxy["type"] = "http";
  426. proxy["behavior"] = "domain";
  427. proxy["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt";
  428. proxy["path"] = "./ruleset/proxy.yaml";
  429. proxy["interval"] = 86400;
  430. node["proxy"] = proxy;
  431. pp.push_back(node);
  432. cncidr["type"] = "http";
  433. cncidr["behavior"] = "domain";
  434. cncidr["url"] = "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt";
  435. cncidr["path"] = "./ruleset/cncidr.yaml";
  436. cncidr["interval"] = 86400;
  437. node["cncidr"] = proxy;
  438. pp.push_back(node);
  439. return pp;
  440. }
  441. void CLashConfig::ThreadFun_process_Config(LPARAM lParam)
  442. {
  443. }
  444. void CLashConfig::ThreadFun_ProcessMonitor_Config(LPARAM lParam)
  445. {
  446. CProcessManager* p = (CProcessManager*)lParam;
  447. if (p)
  448. {
  449. HANDLE hClashProcess = p->GetClashProcessInfo().hProcess;
  450. HANDLE hSubProcess = p->GetSubProcessInfo().hProcess;
  451. WaitForSingleObject(hClashProcess, INFINITE);
  452. CApp::getSingletonPtr()->SetCLashRuning(false);
  453. if (p->IsRunning() != State::Running)
  454. {
  455. return;
  456. }
  457. DWORD exitCode = 0;
  458. THROW_IF_WIN32_BOOL_FALSE(GetExitCodeProcess(hClashProcess, &exitCode));
  459. LOG_HR_MSG(E_FAIL, "syscode.exe exited with code: %ul", exitCode);
  460. FILETIME creationTime = {}, exitTime = {}, kernelTime = {}, userTime = {};
  461. THROW_IF_WIN32_BOOL_FALSE(GetProcessTimes(hClashProcess, &creationTime, &exitTime, &kernelTime, &userTime));
  462. auto creation = winrt::clock::from_FILETIME(creationTime);
  463. auto exit = winrt::clock::from_FILETIME(exitTime);
  464. if (exit - creation < 5s)
  465. {
  466. /*g_balloonClickAction = BalloonClickAction::ShowConsoleWindow;
  467. ShowBalloon(_(L"Clash process was alive less than 5 seconds\nTap to view console log"), _(L"Error"), NIIF_ERROR);
  468. co_await winrt::resume_on_signal(hSubProcess);*/
  469. WaitForSingleObject(hSubProcess, INFINITE);
  470. }
  471. if (p->IsRunning() != State::Running)
  472. {
  473. return;
  474. }
  475. p->Stop();
  476. EventClashPreOceeQut* pEvt = new EventClashPreOceeQut(nullptr);
  477. pEvt->status = 200;
  478. pEvt->msg = L"";
  479. SNotifyCenter::getSingleton().FireEventAsync(pEvt);
  480. pEvt->Release();
  481. }
  482. }
  483. BOOL CLashConfig::SetProxy()
  484. {
  485. BOOL isok = FALSE;
  486. /*if (CApp::getSingletonPtr()->GetSysMode() == PROXY_MODE::sys_mode)
  487. {
  488. auto proxy = "127.0.0.1:" + std::to_string(m_http_port);
  489. isok = SetSystemProxy(S_CA2W(proxy.c_str()), NULL, L"localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*");
  490. }*/
  491. auto proxy = "127.0.0.1:" + std::to_string(m_http_port);
  492. isok = SetSystemProxy(S_CA2W(proxy.c_str()), NULL, L"localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;172.32.*;192.168.*");
  493. return isok;
  494. }
  495. //winrt::fire_and_forget CLashConfig::_StartClash()
  496. //{
  497. // if (CProcessManager::getSingletonPtr()->Start())
  498. // {
  499. // CApp::getSingletonPtr()->SetCLashRuning(true);
  500. //
  501. //
  502. //
  503. // /*HANDLE hClashProcess = CProcessManager::getSingletonPtr()->GetClashProcessInfo().hProcess;
  504. //
  505. // for (size_t i = 0; i < 5; ++i) {
  506. //
  507. // }*/
  508. // }
  509. //
  510. //
  511. //
  512. //}
  513. //
  514. //winrt::Windows::Foundation::IAsyncAction CLashConfig::ProcessMonitor()
  515. //{
  516. // HANDLE hSubProcess = CProcessManager::getSingletonPtr()->GetClashProcessInfo().hProcess,
  517. // hClashProcess = CProcessManager::getSingletonPtr()->GetClashProcessInfo().hProcess;
  518. //
  519. // winrt::resume_on_signal(hClashProcess);
  520. //
  521. // /*std::future<void> f = std::async(std::launch::async, []() {
  522. // })*/
  523. //
  524. //
  525. //
  526. //
  527. //}