OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / main.c
diff --git a/main.c b/main.c
index f0ffb8f..b890086 100644 (file)
--- a/main.c
+++ b/main.c
@@ -233,6 +233,8 @@ BYTE CertificateCacheHash[MAX_CERT_CACHE_HASH][20];
 BYTE SSLRootCAFileHash[20];\r
 // ファイルアイコン表示対応\r
 int DispFileIcon = NO;\r
+// ディレクトリ自動作成\r
+int MakeAllDir = NO;\r
 \r
 \r
 \r
@@ -258,66 +260,68 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLi
 \r
        // プロセス保護\r
 #ifdef ENABLE_PROCESS_PROTECTION\r
-       DWORD ProtectLevel;\r
-       char* pCommand;\r
-       char Option[FMAX_PATH+1];\r
-       ProtectLevel = PROCESS_PROTECTION_NONE;\r
-       pCommand = lpszCmdLine;\r
-       while(pCommand = GetToken(pCommand, Option))\r
        {\r
-               if(strcmp(Option, "--protect") == 0)\r
+               DWORD ProtectLevel;\r
+               char* pCommand;\r
+               char Option[FMAX_PATH+1];\r
+               ProtectLevel = PROCESS_PROTECTION_NONE;\r
+               pCommand = lpszCmdLine;\r
+               while(pCommand = GetToken(pCommand, Option))\r
                {\r
-                       ProtectLevel = PROCESS_PROTECTION_DEFAULT;\r
-                       break;\r
-               }\r
-               else if(strcmp(Option, "--protect-high") == 0)\r
-               {\r
-                       ProtectLevel = PROCESS_PROTECTION_HIGH;\r
-                       break;\r
-               }\r
-               else if(strcmp(Option, "--protect-medium") == 0)\r
-               {\r
-                       ProtectLevel = PROCESS_PROTECTION_MEDIUM;\r
-                       break;\r
+                       if(strcmp(Option, "--protect") == 0)\r
+                       {\r
+                               ProtectLevel = PROCESS_PROTECTION_DEFAULT;\r
+                               break;\r
+                       }\r
+                       else if(strcmp(Option, "--protect-high") == 0)\r
+                       {\r
+                               ProtectLevel = PROCESS_PROTECTION_HIGH;\r
+                               break;\r
+                       }\r
+                       else if(strcmp(Option, "--protect-medium") == 0)\r
+                       {\r
+                               ProtectLevel = PROCESS_PROTECTION_MEDIUM;\r
+                               break;\r
+                       }\r
+                       else if(strcmp(Option, "--protect-low") == 0)\r
+                       {\r
+                               ProtectLevel = PROCESS_PROTECTION_LOW;\r
+                               break;\r
+                       }\r
                }\r
-               else if(strcmp(Option, "--protect-low") == 0)\r
+               if(ProtectLevel != PROCESS_PROTECTION_NONE)\r
                {\r
-                       ProtectLevel = PROCESS_PROTECTION_LOW;\r
-                       break;\r
-               }\r
-       }\r
-       if(ProtectLevel != PROCESS_PROTECTION_NONE)\r
-       {\r
-               SetProcessProtectionLevel(ProtectLevel);\r
-               if(!InitializeLoadLibraryHook())\r
-               {\r
-                       MessageBox(NULL, MSGJPN321, "FFFTP", MB_OK | MB_ICONERROR);\r
-                       return 0;\r
-               }\r
+                       SetProcessProtectionLevel(ProtectLevel);\r
+                       if(!InitializeLoadLibraryHook())\r
+                       {\r
+                               MessageBox(NULL, MSGJPN321, "FFFTP", MB_OK | MB_ICONERROR);\r
+                               return 0;\r
+                       }\r
 #ifndef _DEBUG\r
-               if(IsDebuggerPresent())\r
-               {\r
-                       MessageBox(NULL, MSGJPN322, "FFFTP", MB_OK | MB_ICONERROR);\r
-                       return 0;\r
-               }\r
+                       if(IsDebuggerPresent())\r
+                       {\r
+                               MessageBox(NULL, MSGJPN322, "FFFTP", MB_OK | MB_ICONERROR);\r
+                               return 0;\r
+                       }\r
 #endif\r
-               if(!UnloadUntrustedModule())\r
-               {\r
-                       MessageBox(NULL, MSGJPN323, "FFFTP", MB_OK | MB_ICONERROR);\r
-                       return 0;\r
-               }\r
+                       if(!UnloadUntrustedModule())\r
+                       {\r
+                               MessageBox(NULL, MSGJPN323, "FFFTP", MB_OK | MB_ICONERROR);\r
+                               return 0;\r
+                       }\r
 #ifndef _DEBUG\r
-               if(RestartProtectedProcess(" --restart"))\r
-                       return 0;\r
+                       if(RestartProtectedProcess(" --restart"))\r
+                               return 0;\r
 #endif\r
-               if(!EnableLoadLibraryHook(TRUE))\r
-               {\r
-                       MessageBox(NULL, MSGJPN324, "FFFTP", MB_OK | MB_ICONERROR);\r
-                       return 0;\r
+                       if(!EnableLoadLibraryHook(TRUE))\r
+                       {\r
+                               MessageBox(NULL, MSGJPN324, "FFFTP", MB_OK | MB_ICONERROR);\r
+                               return 0;\r
+                       }\r
                }\r
+               else\r
+                       InitializeLoadLibraryHook();\r
        }\r
