OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / hostman.c
index fdecf28..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
@@ -151,7 +163,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
        int Level2;\r
        HOSTLISTDATA *Data1;\r
        HOSTLISTDATA *Data2;\r
-       NM_TREEVIEW *tView;\r
+       // UTF-8対応\r
+//     NM_TREEVIEW *tView;\r
+       NM_TREEVIEWW *tView;\r
        HTREEITEM tViewPos;\r
        TV_HITTESTINFO HitInfo;\r
 \r
@@ -159,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
@@ -303,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
@@ -550,7 +569,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                        break;\r
 \r
                case WM_NOTIFY:\r
-                       tView = (NM_TREEVIEW FAR *)lParam;\r
+                       // UTF-8対応\r
+//                     tView = (NM_TREEVIEW FAR *)lParam;\r
+                       tView = (NM_TREEVIEWW FAR *)lParam;\r
                        switch(tView->hdr.idFrom)\r
                        {\r
                                case HOST_LIST :\r
@@ -558,7 +579,9 @@ static BOOL CALLBACK SelectHostProc(HWND hDlg, UINT message, WPARAM wParam, LPAR
                                        hItem = tView->itemNew.hItem;\r
                                        switch(tView->hdr.code)\r
                                        {\r
-                                               case TVN_SELCHANGED :\r
+                                               // UTF-8対応\r
+//                                             case TVN_SELCHANGED :\r
+                                               case TVN_SELCHANGEDW :\r
                                                        /* フォルダが選ばれたときは接続、コピーボタンは禁止 */\r
                                                        Item.hItem = hItem;\r
                                                        Item.mask = TVIF_PARAM;\r
@@ -1024,13 +1047,22 @@ int CopyHostFromListInConnect(int Num, HOSTDATA *Set)
                Set->LastDir = Pos->Set.LastDir;\r
                Set->TimeZone = Pos->Set.TimeZone;\r
                // 暗号化通信対応\r
+               Set->UseNoEncryption = Pos->Set.UseNoEncryption;\r
                Set->UseFTPES = Pos->Set.UseFTPES;\r
                Set->UseFTPIS = Pos->Set.UseFTPIS;\r
                Set->UseSFTP = Pos->Set.UseSFTP;\r
                // 同時接続対応\r
                Set->MaxThreadCount = Pos->Set.MaxThreadCount;\r
+               Set->ReuseCmdSkt = Pos->Set.ReuseCmdSkt;\r
                // MLSD対応\r
                Set->UseMLSD = Pos->Set.UseMLSD;\r
+               // IPv6対応\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
@@ -1288,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
@@ -1306,14 +1340,26 @@ void CopyDefaultHost(HOSTDATA *Set)
        strcpy(Set->DialEntry, "");\r
        // 暗号化通信対応\r
        Set->CryptMode = CRYPT_NONE;\r
+       Set->UseNoEncryption = YES;\r
        Set->UseFTPES = YES;\r
        Set->UseFTPIS = YES;\r
        Set->UseSFTP = YES;\r
+       strcpy(Set->PrivateKey, "");\r
        // 同時接続対応\r
        Set->MaxThreadCount = 1;\r
+       Set->ReuseCmdSkt = YES;\r
+       Set->NoDisplayUI = NO;\r
        // MLSD対応\r
        Set->Feature = 0;\r
        Set->UseMLSD = YES;\r
+       // IPv6対応\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
@@ -1637,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
@@ -1717,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
@@ -1750,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
@@ -1787,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
@@ -1803,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
@@ -1841,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
@@ -1851,7 +1920,8 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                { 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_UTF8N_CNV, KANJI_UTF8N },\r
+               { HSET_UTF8BOM_CNV, KANJI_UTF8BOM }\r
        };\r
        #define KANJIBUTTONS    (sizeof(KanjiButton)/sizeof(RADIOBUTTON))\r
 \r
@@ -1899,6 +1969,7 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                case WM_COMMAND :\r
                        switch(GET_WM_COMMAND_ID(wParam, lParam))\r
                        {\r
+                               case HSET_SJIS_CNV :\r
                                case HSET_JIS_CNV :\r
                                case HSET_EUC_CNV :\r
                                        EnableWindow(GetDlgItem(hDlg, HSET_HANCNV), TRUE);\r
@@ -1907,10 +1978,10 @@ static BOOL CALLBACK CodeSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                // UTF-8対応\r
                                case HSET_NO_CNV :\r
                                case HSET_UTF8N_CNV :\r
+                               case HSET_UTF8BOM_CNV :\r
                                        EnableWindow(GetDlgItem(hDlg, HSET_HANCNV), FALSE);\r
                                        break;\r
 \r
-                               case HSET_SJIS_CNV :\r
                                case HSET_FN_JIS_CNV :\r
                                case HSET_FN_EUC_CNV :\r
                                        EnableWindow(GetDlgItem(hDlg, HSET_FN_HANCNV), TRUE);\r
@@ -1942,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
@@ -2029,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
@@ -2044,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
@@ -2054,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
@@ -2071,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
@@ -2099,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
@@ -2112,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
@@ -2127,19 +2247,19 @@ 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
+//     int Num;\r
 \r
        switch (iMessage)\r
        {\r
                case WM_INITDIALOG :\r
+                       SendDlgItemMessage(hDlg, HSET_NO_ENCRYPTION, BM_SETCHECK, TmpHost.UseNoEncryption, 0);\r
                        if(IsOpenSSLLoaded())\r
                        {\r
                                SendDlgItemMessage(hDlg, HSET_FTPES, BM_SETCHECK, TmpHost.UseFTPES, 0);\r
                                SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, TmpHost.UseFTPIS, 0);\r
-                               SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, TmpHost.UseSFTP, 0);\r
                        }\r
                        else\r
                        {\r
@@ -2147,15 +2267,19 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
                                EnableWindow(GetDlgItem(hDlg, HSET_FTPES), FALSE);\r
                                SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, BST_UNCHECKED, 0);\r
                                EnableWindow(GetDlgItem(hDlg, HSET_FTPIS), FALSE);\r
+                       }\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
-                       // TODO: FTPIS対応\r
-                       SendDlgItemMessage(hDlg, HSET_FTPIS, BM_SETCHECK, BST_UNCHECKED, 0);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_FTPIS), FALSE);\r
-                       // TODO: SFTP対応\r
-                       SendDlgItemMessage(hDlg, HSET_SFTP, BM_SETCHECK, BST_UNCHECKED, 0);\r
-                       EnableWindow(GetDlgItem(hDlg, HSET_SFTP), FALSE);\r
                        return(TRUE);\r
 \r
                case WM_NOTIFY:\r
