OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / hostman.c
index d648a30..4fcdd9e 100644 (file)
--- a/hostman.c
+++ b/hostman.c
@@ -28,6 +28,8 @@
 /============================================================================*/\r
 \r
 #define        STRICT\r
+// IPv6対応\r
+#include <winsock2.h>\r
 #include <windows.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
@@ -48,7 +50,9 @@
 \r
 /*===== プロトタイプ =====*/\r
 \r
-static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
 static LRESULT CALLBACK HostListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);\r
 static HOSTLISTDATA *GetNextNode(HOSTLISTDATA *Pos);\r
 static int GetNodeLevel(int Num);\r
@@ -62,15 +66,21 @@ static int DeleteChildAndNext(HOSTLISTDATA *Pos);
 static void SendAllHostNames(HWND hWnd, int Cur);\r
 static int IsNodeGroup(int Num);\r
 static int DispHostSetDlg(HWND hDlg);\r
-static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
-static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
-static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
-static BOOL CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
-static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+//static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+//static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+//static BOOL CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+//static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 // 暗号化通信対応\r
-static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 // 同時接続対応\r
-static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 \r
 /*===== 外部参照 =====*/\r
 \r
@@ -117,7 +127,7 @@ int SelectHost(int Type)
 \r
        /* ホスト設定を保存 */\r
        SetNodeLevelAll();\r
-       SaveRegistory();\r
+       SaveRegistry();\r
 \r
        return(Sts);\r
 }\r
@@ -135,7 +145,9 @@ int SelectHost(int Type)
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
 {\r
        static DIALOGSIZE DlgSize = {\r
                { HOST_NEW, HOST_FOLDER, HOST_SET, HOST_COPY, HOST_DEL, HOST_DOWN, HOST_UP, IDHELP, HOST_SIZEGRIP, -1 },\r
@@ -161,7 +173,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
        {\r
                case WM_INITDIALOG :\r
                        /* TreeViewでのダブルクリックをつかまえるため */\r
-                       HostListProcPtr = (WNDPROC)SetWindowLong(GetDlgItem(hDlg, HOST_LIST), GWL_WNDPROC, (LONG)HostListWndProc);\r
+                       // 64ビット対応\r
+//                     HostListProcPtr = (WNDPROC)SetWindowLong(GetDlgItem(hDlg, HOST_LIST), GWL_WNDPROC, (LONG)HostListWndProc);\r
+                       HostListProcPtr = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, HOST_LIST), GWLP_WNDPROC, (LONG_PTR)HostListWndProc);\r
 \r
 \r
 //             SetClassLong(hDlg, GCL_HICON, (LONG)LoadIcon(GetFtpInst(), MAKEINTRESOURCE(ffftp)));\r
@@ -305,8 +319,11 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                                                CurrentHost = Item.lParam;\r
                                                Level1 = IsNodeGroup(CurrentHost);\r
 \r
-                                               if(((Level1 == YES) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(groupdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)) ||\r
-                                                  ((Level1 == NO) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(hostdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)))\r
+                                               // バグ修正\r
+//                                             if(((Level1 == YES) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(groupdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)) ||\r
+//                                                ((Level1 == NO) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(hostdel_dlg), GetMainHwnd(), ExeEscDialogProc) == YES)))\r
+                                               if(((Level1 == YES) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(groupdel_dlg), hDlg, ExeEscDialogProc) == YES)) ||\r
+                                                  ((Level1 == NO) && (DialogBox(GetFtpInst(), MAKEINTRESOURCE(hostdel_dlg), hDlg, ExeEscDialogProc) == YES)))\r
                                                {\r
                                                        DelHostFromList(CurrentHost);\r
                                                        if(CurrentHost >= Hosts)\r
@@ -1040,7 +1057,12 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set)
                // MLSD対応\r
                Set->UseMLSD = Pos->Set.UseMLSD;\r
                // IPv6対応\r
-               Set->UseIPv6 = Pos->Set.UseIPv6;\r
+               Set->NetType = Pos->Set.NetType;\r
+               // 自動切断対策\r
+               Set->NoopInterval = Pos->Set.NoopInterval;\r
+               // 再転送対応\r
+               Set->TransferErrorMode = Pos->Set.TransferErrorMode;\r
+               Set->TransferErrorNotify = Pos->Set.TransferErrorNotify;\r
                Sts = FFFTP_SUCCESS;\r
        }\r
        return(Sts);\r
