OSDN Git Service

Change behavior of automatic IPv4/IPv6 selection.
[ffftp/ffftp.git] / registry.c
index 616fc83..4fa8352 100644 (file)
@@ -193,6 +193,10 @@ extern int FolderAttrNum;
 // 暗号化通信対応\r
 extern BYTE CertificateCacheHash[MAX_CERT_CACHE_HASH][20];\r
 extern BYTE SSLRootCAFileHash[20];\r
+// ファイルアイコン表示対応\r
+extern int DispFileIcon;\r
+// ディレクトリ自動作成\r
+extern int MakeAllDir;\r
 \r
 /*----- マスタパスワードの設定 ----------------------------------------------\r
 *\r
@@ -291,7 +295,7 @@ int ValidateMasterPassword(void)
 *              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
-void SaveRegistory(void)\r
+void SaveRegistry(void)\r
 {\r
        void *hKey3;\r
        void *hKey4;\r
@@ -611,6 +615,10 @@ void SaveRegistory(void)
                                StrCatOut((char*)&SSLRootCAFileHash, sizeof(SSLRootCAFileHash), Buf);\r
                                EncodePassword(Buf, Str);\r
                                WriteStringToReg(hKey4, "RootCertHash", Str);\r
+                               // ファイルアイコン表示対応\r
+                               WriteIntValueToReg(hKey4, "ListIcon", DispFileIcon);\r
+                               // ディレクトリ自動作成\r
+                               WriteIntValueToReg(hKey4, "MakeDir", MakeAllDir);\r
                        }\r
                        CloseSubKey(hKey4);\r
                }\r
@@ -631,7 +639,7 @@ void SaveRegistory(void)
 *              NO:  読み出し失敗(設定無し)\r
 *----------------------------------------------------------------------------*/\r
 \r
-int LoadRegistory(void)\r
+int LoadRegistry(void)\r
 {\r
        void *hKey3;\r
        void *hKey4;\r
@@ -956,6 +964,12 @@ int LoadRegistory(void)
                                        // 同時接続対応\r
                                        ReadIntValueFromReg(hKey5, "ThreadCount", &Host.MaxThreadCount);\r
                                        ReadIntValueFromReg(hKey5, "ReuseCmdSkt", &Host.ReuseCmdSkt);\r
+                                       // 1.98d以前で同時接続数が1より大きい場合はソケットの再利用なし\r
+                                       if(Version < 1985)\r
+                                       {\r
+                                               if(Host.MaxThreadCount > 1)\r
+                                                       Host.ReuseCmdSkt = NO;\r
+                                       }\r
                                        // MLSD対応\r
                                        ReadIntValueFromReg(hKey5, "MLSD", &Host.UseMLSD);\r
                                        // IPv6対応\r
@@ -980,6 +994,10 @@ int LoadRegistory(void)
                        ReadStringFromReg(hKey4, "RootCertHash", Str, PRIVATE_KEY_LEN*4+1);\r
                        DecodePassword(Str, Buf);\r
                        StrReadIn(Buf, sizeof(SSLRootCAFileHash), (char*)&SSLRootCAFileHash);\r
+                       // ファイルアイコン表示対応\r
+                       ReadIntValueFromReg(hKey4, "ListIcon", &DispFileIcon);\r
+                       // ディレクトリ自動作成\r
+                       ReadIntValueFromReg(hKey4, "MakeDir", &MakeAllDir);\r
 \r
                        CloseSubKey(hKey4);\r
                }\r
@@ -1021,7 +1039,7 @@ int LoadRegistory(void)
 *                      YES/NO=設定無し\r
 *----------------------------------------------------------------------------*/\r
 \r
-DWORD LoadHideDriveListRegistory(void)\r
+DWORD LoadHideDriveListRegistry(void)\r
 {\r
        HKEY hKey1;\r
        HKEY hKey2;\r
@@ -1073,7 +1091,7 @@ DWORD LoadHideDriveListRegistory(void)
 *              なし\r
 *----------------------------------------------------------------------------*/\r
 \r
-void ClearRegistory(void)\r
+void ClearRegistry(void)\r
 {\r
        HKEY hKey2;\r
        HKEY hKey3;\r
@@ -1968,7 +1986,7 @@ static int CloseReg(void *Handle)
                        if(WriteOutRegToFile(Handle) == TRUE)\r
                        {\r
 //                             /* レジストリをクリア */\r
-//                             ClearRegistory();\r
+//                             ClearRegistry();\r
                        }\r
                }\r
                /* テーブルを削除 */\r