OSDN Git Service

initial commit from 1.97b zip archive master
authorhylom <hylom@users.sourceforge.jp>
Thu, 1 Sep 2011 04:44:19 +0000 (13:44 +0900)
committerhylom <hylom@users.sourceforge.jp>
Thu, 1 Sep 2011 04:44:19 +0000 (13:44 +0900)
246 files changed:
FFFTP.chm [new file with mode: 0644]
FFFTP.exe [new file with mode: 0644]
FFFTP.sln [new file with mode: 0644]
FFFTP.txt [new file with mode: 0644]
FFFTP.vcproj [new file with mode: 0644]
FFFTP_English.vcproj [new file with mode: 0644]
JRE32.DLL [new file with mode: 0644]
OLDregistory.c [new file with mode: 0644]
OleDragDrop.c [new file with mode: 0644]
OleDragDrop.h [new file with mode: 0644]
Resource/FFFTP.APS [new file with mode: 0644]
Resource/FFFTP.rc [new file with mode: 0644]
Resource/Thumbs.db [new file with mode: 0644]
Resource/bitmap1.bmp [new file with mode: 0644]
Resource/cursor1.cur [new file with mode: 0644]
Resource/cursor2.cur [new file with mode: 0644]
Resource/drag_csr.cur [new file with mode: 0644]
Resource/ffftp.exe.manifest [new file with mode: 0644]
Resource/icon1.ico [new file with mode: 0644]
Resource/icon2.ico [new file with mode: 0644]
Resource/list_bmp.bmp [new file with mode: 0644]
Resource/main_too.bmp [new file with mode: 0644]
Resource/nodrop_c.cur [new file with mode: 0644]
Resource/resource.h [new file with mode: 0644]
Resource/toolbar1.bmp [new file with mode: 0644]
Resource_eng/FFFTP-eng.aps [new file with mode: 0644]
Resource_eng/FFFTP-eng.rc [new file with mode: 0644]
Resource_eng/Thumbs.db [new file with mode: 0644]
Resource_eng/bitmap1.bmp [new file with mode: 0644]
Resource_eng/cursor1.cur [new file with mode: 0644]
Resource_eng/cursor2.cur [new file with mode: 0644]
Resource_eng/drag_csr.cur [new file with mode: 0644]
Resource_eng/ffftp.exe.manifest [new file with mode: 0644]
Resource_eng/icon1.ico [new file with mode: 0644]
Resource_eng/icon2.ico [new file with mode: 0644]
Resource_eng/list_bmp.bmp [new file with mode: 0644]
Resource_eng/main_too.bmp [new file with mode: 0644]
Resource_eng/nodrop_c.cur [new file with mode: 0644]
Resource_eng/resource.h [new file with mode: 0644]
Resource_eng/toolbar1.bmp [new file with mode: 0644]
SourceCode.txt [new file with mode: 0644]
aes.h [new file with mode: 0644]
aes_modes.c [new file with mode: 0644]
aes_via_ace.h [new file with mode: 0644]
aescrypt.c [new file with mode: 0644]
aeskey.c [new file with mode: 0644]
aesopt.h [new file with mode: 0644]
aestab.c [new file with mode: 0644]
aestab.h [new file with mode: 0644]
bookmark.c [new file with mode: 0644]
brg_endian.h [new file with mode: 0644]
brg_types.h [new file with mode: 0644]
cache.c [new file with mode: 0644]
clipboard.c [new file with mode: 0644]
codecnv.c [new file with mode: 0644]
common.h [new file with mode: 0644]
config.h [new file with mode: 0644]
connect.c [new file with mode: 0644]
diskfree.c [new file with mode: 0644]
dlgsize.c [new file with mode: 0644]
filelist.c [new file with mode: 0644]
ftpproc.c [new file with mode: 0644]
getput.c [new file with mode: 0644]
helpid.h [new file with mode: 0644]
history.c [new file with mode: 0644]
history.txt [new file with mode: 0644]
hostman.c [new file with mode: 0644]
htmlhelp/FFFTP.$HP [new file with mode: 0644]
htmlhelp/FFFTP.CHM [new file with mode: 0644]
htmlhelp/FFFTP.HHC [new file with mode: 0644]
htmlhelp/FFFTP.HHK [new file with mode: 0644]
htmlhelp/FFFTP.HHP [new file with mode: 0644]
htmlhelp/FFFTP.KHP [new file with mode: 0644]
htmlhelp/HTML/H0000001.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000002.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000003.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000004.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000005.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000006.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000007.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000008.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000009.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000010.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000011.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000012.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000013.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000014.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000015.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000016.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000017.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000018.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000019.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000020.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000021.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000022.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000023.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000024.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000025.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000027.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000028.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000029.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000030.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000031.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000032.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000034.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000035.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000036.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000037.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000038.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000039.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000040.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000041.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000042.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000043.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000044.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000045.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000046.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000047.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000048.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000049.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000050.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000051.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000052.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000054.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000055.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000056.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000057.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000058.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000059.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000060.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000061.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000062.HTM [new file with mode: 0644]
htmlhelp/HTML/H0000064.HTM [new file with mode: 0644]
htmlhelp/helpid.h [new file with mode: 0644]
htmlhelp/pic/__OLD_dlg_opt_notify.png [new file with mode: 0644]
htmlhelp/pic/bmarkmenu.png [new file with mode: 0644]
htmlhelp/pic/btn_abort.png [new file with mode: 0644]
htmlhelp/pic/btn_asc.png [new file with mode: 0644]
htmlhelp/pic/btn_auto.png [new file with mode: 0644]
htmlhelp/pic/btn_bin.png [new file with mode: 0644]
htmlhelp/pic/btn_chdir.png [new file with mode: 0644]
htmlhelp/pic/btn_con.png [new file with mode: 0644]
htmlhelp/pic/btn_del.png [new file with mode: 0644]
htmlhelp/pic/btn_discon.png [new file with mode: 0644]
htmlhelp/pic/btn_down.png [new file with mode: 0644]
htmlhelp/pic/btn_euc.png [new file with mode: 0644]
htmlhelp/pic/btn_jis.png [new file with mode: 0644]
htmlhelp/pic/btn_list.png [new file with mode: 0644]
htmlhelp/pic/btn_mirrorup.png [new file with mode: 0644]
htmlhelp/pic/btn_mkdir.png [new file with mode: 0644]
htmlhelp/pic/btn_nocnv.png [new file with mode: 0644]
htmlhelp/pic/btn_quick.png [new file with mode: 0644]
htmlhelp/pic/btn_refresh.png [new file with mode: 0644]
htmlhelp/pic/btn_rename.png [new file with mode: 0644]
htmlhelp/pic/btn_report.png [new file with mode: 0644]
htmlhelp/pic/btn_sync.png [new file with mode: 0644]
htmlhelp/pic/btn_up.png [new file with mode: 0644]
htmlhelp/pic/btn_updir.png [new file with mode: 0644]
htmlhelp/pic/dlg_bmark_edit.png [new file with mode: 0644]
htmlhelp/pic/dlg_bookmark.png [new file with mode: 0644]
htmlhelp/pic/dlg_chattr.png [new file with mode: 0644]
htmlhelp/pic/dlg_defattr.png [new file with mode: 0644]
htmlhelp/pic/dlg_download.png [new file with mode: 0644]
htmlhelp/pic/dlg_downmirror_list.png [new file with mode: 0644]
htmlhelp/pic/dlg_downmirror_notify.png [new file with mode: 0644]
htmlhelp/pic/dlg_downnotify.png [new file with mode: 0644]
htmlhelp/pic/dlg_filter.png [new file with mode: 0644]
htmlhelp/pic/dlg_find.png [new file with mode: 0644]
htmlhelp/pic/dlg_hostcon.png [new file with mode: 0644]
htmlhelp/pic/dlg_hostlist.png [new file with mode: 0644]
htmlhelp/pic/dlg_hset_adv.png [new file with mode: 0644]
htmlhelp/pic/dlg_hset_adv2.png [new file with mode: 0644]
htmlhelp/pic/dlg_hset_code.png [new file with mode: 0644]
htmlhelp/pic/dlg_hset_dialup.png [new file with mode: 0644]
htmlhelp/pic/dlg_hset_main.png [new file with mode: 0644]
htmlhelp/pic/dlg_mailadrs.png [new file with mode: 0644]
htmlhelp/pic/dlg_mirror_list.png [new file with mode: 0644]
htmlhelp/pic/dlg_mirror_notify.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_connect.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_disp.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_fwall.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_mirror.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_misc.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_notify.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_sound.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_tool.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_tool_diff.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_trmode1.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_trmode2.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_trmode3.png [new file with mode: 0644]
htmlhelp/pic/dlg_opt_user.png [new file with mode: 0644]
htmlhelp/pic/dlg_otpcalc.png [new file with mode: 0644]
htmlhelp/pic/dlg_quick.png [new file with mode: 0644]
htmlhelp/pic/dlg_rasreconnect.png [new file with mode: 0644]
htmlhelp/pic/dlg_sel_local.png [new file with mode: 0644]
htmlhelp/pic/dlg_sel_remote.png [new file with mode: 0644]
htmlhelp/pic/dlg_sort.png [new file with mode: 0644]
htmlhelp/pic/dlg_upload.png [new file with mode: 0644]
htmlhelp/pic/dlg_upnotify.png [new file with mode: 0644]
htmlhelp/pic/hide_property.png [new file with mode: 0644]
htmlhelp/pic/hosttree_after.png [new file with mode: 0644]
htmlhelp/pic/main.png [new file with mode: 0644]
htmlhelp/pic/main_filter.png [new file with mode: 0644]
htmlhelp/pic/main_icon.png [new file with mode: 0644]
htmlhelp/pic/main_mirror.png [new file with mode: 0644]
htmlhelp/pic/main_sync.png [new file with mode: 0644]
htmlhelp/pic/main_tab.png [new file with mode: 0644]
htmlhelp/pic/main_tips.png [new file with mode: 0644]
htmlhelp/pic/menu_bookmark.png [new file with mode: 0644]
htmlhelp/pic/menu_command.png [new file with mode: 0644]
htmlhelp/pic/menu_connect.png [new file with mode: 0644]
htmlhelp/pic/menu_disp.png [new file with mode: 0644]
htmlhelp/pic/menu_help.png [new file with mode: 0644]
htmlhelp/pic/menu_option.png [new file with mode: 0644]
htmlhelp/pic/menu_tool.png [new file with mode: 0644]
htmlhelp/pic/proxy.png [new file with mode: 0644]
htmlhelp/pic/rcvsts.png [new file with mode: 0644]
htmlhelp/pic/sym_batu.png [new file with mode: 0644]
htmlhelp/pic/sym_maru.png [new file with mode: 0644]
jreusr.h [new file with mode: 0644]
local.c [new file with mode: 0644]
lvtips.c [new file with mode: 0644]
main.c [new file with mode: 0644]
md4.c [new file with mode: 0644]
md4.h [new file with mode: 0644]
md5.c [new file with mode: 0644]
md5.h [new file with mode: 0644]
mesg-eng.h [new file with mode: 0644]
mesg-jpn.h [new file with mode: 0644]
misc.c [new file with mode: 0644]
option.c [new file with mode: 0644]
ras.c [new file with mode: 0644]
regexp.c [new file with mode: 0644]
registory.c [new file with mode: 0644]
remote.c [new file with mode: 0644]
sample.h [new file with mode: 0644]
sha.c [new file with mode: 0644]
sha.h [new file with mode: 0644]
skey.c [new file with mode: 0644]
socket.c [new file with mode: 0644]
statuswin.c [new file with mode: 0644]
taskwin.c [new file with mode: 0644]
tool.c [new file with mode: 0644]
toolmenu.c [new file with mode: 0644]
updatebell.c [new file with mode: 0644]
wildcard.c [new file with mode: 0644]

