OSDN Git Service

Fix bugs of unexpected operation unlocking.
authors_kawamoto <s_kawamoto@users.sourceforge.jp>
Wed, 25 Apr 2012 15:02:23 +0000 (00:02 +0900)
committers_kawamoto <s_kawamoto@users.sourceforge.jp>
Wed, 25 Apr 2012 15:02:23 +0000 (00:02 +0900)
FFFTP_Eng_Release/FFFTP.exe
Release/FFFTP.exe
main.c
toolmenu.c

index 596ae63..819dfd3 100644 (file)
Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ
index b2b7816..3ba186d 100644 (file)
Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ
diff --git a/main.c b/main.c
index a83a46a..ff76c17 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1077,6 +1077,9 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_REMOTE_UPDIR :\r
                                        break;\r
 \r
                                case MENU_REMOTE_UPDIR :\r
+                                       // デッドロック対策\r
+                                       if(AskUserOpeDisabled() == YES)\r
+                                               break;\r
                                        SuppressRefresh = 1;\r
                                        SetCurrentDirAsDirHist();\r
                                        ChangeDir(WIN_REMOTE, "..");\r
                                        SuppressRefresh = 1;\r
                                        SetCurrentDirAsDirHist();\r
                                        ChangeDir(WIN_REMOTE, "..");\r
@@ -1084,6 +1087,9 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_LOCAL_UPDIR :\r
                                        break;\r
 \r
                                case MENU_LOCAL_UPDIR :\r
+                                       // デッドロック対策\r
+                                       if(AskUserOpeDisabled() == YES)\r
+                                               break;\r
                                        SetCurrentDirAsDirHist();\r
                                        ChangeDir(WIN_LOCAL, "..");\r
                                        break;\r
                                        SetCurrentDirAsDirHist();\r
                                        ChangeDir(WIN_LOCAL, "..");\r
                                        break;\r
@@ -1286,6 +1292,9 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_REFRESH :\r
                                        break;\r
 \r
                                case MENU_REFRESH :\r
+                                       // デッドロック対策\r
+                                       if(AskUserOpeDisabled() == YES)\r
+                                               break;\r
                                        // 同時接続対応\r
                                        CancelFlg = NO;\r
                                        SuppressRefresh = 1;\r
                                        // 同時接続対応\r
                                        CancelFlg = NO;\r
                                        SuppressRefresh = 1;\r
@@ -1312,6 +1321,9 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case REFRESH_REMOTE :\r
                                        break;\r
 \r
                                case REFRESH_REMOTE :\r
+                                       // デッドロック対策\r
+                                       if(AskUserOpeDisabled() == YES)\r
+                                               break;\r
                                        // 同時接続対応\r
                                        CancelFlg = NO;\r
                                        SuppressRefresh = 1;\r
                                        // 同時接続対応\r
                                        CancelFlg = NO;\r
                                        SuppressRefresh = 1;\r
@@ -1380,6 +1392,9 @@ static LRESULT CALLBACK FtpWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
                                        break;\r
 \r
                                case MENU_DOTFILE :\r
                                        break;\r
 \r
                                case MENU_DOTFILE :\r
+                                       // デッドロック対策\r
+                                       if(AskUserOpeDisabled() == YES)\r
+                                               break;\r
                                        // 同時接続対応\r
                                        CancelFlg = NO;\r
                                        DotFile ^= 1;\r
                                        // 同時接続対応\r
                                        CancelFlg = NO;\r
                                        DotFile ^= 1;\r
index 4d58859..7fcc205 100644 (file)
@@ -103,7 +103,9 @@ static int TmpRemoteDirSort;
 \r
 static int SyncMove = NO;\r
 \r
 \r
 static int SyncMove = NO;\r
 \r
-static int HideUI = NO;\r
+// デッドロック対策\r
+//static int HideUI = NO;\r
+static int HideUI = 0;\r
 \r
 \r
 /* 2007/09/21 sunasunamix  ここから *********************/\r
 \r
 \r
 /* 2007/09/21 sunasunamix  ここから *********************/\r
