OSDN Git Service

Normalize half / full width characters
[ffftp/ffftp.git] / ftpproc.c
index c71194a..8f1736b 100644 (file)
--- a/ftpproc.c
+++ b/ftpproc.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
 /*===== プロトタイプ =====*/\r
 \r
 static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList);\r
-static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 \r
 static void DispMirrorFiles(FILELIST *Local, FILELIST *Remote);\r
 static void MirrorDeleteAllLocalDir(FILELIST *Local, TRANSPACKET *Pkt, TRANSPACKET **Base);\r
 static int CheckLocalFile(TRANSPACKET *Pkt);\r
-static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static void RemoveAfterSemicolon(char *Path);\r
 static void MirrorDeleteAllDir(FILELIST *Remote, TRANSPACKET *Pkt, TRANSPACKET **Base);\r
-static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
-static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+//static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static void CountMirrorFiles(HWND hDlg, TRANSPACKET *Pkt);\r
 static int AskMirrorNoTrn(char *Fname, int Mode);\r
 static int AskUpLoadFileAttr(char *Fname);\r
-static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+#if defined(HAVE_TANDEM)\r
+static INT_PTR CALLBACK UpDownAsWithExtDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+#endif\r
 static void DeleteAllDir(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir);\r
 static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir);\r
-static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
-static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+// 64ビット対応\r
+//static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+//static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
+static INT_PTR CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
 static void SetAttrToDialog(HWND hWnd, int Attr);\r
 static int GetAttrFromDialog(HWND hDlg);\r
 static LRESULT CALLBACK SizeNotifyDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
@@ -95,6 +112,9 @@ extern int CancelFlg;
 /*===== ローカルなワーク =====*/\r
 \r
 static char TmpString[FMAX_PATH+80];           /* テンポラリ */\r
+#if defined(HAVE_TANDEM)\r
+static char TmpFileCode[5];            /* テンポラリ */\r
+#endif\r
 static int CurWin;                                             /* ウインドウ番号 */\r
 \r
 int UpExistMode = EXIST_OVW;           /* アップロードで同じ名前のファイルがある時の扱い方 EXIST_xxx */\r
@@ -122,6 +142,9 @@ void DownLoadProc(int ChName, int ForceFile, int All)
        FILELIST *Pos;\r
        TRANSPACKET Pkt;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -200,6 +223,19 @@ void DownLoadProc(int ChName, int ForceFile, int All)
                                }\r
 \r
                                strcpy(Pkt.Cmd, "RETR ");\r
+#if defined(HAVE_TANDEM)\r
+                               if(AskHostType() == HTYPE_TANDEM) {\r
+                                       if(AskTransferType() != TYPE_X) {\r
+                                               Pkt.Type = AskTransferType();\r
+                                       } else {\r
+                                               Pkt.Attr = Pos->Attr;\r
+                                               if (Pkt.Attr == 101)\r
+                                                       Pkt.Type = TYPE_A;\r
+                                               else\r
+                                                       Pkt.Type = TYPE_I;\r
+                                       }\r
+                               } else\r
+#endif\r
                                Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
                                Pkt.Size = Pos->Size;\r
                                Pkt.Time = Pos->Time;\r