@@ -1298,6 +1320,8 @@ void CopyDefaultHost(HOSTDATA *Set)
        Set->KanjiCode = KANJI_NOCNV;\r
        Set->KanaCnv = YES;\r
        Set->NameKanjiCode = KANJI_NOCNV;\r
+       // UTF-8対応\r
+       Set->CurNameKanjiCode = KANJI_NOCNV;\r
        Set->NameKanaCnv = NO;\r
        Set->Pasv = YES;\r
        Set->FireWall = NO;\r
@@ -1323,12 +1347,19 @@ void CopyDefaultHost(HOSTDATA *Set)
        strcpy(Set->PrivateKey, "");\r
        // 同時接続対応\r
        Set->MaxThreadCount = 1;\r
-       Set->ReuseCmdSkt = NO;\r
+       Set->ReuseCmdSkt = YES;\r
+       Set->NoDisplayUI = NO;\r
        // MLSD対応\r
        Set->Feature = 0;\r
        Set->UseMLSD = YES;\r
        // IPv6対応\r
-       Set->UseIPv6 = YES;\r
+       Set->NetType = NTYPE_AUTO;\r
+       Set->CurNetType = NTYPE_AUTO;\r
+       // 自動切断対策\r
+       Set->NoopInterval = 0;\r
+       // 再転送対応\r
+       Set->TransferErrorMode = EXIST_OVW;\r
+       Set->TransferErrorNotify = YES;\r
        return;\r
 }\r
 \r
@@ -1652,9 +1683,13 @@ static int DispHostSetDlg(HWND hDlg)
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
-       long wStyle;\r
+       // 64ビット対応\r
+//     long wStyle;\r
+       LONG_PTR wStyle;\r
        char Tmp[FMAX_PATH+1];\r
        NMHDR *pnmhdr;\r
 \r
@@ -1732,17 +1767,25 @@ static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                        if(SendDlgItemMessage(hDlg, HSET_ANONYMOUS, BM_GETCHECK, 0, 0) == 1)\r
                                        {\r
                                                SendDlgItemMessage(hDlg, HSET_USER, WM_SETTEXT, 0, (LPARAM)"anonymous");\r
-                                               wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               // 64ビット対応\r
+//                                             wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               wStyle = GetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
                                                wStyle &= ~ES_PASSWORD;\r
-                                               SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               // 64ビット対応\r
+//                                             SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               SetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
                                                SendDlgItemMessage(hDlg, HSET_PASS, WM_SETTEXT, 0, (LPARAM)UserMailAdrs);\r
                                        }\r
                                        else\r
                                        {\r
                                                SendDlgItemMessage(hDlg, HSET_USER, WM_SETTEXT, 0, (LPARAM)"");\r
-                                               wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               // 64ビット対応\r
+//                                             wStyle = GetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
+                                               wStyle = GetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE);\r
                                                wStyle |= ES_PASSWORD;\r
-                                               SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               // 64ビット対応\r
+//                                             SetWindowLong(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
+                                               SetWindowLongPtr(GetDlgItem(hDlg, HSET_PASS), GWL_STYLE, wStyle);\r
                                                SendDlgItemMessage(hDlg, HSET_PASS, WM_SETTEXT, 0, (LPARAM)"");\r
                                        }\r
                                        break;\r
@@ -1765,7 +1808,9 @@ static BOOL CALLBACK MainSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
        char Tmp[20];\r
@@ -1802,6 +1847,11 @@ static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPA
                        SendDlgItemMessage(hDlg, HSET_SECURITY, CB_SETCURSEL, TmpHost.Security, 0);\r
                        SendDlgItemMessage(hDlg, HSET_INITCMD, EM_LIMITTEXT, INITCMD_LEN, 0);\r
                        SendDlgItemMessage(hDlg, HSET_INITCMD, WM_SETTEXT, 0, (LPARAM)TmpHost.InitCmd);\r
+                       // IPv6対応\r
+                       SendDlgItemMessage(hDlg, HSET_NETTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN332);\r
+                       SendDlgItemMessage(hDlg, HSET_NETTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN333);\r
+                       SendDlgItemMessage(hDlg, HSET_NETTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN334);\r
+                       SendDlgItemMessage(hDlg, HSET_NETTYPE, CB_SETCURSEL, TmpHost.NetType, 0);\r
                        return(TRUE);\r
 \r
                case WM_NOTIFY:\r