diff --git a/FFFTP.chm b/FFFTP.chm
new file mode 100644 (file)
index 0000000..03a6b14
Binary files /dev/null and b/FFFTP.chm differ
diff --git a/FFFTP.exe b/FFFTP.exe
new file mode 100644 (file)
index 0000000..65ca710
Binary files /dev/null and b/FFFTP.exe differ
diff --git a/FFFTP.sln b/FFFTP.sln
new file mode 100644 (file)
index 0000000..1de1a58
--- /dev/null
+++ b/FFFTP.sln
@@ -0,0 +1,25 @@
+Microsoft Visual Studio Solution File, Format Version 9.00\r
+# Visual Studio 2005\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FFFTP", "FFFTP.vcproj", "{5D9496DB-45AF-4389-8FEE-27C9A2FA207A}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FFFTP_English", "FFFTP_English.vcproj", "{EE7CC1BD-92A9-46D5-8270-386BD7BEEA55}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {5D9496DB-45AF-4389-8FEE-27C9A2FA207A}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {5D9496DB-45AF-4389-8FEE-27C9A2FA207A}.Debug|Win32.Build.0 = Debug|Win32\r
+               {5D9496DB-45AF-4389-8FEE-27C9A2FA207A}.Release|Win32.ActiveCfg = Release|Win32\r
+               {5D9496DB-45AF-4389-8FEE-27C9A2FA207A}.Release|Win32.Build.0 = Release|Win32\r
+               {EE7CC1BD-92A9-46D5-8270-386BD7BEEA55}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {EE7CC1BD-92A9-46D5-8270-386BD7BEEA55}.Debug|Win32.Build.0 = Debug|Win32\r
+               {EE7CC1BD-92A9-46D5-8270-386BD7BEEA55}.Release|Win32.ActiveCfg = Release|Win32\r
+               {EE7CC1BD-92A9-46D5-8270-386BD7BEEA55}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/FFFTP.txt b/FFFTP.txt
new file mode 100644 (file)
index 0000000..92c71a7
--- /dev/null
+++ b/FFFTP.txt
@@ -0,0 +1,171 @@
+============================================================\r
+\81y\83\\83t\83g\96¼\81z\81@\82e\82s\82o\83N\83\89\83C\83A\83\93\83g\81@\82e\82e\82e\82s\82o  Ver 1.97b\r
+\81y\93®\8dì\8am\94F\8aÂ\8b«\81z\81@Windows 7, Vista, XP, 2000\r
+\81y\83T\83|\81[\83g\81z\81@http://www2.biglobe.ne.jp/~sota/\r
+============================================================\r
+\r
+\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82É\82Â\82¢\82Ä\r
+--------------------------\r
+\r
+Ver.1.96d+009\88È\8d~\82Å\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82ð\93±\93ü\82µ\82Ü\82µ\82½\81B\r
+\r
+FFFTP Ver.1.96d+009\88È\8d~\82ð\8dÅ\8f\89\82É\8bN\93®\82µ\82½\8e\9e\81A\90Ú\91±\83\81\83j\83\85\81[\82Ì\90Ý\92è\81¨\r
+\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82Ì\90Ý\92è\82Å\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82ð\90Ý\92è\82µ\82Ä\8eg\97p\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82ð\90Ý\92è\82·\82é\82Æ\81AFFFTP\8bN\93®\8e\9e\82É\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82Ì\93ü\97Í\82ª\r
+\8b\81\82ß\82ç\82ê\82Ü\82·\82Ì\82Å\81A\93ü\97Í\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+\r
+Ver 1.97b\82Å\82Ì\95Ï\8dX\93_\r
+-------------------\r
+\r
+\81E\83z\83X\83g\91¤\82©\82ç\83G\83N\83X\83v\83\8d\81[\83\89\82É\83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\82µ\82½\8e\9e\81A\83t\83@\83C\83\8b\82â\83t\83H\83\8b\83_\82ð\r
+\81@2\82Â\88È\8fã\91I\91ð\82µ\82Ä\82¢\82½\8fê\8d\87\82É\81A\90³\8fí\82É\93®\8dì\82µ\82È\82¢\8fê\8d\87\82ª\82 \82é\82Ì\82ð\8fC\90³\82µ\82Ü\82µ\82½\81B\r
+\81@\81iWindows 7\82ÆVista\82Å\82Í\81A\83t\83@\83C\83\8b\82ª\82È\82¢\82Æ\82¢\82¤\83G\83\89\81[\82ª\95\\8e¦\82³\82ê\82Ü\82·\81B\r
+\81@Widnows XP\82Å\82Í\81A\83G\83N\83X\83v\83\8d\81[\83\89\82ª\96³\94½\89\9e\82É\82È\82è\82Ü\82·\81B\81j\r
+\r
+\r
+Ver 1.96d\88È\91O\82Ö\96ß\82·\8fê\8d\87\r
+-----------------------\r
+\r
+\82±\82Ì\83o\81[\83W\83\87\83\93\82ð\8eg\97p\82µ\82½\82 \82Æ\82Å1.96d\88È\91O\82Ì\83o\81[\83W\83\87\83\93\82É\96ß\82µ\82½\8fê\8d\87\81A\r
+\83z\83X\83g\82Ì\90Ý\92è\82Ì\83p\83X\83\8f\81[\83h\82Í\93ü\97Í\82µ\92¼\82·\95K\97v\82ª\82 \82è\82Ü\82·\81B\r
+\r
+\r
+FFFTP\82Ì\8aT\97v\r
+-----------\r
+\r
+\82f\82t\82h\82È\82e\82s\82o\83N\83\89\83C\83A\83\93\83g\83\\83t\83g\82Å\82·\81B\r
+\r
+\81\99\83t\83@\83C\83\8b\83\8a\83X\83g\82Ì\95\94\95ª\82Æ\83t\83@\83C\83\8b\93]\91\97\82ª\95Ê\83X\83\8c\83b\83h\82È\82Ì\82Å\81A\83t\83@\83C\83\8b\93]\91\97\82ð\r
+\81@\82µ\82È\82ª\82ç\90V\82½\82È\83t\83@\83C\83\8b\91\80\8dì\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\81\99\83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\8b@\94\\82É\82æ\82è\81A\83\8d\81[\83J\83\8b\82Ì\83t\83@\83C\83\8b\8d\\90¬\82Æ\93¯\82\95¨\82ð\r
+\81@\83z\83X\83g\91¤\82É\8dì\82é\82±\82Æ\82ª\8fo\97\88\82Ü\82·\81B\r
+\r
+\81\99\8a¿\8e\9a\83R\81[\83h\82Ì\95Ï\8a·\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\81\99\8a¿\8e\9a\82Ì\83t\83@\83C\83\8b\96¼\82ð\88µ\82¤\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\81\99\83T\83u\83f\83B\83\8c\83N\83g\83\8a\82ð\8aÜ\82ß\82½\83t\83@\83C\83\8b\82Ì\93]\91\97\82ª\82Å\82«\82Ü\82·\81B\r
+\r
+\81\99\83t\83@\83C\83\8b\82Ì\93]\91\97\82ð\81A\82¢\82Â\82Å\82à\92\86\92f\82Å\82«\82Ü\82·\81B\r
+\81@\82Ü\82½\81A\88È\91O\83_\83E\83\93\83\8d\81[\83h\82ð\92\86\92f\82µ\82½\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\81A\82»\82Ì\91±\82«\82ð\83_\83E\83\93\r
+\81@\83\8d\81[\83h\82Å\82«\82Ü\82·\81B\r
+\r
+\81\99\8ae\8eíFireWall\81ASOCKS\81A\83\8f\83\93\83^\83C\83\80\83p\83X\83\8f\81[\83h\82É\91Î\89\9e\82µ\82Ä\82¢\82Ü\82·\81B\r
+\r
+\r
+\83t\83@\83C\83\8b\8d\\90¬\r
+------------\r
+\r
+ffftp.exe -------- \8eÀ\8ds\83t\83@\83C\83\8b\r
+ffftp.hlp -------- \83w\83\8b\83v\83t\83@\83C\83\8b\r
+ffftp.cnt -------- \81@\81V\r
+ffftp.txt -------- \82±\82Ì\83t\83@\83C\83\8b\r
+history.txt ------ \89ü\94Å\97\9a\97ð\r
+jre32.dll -------- \90³\8bK\95\\8c»\8c\9f\8dõ\82c\82k\82k\r
+\r
+\r
+\83A\83\93\83C\83\93\83X\83g\81[\83\8b\95û\96@\r
+--------------------\r
+\r
+\81¡Windows Vista\r
+\83R\83\93\83g\83\8d\81[\83\8b\83p\83l\83\8b\82Ì\81u\83v\83\8d\83O\83\89\83\80\82Æ\8b@\94\\81v\82Å\83A\83\93\83C\83\93\83X\83g\81[\83\8b\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+\81¡Windows XP, 2000, 98, Me\r
+\83R\83\93\83g\83\8d\81[\83\8b\83p\83l\83\8b\82Ì\81u\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\92Ç\89Á\82Æ\8dí\8f\9c\81v\82Å\83A\83\93\83C\83\93\83X\83g\81[\83\8b\r
+\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+\r
+\82²\97\98\97p\82É\82 \82½\82è\r
+--------------\r
+\r
+\81EFFFTP\82Í\83t\83\8a\81[\81E\83\\83t\83g\83E\83G\83A\82Å\82·\81B\8cÂ\90l\8eg\97p\81A\8bÆ\96±\8eg\97p\82Ì\82¢\82¸\82ê\82Å\82à\81A\r
+\81@\82²\8e©\97R\82É\82²\97\98\97p\82­\82¾\82³\82¢\81B\r
+\r
+\81E\83\\83t\83g\83E\83G\83A\82Í\8f\\95ª\82É\83e\83X\83g\82ð\82µ\82Ä\82¢\82Ü\82·\82ª\81A\82¨\8eg\82¢\82Ì\83p\83\\83R\83\93\8aÂ\8b«\82â\81A\r
+\81@\83v\83\8d\83O\83\89\83\80\82Ì\95s\8bï\8d\87\82È\82Ç\82É\82æ\82Á\82Ä\96â\91è\82ª\90\82\82é\8fê\8d\87\82ª\82 \82è\82Ü\82·\81B\82»\82ê\82É\82æ\82è\r
+\81@\91¹\8aQ\82ª\90\82\82Ä\82à\81A\91¹\8aQ\82É\91Î\82·\82é\95Û\8fØ\82Í\8fo\97\88\82©\82Ë\82Ü\82·\82Ì\82Å\81A\82 \82ç\82©\82\82ß\82²\97¹\8f³\r
+\81@\82­\82¾\82³\82¢\81B\r
+\r
+\81E\8fÚ\8d×\82Í\83\89\83C\83Z\83\93\83X\82ð\82²\97\97\82­\82¾\82³\82¢\81B\r
+\r
+\r
+\83\89\83C\83Z\83\93\83X\r
+----------\r
+\r
+\96{\83\\83t\83g\83E\83G\83A\82¨\82æ\82Ñ\82»\82Ì\83\\81[\83X\83R\81[\83h\82Í\81A\8fC\90³BSD\83\89\83C\83Z\83\93\83X\82É\8f]\82¤\82à\82Ì\82Æ\r
+\82µ\82Ü\82·\81B\r
+\r
+Copyright(C) 1997-2010, Sota & cooperators. All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without \r
+modification, are permitted provided that the following conditions \r
+are met:\r
+\r
+ 1. Redistributions of source code must retain the above copyright \r
+    notice, this list of conditions and the following disclaimer.\r
+ 2. Redistributions in binary form must reproduce the above copyright \r
+    notice, this list of conditions and the following disclaimer in the \r
+    documentation and/or other materials provided with the distribution.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR \r
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES \r
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, \r
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF \r
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*** \88È\89º\82Í\93ú\96{\8cê\96ó(\8eQ\8dl) ***\r
+\r
+Copyright(C) 1997-2010 Sota & \82²\8b¦\97Í\82¢\82½\82¾\82¢\82½\95û\81X. All rights reserved.\r
+\r
+\83\\81[\83X\83R\81[\83h\8c`\8e®\82Å\82à\83o\83C\83i\83\8a\8c`\8e®\82Å\82à\81A\95Ï\8dX\82Ì\97L\96³\82É\8aÖ\82í\82ç\82¸\81A\88È\89º\82Ì\8fð\8c\8f\82ð\r
+\96\9e\82½\82·\8fê\8d\87\82É\81A\8dÄ\94z\95z\82¨\82æ\82Ñ\8eg\97p\82ð\8b\96\89Â\82µ\82Ü\82·\81B\r
+\r
+ 1. \83\\81[\83X\83R\81[\83h\8c`\8e®\82Å\8dÄ\94z\95z\82·\82é\8fê\8d\87\81A\8fã\8bL\92\98\8dì\8c \95\\8e¦\81A\96{\8fð\8c\8f\82¨\82æ\82Ñ\89º\8bL\r
+    \90Ó\94C\8cÀ\92è\8bK\92è\82ð\95K\82¸\8aÜ\82ß\82Ä\82­\82¾\82³\82¢\81B\r
+ 2. \83o\83C\83i\83\8a\8c`\8e®\82Å\8dÄ\94z\95z\82·\82é\8fê\8d\87\81A\8fã\8bL\92\98\8dì\8c \95\\8e¦\81A\96{\8fð\8c\8f\82¨\82æ\82Ñ\89º\8bL\90Ó\94C\r
+    \8cÀ\92è\8bK\92è\82ð\81A\94z\95z\95¨\82Æ\8b¤\82É\92ñ\8b\9f\82³\82ê\82é\95\8f\91\82¨\82æ\82Ñ/\82Ü\82½\82Í\91¼\82Ì\8e\91\97¿\82É\95K\82¸\r
+    \8aÜ\82ß\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+\96{\83\\83t\83g\83E\83F\83A\82Í\81A\92\98\8dì\8c \8eÒ\82É\82æ\82Á\82Ä\81u\8c»\8fó\82Ì\82Ü\82Ü\81v\92ñ\8b\9f\82³\82ê\82é\82à\82Ì\82Æ\82µ\81\r
+\96¾\8e¦\96Ù\8e¦\82ð\96â\82í\82¸\81A\8f¤\95i\82Æ\82µ\82Ä\92Ê\8fí\8aú\91Ò\82³\82ê\82é\95i\8e¿\82ð\94õ\82¦\82Ä\82¢\82é\82Æ\82¢\82¤\95Û\8fØ\82â\81A\r
+\93Á\92è\82Ì\96Ú\93I\82É\93K\8d\87\82·\82é\82Æ\82Ì\95Û\8fØ\82ð\8aÜ\82ß\81A\89½\82Ì\95Û\8fØ\82à\82È\82³\82ê\82Ü\82¹\82ñ\81B\r
+\8e\96\97R\82â\91¹\8aQ\94­\90\82Ì\8c´\88ö\82Ì\94@\89½\82ð\96â\82í\82¸\81A\8a\8e\82Â\90Ó\94C\82Ì\8dª\8b\92\82ª\8c_\96ñ\81A\8cµ\8ai\90Ó\94C\81A\r
+\95s\96@\8ds\88×\81i\89ß\8e¸\82È\82Ç\82ð\8aÜ\82Þ\81j\82Å\82 \82é\82©\82ð\96â\82í\82¸\81A\89¼\82É\82»\82Ì\82æ\82¤\82È\91¹\8aQ\82ª\94­\90\82·\82é\r
+\89Â\94\\90«\82ð\92m\82ç\82³\82ê\82Ä\82¢\82½\82Æ\82µ\82Ä\82à\81A\96{\83\\83t\83g\83E\83F\83A\82Ì\8eg\97p\82©\82ç\94­\90\82µ\82½\92¼\90Ú\91¹\8aQ\81A\r
+\8aÔ\90Ú\91¹\8aQ\81A\8bô\94­\93I\82È\91¹\8aQ\81A\93Á\95Ê\91¹\8aQ\81A\92¦\94±\93I\91¹\8aQ\82Ü\82½\82Í\8c\8b\89Ê\91¹\8aQ\82Ì\82¢\82¸\82ê\82É\r
+\91Î\82µ\82Ä\82à\81i\91ã\91Ö\95i\82Ü\82½\82Í\83T\81[\83r\83X\82Ì\92²\92B\81A\8eg\97p\8b@\89ï\82â\83f\81[\83^\81A\97\98\89v\82Ì\91¹\8e¸\82Ì\r
+\95â\8f\9e\81A\82Ü\82½\82Í\8bÆ\96±\82Ì\92\86\92f\82É\91Î\82·\82é\95â\8f\9e\82ð\8aÜ\82ß\81j\81A\92\98\8dì\8c \8eÒ\82Í\90Ó\94C\82ð\82¢\82Á\82³\82¢\95\89\82¢\r
+\82Ü\82¹\82ñ\81B\r
+\r
+\r
+AES\88Ã\8d\86\89»\82Ì\83R\81[\83h\82É\82Â\82¢\82Ä\82Í\81A\88È\89º\82Ì\83\89\83C\83Z\83\93\83X\82Æ\82È\82è\82Ü\82·\81B\r
+\r
+Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved.\r
+\r
+LICENSE TERMS\r
+\r
+The redistribution and use of this software (with or without changes)\r
+is allowed without the payment of fees or royalties provided that:\r
+\r
+1. source code distributions include the above copyright notice, this\r
+list of conditions and the following disclaimer;\r
+\r
+2. binary distributions include the above copyright notice, this list\r
+of conditions and the following disclaimer in their documentation;\r
+\r
+3. the name of the copyright holder is not used to endorse products\r
+built using this software without specific written permission.\r
+\r
+DISCLAIMER\r
+\r
+This software is provided 'as is' with no explicit or implied warranties\r
+in respect of its properties, including, but not limited to, correctness\r
+and/or fitness for purpose.\r
+\r
diff --git a/FFFTP.vcproj b/FFFTP.vcproj
new file mode 100644 (file)
index 0000000..503a503
--- /dev/null
@@ -0,0 +1,443 @@
+<?xml version="1.0" encoding="shift_jis"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="FFFTP"\r
+       ProjectGUID="{5D9496DB-45AF-4389-8FEE-27C9A2FA207A}"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="."\r
+                       IntermediateDirectory=".\debug"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               MkTypLibCompatible="true"\r
+                               SuppressStartupBanner="true"\r
+                               TargetEnvironment="1"\r
+                               TypeLibraryName="./FFFTP.tlb"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="Resource"\r
+                               PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,_WIN32_IE=0x300,_CRT_SECURE_NO_WARNINGS"\r
+                               RuntimeLibrary="1"\r
+                               PrecompiledHeaderFile=".\debug/FFFTP.pch"\r
+                               AssemblerListingLocation=".\debug/"\r
+                               ObjectFile=".\debug/"\r
+                               ProgramDataBaseFileName=".\debug/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1041"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalOptions="/MACHINE:I386"\r
+                               AdditionalDependencies="wsock32.lib comctl32.lib winmm.lib htmlhelp.lib"\r
+                               OutputFile="./FFFTP.exe"\r
+                               LinkIncremental="2"\r
+                               SuppressStartupBanner="true"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile="./FFFTP.pdb"\r
+                               SubSystem="2"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="."\r
+                       IntermediateDirectory=".\Release"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               MkTypLibCompatible="true"\r
+                               SuppressStartupBanner="true"\r
+                               TargetEnvironment="1"\r
+                               TypeLibraryName="./FFFTP.tlb"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories="Resource"\r
+                               PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,_WIN32_IE=0x300,_CRT_SECURE_NO_WARNINGS"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="0"\r
+                               EnableFunctionLevelLinking="true"\r
+                               PrecompiledHeaderFile=".\Release/FFFTP.pch"\r
+                               AssemblerListingLocation=".\Release/"\r
+                               ObjectFile=".\Release/"\r
+                               ProgramDataBaseFileName=".\Release/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="0"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1041"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalOptions="/MACHINE:I386"\r
+                               AdditionalDependencies="wsock32.lib comctl32.lib winmm.lib RASAPI32.LIB htmlhelp.lib"\r
+                               OutputFile="./FFFTP.exe"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="true"\r
+                               GenerateDebugInformation="false"\r
+                               ProgramDatabaseFile="./FFFTP.pdb"\r
+                               SubSystem="2"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\aes_modes.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\aescrypt.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\aeskey.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\aestab.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\bookmark.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\cache.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\clipboard.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\codecnv.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\connect.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\diskfree.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\dlgsize.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\ffftp.rc"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\filelist.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ftpproc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\getput.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\history.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hostman.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\local.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lvtips.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\main.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\md4.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\md5.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\misc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\OleDragDrop.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\option.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ras.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\regexp.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\registory.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\remote.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\sha.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\skey.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\socket.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\statuswin.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\taskwin.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\tool.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\toolmenu.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\updatebell.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\wildcard.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;fi;fd"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\common.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\resource.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\Resource\bitmap1.bmp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\cursor1.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\cursor2.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\drag_csr.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\ico00001.ico"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\icon1.ico"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\icon2.ico"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\list_bmp.bmp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\main_too.bmp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\nodrop_c.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource\toolbar1.bmp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <File\r
+                       RelativePath=".\Resource\ffftp.exe.manifest"\r
+                       >\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32"\r
+                               ExcludedFromBuild="true"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                               />\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                               />\r
+                       </FileConfiguration>\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/FFFTP_English.vcproj b/FFFTP_English.vcproj
new file mode 100644 (file)
index 0000000..484fe3e
--- /dev/null
@@ -0,0 +1,439 @@
+<?xml version="1.0" encoding="shift_jis"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="FFFTP_English"\r
+       ProjectGUID="{EE7CC1BD-92A9-46D5-8270-386BD7BEEA55}"\r
+       RootNamespace="FFFTP_English"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory=".\FFFTP_Eng_Release"\r
+                       IntermediateDirectory=".\FFFTP_Eng_Release"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               MkTypLibCompatible="true"\r
+                               SuppressStartupBanner="true"\r
+                               TargetEnvironment="1"\r
+                               TypeLibraryName=".\FFFTP_Eng_Release/FFFTP_English.tlb"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories="Resource_eng"\r
+                               PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS,_WIN32_IE=0x300,_CRT_SECURE_NO_WARNINGS,ENGLISH"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="0"\r
+                               EnableFunctionLevelLinking="true"\r
+                               PrecompiledHeaderFile=".\FFFTP_Eng_Release/FFFTP_English.pch"\r
+                               AssemblerListingLocation=".\FFFTP_Eng_Release/"\r
+                               ObjectFile=".\FFFTP_Eng_Release/"\r
+                               ProgramDataBaseFileName=".\FFFTP_Eng_Release/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalOptions="/MACHINE:I386"\r
+                               AdditionalDependencies="wsock32.lib comctl32.lib winmm.lib htmlhelp.lib"\r
+                               OutputFile="FFFTP_Eng_Release/FFFTP.exe"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="true"\r
+                               ProgramDatabaseFile=".\FFFTP_Eng_Release/FFFTP.pdb"\r
+                               SubSystem="2"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory=".\FFFTP_Eng_Debug"\r
+                       IntermediateDirectory=".\FFFTP_Eng_Debug"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               MkTypLibCompatible="true"\r
+                               SuppressStartupBanner="true"\r
+                               TargetEnvironment="1"\r
+                               TypeLibraryName=".\FFFTP_Eng_Debug/FFFTP_English.tlb"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="Resource_eng"\r
+                               PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,_WIN32_IE=0x300,_CRT_SECURE_NO_WARNINGS,ENGLISH"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="1"\r
+                               PrecompiledHeaderFile=".\FFFTP_Eng_Debug/FFFTP_English.pch"\r
+                               AssemblerListingLocation=".\FFFTP_Eng_Debug/"\r
+                               ObjectFile=".\FFFTP_Eng_Debug/"\r
+                               ProgramDataBaseFileName=".\FFFTP_Eng_Debug/"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalOptions="/MACHINE:I386"\r
+                               AdditionalDependencies="wsock32.lib comctl32.lib winmm.lib htmlhelp.lib"\r
+                               OutputFile="FFFTP_Eng_Debug/FFFTP.exe"\r
+                               LinkIncremental="2"\r
+                               SuppressStartupBanner="true"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile=".\FFFTP_Eng_Debug/FFFTP.pdb"\r
+                               SubSystem="2"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\aes_modes.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\aescrypt.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\aeskey.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\aestab.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\bookmark.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\cache.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\clipboard.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\codecnv.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\connect.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\diskfree.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\dlgsize.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\FFFTP-eng.rc"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\filelist.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ftpproc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\getput.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\history.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\hostman.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\local.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\lvtips.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\main.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\md4.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\md5.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\misc.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\OleDragDrop.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\option.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\ras.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\regexp.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\registory.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\remote.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\sha.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\skey.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\socket.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\statuswin.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\taskwin.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\tool.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\toolmenu.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\updatebell.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\wildcard.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\common.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\resource.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\Resource_eng\bitmap1.bmp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\cursor1.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\cursor2.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\drag_csr.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\icon1.ico"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\icon2.ico"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\list_bmp.bmp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\main_too.bmp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\nodrop_c.cur"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\Resource_eng\toolbar1.bmp"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <File\r
+                       RelativePath=".\Resource_eng\ffftp.exe.manifest"\r
+                       >\r
+                       <FileConfiguration\r
+                               Name="Release|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                               />\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32"\r
+                               ExcludedFromBuild="true"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                               />\r
+                       </FileConfiguration>\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/JRE32.DLL b/JRE32.DLL
new file mode 100644 (file)
index 0000000..02f6564
Binary files /dev/null and b/JRE32.DLL differ
diff --git a/OLDregistory.c b/OLDregistory.c
new file mode 100644 (file)
index 0000000..888ea1d
--- /dev/null
@@ -0,0 +1,2364 @@
+/*=============================================================================\r
+*                                                              \83\8c\83W\83X\83g\83\8a\8aÖ\8cW\r
+*\r
+*\r
+===============================================================================\r
+/ Copyright (C) 1997-2007 Sota. All rights reserved.\r
+/\r
+/ Redistribution and use in source and binary forms, with or without \r
+/ modification, are permitted provided that the following conditions \r
+/ are met:\r
+/\r
+/  1. Redistributions of source code must retain the above copyright \r
+/     notice, this list of conditions and the following disclaimer.\r
+/  2. Redistributions in binary form must reproduce the above copyright \r
+/     notice, this list of conditions and the following disclaimer in the \r
+/     documentation and/or other materials provided with the distribution.\r
+/\r
+/ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR \r
+/ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES \r
+/ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
+/ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, \r
+/ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
+/ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
+/ USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
+/ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
+/ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF \r
+/ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+/============================================================================*/\r
+\r
+#define        STRICT\r
+#include <windows.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <time.h>\r
+#include <string.h>\r
+#include <windowsx.h>\r
+#include <process.h>\r
+\r
+#include "common.h"\r
+#include "resource.h"\r
+#include "sample.h"\r
+#include "sha.h"\r
+\r
+\r
+/*===== \83v\83\8d\83g\83^\83C\83v =====*/\r
+\r
+static void SaveStr(HKEY hKey, char *Key, char *Str, char *DefaultStr);\r
+static void SaveIntNum(HKEY hKey, char *Key, int Num, int DefaultNum);\r
+static void MakeFontData(LOGFONT Font, HFONT hFont, char *Buf);\r
+static int RestoreFontData(char *Str, LOGFONT *Font);\r
+\r
+static void EncodePassword(char *Str, char *Buf);\r
+static void EncodePasswordOriginal(char *Str, char *Buf);\r
+static void EncodePassword2(char *Str, char *Buf, const char* Key);\r
+\r
+static void DecodePassword(char *Str, char *Buf);\r
+static void DecodePasswordOriginal(char *Str, char *Buf);\r
+static void DecodePassword2(char *Str, char *Buf, const char* Key);\r
+\r
+static void SetRegType(int Type);\r
+static int OpenReg(char *Name, void **Handle);\r
+static int CreateReg(char *Name, void **Handle);\r
+static int CloseReg(void *Handle);\r
+static int OpenSubKey(void *Parent, char *Name, void **Handle);\r
+static int CreateSubKey(void *Parent, char *Name, void **Handle);\r
+static int CloseSubKey(void *Handle);\r
+static int DeleteSubKey(void *Handle, char *Name);\r
+static int DeleteValue(void *Handle, char *Name);\r
+static int ReadIntValueFromReg(void *Handle, char *Name, int *Value);\r
+static int WriteIntValueToReg(void *Handle, char *Name, int Value);\r
+static int ReadStringFromReg(void *Handle, char *Name, char *Str, DWORD Size);\r
+static int WriteStringToReg(void *Handle, char *Name, char *Str);\r
+static int ReadMultiStringFromReg(void *Handle, char *Name, char *Str, DWORD Size);\r
+static int WriteMultiStringToReg(void *Handle, char *Name, char *Str);\r
+static int ReadBinaryFromReg(void *Handle, char *Name, void *Bin, DWORD Size);\r
+static int WriteBinaryToReg(void *Handle, char *Name, void *Bin, int Len);\r
+\r
+int CheckPasswordValidity( char* Password, int length, const char* HashStr );\r
+void CreatePasswordHash( char* Password, int length, char* HashStr );\r
+void SetHashSalt( DWORD salt );\r
+\r
+\r
+/* 2010.01.30 genta \92Ç\89Á */\r
+static char SecretKey[FMAX_PATH+1];\r
+static int SecretKeyLength;\r
+static int IsMasterPasswordError = PASSWORD_OK;\r
+/*===== \8aO\95\94\8eQ\8fÆ =====*/\r
+\r
+/* \90Ý\92è\92l */\r
+extern int WinPosX;\r
+extern int WinPosY;\r
+extern int WinWidth;\r
+extern int WinHeight;\r
+extern int LocalWidth;\r
+extern int TaskHeight;\r
+extern int LocalTabWidth[4];\r
+extern int RemoteTabWidth[6];\r
+extern char UserMailAdrs[USER_MAIL_LEN+1];\r
+extern char ViewerName[VIEWERS][FMAX_PATH+1];\r
+extern HFONT ListFont;\r
+extern LOGFONT ListLogFont;\r
+extern int LocalFileSort;\r
+extern int LocalDirSort;\r
+extern int RemoteFileSort;\r
+extern int RemoteDirSort;\r
+extern int TransMode;\r
+extern int ConnectOnStart;\r
+extern int DebugConsole;\r
+extern int SaveWinPos;\r
+extern char AsciiExt[ASCII_EXT_LEN+1];\r
+extern int RecvMode;\r
+extern int SendMode;\r
+extern int MoveMode;\r
+extern int ListType;\r
+extern int CacheEntry;\r
+extern int CacheSave;\r
+extern char DefaultLocalPath[FMAX_PATH+1];\r
+extern int SaveTimeStamp;\r
+extern int FindMode;\r
+extern int DotFile;\r
+extern int DclickOpen;\r
+extern SOUNDFILE Sound[SOUND_TYPES];\r
+extern int FnameCnv;\r
+extern int ConnectAndSet;\r
+extern int TimeOut;\r
+extern int RmEOF;\r
+extern int RegType;\r
+extern char FwallHost[HOST_ADRS_LEN+1];\r
+extern char FwallUser[USER_NAME_LEN+1];\r
+extern char FwallPass[PASSWORD_LEN+1];\r
+extern int FwallPort;\r
+extern int FwallType;\r
+extern int FwallDefault;\r
+extern int FwallSecurity;\r
+extern int FwallResolv;\r
+extern int FwallLower;\r
+extern int FwallDelimiter;\r
+extern int PasvDefault;\r
+extern char MirrorNoTrn[MIRROR_LEN+1];\r
+extern char MirrorNoDel[MIRROR_LEN+1];\r
+extern int MirrorFnameCnv;\r
+//extern int MirrorFolderCnv;\r
+extern int RasClose;\r
+extern int RasCloseNotify;\r
+extern int FileHist;\r
+extern char DefAttrList[DEFATTRLIST_LEN+1];\r
+extern SIZE HostDlgSize;\r
+extern SIZE BmarkDlgSize;\r
+extern SIZE MirrorDlgSize;\r
+extern int Sizing;\r
+extern int SortSave;\r
+extern char TmpPath[FMAX_PATH+1];\r
+extern int QuickAnonymous;\r
+extern int PassToHist;\r
+extern int VaxSemicolon;\r
+extern int SendQuit;\r
+extern int NoRasControl;\r
+extern int SuppressSave;\r
+\r
+extern int UpExistMode;\r
+extern int ExistMode;\r
+extern int DispIgnoreHide;\r
+extern int DispDrives;\r
+extern int MirUpDelNotify;\r
+extern int MirDownDelNotify;\r
+\r
+extern int FolderAttr;\r
+extern int FolderAttrNum;\r
+\r
+/*----- \83}\83X\83^\83p\83X\83\8f\81[\83h\82Ì\90Ý\92è ----------------------------------------------\r
+*\r
+*      Parameter\r
+*              const char* Password : \83}\83X\83^\81[\83p\83X\83\8f\81[\83h\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+void SetMasterPassword( const char* Password )\r
+{\r
+       ZeroMemory( SecretKey, MAX_PASSWORD_LEN + 12 );\r
+       if( Password != NULL ){\r
+               strncpy( SecretKey, Password, MAX_PASSWORD_LEN );\r
+       }\r
+       else {\r
+               strcpy( SecretKey, DEFAULT_PASSWORD );\r
+       }\r
+       SecretKeyLength = strlen( SecretKey );\r
+       \r
+       /* \96¢\8c\9f\8fØ\82È\82Ì\82Å\81C\8f\89\8aú\8fó\91Ô\82ÍOK\82É\82·\82é (\8b­\90§\8dÄ\90Ý\92è\81¨\95Û\91\82É\82ð\89Â\94\\82É\82·\82é)*/\r
+       IsMasterPasswordError = PASSWORD_OK;\r
+}\r
+\r
+/*----- \83}\83X\83^\83p\83X\83\8f\81[\83h\82Ì\8fó\91Ô\8eæ\93¾ ----------------------------------------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              PASSWORD_OK : OK\r
+*              PASSWORD_UNMATCH : \83p\83X\83\8f\81[\83h\95s\88ê\92v\r
+*              BAD_PASSWORD_HASH : \83p\83X\83\8f\81[\83h\8am\94F\8e¸\94s\r
+*----------------------------------------------------------------------------*/\r
+int GetMasterPasswordStatus(void)\r
+{\r
+       return IsMasterPasswordError;\r
+}\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a\81^INI\83t\83@\83C\83\8b\82Ì\83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82Ì\8c\9f\8fØ\82ð\8ds\82¤ ------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              \r
+*----------------------------------------------------------------------------*/\r
+\r
+int ValidateMasterPassword(void)\r
+{\r
+       void *hKey3;\r
+       int i;\r
+\r
+       SetRegType(REGTYPE_INI);\r
+       if((i = OpenReg("FFFTP", &hKey3)) != SUCCESS)\r
+       {\r
+               if(AskForceIni() == NO)\r
+               {\r
+                       SetRegType(REGTYPE_REG);\r
+                       i = OpenReg("FFFTP", &hKey3);\r
+               }\r
+       }\r
+       if(i == SUCCESS){\r
+               char checkbuf[48];\r
+               int salt = 0;\r
+\r
+               if( ReadIntValueFromReg(hKey3, "CredentialSalt", &salt)){\r
+                       SetHashSalt( salt );\r
+               }\r
+               if( ReadStringFromReg(hKey3, "CredentialCheck", checkbuf, sizeof( checkbuf )) == SUCCESS ){\r
+                       switch( CheckPasswordValidity( SecretKey, SecretKeyLength, checkbuf ) ){\r
+                       case 0: /* not match */\r
+                               IsMasterPasswordError = PASSWORD_UNMATCH;\r
+                               break;\r
+                       case 1: /* match */\r
+                               IsMasterPasswordError = PASSWORD_OK;\r
+                               break;\r
+                       case 2: /* invalid hash */\r
+                       default:\r
+                               IsMasterPasswordError = BAD_PASSWORD_HASH;\r
+                               break;\r
+                       }\r
+               }\r
+               CloseReg(hKey3);\r
+               return YES;\r
+       }\r
+       return NO;\r
+}\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a\81^INI\83t\83@\83C\83\8b\82É\90Ý\92è\92l\82ð\95Û\91¶ ---------------------------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+void SaveRegistory(void)\r
+{\r
+       void *hKey3;\r
+       void *hKey4;\r
+       void *hKey5;\r
+       char Str[FMAX_PATH+1];\r
+       int i;\r
+       int n;\r
+       HOSTDATA DefaultHost;\r
+       HOSTDATA Host;\r
+       HISTORYDATA Hist;\r
+       HISTORYDATA DefaultHist;\r
+       \r
+       if( GetMasterPasswordStatus() == PASSWORD_UNMATCH ){\r
+               /* 2010.01.30 genta: \83}\83X\83^\81[\83p\83X\83\8f\81[\83h\82ª\95s\88ê\92v\82Ì\8fê\8d\87\82Í\95s\97p\88Ó\82É\8fã\8f\91\82«\82µ\82È\82¢ */\r
+               return;\r
+       }\r
+\r
+       SetRegType(RegType);\r
+       if(CreateReg("FFFTP", &hKey3) == SUCCESS)\r
+       {\r
+               char buf[48];\r
+               int salt = GetTickCount();\r
+       \r
+               WriteIntValueToReg(hKey3, "Version", VER_NUM);\r
+               WriteIntValueToReg(hKey3, "CredentialSalt", salt);\r
+               \r
+               SetHashSalt( salt );\r
+               /* save password hash */\r
+               CreatePasswordHash( SecretKey, SecretKeyLength, buf );\r
+               WriteStringToReg(hKey3, "CredentialCheck", buf);\r
+\r
+               if(CreateSubKey(hKey3, "Options", &hKey4) == SUCCESS)\r
+               {\r
+                       WriteIntValueToReg(hKey4, "NoSave", SuppressSave);\r
+\r
+                       if(SuppressSave != YES)\r
+                       {\r
+                               WriteIntValueToReg(hKey4, "WinPosX", WinPosX);\r
+                               WriteIntValueToReg(hKey4, "WinPosY", WinPosY);\r
+                               WriteIntValueToReg(hKey4, "WinWidth", WinWidth);\r
+                               WriteIntValueToReg(hKey4, "WinHeight", WinHeight);\r
+                               WriteIntValueToReg(hKey4, "LocalWidth", LocalWidth);\r
+                               WriteIntValueToReg(hKey4, "TaskHeight", TaskHeight);\r
+                               WriteBinaryToReg(hKey4, "LocalColm", LocalTabWidth, sizeof(LocalTabWidth));\r
+                               WriteBinaryToReg(hKey4, "RemoteColm", RemoteTabWidth, sizeof(RemoteTabWidth));\r
+                               WriteIntValueToReg(hKey4, "SwCmd", Sizing);\r
+\r
+                               WriteStringToReg(hKey4, "UserMail", UserMailAdrs);\r
+                               WriteStringToReg(hKey4, "Viewer", ViewerName[0]);\r
+                               WriteStringToReg(hKey4, "Viewer2", ViewerName[1]);\r
+                               WriteStringToReg(hKey4, "Viewer3", ViewerName[2]);\r
+\r
+                               WriteIntValueToReg(hKey4, "TrType", TransMode);\r
+                               WriteIntValueToReg(hKey4, "Recv", RecvMode);\r
+                               WriteIntValueToReg(hKey4, "Send", SendMode);\r
+                               WriteIntValueToReg(hKey4, "Move", MoveMode);\r
+                               WriteStringToReg(hKey4, "Path", DefaultLocalPath);\r
+                               WriteIntValueToReg(hKey4, "Time", SaveTimeStamp);\r
+                               WriteIntValueToReg(hKey4, "EOF", RmEOF);\r
+                               WriteIntValueToReg(hKey4, "Scolon", VaxSemicolon);\r
+\r
+                               WriteIntValueToReg(hKey4, "RecvEx", ExistMode);\r
+                               WriteIntValueToReg(hKey4, "SendEx", UpExistMode);\r
+\r
+                               WriteIntValueToReg(hKey4, "LFsort", LocalFileSort);\r
+                               WriteIntValueToReg(hKey4, "LDsort", LocalDirSort);\r
+                               WriteIntValueToReg(hKey4, "RFsort", RemoteFileSort);\r
+                               WriteIntValueToReg(hKey4, "RDsort", RemoteDirSort);\r
+                               WriteIntValueToReg(hKey4, "SortSave", SortSave);\r
+\r
+                               WriteIntValueToReg(hKey4, "ListType", ListType);\r
+                               WriteIntValueToReg(hKey4, "Cache", CacheEntry);\r
+                               WriteIntValueToReg(hKey4, "CacheSave", CacheSave);\r
+                               WriteIntValueToReg(hKey4, "DotFile", DotFile);\r
+                               WriteIntValueToReg(hKey4, "Dclick", DclickOpen);\r
+\r
+                               WriteIntValueToReg(hKey4, "ConS", ConnectOnStart);\r
+                               WriteIntValueToReg(hKey4, "OldDlg", ConnectAndSet);\r
+                               WriteIntValueToReg(hKey4, "RasClose", RasClose);\r
+                               WriteIntValueToReg(hKey4, "RasNotify", RasCloseNotify);\r
+                               WriteIntValueToReg(hKey4, "Qanony", QuickAnonymous);\r
+                               WriteIntValueToReg(hKey4, "PassHist", PassToHist);\r
+                               WriteIntValueToReg(hKey4, "SendQuit", SendQuit);\r
+                               WriteIntValueToReg(hKey4, "NoRas", NoRasControl);\r
+\r
+                               WriteIntValueToReg(hKey4, "Debug", DebugConsole);\r
+                               WriteIntValueToReg(hKey4, "WinPos", SaveWinPos);\r
+                               WriteIntValueToReg(hKey4, "RegExp", FindMode);\r
+                               WriteIntValueToReg(hKey4, "Reg", RegType);\r
+\r
+                               WriteMultiStringToReg(hKey4, "AsciiFile", AsciiExt);\r
+                               WriteIntValueToReg(hKey4, "LowUp", FnameCnv);\r
+                               WriteIntValueToReg(hKey4, "Tout", TimeOut);\r
+\r
+                               WriteMultiStringToReg(hKey4, "NoTrn", MirrorNoTrn);\r
+                               WriteMultiStringToReg(hKey4, "NoDel", MirrorNoDel);\r
+                               WriteIntValueToReg(hKey4, "MirFile", MirrorFnameCnv);\r
+                               WriteIntValueToReg(hKey4, "MirUNot", MirUpDelNotify);\r
+                               WriteIntValueToReg(hKey4, "MirDNot", MirDownDelNotify);\r
+\r
+                               MakeFontData(ListLogFont, ListFont, Str);\r
+                               WriteStringToReg(hKey4, "ListFont", Str);\r
+                               WriteIntValueToReg(hKey4, "ListHide", DispIgnoreHide);\r
+                               WriteIntValueToReg(hKey4, "ListDrv", DispDrives);\r
+\r
+                               WriteStringToReg(hKey4, "FwallHost", FwallHost);\r
+                               WriteStringToReg(hKey4, "FwallUser", FwallUser);\r
+                               EncodePassword(FwallPass, Str);\r
+                               WriteStringToReg(hKey4, "FwallPass", Str);\r
+                               WriteIntValueToReg(hKey4, "FwallPort", FwallPort);\r
+                               WriteIntValueToReg(hKey4, "FwallType", FwallType);\r
+                               WriteIntValueToReg(hKey4, "FwallDef", FwallDefault);\r
+                               WriteIntValueToReg(hKey4, "FwallSec", FwallSecurity);\r
+                               WriteIntValueToReg(hKey4, "PasvDef", PasvDefault);\r
+                               WriteIntValueToReg(hKey4, "FwallRes", FwallResolv);\r
+                               WriteIntValueToReg(hKey4, "FwallLow", FwallLower);\r
+                               WriteIntValueToReg(hKey4, "FwallDel", FwallDelimiter);\r
+\r
+                               WriteIntValueToReg(hKey4, "SndConSw", Sound[SND_CONNECT].On);\r
+                               WriteIntValueToReg(hKey4, "SndTrnSw", Sound[SND_TRANS].On);\r
+                               WriteIntValueToReg(hKey4, "SndErrSw", Sound[SND_ERROR].On);\r
+                               WriteStringToReg(hKey4, "SndCon", Sound[SND_CONNECT].Fname);\r
+                               WriteStringToReg(hKey4, "SndTrn", Sound[SND_TRANS].Fname);\r
+                               WriteStringToReg(hKey4, "SndErr", Sound[SND_ERROR].Fname);\r
+\r
+                               WriteMultiStringToReg(hKey4, "DefAttr", DefAttrList);\r
+\r
+                               GetTempPath(FMAX_PATH, Str);\r
+                               SaveStr(hKey4, "Tmp", TmpPath, Str);\r
+\r
+                               WriteBinaryToReg(hKey4, "Hdlg", &HostDlgSize, sizeof(SIZE));\r
+                               WriteBinaryToReg(hKey4, "Bdlg", &BmarkDlgSize, sizeof(SIZE));\r
+                               WriteBinaryToReg(hKey4, "Mdlg", &MirrorDlgSize, sizeof(SIZE));\r
+\r
+                               WriteIntValueToReg(hKey4, "FAttrSw", FolderAttr);\r
+                               WriteIntValueToReg(hKey4, "FAttr", FolderAttrNum);\r
+\r
+                               WriteIntValueToReg(hKey4, "HistNum", FileHist);\r
+\r
+                               /* Ver1.54a\88È\91O\82Ì\8c`\8e®\82Ì\83q\83X\83g\83\8a\83f\81[\83^\82Í\8dí\8f\9c */\r
+                               DeleteValue(hKey4, "Hist");\r
+\r
+                               /* \83q\83X\83g\83\8a\82Ì\90Ý\92è\82ð\95Û\91¶ */\r
+                               CopyDefaultHistory(&DefaultHist);\r
+                               n = 0;\r
+                               for(i = AskHistoryNum(); i > 0; i--)\r
+                               {\r
+                                       if(GetHistoryByNum(i-1, &Hist) == SUCCESS)\r
+                                       {\r
+                                               sprintf(Str, "History%d", n);\r
+                                               if(CreateSubKey(hKey4, Str, &hKey5) == SUCCESS)\r
+                                               {\r
+                                                       SaveStr(hKey5, "HostAdrs", Hist.HostAdrs, DefaultHist.HostAdrs);\r
+                                                       SaveStr(hKey5, "UserName", Hist.UserName, DefaultHist.UserName);\r
+                                                       SaveStr(hKey5, "Account", Hist.Account, DefaultHist.Account);\r
+                                                       SaveStr(hKey5, "LocalDir", Hist.LocalInitDir, NULL);\r
+                                                       SaveStr(hKey5, "RemoteDir", Hist.RemoteInitDir, DefaultHist.RemoteInitDir);\r
+                                                       SaveStr(hKey5, "Chmod", Hist.ChmodCmd, DefaultHist.ChmodCmd);\r
+                                                       SaveStr(hKey5, "Nlst", Hist.LsName, DefaultHist.LsName);\r
+                                                       SaveStr(hKey5, "Init", Hist.InitCmd, DefaultHist.InitCmd);\r
+                                                       EncodePassword(Hist.PassWord, Str);\r
+                                                       SaveStr(hKey5, "Password", Str, DefaultHist.PassWord);\r
+                                                       SaveIntNum(hKey5, "Port", Hist.Port, DefaultHist.Port);\r
+                                                       SaveIntNum(hKey5, "Kanji", Hist.KanjiCode, DefaultHist.KanjiCode);\r
+                                                       SaveIntNum(hKey5, "KanaCnv", Hist.KanaCnv, DefaultHist.KanaCnv);\r
+                                                       SaveIntNum(hKey5, "NameKanji", Hist.NameKanjiCode, DefaultHist.NameKanjiCode);\r
+                                                       SaveIntNum(hKey5, "NameKana", Hist.NameKanaCnv, DefaultHist.NameKanaCnv);\r
+                                                       SaveIntNum(hKey5, "Pasv", Hist.Pasv, DefaultHist.Pasv);\r
+                                                       SaveIntNum(hKey5, "Fwall", Hist.FireWall, DefaultHist.FireWall);\r
+                                                       SaveIntNum(hKey5, "List", Hist.ListCmdOnly, DefaultHist.ListCmdOnly);\r
+                                                       SaveIntNum(hKey5, "NLST-R", Hist.UseNLST_R, DefaultHist.UseNLST_R);\r
+                                                       SaveIntNum(hKey5, "Tzone", Hist.TimeZone, DefaultHist.TimeZone);\r
+                                                       SaveIntNum(hKey5, "Type", Hist.HostType, DefaultHist.HostType);\r
+                                                       SaveIntNum(hKey5, "Sync", Hist.SyncMove, DefaultHist.SyncMove);\r
+                                                       SaveIntNum(hKey5, "Fpath", Hist.NoFullPath, DefaultHist.NoFullPath);\r
+                                                       WriteBinaryToReg(hKey5, "Sort", &Hist.Sort, sizeof(Hist.Sort));\r
+                                                       SaveIntNum(hKey5, "Secu", Hist.Security, DefaultHist.Security);\r
+                                                       WriteIntValueToReg(hKey5, "TrType", Hist.Type);\r
+                                                       SaveIntNum(hKey5, "Dial", Hist.Dialup, DefaultHist.Dialup);\r
+                                                       SaveIntNum(hKey5, "UseIt", Hist.DialupAlways, DefaultHist.DialupAlways);\r
+                                                       SaveIntNum(hKey5, "Notify", Hist.DialupNotify, DefaultHist.DialupNotify);\r
+                                                       SaveStr(hKey5, "DialTo", Hist.DialEntry, DefaultHist.DialEntry);\r
+\r
+                                                       CloseSubKey(hKey5);\r
+                                                       n++;\r
+                                               }\r
+                                       }\r
+                               }\r
+                               WriteIntValueToReg(hKey4, "SavedHist", n);\r
+\r
+                               /* \97]\95ª\82È\83q\83X\83g\83\8a\82ª\82 \82Á\82½\82ç\8dí\8f\9c */\r
+                               for(; n < 999; n++)\r
+                               {\r
+                                       sprintf(Str, "History%d", n);\r
+                                       if(DeleteSubKey(hKey4, Str) != SUCCESS)\r
+                                               break;\r
+                               }\r
+\r
+                               /* \83z\83X\83g\82Ì\90Ý\92è\82ð\95Û\91¶ */\r
+                               CopyDefaultHost(&DefaultHost);\r
+                               i = 0;\r
+                               while(CopyHostFromList(i, &Host) == SUCCESS)\r
+                               {\r
+                                       sprintf(Str, "Host%d", i);\r
+                                       if(CreateSubKey(hKey4, Str, &hKey5) == SUCCESS)\r
+                                       {\r
+//                                             SaveIntNum(hKey5, "Set", Host.Level, DefaultHost.Level);\r
+                                               WriteIntValueToReg(hKey5, "Set", Host.Level);\r
+                                               SaveStr(hKey5, "HostName", Host.HostName, DefaultHost.HostName);\r
+                                               if((Host.Level & SET_LEVEL_GROUP) == 0)\r
+                                               {\r
+                                                       SaveStr(hKey5, "HostAdrs", Host.HostAdrs, DefaultHost.HostAdrs);\r
+                                                       SaveStr(hKey5, "UserName", Host.UserName, DefaultHost.UserName);\r
+                                                       SaveStr(hKey5, "Account", Host.Account, DefaultHost.Account);\r
+                                                       SaveStr(hKey5, "LocalDir", Host.LocalInitDir, NULL);\r
+                                                       SaveStr(hKey5, "RemoteDir", Host.RemoteInitDir, DefaultHost.RemoteInitDir);\r
+                                                       SaveStr(hKey5, "Chmod", Host.ChmodCmd, DefaultHost.ChmodCmd);\r
+                                                       SaveStr(hKey5, "Nlst", Host.LsName, DefaultHost.LsName);\r
+                                                       SaveStr(hKey5, "Init", Host.InitCmd, DefaultHost.InitCmd);\r
+\r
+                                                       if(Host.Anonymous == NO)\r
+                                                               EncodePassword(Host.PassWord, Str);\r
+                                                       else\r
+                                                               strcpy(Str, DefaultHost.PassWord);\r
+                                                       SaveStr(hKey5, "Password", Str, DefaultHost.PassWord);\r
+\r
+                                                       SaveIntNum(hKey5, "Port", Host.Port, DefaultHost.Port);\r
+                                                       SaveIntNum(hKey5, "Anonymous", Host.Anonymous, DefaultHost.Anonymous);\r
+                                                       SaveIntNum(hKey5, "Kanji", Host.KanjiCode, DefaultHost.KanjiCode);\r
+                                                       SaveIntNum(hKey5, "KanaCnv", Host.KanaCnv, DefaultHost.KanaCnv);\r
+                                                       SaveIntNum(hKey5, "NameKanji", Host.NameKanjiCode, DefaultHost.NameKanjiCode);\r
+                                                       SaveIntNum(hKey5, "NameKana", Host.NameKanaCnv, DefaultHost.NameKanaCnv);\r
+                                                       SaveIntNum(hKey5, "Pasv", Host.Pasv, DefaultHost.Pasv);\r
+                                                       SaveIntNum(hKey5, "Fwall", Host.FireWall, DefaultHost.FireWall);\r
+                                                       SaveIntNum(hKey5, "List", Host.ListCmdOnly, DefaultHost.ListCmdOnly);\r
+                                                       SaveIntNum(hKey5, "NLST-R", Host.UseNLST_R, DefaultHost.UseNLST_R);\r
+                                                       SaveIntNum(hKey5, "Last", Host.LastDir, DefaultHost.LastDir);\r
+                                                       SaveIntNum(hKey5, "Tzone", Host.TimeZone, DefaultHost.TimeZone);\r
+                                                       SaveIntNum(hKey5, "Type", Host.HostType, DefaultHost.HostType);\r
+                                                       SaveIntNum(hKey5, "Sync", Host.SyncMove, DefaultHost.SyncMove);\r
+                                                       SaveIntNum(hKey5, "Fpath", Host.NoFullPath, DefaultHost.NoFullPath);\r
+                                                       WriteBinaryToReg(hKey5, "Sort", &Host.Sort, sizeof(Host.Sort));\r
+                                                       SaveIntNum(hKey5, "Secu", Host.Security, DefaultHost.Security);\r
+\r
+                                                       WriteMultiStringToReg(hKey5, "Bmarks", Host.BookMark);\r
+\r
+                                                       SaveIntNum(hKey5, "Dial", Host.Dialup, DefaultHost.Dialup);\r
+                                                       SaveIntNum(hKey5, "UseIt", Host.DialupAlways, DefaultHost.DialupAlways);\r
+                                                       SaveIntNum(hKey5, "Notify", Host.DialupNotify, DefaultHost.DialupNotify);\r
+                                                       SaveStr(hKey5, "DialTo", Host.DialEntry, DefaultHost.DialEntry);\r
+                                               }\r
+                                               CloseSubKey(hKey5);\r
+                                       }\r
+                                       i++;\r
+                               }\r
+                               WriteIntValueToReg(hKey4, "SetNum", i);\r
+\r
+                               /* \97]\95ª\82È\83z\83X\83g\82Ì\90Ý\92è\82ª\82 \82Á\82½\82ç\8dí\8f\9c */\r
+                               for(; i < 998; i++)\r
+                               {\r
+                                       sprintf(Str, "Host%d", i);\r
+                                       if(DeleteSubKey(hKey4, Str) != SUCCESS)\r
+                                               break;\r
+                               }\r
+\r
+                               if((i = AskCurrentHost()) == HOSTNUM_NOENTRY)\r
+                                       i = 0;\r
+                               WriteIntValueToReg(hKey4, "CurSet", i);\r
+                       }\r
+                       CloseSubKey(hKey4);\r
+               }\r
+               CloseReg(hKey3);\r
+       }\r
+       return;\r
+}\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a\81^INI\83t\83@\83C\83\8b\82©\82ç\90Ý\92è\92l\82ð\8cÄ\82Ñ\8fo\82· ---------------------------\r
+*\r
+*      \82±\82Ì\8aÖ\90\94\82ð\95¡\90\94\89ñ\8cÄ\82Ñ\8fo\82·\82Æ\81C\83z\83X\83g\90Ý\92è\82ª\92Ç\89Á\82³\82ê\82é\81D\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              YES: \93Ç\82Ý\8fo\82µ\90¬\8c÷\r
+*              NO:  \93Ç\82Ý\8fo\82µ\8e¸\94s(\90Ý\92è\96³\82µ)\r
+*----------------------------------------------------------------------------*/\r
+\r
+int LoadRegistory(void)\r
+{\r
+       void *hKey3;\r
+       void *hKey4;\r
+       void *hKey5;\r
+       int i;\r
+       int Sets;\r
+       char Str[256];  /* ASCII_EXT_LEN\82æ\82è\91å\82«\82¢\8e\96 */\r
+       char *Pos;\r
+       char *Pos2;\r
+       HOSTDATA Host;\r
+       HISTORYDATA Hist;\r
+       int Sts;\r
+       int Version;\r
+\r
+       Sts = NO;\r
+\r
+       SetRegType(REGTYPE_INI);\r
+       if((i = OpenReg("FFFTP", &hKey3)) != SUCCESS)\r
+       {\r
+               if(AskForceIni() == NO)\r
+               {\r
+                       SetRegType(REGTYPE_REG);\r
+                       i = OpenReg("FFFTP", &hKey3);\r
+               }\r
+       }\r
+\r
+       if(i == SUCCESS)\r
+       {\r
+               char checkbuf[48];\r
+               int salt = 0;\r
+               Sts = YES;\r
+\r
+               ReadIntValueFromReg(hKey3, "Version", &Version);\r
+\r
+               if(OpenSubKey(hKey3, "Options", &hKey4) == SUCCESS)\r
+               {\r
+                       ReadIntValueFromReg(hKey4, "WinPosX", &WinPosX);\r
+                       ReadIntValueFromReg(hKey4, "WinPosY", &WinPosY);\r
+                       ReadIntValueFromReg(hKey4, "WinWidth", &WinWidth);\r
+                       ReadIntValueFromReg(hKey4, "WinHeight", &WinHeight);\r
+                       ReadIntValueFromReg(hKey4, "LocalWidth", &LocalWidth);\r
+                       /* \81«\8b\8c\83o\81[\83W\83\87\83\93\82Ì\83o\83O\91Î\8dô */\r
+                       LocalWidth = max1(0, LocalWidth);\r
+                       ReadIntValueFromReg(hKey4, "TaskHeight", &TaskHeight);\r
+                       /* \81«\8b\8c\83o\81[\83W\83\87\83\93\82Ì\83o\83O\91Î\8dô */\r
+                       TaskHeight = max1(0, TaskHeight);\r
+                       ReadBinaryFromReg(hKey4, "LocalColm", &LocalTabWidth, sizeof(LocalTabWidth));\r
+                       ReadBinaryFromReg(hKey4, "RemoteColm", &RemoteTabWidth, sizeof(RemoteTabWidth));\r
+                       ReadIntValueFromReg(hKey4, "SwCmd", &Sizing);\r
+\r
+                       ReadStringFromReg(hKey4, "UserMail", UserMailAdrs, USER_MAIL_LEN+1);\r
+                       ReadStringFromReg(hKey4, "Viewer", ViewerName[0], FMAX_PATH+1);\r
+                       ReadStringFromReg(hKey4, "Viewer2", ViewerName[1], FMAX_PATH+1);\r
+                       ReadStringFromReg(hKey4, "Viewer3", ViewerName[2], FMAX_PATH+1);\r
+\r
+                       ReadIntValueFromReg(hKey4, "TrType", &TransMode);\r
+                       ReadIntValueFromReg(hKey4, "Recv", &RecvMode);\r
+                       ReadIntValueFromReg(hKey4, "Send", &SendMode);\r
+                       ReadIntValueFromReg(hKey4, "Move", &MoveMode);\r
+                       ReadStringFromReg(hKey4, "Path", DefaultLocalPath, FMAX_PATH+1);\r
+                       ReadIntValueFromReg(hKey4, "Time", &SaveTimeStamp);\r
+                       ReadIntValueFromReg(hKey4, "EOF", &RmEOF);\r
+                       ReadIntValueFromReg(hKey4, "Scolon", &VaxSemicolon);\r
+\r
+                       ReadIntValueFromReg(hKey4, "RecvEx", &ExistMode);\r
+                       ReadIntValueFromReg(hKey4, "SendEx", &UpExistMode);\r
+\r
+                       ReadIntValueFromReg(hKey4, "LFsort", &LocalFileSort);\r
+                       ReadIntValueFromReg(hKey4, "LDsort", &LocalDirSort);\r
+                       ReadIntValueFromReg(hKey4, "RFsort", &RemoteFileSort);\r
+                       ReadIntValueFromReg(hKey4, "RDsort", &RemoteDirSort);\r
+                       ReadIntValueFromReg(hKey4, "SortSave", &SortSave);\r
+\r
+                       ReadIntValueFromReg(hKey4, "ListType", &ListType);\r
+                       ReadIntValueFromReg(hKey4, "Cache", &CacheEntry);\r
+                       ReadIntValueFromReg(hKey4, "CacheSave", &CacheSave);\r
+                       ReadIntValueFromReg(hKey4, "DotFile", &DotFile);\r
+                       ReadIntValueFromReg(hKey4, "Dclick", &DclickOpen);\r
+\r
+                       ReadIntValueFromReg(hKey4, "ConS", &ConnectOnStart);\r
+                       ReadIntValueFromReg(hKey4, "OldDlg", &ConnectAndSet);\r
+                       ReadIntValueFromReg(hKey4, "RasClose", &RasClose);\r
+                       ReadIntValueFromReg(hKey4, "RasNotify", &RasCloseNotify);\r
+                       ReadIntValueFromReg(hKey4, "Qanony", &QuickAnonymous);\r
+                       ReadIntValueFromReg(hKey4, "PassHist", &PassToHist);\r
+                       ReadIntValueFromReg(hKey4, "SendQuit", &SendQuit);\r
+                       ReadIntValueFromReg(hKey4, "NoRas", &NoRasControl);\r
+\r
+                       ReadIntValueFromReg(hKey4, "Debug", &DebugConsole);\r
+                       ReadIntValueFromReg(hKey4, "WinPos", &SaveWinPos);\r
+                       ReadIntValueFromReg(hKey4, "RegExp", &FindMode);\r
+                       ReadIntValueFromReg(hKey4, "Reg", &RegType);\r
+\r
+                       if(ReadMultiStringFromReg(hKey4, "AsciiFile", AsciiExt, ASCII_EXT_LEN+1) == FAIL)\r
+                       {\r
+                               /* \8b\8cASCII\83\82\81[\83h\82Ì\8ag\92£\8eq\82Ì\90Ý\92è\82ð\90V\82µ\82¢\82à\82Ì\82É\95Ï\8a· */\r
+                               ReadStringFromReg(hKey4, "Ascii", Str, ASCII_EXT_LEN+1);\r
+                               memset(AsciiExt, NUL, ASCII_EXT_LEN+1);\r
+                               Pos = Str;\r
+                               while(*Pos != NUL)\r
+                               {\r
+                                       if((Pos2 = strchr(Pos, ';')) == NULL)\r
+                                               Pos2 = strchr(Pos, NUL);\r
+                                       if((Pos2 - Pos) > 0)\r
+                                       {\r
+                                               if((StrMultiLen(AsciiExt) + (Pos2 - Pos) + 2) >= ASCII_EXT_LEN)\r
+                                                       break;\r
+                                               strcpy(AsciiExt + StrMultiLen(AsciiExt), "*.");\r
+                                               strncpy(AsciiExt + StrMultiLen(AsciiExt) - 1, Pos, (Pos2 - Pos));\r
+                                       }\r
+                                       Pos = Pos2;\r
+                                       if(*Pos == ';')\r
+                                               Pos++;\r
+                               }\r
+                       }\r
+\r
+                       ReadIntValueFromReg(hKey4, "LowUp", &FnameCnv);\r
+                       ReadIntValueFromReg(hKey4, "Tout", &TimeOut);\r
+\r
+                       ReadMultiStringFromReg(hKey4, "NoTrn", MirrorNoTrn, MIRROR_LEN+1);\r
+                       ReadMultiStringFromReg(hKey4, "NoDel", MirrorNoDel, MIRROR_LEN+1);\r
+                       ReadIntValueFromReg(hKey4, "MirFile", &MirrorFnameCnv);\r
+                       ReadIntValueFromReg(hKey4, "MirUNot", &MirUpDelNotify);\r
+                       ReadIntValueFromReg(hKey4, "MirDNot", &MirDownDelNotify);\r
+\r
+                       if(ReadStringFromReg(hKey4, "ListFont", Str, 256) == SUCCESS)\r
+                       {\r
+                               if(RestoreFontData(Str, &ListLogFont) == SUCCESS)\r
+                                       ListFont = CreateFontIndirect(&ListLogFont);\r
+                       }\r
+                       ReadIntValueFromReg(hKey4, "ListHide", &DispIgnoreHide);\r
+                       ReadIntValueFromReg(hKey4, "ListDrv", &DispDrives);\r
+\r
+                       ReadStringFromReg(hKey4, "FwallHost", FwallHost, HOST_ADRS_LEN+1);\r
+                       ReadStringFromReg(hKey4, "FwallUser", FwallUser, USER_NAME_LEN+1);\r
+                       ReadStringFromReg(hKey4, "FwallPass", Str, 255);\r
+                       DecodePassword(Str, FwallPass);\r
+                       ReadIntValueFromReg(hKey4, "FwallPort", &FwallPort);\r
+                       ReadIntValueFromReg(hKey4, "FwallType", &FwallType);\r
+                       ReadIntValueFromReg(hKey4, "FwallDef", &FwallDefault);\r
+                       ReadIntValueFromReg(hKey4, "FwallSec", &FwallSecurity);\r
+                       ReadIntValueFromReg(hKey4, "PasvDef", &PasvDefault);\r
+                       ReadIntValueFromReg(hKey4, "FwallRes", &FwallResolv);\r
+                       ReadIntValueFromReg(hKey4, "FwallLow", &FwallLower);\r
+                       ReadIntValueFromReg(hKey4, "FwallDel", &FwallDelimiter);\r
+\r
+                       ReadIntValueFromReg(hKey4, "SndConSw", &Sound[SND_CONNECT].On);\r
+                       ReadIntValueFromReg(hKey4, "SndTrnSw", &Sound[SND_TRANS].On);\r
+                       ReadIntValueFromReg(hKey4, "SndErrSw", &Sound[SND_ERROR].On);\r
+                       ReadStringFromReg(hKey4, "SndCon", Sound[SND_CONNECT].Fname, FMAX_PATH+1);\r
+                       ReadStringFromReg(hKey4, "SndTrn", Sound[SND_TRANS].Fname, FMAX_PATH+1);\r
+                       ReadStringFromReg(hKey4, "SndErr", Sound[SND_ERROR].Fname, FMAX_PATH+1);\r
+\r
+                       ReadMultiStringFromReg(hKey4, "DefAttr", DefAttrList, DEFATTRLIST_LEN+1);\r
+\r
+                       ReadStringFromReg(hKey4, "Tmp", TmpPath, FMAX_PATH+1);\r
+\r
+                       ReadBinaryFromReg(hKey4, "Hdlg", &HostDlgSize, sizeof(SIZE));\r
+                       ReadBinaryFromReg(hKey4, "Bdlg", &BmarkDlgSize, sizeof(SIZE));\r
+                       ReadBinaryFromReg(hKey4, "Mdlg", &MirrorDlgSize, sizeof(SIZE));\r
+\r
+                       ReadIntValueFromReg(hKey4, "FAttrSw", &FolderAttr);\r
+                       ReadIntValueFromReg(hKey4, "FAttr", &FolderAttrNum);\r
+\r
+                       ReadIntValueFromReg(hKey4, "NoSave", &SuppressSave);\r
+\r
+                       ReadIntValueFromReg(hKey4, "HistNum", &FileHist);\r
+//                     ReadMultiStringFromReg(hKey4, "Hist", Hist, (FMAX_PATH+1)*HISTORY_MAX+1);\r
+\r
+                       /* \83q\83X\83g\83\8a\82Ì\90Ý\92è\82ð\93Ç\82Ý\8d\9e\82Þ */\r
+                       Sets = 0;\r
+                       ReadIntValueFromReg(hKey4, "SavedHist", &Sets);\r
+\r
+                       for(i = 0; i < Sets; i++)\r
+                       {\r
+                               sprintf(Str, "History%d", i);\r
+                               if(OpenSubKey(hKey4, Str, &hKey5) == SUCCESS)\r
+                               {\r
+                                       CopyDefaultHistory(&Hist);\r
+\r
+                                       ReadStringFromReg(hKey5, "HostAdrs", Hist.HostAdrs, HOST_ADRS_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "UserName", Hist.UserName, USER_NAME_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Account", Hist.Account, ACCOUNT_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "LocalDir", Hist.LocalInitDir, INIT_DIR_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "RemoteDir", Hist.RemoteInitDir, INIT_DIR_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Chmod", Hist.ChmodCmd, CHMOD_CMD_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Nlst", Hist.LsName, NLST_NAME_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Init", Hist.InitCmd, INITCMD_LEN+1);\r
+                                       ReadIntValueFromReg(hKey5, "Port", &Hist.Port);\r
+                                       ReadIntValueFromReg(hKey5, "Kanji", &Hist.KanjiCode);\r
+                                       ReadIntValueFromReg(hKey5, "KanaCnv", &Hist.KanaCnv);\r
+                                       ReadIntValueFromReg(hKey5, "NameKanji", &Hist.NameKanjiCode);\r
+                                       ReadIntValueFromReg(hKey5, "NameKana", &Hist.NameKanaCnv);\r
+                                       ReadIntValueFromReg(hKey5, "Pasv", &Hist.Pasv);\r
+                                       ReadIntValueFromReg(hKey5, "Fwall", &Hist.FireWall);\r
+                                       ReadIntValueFromReg(hKey5, "List", &Hist.ListCmdOnly);\r
+                                       ReadIntValueFromReg(hKey5, "NLST-R", &Hist.UseNLST_R);\r
+                                       ReadIntValueFromReg(hKey5, "Tzone", &Hist.TimeZone);\r
+                                       ReadIntValueFromReg(hKey5, "Type", &Hist.HostType);\r
+                                       ReadIntValueFromReg(hKey5, "Sync", &Hist.SyncMove);\r
+                                       ReadIntValueFromReg(hKey5, "Fpath", &Hist.NoFullPath);\r
+                                       ReadBinaryFromReg(hKey5, "Sort", &Hist.Sort, sizeof(Hist.Sort));\r
+                                       ReadIntValueFromReg(hKey5, "Secu", &Hist.Security);\r
+                                       ReadIntValueFromReg(hKey5, "TrType", &Hist.Type);\r
+                                       strcpy(Str, "");\r
+                                       ReadStringFromReg(hKey5, "Password", Str, 255);\r
+                                       DecodePassword(Str, Hist.PassWord);\r
+                                       ReadIntValueFromReg(hKey5, "Dial", &Hist.Dialup);\r
+                                       ReadIntValueFromReg(hKey5, "UseIt", &Hist.DialupAlways);\r
+                                       ReadIntValueFromReg(hKey5, "Notify", &Hist.DialupNotify);\r
+                                       ReadStringFromReg(hKey5, "DialTo", Hist.DialEntry, RAS_NAME_LEN+1);\r
+\r
+                                       CloseSubKey(hKey5);\r
+                                       AddHistoryToHistory(&Hist);\r
+                               }\r
+                       }\r
+\r
+                       /* \83z\83X\83g\82Ì\90Ý\92è\82ð\93Ç\82Ý\8d\9e\82Þ */\r
+                       Sets = 0;\r
+                       ReadIntValueFromReg(hKey4, "SetNum", &Sets);\r
+\r
+                       for(i = 0; i < Sets; i++)\r
+                       {\r
+                               sprintf(Str, "Host%d", i);\r
+                               if(OpenSubKey(hKey4, Str, &hKey5) == SUCCESS)\r
+                               {\r
+                                       CopyDefaultHost(&Host);\r
+                                       /* \89º\88Ê\8cÝ\8a·\90«\82Ì\82½\82ß */\r
+                                       if(Version < VER_NUM)\r
+                                       {\r
+                                               Host.Pasv = NO;\r
+                                               Host.ListCmdOnly = NO;\r
+                                       }\r
+                                       ReadIntValueFromReg(hKey5, "Set", &Host.Level);\r
+\r
+                                       ReadStringFromReg(hKey5, "HostName", Host.HostName, HOST_NAME_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "HostAdrs", Host.HostAdrs, HOST_ADRS_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "UserName", Host.UserName, USER_NAME_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Account", Host.Account, ACCOUNT_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "LocalDir", Host.LocalInitDir, INIT_DIR_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "RemoteDir", Host.RemoteInitDir, INIT_DIR_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Chmod", Host.ChmodCmd, CHMOD_CMD_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Nlst", Host.LsName, NLST_NAME_LEN+1);\r
+                                       ReadStringFromReg(hKey5, "Init", Host.InitCmd, INITCMD_LEN+1);\r
+                                       ReadIntValueFromReg(hKey5, "Port", &Host.Port);\r
+                                       ReadIntValueFromReg(hKey5, "Anonymous", &Host.Anonymous);\r
+                                       ReadIntValueFromReg(hKey5, "Kanji", &Host.KanjiCode);\r
+                                       ReadIntValueFromReg(hKey5, "KanaCnv", &Host.KanaCnv);\r
+                                       ReadIntValueFromReg(hKey5, "NameKanji", &Host.NameKanjiCode);\r
+                                       ReadIntValueFromReg(hKey5, "NameKana", &Host.NameKanaCnv);\r
+                                       ReadIntValueFromReg(hKey5, "Pasv", &Host.Pasv);\r
+                                       ReadIntValueFromReg(hKey5, "Fwall", &Host.FireWall);\r
+                                       ReadIntValueFromReg(hKey5, "List", &Host.ListCmdOnly);\r
+                                       ReadIntValueFromReg(hKey5, "NLST-R", &Host.UseNLST_R);\r
+                                       ReadIntValueFromReg(hKey5, "Last", &Host.LastDir);\r
+                                       ReadIntValueFromReg(hKey5, "Tzone", &Host.TimeZone);\r
+                                       ReadIntValueFromReg(hKey5, "Type", &Host.HostType);\r
+                                       ReadIntValueFromReg(hKey5, "Sync", &Host.SyncMove);\r
+                                       ReadIntValueFromReg(hKey5, "Fpath", &Host.NoFullPath);\r
+                                       ReadBinaryFromReg(hKey5, "Sort", &Host.Sort, sizeof(Host.Sort));\r
+                                       ReadIntValueFromReg(hKey5, "Secu", &Host.Security);\r
+                                       if(Host.Anonymous != YES)\r
+                                       {\r
+                                               strcpy(Str, "");\r
+                                               ReadStringFromReg(hKey5, "Password", Str, 255);\r
+                                               DecodePassword(Str, Host.PassWord);\r
+                                       }\r
+                                       else\r
+                                               strcpy(Host.PassWord, UserMailAdrs);\r
+\r
+                                       ReadMultiStringFromReg(hKey5, "Bmarks", Host.BookMark, BOOKMARK_SIZE);\r
+\r
+                                       ReadIntValueFromReg(hKey5, "Dial", &Host.Dialup);\r
+                                       ReadIntValueFromReg(hKey5, "UseIt", &Host.DialupAlways);\r
+                                       ReadIntValueFromReg(hKey5, "Notify", &Host.DialupNotify);\r
+                                       ReadStringFromReg(hKey5, "DialTo", Host.DialEntry, RAS_NAME_LEN+1);\r
+\r
+                                       CloseSubKey(hKey5);\r
+\r
+                                       AddHostToList(&Host, -1, Host.Level);\r
+                               }\r
+                       }\r
+\r
+                       ReadIntValueFromReg(hKey4, "CurSet", &Sets);\r
+                       SetCurrentHost(Sets);\r
+\r
+                       CloseSubKey(hKey4);\r
+               }\r
+               CloseReg(hKey3);\r
+       }\r
+       else\r
+       {\r
+               /*===== \8dÅ\8f\89\82Ì\8bN\93®\8e\9e\81i\90Ý\92è\82ª\96³\82¢) =====*/\r
+\r
+#if 0\r
+               strcpy(UserMailAdrs, "");\r
+               strcpy(Str, "");\r
+               if(InputDialogBox(mailadrs_dlg, HWND_DESKTOP, NULL, Str, USER_MAIL_LEN+1, &i, IDH_HELP_TOPIC_0000001) == YES)\r
+                       strcpy(UserMailAdrs, Str);\r
+\r
+               for(i = 0; i < SAMPLE_HOSTS; i++)\r
+               {\r
+                       CopyDefaultHost(&Host);\r
+                       Host.Level = Sample[i].Level;\r
+                       strcpy(Host.PassWord, UserMailAdrs);\r
+                       strcpy(Host.HostName, Sample[i].HostName);\r
+                       strcpy(Host.HostAdrs, Sample[i].HostAdrs);\r
+                       strcpy(Host.UserName, "anonymous");\r
+                       AddHostToList(&Host, -1, Host.Level);\r
+               }\r
+#endif\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \89B\82µ\83h\83\89\83C\83u\8fî\95ñ\82ð\8eæ\93¾ ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              DWORD \r
+*                      YES/NO=\90Ý\92è\96³\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+DWORD LoadHideDriveListRegistory(void)\r
+{\r
+       HKEY hKey1;\r
+       HKEY hKey2;\r
+       HKEY hKey3;\r
+       HKEY hKey4;\r
+       HKEY hKey5;\r
+       HKEY hKey6;\r
+       DWORD Size;\r
+       DWORD Type;\r
+       DWORD Ret;\r
+\r
+       Ret = 0;\r
+       if(RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hKey1) == ERROR_SUCCESS)\r
+       {\r
+               if(RegOpenKeyEx(hKey1, "Microsoft", 0, KEY_READ, &hKey2) == ERROR_SUCCESS)\r
+               {\r
+                       if(RegOpenKeyEx(hKey2, "Windows", 0, KEY_READ, &hKey3) == ERROR_SUCCESS)\r
+                       {\r
+                               if(RegOpenKeyEx(hKey3, "CurrentVersion", 0, KEY_READ, &hKey4) == ERROR_SUCCESS)\r
+                               {\r
+                                       if(RegOpenKeyEx(hKey4, "Policies", 0, KEY_READ, &hKey5) == ERROR_SUCCESS)\r
+                                       {\r
+                                               if(RegOpenKeyEx(hKey5, "Explorer", 0, KEY_READ, &hKey6) == ERROR_SUCCESS)\r
+                                               {\r
+                                                       Size = sizeof(DWORD);\r
+                                                       RegQueryValueEx(hKey6, "NoDrives", NULL, &Type, (BYTE *)&Ret, &Size);\r
+                                                       RegCloseKey(hKey6);\r
+                                               }\r
+                                               RegCloseKey(hKey5);\r
+                                       }\r
+                                       RegCloseKey(hKey4);\r
+                               }\r
+                               RegCloseKey(hKey3);\r
+                       }\r
+                       RegCloseKey(hKey2);\r
+               }\r
+               RegCloseKey(hKey1);\r
+       }\r
+       return(Ret);\r
+}\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a\82Ì\90Ý\92è\92l\82ð\83N\83\8a\83A --------------------------------------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+void ClearRegistory(void)\r
+{\r
+       HKEY hKey2;\r
+       HKEY hKey3;\r
+       HKEY hKey4;\r
+       DWORD Dispos;\r
+       char Str[20];\r
+       int i;\r
+\r
+       if(RegCreateKeyEx(HKEY_CURRENT_USER, "Software\\Sota", 0, "", REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY, NULL, &hKey2, &Dispos) == ERROR_SUCCESS)\r
+       {\r
+               if(RegCreateKeyEx(hKey2, "FFFTP", 0, "", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey3, &Dispos) == ERROR_SUCCESS)\r
+               {\r
+                       if(RegCreateKeyEx(hKey3, "Options", 0, "", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey4, &Dispos) == ERROR_SUCCESS)\r
+                       {\r
+                               for(i = 0; ; i++)\r
+                               {\r
+                                       sprintf(Str, "Host%d", i);\r
+                                       if(RegDeleteKey(hKey4, Str) != ERROR_SUCCESS)\r
+                                               break;\r
+                               }\r
+                               for(i = 0; ; i++)\r
+                               {\r
+                                       sprintf(Str, "History%d", i);\r
+                                       if(RegDeleteKey(hKey4, Str) != ERROR_SUCCESS)\r
+                                               break;\r
+                               }\r
+                               RegCloseKey(hKey4);\r
+                       }\r
+                       RegDeleteKey(hKey3, "Options");\r
+                       RegCloseKey(hKey3);\r
+               }\r
+               RegDeleteKey(hKey2, "FFFTP");\r
+               RegCloseKey(hKey2);\r
+       }\r
+       return;\r
+}\r
+\r
+\r
+/*----- \90Ý\92è\82ð\83t\83@\83C\83\8b\82É\95Û\91¶ --------------------------------------------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+void SaveSettingsToFile(void)\r
+{\r
+       char Tmp[FMAX_PATH*2];\r
+       char Fname[FMAX_PATH+1];\r
+\r
+       if(RegType == REGTYPE_REG)\r
+       {\r
+               strcpy(Fname, "FFFTP.reg");\r
+               if(SelectFile(GetMainHwnd(), Fname, MSGJPN286, MSGJPN287, "reg", OFN_EXTENSIONDIFFERENT | OFN_OVERWRITEPROMPT, 1) == TRUE)\r
+               {\r
+                       sprintf(Tmp, "/e \x22%s\x22 HKEY_CURRENT_USER\\Software\\sota\\FFFTP", Fname);\r
+                       if(ShellExecute(NULL, "open", "regedit", Tmp, ".", SW_SHOW) <= (HINSTANCE)32)\r
+                       {\r
+                               MessageBox(NULL, MSGJPN285, "FFFTP", MB_OK);\r
+                       }\r
+               }\r
+       }\r
+       else\r
+       {\r
+               strcpy(Fname, "FFFTP-Backup.ini");\r
+               if(SelectFile(GetMainHwnd(), Fname, MSGJPN286, MSGJPN288, "ini", OFN_EXTENSIONDIFFERENT | OFN_OVERWRITEPROMPT, 1) == TRUE)\r
+               {\r
+                       CopyFile(AskIniFilePath(), Fname, FALSE);\r
+               }\r
+       }\r
+       return;\r
+}\r
+\r
+\r
+/*----- \90Ý\92è\82ð\83t\83@\83C\83\8b\82©\82ç\95\9c\8c³ ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              \82È\82µ\r
+*\r
+*      Return Value\r
+*              int     \83\8d\81[\83h\82µ\82½\82©\82Ç\82¤\82© (YES/NO)\r
+*----------------------------------------------------------------------------*/\r
+\r
+int LoadSettingsFromFile(void)\r
+{\r
+       int Ret;\r
+       char Tmp[FMAX_PATH*2];\r
+       char Fname[FMAX_PATH+1];\r
+\r
+       Ret = NO;\r
+       strcpy(Fname, "");\r
+       if(SelectFile(GetMainHwnd(), Fname, MSGJPN291, MSGJPN290, "", OFN_FILEMUSTEXIST, 0) == TRUE)\r
+       {\r
+               if((strlen(Fname) >= 5) && (_stricmp(&Fname[strlen(Fname)-4], ".reg") == 0))\r
+               {\r
+                       sprintf(Tmp, "\x22%s\x22", Fname);\r
+                       if(ShellExecute(NULL, "open", "regedit", Tmp, ".", SW_SHOW) <= (HINSTANCE)32)\r
+                       {\r
+                               MessageBox(NULL, MSGJPN285, "FFFTP", MB_OK);\r
+                       }\r
+                       else\r
+                       {\r
+                               Ret = YES;\r
+                               /* \83\8c\83W\83X\83g\83\8a\83G\83f\83B\83^\82ª\8fI\97¹\82·\82é\82Ì\82ð\91Ò\82 */\r
+//                             WaitForSingleObject(Info.hProcess, INFINITE);\r
+                       }\r
+               }\r
+               else if((strlen(Fname) >= 5) && (_stricmp(&Fname[strlen(Fname)-4], ".ini") == 0))\r
+               {\r
+                       CopyFile(Fname, AskIniFilePath(), FALSE);\r
+                       Ret = YES;\r
+               }\r
+               else\r
+                       MessageBox(NULL, MSGJPN293, "FFFTP", MB_OK);\r
+       }\r
+       return(Ret);\r
+}\r
+\r
+\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a/INI\83t\83@\83C\83\8b\82É\95\8e\9a\97ñ\82ð\83Z\81[\83u --------------------------------\r
+*\r
+*      Parameter\r
+*              HKEY hKey : \83\8c\83W\83X\83g\83\8a\83L\81[\r
+*              char *Key : \83L\81[\96¼\r
+*              char *Str : \83Z\81[\83u\82·\82é\95\8e\9a\97ñ\r
+*              char *DefaultStr : \83f\83t\83H\83\8b\83g\82Ì\95\8e\9a\97ñ\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*\r
+*      Note\r
+*              \95\8e\9a\97ñ\82ª\83f\83t\83H\83\8b\83g\82Ì\95\8e\9a\97ñ\82Æ\93¯\82\82È\82ç\83Z\81[\83u\82µ\82È\82¢\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void SaveStr(HKEY hKey, char *Key, char *Str, char *DefaultStr)\r
+{\r
+       if((DefaultStr != NULL) && (strcmp(Str, DefaultStr) == 0))\r
+               DeleteValue(hKey, Key);\r
+       else\r
+               WriteStringToReg(hKey, Key, Str);\r
+\r
+       return;\r
+}\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a/INI\83t\83@\83C\83\8b\82É\90\94\92l(INT)\82ð\83Z\81[\83u -----------------------------\r
+*\r
+*      Parameter\r
+*              HKEY hKey : \83\8c\83W\83X\83g\83\8a\83L\81[\r
+*              char *Key : \83L\81[\96¼\r
+*              int Num : \83Z\81[\83u\82·\82é\92l\r
+*              int DefaultNum : \83f\83t\83H\83\8b\83g\82Ì\92l\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*\r
+*      Note\r
+*              \90\94\92l\82ª\83f\83t\83H\83\8b\83g\82Ì\92l\82Æ\93¯\82\82È\82ç\83Z\81[\83u\82µ\82È\82¢\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void SaveIntNum(HKEY hKey, char *Key, int Num, int DefaultNum)\r
+{\r
+       if(Num == DefaultNum)\r
+               DeleteValue(hKey, Key);\r
+       else\r
+               WriteIntValueToReg(hKey, Key, Num);\r
+\r
+       return;\r
+}\r
+\r
+\r
+/*----- LOGFONT\83f\81[\83^\82ð\95\8e\9a\97ñ\82É\95Ï\8a·\82·\82é ---------------------------------------\r
+*\r
+*      Parameter\r
+*              LOGFONT Font : \83t\83H\83\93\83g\83f\81[\83^\r
+*              HFONT hFont : \83t\83H\83\93\83g\82Ì\83n\83\93\83h\83\8b\r
+*                      NULL = \83f\83t\83H\83\8b\83g\82Ì\83t\83H\83\93\83g\r
+*              char *Buf : \83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void MakeFontData(LOGFONT Font, HFONT hFont, char *Buf)\r
+{\r
+       *Buf = NUL;\r
+       if(hFont != NULL)\r
+               sprintf(Buf, "%d %d %d %d %d %d %d %d %d %d %d %d %d %s",\r
+                       Font.lfHeight, Font.lfWidth, Font.lfEscapement, Font.lfOrientation,\r
+                       Font.lfWeight, Font.lfItalic, Font.lfUnderline, Font.lfStrikeOut,\r
+                       Font.lfCharSet, Font.lfOutPrecision, Font.lfClipPrecision,\r
+                       Font.lfQuality, Font.lfPitchAndFamily, Font.lfFaceName);\r
+       return;\r
+}\r
+\r
+\r
+/*----- \95\8e\9a\97ñ\82ðLOGFONT\83f\81[\83^\82É\95Ï\8a·\82·\82é ---------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Str : \95\8e\9a\97ñ\r
+*              LOGFONT *Font : \83t\83H\83\93\83g\83f\81[\83^\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL=\95Ï\8a·\82Å\82«\82È\82¢\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int RestoreFontData(char *Str, LOGFONT *Font)\r
+{\r
+       int i;\r
+       int Sts;\r
+\r
+       Sts = FAIL;\r
+       if(sscanf(Str, "%d %d %d %d %d %d %d %d %d %d %d %d %d",\r
+                       &(Font->lfHeight), &(Font->lfWidth), &(Font->lfEscapement), &(Font->lfOrientation),\r
+                       &(Font->lfWeight), &(Font->lfItalic), &(Font->lfUnderline), &(Font->lfStrikeOut),\r
+                       &(Font->lfCharSet), &(Font->lfOutPrecision), &(Font->lfClipPrecision),\r
+                       &(Font->lfQuality), &(Font->lfPitchAndFamily)) == 13)\r
+       {\r
+               for(i = 13; i > 0; i--)\r
+               {\r
+                       if((Str = strchr(Str, ' ')) == NULL)\r
+                               break;\r
+                       Str++;\r
+               }\r
+               if(i == 0)\r
+               {\r
+                       strcpy(Font->lfFaceName, Str);\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+\r
+       if(Sts == FAIL)\r
+               memset(Font, NUL, sizeof(LOGFONT));\r
+\r
+       return(Sts);\r
+}\r
+\r
+/*----- \83p\83X\83\8f\81[\83h\82ð\88Ã\8d\86\89»\82·\82é ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Str : \83p\83X\83\8f\81[\83h\r
+*              char *Buf : \88Ã\8d\86\89»\82µ\82½\83p\83X\83\8f\81[\83h\82ð\8ai\94[\82·\82é\83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+static void EncodePassword(char *Str, char *Buf)\r
+{\r
+       EncodePassword2( Str, Buf, SecretKey );\r
+}\r
+\r
+/*----- \83p\83X\83\8f\81[\83h\82ð\88Ã\8d\86\89»\82·\82é(\83I\83\8a\83W\83i\83\8b\83A\83\8b\83S\83\8a\83Y\83\80)  ------------------\r
+*\r
+*      Parameter\r
+*              char *Str : \83p\83X\83\8f\81[\83h\r
+*              char *Buf : \88Ã\8d\86\89»\82µ\82½\83p\83X\83\8f\81[\83h\82ð\8ai\94[\82·\82é\83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void EncodePasswordOriginal(char *Str, char *Buf)\r
+{\r
+       unsigned char *Get;\r
+       unsigned char *Put;\r
+       int Rnd;\r
+       int Ch;\r
+\r
+       srand((unsigned)time(NULL));\r
+\r
+       Get = (unsigned char *)Str;\r
+       Put = (unsigned char *)Buf;\r
+       \r
+       if( *Get == NUL ){\r
+               *Put = NUL;\r
+               return;\r
+       }\r
+\r
+       /* \8e¯\95Ê\8eq\82ð\90æ\93ª\82É\92u\82­ */\r
+       Put[0] = '0';\r
+       Put[1] = 'A';\r
+       Put += 2;\r
+\r
+       while(*Get != NUL)\r
+       {\r
+               Rnd = rand() % 3;\r
+               Ch = ((int)*Get++) << Rnd;\r
+               Ch = (unsigned char)Ch | (unsigned char)(Ch >> 8);\r
+               *Put++ = 0x40 | ((Rnd & 0x3) << 4) | (Ch & 0xF);\r
+               *Put++ = 0x40 | ((Ch >> 4) & 0xF);\r
+               if((*(Put-2) & 0x1) != 0)\r
+                       *Put++ = (rand() % 62) + 0x40;\r
+       }\r
+       *Put = NUL;\r
+       return;\r
+}\r
+\r
+/*----- \83p\83X\83\8f\81[\83h\82ð\88Ã\8d\86\89»\82·\82é(\83I\83\8a\83W\83i\83\8b\83A\83\8b\83S\83\8a\83Y\83\80\81OKey)  ----------------\r
+*\r
+*      Parameter\r
+*              char *Str : \83p\83X\83\8f\81[\83h\r
+*              char *Buf : \88Ã\8d\86\89»\82µ\82½\83p\83X\83\8f\81[\83h\82ð\8ai\94[\82·\82é\83o\83b\83t\83@\r
+*              const char *Key : \88Ã\8d\86\89»\83L\81[\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void EncodePassword2(char *Str, char *Buf, const char* Key)\r
+{\r
+       unsigned char *Get;\r
+       unsigned char *Put;\r
+       int Rnd;\r
+       int Ch;\r
+\r
+       /* 2010.01.31 genta Key */\r
+       unsigned char *KeyHead = (unsigned char *)Key;\r
+       unsigned char *KeyEnd = KeyHead + strlen(KeyHead);\r
+       unsigned char *KeyCurrent = KeyHead;\r
+\r
+       srand((unsigned)time(NULL));\r
+\r
+       Get = (unsigned char *)Str;\r
+       Put = (unsigned char *)Buf;\r
+       \r
+       if( *Get == NUL ){\r
+               *Put = NUL;\r
+               return;\r
+       }\r
+\r
+       /* \8e¯\95Ê\8eq\82ð\90æ\93ª\82É\92u\82­ */\r
+       Put[0] = '0';\r
+       Put[1] = 'B';\r
+       Put += 2;\r
+\r
+       while(*Get != NUL)\r
+       {\r
+               Rnd = rand() % 3;\r
+               Ch = ((int)(*Get++ ^ *KeyCurrent)) << Rnd;\r
+               Ch = (unsigned char)Ch | (unsigned char)(Ch >> 8);\r
+               *Put++ = 0x40 | ((Rnd & 0x3) << 4) | (Ch & 0xF);\r
+               *Put++ = 0x40 | ((Ch >> 4) & 0xF);\r
+               if((*(Put-2) & 0x1) != 0)\r
+                       *Put++ = (rand() % 62) + 0x40;\r
+\r
+               /* 2010.01.31 genta Key */\r
+               if( ++KeyCurrent == KeyEnd ){\r
+                       KeyCurrent = KeyHead;\r
+               }\r
+       }\r
+       *Put = NUL;\r
+       return;\r
+}\r
+\r
+\r
+/*----- \83p\83X\83\8f\81[\83h\82Ì\88Ã\8d\86\89»\82ð\89ð\82­ ----------------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Str : \88Ã\8d\86\89»\82µ\82½\83p\83X\83\8f\81[\83h\r
+*              char *Buf : \83p\83X\83\8f\81[\83h\82ð\8ai\94[\82·\82é\83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void DecodePassword(char *Str, char *Buf)\r
+{\r
+       unsigned char *Get;\r
+       unsigned char *Put;\r
+\r
+       Get = (unsigned char *)Str;\r
+       Put = (unsigned char *)Buf;\r
+       \r
+       if( *Get == NUL ){\r
+               *Put = NUL;\r
+       }\r
+       else if( 0x40 <= *Get && *Get < 0x80 ){\r
+               /* Original algorithm */\r
+               DecodePasswordOriginal( Str, Buf );\r
+       }\r
+       else if( strncmp( Get, "0A", 2 ) == 0 ){\r
+               DecodePasswordOriginal( Str + 2, Buf );\r
+       }\r
+       else if( strncmp( Get, "0B", 2 ) == 0 ){\r
+               DecodePassword2( Str + 2, Buf, SecretKey );\r
+       }\r
+       else {\r
+               //      unknown encoding\r
+               *Put = NUL;\r
+               return;\r
+       }\r
+}\r
+\r
+/*----- \83p\83X\83\8f\81[\83h\82Ì\88Ã\8d\86\89»\82ð\89ð\82­(\83I\83\8a\83W\83i\83\8b\83A\83\8b\83S\83\8a\83Y\83\80) -------------------\r
+*\r
+*      Parameter\r
+*              char *Str : \88Ã\8d\86\89»\82µ\82½\83p\83X\83\8f\81[\83h\r
+*              char *Buf : \83p\83X\83\8f\81[\83h\82ð\8ai\94[\82·\82é\83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+static void DecodePasswordOriginal(char *Str, char *Buf)\r
+{\r
+       unsigned char *Get;\r
+       unsigned char *Put;\r
+       int Rnd;\r
+       int Ch;\r
+\r
+       Get = (unsigned char *)Str;\r
+       Put = (unsigned char *)Buf;\r
+\r
+       while(*Get != NUL)\r
+       {\r
+               Rnd = ((unsigned int)*Get >> 4) & 0x3;\r
+               Ch = (*Get & 0xF) | ((*(Get+1) & 0xF) << 4);\r
+               Ch <<= 8;\r
+               if((*Get & 0x1) != 0)\r
+                       Get++;\r
+               Get += 2;\r
+               Ch >>= Rnd;\r
+               Ch = (Ch & 0xFF) | ((Ch >> 8) & 0xFF);\r
+               *Put++ = Ch;\r
+       }\r
+       *Put = NUL;\r
+       return;\r
+}\r
+\r
+/*----- \83p\83X\83\8f\81[\83h\82Ì\88Ã\8d\86\89»\82ð\89ð\82­(\83I\83\8a\83W\83i\83\8b\83A\83\8b\83S\83\8a\83Y\83\80\81OKey) -------------------\r
+*\r
+*      Parameter\r
+*              char *Str : \88Ã\8d\86\89»\82µ\82½\83p\83X\83\8f\81[\83h\r
+*              char *Buf : \83p\83X\83\8f\81[\83h\82ð\8ai\94[\82·\82é\83o\83b\83t\83@\r
+*              const char *Key : \88Ã\8d\86\89»\83L\81[\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+static void DecodePassword2(char *Str, char *Buf, const char* Key)\r
+{\r
+       int Rnd;\r
+       int Ch;\r
+       unsigned char *Get = (unsigned char *)Str;\r
+       unsigned char *Put = (unsigned char *)Buf;\r
+\r
+       /* 2010.01.31 genta Key */\r
+       unsigned char *KeyHead = (unsigned char *)Key;\r
+       unsigned char *KeyEnd = KeyHead + strlen(KeyHead);\r
+       unsigned char *KeyCurrent = KeyHead;\r
+\r
+       while(*Get != NUL)\r
+       {\r
+               Rnd = ((unsigned int)*Get >> 4) & 0x3;\r
+               Ch = (*Get & 0xF) | ((*(Get+1) & 0xF) << 4);\r
+               Ch <<= 8;\r
+               if((*Get & 0x1) != 0)\r
+                       Get++;\r
+               Get += 2;\r
+               Ch >>= Rnd;\r
+               Ch = (Ch & 0xFF) | ((Ch >> 8) & 0xFF);\r
+               *Put++ = Ch ^ *KeyCurrent;\r
+               \r
+               /* 2010.01.31 genta Key */\r
+               if( ++KeyCurrent == KeyEnd ){\r
+                       KeyCurrent = KeyHead;\r
+               }\r
+       }\r
+       *Put = NUL;\r
+       return;\r
+}\r
+\r
+\r
+/*===== \83\8c\83W\83X\83g\83\8a\82ÆINI\83t\83@\83C\83\8b\82Ì\83A\83N\83Z\83X\8f\88\97\9d ============*/\r
+\r
+\r
+/*===== INI\83t\83@\83C\83\8b\97p\82Ì\83\8c\83W\83X\83g\83\8a\83f\81[\83^ =====*/\r
+\r
+typedef struct regdatatbl {\r
+       char KeyName[80+1];                     /* \83L\81[\96¼ */\r
+       char ValTbl[REG_SECT_MAX];      /* \92l\82Ì\83e\81[\83u\83\8b */\r
+       int ValLen;                                     /* \92l\83f\81[\83^\82Ì\83o\83C\83g\90\94 */\r
+       int Mode;                                       /* \83L\81[\82Ì\83\82\81[\83h */\r
+       struct regdatatbl *Next;\r
+} REGDATATBL;\r
+\r
+/*===== \83v\83\8d\83g\83^\83C\83v =====*/\r
+\r
+static BOOL WriteOutRegToFile(REGDATATBL *Pos);\r
+static int ReadInReg(char *Name, REGDATATBL **Handle);\r
+static int StrCatOut(char *Src, int Len, char *Dst);\r
+static int StrReadIn(char *Src, int Max, char *Dst);\r
+static char *ScanValue(void *Handle, char *Name);\r
+\r
+\r
+/*===== \83\8d\81[\83J\83\8b\82È\83\8f\81[\83N =====*/\r
+\r
+static int TmpRegType;\r
+\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a\82Ì\83^\83C\83v\82ð\90Ý\92è\82·\82é ------------------------------------------\r
+*\r
+*      Parameter\r
+*              int Type : \83^\83C\83v (REGTYPE_xxx)\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static void SetRegType(int Type)\r
+{\r
+       TmpRegType = Type;\r
+       return;\r
+}\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a/INI\83t\83@\83C\83\8b\82ð\83I\81[\83v\83\93\82·\82é\81i\93Ç\82Ý\8d\9e\82Ý\81j-----------------------\r
+*\r
+*      Parameter\r
+*              char *Name : \83\8c\83W\83X\83g\83\8a\96¼\r
+*              void **Handle : \83n\83\93\83h\83\8b\82ð\95Ô\82·\83\8f\81[\83N\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int OpenReg(char *Name, void **Handle)\r
+{\r
+       int Sts;\r
+       char Tmp[FMAX_PATH+1];\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               strcpy(Tmp, "Software\\Sota\\");\r
+               strcat(Tmp, Name);\r
+               if(RegOpenKeyEx(HKEY_CURRENT_USER, Tmp, 0, KEY_READ, (HKEY *)Handle) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               if((Sts = ReadInReg(Name, (REGDATATBL **)Handle)) == SUCCESS)\r
+                       ((REGDATATBL *)(*Handle))->Mode = 0;\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a/INI\83t\83@\83C\83\8b\82ð\8dì\90¬\82·\82é\81i\8f\91\82«\8d\9e\82Ý\81j---------------------------\r
+*\r
+*      Parameter\r
+*              char *Name : \83\8c\83W\83X\83g\83\8a\96¼\r
+*              void **Handle : \83n\83\93\83h\83\8b\82ð\95Ô\82·\83\8f\81[\83N\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int CreateReg(char *Name, void **Handle)\r
+{\r
+       int Sts;\r
+       char Tmp[FMAX_PATH+1];\r
+       DWORD Dispos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               strcpy(Tmp, "Software\\Sota\\");\r
+               strcat(Tmp, Name);\r
+               if(RegCreateKeyEx(HKEY_CURRENT_USER, Tmp, 0, "", REG_OPTION_NON_VOLATILE, KEY_CREATE_SUB_KEY | KEY_SET_VALUE, NULL, (HKEY *)Handle, &Dispos) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               if((*Handle = malloc(sizeof(REGDATATBL))) != NULL)\r
+               {\r
+                       strcpy(((REGDATATBL *)(*Handle))->KeyName, Name);\r
+                       ((REGDATATBL *)(*Handle))->ValLen = 0;\r
+                       ((REGDATATBL *)(*Handle))->Next = NULL;\r
+                       ((REGDATATBL *)(*Handle))->Mode = 1;\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a/INI\83t\83@\83C\83\8b\82ð\83N\83\8d\81[\83Y\82·\82é ----------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int CloseReg(void *Handle)\r
+{\r
+       REGDATATBL *Pos;\r
+       REGDATATBL *Next;\r
+       FILE *Strm;\r
+\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               RegCloseKey(Handle);\r
+\r
+               /* INI\83t\83@\83C\83\8b\82ð\8dí\8f\9c */\r
+               if((Strm = fopen(AskIniFilePath(), "rt")) != NULL)\r
+               {\r
+                       fclose(Strm);\r
+                       MoveFileToTrashCan(AskIniFilePath());\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if(((REGDATATBL *)Handle)->Mode == 1)\r
+               {\r
+                       if(WriteOutRegToFile(Handle) == TRUE)\r
+                       {\r
+//                             /* \83\8c\83W\83X\83g\83\8a\82ð\83N\83\8a\83A */\r
+//                             ClearRegistory();\r
+                       }\r
+               }\r
+               /* \83e\81[\83u\83\8b\82ð\8dí\8f\9c */\r
+               Pos = Handle;\r
+               while(Pos != NULL)\r
+               {\r
+                       Next = Pos->Next;\r
+                       free(Pos);\r
+                       Pos = Next;\r
+               }\r
+       }\r
+       return(SUCCESS);\r
+}\r
+\r
+\r
+/*----- \83\8c\83W\83X\83g\83\8a\8fî\95ñ\82ðINI\83t\83@\83C\83\8b\82É\8f\91\82«\8d\9e\82Þ ---------------------------------\r
+*\r
+*      Parameter\r
+*              REGDATATBL *Pos : \83\8c\83W\83X\83g\83\8a\83f\81[\83^\r
+*\r
+*      Return Value\r
+*              \82È\82µ\r
+*----------------------------------------------------------------------------*/\r
+\r
+static BOOL WriteOutRegToFile(REGDATATBL *Pos)\r
+{\r
+       FILE *Strm;\r
+       char *Disp;\r
+       BOOL Ret;\r
+\r
+       Ret = FALSE;\r
+       if((Strm = fopen(AskIniFilePath(), "wt")) != NULL)\r
+       {\r
+               fprintf(Strm, MSGJPN239);\r
+               while(Pos != NULL)\r
+               {\r
+                       fprintf(Strm, "\n[%s]\n", Pos->KeyName);\r
+\r
+                       Disp = Pos->ValTbl;\r
+                       while(Disp < (Pos->ValTbl + Pos->ValLen))\r
+                       {\r
+                               fprintf(Strm, "%s\n", Disp);\r
+                               Disp = Disp + strlen(Disp) + 1;\r
+                       }\r
+                       Pos = Pos->Next;\r
+               }\r
+               fclose(Strm);\r
+               Ret = TRUE;\r
+       }\r
+       else\r
+               MessageBox(NULL, MSGJPN240, "FFFTP", MB_OK);\r
+\r
+       return(Ret);\r
+}\r
+\r
+\r
+/*----- INI\83t\83@\83C\83\8b\82©\82ç\83\8c\83W\83X\83g\83\8a\8fî\95ñ\82ð\93Ç\82Ý\8d\9e\82Þ -------------------------------\r
+*\r
+*      Parameter\r
+*              char *Name : \96¼\91O\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int ReadInReg(char *Name, REGDATATBL **Handle)\r
+{\r
+       FILE *Strm;\r
+       char *Buf;\r
+       char *Tmp;\r
+       char *Data;\r
+       REGDATATBL *New;\r
+       REGDATATBL *Pos;\r
+       int Sts;\r
+\r
+       Sts = FAIL;\r
+       *Handle = NULL;\r
+\r
+       if((Strm = fopen(AskIniFilePath(), "rt")) != NULL)\r
+       {\r
+               if((Buf = malloc(REG_SECT_MAX)) != NULL)\r
+               {\r
+                       while(fgets(Buf, REG_SECT_MAX, Strm) != NULL)\r
+                       {\r
+                               if(*Buf != '#')\r
+                               {\r
+                                       if((Tmp = strchr(Buf, '\n')) != NULL)\r
+                                               *Tmp = NUL;\r
+\r
+                                       if(*Buf == '[')\r
+                                       {\r
+                                               if((New = malloc(sizeof(REGDATATBL))) != NULL)\r
+                                               {\r
+                                                       if((Tmp = strchr(Buf, ']')) != NULL)\r
+                                                               *Tmp = NUL;\r
+                                                       strcpy(New->KeyName, Buf+1);\r
+                                                       New->ValLen = 0;\r
+                                                       New->Next = NULL;\r
+                                                       Data = New->ValTbl;\r
+                                               }\r
+                                               if(*Handle == NULL)\r
+                                                       *Handle = New;\r
+                                               else\r
+                                               {\r
+                                                       Pos = *Handle;\r
+                                                       while(Pos->Next != NULL)\r
+                                                               Pos = Pos->Next;\r
+                                                       Pos->Next = New;\r
+                                               }\r
+                                       }\r
+                                       else if(strlen(Buf) > 0)\r
+                                       {\r
+                                               strcpy(Data, Buf);\r
+                                               Data += strlen(Buf) + 1;\r
+                                               New->ValLen += strlen(Buf) + 1;\r
+                                       }\r
+                               }\r
+                       }\r
+                       Sts = SUCCESS;\r
+                       free(Buf);\r
+               }\r
+               fclose(Strm);\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83T\83u\83L\81[\82ð\83I\81[\83v\83\93\82·\82é ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Parent : \90e\82Ì\83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              void **Handle : \83n\83\93\83h\83\8b\82ð\95Ô\82·\83\8f\81[\83N\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int OpenSubKey(void *Parent, char *Name, void **Handle)\r
+{\r
+       int Sts;\r
+       char Key[80];\r
+       REGDATATBL *Pos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegOpenKeyEx(Parent, Name, 0, KEY_READ, (HKEY *)Handle) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               strcpy(Key, ((REGDATATBL *)Parent)->KeyName);\r
+               strcat(Key, "\\");\r
+               strcat(Key, Name);\r
+               Pos = Parent;\r
+               while(Pos != NULL)\r
+               {\r
+                       if(strcmp(Pos->KeyName, Key) == 0)\r
+                       {\r
+                               *Handle = Pos;\r
+                               Sts = SUCCESS;\r
+                               break;\r
+                       }\r
+                       Pos = Pos->Next;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83T\83u\83L\81[\82ð\8dì\90¬\82·\82é ----------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Parent : \90e\82Ì\83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              void **Handle : \83n\83\93\83h\83\8b\82ð\95Ô\82·\83\8f\81[\83N\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int CreateSubKey(void *Parent, char *Name, void **Handle)\r
+{\r
+       int Sts;\r
+       DWORD Dispos;\r
+       REGDATATBL *Pos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegCreateKeyEx(Parent, Name, 0, "", REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, (HKEY *)Handle, &Dispos) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               if((*Handle = malloc(sizeof(REGDATATBL))) != NULL)\r
+               {\r
+                       strcpy(((REGDATATBL *)(*Handle))->KeyName, ((REGDATATBL *)Parent)->KeyName);\r
+                       strcat(((REGDATATBL *)(*Handle))->KeyName, "\\");\r
+                       strcat(((REGDATATBL *)(*Handle))->KeyName, Name);\r
+\r
+                       ((REGDATATBL *)(*Handle))->ValLen = 0;\r
+                       ((REGDATATBL *)(*Handle))->Next = NULL;\r
+\r
+                       Pos = (REGDATATBL *)Parent;\r
+                       while(Pos->Next != NULL)\r
+                               Pos = Pos->Next;\r
+                       Pos->Next = *Handle;\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83T\83u\83L\81[\82ð\83N\83\8d\81[\83Y\82·\82é ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int CloseSubKey(void *Handle)\r
+{\r
+       if(TmpRegType == REGTYPE_REG)\r
+               RegCloseKey(Handle);\r
+       else\r
+       {\r
+               /* Nothing */\r
+       }\r
+       return(SUCCESS);\r
+}\r
+\r
+\r
+/*----- \83T\83u\83L\81[\82ð\8dí\8f\9c\82·\82é ----------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int DeleteSubKey(void *Handle, char *Name)\r
+{\r
+       int Sts;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegDeleteKey(Handle, Name) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               Sts = FAIL;\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \92l\82ð\8dí\8f\9c\82·\82é ----------------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int DeleteValue(void *Handle, char *Name)\r
+{\r
+       int Sts;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegDeleteValue(Handle, Name) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               Sts = FAIL;\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- INT\92l\82ð\93Ç\82Ý\8d\9e\82Þ -------------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              int *Value : INT\92l\82ð\95Ô\82·\83\8f\81[\83N\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int ReadIntValueFromReg(void *Handle, char *Name, int *Value)\r
+{\r
+       int Sts;\r
+       DWORD Size;\r
+       char *Pos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               Size = sizeof(int);\r
+               if(RegQueryValueEx(Handle, Name, NULL, NULL, (BYTE *)Value, &Size) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               if((Pos = ScanValue(Handle, Name)) != NULL)\r
+               {\r
+                       *Value = atoi(Pos);\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- INT\92l\82ð\8f\91\82«\8d\9e\82Þ -------------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              int Value : INT\92l\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int WriteIntValueToReg(void *Handle, char *Name, int Value)\r
+{\r
+       REGDATATBL *Pos;\r
+       char *Data;\r
+       char Tmp[20];\r
+\r
+       if(TmpRegType == REGTYPE_REG)\r
+               RegSetValueEx(Handle, Name, 0, REG_DWORD, (CONST BYTE *)&Value, sizeof(int));\r
+       else\r
+       {\r
+               Pos = (REGDATATBL *)Handle;\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               strcpy(Data, Name);\r
+               strcat(Data, "=");\r
+               sprintf(Tmp, "%d", Value);\r
+               strcat(Data, Tmp);\r
+               Pos->ValLen += strlen(Data) + 1;\r
+       }\r
+       return(SUCCESS);\r
+}\r
+\r
+\r
+/*----- \95\8e\9a\97ñ\82ð\93Ç\82Ý\8d\9e\82Þ ------------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              char *Str : \95\8e\9a\97ñ\82ð\95Ô\82·\83\8f\81[\83N\r
+*              DWORD Size : \8dÅ\91å\83T\83C\83Y\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int ReadStringFromReg(void *Handle, char *Name, char *Str, DWORD Size)\r
+{\r
+       int Sts;\r
+       char *Pos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegQueryValueEx(Handle, Name, NULL, NULL, (BYTE *)Str, &Size) == ERROR_SUCCESS)\r
+               {\r
+                       if(*(Str + Size - 1) != NUL)\r
+                               *(Str + Size) = NUL;\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if((Pos = ScanValue(Handle, Name)) != NULL)\r
+               {\r
+                       Size = min1(Size-1, strlen(Pos));\r
+                       Size = StrReadIn(Pos, Size, Str);\r
+                       *(Str + Size) = NUL;\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \95\8e\9a\97ñ\82ð\8f\91\82«\8d\9e\82Þ ------------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              char *Str :\95\8e\9a\97ñ\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int WriteStringToReg(void *Handle, char *Name, char *Str)\r
+{\r
+       REGDATATBL *Pos;\r
+       char *Data;\r
+\r
+       if(TmpRegType == REGTYPE_REG)\r
+               RegSetValueEx(Handle, Name, 0, REG_SZ, (CONST BYTE *)Str, strlen(Str)+1);\r
+       else\r
+       {\r
+               Pos = (REGDATATBL *)Handle;\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               strcpy(Data, Name);\r
+               strcat(Data, "=");\r
+               Pos->ValLen += strlen(Data);\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               Pos->ValLen += StrCatOut(Str, strlen(Str), Data) + 1;\r
+       }\r
+       return(SUCCESS);\r
+}\r
+\r
+\r
+/*----- \83}\83\8b\83`\95\8e\9a\97ñ\82ð\93Ç\82Ý\8d\9e\82Þ ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              char *Str : \95\8e\9a\97ñ\82ð\95Ô\82·\83\8f\81[\83N\r
+*              DWORD Size : \8dÅ\91å\83T\83C\83Y\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int ReadMultiStringFromReg(void *Handle, char *Name, char *Str, DWORD Size)\r
+{\r
+       int Sts;\r
+       char *Pos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegQueryValueEx(Handle, Name, NULL, NULL, (BYTE *)Str, &Size) == ERROR_SUCCESS)\r
+               {\r
+                       if(*(Str + Size - 1) != NUL)\r
+                               *(Str + Size) = NUL;\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if((Pos = ScanValue(Handle, Name)) != NULL)\r
+               {\r
+                       Size = min1(Size-1, strlen(Pos));\r
+                       Size = StrReadIn(Pos, Size, Str);\r
+                       *(Str + Size) = NUL;\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83}\83\8b\83`\95\8e\9a\97ñ\82ð\8f\91\82«\8d\9e\82Þ ------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              char *Str : \95\8e\9a\97ñ\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int WriteMultiStringToReg(void *Handle, char *Name, char *Str)\r
+{\r
+       REGDATATBL *Pos;\r
+       char *Data;\r
+\r
+       if(TmpRegType == REGTYPE_REG)\r
+               RegSetValueEx(Handle, Name, 0, REG_MULTI_SZ, (CONST BYTE *)Str, StrMultiLen(Str)+1);\r
+       else\r
+       {\r
+               Pos = (REGDATATBL *)Handle;\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               strcpy(Data, Name);\r
+               strcat(Data, "=");\r
+               Pos->ValLen += strlen(Data);\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               Pos->ValLen += StrCatOut(Str, StrMultiLen(Str), Data) + 1;\r
+       }\r
+       return(SUCCESS);\r
+}\r
+\r
+\r
+/*----- \83o\83C\83i\83\8a\82ð\93Ç\82Ý\8d\9e\82Þ-----------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              void *Bin : \83o\83C\83i\83\8a\82ð\95Ô\82·\83\8f\81[\83N\r
+*              DWORD Size : \8dÅ\91å\83T\83C\83Y\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int ReadBinaryFromReg(void *Handle, char *Name, void *Bin, DWORD Size)\r
+{\r
+       int Sts;\r
+       char *Pos;\r
+\r
+       Sts = FAIL;\r
+       if(TmpRegType == REGTYPE_REG)\r
+       {\r
+               if(RegQueryValueEx(Handle, Name, NULL, NULL, (BYTE *)Bin, &Size) == ERROR_SUCCESS)\r
+                       Sts = SUCCESS;\r
+       }\r
+       else\r
+       {\r
+               if((Pos = ScanValue(Handle, Name)) != NULL)\r
+               {\r
+                       Size = min1(Size, strlen(Pos));\r
+                       Size = StrReadIn(Pos, Size, Bin);\r
+                       Sts = SUCCESS;\r
+               }\r
+       }\r
+       return(Sts);\r
+}\r
+\r
+\r
+/*----- \83o\83C\83i\83\8a\82ð\8f\91\82«\8d\9e\82Þ ----------------------------------------------------\r
+*\r
+*      Parameter\r
+*              void *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*              void *Bin : \83o\83C\83i\83\8a\r
+*              int Len : \92·\82³\r
+*\r
+*      Return Value\r
+*              int \83X\83e\81[\83^\83X\r
+*                      SUCCESS/FAIL\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int WriteBinaryToReg(void *Handle, char *Name, void *Bin, int Len)\r
+{\r
+       REGDATATBL *Pos;\r
+       char *Data;\r
+\r
+       if(TmpRegType == REGTYPE_REG)\r
+               RegSetValueEx(Handle, Name, 0, REG_BINARY, (CONST BYTE *)Bin, Len);\r
+       else\r
+       {\r
+               Pos = (REGDATATBL *)Handle;\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               strcpy(Data, Name);\r
+               strcat(Data, "=");\r
+               Pos->ValLen += strlen(Data);\r
+               Data = Pos->ValTbl + Pos->ValLen;\r
+               Pos->ValLen += StrCatOut(Bin, Len, Data) + 1;\r
+       }\r
+       return(SUCCESS);\r
+}\r
+\r
+\r
+/*----- \95\8e\9a\97ñ\82ð\83o\83b\83t\83@\82É\92Ç\89Á\8f\91\82«\8d\9e\82Ý\82·\82é ------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Src : \95\8e\9a\97ñ\r
+*              int len : \95\8e\9a\97ñ\82Ì\92·\82³\r
+*              char *Dst : \8f\91\82«\8d\9e\82Ý\82·\82é\83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              int \92Ç\89Á\82µ\82½\83o\83C\83g\90\94\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int StrCatOut(char *Src, int Len, char *Dst)\r
+{\r
+       int Count;\r
+\r
+       Dst += strlen(Dst);\r
+       Count = 0;\r
+       for(; Len > 0; Len--)\r
+       {\r
+               if(*Src == '\\')\r
+               {\r
+                       *Dst++ = '\\';\r
+                       *Dst++ = '\\';\r
+                       Count += 2;\r
+               }\r
+               else if((*Src >= 0x20) && (*Src <= 0x7E))\r
+               {\r
+                       *Dst++ = *Src;\r
+                       Count++;\r
+               }\r
+               else\r
+               {\r
+                       sprintf(Dst, "\\%02X", *(unsigned char *)Src);\r
+                       Dst += 3;\r
+                       Count += 3;\r
+               }\r
+               Src++;\r
+       }\r
+       *Dst = NUL;\r
+       return(Count);\r
+}\r
+\r
+\r
+/*----- \95\8e\9a\97ñ\82ð\83o\83b\83t\83@\82É\93Ç\82Ý\8d\9e\82Þ --------------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Src : \95\8e\9a\97ñ\r
+*              int Max : \8dÅ\91å\83T\83C\83Y\r
+*              char *Dst : \8f\91\82«\8d\9e\82Ý\82·\82é\83o\83b\83t\83@\r
+*\r
+*      Return Value\r
+*              int \93Ç\82Ý\8d\9e\82ñ\82¾\83o\83C\83g\90\94\r
+*----------------------------------------------------------------------------*/\r
+\r
+static int StrReadIn(char *Src, int Max, char *Dst)\r
+{\r
+       int Count;\r
+       int Tmp;\r
+\r
+       Count = 0;\r
+       while(*Src != NUL)\r
+       {\r
+               if(Count >= Max)\r
+                       break;\r
+\r
+               if(*Src == '\\')\r
+               {\r
+                       Src++;\r
+                       if(*Src == '\\')\r
+                               *Dst = '\\';\r
+                       else\r
+                       {\r
+                               sscanf(Src, "%02x", &Tmp);\r
+                               *Dst = Tmp;\r
+                               Src++;\r
+                       }\r
+               }\r
+               else\r
+                       *Dst = *Src;\r
+\r
+               Count++;\r
+               Dst++;\r
+               Src++;\r
+       }\r
+       return(Count);\r
+}\r
+\r
+\r
+/*----- \92l\82ð\8c\9f\8dõ\82·\82é ----------------------------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Handle : \83n\83\93\83h\83\8b\r
+*              char *Name : \96¼\91O\r
+*\r
+*      Return Value\r
+*              char *\92l\83f\81[\83^\82Ì\90æ\93ª\r
+*                      NULL=\8ew\92è\82Ì\96¼\91O\82Ì\92l\82ª\8c©\82Â\82©\82ç\82È\82¢\r
+*----------------------------------------------------------------------------*/\r
+\r
+static char *ScanValue(void *Handle, char *Name)\r
+{\r
+       REGDATATBL *Cur;\r
+       char *Pos;\r
+       char *Ret;\r
+\r
+       Ret = NULL;\r
+       Cur = Handle;\r
+       Pos = Cur->ValTbl;\r
+       while(Pos < (Cur->ValTbl + Cur->ValLen))\r
+       {\r
+               if((strncmp(Name, Pos, strlen(Name)) == 0) &&\r
+                  (*(Pos + strlen(Name)) == '='))\r
+               {\r
+                       Ret = Pos + strlen(Name) + 1;\r
+                       break;\r
+               }\r
+               Pos += strlen(Pos) + 1;\r
+       }\r
+       return(Ret);\r
+}\r
+\r
+\r
+/*----------- \83p\83X\83\8f\81[\83h\82Ì\91Ã\93\96\90«\82ð\8am\94F\82·\82é ------------------------------------\r
+*\r
+*      Parameter\r
+*              char *Password: \83p\83X\83\8f\81[\83h\95\8e\9a\97ñ\r
+*              char *HashStr: SHA-1\83n\83b\83V\83\85\95\8e\9a\97ñ\r
+*\r
+*      Return Value\r
+*              int 0 \95s\88ê\92v\r
+*                      1: \88ê\92v\r
+*                      2: \88Ù\8fí\r
+*----------------------------------------------------------------------------*/\r
+int CheckPasswordValidity( char* Password, int length, const char* HashStr )\r
+{\r
+       ulong hash1[5];\r
+       ulong hash2[5];\r
+       \r
+       int i, j;\r
+       \r
+       const char* p = HashStr;\r
+       \r
+       /* \8bó\95\8e\9a\97ñ\82Í\88ê\92v\82µ\82½\82±\82Æ\82É\82·\82é */\r
+       if( HashStr[0] == NUL ) return 1;\r
+\r
+       /* Hash\82ð\83`\83F\83b\83N\82·\82é\82·\82é*/\r
+       if( strlen(HashStr) != 40 )     return 2;\r
+\r
+       /* Hash\82ð\83f\83R\81[\83h\82·\82é*/\r
+       for( i = 0; i < 5; i++ ){\r
+               ulong decode = 0;\r
+               for( j = 0; j < 8; j++ ){\r
+                       if( *p < 0x40 || 0x40 + 15 < *p ){\r
+                               return 2;\r
+                       }\r
+                       decode = (decode << 4 ) + (*p - 0x40);\r
+                       ++p;\r
+               }\r
+               hash1[i] = decode;\r
+       }\r
+       \r
+       /* Password \82ð\83n\83b\83V\83\85\82·\82é */\r
+       sha_memory( Password, length, hash2 );\r
+       \r
+       if( memcmp( (char*)hash1, (char*)hash2, sizeof( hash1 )) == 0 ){\r
+               return 1;\r
+       }\r
+       return 0;\r
+}\r
+\r
+/*----------- \83p\83X\83\8f\81[\83h\82Ì\91Ã\93\96\90«\83`\83F\83b\83N\82Ì\82½\82ß\82Ì\95\8e\9a\97ñ\82ð\8dì\90¬\82·\82é ------------\r
+*\r
+*      Parameter\r
+*              char *Password: \83p\83X\83\8f\81[\83h\95\8e\9a\97ñ\r
+*              char *Str: SHA-1\83n\83b\83V\83\85\95\8e\9a\97ñ\8ai\94[\8fê\8f\8a (41bytes\88È\8fã)\r
+*\r
+*      Return Value\r
+*              None\r
+*----------------------------------------------------------------------------*/\r
+void CreatePasswordHash( char* Password, int length, char* HashStr )\r
+{\r
+       ulong hash[5];\r
+       int i, j;\r
+       unsigned char *p = (unsigned char *)HashStr;\r
+\r
+       sha_memory( Password, length, hash );\r
+\r
+       for( i = 0; i < 5; i++ ){\r
+               ulong rest = hash[i];\r
+               for( j = 0; j < 8; j++ ){\r
+                       *p++ = (unsigned char)((rest & 0xf0000000) >> 28) + '@';\r
+                       rest <<= 4;\r
+               }\r
+       }\r
+       *p = NUL;\r
+}\r
+\r
+void SetHashSalt( DWORD salt )\r
+{\r
+       unsigned char* pos = &SecretKey[strlen(SecretKey) + 1];\r
+       *pos++ = ( salt >> 24 ) & 0xff;\r
+       *pos++ = ( salt >> 16 ) & 0xff;\r
+       *pos++ = ( salt >>  8 ) & 0xff;\r
+       *pos++ = ( salt       ) & 0xff;\r
+       \r
+       SecretKeyLength = strlen( SecretKey ) + 5;\r
+}\r
diff --git a/OleDragDrop.c b/OleDragDrop.c
new file mode 100644 (file)
index 0000000..29ee82e
--- /dev/null
@@ -0,0 +1,814 @@
+/**************************************************************************\r
+\r
+       OleDragDrop.c\r
+\r
+       (C) Copyright 1996-2002 By Tomoaki Nakashima. All right reserved.       \r
+               http://www.nakka.com/\r
+               nakka@nakka.com\r
+\r
+**************************************************************************/\r
+\r
+/**************************************************************************\r
+       Include Files\r
+**************************************************************************/\r
+\r
+#define _INC_OLE\r
+#include <windows.h>\r
+#undef _INC_OLE\r
+\r
+#include <oleidl.h>\r
+#include <objidl.h>\r
+\r
+#include "OleDragDrop.h"\r
+\r
+\r
+/* Clipboard format \82©\82ç Type of storage medium \82ð\8eæ\93¾ */\r
+static DWORD FormatToTymed(const UINT cfFormat)\r
+{\r
+       switch(cfFormat)\r
+       {\r
+       case CF_BITMAP:\r
+               return TYMED_GDI;\r
+\r
+       case CF_METAFILEPICT:\r
+               return TYMED_MFPICT;\r
+\r
+       case CF_ENHMETAFILE:\r
+               return TYMED_ENHMF;\r
+       }\r
+       return TYMED_HGLOBAL;\r
+}\r
+\r
+\r
+/******************************************************************************\r
+\r
+       IDropTarget\r
+\r
+******************************************************************************/\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_QueryInterface(LPDROPTARGET pThis, REFIID riid, LPVOID *ppvObject);\r
+static ULONG STDMETHODCALLTYPE OLE_IDropTarget_AddRef(LPDROPTARGET pThis);\r
+static ULONG STDMETHODCALLTYPE OLE_IDropTarget_Release(LPDROPTARGET pThis);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_DragEnter(LPDROPTARGET pThis, LPDATAOBJECT pdo, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_DragOver(LPDROPTARGET pThis, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_DragLeave(LPDROPTARGET pThis);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_Drop(LPDROPTARGET pThis, LPDATAOBJECT pdo, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect);\r
+static HRESULT APIPRIVATE OLE_IDropTarget_Internal_SendMessage(LPDROPTARGET pThis, UINT uNotify, LPDATAOBJECT pdo, DWORD grfKeyState, POINTL *ppt, LPDWORD pdwEffect);\r
+static HRESULT APIPRIVATE DropTarget_GetData(LPDATAOBJECT pdo, UINT cfFormat, LPSTGMEDIUM psm);\r
+static HRESULT APIPRIVATE DropTarget_QueryGetData(LPDATAOBJECT pdo, UINT cfFormat);\r
+\r
+/* IDropTarget Virtual Table */\r
+static IDropTargetVtbl dtv = {\r
+       OLE_IDropTarget_QueryInterface,\r
+       OLE_IDropTarget_AddRef,\r
+       OLE_IDropTarget_Release,\r
+       OLE_IDropTarget_DragEnter,\r
+       OLE_IDropTarget_DragOver,\r
+       OLE_IDropTarget_DragLeave,\r
+       OLE_IDropTarget_Drop\r
+};\r
+\r
+typedef struct _IDROPTARGET_INTERNAL{\r
+       LPVOID lpVtbl;\r
+       ULONG m_refCnt;\r
+       HWND hWnd;\r
+       UINT uCallbackMessage;\r
+       UINT *cFormat;\r
+       int cfcnt;\r
+       IDROPTARGET_NOTIFY dtn;\r
+}IDROPTARGET_INTERNAL , *LPIDROPTARGET_INTERNAL;\r
+\r
+/* OLE\82Ì\83h\83\8d\83b\83v\83^\81[\83Q\83b\83g\82Æ\82µ\82Ä\93o\98^\82·\82é */\r
+BOOL APIPRIVATE OLE_IDropTarget_RegisterDragDrop(HWND hWnd, UINT uCallbackMessage, UINT *cFormat, int cfcnt)\r
+{\r
+       static IDROPTARGET_INTERNAL *pdti;\r
+\r
+       pdti = GlobalAlloc(GPTR, sizeof(IDROPTARGET_INTERNAL));\r
+       if(pdti == NULL){\r
+               return FALSE;\r
+       }\r
+       pdti->lpVtbl = (LPVOID)&dtv;\r
+       pdti->m_refCnt = 0;\r
+       pdti->hWnd = hWnd;                                                                                                      /* \83\81\83b\83Z\81[\83W\82ð\8eó\82¯\8eæ\82é\83E\83B\83\93\83h\83E */\r
+       pdti->uCallbackMessage = uCallbackMessage;                                                      /* \83\81\83b\83Z\81[\83W */\r
+       pdti->cFormat = (UINT *)GlobalAlloc(GPTR, sizeof(UINT) * cfcnt);                /* \91Î\89\9e\82µ\82Ä\82¢\82é\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g */\r
+       if(pdti->cFormat == NULL){\r
+               GlobalFree(pdti);\r
+               return FALSE;\r
+       }\r
+       CopyMemory(pdti->cFormat, cFormat, sizeof(UINT) * cfcnt);\r
+       pdti->cfcnt = cfcnt;                                                                                            /* \83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\90\94 */\r
+       return (S_OK == RegisterDragDrop(hWnd, (LPDROPTARGET)pdti));\r
+}\r
+\r
+/* OLE\82Ì\83h\83\8d\83b\83v\83^\81[\83Q\83b\83g\82ð\89ð\8f\9c\82·\82é */\r
+void APIPRIVATE OLE_IDropTarget_RevokeDragDrop(HWND hWnd)\r
+{\r
+       RevokeDragDrop(hWnd);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_QueryInterface(LPDROPTARGET pThis, REFIID riid, PVOID *ppvObject)\r
+{\r
+       //\97v\8b\81\82³\82ê\82½IID\82Æ\93¯\82\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82ð\95Ô\82·\r
+       if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDropTarget)){\r
+               *ppvObject = (LPVOID)pThis;\r
+               ((LPUNKNOWN)*ppvObject)->lpVtbl->AddRef((LPUNKNOWN)*ppvObject);\r
+               return S_OK;\r
+       }\r
+       *ppvObject = NULL;\r
+       return ResultFromScode(E_NOINTERFACE);\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IDropTarget_AddRef(LPDROPTARGET pThis)\r
+{\r
+       CONST LPIDROPTARGET_INTERNAL pdti = (LPIDROPTARGET_INTERNAL)pThis;\r
+\r
+       /* reference count\82ð\83C\83\93\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pdti->m_refCnt++;\r
+       return pdti->m_refCnt;\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IDropTarget_Release(LPDROPTARGET pThis)\r
+{\r
+       CONST LPIDROPTARGET_INTERNAL pdti = (LPIDROPTARGET_INTERNAL)pThis;\r
+\r
+       /* reference count\82ð\83f\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pdti->m_refCnt--;\r
+\r
+       /* reference count\82ª 0 \82É\82È\82Á\82½\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82Ì\89ð\95ú\82ð\8ds\82¤ */\r
+       if(pdti->m_refCnt == 0L){\r
+               if(pdti->cFormat != NULL){\r
+                       GlobalFree(pdti->cFormat);\r
+               }\r
+               GlobalFree(pdti);\r
+               return 0L;\r
+       }\r
+       return pdti->m_refCnt;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_DragEnter(LPDROPTARGET pThis, LPDATAOBJECT pdo, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)\r
+{\r
+       return OLE_IDropTarget_Internal_SendMessage(pThis, IDROPTARGET_NOTIFY_DRAGENTER, pdo, grfKeyState, &pt, pdwEffect);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_DragOver(LPDROPTARGET pThis, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)\r
+{\r
+       return OLE_IDropTarget_Internal_SendMessage(pThis, IDROPTARGET_NOTIFY_DRAGOVER, NULL, grfKeyState, &pt, pdwEffect);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_DragLeave(LPDROPTARGET pThis)\r
+{\r
+       return OLE_IDropTarget_Internal_SendMessage(pThis, IDROPTARGET_NOTIFY_DRAGLEAVE, NULL, 0, NULL, NULL);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropTarget_Drop(LPDROPTARGET pThis, LPDATAOBJECT pdo, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)\r
+{\r
+       return OLE_IDropTarget_Internal_SendMessage(pThis, IDROPTARGET_NOTIFY_DROP, pdo, grfKeyState, &pt, pdwEffect);\r
+}\r
+\r
+static HRESULT APIPRIVATE OLE_IDropTarget_Internal_SendMessage(LPDROPTARGET pThis, UINT uNotify, LPDATAOBJECT pdo, DWORD grfKeyState, POINTL *ppt, LPDWORD pdwEffect)\r
+{\r
+       CONST LPIDROPTARGET_INTERNAL pdti = (LPIDROPTARGET_INTERNAL)pThis;\r
+       CONST LPIDROPTARGET_NOTIFY pdtn = &(pdti->dtn);\r
+       STGMEDIUM sm;\r
+       UINT cfFormat = 0;\r
+       int i;\r
+\r
+       if(pdo){\r
+               /* \91Î\89\9e\82µ\82Ä\82¢\82é\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82ª\82 \82é\82©\92²\82×\82é */\r
+               for(i = 0;i < pdti->cfcnt;i++){\r
+                       if(DropTarget_QueryGetData(pdo, pdti->cFormat[i]) == S_OK){\r
+                               cfFormat = pdti->cFormat[i];\r
+                               break;\r
+                       }\r
+               }\r
+               /* \83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82©\82ç\83f\81[\83^\82ð\8eæ\93¾\82·\82é */\r
+               if(cfFormat != 0){\r
+                       if (DropTarget_GetData(pdo, cfFormat, &sm) != S_OK){\r
+                               cfFormat = 0;\r
+                       }\r
+               }\r
+       }\r
+       pdtn->ppt = ppt;                                        /* \83}\83E\83X\83|\83C\83\93\83^\82Ì\88Ê\92u */\r
+       pdtn->grfKeyState = grfKeyState;        /* \83L\81[\81A\83}\83E\83X\83{\83^\83\93\82Ì\8fó\91Ô */\r
+       pdtn->cfFormat = cfFormat;                      /* \83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g */\r
+       pdtn->hMem = sm.hGlobal;                        /* \8eÀ\83f\81[\83^ */\r
+       pdtn->pdo = pdo;                                        /* IDataObject */\r
+\r
+       /* \83E\83B\83\93\83h\83E\82É\83C\83x\83\93\83g\82ð\92Ê\92m\82·\82é */\r
+       SendMessage(pdti->hWnd, pdti->uCallbackMessage, (WPARAM)uNotify, (LPARAM)pdtn);\r
+\r
+       /* \83N\83\8a\83b\83v\83{\81[\83h\8c`\8e®\82Ì\83f\81[\83^\82Ì\89ð\95ú */\r
+       if(cfFormat){\r
+               ReleaseStgMedium(&sm);\r
+       }\r
+\r
+       /* \8cø\89Ê\82Ì\90Ý\92è */\r
+       if(pdwEffect){\r
+               *pdwEffect &= pdtn->dwEffect;\r
+\r
+               if((*pdwEffect & DROPEFFECT_MOVE) && (*pdwEffect & DROPEFFECT_COPY)){\r
+                       *pdwEffect ^= DROPEFFECT_COPY;\r
+                       pdtn->dwEffect ^= DROPEFFECT_COPY;\r
+               }\r
+       }\r
+       return S_OK;\r
+}\r
+\r
+static HRESULT APIPRIVATE DropTarget_GetData(LPDATAOBJECT pdo, UINT cfFormat, LPSTGMEDIUM psm)\r
+{\r
+       FORMATETC fmt;\r
+\r
+       /* IDataObject\82É\83N\83\8a\83b\83v\83{\81[\83h\8c`\8e®\82Ì\83f\81[\83^\82ð\97v\8b\81\82·\82é */\r
+       fmt.cfFormat = cfFormat;\r
+       fmt.ptd = NULL;\r
+       fmt.dwAspect = DVASPECT_CONTENT;\r
+       fmt.lindex = -1;\r
+       fmt.tymed = FormatToTymed(cfFormat);\r
+       return pdo->lpVtbl->GetData(pdo, &fmt, psm);\r
+}\r
+\r
+static HRESULT APIPRIVATE DropTarget_QueryGetData(LPDATAOBJECT pdo, UINT cfFormat)\r
+{\r
+       FORMATETC fmt;\r
+\r
+       /* IDataObject\82É\8ew\92è\82Ì\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82ª\91\8dÝ\82·\82é\82©\96â\82¢\8d\87\82í\82¹\82é */\r
+       fmt.cfFormat = cfFormat;\r
+       fmt.ptd = NULL;\r
+       fmt.dwAspect = DVASPECT_CONTENT;\r
+       fmt.lindex = -1;\r
+       fmt.tymed = FormatToTymed(cfFormat);\r
+       return pdo->lpVtbl->QueryGetData(pdo, &fmt);\r
+}\r
+\r
+\r
+/******************************************************************************\r
+\r
+       IEnumFORMATETC\r
+\r
+******************************************************************************/\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_QueryInterface(LPENUMFORMATETC lpThis, REFIID riid, LPVOID FAR* lplpvObj);\r
+static ULONG STDMETHODCALLTYPE OLE_IEnumFORMATETC_AddRef(LPENUMFORMATETC lpThis);\r
+static ULONG STDMETHODCALLTYPE OLE_IEnumFORMATETC_Release(LPENUMFORMATETC lpThis);\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Next(LPENUMFORMATETC lpThis, ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched);\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Skip(LPENUMFORMATETC lpThis, ULONG celt);\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Reset(LPENUMFORMATETC lpThis);\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Clone(LPENUMFORMATETC lpThis, IEnumFORMATETC **ppenum);\r
+\r
+/* IEnumFORMATETC Virtual Table */\r
+static IEnumFORMATETCVtbl efv = {\r
+       OLE_IEnumFORMATETC_QueryInterface,\r
+       OLE_IEnumFORMATETC_AddRef,\r
+       OLE_IEnumFORMATETC_Release,\r
+       OLE_IEnumFORMATETC_Next,\r
+       OLE_IEnumFORMATETC_Skip,\r
+       OLE_IEnumFORMATETC_Reset,\r
+       OLE_IEnumFORMATETC_Clone\r
+};\r
+\r
+typedef struct _IENUMFORMATETC_INTERNAL{\r
+       LPVOID lpVtbl;\r
+       ULONG m_refCnt;\r
+       LPUNKNOWN m_pUnknownObj;\r
+       ULONG m_currElement;\r
+       ULONG m_numFormats;\r
+       LPFORMATETC m_formatList;\r
+}IENUMFORMATETC_INTERNAL , *LPIENUMFORMATETC_INTERNAL;\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_QueryInterface(LPENUMFORMATETC lpThis, REFIID riid, LPVOID FAR* lplpvObj)\r
+{\r
+       //\97v\8b\81\82³\82ê\82½IID\82Æ\93¯\82\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82ð\95Ô\82·\r
+       if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IEnumFORMATETC)){\r
+               *lplpvObj = (LPVOID) lpThis;\r
+                ((LPUNKNOWN)*lplpvObj)->lpVtbl->AddRef(((LPUNKNOWN)*lplpvObj));\r
+               return S_OK;\r
+       }\r
+       *lplpvObj = NULL;\r
+       return ResultFromScode(E_NOINTERFACE);\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IEnumFORMATETC_AddRef(LPENUMFORMATETC lpThis)\r
+{\r
+       CONST LPIENUMFORMATETC_INTERNAL pefi = (LPIENUMFORMATETC_INTERNAL)lpThis;\r
+\r
+       /* reference count\82ð\83C\83\93\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pefi->m_refCnt++;\r
+       /* \90e\83I\83u\83W\83F\83N\83g\82Ìreference count\82ð\89Á\82¦\82é */\r
+       pefi->m_pUnknownObj->lpVtbl->AddRef(pefi->m_pUnknownObj);\r
+       return pefi->m_refCnt;\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IEnumFORMATETC_Release(LPENUMFORMATETC lpThis)\r
+{\r
+       CONST LPIENUMFORMATETC_INTERNAL pefi = (LPIENUMFORMATETC_INTERNAL)lpThis;\r
+\r
+       /* reference count\82ð\83f\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pefi->m_refCnt--;\r
+       /* \90e\83I\83u\83W\83F\83N\83g\82Ìreference count\82ð\8c¸\82ç\82· */\r
+       pefi->m_pUnknownObj->lpVtbl->Release(pefi->m_pUnknownObj);\r
+\r
+       /* reference count\82ª 0 \82É\82È\82Á\82½\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82Ì\89ð\95ú\82ð\8ds\82¤ */\r
+       if(pefi->m_refCnt == 0L){\r
+               if(pefi->m_formatList != NULL){\r
+                       GlobalFree(pefi->m_formatList);\r
+               }\r
+               GlobalFree(pefi);\r
+               return 0L;\r
+       }\r
+       return pefi->m_refCnt;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Next(LPENUMFORMATETC lpThis, ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched)\r
+{\r
+       ULONG i;\r
+       ULONG cReturn=0L;\r
+       LPIENUMFORMATETC_INTERNAL lpefi = ((LPIENUMFORMATETC_INTERNAL)lpThis);\r
+\r
+       if(pceltFetched){\r
+               *pceltFetched = 0L;\r
+       }\r
+       if(lpefi->m_formatList == NULL){\r
+               return ResultFromScode(S_FALSE);\r
+       }\r
+\r
+       if(rgelt == NULL){\r
+               if(celt == 1){\r
+                       return ResultFromScode(S_FALSE);\r
+               }else{\r
+                       return ResultFromScode(E_POINTER);\r
+               }\r
+       }\r
+\r
+       if(lpefi->m_currElement >= lpefi->m_numFormats){\r
+               return ResultFromScode(S_FALSE);\r
+       }\r
+\r
+       for(i = 0;i < celt && lpefi->m_currElement < lpefi->m_numFormats;i++, lpefi->m_currElement++){\r
+               *rgelt = lpefi->m_formatList[lpefi->m_currElement];\r
+               rgelt++;\r
+       }\r
+\r
+       if(pceltFetched != NULL){\r
+               *pceltFetched = i;\r
+       }\r
+       return S_OK;\r
+\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Skip(LPENUMFORMATETC lpThis, ULONG celt)\r
+{\r
+       LPIENUMFORMATETC_INTERNAL lpefi = ((LPIENUMFORMATETC_INTERNAL)lpThis);\r
+\r
+       lpefi->m_currElement += celt;\r
+\r
+       if(lpefi->m_currElement > lpefi->m_numFormats){\r
+               lpefi->m_currElement = lpefi->m_numFormats;\r
+               return ResultFromScode(S_FALSE);\r
+       }\r
+       return S_OK;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Reset(LPENUMFORMATETC lpThis)\r
+{\r
+       LPIENUMFORMATETC_INTERNAL lpefi = ((LPIENUMFORMATETC_INTERNAL)lpThis);\r
+\r
+       lpefi->m_currElement = 0L;\r
+       return S_OK;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IEnumFORMATETC_Clone(LPENUMFORMATETC lpThis, IEnumFORMATETC **ppenum)\r
+{\r
+       LPIENUMFORMATETC_INTERNAL pNew;\r
+       LPIENUMFORMATETC_INTERNAL lpefi = ((LPIENUMFORMATETC_INTERNAL)lpThis);\r
+       UINT i;\r
+\r
+       /* IEnumFORMATETC\82ð\8dì\90¬\82·\82é */\r
+       pNew = GlobalAlloc(GPTR, sizeof(IENUMFORMATETC_INTERNAL));\r
+       if(pNew == NULL){\r
+               return ResultFromScode(E_OUTOFMEMORY);\r
+       }\r
+       pNew->lpVtbl = (LPVOID)&efv;\r
+       pNew->m_refCnt = 0;\r
+       pNew->m_currElement = 0;\r
+\r
+       pNew->m_pUnknownObj = lpefi->m_pUnknownObj;\r
+       pNew->m_numFormats = lpefi->m_numFormats;\r
+\r
+       /* \83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\83\8a\83X\83g\82ð\83R\83s\81[\82·\82é */\r
+       pNew->m_formatList = GlobalAlloc(GPTR, sizeof(FORMATETC) * pNew->m_numFormats);\r
+       if(pNew->m_formatList != NULL){\r
+               for(i = 0;i < pNew->m_numFormats;i++){\r
+                         pNew->m_formatList[i] = lpefi->m_formatList[i];\r
+               }\r
+       }\r
+\r
+       *ppenum = (struct IEnumFORMATETC *)pNew;\r
+       if(pNew == NULL){\r
+               return ResultFromScode(E_OUTOFMEMORY);\r
+       }\r
+       ((LPENUMFORMATETC)pNew)->lpVtbl->AddRef(((LPENUMFORMATETC)pNew));\r
+       pNew->m_currElement = lpefi->m_currElement;\r
+       return S_OK;\r
+}\r
+\r
+\r
+/******************************************************************************\r
+\r
+       IDataObject\r
+\r
+******************************************************************************/\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_QueryInterface(LPDATAOBJECT lpThis, REFIID riid, LPVOID FAR *lplpvObj);\r
+static ULONG STDMETHODCALLTYPE OLE_IDataObject_AddRef(LPDATAOBJECT lpThis);\r
+static ULONG STDMETHODCALLTYPE OLE_IDataObject_Release(LPDATAOBJECT lpThis);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_GetData(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, STGMEDIUM *pmedium);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_GetDataHere(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, STGMEDIUM *pmedium);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_QueryGetData(LPDATAOBJECT lpThis, FORMATETC *pFormatetc);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_GetCanonicalFormatEtc(LPDATAOBJECT lpThis, FORMATETC *pFormatetcIn, FORMATETC *pFormatetcOut);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_SetData(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, STGMEDIUM *pmedium, BOOL fRelease);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_EnumFormatEtc(LPDATAOBJECT lpThis, DWORD dwDirection, IEnumFORMATETC **ppenumFormatetc);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_DAdvise(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_DUnadvise(LPDATAOBJECT lpThis, DWORD dwConnection);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_EnumDAdvise(LPDATAOBJECT lpThis, IEnumSTATDATA **ppenumAdvise);\r
+\r
+/* IDataObject Virtual Table */\r
+static IDataObjectVtbl dov = {\r
+       OLE_IDataObject_QueryInterface,\r
+       OLE_IDataObject_AddRef,\r
+       OLE_IDataObject_Release,\r
+       OLE_IDataObject_GetData,\r
+       OLE_IDataObject_GetDataHere,\r
+       OLE_IDataObject_QueryGetData,\r
+       OLE_IDataObject_GetCanonicalFormatEtc,\r
+       OLE_IDataObject_SetData,\r
+       OLE_IDataObject_EnumFormatEtc,\r
+       OLE_IDataObject_DAdvise,\r
+       OLE_IDataObject_DUnadvise,\r
+       OLE_IDataObject_EnumDAdvise\r
+};\r
+\r
+typedef struct _IDATAOBJECT_INTERNAL{\r
+       LPVOID lpVtbl;\r
+       ULONG m_refCnt;\r
+       UINT m_numTypes;\r
+       UINT m_maxTypes;\r
+       FORMATETC *m_typeList;\r
+       HWND hWnd;\r
+       UINT uCallbackMessage;\r
+}IDATAOBJECT_INTERNAL , *LPIDATAOBJECT_INTERNAL;\r
+\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_QueryInterface(LPDATAOBJECT lpThis, REFIID riid, LPVOID FAR *lplpvObj)\r
+{\r
+       //\97v\8b\81\82³\82ê\82½IID\82Æ\93¯\82\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82ð\95Ô\82·\r
+       if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDataObject)){\r
+               *lplpvObj = lpThis;\r
+                ((LPUNKNOWN)*lplpvObj)->lpVtbl->AddRef(((LPUNKNOWN)*lplpvObj));\r
+               return S_OK;\r
+       }\r
+       *lplpvObj = NULL;\r
+       return ResultFromScode(E_NOINTERFACE);\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IDataObject_AddRef(LPDATAOBJECT lpThis)\r
+{\r
+       CONST LPIDATAOBJECT_INTERNAL pdoi = (LPIDATAOBJECT_INTERNAL)lpThis;\r
+\r
+       /* reference count\82ð\83C\83\93\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pdoi->m_refCnt++;\r
+       return pdoi->m_refCnt;\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IDataObject_Release(LPDATAOBJECT lpThis)\r
+{\r
+       CONST LPIDATAOBJECT_INTERNAL pdoi = (LPIDATAOBJECT_INTERNAL)lpThis;\r
+\r
+       /* reference count\82ð\83f\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pdoi->m_refCnt--;\r
+\r
+       /* reference count\82ª 0 \82É\82È\82Á\82½\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82Ì\89ð\95ú\82ð\8ds\82¤ */\r
+       if(pdoi->m_refCnt == 0L){\r
+               if(pdoi->m_typeList != NULL){\r
+                       GlobalFree(pdoi->m_typeList);\r
+               }\r
+               GlobalFree(pdoi);\r
+               return 0L;\r
+       }\r
+       return pdoi->m_refCnt;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_GetData(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, STGMEDIUM *pmedium)\r
+{\r
+       CONST LPIDATAOBJECT_INTERNAL pdoi = (LPIDATAOBJECT_INTERNAL)lpThis;\r
+       HGLOBAL hMem;\r
+       UINT i;\r
+\r
+       /* \97v\8b\81\82³\82ê\82½\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82ª\91\8dÝ\82·\82é\82©\92²\82×\82é */\r
+       for(i = 0;i < pdoi->m_numTypes;i++){\r
+               if(pdoi->m_typeList[i].cfFormat == pFormatetc->cfFormat){\r
+                       break;\r
+               }\r
+       }\r
+       if(i == pdoi->m_numTypes){\r
+               /* \97v\8b\81\82³\82ê\82½\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82ð\83T\83|\81[\83g\82µ\82Ä\82È\82¢\8fê\8d\87 */\r
+               return ResultFromScode(DV_E_FORMATETC);\r
+       }\r
+\r
+       // \83}\83E\83X\82Ì\83h\83\89\83b\83O\92\86\82Í WM_GETDATA \82ð\91\97\82ç\82È\82¢\82æ\82¤\82É\82·\82é\81B(2007.9.3 yutaka)\r
+       if (GetAsyncKeyState(VK_LBUTTON) & 0x8000 ||\r
+               GetAsyncKeyState(VK_RBUTTON) & 0x8000) {\r
+               return ResultFromScode(DV_E_FORMATETC);\r
+       }\r
+\r
+       /* \83E\83B\83\93\83h\83E\82É\83f\81[\83^\82Ì\97v\8b\81\82ð\8ds\82¤ */\r
+       SendMessage(pdoi->hWnd, pdoi->uCallbackMessage, (WPARAM)pdoi->m_typeList[i].cfFormat, (LPARAM)&hMem);\r
+       if(hMem == NULL){\r
+               return ResultFromScode(STG_E_MEDIUMFULL);\r
+       }\r
+       pmedium->hGlobal = hMem;\r
+       pmedium->tymed = FormatToTymed(pFormatetc->cfFormat);\r
+       pmedium->pUnkForRelease = NULL;\r
+       return S_OK;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_GetDataHere(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, STGMEDIUM *pmedium)\r
+{\r
+       return ResultFromScode(E_NOTIMPL);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_QueryGetData(LPDATAOBJECT lpThis, FORMATETC *pFormatetc)\r
+{\r
+       CONST LPIDATAOBJECT_INTERNAL pdoi = (LPIDATAOBJECT_INTERNAL)lpThis;\r
+       UINT i;\r
+\r
+       /* \97v\8b\81\82³\82ê\82½\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82ª\91\8dÝ\82·\82é\82©\92²\82×\82é */\r
+       for(i = 0;i < pdoi->m_numTypes;i++){\r
+               if(pdoi->m_typeList[i].cfFormat == pFormatetc->cfFormat){\r
+                       return S_OK;\r
+               }\r
+       }\r
+       return ResultFromScode(DV_E_FORMATETC);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_GetCanonicalFormatEtc(LPDATAOBJECT lpThis, FORMATETC *pFormatetcIn, FORMATETC *pFormatetcOut)\r
+{\r
+       return ResultFromScode(E_NOTIMPL);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_SetData(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, STGMEDIUM *pmedium, BOOL fRelease)\r
+{\r
+       return ResultFromScode(E_NOTIMPL);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_EnumFormatEtc(LPDATAOBJECT lpThis, DWORD dwDirection, IEnumFORMATETC **ppenumFormatetc)\r
+{\r
+       CONST LPIDATAOBJECT_INTERNAL pdoi = (LPIDATAOBJECT_INTERNAL)lpThis;\r
+       static IENUMFORMATETC_INTERNAL *pefi;\r
+       UINT i;\r
+\r
+       if(ppenumFormatetc == NULL){\r
+               return ResultFromScode(E_INVALIDARG);\r
+       }\r
+\r
+       if(dwDirection != DATADIR_GET){\r
+               *ppenumFormatetc = NULL;\r
+               return ResultFromScode(E_NOTIMPL);\r
+       }\r
+\r
+       /* IEnumFORMATETC\82ð\8dì\90¬\82·\82é */\r
+       pefi = GlobalAlloc(GPTR, sizeof(IENUMFORMATETC_INTERNAL));\r
+       if(pefi == NULL){\r
+               return E_OUTOFMEMORY;\r
+       }\r
+       pefi->lpVtbl = (LPVOID)&efv;\r
+       pefi->m_refCnt = 0;\r
+       pefi->m_currElement = 0;\r
+       pefi->m_pUnknownObj = (struct IUnknown *)lpThis;\r
+       pefi->m_numFormats = pdoi->m_numTypes;\r
+\r
+       /* \83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\83\8a\83X\83g\82ð\83R\83s\81[\82·\82é */\r
+       pefi->m_formatList = GlobalAlloc(GPTR, sizeof(FORMATETC) * pefi->m_numFormats);\r
+       if(pefi->m_formatList != NULL){\r
+               for(i = 0;i < pefi->m_numFormats;i++){\r
+                         pefi->m_formatList[i] = pdoi->m_typeList[i];\r
+               }\r
+       }\r
+\r
+       ((LPENUMFORMATETC)pefi)->lpVtbl->AddRef(((LPENUMFORMATETC)pefi));\r
+\r
+       *ppenumFormatetc = (struct IEnumFORMATETC *)pefi;\r
+       if(*ppenumFormatetc == NULL){\r
+               return E_OUTOFMEMORY;\r
+       }\r
+       return S_OK;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_DAdvise(LPDATAOBJECT lpThis, FORMATETC *pFormatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)\r
+{\r
+       return ResultFromScode(OLE_E_ADVISENOTSUPPORTED);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_DUnadvise(LPDATAOBJECT lpThis, DWORD dwConnection)\r
+{\r
+       return ResultFromScode(OLE_E_NOCONNECTION);\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDataObject_EnumDAdvise(LPDATAOBJECT lpThis, IEnumSTATDATA **ppenumAdvise)\r
+{\r
+       return ResultFromScode(OLE_E_ADVISENOTSUPPORTED);\r
+}\r
+\r
+\r
+/******************************************************************************\r
+\r
+       IDropSource\r
+\r
+******************************************************************************/\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropSource_QueryInterface(LPDROPSOURCE lpThis, REFIID riid, LPVOID FAR* lplpvObj);\r
+static ULONG STDMETHODCALLTYPE OLE_IDropSource_AddRef(LPDROPSOURCE lpThis);\r
+static ULONG STDMETHODCALLTYPE OLE_IDropSource_Release(LPDROPSOURCE lpThis);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropSource_QueryContinueDrag(LPDROPSOURCE lpThis, BOOL fEscapePressed, DWORD grfKeyState);\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropSource_GiveFeedback(LPDROPSOURCE lpThis, DWORD dwEffect);\r
+\r
+/* IDropSource Virtual Table */\r
+static IDropSourceVtbl dsv = {\r
+       OLE_IDropSource_QueryInterface,\r
+       OLE_IDropSource_AddRef,\r
+       OLE_IDropSource_Release,\r
+       OLE_IDropSource_QueryContinueDrag,\r
+       OLE_IDropSource_GiveFeedback,\r
+};\r
+\r
+typedef struct _IDROPSOURCE_INTERNAL{\r
+       LPVOID lpVtbl;\r
+       ULONG m_refCnt;\r
+       DWORD m_keyState;\r
+       DWORD m_button;\r
+       HWND m_hWnd;\r
+       UINT m_uCallbackDragOverMessage;\r
+}IDROPSOURCE_INTERNAL , *LPIDROPSOURCE_INTERNAL;\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropSource_QueryInterface(LPDROPSOURCE lpThis, REFIID riid, LPVOID FAR *lplpvObj)\r
+{\r
+       //\97v\8b\81\82³\82ê\82½IID\82Æ\93¯\82\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82ð\95Ô\82·\r
+       if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDropSource)){\r
+               *lplpvObj = (LPVOID) lpThis;\r
+               ((LPUNKNOWN)*lplpvObj)->lpVtbl->AddRef(((LPUNKNOWN)*lplpvObj));\r
+               return S_OK;\r
+       }\r
+       *lplpvObj = NULL;\r
+       return ResultFromScode(E_NOINTERFACE);\r
+\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IDropSource_AddRef(LPDROPSOURCE lpThis)\r
+{\r
+       CONST LPIDROPSOURCE_INTERNAL pdsi = (LPIDROPSOURCE_INTERNAL)lpThis;\r
+\r
+       /* reference count\82ð\83C\83\93\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pdsi->m_refCnt++;\r
+       return pdsi->m_refCnt;\r
+}\r
+\r
+static ULONG STDMETHODCALLTYPE OLE_IDropSource_Release(LPDROPSOURCE lpThis)\r
+{\r
+       CONST LPIDROPSOURCE_INTERNAL pdsi = (LPIDROPSOURCE_INTERNAL)lpThis;\r
+\r
+       /* reference count\82ð\83f\83N\83\8a\83\81\83\93\83g\82·\82é */\r
+       pdsi->m_refCnt--;\r
+\r
+       /* reference count\82ª 0 \82É\82È\82Á\82½\8fê\8d\87\82Í\83I\83u\83W\83F\83N\83g\82Ì\89ð\95ú\82ð\8ds\82¤ */\r
+       if(pdsi->m_refCnt == 0L){\r
+               GlobalFree(pdsi);\r
+               return 0L;\r
+       }\r
+       return pdsi->m_refCnt;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropSource_QueryContinueDrag(LPDROPSOURCE lpThis, BOOL fEscapePressed, DWORD grfKeyState)\r
+{\r
+       CONST LPIDROPSOURCE_INTERNAL pdsi = (LPIDROPSOURCE_INTERNAL)lpThis;\r
+\r
+       if(fEscapePressed){\r
+               /* \83G\83X\83P\81[\83v\82ª\89\9f\82³\82ê\82½\8fê\8d\87\82Í\83L\83\83\83\93\83Z\83\8b\82É\82·\82é */\r
+               return ResultFromScode(DRAGDROP_S_CANCEL);\r
+       }\r
+\r
+       // Mouse over\82Ì\92Ê\92m (yutaka)\r
+       SendMessage(pdsi->m_hWnd, pdsi->m_uCallbackDragOverMessage, 0, 0);\r
+\r
+       /* \8ew\92è\82Ì\83L\81[\82â\83}\83E\83X\82ª\97£\82³\82ê\82½\8fê\8d\87\82Í\83h\83\8d\83b\83v\82É\82·\82é */\r
+       if(pdsi->m_button == 0){\r
+               if(grfKeyState != pdsi->m_keyState){\r
+                       return ResultFromScode(DRAGDROP_S_DROP);\r
+               }\r
+       }else{\r
+               if(!(grfKeyState & pdsi->m_button)){\r
+                       return ResultFromScode(DRAGDROP_S_DROP);\r
+               }\r
+       }\r
+       return S_OK;\r
+}\r
+\r
+static HRESULT STDMETHODCALLTYPE OLE_IDropSource_GiveFeedback(LPDROPSOURCE lpThis, DWORD dwEffect)\r
+{\r
+       return ResultFromScode(DRAGDROP_S_USEDEFAULTCURSORS);\r
+}\r
+\r
+/* \83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\82Ì\8aJ\8en */\r
+int APIPRIVATE OLE_IDropSource_Start(HWND hWnd, UINT uCallbackMessage, UINT uCallbackDragOverMessage, UINT *ClipFormtList, int cfcnt, int Effect)\r
+{\r
+       static IDATAOBJECT_INTERNAL *pdoi;\r
+       static IDROPSOURCE_INTERNAL *pdsi;\r
+       DWORD lpdwEffect;\r
+       DWORD keyState;\r
+       int i;\r
+       int ret;\r
+\r
+       /* IDataObject\82Ì\8dì\90¬ */\r
+       pdoi = GlobalAlloc(GPTR, sizeof(IDATAOBJECT_INTERNAL));\r
+       if(pdoi == NULL){\r
+               return -1;\r
+       }\r
+       pdoi->lpVtbl = (LPVOID)&dov;\r
+       pdoi->m_refCnt = 0;\r
+       pdoi->m_numTypes = cfcnt;\r
+       pdoi->m_maxTypes = cfcnt;\r
+       /* \97L\8cø\82È\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82ð\90Ý\92è\82·\82é */\r
+       pdoi->m_typeList = GlobalAlloc(GPTR, sizeof(FORMATETC) * cfcnt);\r
+       if(pdoi->m_typeList == NULL){\r
+               GlobalFree(pdoi);\r
+               return -1;\r
+       }\r
+       for(i = 0;i < cfcnt;i++){\r
+               pdoi->m_typeList[i].cfFormat = ClipFormtList[i];\r
+               pdoi->m_typeList[i].ptd = NULL;\r
+               pdoi->m_typeList[i].dwAspect = DVASPECT_CONTENT;\r
+               pdoi->m_typeList[i].lindex = -1;\r
+               pdoi->m_typeList[i].tymed = FormatToTymed(ClipFormtList[i]);\r
+       }\r
+       pdoi->hWnd = hWnd;\r
+       pdoi->uCallbackMessage = uCallbackMessage;\r
+       ((LPDATAOBJECT)pdoi)->lpVtbl->AddRef((LPDATAOBJECT)pdoi);\r
+\r
+       /* IDropSource\82Ì\8dì\90¬ */\r
+       pdsi = GlobalAlloc(GPTR, sizeof(IDROPSOURCE_INTERNAL));\r
+       if(pdsi == NULL){\r
+               /* IDataObject\82ð\89ð\95ú\82·\82é */\r
+               ((LPDATAOBJECT)pdoi)->lpVtbl->Release((LPDATAOBJECT)pdoi);\r
+               return -1;\r
+       }\r
+       pdsi->lpVtbl = (LPVOID)&dsv;\r
+       pdsi->m_refCnt = 0;\r
+       pdsi->m_hWnd = hWnd; // yutaka\r
+       pdsi->m_uCallbackDragOverMessage = uCallbackDragOverMessage;\r
+\r
+       /* \97L\8cø\82È\83L\81[\82Æ\83}\83E\83X\82Ì\8fó\91Ô */\r
+       if(GetKeyState(VK_RBUTTON) & 0x8000){\r
+               pdsi->m_button = MK_RBUTTON;\r
+       }else{\r
+               pdsi->m_button = MK_LBUTTON;\r
+       }\r
+\r
+       /* \8c»\8dÝ\82Ì\83L\81[\82Æ\83}\83E\83X\82Ì\8fó\91Ô */\r
+       keyState = 0;\r
+       if(GetKeyState(VK_SHIFT) & 0x8000){\r
+               keyState |= MK_SHIFT;\r
+       }\r
+       if(GetKeyState(VK_CONTROL) & 0x8000){\r
+               keyState |= MK_CONTROL;\r
+       }\r
+       if(GetKeyState(VK_MENU) & 0x8000){\r
+               keyState |= MK_ALT;\r
+       }\r
+       if(GetKeyState(VK_LBUTTON) & 0x8000){\r
+               keyState |= MK_LBUTTON;\r
+       }\r
+       if(GetKeyState(VK_MBUTTON) & 0x8000){\r
+               keyState |= MK_MBUTTON;\r
+       }\r
+       if(GetKeyState(VK_RBUTTON) & 0x8000){\r
+               keyState |= MK_RBUTTON;\r
+       }\r
+       pdsi->m_keyState = keyState;\r
+       ((LPDROPSOURCE)pdsi)->lpVtbl->AddRef((LPDROPSOURCE)pdsi);\r
+\r
+       lpdwEffect = 0;\r
+\r
+       /* \83h\83\89\83b\83O&\83h\83\8d\83b\83v\82Ì\8aJ\8en */\r
+       ret = DoDragDrop((LPDATAOBJECT)pdoi, (LPDROPSOURCE)pdsi, Effect, &lpdwEffect);\r
+\r
+       /* IDataObject\82ð\89ð\95ú\82·\82é */\r
+       ((LPDATAOBJECT)pdoi)->lpVtbl->Release((LPDATAOBJECT)pdoi);\r
+       /* IDropSource\82ð\89ð\95ú\82·\82é */\r
+       ((LPDROPSOURCE)pdsi)->lpVtbl->Release((LPDROPSOURCE)pdsi);\r
+\r
+       if(ret == DRAGDROP_S_DROP){\r
+               /* \83h\83\8d\83b\83v\90æ\82Ì\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ª\90Ý\92è\82µ\82½\8cø\89Ê\82ð\95Ô\82· */\r
+               return lpdwEffect;\r
+       }\r
+       return -1;\r
+}\r
+/* End of source */\r
diff --git a/OleDragDrop.h b/OleDragDrop.h
new file mode 100644 (file)
index 0000000..1fbea01
--- /dev/null
@@ -0,0 +1,72 @@
+/**************************************************************************\r
+\r
+       OleDragDrop.h\r
+\r
+       (C) Copyright 1996-2002 By Tomoaki Nakashima. All right reserved.       \r
+               http://www.nakka.com/\r
+               nakka@nakka.com\r
+\r
+**************************************************************************/\r
+\r
+#ifndef _INC_OLEDRAGDROP\r
+#define _INC_OLEDRAGDROP\r
+\r
+#define IDROPTARGET_NOTIFY_DRAGENTER   0\r
+#define IDROPTARGET_NOTIFY_DRAGOVER            1\r
+#define IDROPTARGET_NOTIFY_DRAGLEAVE   2\r
+#define IDROPTARGET_NOTIFY_DROP                3\r
+\r
+typedef struct _IDROPTARGET_NOTIFY{\r
+       POINTL *ppt;                                    //\83}\83E\83X\82Ì\88Ê\92u\r
+       DWORD dwEffect;                                 //\83h\83\89\83b\83O\91\80\8dì\82Å\81A\83h\83\89\83b\83O\82³\82ê\82é\91Î\8fÛ\82Å\8b\96\82³\82ê\82é\8cø\89Ê\r
+       DWORD grfKeyState;                              //\83L\81[\82Ì\8fó\91Ô\r
+       UINT cfFormat;                                  //\83h\83\8d\83b\83v\82³\82ê\82é\83f\81[\83^\82Ì\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\r
+       HANDLE hMem;                                    //\83h\83\8d\83b\83v\82³\82ê\82é\83f\81[\83^\r
+       LPVOID pdo;                                             //IDataObject\r
+}IDROPTARGET_NOTIFY , *LPIDROPTARGET_NOTIFY;\r
+\r
+\r
+\r
+\r
+//DragTarget\r
+BOOL APIPRIVATE OLE_IDropTarget_RegisterDragDrop(HWND hWnd, UINT uCallbackMessage, UINT *cFormat, int cfcnt);\r
+\r
+//\83h\83\89\83b\83O&\83h\83\8d\83b\83v\82Ì\83^\81[\83Q\83b\83g\82Æ\82µ\82Ä\93o\98^\82µ\82Ü\82·\81B\r
+\r
+//[\88ø\90\94]\r
+//     \83h\83\89\83b\83O&\83h\83\8d\83b\83v\91\80\8dì\82ª\8ds\82í\82ê\82½\82Æ\82«\82É\8ew\92è\82Ì\83E\83B\83\93\83h\83E\82Ì\8ew\92è\82Ì\83\81\83b\83Z\81[\83W\82É\92Ê\92m\82³\82ê\82Ü\82·\81B\r
+//     wParam \82É\91\80\8dì\82Ì\8eí\97Þ(IDROPTARGET_NOTIFY_)\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82Ü\82·\81B\r
+//     lParam \82É IDROPTARGET_NOTIFY \8d\\91¢\91Ì\82Ö\82Ì\83|\83C\83\93\83^\82ª\90Ý\92è\82³\82ê\82Ä\82¢\82Ü\82·\81B\r
+\r
+//     cFormat \82Í \8eó\82¯\8eæ\82é\82±\82Æ\82ª\89Â\94\\82È\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\83\8a\83X\83g\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+//     cfcnt \82Í\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\94z\97ñ\82Ì\97v\91f\90\94\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+\r
+void APIPRIVATE OLE_IDropTarget_RevokeDragDrop(HWND hWnd);\r
+\r
+//\83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\82Ì\83^\81[\83Q\83b\83g\82ð\89ð\8f\9c\82µ\82Ü\82·\81B\r
+\r
+\r
+\r
+\r
+//DropSource\r
+int APIPRIVATE OLE_IDropSource_Start(HWND hWnd, UINT uCallbackMessage, UINT uCallbackDragOverMessage, UINT *ClipFormtList, int cfcnt, int Effect);\r
+\r
+//\83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\82ð\8aJ\8en\82·\82é\82Æ\82«\82É\8ew\92è\82µ\82Ü\82·\81B\r
+//\83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\91\80\8dì\82Í\8e©\93®\93I\82É\8ds\82í\82ê\82Ü\82·\82ª\81A\83f\81[\83^\82ª\95K\97v\82È\8e\9e\82Í\81A\8ew\92è\82Ì\83E\83B\83\93\83h\83E\83\81\83b\83Z\81[\83W\82Å\83f\81[\83^\97v\8b\81\82ð\8ds\82¢\82Ü\82·\81B\r
+\r
+//[\88ø\90\94]\r
+//     hWnd \82É uCallbackMessage \82ð\91\97\82Á\82Ä\83f\81[\83^\82Ì\97v\8b\81\82ð\8ds\82¢\82Ü\82·\81B\r
+//     \82±\82Ì\8e\9e wParam \82É\97v\8b\81\82·\82é\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\92l\82ª\93ü\82Á\82Ä\82¢\82Ü\82·\81B\r
+//     \83v\83\8d\83O\83\89\83\80\82Í *(HANDLE *)lParam \82É\83f\81[\83^\82ð\90Ý\92è\82µ\82Ä\95Ô\82µ\82Ü\82·\81B(NULL\82Å\82à\89Â)\r
+\r
+//     ClipFormtList \82Í\83T\83|\81[\83g\82µ\82Ä\82¢\82é\83N\83\8a\83b\83v\83{\81[\83h\83t\83H\81[\83}\83b\83g\82Ì\94z\97ñ\82ð\8ew\92è\82µ\82Ü\82·\81B\r
+//     cfcnt \82Í\83N