Martin Prikryl 18 years ago
parent
commit
7e32c720b4
82 changed files with 1223 additions and 519 deletions
  1. 1 29
      Console.bpr
  2. 28 0
      Console.rc
  3. BIN
      Console.res
  4. 1 2
      DScpComp.bpk
  5. BIN
      DScpComp.res
  6. 1 29
      DragExt.bpr
  7. 28 0
      DragExt.rc
  8. BIN
      DragExt.res
  9. 28 0
      DragExt64.rc
  10. 11 9
      FileZilla.bpr
  11. 12 13
      Putty.bpr
  12. 2 2
      RScpComp.bpr
  13. 9 9
      ScpCore.bpr
  14. 14 14
      ScpForms.bpr
  15. 10 37
      WinSCP.bpr
  16. 28 0
      WinSCP.rc
  17. BIN
      WinSCP.res
  18. 3 11
      core/Configuration.cpp
  19. 0 1
      core/Configuration.h
  20. 50 40
      core/FileBuffer.cpp
  21. 9 3
      core/FileBuffer.h
  22. 129 72
      core/FtpFileSystem.cpp
  23. 6 1
      core/FtpFileSystem.h
  24. 47 1
      core/HierarchicalStorage.cpp
  25. 4 1
      core/HierarchicalStorage.h
  26. 11 0
      core/PuttyIntf.cpp
  27. 2 0
      core/PuttyTools.h
  28. 9 1
      core/RemoteFiles.cpp
  29. 5 17
      core/ScpFileSystem.cpp
  30. 8 2
      core/SecureShell.cpp
  31. 2 2
      core/SecureShell.h
  32. 2 0
      core/SessionData.h
  33. 73 53
      core/SftpFileSystem.cpp
  34. 4 4
      dragext/DragExt.cpp
  35. 2 0
      dragext/DragExt.h
  36. 7 0
      dragext/DragExt64.def
  37. 4 0
      filezilla/FtpControlSocket.cpp
  38. 9 4
      forms/EditorPreferences.cpp
  39. 2 2
      forms/EditorPreferences.h
  40. 1 1
      forms/FullSynchronize.dfm
  41. 6 2
      forms/Login.cpp
  42. 8 4
      forms/Login.dfm
  43. 2 1
      forms/Login.h
  44. 0 1
      forms/Synchronize.dfm
  45. 12 2
      makefile
  46. 33 0
      makefile.dragext64
  47. 5 6
      packages/DiscMon_B5.bpk
  48. BIN
      packages/DiscMon_B5.res
  49. 12 14
      packages/DragDrop_B5.bpk
  50. BIN
      packages/DragDrop_B5.res
  51. 14 15
      packages/DriveDir_B5.bpk
  52. BIN
      packages/DriveDir_B5.res
  53. 10 13
      packages/Moje_B5.bpk
  54. BIN
      packages/Moje_B5.res
  55. 3 4
      packages/ThemeManagerC6.bpk
  56. BIN
      packages/ThemeManagerC6.res
  57. 1 0
      packages/filemng/CustomDriveView.hpp
  58. 10 0
      packages/filemng/CustomDriveView.pas
  59. 36 11
      packages/filemng/IEDriveInfo.pas
  60. 3 4
      packages/tb2k_cb6.bpk
  61. 2 3
      packages/tb2kdsgn_cb6.bpk
  62. 4 5
      packages/tbx_cb6.bpk
  63. BIN
      packages/tbx_cb6.res
  64. BIN
      packages/tbxdsgn_cb6.res
  65. 9 1
      putty/SSH_.C
  66. 1 0
      putty/puttyexp.h
  67. 5 0
      readme
  68. 7 1
      release/winscpsetup.iss
  69. 1 0
      resource/TextsCore.h
  70. 1 0
      resource/TextsCore1.rc
  71. 11 0
      resource/TextsFileZilla.rc
  72. 2 2
      resource/TextsWin1.rc
  73. 0 0
      stamp
  74. 111 59
      windows/ConsoleRunner.cpp
  75. 11 1
      windows/GUITools.cpp
  76. 1 3
      windows/Setup.cpp
  77. 31 0
      windows/Tools.cpp
  78. 1 0
      windows/Tools.h
  79. 79 0
      windows/VCLCommon.cpp
  80. 16 0
      windows/VCLCommon.h
  81. 15 7
      windows/WinConfiguration.cpp
  82. 198 0
      windows/Windows.rc

+ 1 - 29
Console.bpr

@@ -32,7 +32,7 @@
     <PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
     <RFLAGS value=""/>
     <AFLAGS value="/mx /w2 /zd"/>
-    <LFLAGS value="-D&quot;&quot; -ap -Tpe -x -Gn"/>
+    <LFLAGS value="-D -ap -Tpe -x -Gn"/>
     <OTHERFILES value=""/>
   </OPTIONS>
   <LINKER>
@@ -50,34 +50,6 @@
   </BUILDTOOLS>
 
   <IDEOPTIONS>
-[Version Info]
-IncludeVerInfo=1
-AutoIncBuild=1
-MajorVer=2
-MinorVer=0
-Release=0
-Build=76
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1033
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=Martin Prikryl
-FileDescription=Console interface for WinSCP
-FileVersion=2.0.0.76
-InternalName=console
-LegalCopyright=(c) 2004-2007 Martin Prikryl
-LegalTrademarks=
-OriginalFilename=winscp.com
-ProductName=WinSCP
-ProductVersion=4.0.4.0
-Comments=
-WWW=http://winscp.net/
-
 [Compiler]
 ShowInfoMsgs=0
 LinkDebugVcl=0

+ 28 - 0
Console.rc

@@ -0,0 +1,28 @@
+1 VERSIONINFO
+FILEVERSION 2,0,0,80
+PRODUCTVERSION 2,0,0,80
+FILEOS 0x4
+FILETYPE 0x1
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName", "Martin Prikryl\0"
+            VALUE "FileDescription", "Console interface for WinSCP\0"
+            VALUE "FileVersion", "2.0.0.80\0"
+            VALUE "InternalName", "console\0"
+            VALUE "LegalCopyright", "(c) 2000-2007 Martin Prikryl\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "winscp.com\0"
+            VALUE "ProductName", "WinSCP\0"
+            VALUE "ProductVersion", "4.0.5.0\0"
+            VALUE "WWW", "http://winscp.net/\0"
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409 0x04E4
+    }
+}

BIN
Console.res


+ 1 - 2
DScpComp.bpk

@@ -6,7 +6,7 @@
     <PROJECT value="DScpComp.bpl"/>
     <OBJFILES value="DScpComp.obj components\UnixDirView.obj components\UnixPathComboBox.obj 
       components\LogMemo.obj components\UnixDriveView.obj"/>
-    <RESFILES value="DScpComp.res"/>
+    <RESFILES value=""/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>
     <LIBFILES value=""/>
@@ -47,7 +47,6 @@
   </LINKER>
   <FILELIST>
       <FILE FILENAME="DScpComp.cpp" FORMNAME="" UNITNAME="DScpComp" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="DScpComp.res" FORMNAME="" UNITNAME="DScpComp.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="Moje_B5.bpi" FORMNAME="" UNITNAME="Moje_B5" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="DriveDir_B5.bpi" FORMNAME="" UNITNAME="DriveDir_B5" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="DragDrop_B5.bpi" FORMNAME="" UNITNAME="DragDrop_B5" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>

BIN
DScpComp.res


+ 1 - 29
DragExt.bpr

@@ -32,7 +32,7 @@
     <PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
     <RFLAGS value=""/>
     <AFLAGS value="/mx /w2 /zn"/>
-    <LFLAGS value="-D&quot;&quot; -aa -Tpd -x -Gn -Gi"/>
+    <LFLAGS value="-D -aa -Tpd -x -Gn -Gi"/>
     <OTHERFILES value=""/>
   </OPTIONS>
   <LINKER>
@@ -50,34 +50,6 @@
   </BUILDTOOLS>
 
   <IDEOPTIONS>
-[Version Info]
-IncludeVerInfo=1
-AutoIncBuild=1
-MajorVer=1
-MinorVer=1
-Release=5
-Build=75
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=1
-Locale=1033
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=Martin Prikryl
-FileDescription=Drag&amp;Drop shell extension for WinSCP
-FileVersion=1.1.5.75
-InternalName=dragext
-LegalCopyright=(c) 2004-2007 Martin Prikryl
-LegalTrademarks=
-OriginalFilename=dragext.dll
-ProductName=WinSCP
-ProductVersion=4.0.4.0
-Comments=
-WWW=http://winscp.net/
-
 [Compiler]
 ShowInfoMsgs=0
 LinkDebugVcl=0

+ 28 - 0
DragExt.rc

@@ -0,0 +1,28 @@
+1 VERSIONINFO
+FILEVERSION 1,1,6,78
+PRODUCTVERSION 1,1,6,78
+FILEOS 0x4
+FILETYPE 0x2
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName", "Martin Prikryl\0"
+            VALUE "FileDescription", "Drag&Drop shell extension for WinSCP\0"
+            VALUE "FileVersion", "1.1.6.78\0"
+            VALUE "InternalName", "dragext\0"
+            VALUE "LegalCopyright", "(c) 2000-2007 Martin Prikryl\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "dragext.dll\0"
+            VALUE "ProductName", "WinSCP\0"
+            VALUE "ProductVersion", "4.0.5.0\0"
+            VALUE "WWW", "http://winscp.net/\0"
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409 0x04E4
+    }
+}

BIN
DragExt.res


+ 28 - 0
DragExt64.rc

@@ -0,0 +1,28 @@
+1 VERSIONINFO
+FILEVERSION 1,1,6,78
+PRODUCTVERSION 1,1,6,78
+FILEOS 0x4
+FILETYPE 0x2
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName", "Martin Prikryl\0"
+            VALUE "FileDescription", "Drag&Drop shell extension for WinSCP (64-bit)\0"
+            VALUE "FileVersion", "1.1.6.78\0"
+            VALUE "InternalName", "dragext64\0"
+            VALUE "LegalCopyright", "(c) 2000-2007 Martin Prikryl\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "dragext64.dll\0"
+            VALUE "ProductName", "WinSCP\0"
+            VALUE "ProductVersion", "4.0.5.0\0"
+            VALUE "WWW", "http://winscp.net/\0"
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409 0x04E4
+    }
+}

+ 11 - 9
FileZilla.bpr

@@ -4,15 +4,17 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="lib\FileZilla.lib"/>
-    <OBJFILES value="filezilla\ApiLog.obj filezilla\AsyncProxySocketLayer.obj 
-      filezilla\AsyncSocketEx.obj filezilla\AsyncSocketExLayer.obj 
-      filezilla\misc\CBase64Coding.obj filezilla\ControlSocket.obj filezilla\Crypt.obj 
-      filezilla\FzApiStructures.obj filezilla\FileZillaApi.obj 
-      filezilla\FileZillaIntern.obj filezilla\FileZillaIntf.obj 
-      filezilla\FtpControlSocket.obj filezilla\FtpListResult.obj 
-      filezilla\MainThread.obj filezilla\MFC64bitFix.obj filezilla\Options.obj 
-      filezilla\PathFunctions.obj filezilla\ServerPath.obj filezilla\structures.obj 
-      filezilla\TransferSocket.obj filezilla\misc\Fzutf8.obj"/>
+    <OBJFILES value="filezilla\ApiLog.obj
+      filezilla\AsyncProxySocketLayer.obj filezilla\AsyncSocketEx.obj
+      filezilla\AsyncSocketExLayer.obj filezilla\misc\CBase64Coding.obj
+      filezilla\ControlSocket.obj filezilla\Crypt.obj
+      filezilla\FzApiStructures.obj filezilla\FileZillaApi.obj
+      filezilla\FileZillaIntern.obj filezilla\FileZillaIntf.obj
+      filezilla\FtpControlSocket.obj filezilla\FtpListResult.obj
+      filezilla\MainThread.obj filezilla\MFC64bitFix.obj filezilla\Options.obj
+      filezilla\PathFunctions.obj filezilla\ServerPath.obj
+      filezilla\structures.obj filezilla\TransferSocket.obj
+      filezilla\misc\Fzutf8.obj"/>
     <RESFILES value=""/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>

+ 12 - 13
Putty.bpr

@@ -4,19 +4,18 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="lib\Putty.lib"/>
-    <OBJFILES value="putty\BE_NONE.obj putty\CPROXY.obj putty\INT64.obj 
-      putty\LOGGING.obj putty\MISC.obj putty\PORTFWD_.obj 
-      putty\PPROXY.obj putty\PROXY.obj putty\SSH_.obj putty\SSHAES.obj 
-      putty\SSHBLOWF.obj putty\SSHBN.obj putty\SSHCRC.obj 
-      putty\SSHCRCDA.obj putty\SSHDES.obj putty\SSHDH.obj 
-      putty\SSHDSS.obj putty\SSHGSS.obj putty\SSHGSSC.obj 
-      putty\SSHMD5.obj putty\SSHPUBK.obj putty\SSHRAND.obj 
-      putty\SSHRSA.obj putty\SSHSH512.obj putty\SSHSHA.obj 
-      putty\SSHZLIB.obj putty\TREE234.obj putty\CHARSET\UTF8.obj 
-      putty\WILDCARD.obj putty\WINDOWS\WINDL.obj putty\WINDOWS\WINGSS.obj 
-      putty\WINDOWS\WINMISC.obj putty\WINDOWS\WINNET.obj putty\WINDOWS\WINNOISE.obj 
-      putty\WINDOWS\WINPGNTC.obj putty\WINDOWS\WINSTORE_.obj putty\WINDOWS\WINTIME.obj 
-      putty\X11FWD.obj"/>
+    <OBJFILES value="putty\BE_NONE.obj putty\CPROXY.obj putty\INT64.obj
+      putty\LOGGING.obj putty\MISC.obj putty\PORTFWD_.obj putty\PPROXY.obj
+      putty\PROXY.obj putty\SSH_.obj putty\SSHAES.obj putty\SSHBLOWF.obj
+      putty\SSHBN.obj putty\SSHCRC.obj putty\SSHCRCDA.obj putty\SSHDES.obj
+      putty\SSHDH.obj putty\SSHDSS.obj putty\SSHGSS.obj putty\SSHGSSC.obj
+      putty\SSHMD5.obj putty\SSHPUBK.obj putty\SSHRAND.obj putty\SSHRSA.obj
+      putty\SSHSH512.obj putty\SSHSHA.obj putty\SSHZLIB.obj putty\TREE234.obj
+      putty\CHARSET\UTF8.obj putty\WILDCARD.obj putty\WINDOWS\WINDL.obj
+      putty\WINDOWS\WINGSS.obj putty\WINDOWS\WINMISC.obj
+      putty\WINDOWS\WINNET.obj putty\WINDOWS\WINNOISE.obj
+      putty\WINDOWS\WINPGNTC.obj putty\WINDOWS\WINSTORE_.obj
+      putty\WINDOWS\WINTIME.obj putty\X11FWD.obj"/>
     <RESFILES value=""/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>

+ 2 - 2
RScpComp.bpr

@@ -4,8 +4,8 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="lib\RScpComp.lib"/>
-    <OBJFILES value="components\LogMemo.obj components\UnixDirView.obj components\UnixDriveView.obj 
-      components\UnixPathComboBox.obj"/>
+    <OBJFILES value="components\LogMemo.obj components\UnixDirView.obj
+      components\UnixDriveView.obj components\UnixPathComboBox.obj"/>
     <RESFILES value=""/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>

+ 9 - 9
ScpCore.bpr

@@ -4,15 +4,15 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="lib\ScpCore.lib"/>
-    <OBJFILES value="core\Bookmarks.obj core\Common.obj core\Configuration.obj 
-      core\CopyParam.obj core\CoreMain.obj core\Exceptions.obj 
-      core\FileBuffer.obj core\FileInfo.obj core\FileMasks.obj 
-      core\FileOperationProgress.obj core\FileSystems.obj 
-      core\FtpFileSystem.obj core\HierarchicalStorage.obj 
-      core\NamedObjs.obj core\PuttyIntf.obj core\Queue.obj 
-      core\RemoteFiles.obj core\ScpFileSystem.obj core\Script.obj 
-      core\SecureShell.obj core\Security.obj core\SessionData.obj 
-      core\SessionInfo.obj core\SftpFileSystem.obj core\Terminal.obj"/>
+    <OBJFILES value="core\Bookmarks.obj core\Common.obj
+      core\Configuration.obj core\CopyParam.obj core\CoreMain.obj
+      core\Exceptions.obj core\FileBuffer.obj core\FileInfo.obj
+      core\FileMasks.obj core\FileOperationProgress.obj core\FileSystems.obj
+      core\FtpFileSystem.obj core\HierarchicalStorage.obj core\NamedObjs.obj
+      core\PuttyIntf.obj core\Queue.obj core\RemoteFiles.obj
+      core\ScpFileSystem.obj core\Script.obj core\SecureShell.obj
+      core\Security.obj core\SessionData.obj core\SessionInfo.obj
+      core\SftpFileSystem.obj core\Terminal.obj"/>
     <RESFILES value=""/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>

+ 14 - 14
ScpForms.bpr