@@ -1818,6 +1868,8 @@ static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPA
                                        TmpHost.TimeZone = SendDlgItemMessage(hDlg, HSET_TIMEZONE, CB_GETCURSEL, 0, 0) - 12;\r
                                        TmpHost.Security = SendDlgItemMessage(hDlg, HSET_SECURITY, CB_GETCURSEL, 0, 0);\r
                                        SendDlgItemMessage(hDlg, HSET_INITCMD, WM_GETTEXT, INITCMD_LEN+1, (LPARAM)TmpHost.InitCmd);\r
+                                       // IPv6対応\r
+                                       TmpHost.NetType = SendDlgItemMessage(hDlg, HSET_NETTYPE, CB_GETCURSEL, 0, 0);\r
                                        Apply = YES;\r
                                        break;\r
 \r
@@ -1856,7 +1908,9 @@ static BOOL CALLBACK AdvSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPA
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
 \r
@@ -1959,7 +2013,9 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
 \r
@@ -2046,7 +2102,9 @@ static BOOL CALLBACK DialupSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam,
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
        int Num;\r
@@ -2061,6 +2119,10 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                        SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_SETCHECK, TmpHost.ListCmdOnly, 0);\r
                        if(TmpHost.ListCmdOnly == YES)\r
                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                       // MLSD対応\r
+                       else\r
+                               EnableWindow(GetDlgItem(hDlg, HSET_MLSDCMD), FALSE);\r
+                       SendDlgItemMessage(hDlg, HSET_MLSDCMD, BM_SETCHECK, TmpHost.UseMLSD, 0);\r
                        SendDlgItemMessage(hDlg, HSET_NLST_R, BM_SETCHECK, TmpHost.UseNLST_R, 0);\r
                        SendDlgItemMessage(hDlg, HSET_FULLPATH, BM_SETCHECK, TmpHost.NoFullPath, 0);\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN139);\r
@@ -2071,8 +2133,15 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN144);\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN289);\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN295);\r
+#if defined(HAVE_TANDEM)\r
+                       SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_ADDSTRING, 0, (LPARAM)MSGJPN2000);\r
+#endif\r
                        SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_SETCURSEL, TmpHost.HostType, 0);\r
+#if defined(HAVE_TANDEM)\r
+                       if(TmpHost.HostType == 2 || TmpHost.HostType == HTYPE_TANDEM)  /* VAX or Tandem */\r
+#else\r
                        if(TmpHost.HostType == 2)\r
+#endif\r
                        {\r
                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
                                EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), FALSE);\r
@@ -2088,6 +2157,8 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                        SendDlgItemMessage(hDlg, HSET_CHMOD_CMD, WM_GETTEXT, CHMOD_CMD_LEN+1, (LPARAM)TmpHost.ChmodCmd);\r
                                        SendDlgItemMessage(hDlg, HSET_LS_FNAME, WM_GETTEXT, NLST_NAME_LEN+1, (LPARAM)TmpHost.LsName);\r
                                        TmpHost.ListCmdOnly = SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_GETCHECK, 0, 0);\r
+                                       // MLSD対応\r
+                                       TmpHost.UseMLSD = SendDlgItemMessage(hDlg, HSET_MLSDCMD, BM_GETCHECK, 0, 0);\r
                                        TmpHost.UseNLST_R = SendDlgItemMessage(hDlg, HSET_NLST_R, BM_GETCHECK, 0, 0);\r
                                        TmpHost.NoFullPath = SendDlgItemMessage(hDlg, HSET_FULLPATH, BM_GETCHECK, 0, 0);\r
                                        TmpHost.HostType = SendDlgItemMessage(hDlg, HSET_HOSTTYPE, CB_GETCURSEL, 0, 0);\r
@@ -2116,9 +2187,19 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
 \r
                                case HSET_LISTCMD :\r
                                        if(SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_GETCHECK, 0, 0) == 0)\r
+                                               // MLSD対応\r
+//                                             EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), TRUE);\r
+                                       {\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_MLSDCMD), FALSE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), TRUE);\r
+                                       }\r
                                        else\r
+                                               // MLSD対応\r
+//                                             EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                                       {\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_MLSDCMD), TRUE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                                       }\r
                                        break;\r
 \r
                                case HSET_HOSTTYPE :\r
@@ -2129,12 +2210,34 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                                EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), FALSE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), FALSE);\r
                                        }\r