@@ -2163,13 +2287,16 @@ static BOOL CALLBACK CryptSettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, L
                        switch(pnmhdr->code)\r
                        {\r
                                case PSN_APPLY :\r
+                                       TmpHost.UseNoEncryption = SendDlgItemMessage(hDlg, HSET_NO_ENCRYPTION, BM_GETCHECK, 0, 0);\r
                                        if(IsOpenSSLLoaded())\r
                                        {\r
                                                TmpHost.UseFTPES = SendDlgItemMessage(hDlg, HSET_FTPES, BM_GETCHECK, 0, 0);\r
-                                               // TODO: FTPIS対応\r
-//                                             TmpHost.UseFTPIS = SendDlgItemMessage(hDlg, HSET_FTPIS, BM_GETCHECK, 0, 0);\r
-                                               // TODO: SFTP対応\r
-//                                             TmpHost.UseSFTP = SendDlgItemMessage(hDlg, HSET_SFTP, BM_GETCHECK, 0, 0);\r
+                                               TmpHost.UseFTPIS = SendDlgItemMessage(hDlg, HSET_FTPIS, BM_GETCHECK, 0, 0);\r
+                                       }\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
@@ -2187,10 +2314,21 @@ 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
+//     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
@@ -2198,6 +2336,24 @@ static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                        SendDlgItemMessage(hDlg, HSET_THREAD_COUNT, EM_LIMITTEXT, (WPARAM)1, 0);\r
                        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
@@ -2207,6 +2363,28 @@ static BOOL CALLBACK Adv3SettingProc(HWND hDlg, UINT iMessage, WPARAM wParam, LP
                                case PSN_APPLY :\r
                                        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
@@ -2222,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