@@ -4,20 +4,20 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="lib\ScpForms.lib"/>
-    <OBJFILES value="forms\InputDlg.obj forms\MessageDlg.obj windows\VCLCommon.obj 
-      forms\About.obj forms\Authenticate.obj forms\Cleanup.obj 
-      forms\ComboInput.obj forms\Console.obj forms\Copy.obj 
-      forms\CopyParams.obj forms\CopyParamCustom.obj 
-      forms\CopyParamPreset.obj forms\CreateDirectory.obj 
-      forms\CustomCommand.obj forms\Editor.obj forms\EditorPreferences.obj 
-      forms\FileSystemInfo.obj forms\FullSynchronize.obj 
-      forms\GeneralSettings.obj forms\Glyphs.obj forms\ImportSessions.obj 
-      forms\Licence.obj forms\LocationProfiles.obj forms\Log.obj 
-      forms\Login.obj forms\LogSettings.obj forms\OpenDirectory.obj 
-      forms\OperationStatus.obj forms\Preferences.obj forms\Progress.obj 
-      forms\Properties.obj forms\Rights.obj forms\RightsExt.obj 
-      forms\SelectMask.obj forms\Symlink.obj forms\Synchronize.obj 
-      forms\SynchronizeChecklist.obj forms\SynchronizeProgress.obj"/>
+    <OBJFILES value="forms\InputDlg.obj forms\MessageDlg.obj
+      windows\VCLCommon.obj forms\About.obj forms\Authenticate.obj
+      forms\Cleanup.obj forms\ComboInput.obj forms\Console.obj forms\Copy.obj
+      forms\CopyParams.obj forms\CopyParamCustom.obj forms\CopyParamPreset.obj
+      forms\CreateDirectory.obj forms\CustomCommand.obj forms\Editor.obj
+      forms\EditorPreferences.obj forms\FileSystemInfo.obj
+      forms\FullSynchronize.obj forms\GeneralSettings.obj forms\Glyphs.obj
+      forms\ImportSessions.obj forms\Licence.obj forms\LocationProfiles.obj
+      forms\Log.obj forms\Login.obj forms\LogSettings.obj
+      forms\OpenDirectory.obj forms\OperationStatus.obj forms\Preferences.obj
+      forms\Progress.obj forms\Properties.obj forms\Rights.obj
+      forms\RightsExt.obj forms\SelectMask.obj forms\Symlink.obj
+      forms\Synchronize.obj forms\SynchronizeChecklist.obj
+      forms\SynchronizeProgress.obj"/>
     <RESFILES value=""/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES) forms\About.dfm forms\Authenticate.dfm forms\Cleanup.dfm 

+ 10 - 37
WinSCP.bpr

@@ -4,14 +4,14 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="WinSCP.exe"/>
-    <OBJFILES value="WinSCP.obj forms\CustomScpExplorer.obj 
-      windows\CustomWinConfiguration.obj windows\EditorManager.obj 
-      windows\GUIConfiguration.obj windows\GUITools.obj forms\NonVisual.obj 
-      windows\ConsoleRunner.obj windows\ProgParams.obj 
-      windows\QueueController.obj windows\Setup.obj forms\ScpCommander.obj 
-      forms\ScpExplorer.obj windows\SynchronizeController.obj 
-      windows\TerminalManager.obj windows\Tools.obj windows\UserInterface.obj 
-      windows\WinConfiguration.obj windows\WinHelp.obj windows\WinInterface.obj 
+    <OBJFILES value="WinSCP.obj forms\CustomScpExplorer.obj
+      windows\CustomWinConfiguration.obj windows\EditorManager.obj
+      windows\GUIConfiguration.obj windows\GUITools.obj forms\NonVisual.obj
+      windows\ConsoleRunner.obj windows\ProgParams.obj
+      windows\QueueController.obj windows\Setup.obj forms\ScpCommander.obj
+      forms\ScpExplorer.obj windows\SynchronizeController.obj
+      windows\TerminalManager.obj windows\Tools.obj windows\UserInterface.obj
+      windows\WinConfiguration.obj windows\WinHelp.obj windows\WinInterface.obj
       windows\WinMain.obj"/>
     <RESFILES value="windows\Windows.res WinSCP.res"/>
     <DEFFILE value=""/>
@@ -36,7 +36,7 @@
     <USERDEFINES value="OLD_DND"/>
     <SYSDEFINES value="NO_STRICT"/>
     <MAINSOURCE value="WinSCP.cpp"/>
-    <INCLUDEPATH value="core;console;forms;windows;resource;components;dragext;packages\filemng;packages\dragndrop;packages\my;packages\tb2k;packages\tbx;packages\theme;$(BCB)\include;$(BCB)\include\vcl"/>
+    <INCLUDEPATH value="core;console;forms;windows;resource;components;dragext;packages\filemng;packages\dragndrop;packages\my;packages\tb2k;packages\tbx;packages\theme;$(BCB)\include;$(BCB)\include\vcl;$(BCB)\include\mfc"/>
     <LIBPATH value="lib;windows;forms;packages\filemng;packages\tbx;packages\theme;$(BCB)\lib;$(BCB)\lib\obj;$(BCB)\lib\psdk"/>
     <WARNINGS value="-w8092 -w8091 -w8090 -w8089 -w8087 -wprc -wuse -wucp -wstv -wstu -wsig 
       -wpin -wnod -wnak -wdef -wcln -wbbf -wasm -wamp -wamb"/>
@@ -47,7 +47,7 @@
     <PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
     <RFLAGS value=""/>
     <AFLAGS value="/mx /w2 /zi"/>
-    <LFLAGS value="-D&quot;&quot; -S:0x1000000 -aa -Tpe -GD -s -Gn"/>
+    <LFLAGS value="-D -S:0x1000000 -aa -Tpe -GD -s -Gn"/>
     <OTHERFILES value=""/>
   </OPTIONS>
   <LINKER>
@@ -90,33 +90,6 @@
   </BUILDTOOLS>
 
   <IDEOPTIONS>
-[Version Info]
-IncludeVerInfo=1
-AutoIncBuild=1
-MajorVer=4
-MinorVer=0
-Release=4
-Build=346
-Debug=0
-PreRelease=0
-Special=0
-Private=0
-DLL=0
-Locale=1033
-CodePage=1252
-
-[Version Info Keys]
-CompanyName=Martin Prikryl
-FileDescription=Windows SFTP, FTP and SCP client
-FileVersion=4.0.4.346
-InternalName=winscp
-LegalCopyright=(c) 2000-2007 Martin Prikryl
-LegalTrademarks=
-OriginalFilename=winscp404.exe
-ProductName=WinSCP
-ProductVersion=4.0.4.0
-WWW=http://winscp.net/
-
 [Compiler]
 ShowInfoMsgs=0
 LinkDebugVcl=0

+ 28 - 0
WinSCP.rc

@@ -0,0 +1,28 @@
+1 VERSIONINFO
+FILEVERSION 4,0,5,354
+PRODUCTVERSION 4,0,5,354
+FILEOS 0x4
+FILETYPE 0x1
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName", "Martin Prikryl\0"
+            VALUE "FileDescription", "Windows SFTP, FTP and SCP client\0"
+            VALUE "FileVersion", "4.0.5.354\0"
+            VALUE "InternalName", "winscp\0"
+            VALUE "LegalCopyright", "(c) 2000-2007 Martin Prikryl\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "winscp405.exe\0"
+            VALUE "ProductName", "WinSCP\0"
+            VALUE "ProductVersion", "4.0.5.0\0"
+            VALUE "WWW", "http://winscp.net/\0"
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409 0x04E4
+    }
+}

BIN
WinSCP.res


+ 3 - 11
core/Configuration.cpp

@@ -11,7 +11,6 @@
 #include "TextsCore.h"
 #include "Interface.h"
 #include "CoreMain.h"
-#define GSSAPIDLL "gssapi32"
 //---------------------------------------------------------------------------
 #pragma package(smart_init)
 //---------------------------------------------------------------------------
@@ -22,7 +21,6 @@ __fastcall TConfiguration::TConfiguration()
   FStorage = stDetect;
   FDontSave = false;
   FApplicationInfo = NULL;
-  FGSSAPIInstalled = -1;
   FInitialized = false;
 }
 //---------------------------------------------------------------------------
@@ -713,13 +711,7 @@ AnsiString __fastcall TConfiguration::GetRootKeyStr()
 //---------------------------------------------------------------------------
 bool __fastcall TConfiguration::GetGSSAPIInstalled()
 {
-  if (FGSSAPIInstalled < 0)
-  {
-    HINSTANCE Library = LoadLibrary(GSSAPIDLL);
-    FGSSAPIInstalled = (Library != NULL ? 1 : 0);
-    FreeLibrary(Library);
-  }
-  return (FGSSAPIInstalled > 0);
+  return HasGSSAPI();
 }
 //---------------------------------------------------------------------------
 void __fastcall TConfiguration::SetStorage(TStorage value)
@@ -742,14 +734,14 @@ void __fastcall TConfiguration::SetStorage(TStorage value)
       // copy before save as it removes the ini file,
       // when switching from ini to registry
       CopyData(SourceStorage, TargetStorage);
-
-      Save(true);
     }
     __finally
     {
       delete SourceStorage;
       delete TargetStorage;
     }
+
+    Save(true);
   }
 }
 //---------------------------------------------------------------------------

+ 0 - 1
core/Configuration.h

@@ -46,7 +46,6 @@ private:
   bool FDisablePasswordStoring;
   bool FForceBanners;
   bool FDisableAcceptingHostKeys;
-  int FGSSAPIInstalled;
 
   AnsiString __fastcall GetOSVersionStr();
   TVSFixedFileInfo *__fastcall GetFixedApplicationInfo();

+ 50 - 40
core/FileBuffer.cpp

@@ -58,47 +58,38 @@ void __fastcall TFileBuffer::SetMemory(TMemoryStream * value)
 //---------------------------------------------------------------------------
 DWORD __fastcall TFileBuffer::ReadStream(TStream * Stream, const DWORD Len, bool ForceLen)
 {
-  Size = Position + Len;
-  // C++5
-  // FMemory->SetSize(FMemory->Position + Len);
   DWORD Result;
-  if (ForceLen)
-  {
-    Stream->ReadBuffer(Data + Position, Len);
-    Result = Len;
-  }
-  else
-  {
-    Result = Stream->Read(Data + Position, Len);
-  }
-  if (Result != Len)
-  {
-    Size = Size - Len + Result;
-  }
-  FMemory->Seek(Len, soFromCurrent);
-  return Result;
-}
-//---------------------------------------------------------------------------
-DWORD __fastcall TFileBuffer::ReadFile(const HANDLE File, const DWORD Len, bool ForceLen)
-{
-  DWORD Result;
-  TStream *Stream = NULL;
   try
   {
-    Stream = new THandleStream((THandle)File);
-    Result = ReadStream(Stream, Len, ForceLen);
+    Size = Position + Len;
+    // C++5
+    // FMemory->SetSize(FMemory->Position + Len);
+    if (ForceLen)
+    {
+      Stream->ReadBuffer(Data + Position, Len);
+      Result = Len;
+    }
+    else
+    {
+      Result = Stream->Read(Data + Position, Len);
+    }
+    if (Result != Len)
+    {
+      Size = Size - Len + Result;
+    }
+    FMemory->Seek(Len, soFromCurrent);
   }
-  __finally
+  catch(EReadError &)
   {
-    delete Stream;
+    RaiseLastOSError();
   }
   return Result;
 }
 //---------------------------------------------------------------------------
-DWORD __fastcall TFileBuffer::LoadFile(const HANDLE File, const DWORD Len, bool ForceLen)
+DWORD __fastcall TFileBuffer::LoadStream(TStream * Stream, const DWORD Len, bool ForceLen)
 {
   FMemory->Seek(0, soFromBeginning);
-  return ReadFile(File, Len, ForceLen);
+  return ReadStream(Stream, Len, ForceLen);
 }
 //---------------------------------------------------------------------------
 void __fastcall TFileBuffer::Convert(char * Source, char * Dest, int Params)
@@ -204,20 +195,39 @@ void __fastcall TFileBuffer::Delete(int Index, int Len)
 //---------------------------------------------------------------------------
 void __fastcall TFileBuffer::WriteToStream(TStream * Stream, const DWORD Len)
 {
-  Stream->WriteBuffer(Data + Position, Len);
-  FMemory->Seek(Len, soFromCurrent);
+  try
+  {
+    Stream->WriteBuffer(Data + Position, Len);
+    FMemory->Seek(Len, soFromCurrent);
+  }
+  catch(EWriteError &)
+  {
+    RaiseLastOSError();
+  }
 }
 //---------------------------------------------------------------------------
-void __fastcall TFileBuffer::WriteToFile(const HANDLE File, const DWORD Len)
+//---------------------------------------------------------------------------
+__fastcall TSafeHandleStream::TSafeHandleStream(int AHandle) :
+  THandleStream(AHandle)
 {
-  TStream *Stream = NULL;
-  try
+}
+//---------------------------------------------------------------------------
+int __fastcall TSafeHandleStream::Read(void * Buffer, int Count)
+{
+  int Result = FileRead(FHandle, Buffer, Count);
+  if (Result == -1)
   {
-    Stream = new THandleStream((THandle)File);
-    WriteToStream(Stream, Len);
+    RaiseLastOSError();
   }
-  __finally
+  return Result;
+}
+//---------------------------------------------------------------------------
+int __fastcall TSafeHandleStream::Write(const void * Buffer, int Count)
+{
+  int Result = FileWrite(FHandle, Buffer, Count);
+  if (Result == -1)
   {
-    delete Stream;
+    RaiseLastOSError();
   }
-}
+  return Result;
+};

+ 9 - 3
core/FileBuffer.h

@@ -12,17 +12,15 @@ class TFileBuffer
 public:
   __fastcall TFileBuffer();
   virtual __fastcall ~TFileBuffer();
-  DWORD __fastcall LoadFile(const HANDLE File, const DWORD Len, bool ForceLen);
   void __fastcall Convert(char * Source, char * Dest, int Params);
   void __fastcall Convert(TEOLType Source, TEOLType Dest, int Params);
   void __fastcall Convert(char * Source, TEOLType Dest, int Params);
   void __fastcall Convert(TEOLType Source, char * Dest, int Params);
   void __fastcall Insert(int Index, const char * Buf, int Len);
   void __fastcall Delete(int Index, int Len);
-  DWORD __fastcall ReadFile(const HANDLE File, const DWORD Len, bool ForceLen);
+  DWORD __fastcall LoadStream(TStream * Stream, const DWORD Len, bool ForceLen);
   DWORD __fastcall ReadStream(TStream * Stream, const DWORD Len, bool ForceLen);
   void __fastcall WriteToStream(TStream * Stream, const DWORD Len);
-  void __fastcall WriteToFile(const HANDLE File, const DWORD Len);
   __property TMemoryStream * Memory  = { read=FMemory, write=SetMemory };
   __property char * Data = { read=GetData };
   __property int Size = { read=FSize, write=SetSize };
@@ -39,6 +37,14 @@ private:
   int __fastcall GetPosition() const;
 };
 //---------------------------------------------------------------------------
+class TSafeHandleStream : public THandleStream
+{
+public:
+  __fastcall TSafeHandleStream(int AHandle);
+  virtual int __fastcall Read(void * Buffer, int Count);
+  virtual int __fastcall Write(const void * Buffer, int Count);
+};
+//---------------------------------------------------------------------------
 char * __fastcall EOLToStr(TEOLType EOLType);
 //---------------------------------------------------------------------------
 #endif

+ 129 - 72
core/FtpFileSystem.cpp

@@ -116,8 +116,17 @@ class TMessageQueue : public std::list<std::pair<WPARAM, LPARAM> >
 //---------------------------------------------------------------------------
 struct TFileTransferData
 {
+  TFileTransferData()
+  {
+    Params = 0;
+    AutoResume = false;
+    OverwriteResult = -1;
+  }
+
+  AnsiString FileName;
   int Params;
   bool AutoResume;
+  int OverwriteResult;
 };
 //---------------------------------------------------------------------------
 const int tfFirstLevel = 0x01;
@@ -751,6 +760,19 @@ void __fastcall TFTPFileSystem::FileTransferProgress(__int64 TransferSize,
   }
 }
 //---------------------------------------------------------------------------