@@ -250,6 +286,9 @@ void DirectDownLoadProc(char *Fname)
 {\r
        TRANSPACKET Pkt;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -386,6 +425,9 @@ void MirrorDownloadProc(int Notify)
        int Level;\r
        int Mode;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -777,7 +819,9 @@ static int CheckLocalFile(TRANSPACKET *Pkt)
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        static TRANSPACKET *Pkt;\r
        static const RADIOBUTTON DownExistButton[] = {\r
@@ -854,6 +898,9 @@ void UpLoadListProc(int ChName, int All)
        char Tmp[FMAX_PATH+1];\r
        int FirstAdd;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -883,12 +930,29 @@ void UpLoadListProc(int ChName, int All)
                                        _mbslwr(Cat);\r
                                else if(FnameCnv == FNAME_UPPER)\r
                                        _mbsupr(Cat);\r
+#if defined(HAVE_TANDEM)\r
+                               Pkt.FileCode = 0;\r
+                               Pkt.PriExt = DEF_PRIEXT;\r
+                               Pkt.SecExt = DEF_SECEXT;\r
+                               Pkt.MaxExt = DEF_MAXEXT;\r
+#endif\r
                        }\r
                        else\r
                        {\r
                                // 名前を変更する\r
                                strcpy(TmpString, Pos->File);\r
                                CurWin = WIN_LOCAL;\r
+#if defined(HAVE_TANDEM)\r
+                               strcpy(TmpFileCode, "0"); /* ASCII モードの場合は無視される */\r
+                               if(AskHostType() == HTYPE_TANDEM && AskOSS() == NO) {\r
+                                       if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(updown_as_with_ext_dlg), GetMainHwnd(), UpDownAsWithExtDialogCallBack) == YES) {\r
+                                               strcat(Pkt.RemoteFile, TmpString);\r
+                                               Pkt.FileCode = atoi(TmpFileCode);\r
+                                       } else {\r
+                                               break;\r
+                                       }\r
+                               } else\r
+#endif\r
                                if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(updown_as_dlg), GetMainHwnd(), UpDownAsDialogCallBack) == YES)\r
                                        strcat(Pkt.RemoteFile, TmpString);\r
                                else\r
@@ -957,6 +1021,11 @@ void UpLoadListProc(int ChName, int All)
                                // UTF-8対応\r
                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
                                Pkt.KanaCnv = AskHostKanaCnv();\r
+#if defined(HAVE_TANDEM)\r
+                               if(AskHostType() == HTYPE_TANDEM && AskOSS() == NO) {\r
+                                       CalcExtentSize(&Pkt, Pos->Size);\r
+                               }\r
+#endif\r
                                Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
                                if(Pkt.Mode == EXIST_ABORT)\r
                                        break;\r
@@ -1019,6 +1088,9 @@ void UpLoadDragProc(WPARAM wParam)
        int FirstAdd;\r
        char Cur[FMAX_PATH+1];\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -1048,6 +1120,12 @@ void UpLoadDragProc(WPARAM wParam)
                        else if(FnameCnv == FNAME_UPPER)\r
                                _mbsupr(Cat);\r
                        ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
