OSDN Git Service

Fix bugs of drag-and-drop handling.
[ffftp/ffftp.git] / tool.c
diff --git a/tool.c b/tool.c
index dce80ab..4c1cf62 100644 (file)
--- a/tool.c
+++ b/tool.c
@@ -163,3 +163,29 @@ static INT_PTR CALLBACK OtpCalcWinProc(HWND hDlg, UINT message, WPARAM wParam, L
 \r
 \r
 \r
+// FTPS対応\r
+void TurnStatefulFTPFilter()\r
+{\r
+       int ID;\r
+       char CurDir[FMAX_PATH+1];\r
+       char SysDir[FMAX_PATH+1];\r
+       ID = MessageBox(GetMainHwnd(), MSGJPN341, "FFFTP", MB_YESNOCANCEL);\r
+       if(ID == IDYES || ID == IDNO)\r
+       {\r
+               if(GetCurrentDirectory(FMAX_PATH, CurDir) > 0)\r
+               {\r
+                       if(GetSystemDirectory(SysDir, FMAX_PATH) > 0)\r
+                       {\r
+                               if(SetCurrentDirectory(SysDir))\r
+                               {\r
+                                       if(ShellExecute(NULL, "runas", "netsh", ID == IDYES ? "advfirewall set global statefulftp enable" : "advfirewall set global statefulftp disable", NULL, SW_SHOW) <= (HINSTANCE)32)\r
+                                       {\r
+                                               MessageBox(GetMainHwnd(), MSGJPN342, "FFFTP", MB_OK | MB_ICONERROR);\r
+                                       }\r
+                                       SetCurrentDirectory(CurDir);\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r