+void __fastcall TFTPFileSystem::FileTransfer(const AnsiString & FileName,
+  const AnsiString & LocalFile, const AnsiString & RemoteFile,
+  const AnsiString & RemotePath, bool Get, __int64 Size, int Type,
+  TFileTransferData & UserData, TFileOperationProgressType * OperationProgress)
+{
+  FILE_OPERATION_LOOP(FMTLOAD(TRANSFER_ERROR, (FileName)),
+    FFileZillaIntf->FileTransfer(LocalFile.c_str(), RemoteFile.c_str(),
+      RemotePath.c_str(), Get, Size, Type, &UserData);
+    unsigned int Reply = WaitForReply();
+    GotReply(Reply, FLAGMASK(FFileTransferCancelled, REPLY_ALLOW_CANCEL));
+  );
+}
+//---------------------------------------------------------------------------
 void __fastcall TFTPFileSystem::CopyToLocal(TStrings * FilesToCopy,
   const AnsiString TargetDir, const TCopyParamType * CopyParam,
   int Params, TFileOperationProgressType * OperationProgress,
@@ -924,6 +946,8 @@ void __fastcall TFTPFileSystem::Sink(const AnsiString FileName,
 
     ResetFileTransfer();
 
+    TFileTransferData UserData;
+
     AnsiString FilePath = UnixExtractFilePath(FileName);
     unsigned int TransferType = (OperationProgress->AsciiTransfer ? 1 : 2);
     assert(!FIgnoreFileList);
@@ -931,14 +955,11 @@ void __fastcall TFTPFileSystem::Sink(const AnsiString FileName,
     try
     {
       FFileTransferPreserveTime = CopyParam->PreserveTime;
-      FFileTransferFileName = DestFileName;
-      TFileTransferData UserData;
+      UserData.FileName = DestFileName;
       UserData.Params = Params;
       UserData.AutoResume = FLAGSET(Flags, tfAutoResume);
-      FFileZillaIntf->FileTransfer(DestFullName.c_str(), OnlyFileName.c_str(),
-        FilePath.c_str(), true, File->Size, TransferType, &UserData);
-      unsigned int Reply = WaitForReply();
-      GotReply(Reply, FLAGMASK(FFileTransferCancelled, REPLY_ALLOW_CANCEL));
+      FileTransfer(FileName, DestFullName, OnlyFileName,
+        FilePath, true, File->Size, TransferType, UserData, OperationProgress);
     }
     __finally
     {
@@ -948,9 +969,9 @@ void __fastcall TFTPFileSystem::Sink(const AnsiString FileName,
     CheckFileTransferAbort();
 
     // in case dest filename is changed from overwrite dialog
-    if (DestFileName != FFileTransferFileName)
+    if (DestFileName != UserData.FileName)
     {
-      DestFullName = TargetDir + FFileTransferFileName;
+      DestFullName = TargetDir + UserData.FileName;
       Attrs = FileGetAttr(DestFullName);
     }
 
@@ -1147,6 +1168,8 @@ void __fastcall TFTPFileSystem::Source(const AnsiString FileName,
 
     ResetFileTransfer();
 
+    TFileTransferData UserData;
+
     unsigned int TransferType = (OperationProgress->AsciiTransfer ? 1 : 2);
     assert(!FIgnoreFileList);
     FIgnoreFileList = true;
@@ -1155,14 +1178,11 @@ void __fastcall TFTPFileSystem::Source(const AnsiString FileName,
       // not supports for uploads anyway
       FFileTransferPreserveTime = CopyParam->PreserveTime;
       // not used for uploads
-      FFileTransferFileName = DestFileName;
-      TFileTransferData UserData;
+      UserData.FileName = DestFileName;
       UserData.Params = Params;
       UserData.AutoResume = FLAGSET(Flags, tfAutoResume);
-      FFileZillaIntf->FileTransfer(FileName.c_str(), DestFileName.c_str(),
-        TargetDir.c_str(), false, Size, TransferType, &UserData);
-      unsigned int Reply = WaitForReply();
-      GotReply(Reply, FLAGMASK(FFileTransferCancelled, REPLY_ALLOW_CANCEL));
+      FileTransfer(FileName, FileName, DestFileName,
+        TargetDir, false, Size, TransferType, UserData, OperationProgress);
     }
     __finally
     {
@@ -1879,20 +1899,10 @@ unsigned int __fastcall TFTPFileSystem::PoolForReply()
   return Reply;
 }
 //---------------------------------------------------------------------------
-unsigned int __fastcall TFTPFileSystem::WaitForReply(bool Command)
+void __fastcall TFTPFileSystem::DoWaitForReply(unsigned int& ReplyToAwait)
 {
-  assert(FReply == 0);
-  assert(FCommandReply == 0);
-  assert(!FWaitingForReply);
-
-  ResetReply();
-  FWaitingForReply = true;
-
-  unsigned int Reply;
-
   try
   {
-    unsigned int& ReplyToAwait = (Command ? FCommandReply : FReply);
     while (ReplyToAwait == 0)
     {
       WaitForMessages();
@@ -1904,6 +1914,35 @@ unsigned int __fastcall TFTPFileSystem::WaitForReply(bool Command)
       // is posted immediately afterwards. leave detection of that to Idle()
       while (ProcessMessage() && (ReplyToAwait == 0));
     }
+  }
+  catch(...)
+  {
+    // even if non-fatal error happens, we must process pending message,
+    // so that we "eat" the reply message, so that it gets not mistakenly
+    // associated with future connect
+    if (FTerminal->Active)
+    {
+      DoWaitForReply(ReplyToAwait);
+    }
+    throw;
+  }
+}
+//---------------------------------------------------------------------------
+unsigned int __fastcall TFTPFileSystem::WaitForReply(bool Command)
+{
+  assert(FReply == 0);
+  assert(FCommandReply == 0);
+  assert(!FWaitingForReply);
+
+  ResetReply();
+  FWaitingForReply = true;
+
+  unsigned int Reply;
+
+  try
+  {
+    unsigned int& ReplyToAwait = (Command ? FCommandReply : FReply);
+    DoWaitForReply(ReplyToAwait);
 
     Reply = ReplyToAwait;
   }
@@ -2262,57 +2301,67 @@ bool __fastcall TFTPFileSystem::HandleAsynchRequestOverwrite(
   else
   {
     TFileTransferData & UserData = *((TFileTransferData *)AUserData);
-    TFileOperationProgressType * OperationProgress = FTerminal->OperationProgress;
-    AnsiString FileName = FileName1;
-    assert(FFileTransferFileName == FileName);
-    TOverwriteMode OverwriteMode = omOverwrite;
-    TOverwriteFileParams FileParams;
-    FileParams.SourceSize = Size2;
-    FileParams.DestSize = Size1;
-    // !!! TODO DST
-    FileParams.SourceTimestamp = UnixToDateTime(Time2, dstmUnix);
-    FileParams.DestTimestamp = UnixToDateTime(Time1, dstmUnix);
-    if ((OperationProgress->Side == osLocal) && !HasTime1)
+    if (UserData.OverwriteResult >= 0)
     {
-      FileParams.DestPrecision = mfMDY;
+      // on retry, use the same answer as on the first attempt
+      RequestResult = UserData.OverwriteResult;
     }
-    if ((OperationProgress->Side == osRemote) && !HasTime2)
+    else
     {
-      FileParams.SourcePrecision = mfMDY;
-    }
+      TFileOperationProgressType * OperationProgress = FTerminal->OperationProgress;
+      AnsiString FileName = FileName1;
+      assert(UserData.FileName == FileName);
+      TOverwriteMode OverwriteMode = omOverwrite;
+      TOverwriteFileParams FileParams;
+      FileParams.SourceSize = Size2;
+      FileParams.DestSize = Size1;
+      // !!! TODO DST
+      FileParams.SourceTimestamp = UnixToDateTime(Time2, dstmUnix);
+      FileParams.DestTimestamp = UnixToDateTime(Time1, dstmUnix);
+      if ((OperationProgress->Side == osLocal) && !HasTime1)
+      {
+        FileParams.DestPrecision = mfMDY;
+      }
+      if ((OperationProgress->Side == osRemote) && !HasTime2)
+      {
+        FileParams.SourcePrecision = mfMDY;
+      }
 
-    if (ConfirmOverwrite(FileName, OverwriteMode, OperationProgress,
-          &FileParams, UserData.Params, UserData.AutoResume))
-    {
-      switch (OverwriteMode)
+      if (ConfirmOverwrite(FileName, OverwriteMode, OperationProgress,
+            &FileParams, UserData.Params, UserData.AutoResume))
       {
-        case omOverwrite:
-          if (FileName != FileName1)
-          {
-            strncpy(FileName1, FileName.c_str(), FileName1Len);
-            FileName1[FileName1Len - 1] = '\0';
-            FFileTransferFileName = FileName1;
-            RequestResult = TFileZillaIntf::FILEEXISTS_RENAME;
-          }
-          else
-          {
-            RequestResult = TFileZillaIntf::FILEEXISTS_OVERWRITE;
-          }
-          break;
+        switch (OverwriteMode)
+        {
+          case omOverwrite:
+            if (FileName != FileName1)
+            {
+              strncpy(FileName1, FileName.c_str(), FileName1Len);
+              FileName1[FileName1Len - 1] = '\0';
+              UserData.FileName = FileName1;
+              RequestResult = TFileZillaIntf::FILEEXISTS_RENAME;
+            }
+            else
+            {
+              RequestResult = TFileZillaIntf::FILEEXISTS_OVERWRITE;
+            }
+            break;
 
-        case omResume:
-          RequestResult = TFileZillaIntf::FILEEXISTS_RESUME;
-          break;
+          case omResume:
+            RequestResult = TFileZillaIntf::FILEEXISTS_RESUME;
+            break;
 
-        default:
-          assert(false);
-          RequestResult = TFileZillaIntf::FILEEXISTS_OVERWRITE;
-          break;
+          default:
+            assert(false);
+            RequestResult = TFileZillaIntf::FILEEXISTS_OVERWRITE;
+            break;
+        }
       }
-    }
-    else
-    {
-      RequestResult = TFileZillaIntf::FILEEXISTS_SKIP;
+      else
+      {
+        RequestResult = TFileZillaIntf::FILEEXISTS_SKIP;
+      }
+      // remember the answer for the retries
+      UserData.OverwriteResult = RequestResult;
     }
     return true;
   }
@@ -2348,7 +2397,14 @@ bool __fastcall TFTPFileSystem::HandleListData(const char * Path,
         File->FileName = Entry->Name;
         if (strlen(Entry->Permissions) >= 10)
         {
-          File->Rights->Text = Entry->Permissions + 1;
+          try
+          {
+            File->Rights->Text = Entry->Permissions + 1;
+          }
+          catch(...)
+          {
+            // ignore permissions errors with FTP
+          }
         }
 
         const char * Space = strchr(Entry->OwnerGroup, ' ');
@@ -2413,11 +2469,12 @@ bool __fastcall TFTPFileSystem::HandleListData(const char * Path,
       catch (Exception & E)
       {
         delete File;
-        throw ETerminal(&E, FMTLOAD(LIST_LINE_ERROR, (
+        AnsiString EntryData =
           FORMAT("%s/%s/%s/%s/%d/%d/%d/%d/%d/%d/%d/%d/%d",
             (Entry->Name, Entry->Permissions, Entry->OwnerGroup, IntToStr(Entry->Size),
-             Entry->Dir, Entry->Link, Entry->Year, Entry->Month, Entry->Day,
-             Entry->Hour, Entry->Minute, Entry->HasTime, Entry->HasDate)))));
+             int(Entry->Dir), int(Entry->Link), Entry->Year, Entry->Month, Entry->Day,
+             Entry->Hour, Entry->Minute, int(Entry->HasTime), int(Entry->HasDate)));
+        throw ETerminal(&E, FMTLOAD(LIST_LINE_ERROR, (EntryData)));
       }
 
       FFileList->AddFile(File);

+ 6 - 1
core/FtpFileSystem.h

@@ -13,6 +13,7 @@ class TCriticalSection;
 class TMessageQueue;
 class TOverwriteFileParams;
 struct TListDataEntry;
+struct TFileTransferData;
 //---------------------------------------------------------------------------
 class TFTPFileSystem : public TCustomFileSystem
 {
@@ -103,6 +104,7 @@ protected:
     TStrings ** Response = NULL);
   void __fastcall ResetReply();
   void __fastcall HandleReplyStatus(const char * AStatus);
+  void __fastcall DoWaitForReply(unsigned int& ReplyToAwait);
 
   bool __fastcall HandleStatus(const char * Status, int Type);
   bool __fastcall HandleAsynchRequestOverwrite(
@@ -149,6 +151,10 @@ protected:
   void __fastcall ResetCaches();
   void __fastcall CaptureOutput(const AnsiString & Str);
   void __fastcall DoReadDirectory(TRemoteFileList * FileList);
+  void __fastcall FileTransfer(const AnsiString & FileName, const AnsiString & LocalFile,
+    const AnsiString & RemoteFile, const AnsiString & RemotePath, bool Get,
+    __int64 Size, int Type, TFileTransferData & UserData,
+    TFileOperationProgressType * OperationProgress);
 
   static bool __fastcall Unquote(AnsiString & Str);
 
@@ -189,7 +195,6 @@ private:
   enum { ftaNone, ftaSkip, ftaCancel } FFileTransferAbort;
   bool FIgnoreFileList;
   bool FFileTransferCancelled;
-  AnsiString FFileTransferFileName;
   __int64 FFileTransferResumed;
   bool FFileTransferPreserveTime;
   bool FAwaitingProgress;

+ 47 - 1
core/HierarchicalStorage.cpp

@@ -5,6 +5,7 @@
 #include "Common.h"
 #include "PuttyIntf.h"
 #include "HierarchicalStorage.h"
+#include <vector>
 //---------------------------------------------------------------------------
 #pragma package(smart_init)
 //---------------------------------------------------------------------------
@@ -276,6 +277,50 @@ __fastcall TRegistryStorage::~TRegistryStorage()
   delete FRegistry;
 };
 //---------------------------------------------------------------------------
+bool __fastcall TRegistryStorage::Copy(TRegistryStorage * Storage)
+{
+  TRegistry * Registry = Storage->FRegistry;
+  bool Result = true;
+  TStrings * Names = new TStringList();
+  try
+  {
+    Registry->GetValueNames(Names);
+    std::vector<unsigned char> Buffer(1024, 0);
+    int Index = 0;
+    while ((Index < Names->Count) && Result)
+    {
+      AnsiString Name = Names->Strings[Index];
+      unsigned long Size = Buffer.size();
+      unsigned long Type;
+      int RegResult;
+      do
+      {
+        RegResult = RegQueryValueEx(Registry->CurrentKey, Name.c_str(), NULL,
+          &Type, &Buffer[0], &Size);
+        if (Result == ERROR_MORE_DATA)
+        {
+          Buffer.resize(Size);
+        }
+      } while (RegResult == ERROR_MORE_DATA);
+
+      Result = (RegResult == ERROR_SUCCESS);
+      if (Result)
+      {
+        RegResult = RegSetValueEx(FRegistry->CurrentKey, Name.c_str(), NULL, Type,
+          &Buffer[0], Size);
+        Result = (RegResult == ERROR_SUCCESS);
+      }
+
+      ++Index;
+    }
+  }
+  __finally
+  {
+    delete Names;
+  }
+  return Result;
+}
+//---------------------------------------------------------------------------
 void __fastcall TRegistryStorage::SetAccessMode(TStorageAccessMode value)
 {
   THierarchicalStorage::SetAccessMode(value);
@@ -486,11 +531,12 @@ int __fastcall TRegistryStorage::GetFailed()
 __fastcall TIniFileStorage::TIniFileStorage(const AnsiString AStorage):
   THierarchicalStorage(AStorage)
 {
-  FIniFile = new TIniFile(Storage);
+  FIniFile = new TMemIniFile(Storage);
 }
 //---------------------------------------------------------------------------
 __fastcall TIniFileStorage::~TIniFileStorage()
 {
+  FIniFile->UpdateFile();
   delete FIniFile;
 }
 //---------------------------------------------------------------------------

+ 4 - 1
core/HierarchicalStorage.h

@@ -74,6 +74,9 @@ public:
   __fastcall TRegistryStorage(const AnsiString AStorage, HKEY ARootKey);
   __fastcall TRegistryStorage(const AnsiString AStorage);
   virtual __fastcall ~TRegistryStorage();
+
+  bool __fastcall Copy(TRegistryStorage * Storage);
+
   virtual bool __fastcall OpenSubKey(const AnsiString SubKey, bool CanCreate);
   virtual bool __fastcall CreateSubKey(const AnsiString SubKey);
   virtual void __fastcall CloseSubKey();
@@ -150,7 +153,7 @@ public:
   virtual void __fastcall GetValueNames(Classes::TStrings* Strings);
 
 private:
-  TIniFile * FIniFile;
+  TCustomIniFile * FIniFile;
   AnsiString __fastcall GetCurrentSection();
 protected:
   __property AnsiString CurrentSection  = { read=GetCurrentSection };

+ 11 - 0
core/PuttyIntf.cpp

@@ -165,6 +165,7 @@ static int get_line(void * frontend, const char * prompt, char * str,
 void logevent(void * frontend, const char * string)
 {
   // Frontend maybe NULL here
+  // (one of the examples is indirect call from ssh_gssapi_init from HasGSSAPI)
   if (frontend != NULL)
   {
     ((TSecureShell *)frontend)->PuttyLogEvent(string);
@@ -567,3 +568,13 @@ __int64 __fastcall ParseSize(AnsiString SizeStr)
   return parse_blocksize(SizeStr.c_str());
 }
 //---------------------------------------------------------------------------
+bool __fastcall HasGSSAPI()
+{
+  static int has = -1;
+  if (has < 0)
+  {
+    has = (has_gssapi_ssh() ? 1 : 0);
+  }
+  return (has > 0);
+}
+//---------------------------------------------------------------------------

+ 2 - 0
core/PuttyTools.h

@@ -13,4 +13,6 @@ __int64 __fastcall ParseSize(AnsiString SizeStr);
 //---------------------------------------------------------------------------
 bool __fastcall IsListenerFree(unsigned int PortNumber);
 //---------------------------------------------------------------------------
+bool __fastcall HasGSSAPI();
+//---------------------------------------------------------------------------
 #endif

+ 9 - 1
core/RemoteFiles.cpp

@@ -697,7 +697,15 @@ void __fastcall TRemoteFile::SetListingStr(AnsiString value)
     Rights->Text = Line.SubString(1, 9);
     Line.Delete(1, 9);
     // Rights column maybe followed by '+' sign, we ignore it
-    if (!Line.IsEmpty() && (Line[1] == '+')) Line.Delete(1, 1);
+    // (On MacOS, there may be a space in between)
+    if (!Line.IsEmpty() && (Line[1] == '+'))
+    {
+      Line.Delete(1, 1);
+    }
+    else if ((Line.Length() >= 2) && (Line[1] == ' ') && (Line[2] == '+'))
+    {
+      Line.Delete(1, 2);
+    }
     Line = Line.TrimLeft();
 
     GETCOL;

+ 5 - 17
core/ScpFileSystem.cpp

@@ -1535,6 +1535,7 @@ void __fastcall TSCPFileSystem::SCPSource(const AnsiString FileName,
   FTerminal->OpenLocalFile(FileName, GENERIC_READ,
     &Attrs, &File, NULL, &MTime, &ATime, &Size);
 
+  TStream * Stream = new TSafeHandleStream((THandle)File);
   try
   {
     bool Dir = FLAGSET(Attrs, faDirectory);
@@ -1588,14 +1589,7 @@ void __fastcall TSCPFileSystem::SCPSource(const AnsiString FileName,
           // This is crucial, if it fails during file transfer, it's fatal error
           FILE_OPERATION_LOOP_EX (!OperationProgress->TransferingFile,
               FMTLOAD(READ_ERROR, (FileName)),
-            try
-            {
-              BlockBuf.LoadFile(File, OperationProgress->LocalBlockSize(), true);
-            }
-            catch(...)
-            {
-              RaiseLastOSError();
-            }
+            BlockBuf.LoadStream(Stream, OperationProgress->LocalBlockSize(), true);
           );
 
           OperationProgress->AddLocalyUsed(BlockBuf.Size);
@@ -1755,6 +1749,7 @@ void __fastcall TSCPFileSystem::SCPSource(const AnsiString FileName,
     {
       CloseHandle(File);
     }
+    delete Stream;
   }
 
   /* TODO : Delete also read-only files. */
@@ -2287,7 +2282,7 @@ void __fastcall TSCPFileSystem::SCPSink(const AnsiString TargetDir,
                 EXCEPTION;
               }
 
-              FileStream = new THandleStream((THandle)File);
+              FileStream = new TSafeHandleStream((THandle)File);
             }
             catch (Exception &E)
             {
@@ -2335,14 +2330,7 @@ void __fastcall TSCPFileSystem::SCPSink(const AnsiString TargetDir,
 
                 // This is crucial, if it fails during file transfer, it's fatal error
                 FILE_OPERATION_LOOP_EX (false, FMTLOAD(WRITE_ERROR, (DestFileName)),
-                  try
-                  {
-                    BlockBuf.WriteToStream(FileStream, BlockBuf.Size);
-                  }
-                  catch(...)
-                  {
-                    RaiseLastOSError();
-                  }
+                  BlockBuf.WriteToStream(FileStream, BlockBuf.Size);
                 );
 
                 OperationProgress->AddLocalyUsed(BlockBuf.Size);

+ 8 - 2
core/SecureShell.cpp

@@ -1415,11 +1415,17 @@ TCipher __fastcall TSecureShell::FuncToSsh2Cipher(const void * Cipher)
   return Result;
 }
 //---------------------------------------------------------------------------
-void __fastcall TSecureShell::VerifyHostKey(const AnsiString Host, int Port,
-  const AnsiString KeyType, const AnsiString KeyStr, const AnsiString Fingerprint)
+void __fastcall TSecureShell::VerifyHostKey(AnsiString Host, int Port,
+  const AnsiString KeyType, AnsiString KeyStr, const AnsiString Fingerprint)
 {
   GotHostKey();
 
+  if (FSessionData->Tunnel)
+  {
+    Host = FSessionData->OrigHostName;
+    Port = FSessionData->OrigPortNumber;
+  }
+
   int Result;
 
   FSessionInfo.HostKeyFingerprint = Fingerprint;

+ 2 - 2
core/SecureShell.h

@@ -125,8 +125,8 @@ public:
   void __fastcall FromBackend(bool IsStdErr, const char * Data, int Length);
   void __fastcall CWrite(const char * Data, int Length, bool Untrusted);
   const AnsiString & __fastcall GetStdError();
-  void __fastcall VerifyHostKey(const AnsiString Host, int Port,
-    const AnsiString KeyType, const AnsiString KeyStr, const AnsiString Fingerprint);
+  void __fastcall VerifyHostKey(AnsiString Host, int Port,
+    const AnsiString KeyType, AnsiString KeyStr, const AnsiString Fingerprint);
   void __fastcall AskAlg(const AnsiString AlgType, const AnsiString AlgName);
   void __fastcall DisplayBanner(const AnsiString & Banner);
   void __fastcall OldKeyfileWarning();

+ 2 - 0
core/SessionData.h

@@ -362,6 +362,8 @@ public:
   __property int FtpPingInterval  = { read=FFtpPingInterval, write=SetFtpPingInterval };
   __property TPingType FtpPingType = { read = FFtpPingType, write = SetFtpPingType };
   __property AnsiString StorageKey = { read = GetStorageKey };
+  __property AnsiString OrigHostName = { read = FOrigHostName };
+  __property int OrigPortNumber = { read = FOrigPortNumber };
 };
 //---------------------------------------------------------------------------
 class TStoredSessionList : public TNamedObjectList

+ 73 - 53
core/SftpFileSystem.cpp

@@ -1284,18 +1284,23 @@ public:
   TSFTPUploadQueue(TSFTPFileSystem * AFileSystem) :
     TSFTPAsynchronousQueue(AFileSystem)
   {
-    FFile = NULL;
+    FStream = NULL;
     OperationProgress = NULL;
     FLastBlockSize = 0;
     FEnd = false;
   }
 
+  virtual __fastcall ~TSFTPUploadQueue()
+  {
+    delete FStream;
+  }
+
   bool __fastcall Init(const AnsiString AFileName,
     HANDLE AFile, TFileOperationProgressType * AOperationProgress,
     const AnsiString AHandle, __int64 ATransfered)
   {
     FFileName = AFileName;
-    FFile = AFile;
+    FStream = new TSafeHandleStream((THandle)AFile);
     OperationProgress = AOperationProgress;
     FHandle = AHandle;
     FTransfered = ATransfered;
@@ -1316,7 +1321,7 @@ protected:
     if (Result)
     {
       FILE_OPERATION_LOOP(FMTLOAD(READ_ERROR, (FFileName)),
-        BlockBuf.LoadFile(FFile, BlockSize, false);
+        BlockBuf.LoadStream(FStream, BlockSize, false);
       );
 
       FEnd = (BlockBuf.Size == 0);
@@ -1377,7 +1382,7 @@ protected:
   }
 
 private:
-  HANDLE FFile;
+  TStream * FStream;
   TFileOperationProgressType * OperationProgress;
   AnsiString FFileName;
   unsigned long FLastBlockSize;
@@ -3556,7 +3561,10 @@ void __fastcall TSFTPFileSystem::CopyToRemote(TStrings * FilesToCopy,
       catch(EScpSkipFile & E)
       {
         SUSPEND_OPERATION (
-          if (!FTerminal->HandleException(&E)) throw;
+          if (!FTerminal->HandleException(&E))
+          {
+            throw;
+          };
         );
       }
     }
@@ -3858,7 +3866,7 @@ void __fastcall TSFTPFileSystem::SFTPSource(const AnsiString FileName,
         AnsiString((OperationProgress->AsciiTransfer ? "Ascii" : "Binary")) +
           " transfer mode selected.");
 
-      // should we check for interupted transfer?
+      // should we check for interrupted transfer?
       ResumeAllowed = !OperationProgress->AsciiTransfer &&
         CopyParam->AllowResume(OperationProgress->LocalSize) &&
         IsCapable(fcRename);
@@ -3884,55 +3892,74 @@ void __fastcall TSFTPFileSystem::SFTPSource(const AnsiString FileName,
             FileParams.DestSize = OpenParams.DestFileSize;
             FileParams.DestTimestamp = File->Modification;
             DestRights = *File->Rights;
+            // if destination file is symlink, never do resumable transfer,
+            // as it would delete the symlink.
+            // also bit of heuristics to detect symlink on SFTP-3 and older
+            // (which does not indicate symlink in SSH_FXP_ATTRS).
+            // if file has all permissions and is small, then it is likely symlink.
+            // also it is not likely that such a small file (if it is not symlink)
+            // gets overwritten by large file (that would trigger resumable transfer).
+            if (File->IsSymLink ||
+                ((FVersion < 4) &&
+                 ((*File->Rights & TRights::rfAll) == TRights::rfAll) &&
+                 (File->Size < 100)))
+            {
+              ResumeAllowed = false;
+              OperationProgress->SetResumeStatus(rsDisabled);
+            }
+
             delete File;
             File = NULL;
           }
 
-          FTerminal->LogEvent("Checking existence of partially transfered file.");
-          if (RemoteFileExists(DestPartinalFullName, &File))
+          if (ResumeAllowed)
           {
-            ResumeOffset = File->Size;
-            delete File;
-            File = NULL;
-
-            bool PartialBiggerThanSource = (ResumeOffset > OperationProgress->LocalSize);
-            if (FLAGCLEAR(Params, cpNoConfirmation))
-            {
-              ResumeTransfer = SFTPConfirmResume(DestFileName,
-                PartialBiggerThanSource, OperationProgress);
-            }
-            else
+            FTerminal->LogEvent("Checking existence of partially transfered file.");
+            if (RemoteFileExists(DestPartinalFullName, &File))
             {
-              ResumeTransfer = !PartialBiggerThanSource;
-            }
+              ResumeOffset = File->Size;
+              delete File;
+              File = NULL;
 
-            if (!ResumeTransfer)
-            {
-              DeleteFile(DestPartinalFullName);
+              bool PartialBiggerThanSource = (ResumeOffset > OperationProgress->LocalSize);
+              if (FLAGCLEAR(Params, cpNoConfirmation))
+              {
+                ResumeTransfer = SFTPConfirmResume(DestFileName,
+                  PartialBiggerThanSource, OperationProgress);
+              }
+              else
+              {
+                ResumeTransfer = !PartialBiggerThanSource;
+              }
+
+              if (!ResumeTransfer)
+              {
+                DeleteFile(DestPartinalFullName);
+              }
+              else
+              {
+                FTerminal->LogEvent("Resuming file transfer.");
+              }
             }
             else
             {
-              FTerminal->LogEvent("Resuming file transfer.");
-            }
-          }
-          else
-          {
-            // partial upload file does not exists, check for full file
-            if (DestFileExists &&
-                (FLAGSET(Params, cpNewerOnly) ||
-                 (FTerminal->Configuration->ConfirmOverwriting &&
-                  !OperationProgress->YesToAll && FLAGCLEAR(Params, cpNoConfirmation))))
-            {
-              AnsiString PrevDestFileName = DestFileName;
-              SFTPConfirmOverwrite(DestFileName,
-                OperationProgress, OpenParams.OverwriteMode, &FileParams);
-              if (PrevDestFileName != DestFileName)
+              // partial upload file does not exists, check for full file
+              if (DestFileExists &&
+                  (FLAGSET(Params, cpNewerOnly) ||
+                   (FTerminal->Configuration->ConfirmOverwriting &&
+                    !OperationProgress->YesToAll && FLAGCLEAR(Params, cpNoConfirmation))))
               {
-                // update paths in case user changes the file name
-                DestFullName = LocalCanonify(TargetDir + DestFileName);
-                DestPartinalFullName = DestFullName + FTerminal->Configuration->PartialExt;
-                FTerminal->LogEvent("Checking existence of new file.");
-                DestFileExists = RemoteFileExists(DestFullName, NULL);
+                AnsiString PrevDestFileName = DestFileName;
+                SFTPConfirmOverwrite(DestFileName,
+                  OperationProgress, OpenParams.OverwriteMode, &FileParams);
+                if (PrevDestFileName != DestFileName)
+                {
+                  // update paths in case user changes the file name
+                  DestFullName = LocalCanonify(TargetDir + DestFileName);
+                  DestPartinalFullName = DestFullName + FTerminal->Configuration->PartialExt;
+                  FTerminal->LogEvent("Checking existence of new file.");
+                  DestFileExists = RemoteFileExists(DestFullName, NULL);
+                }
               }
             }
           }
@@ -4785,7 +4812,7 @@ void __fastcall TSFTPFileSystem::SFTPSink(const AnsiString FileName,
           SSH_FILEXFER_ATTR_MODIFYTIME);
       }
 
-      FileStream = new THandleStream((THandle)LocalHandle);
+      FileStream = new TSafeHandleStream((THandle)LocalHandle);
 
       // at end of this block queue is disposed
       {
@@ -4901,14 +4928,7 @@ void __fastcall TSFTPFileSystem::SFTPSink(const AnsiString FileName,
             }
 
             FILE_OPERATION_LOOP (FMTLOAD(WRITE_ERROR, (LocalFileName)),
-              try
-              {
-                BlockBuf.WriteToStream(FileStream, BlockBuf.Size);
-              }
-              catch(...)
-              {
-                RaiseLastOSError();
-              }
+              BlockBuf.WriteToStream(FileStream, BlockBuf.Size);
             );
 
             OperationProgress->AddLocalyUsed(BlockBuf.Size);

+ 4 - 4
dragext/DragExt.cpp

@@ -5,7 +5,7 @@
 #define STRICT
 #endif
 //---------------------------------------------------------------------------
-#ifdef MSVC
+#ifdef _MSC_VER
 #include <objbase.h>
 #define snprintf _snprintf
 #endif
@@ -38,7 +38,7 @@ class CShellExtClassFactory : public IClassFactory
 {
 public:
   CShellExtClassFactory();
-  ~CShellExtClassFactory();
+  virtual ~CShellExtClassFactory();
 
   // IUnknown members
   STDMETHODIMP         QueryInterface(REFIID, LPVOID FAR*);
@@ -57,7 +57,7 @@ class CShellExt : public IShellExtInit, ICopyHook
 {
 public:
   CShellExt();
-  ~CShellExt();
+  virtual ~CShellExt();
 
   // IUnknown members
   STDMETHODIMP         QueryInterface(REFIID, LPVOID FAR*);
@@ -294,7 +294,7 @@ bool RegisterServer(bool AllUsers)
     if (RegCreateKey(HKey, ClassID, &HKey) == ERROR_SUCCESS)
     {
       RegSetValueEx(HKey, NULL, 0, REG_SZ,
-        reinterpret_cast<unsigned char*>(DRAG_EXT_NAME), sizeof(DRAG_EXT_NAME));
+        reinterpret_cast<const unsigned char*>(DRAG_EXT_NAME), sizeof(DRAG_EXT_NAME));
 
       if (RegCreateKey(HKey, "InProcServer32", &HKey) == ERROR_SUCCESS)
       {

+ 2 - 0
dragext/DragExt.h

@@ -10,6 +10,7 @@
 DEFINE_GUID(CLSID_ShellExtension, 0xe15e1d68, 0x0d1c, 0x49f7,
   0xbe, 0xb8, 0x81, 0x2b, 0x1e, 0x00, 0xfa, 0x60 );
 //---------------------------------------------------------------------------
+#pragma pack(push, 4)
 struct TDragExtCommStruct
 {
   enum TVersion
@@ -24,5 +25,6 @@ struct TDragExtCommStruct
   bool Dragging;
   char DropDest[MAX_PATH];
 };
+#pragma pack(pop)
 //---------------------------------------------------------------------------
 #endif // DragExtH

+ 7 - 0
dragext/DragExt64.def

@@ -0,0 +1,7 @@
+LIBRARY      "dragext64"
+
+EXPORTS
+    DllCanUnloadNow         PRIVATE
+    DllGetClassObject       PRIVATE
+    DllRegisterServer       PRIVATE
+    DllUnregisterServer     PRIVATE

+ 4 - 0
filezilla/FtpControlSocket.cpp

@@ -3301,7 +3301,11 @@ void CFtpControlSocket::FileTransfer(t_transferfile *transferfile/*=0*/,BOOL bFi
 						res = m_pDataFile->Open(pData->transferfile.localfile,CFile::modeWrite|CFile::modeCreate|CFile::shareDenyWrite);
 				}
 				else
+#ifdef MPEXT
+					res = m_pDataFile->Open(pData->transferfile.localfile,CFile::modeRead|CFile::shareDenyNone);
+#else
 					res = m_pDataFile->Open(pData->transferfile.localfile,CFile::modeRead|CFile::shareDenyWrite);
+#endif
 				if (!res)
 				{
 					//Error opening the file

+ 9 - 4
forms/EditorPreferences.cpp

@@ -19,9 +19,11 @@ bool __fastcall DoEditorPreferencesDialog(TEditorPreferences * Editor,
   TEditorPreferencesMode Mode)
 {
   bool Result;
-  TEditorPreferencesDialog * Dialog = new TEditorPreferencesDialog(Application, Mode);
+
+  TEditorPreferencesDialog * Dialog = SafeFormCreate<TEditorPreferencesDialog>(Application);
   try
   {
+    Dialog->Init(Mode);
     Result = Dialog->Execute(Editor);
   }
   __finally
@@ -32,16 +34,19 @@ bool __fastcall DoEditorPreferencesDialog(TEditorPreferences * Editor,
 }
 //---------------------------------------------------------------------------
 __fastcall TEditorPreferencesDialog::TEditorPreferencesDialog(
-  TComponent * Owner, TEditorPreferencesMode Mode) :
+  TComponent * Owner) :
   TForm(Owner)
 {
   UseSystemSettings(this);
 
+  InstallPathWordBreakProc(ExternalEditorEdit);
+}
+//---------------------------------------------------------------------------
+void __fastcall TEditorPreferencesDialog::Init(TEditorPreferencesMode Mode)
+{
   FMode = Mode;
 
   Caption = LoadStr(Mode == epmEdit ? EDITOR_EDIT : EDITOR_ADD);
-
-  InstallPathWordBreakProc(ExternalEditorEdit);
 }
 //---------------------------------------------------------------------------
 bool __fastcall TEditorPreferencesDialog::Execute(TEditorPreferences * Editor)

+ 2 - 2
forms/EditorPreferences.h

@@ -33,9 +33,9 @@ __published:
   void __fastcall MaskEditExit(TObject *Sender);
 
 public:
-  __fastcall TEditorPreferencesDialog(TComponent * Owner,
-    TEditorPreferencesMode Mode);
+  virtual __fastcall TEditorPreferencesDialog(TComponent * Owner);
 
+  void __fastcall Init(TEditorPreferencesMode Mode);
   bool __fastcall Execute(TEditorPreferences * Editor);
 
 private:

+ 1 - 1
forms/FullSynchronize.dfm

@@ -160,7 +160,7 @@ object FullSynchronizeDialog: TFullSynchronizeDialog
     Top = 396
     Width = 129
     Height = 25
-    Anchors = [akRight, akBottom]
+    Anchors = [akLeft, akBottom]
     Caption = 'Transfer settin&gs...'
     TabOrder = 7
     OnClick = TransferSettingsButtonClick

+ 6 - 2
forms/Login.cpp

@@ -845,7 +845,6 @@ void __fastcall TLoginDialog::UpdateControls()
       EnableControl(SessionListView, SessionListView->Items->Count);
       // keep 2 pixels on right free
       AdjustListColumnsWidth(SessionListView, -1, 2);
-      EnableControl(ShellIconsButton, SessionListView->Selected);
 
       // ssh/authentication sheet
       AuthSheet->Enabled = SshProtocol && Advanced;
@@ -1242,6 +1241,10 @@ void __fastcall TLoginDialog::ActionListUpdate(TBasicAction *Action,
   {
     SaveSessionAction->Enabled = (PageControl->ActivePage != SessionListSheet);
   }
+  else if (Action == ShellIconSessionAction)
+  {
+    ShellIconSessionAction->Enabled = SessionListView->Selected;
+  }
   Handled = true;
 
   if (!LoginButton->Default && !SessionListView->IsEditing())
@@ -1515,7 +1518,8 @@ void __fastcall TLoginDialog::ToolsMenuButtonClick(TObject * /*Sender*/)
   MenuPopup(ToolsPopupMenu, ToolsMenuButton);
 }
 //---------------------------------------------------------------------------
-void __fastcall TLoginDialog::ShellIconsButtonClick(TObject * /*Sender*/)
+void __fastcall TLoginDialog::ShellIconSessionActionExecute(
+  TObject * /*Sender*/)
 {
   MenuPopup(IconsPopupMenu, ShellIconsButton);
 }

+ 8 - 4
forms/Login.dfm

@@ -186,7 +186,7 @@ object LoginDialog: TLoginDialog
             Top = 85
             Width = 137
             Height = 21
-            MaxLength = 50
+            MaxLength = 100
             TabOrder = 1
             Text = 'UserNameEdit'
             OnChange = DataChange
@@ -197,7 +197,7 @@ object LoginDialog: TLoginDialog
             Width = 171
             Height = 21
             Anchors = [akLeft, akTop, akRight]
-            MaxLength = 50
+            MaxLength = 100
             TabOrder = 2
             Text = 'PasswordEdit'
             OnChange = DataChange
@@ -376,10 +376,9 @@ object LoginDialog: TLoginDialog
           Top = 163
           Width = 88
           Height = 25
+          Action = ShellIconSessionAction
           Anchors = [akTop, akRight]
-          Caption = 'Shell &icon...'
           TabOrder = 6
-          OnClick = ShellIconsButtonClick
         end
         object RenameButton: TButton
           Left = 257
@@ -2298,6 +2297,11 @@ object LoginDialog: TLoginDialog
       Caption = '&Rename'
       OnExecute = RenameSessionActionExecute
     end
+    object ShellIconSessionAction: TAction
+      Category = 'Sessions'
+      Caption = 'Shell &icon...'
+      OnExecute = ShellIconSessionActionExecute
+    end
   end
   object ToolsPopupMenu: TPopupMenu
     Left = 48

+ 2 - 1
forms/Login.h

@@ -268,6 +268,7 @@ __published:
   TLabel *InsecureLabel;
   TGroupBox *ConnectionGroup;
   TCheckBox *FtpPasvModeCheck;
+  TAction *ShellIconSessionAction;
   void __fastcall DataChange(TObject *Sender);
   void __fastcall FormShow(TObject *Sender);
   void __fastcall SessionListViewSelectItem(TObject *Sender,
@@ -301,7 +302,6 @@ __published:
   void __fastcall DesktopIconActionExecute(TObject *Sender);
   void __fastcall SessionListViewCustomDrawItem(TCustomListView *Sender,
           TListItem *Item, TCustomDrawState State, bool &DefaultDraw);
-  void __fastcall ShellIconsButtonClick(TObject *Sender);
   void __fastcall SendToHookActionExecute(TObject *Sender);
   void __fastcall CheckForUpdatesActionExecute(TObject *Sender);
   void __fastcall LanguagesButtonClick(TObject *Sender);
@@ -330,6 +330,7 @@ __published:
   void __fastcall TransferProtocolComboChange(TObject *Sender);
   void __fastcall NavigationTreeCollapsing(TObject *Sender,
           TTreeNode *Node, bool &AllowCollapse);
+  void __fastcall ShellIconSessionActionExecute(TObject *Sender);
 
 private:
   int NoUpdate;

+ 0 - 1
forms/Synchronize.dfm

@@ -205,7 +205,6 @@ object SynchronizeDialog: TSynchronizeDialog
     Top = 288
     Width = 137
     Height = 25
-    Anchors = [akTop, akRight]
     Caption = 'Transfer settin&gs...'
     TabOrder = 2
     OnClick = TransferSettingsButtonClick

+ 12 - 2
makefile

@@ -7,10 +7,17 @@ ROOT = $(MAKEDIR)\..
 EXTERNALDEFINES = NO_FILEZILLA;
 !endif
 #------------------------------------------------------------------------------
-MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -DEXTERNALDEFINES=$(EXTERNALDEFINES) -f$&.mak
+MAKEBASE = $(ROOT)\bin\make.exe -$(MAKEFLAGS)
+MAKE = $(MAKEBASE) -DEXTERNALDEFINES=$(EXTERNALDEFINES) -f$&.mak
 BPR2MAK = $(ROOT)\bin\bpr2mak
 #------------------------------------------------------------------------------
-default: WinSCP.exe DragExt.dll WinSCP.com lib\DiscMon_B5.lib
+default: WinSCP.exe
+default: DragExt.dll
+!ifdef WITH_DRAGEXT64
+default: DragExt64.dll
+!endif
+default: WinSCP.com
+default: lib\DiscMon_B5.lib
 
 WinSCP.exe: WinSCP.bpr
 WinSCP.exe: lib\Moje_B5.lib lib\DragDrop_B5.lib lib\DriveDir_B5.lib
@@ -24,6 +31,9 @@ DragExt.dll: DragExt.bpr
  $(BPR2MAK) -tdefault.bmk DragExt.bpr
  $(MAKE)
 
+DragExt64.dll:
+ $(MAKEBASE) -fmakefile.dragext64
+
 WinSCP.com: Console.com
  ren Console.com WinSCP.com
 

+ 33 - 0
makefile.dragext64

@@ -0,0 +1,33 @@
+#------------------------------------------------------------------------------
+# DRAGEXT64CL = <path to x64 cl.exe>
+# DRAGEXT64LIBPATH = <path to x64 libraries>
+# DRAGEXT64INCLUDEPATH = <path to x64 includes>
+#------------------------------------------------------------------------------
+!ifndef ROOT
+ROOT = $(MAKEDIR)\..
+!endif
+#------------------------------------------------------------------------------
+!ifndef DRAGEXT64CL
+DRAGEXT64CL = cl.exe
+!endif
+#------------------------------------------------------------------------------
+INCLUDE = /I$(DRAGEXT64INCL)
+LIBPATH = /LIBPATH:$(DRAGEXT64LIB)
+OUTPUT = DragExt64
+
+ALLLIB = version.lib AdvAPI32.Lib Shell32.Lib Ole32.Lib bufferoverflowu.lib
+
+CFLAGS1 = /EHsc /GS- /Zi /LD /DWIN32;NDEBUG;_WINDOWS;_USRDLL /wd4068
+CFLAGS2 = /Fe$(OUTPUT).dll /Fo$(OUTPUT).obj
+CFLAGS = $(CFLAGS1) $(CFLAGS2) $(INCLUDE)
+LFLAGS = $(LIBPATH) /MACHINE:AMD64 /DEF:dragext\$(OUTPUT).def
+
+SOURCES = dragext\DragExt.cpp
+
+$(OUTPUT).dll: $(OUTPUT).res
+ $(DRAGEXT64CL) /nologo $(CFLAGS) $(SOURCES) /link $(LFLAGS) $(ALLLIB) $**
+
+$(OUTPUT).res: $(OUTPUT).rc
+ $(ROOT)\bin\brcc32 -fo$< $**
+
+default: DragExt64.dll

+ 5 - 6
packages/DiscMon_B5.bpk

@@ -4,8 +4,8 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\DiscMon_B5.bpl"/>
-    <OBJFILES value="DiscMon_B5.obj &quot;my\CompThread.obj&quot; &quot;my\DiscMon.obj&quot;"/>
-    <RESFILES value="DiscMon_B5.res &quot;my\DiscMon.dcr&quot;"/>
+    <OBJFILES value="DiscMon_B5.obj my\CompThread.obj my\DiscMon.obj"/>
+    <RESFILES value="my\DiscMon.dcr"/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>
     <LIBFILES value=""/>
@@ -13,7 +13,7 @@
     <SPARELIBS value="rtl.lib vcl.lib"/>
     <PACKAGES value="rtl.bpi vcl.bpi vclx.bpi"/>
     <PATHCPP value=".;"/>
-    <PATHPAS value=".;&quot;my&quot;"/>
+    <PATHPAS value=".;my"/>
     <PATHRC value=".;"/>
     <PATHASM value=".;"/>
     <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
@@ -22,8 +22,8 @@
     <USERDEFINES value=""/>
     <SYSDEFINES value="NO_STRICT;USEPACKAGES"/>
     <MAINSOURCE value="DiscMon_B5.cpp"/>
-    <INCLUDEPATH value="&quot;my&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
-    <LIBPATH value="..\lib\;&quot;my&quot;;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Source\ToolsAPI"/>
+    <INCLUDEPATH value="my;$(BCB)\include;$(BCB)\include\vcl"/>
+    <LIBPATH value="..\lib\;my;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Source\ToolsAPI"/>
     <WARNINGS value="-wuse -w-par"/>
     <OTHERFILES value=""/>
   </MACROS>
@@ -43,7 +43,6 @@
   </LINKER>
   <FILELIST>
       <FILE FILENAME="DiscMon_B5.cpp" FORMNAME="" UNITNAME="DiscMon_B5" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="DiscMon_B5.res" FORMNAME="" UNITNAME="DiscMon_B5.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="rtl.bpi" FORMNAME="" UNITNAME="rtl" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="vcl.bpi" FORMNAME="" UNITNAME="vcl" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="vclx.bpi" FORMNAME="" UNITNAME="vclx" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>

BIN
packages/DiscMon_B5.res


+ 12 - 14
packages/DragDrop_B5.bpk

@@ -4,15 +4,14 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\DragDrop_B5.bpl"/>
-    <OBJFILES value="DragDrop_B5.obj &quot;dragndrop\DragDrop.obj&quot; &quot;dragndrop\DragDropBitmap.obj&quot; 
-      &quot;dragndrop\DragDropFiles.obj&quot; &quot;dragndrop\DragDropFilesEx.obj&quot; 
-      &quot;dragndrop\DragDropText.obj&quot; &quot;dragndrop\DragDropURL.obj&quot; &quot;dragndrop\ListSort.obj&quot; 
-      &quot;dragndrop\PIDL.obj&quot;"/>
-    <RESFILES value="DragDrop_B5.res &quot;dragndrop\DragDrop.dcr&quot; 
-      &quot;dragndrop\DragDropBitmap.dcr&quot; 
-      &quot;dragndrop\DragDropFiles.dcr&quot; 
-      &quot;dragndrop\DragDropFilesEx.dcr&quot; 
-      &quot;dragndrop\DragDropText.dcr&quot; &quot;dragndrop\ListSort.dcr&quot;"/>
+    <OBJFILES value="DragDrop_B5.obj dragndrop\DragDrop.obj
+      dragndrop\DragDropBitmap.obj dragndrop\DragDropFiles.obj
+      dragndrop\DragDropFilesEx.obj dragndrop\DragDropText.obj
+      dragndrop\DragDropURL.obj dragndrop\ListSort.obj dragndrop\PIDL.obj"/>
+    <RESFILES value="dragndrop\DragDrop.dcr
+      dragndrop\DragDropBitmap.dcr dragndrop\DragDropFiles.dcr
+      dragndrop\DragDropFilesEx.dcr dragndrop\DragDropText.dcr
+      dragndrop\ListSort.dcr"/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>
     <LIBFILES value=""/>
@@ -20,7 +19,7 @@
     <SPARELIBS value="rtl.lib vcl.lib"/>
     <PACKAGES value="rtl.bpi vcl.bpi"/>
     <PATHCPP value=".;"/>
-    <PATHPAS value=".;&quot;dragndrop&quot;"/>
+    <PATHPAS value=".;dragndrop"/>
     <PATHRC value=".;"/>
     <PATHASM value=".;"/>
     <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
@@ -29,8 +28,8 @@
     <USERDEFINES value=""/>
     <SYSDEFINES value="NO_STRICT;USEPACKAGES"/>
     <MAINSOURCE value="DragDrop_B5.cpp"/>
-    <INCLUDEPATH value="&quot;dragndrop&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
-    <LIBPATH value="..\lib\;&quot;dragndrop&quot;;$(BCB)\lib\obj;$(BCB)\lib"/>
+    <INCLUDEPATH value="dragndrop;$(BCB)\include;$(BCB)\include\vcl"/>
+    <LIBPATH value="..\lib\;dragndrop;$(BCB)\lib\obj;$(BCB)\lib"/>
     <WARNINGS value="-w-par"/>
     <OTHERFILES value=""/>
   </MACROS>
@@ -39,7 +38,7 @@
     <PFLAGS value="-$Y- -$L- -$D- -$C- -$A8 -v -JPHNE -M"/>
     <RFLAGS value=""/>
     <AFLAGS value="/mx /w2 /zn"/>
-    <LFLAGS value="-D&quot;dragndrop&quot; -aa -Tpp -x -Gn -Gl -Gi"/>
+    <LFLAGS value="-Ddragndrop -aa -Tpp -x -Gn -Gl -Gi"/>
     <OTHERFILES value=""/>
   </OPTIONS>
   <LINKER>
@@ -50,7 +49,6 @@
   </LINKER>
   <FILELIST>
       <FILE FILENAME="DragDrop_B5.cpp" FORMNAME="" UNITNAME="DragDrop_B5" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="DragDrop_B5.res" FORMNAME="" UNITNAME="DragDrop_B5" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="dragndrop\DragDrop.pas" FORMNAME="" UNITNAME="DragDrop" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="dragndrop\DragDrop.dcr" FORMNAME="" UNITNAME="DragDrop" CONTAINERID="DcrTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="dragndrop\DragDropBitmap.pas" FORMNAME="" UNITNAME="DragDropBitmap" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>

BIN
packages/DragDrop_B5.res


+ 14 - 15
packages/DriveDir_B5.bpk

@@ -4,16 +4,16 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\DriveDir_B5.bpl"/>
-    <OBJFILES value="DriveDir_B5.obj &quot;filemng\DirView.obj&quot; &quot;filemng\DriveView.obj&quot; 
-      &quot;filemng\FileOperator.obj&quot; &quot;filemng\IEComboBox.obj&quot; &quot;filemng\BaseUtils.obj&quot; 
-      &quot;filemng\FileChanges.obj&quot; &quot;filemng\MaskSearch.obj&quot; &quot;filemng\IEDriveInfo.obj&quot; 
-      &quot;filemng\ShellDialogs.obj&quot; &quot;filemng\DirViewColProperties.obj&quot; 
-      &quot;filemng\CustomDirView.obj&quot; &quot;filemng\CustomUnixDirView.obj&quot; 
-      &quot;filemng\UnixDirViewColProperties.obj&quot; &quot;filemng\CustomPathComboBox.obj&quot; 
-      &quot;filemng\IEPathComboBox.obj&quot; &quot;filemng\ListExt.obj&quot; &quot;filemng\CustomDriveView.obj&quot;"/>
-    <RESFILES value="DriveDir_B5.res &quot;filemng\DirView.dcr&quot; 
-      &quot;filemng\DriveView.dcr&quot; &quot;filemng\FileOperator.dcr&quot; 
-      &quot;filemng\IEComboBox.dcr&quot;"/>
+    <OBJFILES value="DriveDir_B5.obj filemng\DirView.obj
+      filemng\DriveView.obj filemng\FileOperator.obj filemng\IEComboBox.obj
+      filemng\BaseUtils.obj filemng\FileChanges.obj filemng\MaskSearch.obj
+      filemng\IEDriveInfo.obj filemng\ShellDialogs.obj
+      filemng\DirViewColProperties.obj filemng\CustomDirView.obj
+      filemng\CustomUnixDirView.obj filemng\UnixDirViewColProperties.obj
+      filemng\CustomPathComboBox.obj filemng\IEPathComboBox.obj
+      filemng\ListExt.obj filemng\CustomDriveView.obj"/>
+    <RESFILES value="filemng\DirView.dcr filemng\DriveView.dcr
+      filemng\FileOperator.dcr filemng\IEComboBox.dcr"/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>
     <LIBFILES value=""/>
@@ -22,7 +22,7 @@
     <PACKAGES value="DragDrop_B5.bpi Moje_B5.bpi rtl.bpi vcl.bpi
       vclx.bpi"/>
     <PATHCPP value=".;"/>
-    <PATHPAS value=".;&quot;filemng&quot;"/>
+    <PATHPAS value=".;filemng"/>
     <PATHRC value=".;"/>
     <PATHASM value=".;"/>
     <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
@@ -31,8 +31,8 @@
     <USERDEFINES value="OLD_DND;NORTON_LIKE"/>
     <SYSDEFINES value="NO_STRICT;USEPACKAGES"/>
     <MAINSOURCE value="DriveDir_B5.cpp"/>
-    <INCLUDEPATH value="&quot;filemng&quot;;&quot;dragndrop&quot;;&quot;my&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
-    <LIBPATH value="..\lib\;&quot;filemng&quot;;&quot;dragndrop&quot;;&quot;my&quot;;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Source\ToolsAPI"/>
+    <INCLUDEPATH value="filemng;dragndrop;my;$(BCB)\include;$(BCB)\include\vcl"/>
+    <LIBPATH value="..\lib\;filemng;dragndrop;my;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Source\ToolsAPI"/>
     <WARNINGS value="-wuse -w-par"/>
     <OTHERFILES value=""/>
   </MACROS>
@@ -41,7 +41,7 @@
     <PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
     <RFLAGS value=""/>
     <AFLAGS value="/mx /w2 /zn"/>
-    <LFLAGS value="-D&quot;filemng&quot; -aa -Tpp -GD -s -Gn -Gl -Gi -M"/>
+    <LFLAGS value="-Dfilemng -aa -Tpp -GD -s -Gn -Gl -Gi -M"/>
     <OTHERFILES value=""/>
   </OPTIONS>
   <LINKER>
@@ -52,7 +52,6 @@
   </LINKER>
   <FILELIST>
       <FILE FILENAME="DriveDir_B5.cpp" FORMNAME="" UNITNAME="DriveDir_B5" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="DriveDir_B5.res" FORMNAME="" UNITNAME="DriveDir_B5" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="filemng\DirView.pas" FORMNAME="" UNITNAME="DirView" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="filemng\DirView.dcr" FORMNAME="" UNITNAME="DirView" CONTAINERID="DcrTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="filemng\DriveView.pas" FORMNAME="" UNITNAME="DriveView" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>

BIN
packages/DriveDir_B5.res


+ 10 - 13
packages/Moje_B5.bpk

@@ -4,15 +4,13 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\Moje_B5.bpl"/>
-    <OBJFILES value="Moje_B5.obj &quot;my\HistoryComboBox.obj&quot; 
-      &quot;my\ListViewColProperties.obj&quot; &quot;my\MoreButton.obj&quot; 
-      &quot;my\NortonLikeListView.obj&quot; &quot;my\PathLabel.obj&quot; 
-      &quot;my\UpDownEdit.obj&quot; &quot;my\ComboEdit.obj&quot; &quot;my\PasswordEdit.obj&quot; 
-      &quot;my\ResourceModule.obj&quot; &quot;my\CompThread.obj&quot; &quot;my\DiscMon.obj&quot; 
-      &quot;my\TcpIp.obj&quot; &quot;my\GrayedCheckBox.obj&quot; &quot;my\IEListView.obj&quot; 
-      &quot;my\LanguagesDEPfix.obj&quot;"/>
-    <RESFILES value="Moje_B5.res &quot;my\HistoryComboBox.dcr&quot; 
-      &quot;my\NortonLikeListView.dcr&quot; &quot;my\PathLabel.dcr&quot; &quot;my\DiscMon.dcr&quot;"/>
+    <OBJFILES value="Moje_B5.obj my\HistoryComboBox.obj
+      my\ListViewColProperties.obj my\MoreButton.obj my\NortonLikeListView.obj
+      my\PathLabel.obj my\UpDownEdit.obj my\ComboEdit.obj my\PasswordEdit.obj
+      my\ResourceModule.obj my\CompThread.obj my\DiscMon.obj my\TcpIp.obj
+      my\GrayedCheckBox.obj my\IEListView.obj my\LanguagesDEPfix.obj"/>
+    <RESFILES value="my\HistoryComboBox.dcr my\NortonLikeListView.dcr
+      my\PathLabel.dcr my\DiscMon.dcr"/>
     <DEFFILE value=""/>
     <RESDEPEN value="$(RESFILES)"/>
     <LIBFILES value=""/>
@@ -20,7 +18,7 @@
     <SPARELIBS value="rtl.lib vcl.lib"/>
     <PACKAGES value="rtl.bpi vcl.bpi vclx.bpi"/>
     <PATHCPP value=".;"/>
-    <PATHPAS value=".;&quot;my&quot;"/>
+    <PATHPAS value=".;my"/>
     <PATHRC value=".;"/>
     <PATHASM value=".;"/>
     <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
@@ -29,8 +27,8 @@
     <USERDEFINES value=""/>
     <SYSDEFINES value="NO_STRICT;USEPACKAGES"/>
     <MAINSOURCE value="Moje_B5.cpp"/>
-    <INCLUDEPATH value="&quot;my&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
-    <LIBPATH value="..\lib\;&quot;my&quot;;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Source\ToolsAPI"/>
+    <INCLUDEPATH value="my;$(BCB)\include;$(BCB)\include\vcl"/>
+    <LIBPATH value="..\lib\;my;$(BCB)\lib\obj;$(BCB)\lib;$(BCB)\Source\ToolsAPI"/>
     <WARNINGS value="-wuse -w-par"/>
     <OTHERFILES value=""/>
   </MACROS>
@@ -50,7 +48,6 @@
   </LINKER>
   <FILELIST>
       <FILE FILENAME="Moje_B5.cpp" FORMNAME="" UNITNAME="Moje_B5" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="Moje_B5.res" FORMNAME="" UNITNAME="Moje_B5" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="rtl.bpi" FORMNAME="" UNITNAME="rtl" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="vcl.bpi" FORMNAME="" UNITNAME="vcl" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="vclx.bpi" FORMNAME="" UNITNAME="vclx" CONTAINERID="BPITool" DESIGNCLASS="" LOCALCOMMAND=""/>

BIN
packages/Moje_B5.res


+ 3 - 4
packages/ThemeManagerC6.bpk

@@ -4,9 +4,9 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\ThemeManagerC6.bpl"/>
-    <OBJFILES value="ThemeManagerC6.obj theme\TmSchema.obj theme\UxTheme.obj 
-      theme\ThemeSrv.obj theme\ThemeMgr.obj"/>
-    <RESFILES value="ThemeManagerC6.res"/>
+    <OBJFILES value="ThemeManagerC6.obj theme\TmSchema.obj
+      theme\UxTheme.obj theme\ThemeSrv.obj theme\ThemeMgr.obj"/>
+    <RESFILES value=""/>
     <IDLFILES value=""/>
     <IDLGENFILES value=""/>
     <DEFFILE value=""/>
@@ -48,7 +48,6 @@
   </LINKER>
   <FILELIST>
       <FILE FILENAME="ThemeManagerC6.cpp" FORMNAME="" UNITNAME="ThemeManagerC6" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
-      <FILE FILENAME="ThemeManagerC6.res" FORMNAME="" UNITNAME="ThemeManagerC6.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="theme\TmSchema.pas" FORMNAME="" UNITNAME="TmSchema" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="theme\UxTheme.pas" FORMNAME="" UNITNAME="UxTheme" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
       <FILE FILENAME="theme\ThemeSrv.pas" FORMNAME="" UNITNAME="ThemeSrv" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>

BIN
packages/ThemeManagerC6.res


+ 1 - 0
packages/filemng/CustomDriveView.hpp

@@ -108,6 +108,7 @@ protected:
 	virtual bool __fastcall IsCustomDrawn(Comctrls::TCustomDrawTarget Target, Comctrls::TCustomDrawStage Stage);
 	virtual bool __fastcall CustomDrawItem(Comctrls::TTreeNode* Node, Comctrls::TCustomDrawState State, Comctrls::TCustomDrawStage Stage, bool &PaintImages);
 	HIDESBASE MESSAGE void __fastcall CNNotify(Messages::TWMNotify &Msg);
+	HIDESBASE MESSAGE void __fastcall CMColorChanged(Messages::TMessage &Msg);
 	HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Msg);
 	HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Msg);
 	HIDESBASE MESSAGE void __fastcall WMRButtonDown(Messages::TWMMouse &Msg);

+ 10 - 0
packages/filemng/CustomDriveView.pas

@@ -86,6 +86,7 @@ type
       Stage: TCustomDrawStage; var PaintImages: Boolean): Boolean; override;
 
     procedure CNNotify(var Msg: TWMNotify); message CN_NOTIFY;
+    procedure CMColorChanged(var Msg: TMessage); message CM_COLORCHANGED;
     procedure WMLButtonDown(var Msg: TWMLButtonDown); message WM_LBUTTONDOWN;
     procedure WMLButtonUp(var Msg: TWMLButtonDown); message WM_LBUTTONUP;
     procedure WMRButtonDown(var Msg: TWMRButtonDown); message WM_RBUTTONDOWN;
@@ -932,6 +933,15 @@ begin
   end;
 end; {CNNotify}
 
+procedure TCustomDriveView.CMColorChanged(var Msg: TMessage);
+begin
+  inherited;
+  if Assigned(Images) then
+    Images.BkColor := Color;
+  if Assigned(StateImages) then
+    StateImages.BkColor := Color;
+end;
+
 procedure TCustomDriveView.WMLButtonDown(var Msg: TWMLButtonDown);
 begin
   FCanChange := False;

+ 36 - 11
packages/filemng/IEDriveInfo.pas

@@ -444,10 +444,10 @@ const
   USE_CONN     = 4;
   USE_RECONN   = 5;
 
-function NetUseGetInfo(UncServerName: LMSTR; UseName: LMSTR; Level: DWORD;
-  var BufPtr: LPBYTE): NET_API_STATUS; stdcall; external 'netapi32.dll' name 'NetUseGetInfo';
-function NetApiBufferFree(Buffer: LPVOID): NET_API_STATUS; stdcall;
-  external 'netapi32.dll' name 'NetApiBufferFree';
+var
+  NetUseGetInfo: function(UncServerName: LMSTR; UseName: LMSTR; Level: DWORD;
+    var BufPtr: LPBYTE): NET_API_STATUS; stdcall;
+  NetApiBufferFree: function(Buffer: LPVOID): NET_API_STATUS; stdcall;
 
 function GetNetWorkConnected(Drive: Char): Boolean;
 var
@@ -455,22 +455,45 @@ var
   Use: WideString;
   NetResult: Integer;
 begin
-  Use := Drive + ':';
-  NetResult := NetUseGetInfo(nil, PWideChar(Use), 1, BufPtr);
-  if NetResult = 0 then
+  if Assigned(NetUseGetInfo) then
   begin
-    Result := (PUSE_INFO_1(BufPtr)^.ui1_status = USE_OK);
-    NetApiBufferFree(LPVOID(BufPtr));
+    Use := Drive + ':';
+    NetResult := NetUseGetInfo(nil, PWideChar(Use), 1, BufPtr);
+    if NetResult = 0 then
+    begin
+      Result := (PUSE_INFO_1(BufPtr)^.ui1_status = USE_OK);
+      Assert(Assigned(NetApiBufferFree));
+      NetApiBufferFree(LPVOID(BufPtr));
+    end
+      else
+    begin
+      // NetUseGetInfo works for DFS shares only, hence when it fails
+      // we suppose different share type and fallback to "connected"
+      Result := True;
+    end;
   end
     else
   begin
-    // NetUseGetInfo works for DFS shares only, hence when it fails
-    // we suppose different share type and fallback to "connected"
     Result := True;
   end;
 end;
 
+var
+  NetApiDll: THandle;
+
 initialization
+  NetApiDll := SafeLoadLibrary('netapi32.dll');
+  if NetApiDll <> 0 then
+  begin
+    @NetUseGetInfo := GetProcAddress(NetApiDll, 'NetUseGetInfo');
+    @NetApiBufferFree := GetProcAddress(NetApiDll, 'NetApiBufferFree');
+  end
+    else
+  begin
+    @NetUseGetInfo := nil;
+    @NetApiBufferFree := nil;
+  end;
+
   if not Assigned(DriveInfo) then
     DriveInfo := TDriveInfo.Create;
 
@@ -480,4 +503,6 @@ finalization
     DriveInfo.Free;
     DriveInfo := nil;
   end;
+
+  if NetApiDll <> 0 then FreeLibrary(NetApiDll);
 end.

+ 3 - 4
packages/tb2k_cb6.bpk

@@ -4,10 +4,9 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\tb2k_cb6.bpl"/>
-    <OBJFILES value="tb2k_cb6.obj tb2k\TB2Common.obj tb2k\TB2Consts.obj 
-      tb2k\TB2Dock.obj tb2k\TB2ExtItems.obj tb2k\TB2Item.obj 
-      tb2k\TB2Toolbar.obj tb2k\TB2Version.obj tb2k\TB2Hook.obj 
-      tb2k\TB2Anim.obj tb2k\TB2Acc.obj"/>
+    <OBJFILES value="tb2k_cb6.obj tb2k\TB2Common.obj tb2k\TB2Consts.obj
+      tb2k\TB2Dock.obj tb2k\TB2ExtItems.obj tb2k\TB2Item.obj tb2k\TB2Toolbar.obj
+      tb2k\TB2Version.obj tb2k\TB2Hook.obj tb2k\TB2Anim.obj tb2k\TB2Acc.obj"/>
     <RESFILES value=""/>
     <IDLFILES value=""/>
     <DEFFILE value=""/>

+ 2 - 3
packages/tb2kdsgn_cb6.bpk

@@ -4,9 +4,8 @@
   <MACROS>
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\tb2kdsgn_cb6.bpl"/>
-    <OBJFILES value="tb2kdsgn_cb6.obj tb2k\TB2DsgnConverter.obj 
-      tb2k\TB2DsgnItemEditor.obj tb2k\TB2DsgnConvertOptions.obj 
-      tb2k\TB2Reg.obj"/>
+    <OBJFILES value="tb2kdsgn_cb6.obj tb2k\TB2DsgnConverter.obj
+      tb2k\TB2DsgnItemEditor.obj tb2k\TB2DsgnConvertOptions.obj tb2k\TB2Reg.obj"/>
     <RESFILES value="tb2k\TB2Reg.dcr"/>
     <IDLFILES value=""/>
     <DEFFILE value=""/>

+ 4 - 5
packages/tbx_cb6.bpk

@@ -5,10 +5,9 @@
     <VERSION value="BCB.06.00"/>
     <PROJECT value="..\lib\tbx_cb6.bpl"/>
     <OBJFILES value="tbx_cb6.obj tbx\TBXDefaultTheme.obj
-      tbx\TBXOfficeXPTheme.obj tbx\TBX.obj tbx\TBXUtils.obj
-      tbx\TBXExtItems.obj tbx\TBXUxThemes.obj tbx\TBXStatusBars.obj
-      tbx\TBXThemes.obj tbx\TBXLists.obj tbx\TBXOffice2003Theme.obj
-      tbx\TBXToolPals.obj"/>
+      tbx\TBXOfficeXPTheme.obj tbx\TBX.obj tbx\TBXUtils.obj tbx\TBXExtItems.obj
+      tbx\TBXUxThemes.obj tbx\TBXStatusBars.obj tbx\TBXThemes.obj
+      tbx\TBXLists.obj tbx\TBXOffice2003Theme.obj tbx\TBXToolPals.obj"/>
     <RESFILES value=""/>
     <IDLFILES value=""/>
     <IDLGENFILES value=""/>
@@ -34,7 +33,7 @@
     <OTHERFILES value=""/>
   </MACROS>
   <OPTIONS>
-    <IDLCFLAGS value="-Itbx\. -Itbx -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -D_DEBUG
+    <IDLCFLAGS value="-Itbx\. -Itbx -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -D_DEBUG 
       -boa"/>
     <CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tWM"/>
     <PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>

BIN
packages/tbx_cb6.res


BIN
packages/tbxdsgn_cb6.res


+ 9 - 1
putty/SSH_.C

@@ -97,4 +97,12 @@ void md5checksum(const char * buffer, int len, unsigned char output[16])
   MD5Init(&md5c);
   MD5Update(&md5c, buffer, len);
   MD5Final(output, &md5c);
-}
+}
+
+int has_gssapi_ssh()
+{
+  struct ssh_tag ssh;
+  memset(&ssh, 0, sizeof(ssh));
+  ssh.frontend = NULL;
+  return ssh_gssapi_init(&ssh);
+}

+ 1 - 0
putty/puttyexp.h

@@ -21,6 +21,7 @@ int get_ssh_exitcode(void * handle);
 const unsigned int * ssh2_remmaxpkt(void * handle);
 const unsigned int * ssh2_remwindow(void * handle);
 void md5checksum(const char * buffer, int len, unsigned char output[16]);
+int has_gssapi_ssh();
 
 // from portfwd.c
 

+ 5 - 0
readme

@@ -2,10 +2,15 @@ This is the README file for source code package of WinSCP.
 
 To build full version of WinSCP you need Borland C++ Builder 6 Professional.
 You can build version without FTP support with Borland C++ Builder 6 Personal.
+To build 64-bit version of drag&drop shell extension, you need
+Windows Platform SDK.
 
 To build WinSCP from source by yourself, type 'make' in root
 folder of source code package (directory where 'makefile' file resides).
 To build version without FTP support, use 'make -DNO_FILEZILLA'.
+To build also 64-bit version of drag&drop, use 'make -DWITH_DRAGEXT64'.
+However before you need to set some environment variables.
+Refer to makefile.dragext64.
 
 Directory structure:
 /            project files of all native libraries and executables

+ 7 - 1
release/winscpsetup.iss

@@ -26,6 +26,7 @@
 #define TranslationMask TranslationDir + "\WinSCP.???"
 #define MainFileSource SourceDir+"\WinSCP.exe"
 #define ShellExtFileSource SourceDir+"\DragExt.dll"
+#define ShellExt64FileSource SourceDir+"\DragExt64.dll"
 #define ConsoleFileSource SourceDir+"\WinSCP.com"
 
 #define Major
@@ -232,7 +233,12 @@ Source: "licence"; DestDir: "{app}"; \
   Components: main; Flags: ignoreversion
 Source: "{#ShellExtFileSource}"; DestDir: "{app}"; \
   Components: shellext; \
-  Flags: ignoreversion regserver restartreplace restartreplace uninsrestartdelete
+  Flags: ignoreversion regserver restartreplace uninsrestartdelete; \
+  Check: not IsWin64
+Source: "{#ShellExt64FileSource}"; DestDir: "{app}"; \
+  Components: shellext; \
+  Flags: ignoreversion regserver restartreplace uninsrestartdelete; \
+  Check: IsWin64
 Source: "{#PuttySourceDir}\LICENCE"; DestDir: "{app}\PuTTY"; \
   Components: pageant puttygen; Flags: ignoreversion
 Source: "{#PuttySourceDir}\putty.hlp"; DestDir: "{app}\PuTTY"; \

+ 1 - 0
resource/TextsCore.h

@@ -184,6 +184,7 @@
 #define FTP_CREDENTIAL_PROMPT   257
 #define FTP_PWD_RESPONSE_ERROR  258
 #define FTP_UNSUPPORTED         259
+#define TRANSFER_ERROR          261
 
 #define CORE_CONFIRMATION_STRINGS 300
 #define CONFIRM_PROLONG_TIMEOUT2 301

+ 1 - 0
resource/TextsCore1.rc

@@ -157,6 +157,7 @@ BEGIN
   FTP_CREDENTIAL_PROMPT, "Prompting for credentials..."
   FTP_PWD_RESPONSE_ERROR, "Invalid response to PWD command '%s'."
   FTP_UNSUPPORTED, "This version does not support FTP protocol."
+  TRANSFER_ERROR, "Error transferring file '%s'."
 
   CORE_CONFIRMATION_STRINGS, "CORE_CONFIRMATION"
   CONFIRM_PROLONG_TIMEOUT2, "Host has not answered for %d seconds.\n\nWait for another %0:d seconds?"

+ 11 - 0
resource/TextsFileZilla.rc

@@ -1,5 +1,16 @@
 #include "TextsFileZilla.h"
 
+#define _AFX_NO_APPMENU_RESOURCES
+#define _AFX_NO_FILECMD_RESOURCES
+#define _AFX_NO_OLE_RESOURCES
+#define _AFX_NO_MAPI_RESOURCES
+#define _AFX_NO_OCC_RESOURCES
+#define _AFX_NO_SPLITTER_RESOURCES
+#define _AFX_NO_TRACKER_RESOURCES
+#define _AFX_NO_CTL3D_RESOURCES
+#define _AFX_NO_NEWTYPEDLG_RESOURCES
+#include "afxres.rc"
+
 STRINGTABLE
 BEGIN
   IDS_ERRORMSG_NAMEINUSE, "File already exists"

+ 2 - 2
resource/TextsWin1.rc

@@ -35,10 +35,10 @@ BEGIN
         REGISTER_URL_ERROR, "Cannot register application to handle sftp:// and scp:// addresses."
         MUTEX_RELEASE_TIMEOUT, "Mutex was not released in required interval."
         DRAGEXT_MUTEX_RELEASE_TIMEOUT, "Shell drag extension mutex was not released in required interval."
-        DRAGEXT_TARGET_UNKNOWN, "WinSCP was not able to detect folder, where the dragged file(s) was dropped. Either you have not dropped the file(s) to regular folder (e.g. Windows Explorer) or WinSCP shell drag extension is not installed or you have not restarted the computer yet after installation. Install the extension or switch to compatible drag&&drop mode (from Preferences window), which uses temporary folder for downloads. It allows you to drop files to any destination."
+        DRAGEXT_TARGET_UNKNOWN, "WinSCP was not able to detect folder, where the dragged file(s) was dropped. Either you have not dropped the file(s) to regular folder (e.g. Windows Explorer) or WinSCP shell drag extension is not installed or you have not restarted the computer yet after installation. Install the extension or switch to compatible drag&drop mode (from Preferences window), which uses temporary folder for downloads. It allows you to drop files to any destination."
         UNKNOWN_TRANSLATION, "File '%s' does not contain translation for this product version."
         INCOMPATIBLE_TRANSLATION, "File '%s' contains translation for %s version %s."
-        DRAGEXT_TARGET_NOT_INSTALLED, "Shell drag extension support is enabled, but the extension was not loaded. Either it is not installed or you have not restarted the computer yet after installation. Install the extension or switch to compatible drag&&drop mode (from Preferences window), which uses temporary folder for downloads."
+        DRAGEXT_TARGET_NOT_INSTALLED, "Shell drag extension support is enabled, but the extension was not loaded. Either it is not installed or you have not restarted the computer yet after installation. Install the extension or switch to compatible drag&drop mode (from Preferences window), which uses temporary folder for downloads."
         GSSAPI_NOT_INSTALLED, "MIT Kerberos 5 GSSAPI not found. You need to install it before using this feature."
         WATCH_ERROR_GENERAL, "Error watching for changes."
         WATCH_ERROR_DIRECTORY, "Error watching for changes in directory '%s'."

+ 0 - 0
stamp


+ 111 - 59
windows/ConsoleRunner.cpp

@@ -645,7 +645,7 @@ public:
 
 protected:
   bool __fastcall Input(AnsiString & Str, bool Echo, unsigned int Timer);
-  inline void __fastcall Print(const AnsiString & Str);
+  inline void __fastcall Print(const AnsiString & Str, bool FromBeginning = false);
   inline void __fastcall PrintLine(const AnsiString & Str);
   inline void __fastcall PrintMessage(const AnsiString & Str);
   void __fastcall UpdateTitle();
@@ -717,16 +717,16 @@ void __fastcall TConsoleRunner::ScriptInput(TScript * /*Script*/,
   }
 }
 //---------------------------------------------------------------------------
-void __fastcall TConsoleRunner::Print(const AnsiString & Str)
+void __fastcall TConsoleRunner::Print(const AnsiString & Str, bool FromBeginning)
 {
   if (FLastProgressLen > 0)
   {
-    FConsole->Print("\n" + Str);
+    FConsole->Print("\n" + Str, FromBeginning);
     FLastProgressLen = 0;
   }
   else
   {
-    FConsole->Print(Str);
+    FConsole->Print(Str, FromBeginning);
   }
 }
 //---------------------------------------------------------------------------
@@ -826,12 +826,21 @@ void __fastcall TConsoleRunner::ScriptTerminalQueryUser(TObject * /*Sender*/,
 {
   AnsiString AQuery = Query;
   unsigned int Timer = 0;
-  Answer = 0;
+  unsigned int Timeout = 0;
+  int TimeoutA = 0;
 
   if (Params != NULL)
   {
+    if (Params->Timeout > 0)
+    {
+      assert(Params->Timer == 0);
+      Timeout = Params->Timeout;
+      TimeoutA = Params->TimeoutAnswer;
+    }
+
     if (Params->Timer > 0)
     {
+      assert(Params->Timeout == 0);
       Timer = Params->Timer;
       if (Params->TimerAnswers > 0)
       {
@@ -939,6 +948,7 @@ void __fastcall TConsoleRunner::ScriptTerminalQueryUser(TObject * /*Sender*/,
   int AbortIndex;
   int ContinueA = ContinueAnswer(Answers);
   int ContinueIndex;
+  int TimeoutIndex = 0;
 
   for (int Index = 0; Index < ButtonCount; Index++)
   {
@@ -992,86 +1002,128 @@ void __fastcall TConsoleRunner::ScriptTerminalQueryUser(TObject * /*Sender*/,
     {
       ContinueIndex = Index + 1;
     }
+    if (Buttons[Index] == ContinueA)
+    {
+      ContinueIndex = Index + 1;
+    }
+    if (Buttons[Index] == TimeoutA)
+    {
+      TimeoutIndex = Index + 1;
+    }
   }
 
   assert(Accels.Pos(' ') == 0);
 
-  AnsiString Output;
-  for (int i = 0; i < ButtonCount; i++)
-  {
-    if (i > 0)
-    {
-      Output += ", ";
-    }
+  bool Timeouting = (Timeout > 0);
 
-    AnsiString Caption = Captions[i];
-    int P = Caption.Pos('&');
-    assert(P >= 0);
-
-    Caption[P] = '(';
-    Caption.Insert(")", P + 2);
-    Output += Caption;
-  }
-  Output += ": ";
-  Print(Output);
-
-  int AnswerIndex;
-  if (FScript->Batch == TScript::BatchContinue)
-  {
-    AnswerIndex = ContinueIndex;
-  }
-  else if (FScript->Batch != TScript::BatchOff)
-  {
-    AnswerIndex = AbortIndex;
-  }
-  else
+  do
   {
+    Answer = 0;
+    int AnswerIndex;
     bool Retry;
+
     do
     {
       Retry = false;
-      AnswerIndex = FConsole->Choice(Accels, CancelIndex, -1, -2, Timer);
-      if (AnswerIndex == -1)
+
+      AnsiString Output;
+      for (int i = 0; i < ButtonCount; i++)
+      {
+        if (i > 0)
+        {
+          Output += ", ";
+        }
+
+        AnsiString Caption = Captions[i];
+        int P = Caption.Pos('&');
+        assert(P >= 0);
+
+        Caption[P] = '(';
+        Caption.Insert(")", P + 2);
+
+        if (i + 1 == TimeoutIndex)
+        {
+          assert(Timeouting);
+          Caption = FMTLOAD(TIMEOUT_BUTTON, (Caption, int(Timeout / 1000)));
+        }
+
+        Output += Caption;
+      }
+      Output += ": ";
+
+      // note that length of string may decrease over time due to number of
+      // seconds length, but supposing it decreases by one character at time
+      // at most, we do not mind as the prompt is terminated with space
+      Print(Output, true);
+
+      if (!Timeouting && (FScript->Batch == TScript::BatchContinue))
+      {
+        AnswerIndex = ContinueIndex;
+      }
+      else if (!Timeouting && (FScript->Batch != TScript::BatchOff))
       {
-        NotifyAbort();
         AnswerIndex = AbortIndex;
       }
-      else if (AnswerIndex == -2)
+      else if (Timeouting && (Timeout < 1000))
+      {
+        AnswerIndex = TimeoutIndex;
+      }
+      else
       {
-        assert((Params != NULL) && (Params->TimerEvent != NULL));
-        if ((Params != NULL) && (Params->TimerEvent != NULL))
+        AnswerIndex = FConsole->Choice(Accels, CancelIndex, -1, -2,
+          (Timeouting ? 1000 : Timer));
+        if (AnswerIndex == -1)
         {
-          unsigned int AAnswer = 0;
-          Params->TimerEvent(AAnswer);
-          if (AAnswer != 0)
+          NotifyAbort();
+          AnswerIndex = AbortIndex;
+        }
+        else if (AnswerIndex == -2)
+        {
+          if (Timeouting)
           {
-            Answer = AAnswer;
+            assert(Timeout >= 1000);
+            Timeout -= 1000;
+            Retry = true;
           }
           else
           {
-            Retry = true;
+            assert((Params != NULL) && (Params->TimerEvent != NULL));
+            if ((Params != NULL) && (Params->TimerEvent != NULL))
+            {
+              unsigned int AAnswer = 0;
+              Params->TimerEvent(AAnswer);
+              if (AAnswer != 0)
+              {
+                Answer = AAnswer;
+              }
+              else
+              {
+                Retry = true;
+              }
+            }
           }
         }
       }
     }
     while (Retry);
-  }
 
-  if (Answer == 0)
-  {
-    assert((AnswerIndex >= 1) && (AnswerIndex <= Accels.Length()));
-    AnsiString AnswerCaption = Captions[AnswerIndex - 1];
-    int P = AnswerCaption.Pos("&");
-    assert(P >= 0);
-    AnswerCaption.Delete(P, 1);
-    PrintLine(AnswerCaption);
-
-    Answer = Buttons[AnswerIndex - 1];
-  }
-  else
-  {
-    PrintLine("");
+    if (Answer == 0)
+    {
+      assert((AnswerIndex >= 1) && (AnswerIndex <= Accels.Length()));
+      AnsiString AnswerCaption = Captions[AnswerIndex - 1];
+      int P = AnswerCaption.Pos("&");
+      assert(P >= 0);
+      AnswerCaption.Delete(P, 1);
+      PrintLine(AnswerCaption);
+
+      Answer = Buttons[AnswerIndex - 1];
+    }
+    else
+    {
+      PrintLine("");
+    }
   }
+  while (Answer == 0);
 
   if (Answer == qaAbort)
   {

+ 11 - 1
windows/GUITools.cpp

@@ -53,8 +53,9 @@ void __fastcall OpenSessionInPutty(const AnsiString PuttyPath,
   if (FindFile(Program))
   {
     AnsiString SessionName;
-    THierarchicalStorage * Storage = NULL;
+    TRegistryStorage * Storage = NULL;
     TSessionData * ExportData = NULL;
+    TRegistryStorage * SourceStorage = NULL;
     try
     {
       Storage = new TRegistryStorage(Configuration->PuttySessionsKey);
@@ -67,6 +68,14 @@ void __fastcall OpenSessionInPutty(const AnsiString PuttyPath,
         }
         else
         {
+          SourceStorage = new TRegistryStorage(Configuration->PuttySessionsKey);
+          if (SourceStorage->OpenSubKey(MungeStr(StoredSessions->DefaultSettings->Name), false) &&
+              Storage->OpenSubKey(MungeStr(GUIConfiguration->PuttySession), true))
+          {
+            Storage->Copy(SourceStorage);
+            Storage->CloseSubKey();
+          }
+
           ExportData = new TSessionData("");
           ExportData->Assign(SessionData);
           ExportData->Modified = true;
@@ -81,6 +90,7 @@ void __fastcall OpenSessionInPutty(const AnsiString PuttyPath,
     {
       delete Storage;
       delete ExportData;
+      delete SourceStorage;
     }
 
     if (!Params.IsEmpty())

+ 1 - 3
windows/Setup.cpp

@@ -569,11 +569,9 @@ void __fastcall TemporaryDirectoryCleanup()
 
     if (Continue)
     {
-      TStrings * F = Folders;
-      Folders = NULL;
       try
       {
-        WinConfiguration->CleanupTemporaryFolders(F);
+        WinConfiguration->CleanupTemporaryFolders(Folders);
       }
       catch (Exception &E)
       {

+ 31 - 0
windows/Tools.cpp

@@ -442,3 +442,34 @@ void __fastcall BrowseForExecutable(TComboBox * Control, AnsiString Title,
 {
   BrowseForExecutableT(Control, Title, Filter, FileNameCommand);
 }
+//---------------------------------------------------------------------------
+bool __fastcall IsWin64()
+{
+  static int Result = -1;
+  if (Result < 0)
+  {
+    typedef BOOL WINAPI (*IsWow64ProcessType)(HANDLE Process, PBOOL Wow64Process);
+
+    Result = 0;
+
+    HMODULE Kernel = GetModuleHandle(kernel32);
+    if (Kernel != NULL)
+    {
+      IsWow64ProcessType IsWow64Process =
+        (IsWow64ProcessType)GetProcAddress(Kernel, "IsWow64Process");
+      if (IsWow64Process != NULL)
+      {
+        BOOL Wow64Process = FALSE;
+        if (IsWow64Process(GetCurrentProcess(), &Wow64Process))
+        {
+          if (Wow64Process)
+          {
+            Result = 1;
+          }
+        }
+      }
+    }
+  }
+
+  return (Result > 0);
+}

+ 1 - 0
windows/Tools.h

@@ -30,5 +30,6 @@ void __fastcall BrowseForExecutable(TEdit * Control, AnsiString Title,
   AnsiString Filter, bool FileNameCommand);
 void __fastcall BrowseForExecutable(TComboBox * Control, AnsiString Title,
   AnsiString Filter, bool FileNameCommand);
+bool __fastcall IsWin64();
 //---------------------------------------------------------------------------
 #endif

+ 79 - 0
windows/VCLCommon.cpp

@@ -1214,3 +1214,82 @@ void __fastcall LinkLabel(TStaticText * StaticText, AnsiString Url,
   ((TMethod*)&WindowProc)->Code = LinkLabelWindowProc;
   StaticText->WindowProc = WindowProc;
 }
+//---------------------------------------------------------------------------
+int __fastcall SafeShowModal(TForm * Form)
+{
+  // FIX: Due to some bug in Theme Manager, certain forms randomly
+  // fails in call to ShowModal(), hence repeat the call until it succeeds.
+
+  int Result = -1;
+  int Retry = 0;
+
+  do
+  {
+    try
+    {
+      Result = Form->ShowModal();
+    }
+    catch (EOSError & E)
+    {
+      if (E.Message == Sysconst_SUnkOSError)
+      {
+        ++Retry;
+        if (Retry >= 10)
+        {
+          throw;
+        }
+        else
+        {
+          Form->Visible = false;
+        }
+      }
+      else
+      {
+        throw;
+      }
+    }
+  }
+  while (Result < 0);
+
+  return Result;
+}
+//---------------------------------------------------------------------------
+static void __fastcall CreateHandles(TWinControl * Control)
+{
+  Control->HandleNeeded();
+
+  for (int Index = 0; Index < Control->ControlCount; Index++)
+  {
+    TWinControl * ChildControl = dynamic_cast<TWinControl *>(Control->Controls[Index]);
+    if (ChildControl != NULL)
+    {
+      CreateHandles(ChildControl);
+    }
+  }
+}
+//---------------------------------------------------------------------------
+TForm * __fastcall _SafeFormValidate(TForm * Form, int & Retry)
+{
+  try
+  {
+    CreateHandles(Form);
+  }
+  catch (EOSError & E)
+  {
+    delete Form;
+    Form = NULL;
+
+    ++Retry;
+    if ((E.Message != Sysconst_SUnkOSError) ||
+        (Retry >= 10))
+    {
+      throw;
+    }
+  }
+  catch(...)
+  {
+    delete Form;
+  }
+
+  return Form;
+}

+ 16 - 0
windows/VCLCommon.h

@@ -39,5 +39,21 @@ void __fastcall UpdateFormPosition(TForm * Form, TPosition Position);
 void __fastcall ResizeForm(TForm * Form, int Width, int Height);
 void __fastcall SetCorrectFormParent(TForm * Form);
 void __fastcall InvokeHelp(TWinControl * Control);
+TForm * __fastcall _SafeFormValidate(TForm * Form, int & Retry);
+template<class FormType>
+FormType * __fastcall SafeFormCreate(TComponent * Owner)
+{
+  // FIX: Due to some bug in Theme Manager, certain forms randomly
+  // fails in call to ShowModal(), hence repeat the call until it succeeds.
+  int Retry = 0;
+  FormType * Form;
+  do
+  {
+    Form = dynamic_cast<FormType *>(_SafeFormValidate(new FormType(Owner), Retry));
+  }
+  while (Form == NULL);
+
+  return Form;
+}
 //---------------------------------------------------------------------------
 #endif  // VCLCommonH

+ 15 - 7
windows/WinConfiguration.cpp

@@ -508,7 +508,7 @@ void __fastcall TWinConfiguration::DefaultLocalized()
   if (FCustomCommandsDefaults)
   {
     FCustomCommands->Clear();
-    FCustomCommands->Values[LoadStr(CUSTOM_COMMAND_EXECUTE)] = "\"!\"";
+    FCustomCommands->Values[LoadStr(CUSTOM_COMMAND_EXECUTE)] = "\"./!\"";
     FCustomCommands->Params[LoadStr(CUSTOM_COMMAND_EXECUTE)] = 0;
     FCustomCommands->Values[LoadStr(CUSTOM_COMMAND_TOUCH)] = "touch \"!\"";
     FCustomCommands->Params[LoadStr(CUSTOM_COMMAND_TOUCH)] = ccApplyToDirectories | ccRecursive;
@@ -954,12 +954,20 @@ bool __fastcall TWinConfiguration::GetDDExtInstalled()
 {
   if (FDDExtInstalled < 0)
   {
-    void* DragExtRef;
-    bool Result;
-    Result = (CoCreateInstance(CLSID_ShellExtension, NULL,
-      CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IID_IUnknown,
-      &DragExtRef) == S_OK);
-    FDDExtInstalled = (Result ? 1 : 0);
+    if (IsWin64())
+    {
+      // temporarily consider dragext always present of 64-bit system
+      FDDExtInstalled = 1;
+    }
+    else
+    {
+      void* DragExtRef;
+      bool Result;
+      Result = (CoCreateInstance(CLSID_ShellExtension, NULL,
+        CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IID_IUnknown,
+        &DragExtRef) == S_OK);
+      FDDExtInstalled = (Result ? 1 : 0);
+    }
   }
   return (FDDExtInstalled > 0);
 }

+ 198 - 0
windows/Windows.rc

@@ -1,4 +1,6 @@
+#ifndef NO_FILEZILLA
 #include "..\\resource\\TextsFileZilla.rc"
+#endif
 #include "..\\resource\\TextsCore1.rc"
 #include "..\\resource\\TextsCore2.rc"
 #include "..\\resource\\TextsWin1.rc"
@@ -9,6 +11,202 @@
 LICENCE RCDATA "Licence.txt"
 LICENCE_PUTTY RCDATA "LicencePuTTY.txt"
 
+#ifndef IDE
+MAINICON ICON
+MOVEABLE PURE LOADONCALL DISCARDABLE
+LANGUAGE LANG_NEUTRAL, 0
+BEGIN
+'00 00 01 00 02 00 20 20 00 00 00 00 00 00 A8 08 '
+'00 00 26 00 00 00 20 20 10 00 00 00 00 00 E8 02 '
+'00 00 CE 08 00 00 28 00 00 00 20 00 00 00 40 00 '
+'00 00 01 00 08 00 00 00 00 00 00 04 00 00 00 00 '
+'00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 '
+'00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00 '
+'00 00 80 00 80 00 80 80 00 00 C0 C0 C0 00 C0 DC '
+'C0 00 F0 CA A6 00 33 00 00 00 00 00 33 00 33 00 '
+'33 00 33 33 00 00 16 16 16 00 1C 1C 1C 00 22 22 '
+'22 00 29 29 29 00 55 55 55 00 4D 4D 4D 00 42 42 '
+'42 00 39 39 39 00 80 7C FF 00 50 50 FF 00 93 00 '
+'D6 00 FF EC CC 00 C6 D6 EF 00 D6 E7 E7 00 90 A9 '
+'AD 00 00 FF 33 00 00 00 66 00 00 00 99 00 00 00 '
+'CC 00 00 33 00 00 00 33 33 00 00 33 66 00 00 33 '
+'99 00 00 33 CC 00 00 33 FF 00 00 66 00 00 00 66 '
+'33 00 00 66 66 00 00 66 99 00 00 66 CC 00 00 66 '
+'FF 00 00 99 00 00 00 99 33 00 00 99 66 00 00 99 '
+'99 00 00 99 CC 00 00 99 FF 00 00 CC 00 00 00 CC '
+'33 00 00 CC 66 00 00 CC 99 00 00 CC CC 00 00 CC '
+'FF 00 00 FF 66 00 00 FF 99 00 00 FF CC 00 33 FF '
+'00 00 FF 00 33 00 33 00 66 00 33 00 99 00 33 00 '
+'CC 00 33 00 FF 00 FF 33 00 00 33 33 33 00 33 33 '
+'66 00 33 33 99 00 33 33 CC 00 33 33 FF 00 33 66 '
+'00 00 33 66 33 00 33 66 66 00 33 66 99 00 33 66 '
+'CC 00 33 66 FF 00 33 99 00 00 33 99 33 00 33 99 '
+'66 00 33 99 99 00 33 99 CC 00 33 99 FF 00 33 CC '
+'00 00 33 CC 33 00 33 CC 66 00 33 CC 99 00 33 CC '
+'CC 00 33 CC FF 00 33 FF 33 00 33 FF 66 00 33 FF '
+'99 00 33 FF CC 00 33 FF FF 00 66 00 00 00 66 00 '
+'33 00 66 00 66 00 66 00 99 00 66 00 CC 00 66 00 '
+'FF 00 66 33 00 00 66 33 33 00 66 33 66 00 66 33 '
+'99 00 66 33 CC 00 66 33 FF 00 66 66 00 00 66 66 '
+'33 00 66 66 66 00 66 66 99 00 66 66 CC 00 66 99 '
+'00 00 66 99 33 00 66 99 66 00 66 99 99 00 66 99 '
+'CC 00 66 99 FF 00 66 CC 00 00 66 CC 33 00 66 CC '
+'99 00 66 CC CC 00 66 CC FF 00 66 FF 00 00 66 FF '
+'33 00 66 FF 99 00 66 FF CC 00 CC 00 FF 00 FF 00 '
+'CC 00 99 99 00 00 99 33 99 00 99 00 99 00 99 00 '
+'CC 00 99 00 00 00 99 33 33 00 99 00 66 00 99 33 '
+'CC 00 99 00 FF 00 99 66 00 00 99 66 33 00 99 33 '
+'66 00 99 66 99 00 99 66 CC 00 99 33 FF 00 99 99 '
+'33 00 99 99 66 00 99 99 99 00 99 99 CC 00 99 99 '
+'FF 00 99 CC 00 00 99 CC 33 00 66 CC 66 00 99 CC '
+'99 00 99 CC CC 00 99 CC FF 00 99 FF 00 00 99 FF '
+'33 00 99 CC 66 00 99 FF 99 00 99 FF CC 00 99 FF '
+'FF 00 CC 00 00 00 99 00 33 00 CC 00 66 00 CC 00 '
+'99 00 CC 00 CC 00 99 33 00 00 CC 33 33 00 CC 33 '
+'66 00 CC 33 99 00 CC 33 CC 00 CC 33 FF 00 CC 66 '
+'00 00 CC 66 33 00 99 66 66 00 CC 66 99 00 CC 66 '
+'CC 00 99 66 FF 00 CC 99 00 00 CC 99 33 00 CC 99 '
+'66 00 CC 99 99 00 CC 99 CC 00 CC 99 FF 00 CC CC '
+'00 00 CC CC 33 00 CC CC 66 00 CC CC 99 00 CC CC '
+'CC 00 CC CC FF 00 CC FF 00 00 CC FF 33 00 99 FF '
+'66 00 CC FF 99 00 CC FF CC 00 CC FF FF 00 CC 00 '
+'33 00 FF 00 66 00 FF 00 99 00 CC 33 00 00 FF 33 '
+'33 00 FF 33 66 00 FF 33 99 00 FF 33 CC 00 FF 33 '
+'FF 00 FF 66 00 00 FF 66 33 00 CC 66 66 00 FF 66 '
+'99 00 FF 66 CC 00 CC 66 FF 00 FF 99 00 00 FF 99 '
+'33 00 FF 99 66 00 FF 99 99 00 FF 99 CC 00 FF 99 '
+'FF 00 FF CC 00 00 FF CC 33 00 FF CC 66 00 FF CC '
+'99 00 FF CC CC 00 FF CC FF 00 FF FF 33 00 CC FF '
+'66 00 FF FF 99 00 FF FF CC 00 66 66 FF 00 66 FF '
+'66 00 66 FF FF 00 FF 66 66 00 FF 66 FF 00 FF FF '
+'66 00 21 00 A5 00 5F 5F 5F 00 77 77 77 00 86 86 '
+'86 00 96 96 96 00 CB CB CB 00 B2 B2 B2 00 D7 D7 '
+'D7 00 DD DD DD 00 E3 E3 E3 00 EA EA EA 00 F1 F1 '
+'F1 00 F8 F8 F8 00 F0 FB FF 00 A4 A0 A0 00 80 80 '
+'80 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00 '
+'00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA 00 '
+'00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 '
+'03 03 03 03 03 03 03 03 03 75 EC 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 03 '
+'03 03 03 03 03 03 03 03 03 75 01 75 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 75 '
+'75 75 75 75 75 75 75 75 75 9A 03 01 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 75 '
+'59 38 38 59 59 59 59 7A 75 1A 75 01 EC 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 '
+'01 01 01 01 01 01 01 01 01 01 9A 03 EA 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 75 01 03 '
+'01 01 01 01 01 01 01 01 01 01 03 75 01 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 EC 01 03 '
+'75 75 75 75 9A 9A 9A 75 03 75 01 01 01 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 EA 01 01 '
+'EC EC EC EC EC EC 75 1A 75 75 03 00 0E 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 EA '
+'F7 F7 EC EC EA EA 0D 75 75 75 75 01 EC 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 F7 '
+'07 07 F7 EC EC EA EA 75 75 75 75 01 EC 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 F3 07 F7 EC EA EA 75 75 75 75 01 EC 00 00 00 '
+'00 00 00 00 00 00 00 EA EA EA EA EA EA EA EA EA '
+'00 00 F2 07 EC EA EA 75 75 75 75 01 EC 00 00 00 '
+'00 00 00 00 00 00 00 EA 00 38 38 38 38 38 38 EA '
+'00 07 07 F7 EA EA EA 75 75 75 75 01 EA 00 00 00 '
+'F7 0E 0D 0D 0D 0D 00 EA 00 FB EA EA EA FB 38 EA '
+'00 01 01 01 01 01 01 03 03 75 75 01 EA 00 00 00 '
+'EA 8B AD AD AD AD 00 EA 00 FB FB EA FB FB 38 EA '
+'00 75 75 75 75 75 75 75 75 9A 75 01 EA 00 00 00 '
+'EA AD AD AD AD AD 00 EA 00 FB EA EA EA FB 38 EA '
+'00 59 59 38 59 59 7A 9A 1A F2 75 01 EA 00 00 00 '
+'EA F7 09 09 09 09 00 EA 00 FB FB EA FB FB 38 EA '
+'00 75 75 75 75 75 75 75 75 75 F2 75 EA 00 00 00 '
+'EA 0E EA EA EA 65 00 EA 00 00 00 00 00 00 00 EA '
+'00 75 75 75 75 75 75 75 75 75 75 9A EA 00 00 00 '
+'EA 8B 8B 8B 8B AD 00 EA EA EA EA EA EA EA EA EA '
+'00 01 01 01 01 01 01 01 01 01 01 01 EA 00 00 00 '
+'EA 8B F7 F7 F7 F7 F7 00 EA 00 EA 00 00 00 EA 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F7 '
+'65 EA F7 EC EC EA 0D 00 EA 00 EA EA 00 00 EA 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EC '
+'65 F7 08 07 F7 EC EA 00 EA 00 8B EA 00 00 EA 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA '
+'65 07 FF F3 07 EC EA EC 00 EA 00 00 00 EA 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA '
+'EA F7 F3 F2 07 EC EA EA AD 00 EA EA EA 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA '
+'AD EA EA EA EA EA EA EA AD 09 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EA '
+'09 09 09 09 09 09 09 09 09 F3 8B EA 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 EC '
+'EC F3 09 09 09 09 F3 F3 F3 F3 07 65 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'EC EC 09 09 09 09 09 09 09 09 F3 EC 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 EA EA EA EA EA EA EA EA 65 EA EA 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF '
+'FF FF FF FF 00 0F FF FF 00 07 FF FF 00 03 FF FF '
+'00 03 FF FF 00 01 FF FF 00 01 FF FE 00 01 FF FE '
+'00 01 FF FE 00 01 FF FE 00 01 FF FE 00 01 FF FF '
+'E0 01 FF 80 30 01 FF A0 20 01 C0 A0 20 01 C0 A0 '
+'20 01 C0 A0 20 01 C0 A0 20 01 C0 BF A0 01 C0 80 '
+'20 01 C0 53 7F FF 80 53 7F FF 80 53 7F FF 80 2E '
+'FF FF 80 11 FF FF 80 0F FF FF 80 03 FF FF 80 03 '
+'FF FF C0 03 FF FF E0 03 FF FF FF FF FF FF 28 00 '
+'00 00 20 00 00 00 40 00 00 00 01 00 04 00 00 00 '
+'00 00 00 02 00 00 00 00 00 00 00 00 00 00 10 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80 '
+'00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80 '
+'00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF '
+'00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF '
+'00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 71 11 '
+'11 11 11 11 00 00 00 00 00 00 00 00 00 00 11 11 '
+'17 11 17 18 70 00 00 00 00 00 00 00 00 00 17 77 '
+'77 77 77 78 18 00 00 00 00 00 00 00 00 00 17 77 '
+'77 77 77 78 71 00 00 00 00 00 00 00 00 00 18 BB '
+'BB BB BB 88 71 70 00 00 00 00 00 00 00 00 11 11 '
+'11 11 11 11 87 10 00 00 00 00 00 00 00 07 11 11 '
+'11 11 11 11 18 10 00 00 00 00 00 00 00 07 17 88 '
+'88 88 88 78 11 10 00 00 00 00 00 00 00 01 11 77 '
+'77 77 78 88 11 10 00 00 00 00 00 00 00 01 17 77 '
+'77 74 18 88 71 70 00 00 00 00 00 00 00 01 17 88 '
+'87 77 18 88 71 70 00 00 00 00 00 00 00 00 00 08 '
+'87 77 48 88 71 70 00 00 00 00 04 74 74 74 77 08 '
+'88 77 78 78 71 70 00 00 00 00 07 0B BB BB B7 08 '
+'87 77 17 78 71 70 00 71 11 11 07 0B 47 7B B4 01 '
+'11 11 11 78 71 70 00 77 77 77 04 0B B7 BB B7 08 '
+'88 88 88 88 71 70 00 77 78 77 07 0B 77 7B B7 0B '
+'BB BB B8 88 81 10 00 77 88 88 07 0B B7 BB B7 08 '
+'88 88 88 88 88 10 00 71 44 44 07 00 00 00 07 08 '
+'88 88 88 88 88 70 00 47 77 77 07 77 77 77 74 01 '
+'11 11 11 11 11 70 00 47 78 88 86 70 41 00 70 00 '
+'00 00 00 00 00 00 07 47 77 77 46 40 74 00 40 00 '
+'00 00 00 00 00 00 07 48 88 77 46 70 74 00 70 00 '
+'00 00 00 00 00 00 07 48 88 87 47 67 00 07 00 00 '
+'00 00 00 00 00 00 07 78 88 87 77 76 74 70 00 00 '
+'00 00 00 00 00 00 04 77 77 74 77 78 00 00 00 00 '
+'00 00 00 00 00 00 04 88 88 88 88 88 74 00 00 00 '
+'00 00 00 00 00 00 07 08 88 88 88 88 84 00 00 00 '
+'00 00 00 00 00 00 00 77 88 88 88 88 87 00 00 00 '
+'00 00 00 00 00 00 00 07 47 74 44 44 47 00 00 00 '
+'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 '
+'00 00 00 00 00 00 FF FF FF FF FF FF 00 0F FF FF '
+'00 07 FF FF 00 03 FF FF 00 03 FF FF 00 01 FF FF '
+'00 01 FF FE 00 01 FF FE 00 01 FF FE 00 01 FF FE '
+'00 01 FF FE 00 01 FF FF E0 01 FF 80 20 01 FF A0 '
+'20 01 C0 A0 20 01 C0 A0 20 01 C0 A0 20 01 C0 A0 '
+'20 01 C0 BF A0 01 C0 80 20 01 C0 13 7F FF 80 13 '
+'7F FF 80 13 7F FF 80 0E FF FF 80 01 FF FF 80 0F '
+'FF FF 80 03 FF FF 80 03 FF FF C0 03 FF FF E0 03 '
+'FF FF FF FF FF FF '
+END
+#endif
+
 X_GREENKEY ICON
 MOVEABLE PURE LOADONCALL DISCARDABLE
 LANGUAGE LANG_NEUTRAL, 0