+#if defined(HAVE_TANDEM)\r
+                       Pkt.FileCode = 0;\r
+                       Pkt.PriExt = DEF_PRIEXT;\r
+                       Pkt.SecExt = DEF_SECEXT;\r
+                       Pkt.MaxExt = DEF_MAXEXT;\r
+#endif\r
 \r
                        if(AskHostType() == HTYPE_ACOS)\r
                        {\r
@@ -1109,6 +1187,12 @@ void UpLoadDragProc(WPARAM wParam)
                                // UTF-8対応\r
                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
                                Pkt.KanaCnv = AskHostKanaCnv();\r
+#if defined(HAVE_TANDEM)\r
+                               if(AskHostType() == HTYPE_TANDEM && AskOSS() == NO) {\r
+                                       int a = Pos->InfoExist && FINFO_SIZE;\r
+                                       CalcExtentSize(&Pkt, Pos->Size);\r
+                               }\r
+#endif\r
                                Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
                                if(Pkt.Mode == EXIST_ABORT)\r
                                        break;\r
@@ -1175,6 +1259,9 @@ void MirrorUploadProc(int Notify)
        FILETIME TmpFtimeL;\r
        FILETIME TmpFtimeR;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
        {\r
                DisableUserOpe();\r
@@ -1377,6 +1464,11 @@ void MirrorUploadProc(int Notify)
                                                // UTF-8対応\r
                                                Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
                                                Pkt.KanaCnv = AskHostKanaCnv();\r
+#if defined(HAVE_TANDEM)\r
+                                               if(AskHostType() == HTYPE_TANDEM && AskOSS() == NO) {\r
+                                                       CalcExtentSize(&Pkt, LocalPos->Size);\r
+                                               }\r
+#endif\r
                                                Pkt.Mode = EXIST_OVW;\r
                                                AddTmpTransFileList(&Pkt, &Base);\r
                                        }\r
@@ -1469,7 +1561,9 @@ static void MirrorDeleteAllDir(FILELIST *Remote, TRANSPACKET *Pkt, TRANSPACKET *
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        static int Mode;\r
 \r
@@ -1518,7 +1612,9 @@ static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wPara
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        static DIALOGSIZE DlgSize = {\r
                { MIRROR_DEL, MIRROR_SIZEGRIP, -1 },\r
@@ -1777,13 +1873,26 @@ static int AskUpLoadFileAttr(char *Fname)
 static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList)\r
 {\r
        int Ret;\r
+#if defined(HAVE_TANDEM)\r
+       int Mode;\r
+#endif\r
        FILELIST *Exist;\r
 \r
        Ret = EXIST_OVW;\r
        Pkt->ExistSize = 0;\r
        if(SendMode != TRANS_OVW)\r
        {\r
+#if defined(HAVE_TANDEM)\r
+               /* HP NonStop Server は大文字小文字の区別なし(すべて大文字) */\r
+               if(AskHostType() == HTYPE_TANDEM)\r
+                       Mode = COMP_IGNORE;\r
+               else\r
+                       Mode = COMP_STRICT;\r
+\r
+               if((Exist = SearchFileList(GetFileName(Pkt->RemoteFile), ListList, Mode)) != NULL)\r
+#else\r
                if((Exist = SearchFileList(GetFileName(Pkt->RemoteFile), ListList, COMP_STRICT)) != NULL)\r
+#endif\r
                {\r
                        Pkt->ExistSize = Exist->Size;\r
 \r
@@ -1824,7 +1933,9 @@ static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList)
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        static TRANSPACKET *Pkt;\r
        static const RADIOBUTTON UpExistButton[] = {\r
@@ -1890,7 +2001,55 @@ static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wPar
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+{\r
+       switch (iMessage)\r
+       {\r
+               case WM_INITDIALOG :\r
+                       if(CurWin == WIN_LOCAL)\r
+                               SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN064);\r
+                       else\r
+                               SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN065);\r
+\r
+                       SendDlgItemMessage(hDlg, UPDOWNAS_NEW, EM_LIMITTEXT, FMAX_PATH, 0);\r
+                       SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_SETTEXT, 0, (LPARAM)TmpString);\r
+                       SendDlgItemMessage(hDlg, UPDOWNAS_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
+                       return(TRUE);\r
+\r
+               case WM_COMMAND :\r
+                       switch(GET_WM_COMMAND_ID(wParam, lParam))\r
+                       {\r
+                               case IDOK :\r
+                                       SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpString);\r
+                                       EndDialog(hDlg, YES);\r
+                                       break;\r
+\r
+                               case UPDOWNAS_STOP :\r
+                                       EndDialog(hDlg, NO_ALL);\r
+                                       break;\r
+                       }\r
+            return(TRUE);\r
+       }\r
+       return(FALSE);\r
+}\r
+\r
+\r
+#if defined(HAVE_TANDEM)\r
+/*----- アップロード/ダウンロードファイル名入力ダイアログのコールバック ------\r
+*\r
+*      Parameter\r
+*              HWND hDlg : ウインドウハンドル\r
+*              UINT message : メッセージ番号\r
+*              WPARAM wParam : メッセージの WPARAM 引数\r
+*              LPARAM lParam : メッセージの LPARAM 引数\r
+*\r
+*      Return Value\r
+*              BOOL TRUE/FALSE\r
+*----------------------------------------------------------------------------*/\r
+\r
+static INT_PTR CALLBACK UpDownAsWithExtDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        switch (iMessage)\r
        {\r
@@ -1903,6 +2062,9 @@ static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wPa
                        SendDlgItemMessage(hDlg, UPDOWNAS_NEW, EM_LIMITTEXT, FMAX_PATH, 0);\r
                        SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_SETTEXT, 0, (LPARAM)TmpString);\r
                        SendDlgItemMessage(hDlg, UPDOWNAS_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
+                       SendDlgItemMessage(hDlg, UPDOWNAS_FILECODE, EM_LIMITTEXT, 4, 0);\r
+                       SendDlgItemMessage(hDlg, UPDOWNAS_FILECODE, WM_SETTEXT, 0, (LPARAM)TmpFileCode);\r
+\r
                        return(TRUE);\r
 \r
                case WM_COMMAND :\r
@@ -1910,6 +2072,7 @@ static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wPa
                        {\r
                                case IDOK :\r
                                        SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpString);\r
+                                       SendDlgItemMessage(hDlg, UPDOWNAS_FILECODE, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpFileCode);\r
                                        EndDialog(hDlg, YES);\r
                                        break;\r
 \r
@@ -1921,6 +2084,7 @@ static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wPa
        }\r
        return(FALSE);\r
 }\r
+#endif\r
 \r
 \r
 /*----- ファイル一覧で指定されたファイルを削除する ----------------------------\r
@@ -1942,6 +2106,11 @@ void DeleteProc(void)
        char CurDir[FMAX_PATH+1];\r
        char Tmp[FMAX_PATH+1];\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
+       // デッドロック対策\r
+       DisableUserOpe();\r
        Sts = YES;\r
        AskRemoteCurDir(CurDir, FMAX_PATH);\r
        FileListBase = NULL;\r
@@ -1961,7 +2130,8 @@ void DeleteProc(void)
 \r
        if(Sts == YES)\r
        {\r
-               DisableUserOpe();\r
+               // デッドロック対策\r
+//             DisableUserOpe();\r
 \r
                DelFlg = NO;\r
                Sts = NO;\r
@@ -1997,8 +2167,11 @@ void DeleteProc(void)
                                GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
                }\r
 \r
-               EnableUserOpe();\r
+               // デッドロック対策\r
+//             EnableUserOpe();\r
        }\r
+       // デッドロック対策\r
+       EnableUserOpe();\r
        return;\r
 }\r
 \r
@@ -2071,7 +2244,9 @@ static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDi
        {\r
                sprintf(TmpString, "%s", Path);\r
 \r
-               if(AskHostType() == HTYPE_VMS)\r
+               // ローカルのファイルのパスの最後の'\\'が消えるバグ修正\r
+//             if(AskHostType() == HTYPE_VMS)\r
+               if(Win == WIN_REMOTE && AskHostType() == HTYPE_VMS)\r
                        ReformToVMSstylePathName(TmpString);\r
 \r
                CurWin = Win;\r
@@ -2091,7 +2266,9 @@ static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDi
                else\r
                {\r
                        /* フルパスを使わない時のための処理 */\r
-                       if(ProcForNonFullpath(Path, CurDir, GetMainHwnd(), 0) == FFFTP_FAIL)\r
+                       // 同時接続対応\r
+//                     if(ProcForNonFullpath(Path, CurDir, GetMainHwnd(), 0) == FFFTP_FAIL)\r
+                       if(ProcForNonFullpath(AskCmdCtrlSkt(), Path, CurDir, GetMainHwnd(), &CancelFlg) == FFFTP_FAIL)\r
                                *Sw = NO_ALL;\r
 \r
                        if(*Sw != NO_ALL)\r
@@ -2120,7 +2297,9 @@ static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDi
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        switch (iMessage)\r
        {\r
@@ -2175,6 +2354,9 @@ void RenameProc(void)
        int RenFlg;\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        Sts = FFFTP_SUCCESS;\r
        if(GetFocus() == GetLocalHwnd())\r
                Win = WIN_LOCAL;\r
@@ -2250,6 +2432,9 @@ void MoveRemoteFileProc(int drop_index)
        int RenFlg;\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(MoveMode == MOVE_DISABLE)\r
        {\r
                return;\r
@@ -2366,7 +2551,9 @@ void MoveRemoteFileProc(int drop_index)
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+static INT_PTR CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        switch (iMessage)\r
        {\r
@@ -2416,9 +2603,12 @@ void MkdirProc(void)
        int Sts;\r
        int Win;\r
        char Path[FMAX_PATH+1];\r
-       char *Title;\r
+       const char *Title;\r
        int Tmp;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(GetFocus() == GetLocalHwnd())\r
        {\r
                Win = WIN_LOCAL;\r
@@ -2471,6 +2661,9 @@ void ChangeDirComboProc(HWND hWnd)
        char Tmp[FMAX_PATH+1];\r
        int i;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if((i = SendMessage(hWnd, CB_GETCURSEL, 0, 0)) != CB_ERR)\r
        {\r
                SendMessage(hWnd, CB_GETLBTEXT, i, (LPARAM)Tmp);\r
@@ -2512,6 +2705,9 @@ void ChangeDirBmarkProc(int MarkID)
        char Remote[FMAX_PATH+1];\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        Sts = AskBookMarkText(MarkID, Local, Remote, FMAX_PATH+1);\r
        if((Sts == BMARK_TYPE_LOCAL) || (Sts == BMARK_TYPE_BOTH))\r
        {\r
@@ -2548,9 +2744,12 @@ void ChangeDirDirectProc(int Win)
 {\r
        int Sts;\r
        char Path[FMAX_PATH+1];\r
-       char *Title;\r
+       const char *Title;\r
        int Tmp;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(Win == WIN_LOCAL)\r
                Title = MSGJPN072;\r
        else\r
@@ -2627,6 +2826,9 @@ void ChmodProc(void)
        char *BufTmp;\r
        int BufLen;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(GetFocus() == GetRemoteHwnd())\r
        {\r
                if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
@@ -2705,7 +2907,9 @@ void ChmodProc(void)
 *              BOOL TRUE/FALSE\r
 *----------------------------------------------------------------------------*/\r
 \r
-BOOL CALLBACK ChmodDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+// 64ビット対応\r
+//BOOL CALLBACK ChmodDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
+INT_PTR CALLBACK ChmodDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
 {\r
        char Str[5];\r
        static char *Buf;\r
@@ -2850,6 +3054,9 @@ void SomeCmdProc(void)
        int Tmp;\r
        FILELIST *FileListBase;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if(GetFocus() == GetRemoteHwnd())\r
        {\r
                if(CheckClosedAndReconnect() == FFFTP_SUCCESS)\r
@@ -2894,6 +3101,9 @@ void CalcFileSizeProc(void)
        int All;\r
        int Sts;\r
 \r
+       // 同時接続対応\r
+       CancelFlg = NO;\r
+\r
        if((All = DialogBox(GetFtpInst(), MAKEINTRESOURCE(filesize_notify_dlg), GetMainHwnd(), SizeNotifyDlgWndProc)) != NO_ALL)\r
        {\r
                Sts = FFFTP_SUCCESS;\r
@@ -3117,7 +3327,9 @@ void CopyURLtoClipBoard(void)
 *                      Path にファイル名のみ残す。(パス名は消す)\r
 *----------------------------------------------------------------------------*/\r
 \r
-int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type)\r
+// 同時接続対応\r
+//int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type)\r
+int ProcForNonFullpath(SOCKET cSkt, char *Path, char *CurDir, HWND hWnd, int *CancelCheckWork)\r
 {\r
        int Sts;\r
        int Cmd;\r
@@ -3139,10 +3351,12 @@ int ProcForNonFullpath(char *Path, char *CurDir, HWND hWnd, int Type)
 \r
                if(strcmp(Tmp, CurDir) != 0)\r
                {\r
-                       if(Type == 0)\r
-                               Cmd = CommandProcCmd(NULL, "CWD %s", Tmp);\r
-                       else\r
-                               Cmd = CommandProcTrn(NULL, "CWD %s", Tmp);\r
+                       // 同時接続対応\r
+//                     if(Type == 0)\r
+//                             Cmd = CommandProcCmd(NULL, "CWD %s", Tmp);\r
+//                     else\r
+//                             Cmd = CommandProcTrn(NULL, "CWD %s", Tmp);\r
+                       Cmd = CommandProcTrn(cSkt, NULL, CancelCheckWork, "CWD %s", Tmp);\r
 \r
                        if(Cmd/100 != FTP_COMPLETE)\r
                        {\r
@@ -3297,3 +3511,20 @@ static int RenameUnuseableName(char *Fname)
 }\r
 \r
 \r
+// 自動切断対策\r
+// NOOPコマンドでは効果が無いホストが多いためLISTコマンドを使用\r
+void NoopProc(void)\r
+{\r
+       int CancelCheckWork;\r
+       CancelCheckWork = NO;\r
+       if(AskConnecting() == YES && AskUserOpeDisabled() == NO)\r
+       {\r
+               if(AskReuseCmdSkt() == NO || AskShareProh() == YES)\r
+               {\r
+                       DisableUserOpe();\r
+                       DoDirListCmdSkt("", "", 999, &CancelCheckWork);\r
+                       EnableUserOpe();\r
+               }\r
+       }\r
+}\r
+\r