OSDN Git Service

Add UTF-8 to UTF-16 API bridge.
[ffftp/ffftp.git] / ftpproc.c
1 /*=============================================================================\r
2 *\r
3 *                                                               \82e\82s\82o\83R\83}\83\93\83h\91\80\8dì\r
4 *\r
5 ===============================================================================\r
6 / Copyright (C) 1997-2007 Sota. All rights reserved.\r
7 /\r
8 / Redistribution and use in source and binary forms, with or without \r
9 / modification, are permitted provided that the following conditions \r
10 / are met:\r
11 /\r
12 /  1. Redistributions of source code must retain the above copyright \r
13 /     notice, this list of conditions and the following disclaimer.\r
14 /  2. Redistributions in binary form must reproduce the above copyright \r
15 /     notice, this list of conditions and the following disclaimer in the \r
16 /     documentation and/or other materials provided with the distribution.\r
17 /\r
18 / THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR \r
19 / IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES \r
20 / OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
21 / IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, \r
22 / INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
23 / BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF \r
24 / USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON \r
25 / ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
26 / (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF \r
27 / THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
28 /============================================================================*/\r
29 \r
30 #define  STRICT\r
31 #include <windows.h>\r
32 #include <stdio.h>\r
33 #include <stdlib.h>\r
34 #include <string.h>\r
35 #include <mbstring.h>\r
36 #include <windowsx.h>\r
37 #include <commctrl.h>\r
38 \r
39 #include "common.h"\r
40 #include "resource.h"\r
41 \r
42 #include <htmlhelp.h>\r
43 #include "helpid.h"\r
44 \r
45 \r
46 /*===== \83v\83\8d\83g\83^\83C\83v =====*/\r
47 \r
48 static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList);\r
49 static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
50 \r
51 static void DispMirrorFiles(FILELIST *Local, FILELIST *Remote);\r
52 static void MirrorDeleteAllLocalDir(FILELIST *Local, TRANSPACKET *Pkt, TRANSPACKET **Base);\r
53 static int CheckLocalFile(TRANSPACKET *Pkt);\r
54 static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
55 static void RemoveAfterSemicolon(char *Path);\r
56 static void MirrorDeleteAllDir(FILELIST *Remote, TRANSPACKET *Pkt, TRANSPACKET **Base);\r
57 static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
58 static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
59 static void CountMirrorFiles(HWND hDlg, TRANSPACKET *Pkt);\r
60 static int AskMirrorNoTrn(char *Fname, int Mode);\r
61 static int AskUpLoadFileAttr(char *Fname);\r
62 static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
63 static void DeleteAllDir(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir);\r
64 static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir);\r
65 static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
66 static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);\r
67 static void SetAttrToDialog(HWND hWnd, int Attr);\r
68 static int GetAttrFromDialog(HWND hDlg);\r
69 static LRESULT CALLBACK SizeNotifyDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
70 static LRESULT CALLBACK SizeDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);\r
71 static int RenameUnuseableName(char *Fname);\r
72 \r
73 /*===== \8aO\95\94\8eQ\8fÆ ====*/\r
74 \r
75 extern HWND hHelpWin;\r
76 \r
77 /* \90Ý\92è\92l */\r
78 extern int FnameCnv;\r
79 extern int RecvMode;\r
80 extern int SendMode;\r
81 extern int MoveMode;\r
82 extern char MirrorNoTrn[MIRROR_LEN+1];\r
83 extern char MirrorNoDel[MIRROR_LEN+1];\r
84 extern int MirrorFnameCnv;\r
85 extern char DefAttrList[DEFATTRLIST_LEN+1];\r
86 extern SIZE MirrorDlgSize;\r
87 extern int VaxSemicolon;\r
88 extern int DebugConsole;\r
89 extern int CancelFlg;\r
90 \r
91 /*===== \83\8d\81[\83J\83\8b\82È\83\8f\81[\83N =====*/\r
92 \r
93 static char TmpString[FMAX_PATH+80];            /* \83e\83\93\83|\83\89\83\8a */\r
94 static int CurWin;                                              /* \83E\83C\83\93\83h\83E\94Ô\8d\86 */\r
95 \r
96 int UpExistMode = EXIST_OVW;            /* \83A\83b\83v\83\8d\81[\83h\82Å\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\88µ\82¢\95û EXIST_xxx */\r
97 int ExistMode = EXIST_OVW;              /* \93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\88µ\82¢\95û EXIST_xxx */\r
98 static int ExistNotify;         /* \8am\94F\83_\83C\83A\83\8d\83O\82ð\8fo\82·\82©\82Ç\82¤\82© YES/NO */\r
99 \r
100 static double FileSize;         /* \83t\83@\83C\83\8b\91\8d\97e\97Ê */\r
101 \r
102 \r
103 \r
104 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83_\83E\83\93\83\8d\81[\83h\82·\82é --------------------\r
105 *\r
106 *       Parameter\r
107 *               int ChName : \96¼\91O\82ð\95Ï\82¦\82é\82©\82Ç\82¤\82© (YES/NO)\r
108 *               int ForceFile : \83f\83B\83\8c\83N\83g\83\8a\82ð\83t\83@\83C\83\8b\8c©\82È\82·\82©\82Ç\82¤\82© (YES/NO)\r
109 *               int All : \91S\82Ä\82ª\91I\82Î\82ê\82Ä\82¢\82é\95¨\82Æ\82µ\82Ä\88µ\82¤\82©\82Ç\82¤\82© (YES/NO)\r
110 *\r
111 *       Return Value\r
112 *               \82È\82µ\r
113 *----------------------------------------------------------------------------*/\r
114 \r
115 void DownLoadProc(int ChName, int ForceFile, int All)\r
116 {\r
117         FILELIST *FileListBase;\r
118         FILELIST *Pos;\r
119         TRANSPACKET Pkt;\r
120 \r
121         if(CheckClosedAndReconnect() == SUCCESS)\r
122         {\r
123                 DisableUserOpe();\r
124 \r
125                 ExistNotify = YES;\r
126 //              KeepTransferDialog(YES);\r
127 \r
128                 FileListBase = NULL;\r
129                 MakeSelectedFileList(WIN_REMOTE, (ForceFile == YES ? NO : YES), All, &FileListBase, &CancelFlg);\r
130 \r
131                 if(AskNoFullPathMode() == YES)\r
132                 {\r
133                         strcpy(Pkt.Cmd, "SETCUR");\r
134                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
135                         AddTransFileList(&Pkt);\r
136                 }\r
137 \r
138                 Pos = FileListBase;\r
139                 while(Pos != NULL)\r
140                 {\r
141                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
142                         SetYenTail(Pkt.LocalFile);\r
143                         strcpy(TmpString, Pos->File);\r
144                         if((ChName == NO) || ((ForceFile == NO) && (Pos->Node == NODE_DIR)))\r
145                         {\r
146                                 if(FnameCnv == FNAME_LOWER)\r
147                                         _mbslwr(TmpString);\r
148                                 else if(FnameCnv == FNAME_UPPER)\r
149                                         _mbsupr(TmpString);\r
150                                 RemoveAfterSemicolon(TmpString);\r
151                                 if(RenameUnuseableName(TmpString) == FAIL)\r
152                                         break;\r
153                         }\r
154                         else\r
155                         {\r
156                                 CurWin = WIN_REMOTE;\r
157                                 if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(updown_as_dlg), GetMainHwnd(), UpDownAsDialogCallBack) == YES)\r
158                                 {\r
159                                         if(RenameUnuseableName(TmpString) == FAIL)\r
160                                                 break;\r
161                                 }\r
162                                 else\r
163                                         break;\r
164                         }\r
165                         strcat(Pkt.LocalFile, TmpString);\r
166                         ReplaceAll(Pkt.LocalFile, '/', '\\');\r
167 \r
168                         if((ForceFile == NO) && (Pos->Node == NODE_DIR))\r
169                         {\r
170                                 strcpy(Pkt.Cmd, "MKD ");\r
171                                 strcpy(Pkt.RemoteFile, "");\r
172                                 AddTransFileList(&Pkt);\r
173                         }\r
174                         else if((Pos->Node == NODE_FILE) ||\r
175                                         ((ForceFile == YES) && (Pos->Node == NODE_DIR)))\r
176                         {\r
177                                 if(AskHostType() == HTYPE_ACOS)\r
178                                 {\r
179                                         strcpy(Pkt.RemoteFile, "'");\r
180                                         strcat(Pkt.RemoteFile, AskHostLsName());\r
181                                         strcat(Pkt.RemoteFile, "(");\r
182                                         strcat(Pkt.RemoteFile, Pos->File);\r
183                                         strcat(Pkt.RemoteFile, ")");\r
184                                         strcat(Pkt.RemoteFile, "'");\r
185                                 }\r
186                                 else if(AskHostType() == HTYPE_ACOS_4)\r
187                                 {\r
188                                         strcpy(Pkt.RemoteFile, Pos->File);\r
189                                 }\r
190                                 else\r
191                                 {\r
192                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
193                                         SetSlashTail(Pkt.RemoteFile);\r
194                                         strcat(Pkt.RemoteFile, Pos->File);\r
195                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
196                                 }\r
197 \r
198                                 strcpy(Pkt.Cmd, "RETR ");\r
199                                 Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
200                                 Pkt.Size = Pos->Size;\r
201                                 Pkt.Time = Pos->Time;\r
202                                 Pkt.KanjiCode = AskHostKanjiCode();\r
203                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
204                                 Pkt.KanaCnv = AskHostKanaCnv();\r
205 \r
206                                 Pkt.Mode = CheckLocalFile(&Pkt);        /* Pkt.ExistSize \82ª\83Z\83b\83g\82³\82ê\82é */\r
207                                 if(Pkt.Mode == EXIST_ABORT)\r
208                                         break;\r
209                                 else if(Pkt.Mode != EXIST_IGNORE)\r
210                                         AddTransFileList(&Pkt);\r
211                         }\r
212                         Pos = Pos->Next;\r
213                 }\r
214 \r
215                 if(AskNoFullPathMode() == YES)\r
216                 {\r
217                         strcpy(Pkt.Cmd, "BACKCUR");\r
218                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
219                         AddTransFileList(&Pkt);\r
220                 }\r
221                 DeleteFileList(&FileListBase);\r
222 \r
223                 strcpy(Pkt.Cmd, "GOQUIT");\r
224                 AddTransFileList(&Pkt);\r
225 \r
226                 GoForwardTransWindow();\r
227 //              KeepTransferDialog(NO);\r
228 \r
229                 EnableUserOpe();\r
230         }\r
231         return;\r
232 }\r
233 \r
234 \r
235 /*----- \8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\88ê\82Â\83_\83E\83\93\83\8d\81[\83h\82·\82é ------------------------------\r
236 *\r
237 *       Parameter\r
238 *               char *Fname : \83t\83@\83C\83\8b\96¼\r
239 *\r
240 *       Return Value\r
241 *               \82È\82µ\r
242 *----------------------------------------------------------------------------*/\r
243 \r
244 void DirectDownLoadProc(char *Fname)\r
245 {\r
246         TRANSPACKET Pkt;\r
247 \r
248         if(CheckClosedAndReconnect() == SUCCESS)\r
249         {\r
250                 DisableUserOpe();\r
251 \r
252                 ExistNotify = YES;\r
253 //              KeepTransferDialog(YES);\r
254 \r
255                 if(AskNoFullPathMode() == YES)\r
256                 {\r
257                         strcpy(Pkt.Cmd, "SETCUR");\r
258                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
259                         AddTransFileList(&Pkt);\r
260                 }\r
261 \r
262                 if(strlen(Fname) > 0)\r
263                 {\r
264                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
265                         SetYenTail(Pkt.LocalFile);\r
266                         strcpy(TmpString, Fname);\r
267                         if(FnameCnv == FNAME_LOWER)\r
268                                 _mbslwr(TmpString);\r
269                         else if(FnameCnv == FNAME_UPPER)\r
270                                 _mbsupr(TmpString);\r
271                         RemoveAfterSemicolon(TmpString);\r
272 \r
273                         if(RenameUnuseableName(TmpString) == SUCCESS)\r
274                         {\r
275                                 strcat(Pkt.LocalFile, TmpString);\r
276                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
277 \r
278                                 if(AskHostType() == HTYPE_ACOS)\r
279                                 {\r
280                                         strcpy(Pkt.RemoteFile, "'");\r
281                                         strcat(Pkt.RemoteFile, AskHostLsName());\r
282                                         strcat(Pkt.RemoteFile, "(");\r
283                                         strcat(Pkt.RemoteFile, Fname);\r
284                                         strcat(Pkt.RemoteFile, ")");\r
285                                         strcat(Pkt.RemoteFile, "'");\r
286                                 }\r
287                                 else if(AskHostType() == HTYPE_ACOS_4)\r
288                                 {\r
289                                         strcpy(Pkt.RemoteFile, Fname);\r
290                                 }\r
291                                 else\r
292                                 {\r
293                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
294                                         SetSlashTail(Pkt.RemoteFile);\r
295                                         strcat(Pkt.RemoteFile, Fname);\r
296                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
297                                 }\r
298 \r
299                                 strcpy(Pkt.Cmd, "RETR-S ");\r
300                                 Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
301 \r
302                                 /* \83T\83C\83Y\82Æ\93ú\95t\82Í\93]\91\97\91¤\83X\83\8c\83b\83h\82Å\8eæ\93¾\82µ\81A\83Z\83b\83g\82·\82é */\r
303 \r
304                                 Pkt.KanjiCode = AskHostKanjiCode();\r
305                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
306                                 Pkt.KanaCnv = AskHostKanaCnv();\r
307 \r
308                                 Pkt.Mode = CheckLocalFile(&Pkt);        /* Pkt.ExistSize \82ª\83Z\83b\83g\82³\82ê\82é */\r
309                                 if((Pkt.Mode != EXIST_ABORT) && (Pkt.Mode != EXIST_IGNORE))\r
310                                         AddTransFileList(&Pkt);\r
311                         }\r
312                 }\r
313 \r
314                 if(AskNoFullPathMode() == YES)\r
315                 {\r
316                         strcpy(Pkt.Cmd, "BACKCUR");\r
317                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
318                         AddTransFileList(&Pkt);\r
319                 }\r
320 \r
321                 strcpy(Pkt.Cmd, "GOQUIT");\r
322                 AddTransFileList(&Pkt);\r
323 \r
324                 GoForwardTransWindow();\r
325 //              KeepTransferDialog(NO);\r
326 \r
327                 EnableUserOpe();\r
328         }\r
329         return;\r
330 }\r
331 \r
332 \r
333 /*----- \93ü\97Í\82³\82ê\82½\83t\83@\83C\83\8b\96¼\82Ì\83t\83@\83C\83\8b\82ð\88ê\82Â\83_\83E\83\93\83\8d\81[\83h\82·\82é ------------------\r
334 *\r
335 *       Parameter\r
336 *               \82È\82µ\r
337 *\r
338 *       Return Value\r
339 *               \82È\82µ\r
340 *----------------------------------------------------------------------------*/\r
341 \r
342 void InputDownLoadProc(void)\r
343 {\r
344         char Path[FMAX_PATH+1];\r
345         int Tmp;\r
346 \r
347 //      DisableUserOpe();\r
348 \r
349         strcpy(Path, "");\r
350         if(InputDialogBox(downname_dlg, GetMainHwnd(), NULL, Path, FMAX_PATH, &Tmp, IDH_HELP_TOPIC_0000001) == YES)\r
351         {\r
352                 DirectDownLoadProc(Path);\r
353         }\r
354 \r
355 //      EnableUserOpe();\r
356 \r
357         return;\r
358 }\r
359 \r
360 \r
361 /*----- \83~\83\89\81[\83\8a\83\93\83O\83_\83E\83\93\83\8d\81[\83h\82ð\8ds\82¤ ----------------------------------------\r
362 *\r
363 *       Parameter\r
364 *               int Notify : \8am\94F\82ð\8ds\82¤\82©\82Ç\82¤\82© (YES/NO)\r
365 *\r
366 *       Return Value\r
367 *               \82È\82µ\r
368 *----------------------------------------------------------------------------*/\r
369 \r
370 void MirrorDownloadProc(int Notify)\r
371 {\r
372         FILELIST *LocalListBase;\r
373         FILELIST *RemoteListBase;\r
374         FILELIST *LocalPos;\r
375         FILELIST *RemotePos;\r
376         TRANSPACKET Pkt;\r
377         TRANSPACKET *Base;\r
378         char Name[FMAX_PATH+1];\r
379         char *Cat;\r
380         int Level;\r
381         int Mode;\r
382 \r
383         if(CheckClosedAndReconnect() == SUCCESS)\r
384         {\r
385                 DisableUserOpe();\r
386 \r
387                 Base = NULL;\r
388 \r
389                 if(Notify == YES)\r
390                         Notify = DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirror_down_dlg), GetMainHwnd(), MirrorNotifyCallBack, 0);\r
391                 else\r
392                         Notify = YES;\r
393 \r
394                 if((Notify == YES) || (Notify == YES_LIST))\r
395                 {\r
396                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\8eæ\93¾ =====*/\r
397 \r
398                         LocalListBase = NULL;\r
399                         MakeSelectedFileList(WIN_LOCAL, YES, YES, &LocalListBase, &CancelFlg);\r
400                         RemoteListBase = NULL;\r
401                         MakeSelectedFileList(WIN_REMOTE, YES, YES, &RemoteListBase, &CancelFlg);\r
402 \r
403                         RemotePos = RemoteListBase;\r
404                         while(RemotePos != NULL)\r
405                         {\r
406                                 RemotePos->Attr = YES;          /* RemotePos->Attr\82Í\93]\91\97\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
407                                 RemotePos = RemotePos->Next;\r
408                         }\r
409 \r
410                         LocalPos = LocalListBase;\r
411                         while(LocalPos != NULL)\r
412                         {\r
413                                 if(AskMirrorNoTrn(LocalPos->File, 1) == NO)\r
414                                 {\r
415                                         LocalPos->Attr = YES;\r
416                                         LocalPos = LocalPos->Next;\r
417                                 }\r
418                                 else\r
419                                 {\r
420                                         LocalPos->Attr = NO;    /* LocalPos->Attr\82Í\8dí\8f\9c\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
421 \r
422                                         if(LocalPos->Node == NODE_DIR)\r
423                                         {\r
424                                                 Level = AskDirLevel(LocalPos->File);\r
425                                                 LocalPos = LocalPos->Next;\r
426                                                 while(LocalPos != NULL)\r
427                                                 {\r
428                                                         if((LocalPos->Node == NODE_DIR) &&\r
429                                                            (AskDirLevel(LocalPos->File) <= Level))\r
430                                                         {\r
431                                                                 break;\r
432                                                         }\r
433                                                         LocalPos->Attr = NO;\r
434                                                         LocalPos = LocalPos->Next;\r
435                                                 }\r
436                                         }\r
437                                         else\r
438                                                 LocalPos = LocalPos->Next;\r
439                                 }\r
440                         }\r
441 \r
442                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\94ä\8ar =====*/\r
443 \r
444                         RemotePos = RemoteListBase;\r
445                         while(RemotePos != NULL)\r
446                         {\r
447                                 if(AskMirrorNoTrn(RemotePos->File, 0) == NO)\r
448                                 {\r
449                                         strcpy(Name, RemotePos->File);\r
450 //                                      ReplaceAll(Name, '/', '\\');\r
451 \r
452                                         if(MirrorFnameCnv == YES)\r
453                                                 Mode = COMP_LOWERMATCH;\r
454                                         else\r
455                                                 Mode = COMP_STRICT;\r
456 \r
457                                         if((LocalPos = SearchFileList(Name, LocalListBase, Mode)) != NULL)\r
458                                         {\r
459                                                 if((RemotePos->Node == NODE_DIR) && (LocalPos->Node == NODE_DIR))\r
460                                                 {\r
461                                                         LocalPos->Attr = NO;\r
462                                                         RemotePos->Attr = NO;\r
463                                                 }\r
464                                                 else if((RemotePos->Node == NODE_FILE) && (LocalPos->Node == NODE_FILE))\r
465                                                 {\r
466                                                         LocalPos->Attr = NO;\r
467                                                         if(CompareFileTime(&RemotePos->Time, &LocalPos->Time) <= 0)\r
468                                                                 RemotePos->Attr = NO;\r
469                                                 }\r
470                                         }\r
471                                         RemotePos = RemotePos->Next;\r
472                                 }\r
473                                 else\r
474                                 {\r
475                                         if(RemotePos->Node == NODE_FILE)\r
476                                         {\r
477                                                 RemotePos->Attr = NO;\r
478                                                 RemotePos = RemotePos->Next;\r
479                                         }\r
480                                         else\r
481                                         {\r
482                                                 RemotePos->Attr = NO;\r
483                                                 Level = AskDirLevel(RemotePos->File);\r
484                                                 RemotePos = RemotePos->Next;\r
485                                                 while(RemotePos != NULL)\r
486                                                 {\r
487                                                         if((RemotePos->Node == NODE_DIR) &&\r
488                                                            (AskDirLevel(RemotePos->File) <= Level))\r
489                                                         {\r
490                                                                 break;\r
491                                                         }\r
492                                                         RemotePos->Attr = NO;\r
493                                                         RemotePos = RemotePos->Next;\r
494                                                 }\r
495                                         }\r
496                                 }\r
497                         }\r
498 \r
499                         DispMirrorFiles(LocalListBase, RemoteListBase);\r
500 \r
501                         /*===== \8dí\8f\9c\81^\83A\83b\83v\83\8d\81[\83h =====*/\r
502 \r
503                         LocalPos = LocalListBase;\r
504                         while(LocalPos != NULL)\r
505                         {\r
506                                 if((LocalPos->Attr == YES) && (LocalPos->Node == NODE_FILE))\r
507                                 {\r
508                                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
509                                         SetYenTail(Pkt.LocalFile);\r
510                                         strcat(Pkt.LocalFile, LocalPos->File);\r
511                                         ReplaceAll(Pkt.LocalFile, '/', '\\');\r
512                                         strcpy(Pkt.RemoteFile, "");\r
513                                         strcpy(Pkt.Cmd, "L-DELE ");\r
514                                         AddTmpTransFileList(&Pkt, &Base);\r
515                                 }\r
516                                 LocalPos = LocalPos->Next;\r
517                         }\r
518                         MirrorDeleteAllLocalDir(LocalListBase, &Pkt, &Base);\r
519 \r
520 \r
521                         RemotePos = RemoteListBase;\r
522                         while(RemotePos != NULL)\r
523                         {\r
524                                 if(RemotePos->Attr == YES)\r
525                                 {\r
526                                         AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
527                                         SetYenTail(Pkt.LocalFile);\r
528                                         Cat = strchr(Pkt.LocalFile, NUL);\r
529                                         strcat(Pkt.LocalFile, RemotePos->File);\r
530 \r
531                                         if(MirrorFnameCnv == YES)\r
532                                                 _mbslwr(Cat);\r
533 \r
534                                         RemoveAfterSemicolon(Cat);\r
535                                         ReplaceAll(Pkt.LocalFile, '/', '\\');\r
536 \r
537                                         if(RemotePos->Node == NODE_DIR)\r
538                                         {\r
539                                                 strcpy(Pkt.RemoteFile, "");\r
540                                                 strcpy(Pkt.Cmd, "L-MKD ");\r
541                                                 AddTmpTransFileList(&Pkt, &Base);\r
542                                         }\r
543                                         else if(RemotePos->Node == NODE_FILE)\r
544                                         {\r
545                                                 AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
546                                                 SetSlashTail(Pkt.RemoteFile);\r
547                                                 strcat(Pkt.RemoteFile, RemotePos->File);\r
548                                                 ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
549 \r
550                                                 strcpy(Pkt.Cmd, "RETR ");\r
551                                                 Pkt.Type = AskTransferTypeAssoc(Pkt.RemoteFile, AskTransferType());\r
552                                                 Pkt.Size = RemotePos->Size;\r
553                                                 Pkt.Time = RemotePos->Time;\r
554 //                                              Pkt.Attr = 0;\r
555                                                 Pkt.KanjiCode = AskHostKanjiCode();\r
556                                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
557                                                 Pkt.KanaCnv = AskHostKanaCnv();\r
558                                                 Pkt.Mode = EXIST_OVW;\r
559                                                 AddTmpTransFileList(&Pkt, &Base);\r
560                                         }\r
561                                 }\r
562                                 RemotePos = RemotePos->Next;\r
563                         }\r
564 \r
565                         if((Notify == YES) ||\r
566                            (DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirrordown_notify_dlg), GetMainHwnd(), MirrorDispListCallBack, (LPARAM)&Base) == YES))\r
567                         {\r
568                                 if(AskNoFullPathMode() == YES)\r
569                                 {\r
570                                         strcpy(Pkt.Cmd, "SETCUR");\r
571                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
572                                         AddTransFileList(&Pkt);\r
573                                 }\r
574                                 AppendTransFileList(Base);\r
575 \r
576                                 if(AskNoFullPathMode() == YES)\r
577                                 {\r
578                                         strcpy(Pkt.Cmd, "BACKCUR");\r
579                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
580                                         AddTransFileList(&Pkt);\r
581                                 }\r
582 \r
583                                 strcpy(Pkt.Cmd, "GOQUIT");\r
584                                 AddTransFileList(&Pkt);\r
585                         }\r
586                         else\r
587                                 EraseTmpTransFileList(&Base);\r
588 \r
589                         DeleteFileList(&LocalListBase);\r
590                         DeleteFileList(&RemoteListBase);\r
591 \r
592                         GoForwardTransWindow();\r
593                 }\r
594 \r
595                 EnableUserOpe();\r
596         }\r
597         return;\r
598 }\r
599 \r
600 \r
601 /*----- \83~\83\89\81[\83\8a\83\93\83O\82Ì\83t\83@\83C\83\8b\88ê\97\97\82ð\95\\8e¦ --------------------------------------\r
602 *\r
603 *       Parameter\r
604 *               FILELIST *Local : \83\8d\81[\83J\83\8b\91¤\r
605 *               FILELIST *Remote : \83\8a\83\82\81[\83g\91¤\r
606 *\r
607 *       Return Value\r
608 *               \82È\82µ\r
609 *----------------------------------------------------------------------------*/\r
610 \r
611 static void DispMirrorFiles(FILELIST *Local, FILELIST *Remote)\r
612 {\r
613         char Date[80];\r
614         SYSTEMTIME sTime;\r
615         FILETIME fTime;\r
616 \r
617         if(DebugConsole == YES)\r
618         {\r
619                 DoPrintf("---- MIRROR FILE LIST ----");\r
620                 while(Local != NULL)\r
621                 {\r
622                         FileTimeToLocalFileTime(&Local->Time, &fTime);\r
623                         FileTimeToSystemTime(&fTime, &sTime);\r
624                         sprintf(Date, "%04d/%02d/%02d %02d:%02d:%02d.%04d", \r
625                                 sTime.wYear, sTime.wMonth, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliseconds);\r
626                         DoPrintf("LOCAL  : %s %s [%s] %s", Local->Attr==1?"YES":"NO ", Local->Node==NODE_DIR?"DIR ":"FILE", Date, Local->File);\r
627                         Local = Local->Next;\r
628                 }\r
629                 while(Remote != NULL)\r
630                 {\r
631                         FileTimeToLocalFileTime(&Remote->Time, &fTime);\r
632                         FileTimeToSystemTime(&fTime, &sTime);\r
633                         sprintf(Date, "%04d/%02d/%02d %02d:%02d:%02d.%04d", \r
634                                 sTime.wYear, sTime.wMonth, sTime.wDay, sTime.wHour, sTime.wMinute, sTime.wSecond, sTime.wMilliseconds);\r
635                         DoPrintf("REMOTE : %s %s [%s] %s", Remote->Attr==1?"YES":"NO ", Remote->Node==NODE_DIR?"DIR ":"FILE", Date, Remote->File);\r
636                         Remote = Remote->Next;\r
637                 }\r
638                 DoPrintf("---- END ----");\r
639         }\r
640         return;\r
641 }\r
642 \r
643 \r
644 /*----- \83~\83\89\81[\83\8a\83\93\83O\8e\9e\82Ì\83\8d\81[\83J\83\8b\91¤\82Ì\83t\83H\83\8b\83_\8dí\8f\9c ------------------------------\r
645 *\r
646 *       Parameter\r
647 *               FILELIST *Local : \83t\83@\83C\83\8b\83\8a\83X\83g\r
648 *               TRANSPACKET *Pkt : \r
649 *               TRANSPACKET **Base : \r
650 *\r
651 *       Return Value\r
652 *               \82È\82µ\r
653 *----------------------------------------------------------------------------*/\r
654 \r
655 static void MirrorDeleteAllLocalDir(FILELIST *Local, TRANSPACKET *Pkt, TRANSPACKET **Base)\r
656 {\r
657         while(Local != NULL)\r
658         {\r
659                 if(Local->Node == NODE_DIR)\r
660                 {\r
661                         MirrorDeleteAllLocalDir(Local->Next, Pkt, Base);\r
662 \r
663                         if(Local->Attr == YES)\r
664                         {\r
665                                 AskLocalCurDir(Pkt->LocalFile, FMAX_PATH);\r
666                                 SetYenTail(Pkt->LocalFile);\r
667                                 strcat(Pkt->LocalFile, Local->File);\r
668                                 ReplaceAll(Pkt->LocalFile, '/', '\\');\r
669                                 strcpy(Pkt->RemoteFile, "");\r
670                                 strcpy(Pkt->Cmd, "L-RMD ");\r
671                                 AddTmpTransFileList(Pkt, Base);\r
672                         }\r
673                         break;\r
674                 }\r
675                 Local = Local->Next;\r
676         }\r
677         return;\r
678 }\r
679 \r
680 \r
681 /*----- \83t\83@\83C\83\8b\96¼\82Ì\83Z\83~\83R\83\8d\83\93\88È\8d~\82ð\8eæ\82è\8f\9c\82­ ----------------------------------\r
682 *\r
683 *       Parameter\r
684 *               char *Path : \83t\83@\83C\83\8b\96¼\r
685 *\r
686 *       Return Value\r
687 *               \82È\82µ\r
688 *\r
689 *       Note\r
690 *               Path\82Ì\93à\97e\82ª\8f\91\82«\8a·\82¦\82ç\82ê\82é\r
691 *               \83I\83v\83V\83\87\83\93\90Ý\92è\82É\82æ\82Á\82Ä\8f\88\97\9d\82ð\90Ø\91Ö\82¦\82é\r
692 *----------------------------------------------------------------------------*/\r
693 \r
694 static void RemoveAfterSemicolon(char *Path)\r
695 {\r
696         char *Pos;\r
697 \r
698         if(VaxSemicolon == YES)\r
699         {\r
700                 if((Pos = strchr(Path, ';')) != NULL)\r
701                         *Pos = NUL;\r
702         }\r
703         return;\r
704 }\r
705 \r
706 \r
707 /*----- \83\8d\81[\83J\83\8b\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82È\82¢\82©\83`\83F\83b\83N --------------------------\r
708 *\r
709 *       Parameter\r
710 *               TRANSPACKET *Pkt : \93]\91\97\83t\83@\83C\83\8b\8fî\95ñ\r
711 *\r
712 *       Return Value\r
713 *               int \8f\88\97\9d\95û\96@\r
714 *                       EXIST_OVW/EXIST_RESUME/EXIST_IGNORE\r
715 *\r
716 *       Note\r
717 *               Pkt.ExistSize, ExistMode\81AExistNotify \82ª\95Ï\8dX\82³\82ê\82é\r
718 *----------------------------------------------------------------------------*/\r
719 \r
720 static int CheckLocalFile(TRANSPACKET *Pkt)\r
721 {\r
722         HANDLE fHnd;\r
723         WIN32_FIND_DATA Find;\r
724         int Ret;\r
725 \r
726         Ret = EXIST_OVW;\r
727         Pkt->ExistSize = 0;\r
728         if(RecvMode != TRANS_OVW)\r
729         {\r
730                 if((fHnd = FindFirstFile(Pkt->LocalFile, &Find)) != INVALID_HANDLE_VALUE)\r
731                 {\r
732                         FindClose(fHnd);\r
733 \r
734                         Pkt->ExistSize = MakeLongLong(Find.nFileSizeHigh, Find.nFileSizeLow);\r
735 \r
736                         if(ExistNotify == YES)\r
737                         {\r
738                                 SoundPlay(SND_ERROR);\r
739                                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(down_exist_dlg), GetMainHwnd(), DownExistDialogCallBack, (LPARAM)Pkt) == NO)\r
740                                         Ret = EXIST_ABORT;\r
741                                 else\r
742                                         Ret = ExistMode;\r
743                         }\r
744                         else\r
745                                 Ret = ExistMode;\r
746 \r
747                         if(Ret == EXIST_NEW)\r
748                         {\r
749                                 /*\83t\83@\83C\83\8b\93ú\95t\83`\83F\83b\83N */\r
750                                 if(CompareFileTime(&Find.ftLastWriteTime, &Pkt->Time) < 0)\r
751                                         Ret = EXIST_OVW;\r
752                                 else\r
753                                         Ret = EXIST_IGNORE;\r
754                         }\r
755                 }\r
756         }\r
757         return(Ret);\r
758 }\r
759 \r
760 \r
761 /*----- \83\8d\81[\83J\83\8b\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\8am\94F\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ----\r
762 *\r
763 *       Parameter\r
764 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
765 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
766 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
767 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
768 *\r
769 *       Return Value\r
770 *               BOOL TRUE/FALSE\r
771 *----------------------------------------------------------------------------*/\r
772 \r
773 static BOOL CALLBACK DownExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
774 {\r
775         static TRANSPACKET *Pkt;\r
776         static const RADIOBUTTON DownExistButton[] = {\r
777                 { DOWN_EXIST_OVW, EXIST_OVW },\r
778                 { DOWN_EXIST_NEW, EXIST_NEW },\r
779                 { DOWN_EXIST_RESUME, EXIST_RESUME },\r
780                 { DOWN_EXIST_IGNORE, EXIST_IGNORE }\r
781         };\r
782         #define DOWNEXISTBUTTONS        (sizeof(DownExistButton)/sizeof(RADIOBUTTON))\r
783 \r
784         switch (iMessage)\r
785         {\r
786                 case WM_INITDIALOG :\r
787                         Pkt = (TRANSPACKET *)lParam;\r
788                         SendDlgItemMessage(hDlg, DOWN_EXIST_NAME, EM_LIMITTEXT, FMAX_PATH, 0);\r
789                         SendDlgItemMessage(hDlg, DOWN_EXIST_NAME, WM_SETTEXT, 0, (LPARAM)Pkt->LocalFile);\r
790 \r
791                         if((Pkt->Type == TYPE_A) || (Pkt->ExistSize <= 0))\r
792                                 EnableWindow(GetDlgItem(hDlg, DOWN_EXIST_RESUME), FALSE);\r
793 \r
794                         SetRadioButtonByValue(hDlg, ExistMode, DownExistButton, DOWNEXISTBUTTONS);\r
795                         return(TRUE);\r
796 \r
797                 case WM_COMMAND :\r
798                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
799                         {\r
800                                 case IDOK_ALL :\r
801                                         ExistNotify = NO;\r
802                                         /* \82±\82±\82É break \82Í\82È\82¢ */\r
803 \r
804                                 case IDOK :\r
805                                         ExistMode = AskRadioButtonValue(hDlg, DownExistButton, DOWNEXISTBUTTONS);\r
806                                         SendDlgItemMessage(hDlg, DOWN_EXIST_NAME, WM_GETTEXT, FMAX_PATH, (LPARAM)Pkt->LocalFile);\r
807                                         EndDialog(hDlg, YES);\r
808                                         break;\r
809 \r
810                                 case IDCANCEL :\r
811 //                                      ExistMode = EXIST_ABORT;\r
812                                         EndDialog(hDlg, NO);\r
813                                         break;\r
814 \r
815                                 case IDHELP :\r
816                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000009);\r
817                                         break;\r
818                         }\r
819             return(TRUE);\r
820         }\r
821         return(FALSE);\r
822 }\r
823 \r
824 \r
825 \r
826 \r
827 \r
828 \r
829 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83A\83b\83v\83\8d\81[\83h\82·\82é --------------------\r
830 *\r
831 *       Parameter\r
832 *               int ChName : \96¼\91O\82ð\95Ï\82¦\82é\82©\82Ç\82¤\82© (YES/NO)\r
833 *               int All : \91S\82Ä\82ª\91I\82Î\82ê\82Ä\82¢\82é\95¨\82Æ\82µ\82Ä\88µ\82¤\82©\82Ç\82¤\82© (YES/NO)\r
834 *\r
835 *       Return Value\r
836 *               \82È\82µ\r
837 *----------------------------------------------------------------------------*/\r
838 \r
839 void UpLoadListProc(int ChName, int All)\r
840 {\r
841         FILELIST *FileListBase;\r
842         FILELIST *Pos;\r
843         TRANSPACKET Pkt;\r
844         TRANSPACKET Pkt1;\r
845         char *Cat;\r
846         FILELIST *RemoteList;\r
847         char Tmp[FMAX_PATH+1];\r
848         int FirstAdd;\r
849 \r
850         if(CheckClosedAndReconnect() == SUCCESS)\r
851         {\r
852                 DisableUserOpe();\r
853 \r
854                 // \83\8d\81[\83J\83\8b\91¤\82Å\91I\82Î\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82ðFileListBase\82É\93o\98^\r
855                 FileListBase = NULL;\r
856                 MakeSelectedFileList(WIN_LOCAL, YES, All, &FileListBase, &CancelFlg);\r
857 \r
858                 // \8c»\8dÝ\83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82É\95\\8e¦\82³\82ê\82Ä\82¢\82é\82à\82Ì\82ðRemoteList\82É\93o\98^\r
859                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
860                 RemoteList = NULL;\r
861                 AddRemoteTreeToFileList(AskCurrentFileListNum(), "", RDIR_NONE, &RemoteList);\r
862 \r
863                 FirstAdd = YES;\r
864                 ExistNotify = YES;\r
865 \r
866                 Pos = FileListBase;\r
867                 while(Pos != NULL)\r
868                 {\r
869                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
870                         SetSlashTail(Pkt.RemoteFile);\r
871                         Cat = strchr(Pkt.RemoteFile, NUL);\r
872                         if((ChName == NO) || (Pos->Node == NODE_DIR))\r
873                         {\r
874                                 strcat(Pkt.RemoteFile, Pos->File);\r
875                                 if(FnameCnv == FNAME_LOWER)\r
876                                         _mbslwr(Cat);\r
877                                 else if(FnameCnv == FNAME_UPPER)\r
878                                         _mbsupr(Cat);\r
879                         }\r
880                         else\r
881                         {\r
882                                 // \96¼\91O\82ð\95Ï\8dX\82·\82é\r
883                                 strcpy(TmpString, Pos->File);\r
884                                 CurWin = WIN_LOCAL;\r
885                                 if(DialogBox(GetFtpInst(), MAKEINTRESOURCE(updown_as_dlg), GetMainHwnd(), UpDownAsDialogCallBack) == YES)\r
886                                         strcat(Pkt.RemoteFile, TmpString);\r
887                                 else\r
888                                         break;\r
889                         }\r
890                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
891 \r
892                         if(AskHostType() == HTYPE_ACOS)\r
893                         {\r
894                                 strcpy(Pkt.RemoteFile, "'");\r
895                                 strcat(Pkt.RemoteFile, AskHostLsName());\r
896                                 strcat(Pkt.RemoteFile, "(");\r
897                                 strcat(Pkt.RemoteFile, Cat);\r
898                                 strcat(Pkt.RemoteFile, ")");\r
899                                 strcat(Pkt.RemoteFile, "'");\r
900                         }\r
901                         else if(AskHostType() == HTYPE_ACOS_4)\r
902                                 strcpy(Pkt.RemoteFile, Cat);\r
903 \r
904                         if(Pos->Node == NODE_DIR)\r
905                         {\r
906                                 // \83t\83H\83\8b\83_\82Ì\8fê\8d\87\r
907 \r
908                                 // \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82ðRemoteList\82É\93o\98^\r
909                                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
910                                 if(RemoteList != NULL)\r
911                                         DeleteFileList(&RemoteList);\r
912                                 RemoteList = NULL;\r
913 \r
914                                 AskRemoteCurDir(Tmp, FMAX_PATH);\r
915                                 if(DoCWD(Pkt.RemoteFile, NO, NO, NO) == FTP_COMPLETE)\r
916                                 {\r
917                                         if(DoDirListCmdSkt("", "", 998, &CancelFlg) == FTP_COMPLETE)\r
918                                                 AddRemoteTreeToFileList(998, "", RDIR_NONE, &RemoteList);\r
919                                         DoCWD(Tmp, NO, NO, NO);\r
920                                 }\r
921                                 else\r
922                                 {\r
923                                         // \83t\83H\83\8b\83_\82ð\8dì\90¬\r
924                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
925                                         {\r
926                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
927                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
928                                                 AddTransFileList(&Pkt1);\r
929                                         }\r
930                                         FirstAdd = NO;\r
931                                         strcpy(Pkt.Cmd, "MKD ");\r
932                                         strcpy(Pkt.LocalFile, "");\r
933                                         AddTransFileList(&Pkt);\r
934                                 }\r
935                         }\r
936                         else if(Pos->Node == NODE_FILE)\r
937                         {\r
938                                 // \83t\83@\83C\83\8b\82Ì\8fê\8d\87\r
939                                 AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
940                                 SetYenTail(Pkt.LocalFile);\r
941                                 strcat(Pkt.LocalFile, Pos->File);\r
942                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
943 \r
944                                 strcpy(Pkt.Cmd, "STOR ");\r
945                                 Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
946                                 Pkt.Size = 0;\r
947                                 Pkt.Time = Pos->Time;\r
948                                 Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
949                                 Pkt.KanjiCode = AskHostKanjiCode();\r
950                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
951                                 Pkt.KanaCnv = AskHostKanaCnv();\r
952                                 Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
953                                 if(Pkt.Mode == EXIST_ABORT)\r
954                                         break;\r
955                                 else if(Pkt.Mode != EXIST_IGNORE)\r
956                                 {\r
957                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
958                                         {\r
959                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
960                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
961                                                 AddTransFileList(&Pkt1);\r
962                                         }\r
963                                         FirstAdd = NO;\r
964                                         AddTransFileList(&Pkt);\r
965                                 }\r
966                         }\r
967                         Pos = Pos->Next;\r
968                 }\r
969 \r
970                 if((FirstAdd == NO) && (AskNoFullPathMode() == YES))\r
971                 {\r
972                         strcpy(Pkt.Cmd, "BACKCUR");\r
973                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
974                         AddTransFileList(&Pkt);\r
975                 }\r
976 \r
977                 if(RemoteList != NULL)\r
978                         DeleteFileList(&RemoteList);\r
979 \r
980                 DeleteFileList(&FileListBase);\r
981 \r
982                 strcpy(Pkt.Cmd, "GOQUIT");\r
983                 AddTransFileList(&Pkt);\r
984 \r
985                 GoForwardTransWindow();\r
986 \r
987                 EnableUserOpe();\r
988         }\r
989         return;\r
990 }\r
991 \r
992 \r
993 /*----- \83h\83\89\83b\83O\81\95\83h\83\8d\83b\83v\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\83A\83b\83v\83\8d\81[\83h\82·\82é --------------\r
994 *\r
995 *       Parameter\r
996 *               WPARAM wParam : \83h\83\8d\83b\83v\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\8fî\95ñ\r
997 *\r
998 *       Return Value\r
999 *               \82È\82µ\r
1000 *----------------------------------------------------------------------------*/\r
1001 \r
1002 void UpLoadDragProc(WPARAM wParam)\r
1003 {\r
1004         FILELIST *FileListBase;\r
1005         FILELIST *Pos;\r
1006         TRANSPACKET Pkt;\r
1007         TRANSPACKET Pkt1;\r
1008         char *Cat;\r
1009         FILELIST *RemoteList;\r
1010         char Tmp[FMAX_PATH+1];\r
1011         int FirstAdd;\r
1012         char Cur[FMAX_PATH+1];\r
1013 \r
1014         if(CheckClosedAndReconnect() == SUCCESS)\r
1015         {\r
1016                 DisableUserOpe();\r
1017 \r
1018                 // \83\8d\81[\83J\83\8b\91¤\82Å\91I\82Î\82ê\82Ä\82¢\82é\83t\83@\83C\83\8b\82ðFileListBase\82É\93o\98^\r
1019                 FileListBase = NULL;\r
1020                 MakeDroppedFileList(wParam, Cur, &FileListBase);\r
1021 \r
1022                 // \8c»\8dÝ\83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82É\95\\8e¦\82³\82ê\82Ä\82¢\82é\82à\82Ì\82ðRemoteList\82É\93o\98^\r
1023                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
1024                 RemoteList = NULL;\r
1025                 AddRemoteTreeToFileList(AskCurrentFileListNum(), "", RDIR_NONE, &RemoteList);\r
1026 \r
1027                 FirstAdd = YES;\r
1028                 ExistNotify = YES;\r
1029 \r
1030                 Pos = FileListBase;\r
1031                 while(Pos != NULL)\r
1032                 {\r
1033                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1034                         SetSlashTail(Pkt.RemoteFile);\r
1035                         Cat = strchr(Pkt.RemoteFile, NUL);\r
1036 \r
1037                         strcat(Pkt.RemoteFile, Pos->File);\r
1038                         if(FnameCnv == FNAME_LOWER)\r
1039                                 _mbslwr(Cat);\r
1040                         else if(FnameCnv == FNAME_UPPER)\r
1041                                 _mbsupr(Cat);\r
1042                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
1043 \r
1044                         if(AskHostType() == HTYPE_ACOS)\r
1045                         {\r
1046                                 strcpy(Pkt.RemoteFile, "'");\r
1047                                 strcat(Pkt.RemoteFile, AskHostLsName());\r
1048                                 strcat(Pkt.RemoteFile, "(");\r
1049                                 strcat(Pkt.RemoteFile, Cat);\r
1050                                 strcat(Pkt.RemoteFile, ")");\r
1051                                 strcat(Pkt.RemoteFile, "'");\r
1052                         }\r
1053                         else if(AskHostType() == HTYPE_ACOS_4)\r
1054                                 strcpy(Pkt.RemoteFile, Cat);\r
1055 \r
1056                         if(Pos->Node == NODE_DIR)\r
1057                         {\r
1058                                 // \83t\83H\83\8b\83_\82Ì\8fê\8d\87\r
1059 \r
1060                                 // \83z\83X\83g\91¤\82Ì\83t\83@\83C\83\8b\88ê\97\97\82ðRemoteList\82É\93o\98^\r
1061                                 // \93¯\96¼\83t\83@\83C\83\8b\83`\83F\83b\83N\97p\r
1062                                 if(RemoteList != NULL)\r
1063                                         DeleteFileList(&RemoteList);\r
1064                                 RemoteList = NULL;\r
1065 \r
1066                                 AskRemoteCurDir(Tmp, FMAX_PATH);\r
1067                                 if(DoCWD(Pkt.RemoteFile, NO, NO, NO) == FTP_COMPLETE)\r
1068                                 {\r
1069                                         if(DoDirListCmdSkt("", "", 998, &CancelFlg) == FTP_COMPLETE)\r
1070                                                 AddRemoteTreeToFileList(998, "", RDIR_NONE, &RemoteList);\r
1071                                         DoCWD(Tmp, NO, NO, NO);\r
1072                                 }\r
1073                                 else\r
1074                                 {\r
1075                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
1076                                         {\r
1077                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
1078                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
1079                                                 AddTransFileList(&Pkt1);\r
1080                                         }\r
1081                                         FirstAdd = NO;\r
1082                                         strcpy(Pkt.Cmd, "MKD ");\r
1083                                         strcpy(Pkt.LocalFile, "");\r
1084                                         AddTransFileList(&Pkt);\r
1085                                 }\r
1086                         }\r
1087                         else if(Pos->Node == NODE_FILE)\r
1088                         {\r
1089                                 // \83t\83@\83C\83\8b\82Ì\8fê\8d\87\r
1090                                 strcpy(Pkt.LocalFile, Cur);\r
1091                                 SetYenTail(Pkt.LocalFile);\r
1092                                 strcat(Pkt.LocalFile, Pos->File);\r
1093                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
1094 \r
1095                                 strcpy(Pkt.Cmd, "STOR ");\r
1096                                 Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
1097                                 Pkt.Size = 0;\r
1098                                 Pkt.Time = Pos->Time;\r
1099                                 Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
1100                                 Pkt.KanjiCode = AskHostKanjiCode();\r
1101                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
1102                                 Pkt.KanaCnv = AskHostKanaCnv();\r
1103                                 Pkt.Mode = CheckRemoteFile(&Pkt, RemoteList);\r
1104                                 if(Pkt.Mode == EXIST_ABORT)\r
1105                                         break;\r
1106                                 else if(Pkt.Mode != EXIST_IGNORE)\r
1107                                 {\r
1108                                         if((FirstAdd == YES) && (AskNoFullPathMode() == YES))\r
1109                                         {\r
1110                                                 strcpy(Pkt1.Cmd, "SETCUR");\r
1111                                                 AskRemoteCurDir(Pkt1.RemoteFile, FMAX_PATH);\r
1112                                                 AddTransFileList(&Pkt1);\r
1113                                         }\r
1114                                         FirstAdd = NO;\r
1115                                         AddTransFileList(&Pkt);\r
1116                                 }\r
1117                         }\r
1118                         Pos = Pos->Next;\r
1119                 }\r
1120 \r
1121                 if((FirstAdd == NO) && (AskNoFullPathMode() == YES))\r
1122                 {\r
1123                         strcpy(Pkt.Cmd, "BACKCUR");\r
1124                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1125                         AddTransFileList(&Pkt);\r
1126                 }\r
1127 \r
1128                 if(RemoteList != NULL)\r
1129                         DeleteFileList(&RemoteList);\r
1130 \r
1131                 DeleteFileList(&FileListBase);\r
1132 \r
1133                 strcpy(Pkt.Cmd, "GOQUIT");\r
1134                 AddTransFileList(&Pkt);\r
1135 \r
1136                 GoForwardTransWindow();\r
1137 \r
1138                 EnableUserOpe();\r
1139         }\r
1140         return;\r
1141 }\r
1142 \r
1143 \r
1144 /*----- \83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\82ð\8ds\82¤ ----------------------------------------\r
1145 *\r
1146 *       Parameter\r
1147 *               int Notify : \8am\94F\82ð\8ds\82¤\82©\82Ç\82¤\82© (YES/NO)\r
1148 *\r
1149 *       Return Value\r
1150 *               \82È\82µ\r
1151 *----------------------------------------------------------------------------*/\r
1152 \r
1153 void MirrorUploadProc(int Notify)\r
1154 {\r
1155         FILELIST *LocalListBase;\r
1156         FILELIST *RemoteListBase;\r
1157         FILELIST *LocalPos;\r
1158         FILELIST *RemotePos;\r
1159         TRANSPACKET Pkt;\r
1160         TRANSPACKET *Base;\r
1161         char Name[FMAX_PATH+1];\r
1162         char *Cat;\r
1163         int Level;\r
1164         int Mode;\r
1165         SYSTEMTIME TmpStime;\r
1166         FILETIME TmpFtimeL;\r
1167         FILETIME TmpFtimeR;\r
1168 \r
1169         if(CheckClosedAndReconnect() == SUCCESS)\r
1170         {\r
1171                 DisableUserOpe();\r
1172 \r
1173                 Base = NULL;\r
1174 \r
1175                 if(Notify == YES)\r
1176                         Notify = DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirror_up_dlg), GetMainHwnd(), MirrorNotifyCallBack, 1);\r
1177                 else\r
1178                         Notify = YES;\r
1179 \r
1180                 if((Notify == YES) || (Notify == YES_LIST))\r
1181                 {\r
1182                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\8eæ\93¾ =====*/\r
1183 \r
1184                         LocalListBase = NULL;\r
1185                         MakeSelectedFileList(WIN_LOCAL, YES, YES, &LocalListBase, &CancelFlg);\r
1186                         RemoteListBase = NULL;\r
1187                         MakeSelectedFileList(WIN_REMOTE, YES, YES, &RemoteListBase, &CancelFlg);\r
1188 \r
1189                         LocalPos = LocalListBase;\r
1190                         while(LocalPos != NULL)\r
1191                         {\r
1192                                 LocalPos->Attr = YES;           /* LocalPos->Attr\82Í\93]\91\97\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
1193                                 LocalPos = LocalPos->Next;\r
1194                         }\r
1195 \r
1196                         RemotePos = RemoteListBase;\r
1197                         while(RemotePos != NULL)\r
1198                         {\r
1199                                 if(AskMirrorNoTrn(RemotePos->File, 1) == NO)\r
1200                                 {\r
1201                                         RemotePos->Attr = YES;\r
1202                                         RemotePos = RemotePos->Next;\r
1203                                 }\r
1204                                 else\r
1205                                 {\r
1206                                         RemotePos->Attr = NO;   /* RemotePos->Attr\82Í\8dí\8f\9c\82·\82é\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O\82É\8eg\97p (YES/NO) */\r
1207 \r
1208                                         if(RemotePos->Node == NODE_DIR)\r
1209                                         {\r
1210                                                 Level = AskDirLevel(RemotePos->File);\r
1211                                                 RemotePos = RemotePos->Next;\r
1212                                                 while(RemotePos != NULL)\r
1213                                                 {\r
1214                                                         if((RemotePos->Node == NODE_DIR) &&\r
1215                                                            (AskDirLevel(RemotePos->File) <= Level))\r
1216                                                         {\r
1217                                                                 break;\r
1218                                                         }\r
1219                                                         RemotePos->Attr = NO;\r
1220                                                         RemotePos = RemotePos->Next;\r
1221                                                 }\r
1222                                         }\r
1223                                         else\r
1224                                                 RemotePos = RemotePos->Next;\r
1225                                 }\r
1226                         }\r
1227 \r
1228                         /*===== \83t\83@\83C\83\8b\83\8a\83X\83g\94ä\8ar =====*/\r
1229 \r
1230                         LocalPos = LocalListBase;\r
1231                         while(LocalPos != NULL)\r
1232                         {\r
1233                                 if(AskMirrorNoTrn(LocalPos->File, 0) == NO)\r
1234                                 {\r
1235                                         strcpy(Name, LocalPos->File);\r
1236                                         ReplaceAll(Name, '\\', '/');\r
1237 \r
1238                                         if(MirrorFnameCnv == YES)\r
1239                                                 Mode = COMP_LOWERMATCH;\r
1240                                         else\r
1241                                                 Mode = COMP_STRICT;\r
1242 \r
1243                                         if(LocalPos->Node == NODE_DIR)\r
1244                                         {\r
1245                                                 if((RemotePos = SearchFileList(Name, RemoteListBase, Mode)) != NULL)\r
1246                                                 {\r
1247                                                         if(RemotePos->Node == NODE_DIR)\r
1248                                                         {\r
1249                                                                 RemotePos->Attr = NO;\r
1250                                                                 LocalPos->Attr = NO;\r
1251                                                         }\r
1252                                                 }\r
1253                                         }\r
1254                                         else if(LocalPos->Node == NODE_FILE)\r
1255                                         {\r
1256                                                 if((RemotePos = SearchFileList(Name, RemoteListBase, Mode)) != NULL)\r
1257                                                 {\r
1258                                                         if(RemotePos->Node == NODE_FILE)\r
1259                                                         {\r
1260                                                                 FileTimeToLocalFileTime(&LocalPos->Time, &TmpFtimeL);\r
1261                                                                 FileTimeToLocalFileTime(&RemotePos->Time, &TmpFtimeR);\r
1262                                                                 if((RemotePos->InfoExist & FINFO_TIME) == 0)\r
1263                                                                 {\r
1264                                                                         FileTimeToSystemTime(&TmpFtimeL, &TmpStime);\r
1265                                                                         TmpStime.wHour = 0;\r
1266                                                                         TmpStime.wMinute = 0;\r
1267                                                                         TmpStime.wSecond = 0;\r
1268                                                                         TmpStime.wMilliseconds = 0;\r
1269                                                                         SystemTimeToFileTime(&TmpStime, &TmpFtimeL);\r
1270 \r
1271                                                                         FileTimeToSystemTime(&TmpFtimeR, &TmpStime);\r
1272                                                                         TmpStime.wHour = 0;\r
1273                                                                         TmpStime.wMinute = 0;\r
1274                                                                         TmpStime.wSecond = 0;\r
1275                                                                         TmpStime.wMilliseconds = 0;\r
1276                                                                         SystemTimeToFileTime(&TmpStime, &TmpFtimeR);\r
1277                                                                 }\r
1278                                                                 RemotePos->Attr = NO;\r
1279                                                                 if(CompareFileTime(&TmpFtimeL, &TmpFtimeR) <= 0)\r
1280                                                                         LocalPos->Attr = NO;\r
1281                                                         }\r
1282                                                 }\r
1283                                         }\r
1284 \r
1285                                         LocalPos = LocalPos->Next;\r
1286                                 }\r
1287                                 else\r
1288                                 {\r
1289                                         if(LocalPos->Node == NODE_FILE)\r
1290                                         {\r
1291                                                 LocalPos->Attr = NO;\r
1292                                                 LocalPos = LocalPos->Next;\r
1293                                         }\r
1294                                         else\r
1295                                         {\r
1296                                                 LocalPos->Attr = NO;\r
1297                                                 Level = AskDirLevel(LocalPos->File);\r
1298                                                 LocalPos = LocalPos->Next;\r
1299                                                 while(LocalPos != NULL)\r
1300                                                 {\r
1301                                                         if((LocalPos->Node == NODE_DIR) &&\r
1302                                                            (AskDirLevel(LocalPos->File) <= Level))\r
1303                                                         {\r
1304                                                                 break;\r
1305                                                         }\r
1306                                                         LocalPos->Attr = NO;\r
1307                                                         LocalPos = LocalPos->Next;\r
1308                                                 }\r
1309                                         }\r
1310                                 }\r
1311                         }\r
1312 \r
1313                         DispMirrorFiles(LocalListBase, RemoteListBase);\r
1314 \r
1315                         /*===== \8dí\8f\9c\81^\83A\83b\83v\83\8d\81[\83h =====*/\r
1316 \r
1317                         RemotePos = RemoteListBase;\r
1318                         while(RemotePos != NULL)\r
1319                         {\r
1320                                 if((RemotePos->Attr == YES) && (RemotePos->Node == NODE_FILE))\r
1321                                 {\r
1322                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1323                                         SetSlashTail(Pkt.RemoteFile);\r
1324                                         strcat(Pkt.RemoteFile, RemotePos->File);\r
1325                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
1326                                         strcpy(Pkt.LocalFile, "");\r
1327                                         strcpy(Pkt.Cmd, "R-DELE ");\r
1328                                         AddTmpTransFileList(&Pkt, &Base);\r
1329                                 }\r
1330                                 RemotePos = RemotePos->Next;\r
1331                         }\r
1332                         MirrorDeleteAllDir(RemoteListBase, &Pkt, &Base);\r
1333 \r
1334                         LocalPos = LocalListBase;\r
1335                         while(LocalPos != NULL)\r
1336                         {\r
1337                                 if(LocalPos->Attr == YES)\r
1338                                 {\r
1339                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1340                                         SetSlashTail(Pkt.RemoteFile);\r
1341                                         Cat = strchr(Pkt.RemoteFile, NUL);\r
1342                                         strcat(Pkt.RemoteFile, LocalPos->File);\r
1343 \r
1344                                         if(MirrorFnameCnv == YES)\r
1345                                                 _mbslwr(Cat);\r
1346 \r
1347                                         ReplaceAll(Pkt.RemoteFile, '\\', '/');\r
1348 \r
1349                                         if(LocalPos->Node == NODE_DIR)\r
1350                                         {\r
1351                                                 strcpy(Pkt.LocalFile, "");\r
1352                                                 strcpy(Pkt.Cmd, "R-MKD ");\r
1353                                                 AddTmpTransFileList(&Pkt, &Base);\r
1354                                         }\r
1355                                         else if(LocalPos->Node == NODE_FILE)\r
1356                                         {\r
1357                                                 AskLocalCurDir(Pkt.LocalFile, FMAX_PATH);\r
1358                                                 SetYenTail(Pkt.LocalFile);\r
1359                                                 strcat(Pkt.LocalFile, LocalPos->File);\r
1360                                                 ReplaceAll(Pkt.LocalFile, '/', '\\');\r
1361 \r
1362                                                 strcpy(Pkt.Cmd, "STOR ");\r
1363                                                 Pkt.Type = AskTransferTypeAssoc(Pkt.LocalFile, AskTransferType());\r
1364                                                 Pkt.Size = 0;\r
1365                                                 Pkt.Time = LocalPos->Time;\r
1366                                                 Pkt.Attr = AskUpLoadFileAttr(Pkt.RemoteFile);\r
1367                                                 Pkt.KanjiCode = AskHostKanjiCode();\r
1368                                                 Pkt.KanjiCodeDesired = AskLocalKanjiCode();\r
1369                                                 Pkt.KanaCnv = AskHostKanaCnv();\r
1370                                                 Pkt.Mode = EXIST_OVW;\r
1371                                                 AddTmpTransFileList(&Pkt, &Base);\r
1372                                         }\r
1373                                 }\r
1374                                 LocalPos = LocalPos->Next;\r
1375                         }\r
1376 \r
1377                         if((Notify == YES) ||\r
1378                            (DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(mirror_notify_dlg), GetMainHwnd(), MirrorDispListCallBack, (LPARAM)&Base) == YES))\r
1379                         {\r
1380                                 if(AskNoFullPathMode() == YES)\r
1381                                 {\r
1382                                         strcpy(Pkt.Cmd, "SETCUR");\r
1383                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1384                                         AddTransFileList(&Pkt);\r
1385                                 }\r
1386                                 AppendTransFileList(Base);\r
1387 \r
1388                                 if(AskNoFullPathMode() == YES)\r
1389                                 {\r
1390                                         strcpy(Pkt.Cmd, "BACKCUR");\r
1391                                         AskRemoteCurDir(Pkt.RemoteFile, FMAX_PATH);\r
1392                                         AddTransFileList(&Pkt);\r
1393                                 }\r
1394 \r
1395                                 strcpy(Pkt.Cmd, "GOQUIT");\r
1396                                 AddTransFileList(&Pkt);\r
1397                         }\r
1398                         else\r
1399                                 EraseTmpTransFileList(&Base);\r
1400 \r
1401                         DeleteFileList(&LocalListBase);\r
1402                         DeleteFileList(&RemoteListBase);\r
1403 \r
1404                         GoForwardTransWindow();\r
1405                 }\r
1406 \r
1407                 EnableUserOpe();\r
1408         }\r
1409         return;\r
1410 }\r
1411 \r
1412 \r
1413 /*----- \83~\83\89\81[\83\8a\83\93\83O\8e\9e\82Ì\83z\83X\83g\91¤\82Ì\83t\83H\83\8b\83_\8dí\8f\9c --------------------------------\r
1414 *\r
1415 *       Parameter\r
1416 *               FILELIST *Base : \83t\83@\83C\83\8b\83\8a\83X\83g\r
1417 *               TRANSPACKET *Pkt : \r
1418 *               TRANSPACKET **Base : \r
1419 *\r
1420 *       Return Value\r
1421 *               \82È\82µ\r
1422 *----------------------------------------------------------------------------*/\r
1423 \r
1424 static void MirrorDeleteAllDir(FILELIST *Remote, TRANSPACKET *Pkt, TRANSPACKET **Base)\r
1425 {\r
1426         while(Remote != NULL)\r
1427         {\r
1428                 if(Remote->Node == NODE_DIR)\r
1429                 {\r
1430                         MirrorDeleteAllDir(Remote->Next, Pkt, Base);\r
1431 \r
1432                         if(Remote->Attr == YES)\r
1433                         {\r
1434                                 AskRemoteCurDir(Pkt->RemoteFile, FMAX_PATH);\r
1435                                 SetSlashTail(Pkt->RemoteFile);\r
1436                                 strcat(Pkt->RemoteFile, Remote->File);\r
1437                                 ReplaceAll(Pkt->RemoteFile, '\\', '/');\r
1438                                 strcpy(Pkt->LocalFile, "");\r
1439                                 strcpy(Pkt->Cmd, "R-RMD ");\r
1440                                 AddTmpTransFileList(Pkt, Base);\r
1441                         }\r
1442                         break;\r
1443                 }\r
1444                 Remote = Remote->Next;\r
1445         }\r
1446         return;\r
1447 }\r
1448 \r
1449 \r
1450 /*----- \83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\8aJ\8en\8am\94F\83E\83C\83\93\83h\83E\82Ì\83R\81[\83\8b\83o\83b\83N --------------\r
1451 *\r
1452 *       Parameter\r
1453 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1454 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1455 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1456 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1457 *\r
1458 *       Return Value\r
1459 *               BOOL TRUE/FALSE\r
1460 *----------------------------------------------------------------------------*/\r
1461 \r
1462 static BOOL CALLBACK MirrorNotifyCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1463 {\r
1464         static int Mode;\r
1465 \r
1466         switch (iMessage)\r
1467         {\r
1468                 case WM_INITDIALOG :\r
1469                         Mode = lParam;\r
1470                         return(TRUE);\r
1471 \r
1472                 case WM_COMMAND :\r
1473                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1474                         {\r
1475                                 case IDOK :\r
1476                                         EndDialog(hDlg, YES);\r
1477                                         break;\r
1478 \r
1479                                 case IDCANCEL :\r
1480                                         EndDialog(hDlg, NO);\r
1481                                         break;\r
1482 \r
1483                                 case MIRRORUP_DISP :\r
1484                                         EndDialog(hDlg, YES_LIST);\r
1485                                         break;\r
1486 \r
1487                                 case IDHELP :\r
1488                                         if(Mode == 0)\r
1489                                                 hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000013);\r
1490                                         else\r
1491                                                 hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000012);\r
1492                         }\r
1493             return(TRUE);\r
1494         }\r
1495         return(FALSE);\r
1496 }\r
1497 \r
1498 \r
1499 /*----- \83~\83\89\81[\83\8a\83\93\83O\83A\83b\83v\83\8d\81[\83h\8f\88\97\9d\93à\97e\8am\94F\83E\83C\83\93\83h\83E\82Ì\83R\81[\83\8b\83o\83b\83N ----------\r
1500 *\r
1501 *       Parameter\r
1502 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1503 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1504 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1505 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1506 *\r
1507 *       Return Value\r
1508 *               BOOL TRUE/FALSE\r
1509 *----------------------------------------------------------------------------*/\r
1510 \r
1511 static BOOL CALLBACK MirrorDispListCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1512 {\r
1513         static DIALOGSIZE DlgSize = {\r
1514                 { MIRROR_DEL, MIRROR_SIZEGRIP, -1 },\r
1515                 { IDOK, IDCANCEL, IDHELP, MIRROR_DEL, MIRROR_COPYNUM, MIRROR_MAKENUM, MIRROR_DELNUM, MIRROR_SIZEGRIP, -1 },\r
1516                 { MIRROR_LIST, -1 },\r
1517                 { 0, 0 },\r
1518                 { 0, 0 }\r
1519         };\r
1520 \r
1521         static TRANSPACKET **Base;\r
1522         TRANSPACKET *Pos;\r
1523         char Tmp[FMAX_PATH+1+6];\r
1524         int Num;\r
1525         int *List;\r
1526 \r
1527         switch (iMessage)\r
1528         {\r
1529                 case WM_INITDIALOG :\r
1530                         Base = (TRANSPACKET **)lParam;\r
1531                         Pos = *Base;\r
1532                         while(Pos != NULL)\r
1533                         {\r
1534                                 strcpy(Tmp, "");\r
1535                                 if((strncmp(Pos->Cmd, "R-DELE", 6) == 0) ||\r
1536                                    (strncmp(Pos->Cmd, "R-RMD", 5) == 0))\r
1537                                         sprintf(Tmp, MSGJPN052, Pos->RemoteFile);\r
1538                                 else if(strncmp(Pos->Cmd, "R-MKD", 5) == 0)\r
1539                                         sprintf(Tmp, MSGJPN053, Pos->RemoteFile);\r
1540                                 else if(strncmp(Pos->Cmd, "STOR", 4) == 0)\r
1541                                         sprintf(Tmp, MSGJPN054, Pos->RemoteFile);\r
1542                                 else if((strncmp(Pos->Cmd, "L-DELE", 6) == 0) ||\r
1543                                                 (strncmp(Pos->Cmd, "L-RMD", 5) == 0))\r
1544                                         sprintf(Tmp, MSGJPN055, Pos->LocalFile);\r
1545                                 else if(strncmp(Pos->Cmd, "L-MKD", 5) == 0)\r
1546                                         sprintf(Tmp, MSGJPN056, Pos->LocalFile);\r
1547                                 else if(strncmp(Pos->Cmd, "RETR", 4) == 0)\r
1548                                         sprintf(Tmp, MSGJPN057, Pos->LocalFile);\r
1549 \r
1550                                 if(strlen(Tmp) > 0)\r
1551                                         SendDlgItemMessage(hDlg, MIRROR_LIST, LB_ADDSTRING, 0, (LPARAM)Tmp);\r
1552                                 Pos = Pos->Next;\r
1553                         }\r
1554                         CountMirrorFiles(hDlg, *Base);\r
1555                         DlgSizeInit(hDlg, &DlgSize, &MirrorDlgSize);\r
1556                         EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), FALSE);\r
1557                         return(TRUE);\r
1558 \r
1559                 case WM_COMMAND :\r
1560                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1561                         {\r
1562                                 case IDOK :\r
1563                                         AskDlgSize(hDlg, &DlgSize, &MirrorDlgSize);\r
1564                                         EndDialog(hDlg, YES);\r
1565                                         break;\r
1566 \r
1567                                 case IDCANCEL :\r
1568                                         AskDlgSize(hDlg, &DlgSize, &MirrorDlgSize);\r
1569                                         EndDialog(hDlg, NO);\r
1570                                         break;\r
1571 \r
1572                                 case MIRROR_DEL :\r
1573                                         Num = SendDlgItemMessage(hDlg, MIRROR_LIST, LB_GETSELCOUNT, 0, 0);\r
1574                                         if((List = malloc(Num * sizeof(int))) != NULL)\r
1575                                         {\r
1576                                                 Num = SendDlgItemMessage(hDlg, MIRROR_LIST, LB_GETSELITEMS, Num, (LPARAM)List);\r
1577                                                 for(Num--; Num >= 0; Num--)\r
1578                                                 {\r
1579                                                         if(RemoveTmpTransFileListItem(Base, List[Num]) == SUCCESS)\r
1580                                                                 SendDlgItemMessage(hDlg, MIRROR_LIST, LB_DELETESTRING, List[Num], 0);\r
1581                                                         else\r
1582                                                                 MessageBeep(-1);\r
1583                                                 }\r
1584                                                 free(List);\r
1585                                                 CountMirrorFiles(hDlg, *Base);\r
1586                                         }\r
1587                                         break;\r
1588 \r
1589                                 case MIRROR_LIST :\r
1590                                         switch(GET_WM_COMMAND_CMD(wParam, lParam))\r
1591                                         {\r
1592                                                 case LBN_SELCHANGE :\r
1593                                                         if(SendDlgItemMessage(hDlg, MIRROR_LIST, LB_GETSELCOUNT, 0, 0) > 0)\r
1594                                                                 EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), TRUE);\r
1595                                                         else\r
1596                                                                 EnableWindow(GetDlgItem(hDlg, MIRROR_DEL), FALSE);\r
1597                                                         break;\r
1598                                         }\r
1599                                         break;\r
1600 \r
1601                                 case IDHELP :\r
1602                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000012);\r
1603                         }\r
1604             return(TRUE);\r
1605 \r
1606                 case WM_SIZING :\r
1607                         DlgSizeChange(hDlg, &DlgSize, (RECT *)lParam, (int)wParam);\r
1608                     return(TRUE);\r
1609         }\r
1610         return(FALSE);\r
1611 }\r
1612 \r
1613 \r
1614 /*----- \83~\83\89\81[\83\8a\83\93\83O\82Å\93]\91\97\81^\8dí\8f\9c\82·\82é\83t\83@\83C\83\8b\82Ì\90\94\82ð\90\94\82¦\83_\83C\83A\83\8d\83O\82É\95\\8e¦---------\r
1615 *\r
1616 *       Parameter\r
1617 *               HWND hWnd : \r
1618 *               TRANSPACKET *Pkt : \r
1619 *\r
1620 *       Return Value\r
1621 *               \82È\82µ\r
1622 *----------------------------------------------------------------------------*/\r
1623 \r
1624 static void CountMirrorFiles(HWND hDlg, TRANSPACKET *Pkt)\r
1625 {\r
1626         char Tmp[80];\r
1627         int Del;\r
1628         int Make;\r
1629         int Copy;\r
1630 \r
1631         Del = 0;\r
1632         Make = 0;\r
1633         Copy = 0;\r
1634         while(Pkt != NULL)\r
1635         {\r
1636                 if((strncmp(Pkt->Cmd, "R-DELE", 6) == 0) ||\r
1637                    (strncmp(Pkt->Cmd, "R-RMD", 5) == 0) ||\r
1638                    (strncmp(Pkt->Cmd, "L-DELE", 6) == 0) ||\r
1639                    (strncmp(Pkt->Cmd, "L-RMD", 5) == 0))\r
1640                 {\r
1641                         Del += 1;\r
1642                 }\r
1643                 else if((strncmp(Pkt->Cmd, "R-MKD", 5) == 0) ||\r
1644                                 (strncmp(Pkt->Cmd, "L-MKD", 5) == 0))\r
1645                 {\r
1646                         Make += 1;\r
1647                 }\r
1648                 else if((strncmp(Pkt->Cmd, "STOR", 4) == 0) ||\r
1649                                 (strncmp(Pkt->Cmd, "RETR", 4) == 0))\r
1650                 {\r
1651                         Copy += 1;\r
1652                 }\r
1653                 Pkt = Pkt->Next;\r
1654         }\r
1655 \r
1656         if(Copy != 0)\r
1657                 sprintf(Tmp, MSGJPN058, Copy);\r
1658         else\r
1659                 sprintf(Tmp, MSGJPN059);\r
1660         SendDlgItemMessage(hDlg, MIRROR_COPYNUM, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1661 \r
1662         if(Make != 0)\r
1663                 sprintf(Tmp, MSGJPN060, Make);\r
1664         else\r
1665                 sprintf(Tmp, MSGJPN061);\r
1666         SendDlgItemMessage(hDlg, MIRROR_MAKENUM, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1667 \r
1668         if(Del != 0)\r
1669                 sprintf(Tmp, MSGJPN062, Del);\r
1670         else\r
1671                 sprintf(Tmp, MSGJPN063);\r
1672         SendDlgItemMessage(hDlg, MIRROR_DELNUM, WM_SETTEXT, 0, (LPARAM)Tmp);\r
1673 \r
1674         return;\r
1675 }\r
1676 \r
1677 \r
1678 \r
1679 \r
1680 /*----- \83~\83\89\81[\83\8a\83\93\83O\82Å\93]\91\97\81^\8dí\8f\9c\82µ\82È\82¢\83t\83@\83C\83\8b\82©\82Ç\82¤\82©\82ð\95Ô\82· ------------------\r
1681 *\r
1682 *       Parameter\r
1683 *               char Fname : \83t\83@\83C\83\8b\96¼\r
1684 *               int Mode : \83\82\81[\83h\r
1685 *                       0=\93]\91\97\82µ\82È\82¢\83t\83@\83C\83\8b, 1=\8dí\8f\9c\82µ\82È\82¢\83t\83@\83C\83\8b\r
1686 *\r
1687 *       Return Value\r
1688 *               int \83X\83e\81[\83^\83X\r
1689 *                       YES=\93]\91\97\81E\8dí\8f\9c\82µ\82È\82¢/NO\r
1690 *----------------------------------------------------------------------------*/\r
1691 \r
1692 static int AskMirrorNoTrn(char *Fname, int Mode)\r
1693 {\r
1694         int Ret;\r
1695         char *Tbl;\r
1696 \r
1697         Tbl = MirrorNoTrn;\r
1698         if(Mode == 1)\r
1699                 Tbl = MirrorNoDel;\r
1700 \r
1701         Ret = NO;\r
1702         if(StrMultiLen(Tbl) > 0)\r
1703         {\r
1704                 Fname = GetFileName(Fname);\r
1705                 while(*Tbl != NUL)\r
1706                 {\r
1707                         if(CheckFname(Fname, Tbl) == SUCCESS)\r
1708                         {\r
1709                                 Ret = YES;\r
1710                                 break;\r
1711                         }\r
1712                         Tbl += strlen(Tbl) + 1;\r
1713                 }\r
1714         }\r
1715         return(Ret);\r
1716 }\r
1717 \r
1718 \r
1719 /*----- \83A\83b\83v\83\8d\81[\83h\82·\82é\83t\83@\83C\83\8b\82Ì\91®\90«\82ð\95Ô\82· ----------------------------------\r
1720 *\r
1721 *       Parameter\r
1722 *               char Fname : \83t\83@\83C\83\8b\96¼\r
1723 *\r
1724 *       Return Value\r
1725 *               int \91®\90« (-1=\90Ý\92è\82È\82µ)\r
1726 *----------------------------------------------------------------------------*/\r
1727 \r
1728 static int AskUpLoadFileAttr(char *Fname)\r
1729 {\r
1730         int Ret;\r
1731         int Sts;\r
1732         char *Tbl;\r
1733 \r
1734         Tbl = DefAttrList;\r
1735         Fname = GetFileName(Fname);\r
1736         Ret = -1;\r
1737         while(*Tbl != NUL)\r
1738         {\r
1739                 Sts = CheckFname(Fname, Tbl);\r
1740                 Tbl += strlen(Tbl) + 1;\r
1741 \r
1742                 if((Sts == SUCCESS) && (*Tbl != NUL))\r
1743                 {\r
1744                         Ret = xtoi(Tbl);\r
1745                         break;\r
1746                 }\r
1747                 Tbl += strlen(Tbl) + 1;\r
1748         }\r
1749         return(Ret);\r
1750 }\r
1751 \r
1752 \r
1753 /*----- \83z\83X\83g\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82È\82¢\82©\83`\83F\83b\83N- ---------------------------a\r
1754 *\r
1755 *       Parameter\r
1756 *               TRANSPACKET *Pkt : \93]\91\97\83t\83@\83C\83\8b\8fî\95ñ\r
1757 *               FILELIST *ListList : \r
1758 *\r
1759 *       Return Value\r
1760 *               int \8f\88\97\9d\95û\96@\r
1761 *                       EXIST_OVW/EXIST_UNIQUE/EXIST_IGNORE\r
1762 *\r
1763 *       Note\r
1764 *               Pkt.ExistSize, UpExistMode\81AExistNotify \82ª\95Ï\8dX\82³\82ê\82é\r
1765 *----------------------------------------------------------------------------*/\r
1766 \r
1767 static int CheckRemoteFile(TRANSPACKET *Pkt, FILELIST *ListList)\r
1768 {\r
1769         int Ret;\r
1770         FILELIST *Exist;\r
1771 \r
1772         Ret = EXIST_OVW;\r
1773         Pkt->ExistSize = 0;\r
1774         if(SendMode != TRANS_OVW)\r
1775         {\r
1776                 if((Exist = SearchFileList(GetFileName(Pkt->RemoteFile), ListList, COMP_STRICT)) != NULL)\r
1777                 {\r
1778                         Pkt->ExistSize = Exist->Size;\r
1779 \r
1780                         if(ExistNotify == YES)\r
1781                         {\r
1782                                 SoundPlay(SND_ERROR);\r
1783                                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(up_exist_dlg), GetMainHwnd(), UpExistDialogCallBack, (LPARAM)Pkt) == NO)\r
1784                                         Ret = EXIST_ABORT;\r
1785                                 else\r
1786                                         Ret = UpExistMode;\r
1787                         }\r
1788                         else\r
1789                                 Ret = UpExistMode;\r
1790 \r
1791                         if(Ret == EXIST_NEW)\r
1792                         {\r
1793                                 /*\83t\83@\83C\83\8b\93ú\95t\83`\83F\83b\83N */\r
1794                                 if(CompareFileTime(&Exist->Time, &Pkt->Time) < 0)\r
1795                                         Ret = EXIST_OVW;\r
1796                                 else\r
1797                                         Ret = EXIST_IGNORE;\r
1798                         }\r
1799                 }\r
1800         }\r
1801         return(Ret);\r
1802 }\r
1803 \r
1804 \r
1805 /*----- \83z\83X\83g\82É\93¯\82\96¼\91O\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\8e\9e\82Ì\8am\94F\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------\r
1806 *\r
1807 *       Parameter\r
1808 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1809 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1810 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1811 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1812 *\r
1813 *       Return Value\r
1814 *               BOOL TRUE/FALSE\r
1815 *----------------------------------------------------------------------------*/\r
1816 \r
1817 static BOOL CALLBACK UpExistDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1818 {\r
1819         static TRANSPACKET *Pkt;\r
1820         static const RADIOBUTTON UpExistButton[] = {\r
1821                 { UP_EXIST_OVW, EXIST_OVW },\r
1822                 { UP_EXIST_NEW, EXIST_NEW },\r
1823                 { UP_EXIST_RESUME, EXIST_RESUME },\r
1824                 { UP_EXIST_UNIQUE, EXIST_UNIQUE },\r
1825                 { UP_EXIST_IGNORE, EXIST_IGNORE }\r
1826         };\r
1827         #define UPEXISTBUTTONS  (sizeof(UpExistButton)/sizeof(RADIOBUTTON))\r
1828 \r
1829         switch (iMessage)\r
1830         {\r
1831                 case WM_INITDIALOG :\r
1832                         Pkt = (TRANSPACKET *)lParam;\r
1833                         SendDlgItemMessage(hDlg, UP_EXIST_NAME, EM_LIMITTEXT, FMAX_PATH, 0);\r
1834                         SendDlgItemMessage(hDlg, UP_EXIST_NAME, WM_SETTEXT, 0, (LPARAM)Pkt->RemoteFile);\r
1835 \r
1836                         if((Pkt->Type == TYPE_A) || (Pkt->ExistSize <= 0))\r
1837                                 EnableWindow(GetDlgItem(hDlg, UP_EXIST_RESUME), FALSE);\r
1838 \r
1839                         SetRadioButtonByValue(hDlg, UpExistMode, UpExistButton, UPEXISTBUTTONS);\r
1840                         return(TRUE);\r
1841 \r
1842                 case WM_COMMAND :\r
1843                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1844                         {\r
1845                                 case IDOK_ALL :\r
1846                                         ExistNotify = NO;\r
1847                                         /* \82±\82±\82É break \82Í\82È\82¢ */\r
1848 \r
1849                                 case IDOK :\r
1850                                         UpExistMode = AskRadioButtonValue(hDlg, UpExistButton, UPEXISTBUTTONS);\r
1851                                         SendDlgItemMessage(hDlg, UP_EXIST_NAME, WM_GETTEXT, FMAX_PATH, (LPARAM)Pkt->RemoteFile);\r
1852                                         EndDialog(hDlg, YES);\r
1853                                         break;\r
1854 \r
1855                                 case IDCANCEL :\r
1856 //                                      Pkt->Abort = ABORT_USER;\r
1857 //                                      UpExistMode = EXIST_IGNORE;\r
1858                                         EndDialog(hDlg, NO);\r
1859                                         break;\r
1860 \r
1861                                 case IDHELP :\r
1862                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000011);\r
1863                                         break;\r
1864                         }\r
1865             return(TRUE);\r
1866         }\r
1867         return(FALSE);\r
1868 }\r
1869 \r
1870 \r
1871 /*----- \83A\83b\83v\83\8d\81[\83h\81^\83_\83E\83\93\83\8d\81[\83h\83t\83@\83C\83\8b\96¼\93ü\97Í\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------\r
1872 *\r
1873 *       Parameter\r
1874 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
1875 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
1876 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
1877 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
1878 *\r
1879 *       Return Value\r
1880 *               BOOL TRUE/FALSE\r
1881 *----------------------------------------------------------------------------*/\r
1882 \r
1883 static BOOL CALLBACK UpDownAsDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
1884 {\r
1885         switch (iMessage)\r
1886         {\r
1887                 case WM_INITDIALOG :\r
1888                         if(CurWin == WIN_LOCAL)\r
1889                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN064);\r
1890                         else\r
1891                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN065);\r
1892 \r
1893                         SendDlgItemMessage(hDlg, UPDOWNAS_NEW, EM_LIMITTEXT, FMAX_PATH, 0);\r
1894                         SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_SETTEXT, 0, (LPARAM)TmpString);\r
1895                         SendDlgItemMessage(hDlg, UPDOWNAS_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
1896                         return(TRUE);\r
1897 \r
1898                 case WM_COMMAND :\r
1899                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
1900                         {\r
1901                                 case IDOK :\r
1902                                         SendDlgItemMessage(hDlg, UPDOWNAS_NEW, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpString);\r
1903                                         EndDialog(hDlg, YES);\r
1904                                         break;\r
1905 \r
1906                                 case UPDOWNAS_STOP :\r
1907                                         EndDialog(hDlg, NO_ALL);\r
1908                                         break;\r
1909                         }\r
1910             return(TRUE);\r
1911         }\r
1912         return(FALSE);\r
1913 }\r
1914 \r
1915 \r
1916 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82ð\8dí\8f\9c\82·\82é ----------------------------\r
1917 *\r
1918 *       Parameter\r
1919 *               \82È\82µ\r
1920 *\r
1921 *       Return Value\r
1922 *               \82È\82µ\r
1923 *----------------------------------------------------------------------------*/\r
1924 \r
1925 void DeleteProc(void)\r
1926 {\r
1927         int Win;\r
1928         FILELIST *FileListBase;\r
1929         FILELIST *Pos;\r
1930         int DelFlg;\r
1931         int Sts;\r
1932         char CurDir[FMAX_PATH+1];\r
1933         char Tmp[FMAX_PATH+1];\r
1934 \r
1935         Sts = YES;\r
1936         AskRemoteCurDir(CurDir, FMAX_PATH);\r
1937         FileListBase = NULL;\r
1938         if(GetFocus() == GetLocalHwnd())\r
1939         {\r
1940                 Win = WIN_LOCAL;\r
1941                 MakeSelectedFileList(Win, NO, NO, &FileListBase, &CancelFlg);\r
1942         }\r
1943         else\r
1944         {\r
1945                 Win = WIN_REMOTE;\r
1946                 if(CheckClosedAndReconnect() == SUCCESS)\r
1947                         MakeSelectedFileList(Win, YES, NO, &FileListBase, &CancelFlg);\r
1948                 else\r
1949                         Sts = NO;\r
1950         }\r
1951 \r
1952         if(Sts == YES)\r
1953         {\r
1954                 DisableUserOpe();\r
1955 \r
1956                 DelFlg = NO;\r
1957                 Sts = NO;\r
1958                 Pos = FileListBase;\r
1959                 while(Pos != NULL)\r
1960                 {\r
1961                         if(Pos->Node == NODE_FILE)\r
1962                         {\r
1963                                 DelNotifyAndDo(Pos, Win, &Sts, &DelFlg, CurDir);\r
1964                                 if(Sts == NO_ALL)\r
1965                                         break;\r
1966                         }\r
1967                         Pos = Pos->Next;\r
1968                 }\r
1969 \r
1970                 if(Sts != NO_ALL)\r
1971                         DeleteAllDir(FileListBase, Win, &Sts, &DelFlg, CurDir);\r
1972 \r
1973                 if(Win == WIN_REMOTE)\r
1974                 {\r
1975                         AskRemoteCurDir(Tmp, FMAX_PATH);\r
1976                         if(strcmp(Tmp, CurDir) != 0)\r
1977                                 DoCWD(Tmp, NO, NO, NO);\r
1978                 }\r
1979 \r
1980                 DeleteFileList(&FileListBase);\r
1981 \r
1982                 if(DelFlg == YES)\r
1983                 {\r
1984                         if(Win == WIN_LOCAL)\r
1985                                 GetLocalDirForWnd();\r
1986                         else\r
1987                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
1988                 }\r
1989 \r
1990                 EnableUserOpe();\r
1991         }\r
1992         return;\r
1993 }\r
1994 \r
1995 \r
1996 /*----- \83T\83u\83f\83B\83\8c\83N\83g\83\8a\88È\89º\82ð\91S\82Ä\8dí\8f\9c\82·\82é ------------------------------------\r
1997 *\r
1998 *       Parameter\r
1999 *               FILELIST *Dt : \8dí\8f\9c\82·\82é\83t\83@\83C\83\8b\82Ì\83\8a\83X\83g\r
2000 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
2001 *               int *Sw : \91\80\8dì\95û\96@ (YES/NO/YES_ALL/NO_ALL)\r
2002 *               int *Flg : \83t\83@\83C\83\8b\82ð\8dí\8f\9c\82µ\82½\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O (YES/NO)\r
2003 *               char *CurDir : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\r
2004 *\r
2005 *       Return Value\r
2006 *               \82È\82µ\r
2007 *----------------------------------------------------------------------------*/\r
2008 \r
2009 static void DeleteAllDir(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir)\r
2010 {\r
2011         while(Dt != NULL)\r
2012         {\r
2013                 if(Dt->Node == NODE_DIR)\r
2014                 {\r
2015                         DeleteAllDir(Dt->Next, Win, Sw, Flg, CurDir);\r
2016                         if(*Sw == NO_ALL)\r
2017                                 break;\r
2018 \r
2019                         DelNotifyAndDo(Dt, Win, Sw, Flg, CurDir);\r
2020                         break;\r
2021                 }\r
2022                 Dt = Dt->Next;\r
2023         }\r
2024         return;\r
2025 }\r
2026 \r
2027 \r
2028 /*----- \8dí\8f\9c\82·\82é\82©\82Ç\82¤\82©\82Ì\8am\94F\82Æ\8dí\8f\9c\8eÀ\8ds --------------------------------------\r
2029 *\r
2030 *       Parameter\r
2031 *               FILELIST *Dt : \8dí\8f\9c\82·\82é\83t\83@\83C\83\8b\82Ì\83\8a\83X\83g\r
2032 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
2033 *               int *Sw : \91\80\8dì\95û\96@ (YES/NO/YES_ALL/NO_ALL)\r
2034 *               int *Flg : \83t\83@\83C\83\8b\82ð\8dí\8f\9c\82µ\82½\82©\82Ç\82¤\82©\82Ì\83t\83\89\83O (YES/NO)\r
2035 *               char *CurDir : \83J\83\8c\83\93\83g\83f\83B\83\8c\83N\83g\83\8a\r
2036 *\r
2037 *       Return Value\r
2038 *               \82È\82µ\r
2039 *----------------------------------------------------------------------------*/\r
2040 \r
2041 static void DelNotifyAndDo(FILELIST *Dt, int Win, int *Sw, int *Flg, char *CurDir)\r
2042 {\r
2043         char Path[FMAX_PATH+1];\r
2044 \r
2045         if(Win == WIN_LOCAL)\r
2046         {\r
2047                 AskLocalCurDir(Path, FMAX_PATH);\r
2048                 SetYenTail(Path);\r
2049                 strcat(Path, Dt->File);\r
2050                 ReplaceAll(Path, '/', '\\');\r
2051         }\r
2052         else\r
2053         {\r
2054                 AskRemoteCurDir(Path, FMAX_PATH);\r
2055                 SetSlashTail(Path);\r
2056                 strcat(Path, Dt->File);\r
2057                 ReplaceAll(Path, '\\', '/');\r
2058         }\r
2059 \r
2060         if(*Sw != YES_ALL)\r
2061         {\r
2062                 sprintf(TmpString, "%s", Path);\r
2063 \r
2064                 if(AskHostType() == HTYPE_VMS)\r
2065                         ReformToVMSstylePathName(TmpString);\r
2066 \r
2067                 CurWin = Win;\r
2068                 *Sw = DialogBox(GetFtpInst(), MAKEINTRESOURCE(delete_dlg), GetMainHwnd(), DeleteDialogCallBack);\r
2069         }\r
2070 \r
2071         if((*Sw == YES) || (*Sw == YES_ALL))\r
2072         {\r
2073                 if(Win == WIN_LOCAL)\r
2074                 {\r
2075                         if(Dt->Node == NODE_FILE)\r
2076                                 DoLocalDELE(Path);\r
2077                         else\r
2078                                 DoLocalRMD(Path);\r
2079                         *Flg = YES;\r
2080                 }\r
2081                 else\r
2082                 {\r
2083                         /* \83t\83\8b\83p\83X\82ð\8eg\82í\82È\82¢\8e\9e\82Ì\82½\82ß\82Ì\8f\88\97\9d */\r
2084                         if(ProcForNonFullpath(Path, CurDir, GetMainHwnd(), 0) == FAIL)\r
2085                                 *Sw = NO_ALL;\r
2086 \r
2087                         if(*Sw != NO_ALL)\r
2088                         {\r
2089                                 if(Dt->Node == NODE_FILE)\r
2090                                         DoDELE(Path);\r
2091                                 else\r
2092                                         DoRMD(Path);\r
2093                                 *Flg = YES;\r
2094                         }\r
2095                 }\r
2096         }\r
2097         return;\r
2098 }\r
2099 \r
2100 \r
2101 /*----- \83t\83@\83C\83\8b\8dí\8f\9c\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ----------------------------------\r
2102 *\r
2103 *       Parameter\r
2104 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2105 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2106 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2107 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2108 *\r
2109 *       Return Value\r
2110 *               BOOL TRUE/FALSE\r
2111 *----------------------------------------------------------------------------*/\r
2112 \r
2113 static BOOL CALLBACK DeleteDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
2114 {\r
2115         switch (iMessage)\r
2116         {\r
2117                 case WM_INITDIALOG :\r
2118                         if(CurWin == WIN_LOCAL)\r
2119                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN066);\r
2120                         else\r
2121                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN067);\r
2122                         SendDlgItemMessage(hDlg, DELETE_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
2123                         return(TRUE);\r
2124 \r
2125                 case WM_COMMAND :\r
2126                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2127                         {\r
2128                                 case IDOK :\r
2129                                         EndDialog(hDlg, YES);\r
2130                                         break;\r
2131 \r
2132                                 case DELETE_NO :\r
2133                                         EndDialog(hDlg, NO);\r
2134                                         break;\r
2135 \r
2136                                 case DELETE_ALL :\r
2137                                         EndDialog(hDlg, YES_ALL);\r
2138                                         break;\r
2139 \r
2140                                 case IDCANCEL :\r
2141                                         EndDialog(hDlg, NO_ALL);\r
2142                                         break;\r
2143                         }\r
2144             return(TRUE);\r
2145         }\r
2146         return(FALSE);\r
2147 }\r
2148 \r
2149 \r
2150 /*----- \83t\83@\83C\83\8b\88ê\97\97\82Å\8ew\92è\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\96¼\91O\82ð\95Ï\8dX\82·\82é ----------------------\r
2151 *\r
2152 *       Parameter\r
2153 *               \82È\82µ\r
2154 *\r
2155 *       Return Value\r
2156 *               \82È\82µ\r
2157 *----------------------------------------------------------------------------*/\r
2158 \r
2159 void RenameProc(void)\r
2160 {\r
2161         int Win;\r
2162         FILELIST *FileListBase;\r
2163         FILELIST *Pos;\r
2164         char New[FMAX_PATH+1];\r
2165         int RenFlg;\r
2166         int Sts;\r
2167 \r
2168         Sts = SUCCESS;\r
2169         if(GetFocus() == GetLocalHwnd())\r
2170                 Win = WIN_LOCAL;\r
2171         else\r
2172         {\r
2173                 Win = WIN_REMOTE;\r
2174                 Sts = CheckClosedAndReconnect();\r
2175         }\r
2176 \r
2177         if(Sts == SUCCESS)\r
2178         {\r
2179                 DisableUserOpe();\r
2180 \r
2181                 FileListBase = NULL;\r
2182                 MakeSelectedFileList(Win, NO, NO, &FileListBase, &CancelFlg);\r
2183 \r
2184                 RenFlg = NO;\r
2185                 Sts = NO;\r
2186                 Pos = FileListBase;\r
2187                 while(Pos != NULL)\r
2188                 {\r
2189                         if((Pos->Node == NODE_FILE) || (Pos->Node == NODE_DIR))\r
2190                         {\r
2191                                 strcpy(TmpString, Pos->File);\r
2192                                 CurWin = Win;\r
2193                                 Sts = DialogBox(GetFtpInst(), MAKEINTRESOURCE(rename_dlg), GetMainHwnd(), RenameDialogCallBack);\r
2194 \r
2195                                 if(Sts == NO_ALL)\r
2196                                         break;\r
2197 \r
2198                                 if((Sts == YES) && (strlen(TmpString) != 0))\r
2199                                 {\r
2200                                         strcpy(New, TmpString);\r
2201                                         if(Win == WIN_LOCAL)\r
2202                                                 DoLocalRENAME(Pos->File, New);\r
2203                                         else\r
2204                                                 DoRENAME(Pos->File, New);\r
2205                                         RenFlg = YES;\r
2206                                 }\r
2207                         }\r
2208                         Pos = Pos->Next;\r
2209                 }\r
2210                 DeleteFileList(&FileListBase);\r
2211 \r
2212                 if(RenFlg == YES)\r
2213                 {\r
2214                         if(Win == WIN_LOCAL)\r
2215                                 GetLocalDirForWnd();\r
2216                         else\r
2217                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2218                 }\r
2219 \r
2220                 EnableUserOpe();\r
2221         }\r
2222         return;\r
2223 }\r
2224 \r
2225 \r
2226 //\r
2227 // \83\8a\83\82\81[\83g\91¤\82Å\82Ì\83t\83@\83C\83\8b\82Ì\88Ú\93®\81i\83\8a\83l\81[\83\80\81j\82ð\8ds\82¤\r
2228 //  \r
2229 // RenameProc()\82ð\83x\81[\83X\82É\89ü\91¢\81B(2007.9.5 yutaka)\r
2230 //\r
2231 void MoveRemoteFileProc(int drop_index)\r
2232 {\r
2233         int Win;\r
2234         FILELIST *FileListBase;\r
2235         FILELIST *Pos;\r
2236         FILELIST Pkt;\r
2237         char New[FMAX_PATH+1];\r
2238         char Old[FMAX_PATH+1];\r
2239         char HostDir[FMAX_PATH+1];\r
2240         int RenFlg;\r
2241         int Sts;\r
2242 \r
2243         if(MoveMode == MOVE_DISABLE)\r
2244         {\r
2245                 return;\r
2246         }\r
2247 \r
2248         AskRemoteCurDir(HostDir, FMAX_PATH);\r
2249 \r
2250         // \83h\83\8d\83b\83v\90æ\82Ì\83t\83H\83\8b\83_\96¼\82ð\93¾\82é\r
2251         GetNodeName(WIN_REMOTE, drop_index, Pkt.File, FMAX_PATH);\r
2252 \r
2253         if(MoveMode == MOVE_DLG)\r
2254         {\r
2255                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(move_notify_dlg), GetRemoteHwnd(), ExeEscTextDialogProc, (LPARAM)Pkt.File) == NO)\r
2256                 {\r
2257                         return;\r
2258                 }\r
2259         }\r
2260 \r
2261         Sts = SUCCESS;\r
2262 #if 0\r
2263         if(GetFocus() == GetLocalHwnd())\r
2264                 Win = WIN_LOCAL;\r
2265         else\r
2266         {\r
2267                 Win = WIN_REMOTE;\r
2268                 Sts = CheckClosedAndReconnect();\r
2269         }\r
2270 #else\r
2271                 Win = WIN_REMOTE;\r
2272                 Sts = CheckClosedAndReconnect();\r
2273 #endif\r
2274 \r
2275         if(Sts == SUCCESS)\r
2276         {\r
2277                 DisableUserOpe();\r
2278 \r
2279                 FileListBase = NULL;\r
2280                 MakeSelectedFileList(Win, NO, NO, &FileListBase, &CancelFlg);\r
2281 \r
2282                 RenFlg = NO;\r
2283                 Sts = NO;\r
2284                 Pos = FileListBase;\r
2285                 while(Pos != NULL)\r
2286                 {\r
2287                         if((Pos->Node == NODE_FILE) || (Pos->Node == NODE_DIR))\r
2288                         {\r
2289                                 strcpy(TmpString, Pos->File);\r
2290                                 CurWin = Win;\r
2291 #if 0\r
2292                                 Sts = DialogBox(GetFtpInst(), MAKEINTRESOURCE(rename_dlg), GetMainHwnd(), RenameDialogCallBack);\r
2293 \r
2294                                 if(Sts == NO_ALL)\r
2295                                         break;\r
2296 #else\r
2297                                 Sts = YES;\r
2298 #endif\r
2299 \r
2300                                 if((Sts == YES) && (strlen(TmpString) != 0))\r
2301                                 {\r
2302                                         // \83p\83X\82Ì\90Ý\92è(local)\r
2303                                         strncpy_s(Old, sizeof(Old), HostDir, _TRUNCATE);\r
2304                                         strncat_s(Old, sizeof(Old), "/", _TRUNCATE);\r
2305                                         strncat_s(Old, sizeof(Old), Pos->File, _TRUNCATE);\r
2306 \r
2307                                         // \83p\83X\82Ì\90Ý\92è(remote)\r
2308                                         strncpy_s(New, sizeof(New), HostDir, _TRUNCATE);\r
2309                                         strncat_s(New, sizeof(New), "/", _TRUNCATE);\r
2310                                         strncat_s(New, sizeof(New), Pkt.File, _TRUNCATE);\r
2311                                         strncat_s(New, sizeof(New), "/", _TRUNCATE);\r
2312                                         strncat_s(New, sizeof(New), Pos->File, _TRUNCATE);\r
2313 \r
2314                                         if(Win == WIN_LOCAL)\r
2315                                                 DoLocalRENAME(Old, New);\r
2316                                         else\r
2317                                                 DoRENAME(Old, New);\r
2318                                         RenFlg = YES;\r
2319                                 }\r
2320                         }\r
2321                         Pos = Pos->Next;\r
2322                 }\r
2323                 DeleteFileList(&FileListBase);\r
2324 \r
2325                 if(RenFlg == YES)\r
2326                 {\r
2327                         if(Win == WIN_LOCAL) {\r
2328                                 GetLocalDirForWnd();\r
2329                         } else {\r
2330                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2331 \r
2332                                 strncpy_s(New, sizeof(New), HostDir, _TRUNCATE);\r
2333                                 strncat_s(New, sizeof(New), "/", _TRUNCATE);\r
2334                                 strncat_s(New, sizeof(New), Pkt.File, _TRUNCATE);\r
2335                                 DoCWD(New, YES, YES, YES);\r
2336                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2337                         }\r
2338                 }\r
2339 \r
2340                 EnableUserOpe();\r
2341         }\r
2342         return;\r
2343 }\r
2344 \r
2345 \r
2346 \r
2347 /*----- \90V\83t\83@\83C\83\8b\96¼\93ü\97Í\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N ------------------------------\r
2348 *\r
2349 *       Parameter\r
2350 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2351 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2352 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2353 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2354 *\r
2355 *       Return Value\r
2356 *               BOOL TRUE/FALSE\r
2357 *----------------------------------------------------------------------------*/\r
2358 \r
2359 static BOOL CALLBACK RenameDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
2360 {\r
2361         switch (iMessage)\r
2362         {\r
2363                 case WM_INITDIALOG :\r
2364                         if(CurWin == WIN_LOCAL)\r
2365                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN068);\r
2366                         else\r
2367                                 SendMessage(hDlg, WM_SETTEXT, 0, (LPARAM)MSGJPN069);\r
2368                         SendDlgItemMessage(hDlg, RENAME_NEW, EM_LIMITTEXT, FMAX_PATH, 0);\r
2369                         SendDlgItemMessage(hDlg, RENAME_NEW, WM_SETTEXT, 0, (LPARAM)TmpString);\r
2370                         SendDlgItemMessage(hDlg, RENAME_TEXT, WM_SETTEXT, 0, (LPARAM)TmpString);\r
2371                         return(TRUE);\r
2372 \r
2373                 case WM_COMMAND :\r
2374                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2375                         {\r
2376                                 case IDOK :\r
2377                                         SendDlgItemMessage(hDlg, RENAME_NEW, WM_GETTEXT, FMAX_PATH, (LPARAM)TmpString);\r
2378                                         EndDialog(hDlg, YES);\r
2379                                         break;\r
2380 \r
2381                                 case IDCANCEL :\r
2382                                         EndDialog(hDlg, NO);\r
2383                                         break;\r
2384 \r
2385                                 case RENAME_STOP :\r
2386                                         EndDialog(hDlg, NO_ALL);\r
2387                                         break;\r
2388                         }\r
2389             return(TRUE);\r
2390         }\r
2391         return(FALSE);\r
2392 }\r
2393 \r
2394 \r
2395 /*----- \90V\82µ\82¢\83f\83B\83\8c\83N\83g\83\8a\82ð\8dì\90¬\82·\82é ------------------------------------------\r
2396 *\r
2397 *       Parameter\r
2398 *               \82È\82µ\r
2399 *\r
2400 *       Return Value\r
2401 *               \82È\82µ\r
2402 *----------------------------------------------------------------------------*/\r
2403 \r
2404 void MkdirProc(void)\r
2405 {\r
2406         int Sts;\r
2407         int Win;\r
2408         char Path[FMAX_PATH+1];\r
2409         char *Title;\r
2410         int Tmp;\r
2411 \r
2412         if(GetFocus() == GetLocalHwnd())\r
2413         {\r
2414                 Win = WIN_LOCAL;\r
2415                 Title = MSGJPN070;\r
2416         }\r
2417         else\r
2418         {\r
2419                 Win = WIN_REMOTE;\r
2420                 Title = MSGJPN071;\r
2421         }\r
2422 \r
2423         strcpy(Path, "");\r
2424         Sts = InputDialogBox(mkdir_dlg, GetMainHwnd(), Title, Path, FMAX_PATH+1, &Tmp, IDH_HELP_TOPIC_0000001);\r
2425 \r
2426         if((Sts == YES) && (strlen(Path) != 0))\r
2427         {\r
2428                 if(Win == WIN_LOCAL)\r
2429                 {\r
2430                         DisableUserOpe();\r
2431                         DoLocalMKD(Path);\r
2432                         GetLocalDirForWnd();\r
2433                         EnableUserOpe();\r
2434                 }\r
2435                 else\r
2436                 {\r
2437                         if(CheckClosedAndReconnect() == SUCCESS)\r
2438                         {\r
2439                                 DisableUserOpe();\r
2440                                 DoMKD(Path);\r
2441                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2442                                 EnableUserOpe();\r
2443                         }\r
2444                 }\r
2445         }\r
2446         return;\r
2447 }\r
2448 \r
2449 \r
2450 /*----- \83q\83X\83g\83\8a\83\8a\83X\83g\82ð\8eg\82Á\82½\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® ------------------------------\r
2451 *\r
2452 *       Parameter\r
2453 *               HWND hWnd : \83R\83\93\83{\83{\83b\83N\83X\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2454 *\r
2455 *       Return Value\r
2456 *               \82È\82µ\r
2457 *----------------------------------------------------------------------------*/\r
2458 \r
2459 void ChangeDirComboProc(HWND hWnd)\r
2460 {\r
2461         char Tmp[FMAX_PATH+1];\r
2462         int i;\r
2463 \r
2464         if((i = SendMessage(hWnd, CB_GETCURSEL, 0, 0)) != CB_ERR)\r
2465         {\r
2466                 SendMessage(hWnd, CB_GETLBTEXT, i, (LPARAM)Tmp);\r
2467 \r
2468                 if(hWnd == GetLocalHistHwnd())\r
2469                 {\r
2470                         DisableUserOpe();\r
2471                         DoLocalCWD(Tmp);\r
2472                         GetLocalDirForWnd();\r
2473                         EnableUserOpe();\r
2474                 }\r
2475                 else\r
2476                 {\r
2477                         if(CheckClosedAndReconnect() == SUCCESS)\r
2478                         {\r
2479                                 DisableUserOpe();\r
2480                                 if(DoCWD(Tmp, YES, NO, YES) < FTP_RETRY)\r
2481                                         GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
2482                                 EnableUserOpe();\r
2483                         }\r
2484                 }\r
2485         }\r
2486         return;\r
2487 }\r
2488 \r
2489 \r
2490 /*----- \83u\83b\83N\83}\81[\83N\82ð\8eg\82Á\82½\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® --------------------------------\r
2491 *\r
2492 *       Parameter\r
2493 *               int MarkID : \83u\83b\83N\83}\81[\83N\82Ì\83\81\83j\83\85\81[ID\r
2494 *\r
2495 *       Return Value\r
2496 *               \82È\82µ\r
2497 *----------------------------------------------------------------------------*/\r
2498 \r
2499 void ChangeDirBmarkProc(int MarkID)\r
2500 {\r
2501         char Local[FMAX_PATH+1];\r
2502         char Remote[FMAX_PATH+1];\r
2503         int Sts;\r
2504 \r
2505         Sts = AskBookMarkText(MarkID, Local, Remote, FMAX_PATH+1);\r
2506         if((Sts == BMARK_TYPE_LOCAL) || (Sts == BMARK_TYPE_BOTH))\r
2507         {\r
2508                 DisableUserOpe();\r
2509                 if(DoLocalCWD(Local) == SUCCESS)\r
2510                         GetLocalDirForWnd();\r
2511                 EnableUserOpe();\r
2512         }\r
2513 \r
2514         if((Sts == BMARK_TYPE_REMOTE) || (Sts == BMARK_TYPE_BOTH))\r
2515         {\r
2516                 if(CheckClosedAndReconnect() == SUCCESS)\r
2517                 {\r
2518                         DisableUserOpe();\r
2519                         if(DoCWD(Remote, YES, NO, YES) < FTP_RETRY)\r
2520                                 GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
2521                         EnableUserOpe();\r
2522                 }\r
2523         }\r
2524         return;\r
2525 }\r
2526 \r
2527 \r
2528 /*----- \83f\83B\83\8c\83N\83g\83\8a\96¼\82ð\93ü\97Í\82µ\82Ä\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® ----------------------------\r
2529 *\r
2530 *       Parameter\r
2531 *               int Win : \83E\83C\83\93\83h\83E\94Ô\8d\86 (WIN_xxx)\r
2532 *\r
2533 *       Return Value\r
2534 *               \82È\82µ\r
2535 *----------------------------------------------------------------------------*/\r
2536 \r
2537 void ChangeDirDirectProc(int Win)\r
2538 {\r
2539         int Sts;\r
2540         char Path[FMAX_PATH+1];\r
2541         char *Title;\r
2542         int Tmp;\r
2543 \r
2544         if(Win == WIN_LOCAL)\r
2545                 Title = MSGJPN072;\r
2546         else\r
2547                 Title = MSGJPN073;\r
2548 \r
2549         strcpy(Path, "");\r
2550         if(Win == WIN_LOCAL)\r
2551                 Sts = InputDialogBox(chdir_br_dlg, GetMainHwnd(), Title, Path, FMAX_PATH+1, &Tmp, IDH_HELP_TOPIC_0000001);\r
2552         else\r
2553                 Sts = InputDialogBox(chdir_dlg, GetMainHwnd(), Title, Path, FMAX_PATH+1, &Tmp, IDH_HELP_TOPIC_0000001);\r
2554 \r
2555         if((Sts == YES) && (strlen(Path) != 0))\r
2556         {\r
2557                 if(Win == WIN_LOCAL)\r
2558                 {\r
2559                         DisableUserOpe();\r
2560                         DoLocalCWD(Path);\r
2561                         GetLocalDirForWnd();\r
2562                         EnableUserOpe();\r
2563                 }\r
2564                 else\r
2565                 {\r
2566                         if(CheckClosedAndReconnect() == SUCCESS)\r
2567                         {\r
2568                                 DisableUserOpe();\r
2569                                 if(DoCWD(Path, YES, NO, YES) < FTP_RETRY)\r
2570                                         GetRemoteDirForWnd(CACHE_NORMAL, &CancelFlg);\r
2571                                 EnableUserOpe();\r
2572                         }\r
2573                 }\r
2574         }\r
2575         return;\r
2576 }\r
2577 \r
2578 \r
2579 /*----- Drop\82³\82ê\82½\83t\83@\83C\83\8b\82É\82æ\82é\83f\83B\83\8c\83N\83g\83\8a\82Ì\88Ú\93® ----------------------------\r
2580 *\r
2581 *       Parameter\r
2582 *               WPARAM wParam : \83h\83\8d\83b\83v\82³\82ê\82½\83t\83@\83C\83\8b\82Ì\8fî\95ñ\r
2583 *\r
2584 *       Return Value\r
2585 *               \82È\82µ\r
2586 *----------------------------------------------------------------------------*/\r
2587 \r
2588 void ChangeDirDropFileProc(WPARAM wParam)\r
2589 {\r
2590         char Path[FMAX_PATH+1];\r
2591 \r
2592         DisableUserOpe();\r
2593         MakeDroppedDir(wParam, Path);\r
2594         DoLocalCWD(Path);\r
2595         GetLocalDirForWnd();\r
2596         EnableUserOpe();\r
2597         return;\r
2598 }\r
2599 \r
2600 \r
2601 /*----- \83t\83@\83C\83\8b\82Ì\91®\90«\95Ï\8dX ----------------------------------------------------\r
2602 *\r
2603 *       Parameter\r
2604 *               \82È\82µ\r
2605 *\r
2606 *       Return Value\r
2607 *               \82È\82µ\r
2608 *----------------------------------------------------------------------------*/\r
2609 \r
2610 void ChmodProc(void)\r
2611 {\r
2612         int ChmodFlg;\r
2613         FILELIST *FileListBase;\r
2614         FILELIST *Pos;\r
2615         char Tmp[5];\r
2616         char *Buf;\r
2617         char *BufTmp;\r
2618         int BufLen;\r
2619 \r
2620         if(GetFocus() == GetRemoteHwnd())\r
2621         {\r
2622                 if(CheckClosedAndReconnect() == SUCCESS)\r
2623                 {\r
2624                         DisableUserOpe();\r
2625                         FileListBase = NULL;\r
2626                         MakeSelectedFileList(WIN_REMOTE, NO, NO, &FileListBase, &CancelFlg);\r
2627                         if(FileListBase != NULL)\r
2628                         {\r
2629                                 sprintf(Tmp, "%03X", FileListBase->Attr);\r
2630                                 if(DialogBoxParam(GetFtpInst(), MAKEINTRESOURCE(chmod_dlg), GetMainHwnd(), ChmodDialogCallBack, (LPARAM)Tmp) == YES)\r
2631                                 {\r
2632                                         ChmodFlg = NO;\r
2633                                         Pos = FileListBase;\r
2634                                         while(Pos != NULL)\r
2635                                         {\r
2636                                                 if((Pos->Node == NODE_FILE) || (Pos->Node == NODE_DIR))\r
2637                                                 {\r
2638                                                         DoCHMOD(Pos->File, Tmp);\r
2639                                                         ChmodFlg = YES;\r
2640                                                 }\r
2641                                                 Pos = Pos->Next;\r
2642                                         }\r
2643                                         if(ChmodFlg == YES)\r
2644                                                 GetRemoteDirForWnd(CACHE_REFRESH, &CancelFlg);\r
2645                                 }\r
2646                         }\r
2647                         DeleteFileList(&FileListBase);\r
2648                         EnableUserOpe();\r
2649                 }\r
2650         }\r
2651         else if(GetFocus() == GetLocalHwnd())\r
2652         {\r
2653                 DisableUserOpe();\r
2654                 FileListBase = NULL;\r
2655                 MakeSelectedFileList(WIN_LOCAL, NO, NO, &FileListBase, &CancelFlg);\r
2656                 if(FileListBase != NULL)\r
2657                 {\r
2658                         if((Buf = malloc(1)) != NULL)\r
2659                         {\r
2660                                 *Buf = NUL;\r
2661                                 BufLen = 0;\r
2662                                 Pos = FileListBase;\r
2663                                 while(Pos != NULL)\r
2664                                 {\r
2665                                         if((BufTmp = realloc(Buf, BufLen + strlen(Pos->File) + 2)) != NULL)\r
2666                                         {\r
2667                                                 Buf = BufTmp;\r
2668                                                 strcpy(Buf+BufLen, Pos->File);\r
2669                                                 BufLen += strlen(Pos->File) + 1;\r
2670                                         }\r
2671                                         Pos = Pos->Next;\r
2672                                 }\r
2673 \r
2674                                 memset(Buf+BufLen, NUL, 1);\r
2675                                 DispFileProperty(Buf);\r
2676                                 free(Buf);\r
2677                         }\r
2678                 }\r
2679                 DeleteFileList(&FileListBase);\r
2680                 EnableUserOpe();\r
2681         }\r
2682         return;\r
2683 }\r
2684 \r
2685 \r
2686 /*----- \91®\90«\95Ï\8dX\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N --------------------------------------\r
2687 *\r
2688 *       Parameter\r
2689 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2690 *               UINT message : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2691 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2692 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2693 *\r
2694 *       Return Value\r
2695 *               BOOL TRUE/FALSE\r
2696 *----------------------------------------------------------------------------*/\r
2697 \r
2698 BOOL CALLBACK ChmodDialogCallBack(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam)\r
2699 {\r
2700         char Str[5];\r
2701         static char *Buf;\r
2702         int Tmp;\r
2703 \r
2704         switch (iMessage)\r
2705         {\r
2706                 case WM_INITDIALOG :\r
2707                         Buf = (char *)lParam;\r
2708                         SendDlgItemMessage(hDlg, PERM_NOW, EM_LIMITTEXT, 4, 0);\r
2709                         SendDlgItemMessage(hDlg, PERM_NOW, WM_SETTEXT, 0, (LPARAM)Buf);\r
2710                         SetAttrToDialog(hDlg, xtoi(Buf));\r
2711                         return(TRUE);\r
2712 \r
2713                 case WM_COMMAND :\r
2714                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2715                         {\r
2716                                 case IDOK :\r
2717                                         SendDlgItemMessage(hDlg, PERM_NOW, WM_GETTEXT, 5, (LPARAM)Buf);\r
2718                                         EndDialog(hDlg, YES);\r
2719                                         break;\r
2720 \r
2721                                 case IDCANCEL :\r
2722                                         EndDialog(hDlg, NO);\r
2723                                         break;\r
2724 \r
2725                                 case PERM_O_READ :\r
2726                                 case PERM_O_WRITE :\r
2727                                 case PERM_O_EXEC :\r
2728                                 case PERM_G_READ :\r
2729                                 case PERM_G_WRITE :\r
2730                                 case PERM_G_EXEC :\r
2731                                 case PERM_A_READ :\r
2732                                 case PERM_A_WRITE :\r
2733                                 case PERM_A_EXEC :\r
2734                                         Tmp = GetAttrFromDialog(hDlg);\r
2735                                         sprintf(Str, "%03X", Tmp);\r
2736                                         SendDlgItemMessage(hDlg, PERM_NOW, WM_SETTEXT, 0, (LPARAM)Str);\r
2737                                         break;\r
2738 \r
2739                                 case IDHELP :\r
2740                                         hHelpWin = HtmlHelp(NULL, AskHelpFilePath(), HH_HELP_CONTEXT, IDH_HELP_TOPIC_0000017);\r
2741                                         break;\r
2742                         }\r
2743             return(TRUE);\r
2744         }\r
2745         return(FALSE);\r
2746 }\r
2747 \r
2748 \r
2749 /*----- \91®\90«\82ð\83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82É\90Ý\92è ----------------------------------------\r
2750 *\r
2751 *       Parameter\r
2752 *               HWND hWnd : \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2753 *               int Attr : \91®\90«\r
2754 *\r
2755 *       Return Value\r
2756 *               \82È\82µ\r
2757 *----------------------------------------------------------------------------*/\r
2758 \r
2759 static void SetAttrToDialog(HWND hDlg, int Attr)\r
2760 {\r
2761         if(Attr & 0x400)\r
2762                 SendDlgItemMessage(hDlg, PERM_O_READ, BM_SETCHECK, 1, 0);\r
2763         if(Attr & 0x200)\r
2764                 SendDlgItemMessage(hDlg, PERM_O_WRITE, BM_SETCHECK, 1, 0);\r
2765         if(Attr & 0x100)\r
2766                 SendDlgItemMessage(hDlg, PERM_O_EXEC, BM_SETCHECK, 1, 0);\r
2767 \r
2768         if(Attr & 0x40)\r
2769                 SendDlgItemMessage(hDlg, PERM_G_READ, BM_SETCHECK, 1, 0);\r
2770         if(Attr & 0x20)\r
2771                 SendDlgItemMessage(hDlg, PERM_G_WRITE, BM_SETCHECK, 1, 0);\r
2772         if(Attr & 0x10)\r
2773                 SendDlgItemMessage(hDlg, PERM_G_EXEC, BM_SETCHECK, 1, 0);\r
2774 \r
2775         if(Attr & 0x4)\r
2776                 SendDlgItemMessage(hDlg, PERM_A_READ, BM_SETCHECK, 1, 0);\r
2777         if(Attr & 0x2)\r
2778                 SendDlgItemMessage(hDlg, PERM_A_WRITE, BM_SETCHECK, 1, 0);\r
2779         if(Attr & 0x1)\r
2780                 SendDlgItemMessage(hDlg, PERM_A_EXEC, BM_SETCHECK, 1, 0);\r
2781 \r
2782         return;\r
2783 }\r
2784 \r
2785 \r
2786 /*----- \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82Ì\93à\97e\82©\82ç\91®\90«\82ð\8eæ\93¾ --------------------------------\r
2787 *\r
2788 *       Parameter\r
2789 *               HWND hWnd : \83_\83C\83A\83\8d\83O\83{\83b\83N\83X\82Ì\83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2790 *\r
2791 *       Return Value\r
2792 *               int \91®\90«\r
2793 *----------------------------------------------------------------------------*/\r
2794 \r
2795 static int GetAttrFromDialog(HWND hDlg)\r
2796 {\r
2797         int Ret;\r
2798 \r
2799         Ret = 0;\r
2800 \r
2801         if(SendDlgItemMessage(hDlg, PERM_O_READ, BM_GETCHECK, 0, 0) == 1)\r
2802                 Ret |= 0x400;\r
2803         if(SendDlgItemMessage(hDlg, PERM_O_WRITE, BM_GETCHECK, 0, 0) == 1)\r
2804                 Ret |= 0x200;\r
2805         if(SendDlgItemMessage(hDlg, PERM_O_EXEC, BM_GETCHECK, 0, 0) == 1)\r
2806                 Ret |= 0x100;\r
2807 \r
2808         if(SendDlgItemMessage(hDlg, PERM_G_READ, BM_GETCHECK, 0, 0) == 1)\r
2809                 Ret |= 0x40;\r
2810         if(SendDlgItemMessage(hDlg, PERM_G_WRITE, BM_GETCHECK, 0, 0) == 1)\r
2811                 Ret |= 0x20;\r
2812         if(SendDlgItemMessage(hDlg, PERM_G_EXEC, BM_GETCHECK, 0, 0) == 1)\r
2813                 Ret |= 0x10;\r
2814 \r
2815         if(SendDlgItemMessage(hDlg, PERM_A_READ, BM_GETCHECK, 0, 0) == 1)\r
2816                 Ret |= 0x4;\r
2817         if(SendDlgItemMessage(hDlg, PERM_A_WRITE, BM_GETCHECK, 0, 0) == 1)\r
2818                 Ret |= 0x2;\r
2819         if(SendDlgItemMessage(hDlg, PERM_A_EXEC, BM_GETCHECK, 0, 0) == 1)\r
2820                 Ret |= 0x1;\r
2821 \r
2822         return(Ret);\r
2823 }\r
2824 \r
2825 \r
2826 \r
2827 \r
2828 /*----- \94C\88Ó\82Ì\83R\83}\83\93\83h\82ð\91\97\82é --------------------------------------------------\r
2829 *\r
2830 *       Parameter\r
2831 *               \82È\82µ\r
2832 *\r
2833 *       Return Value\r
2834 *               \82È\82µ\r
2835 *----------------------------------------------------------------------------*/\r
2836 \r
2837 void SomeCmdProc(void)\r
2838 {\r
2839         char Cmd[81];\r
2840         int Tmp;\r
2841         FILELIST *FileListBase;\r
2842 \r
2843         if(GetFocus() == GetRemoteHwnd())\r
2844         {\r
2845                 if(CheckClosedAndReconnect() == SUCCESS)\r
2846                 {\r
2847                         DisableUserOpe();\r
2848                         FileListBase = NULL;\r
2849                         MakeSelectedFileList(WIN_REMOTE, NO, NO, &FileListBase, &CancelFlg);\r
2850                         memset(Cmd, NUL, 81);\r
2851                         if(FileListBase != NULL)\r
2852                         {\r
2853                                 strncpy(Cmd, FileListBase->File, 80);\r
2854                         }\r
2855                         DeleteFileList(&FileListBase);\r
2856 \r
2857                         if(InputDialogBox(somecmd_dlg, GetMainHwnd(), NULL, Cmd, 81, &Tmp, IDH_HELP_TOPIC_0000023) == YES)\r
2858                         {\r
2859                                 DoQUOTE(Cmd);\r
2860                         }\r
2861                         EnableUserOpe();\r
2862                 }\r
2863         }\r
2864         return;\r
2865 }\r
2866 \r
2867 \r
2868 \r
2869 \r
2870 /*----- \83t\83@\83C\83\8b\91\8d\97e\97Ê\82Ì\8cv\8eZ\82ð\8ds\82¤ --------------------------------------------\r
2871 *\r
2872 *       Parameter\r
2873 *               \82È\82µ\r
2874 *\r
2875 *       Return Value\r
2876 *               \82È\82µ\r
2877 *----------------------------------------------------------------------------*/\r
2878 \r
2879 void CalcFileSizeProc(void)\r
2880 {\r
2881         FILELIST *ListBase;\r
2882         FILELIST *Pos;\r
2883         int Win;\r
2884         int All;\r
2885         int Sts;\r
2886 \r
2887         if((All = DialogBox(GetFtpInst(), MAKEINTRESOURCE(filesize_notify_dlg), GetMainHwnd(), SizeNotifyDlgWndProc)) != NO_ALL)\r
2888         {\r
2889                 Sts = SUCCESS;\r
2890                 if(GetFocus() == GetLocalHwnd())\r
2891                         Win = WIN_LOCAL;\r
2892                 else\r
2893                 {\r
2894                         Win = WIN_REMOTE;\r
2895                         Sts = CheckClosedAndReconnect();\r
2896                 }\r
2897 \r
2898                 if(Sts == SUCCESS)\r
2899                 {\r
2900                         ListBase = NULL;\r
2901                         MakeSelectedFileList(Win, YES, All, &ListBase, &CancelFlg);\r
2902 \r
2903                         FileSize = 0;\r
2904                         Pos = ListBase;\r
2905                         while(Pos != NULL)\r
2906                         {\r
2907                                 if(Pos->Node != NODE_DIR)\r
2908                                         FileSize += Pos->Size;\r
2909                                 Pos = Pos->Next;\r
2910                         }\r
2911                         DeleteFileList(&ListBase);\r
2912                         DialogBox(GetFtpInst(), MAKEINTRESOURCE(filesize_dlg), GetMainHwnd(), SizeDlgWndProc);\r
2913                 }\r
2914         }\r
2915         return;\r
2916 }\r
2917 \r
2918 \r
2919 /*----- \83t\83@\83C\83\8b\97e\97Ê\8c\9f\8dõ\8am\94F\83_\83C\83A\83\8d\83O\82Ì\83R\81[\83\8b\83o\83b\83N --------------------------\r
2920 *\r
2921 *       Parameter\r
2922 *               HWND hDlg : \83E\83C\83\93\83h\83E\83n\83\93\83h\83\8b\r
2923 *               UINT message  : \83\81\83b\83Z\81[\83W\94Ô\8d\86\r
2924 *               WPARAM wParam : \83\81\83b\83Z\81[\83W\82Ì WPARAM \88ø\90\94\r
2925 *               LPARAM lParam : \83\81\83b\83Z\81[\83W\82Ì LPARAM \88ø\90\94\r
2926 *\r
2927 *       Return Value\r
2928 *               \83\81\83b\83Z\81[\83W\82É\91Î\89\9e\82·\82é\96ß\82è\92l\r
2929 *----------------------------------------------------------------------------*/\r
2930 \r
2931 static LRESULT CALLBACK SizeNotifyDlgWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
2932 {\r
2933         switch (message)\r
2934         {\r
2935                 case WM_INITDIALOG :\r
2936                         if(GetFocus() == GetLocalHwnd())\r
2937                                 SendDlgItemMessage(hDlg, FSNOTIFY_TITLE, WM_SETTEXT, 0, (LPARAM)MSGJPN074);\r
2938                         else\r
2939                                 SendDlgItemMessage(hDlg, FSNOTIFY_TITLE, WM_SETTEXT, 0, (LPARAM)MSGJPN075);\r
2940                         return(TRUE);\r
2941 \r
2942                 case WM_COMMAND :\r
2943                         switch(GET_WM_COMMAND_ID(wParam, lParam))\r
2944                         {\r
2945                                 case IDOK :\r
2946                                         if(SendDlgItemMessage(hDlg, FSNOTIFY_SEL_ONLY, BM_GETCHECK, 0, 0) == 1)\r
2947                                                 EndDialog(hDlg, NO);\r
2948                                         else\r
2949 &