+#if defined(HAVE_TANDEM)\r
+                                       else if(Num == HTYPE_TANDEM) /* Tandem */\r
+                                       {\r
+                                               /* Tandem を選択すると自動的に LIST にチェックをいれる */\r
+                                               SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_SETCHECK, 1, 0);\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), FALSE);\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), FALSE);\r
+                                       }\r
+                                       else\r
+                                       {\r
+                                               if(SendDlgItemMessage(hDlg, HSET_LISTCMD, BM_GETCHECK, 0, 0) == 0) {\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), TRUE);\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), TRUE);\r
+                                               } else {\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), FALSE);\r
+                                                       EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), TRUE);\r
+                                               }\r
+                                               EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), TRUE);\r
+                                       }\r
+#else\r
                                        else\r
                                        {\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_NLST_R), TRUE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_LISTCMD), TRUE);\r
                                                EnableWindow(GetDlgItem(hDlg, HSET_FULLPATH), TRUE);\r
                                        }\r
+#endif\r
                                        break;\r
                        }\r
                        return(TRUE);\r
@@ -2144,7 +2247,7 @@ static BOOL CALLBACK Adv2SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
 \r
 \r
 // 暗号化通信対応\r
-static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
 //     int Num;\r
@@ -2165,13 +2268,18 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
                                SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, BST_UNCHECKED, 0);\r
                                EnableWindow(GetDlgItem(hDlg, HSET_FTPIS), FALSE);\r
                        }\r
-                       SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, TmpHost.UseSFTP, 0);\r
-                       SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_SETTEXT, 0, (LPARAM)TmpHost.PrivateKey);\r
-                       // TODO: SFTP対応\r
-                       SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, BST_UNCHECKED, 0);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_SFTP), FALSE);\r
-                       EnableWindow(GetDlgItem(hDlg, PKEY_FILE_BR), FALSE);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_PRIVATE_KEY), FALSE);\r
+                       if(IsPuTTYLoaded())\r
+                       {\r
+                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, TmpHost.UseSFTP, 0);\r
+                               SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_SETTEXT, 0, (LPARAM)TmpHost.PrivateKey);\r
+                       }\r
+                       else\r
+                       {\r
+                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, BST_UNCHECKED, 0);\r
+                               EnableWindow(GetDlgItem(hDlg, HSET_SFTP), FALSE);\r
+                               EnableWindow(GetDlgItem(hDlg, PKEY_FILE_BR), FALSE);\r
+                               EnableWindow(GetDlgItem(hDlg, HSET_PRIVATE_KEY), FALSE);\r
+                       }\r
                        return(TRUE);\r
 \r
                case WM_NOTIFY:\r
@@ -2185,9 +2293,11 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
                                                TmpHost.UseFTPES = SendDlgItemMessage(hDlg, HSET_FTPES, BM_GETCHECK, 0, 0);\r
                                                TmpHost.UseFTPIS = SendDlgItemMessage(hDlg, HSET_FTPIS, BM_GETCHECK, 0, 0);\r
                                        }\r
-                                       // TODO: SFTP対応\r
-//                                     TmpHost.UseSFTP = SendDlgItemMessage(hDlg, HSET_SFTP, BM_GETCHECK, 0, 0);\r
-                                       SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_GETTEXT, PRIVATE_KEY_LEN+1, (LPARAM)TmpHost.PrivateKey);\r
+                                       if(IsPuTTYLoaded())\r
+                                       {\r
+                                               TmpHost.UseSFTP = SendDlgItemMessage(hDlg, HSET_SFTP, BM_GETCHECK, 0, 0);\r
+                                               SendDlgItemMessage(hDlg, HSET_PRIVATE_KEY, WM_GETTEXT, PRIVATE_KEY_LEN+1, (LPARAM)TmpHost.PrivateKey);\r
+                                       }\r
                                        Apply = YES;\r
                                        break;\r
 \r
@@ -2204,11 +2314,22 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
 }\r
 \r
 // 同時接続対応\r
-static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        NMHDR *pnmhdr;\r
 //     int Num;\r
 \r