-       else\r
-               InitializeLoadLibraryHook();\r
 #endif\r
 \r
        // マルチコアCPUの特定環境下でファイル通信中にクラッシュするバグ対策\r
@@ -448,7 +452,7 @@ static int InitApp(LPSTR lpszCmdLine, int cmdShow)
                /* 2010.02.01 genta マスターパスワードを入力させる\r
                  -z オプションがあるときは最初だけスキップ\r
                  -z オプションがないときは,デフォルトパスワードをまず試す\r
-                 LoadRegistory()する\r
+                 LoadRegistry()する\r
                  パスワードが不一致なら再入力するか尋ねる.\r
                  (破損していた場合はさせない)\r
                */\r
@@ -493,7 +497,7 @@ static int InitApp(LPSTR lpszCmdLine, int cmdShow)
                \r
                if(masterpass != 0)\r
                {\r
-                       LoadRegistory();\r
+                       LoadRegistry();\r
 \r
                        // 暗号化通信対応\r
                        SetSSLTimeoutCallback(TimeOut * 1000, SSLTimeoutCallback);\r
@@ -1063,42 +1067,42 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
 \r
                                case MENU_DOWNLOAD :\r
                                        SetCurrentDirAsDirHist();\r
-                                       DownLoadProc(NO, NO, NO);\r
+                                       DownloadProc(NO, NO, NO);\r
                                        break;\r
 \r
                                case MENU_DOWNLOAD_AS :\r
                                        SetCurrentDirAsDirHist();\r
-                                       DownLoadProc(YES, NO, NO);\r
+                                       DownloadProc(YES, NO, NO);\r
                                        break;\r
 \r
                                case MENU_DOWNLOAD_AS_FILE :\r
                                        SetCurrentDirAsDirHist();\r
-                                       DownLoadProc(NO, YES, NO);\r
+                                       DownloadProc(NO, YES, NO);\r
                                        break;\r
 \r
                                case MENU_DOWNLOAD_ALL :\r
                                        SetCurrentDirAsDirHist();\r
-                                       DownLoadProc(NO, NO, YES);\r
+                                       DownloadProc(NO, NO, YES);\r
                                        break;\r
 \r
                                case MENU_DOWNLOAD_NAME :\r
                                        SetCurrentDirAsDirHist();\r
-                                       InputDownLoadProc();\r
+                                       InputDownloadProc();\r
                                        break;\r
 \r
                                case MENU_UPLOAD :\r
                                        SetCurrentDirAsDirHist();\r
-                                       UpLoadListProc(NO, NO);\r
+                                       UploadListProc(NO, NO);\r
                                        break;\r
 \r
                                case MENU_UPLOAD_AS :\r
                                        SetCurrentDirAsDirHist();\r
-                                       UpLoadListProc(YES, NO);\r
+                                       UploadListProc(YES, NO);\r
                                        break;\r
 \r
                                case MENU_UPLOAD_ALL :\r
                                        SetCurrentDirAsDirHist();\r
-                                       UpLoadListProc(NO, YES);\r
+                                       UploadListProc(NO, YES);\r
                                        break;\r
 \r
                                case MENU_MIRROR_UPLOAD :\r
@@ -1359,7 +1363,7 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
 \r
                                case MENU_REGSAVE :\r
                                        GetListTabWidth();\r
-                                       SaveRegistory();\r
+                                       SaveRegistry();\r
                                        SaveSettingsToFile();\r
                                        break;\r
 \r
@@ -1375,7 +1379,7 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                case MENU_REGINIT :\r
                                        if(DialogBox(hInstFtp, MAKEINTRESOURCE(reginit_dlg), hWnd, ExeEscDialogProc) == YES)\r
                                        {\r
-                                               ClearRegistory();\r
+                                               ClearRegistry();\r
                                                SaveExit = NO;\r
                                                PostMessage(hWnd, WM_CLOSE, 0, 0L);\r
                                        }\r
@@ -2082,7 +2086,7 @@ static void ExitProc(HWND hWnd)
        if(SaveExit == YES)\r
        {\r
                GetListTabWidth();\r
-               SaveRegistory();\r
+               SaveRegistry();\r
 \r
                if((CacheEntry > 0) && (CacheSave == YES))\r
                        SaveCache();\r
@@ -2222,12 +2226,12 @@ void DoubleClickProc(int Win, int Mode, int App)
                                                        /* 不正なパスを検出 */\r
                                                        if(CheckPathViolation(&MainTransPkt) == NO)\r
                                                        {\r
-//                                                             if((Sts = DoDownLoad(AskCmdCtrlSkt(), &MainTransPkt, NO)) == 429)\r
+//                                                             if((Sts = DoDownload(AskCmdCtrlSkt(), &MainTransPkt, NO)) == 429)\r
 //                                                             {\r
 //                                                                     ReConnectCmdSkt();\r
                                                                        // 同時接続対応\r
                                                                        CancelFlg = NO;\r
-                                                                       Sts = DoDownLoad(AskCmdCtrlSkt(), &MainTransPkt, NO, &CancelFlg);\r
+                                                                       Sts = DoDownload(AskCmdCtrlSkt(), &MainTransPkt, NO, &CancelFlg);\r
 //                                                             }\r
                                                        }\r
 \r