@@ -588,7 +590,9 @@ HWND GetRemoteTbarWnd(void)
 \r
 int GetHideUI(void)\r
 {\r
 \r
 int GetHideUI(void)\r
 {\r
-       return(HideUI);\r
+       // デッドロック対策\r
+//     return(HideUI);\r
+       return (HideUI > 0 ? YES : NO);\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -608,7 +612,9 @@ void MakeButtonsFocus(void)
        int Count;\r
        int Win;\r
 \r
        int Count;\r
        int Win;\r
 \r
-       if(HideUI == NO)\r
+       // デッドロック対策\r
+//     if(HideUI == NO)\r
+       if(HideUI == 0)\r
        {\r
                hWndMain = GetMainHwnd();\r
                hWndFocus = GetFocus();\r
        {\r
                hWndMain = GetMainHwnd();\r
                hWndFocus = GetFocus();\r
@@ -766,7 +772,9 @@ void DisableUserOpe(void)
 {\r
        int i;\r
 \r
 {\r
        int i;\r
 \r
-       HideUI = YES;\r
+       // デッドロック対策\r
+//     HideUI = YES;\r
+       HideUI++;\r
 \r
        for(i = 0; i < sizeof(HideMenus) / sizeof(int); i++)\r
        {\r
 \r
        for(i = 0; i < sizeof(HideMenus) / sizeof(int); i++)\r
        {\r
@@ -796,7 +804,11 @@ void EnableUserOpe(void)
 {\r
        int i;\r
 \r
 {\r
        int i;\r
 \r
-       if(HideUI == YES)\r
+       // デッドロック対策\r
+//     if(HideUI == YES)\r
+       if(HideUI > 0)\r
+               HideUI--;\r
+       if(HideUI == 0)\r
        {\r
                for(i = 0; i < sizeof(HideMenus) / sizeof(int); i++)\r
                {\r
        {\r
                for(i = 0; i < sizeof(HideMenus) / sizeof(int); i++)\r
                {\r
@@ -812,7 +824,8 @@ void EnableUserOpe(void)
                HideHostKanjiButton();\r
                HideLocalKanjiButton();\r
 \r
                HideHostKanjiButton();\r
                HideLocalKanjiButton();\r
 \r
-               HideUI = NO;\r
+               // バグ修正\r
+//             HideUI = NO;\r
 \r
                MakeButtonsFocus();\r
        }\r
 \r
                MakeButtonsFocus();\r
        }\r
@@ -832,7 +845,9 @@ void EnableUserOpe(void)
 \r
 int AskUserOpeDisabled(void)\r
 {\r
 \r
 int AskUserOpeDisabled(void)\r
 {\r
-       return(HideUI);\r
+       // デッドロック対策\r
+//     return(HideUI);\r
+       return (HideUI > 0 ? YES : NO);\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -1758,7 +1773,9 @@ void LocalRbuttonMenu(int Pos)
        UINT Flg3;\r
        int Count;\r
 \r
        UINT Flg3;\r
        int Count;\r
 \r
-       if(HideUI == NO)\r
+       // デッドロック対策\r
+//     if(HideUI == NO)\r
+       if(HideUI == 0)\r
        {\r
                Flg1 = 0;\r
                if(AskConnecting() == NO)\r
        {\r
                Flg1 = 0;\r
                if(AskConnecting() == NO)\r
@@ -1823,7 +1840,9 @@ void RemoteRbuttonMenu(int Pos)
        UINT Flg3;\r
        int Count;\r
 \r
        UINT Flg3;\r
        int Count;\r
 \r
-       if(HideUI == NO)\r
+       // デッドロック対策\r
+//     if(HideUI == NO)\r
+       if(HideUI == 0)\r
        {\r
                Flg1 = 0;\r
                if(AskConnecting() == NO)\r
        {\r
                Flg1 = 0;\r
                if(AskConnecting() == NO)\r