+       // UTF-8対応\r
+       static const RADIOBUTTON KanjiButton[] = {\r
+               { HSET_NO_CNV, KANJI_NOCNV },\r
+               { HSET_SJIS_CNV, KANJI_SJIS },\r
+               { HSET_JIS_CNV, KANJI_JIS },\r
+               { HSET_EUC_CNV, KANJI_EUC },\r
+               { HSET_UTF8N_CNV, KANJI_UTF8N },\r
+               { HSET_UTF8BOM_CNV, KANJI_UTF8BOM }\r
+       };\r
+       #define KANJIBUTTONS    (sizeof(KanjiButton)/sizeof(RADIOBUTTON))\r
+\r
        switch (iMessage)\r
        {\r
                case WM_INITDIALOG :\r
@@ -2216,6 +2337,23 @@ static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                        SetDecimalText(hDlg, HSET_THREAD_COUNT, TmpHost.MaxThreadCount);\r
                        SendDlgItemMessage(hDlg, HSET_THREAD_COUNT_SPN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(MAX_DATA_CONNECTION, 1));\r
                        SendDlgItemMessage(hDlg, HSET_REUSE_SOCKET, BM_SETCHECK, TmpHost.ReuseCmdSkt, 0);\r
+                       SendDlgItemMessage(hDlg, HSET_NOOP_INTERVAL, EM_LIMITTEXT, (WPARAM)3, 0);\r
+                       SetDecimalText(hDlg, HSET_NOOP_INTERVAL, TmpHost.NoopInterval);\r
+                       SendDlgItemMessage(hDlg, HSET_NOOP_INTERVAL_SPN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(300, 0));\r
+                       SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_ADDSTRING, 0, (LPARAM)MSGJPN335);\r
+                       SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_ADDSTRING, 0, (LPARAM)MSGJPN336);\r
+                       SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_ADDSTRING, 0, (LPARAM)MSGJPN337);\r
+                       SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_ADDSTRING, 0, (LPARAM)MSGJPN338);\r
+                       if(TmpHost.TransferErrorNotify == YES)\r
+                               SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_SETCURSEL, 0, 0);\r
+                       else if(TmpHost.TransferErrorMode == EXIST_OVW)\r
+                               SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_SETCURSEL, 1, 0);\r
+                       else if(TmpHost.TransferErrorMode == EXIST_RESUME)\r
+                               SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_SETCURSEL, 2, 0);\r
+                       else if(TmpHost.TransferErrorMode == EXIST_IGNORE)\r
+                               SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_SETCURSEL, 3, 0);\r
+                       else\r
+                               SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_SETCURSEL, 0, 0);\r
                        return(TRUE);\r
 \r
                case WM_NOTIFY:\r
@@ -2226,6 +2364,27 @@ static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                        TmpHost.MaxThreadCount = GetDecimalText(hDlg, HSET_THREAD_COUNT);\r
                                        CheckRange2(&TmpHost.MaxThreadCount, MAX_DATA_CONNECTION, 1);\r
                                        TmpHost.ReuseCmdSkt = SendDlgItemMessage(hDlg, HSET_REUSE_SOCKET, BM_GETCHECK, 0, 0);\r
+                                       TmpHost.NoopInterval = GetDecimalText(hDlg, HSET_NOOP_INTERVAL);\r
+                                       CheckRange2(&TmpHost.NoopInterval, 300, 0);\r
+                                       switch(SendDlgItemMessage(hDlg, HSET_ERROR_MODE, CB_GETCURSEL, 0, 0))\r
+                                       {\r
+                                       case 0:\r
+                                               TmpHost.TransferErrorMode = EXIST_OVW;\r
+                                               TmpHost.TransferErrorNotify = YES;\r
+                                               break;\r
+                                       case 1:\r
+                                               TmpHost.TransferErrorMode = EXIST_OVW;\r
+                                               TmpHost.TransferErrorNotify = NO;\r
+                                               break;\r
+                                       case 2:\r
+                                               TmpHost.TransferErrorMode = EXIST_RESUME;\r
+                                               TmpHost.TransferErrorNotify = NO;\r
+                                               break;\r
+                                       case 3:\r
+                                               TmpHost.TransferErrorMode = EXIST_IGNORE;\r
+                                               TmpHost.TransferErrorNotify = NO;\r
+                                               break;\r
+                                       }\r
                                        Apply = YES;\r
                                        break;\r
 \r
@@ -2241,3 +2400,23 @@ static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
        return(FALSE);\r
 }\r
 \r
+// 暗号化通信対応\r
+// ホストの暗号化設定を更新\r
+int SetHostExcryption(int Num, int UseNoEncryption, int UseFTPES, int UseFTPIS, int UseSFTP)\r
+{\r
+       int Sts;\r
+       HOSTLISTDATA *Pos;\r
+\r
+       Sts = FFFTP_FAIL;\r
+       if((Num >= 0) && (Num < Hosts))\r
+       {\r
+               Pos = GetNodeByNum(Num);\r
+               Pos->Set.UseNoEncryption = UseNoEncryption;\r
+               Pos->Set.UseFTPES = UseFTPES;\r
+               Pos->Set.UseFTPIS = UseFTPIS;\r
+               Pos->Set.UseSFTP = UseSFTP;\r
+               Sts = FFFTP_SUCCESS;\r
+       }\r
+       return(Sts);\r
+}\r
+\r