source: trunk/dll/worker.c@ 1444

Last change on this file since 1444 was 1444, checked in by Gregg Young, 16 years ago

Rework of drivebar to rescan all drives and refresh media buttons and menu items grey out inappropriate menu items. Streamline Tree scan code and use semaphores to serialize access. Add NOEASUPPORT and LOCALHD driveflag; .LONGNAME usage fixes; (Tickets 377-386)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 50.9 KB
Line 
1
2/***********************************************************************
3
4 $Id: worker.c 1444 2009-07-22 23:24:23Z gyoung $
5
6 Worker thread
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2001, 2009 Steven H. Levine
10
11 16 Oct 02 SHL Comments
12 18 Oct 02 SHL MassAction:Archive - force extension so file found
13 06 Jun 05 SHL Indent -i2
14 06 Jun 05 SHL Rework Action for VAC3.65 compat
15 27 Jul 05 SHL IDM_DOITYOURSELF - avoid need to strip in ExecOnList
16 22 Jul 06 SHL Comments
17 22 Jul 06 SHL Check more run time errors
18 03 Nov 06 SHL Renames
19 03 Nov 06 SHL Count thread usage
20 21 Apr 07 GKY Find FM2Utils by path or utils directory
21 16 Jun 07 SHL Update for OpenWatcom
22 06 Aug 07 GKY Reduce DosSleep times (ticket 148)
23 07 Aug 07 SHL Use BldQuotedFileName
24 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
25 26 Aug 07 SHL Revert to DosSleep(0)
26 29 Feb 08 GKY Refactor global command line variables to notebook.h
27 22 Jun 08 GKY Made Felete move to xworkplace trash can on systems that have it
28 16 JUL 08 GKY Use TMP directory for temp files
29 20 Jul 08 GKY Add save/append filename to clipboard.
30 02 Aug 08 GKY Limit use of "trash can" to local writable fixed drives or to trash can supported
31 drives list if it exists. Fix ability to deselect use of trash can.
32 01 Sep 08 GKY Add code to retry on Netdrives "pipe error"
33 04 Dec 08 GKY Add a DosSleep to allow file extract to complete before rescan
34 04 Dec 08 GKY Add mutex semaphore and disable fSyncUpdates for file deletes to prevent the creation
35 on dead CNRITEMS.
36 10 Dec 08 SHL Integrate exception handler support
37 25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
38 25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session
39 to prevent duplicate directory names in tree following a copy before initial scan.
40 07 Feb 09 GKY Allow user to turn off alert and/or error beeps in settings notebook.
41 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used)
42 08 Mar 09 GKY Additional strings move to PCSZs
43 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
44
45***********************************************************************/
46
47#include <stdlib.h>
48#include <string.h>
49#include <ctype.h>
50#include <share.h>
51#include <process.h> // _beginthread // 10 Dec 08 SHL
52#include <time.h>
53
54#define INCL_DOS
55#define INCL_DOSERRORS
56// #define INCL_WINPROGRAMLIST // 13 Jul 09 SHL dropped
57// #define INCL_WINHELP // 13 Jul 09 SHL dropped
58#define INCL_LONGLONG
59#define INCL_WINPOINTERS // WinSetFileIcon
60// #define INCL_WINWORKPLACE // 13 Jul 09 SHL dropped
61#define INCL_WINSHELLDATA // PrfQueryProfileData
62#define INCL_WINTIMER // WinStarTimer
63#define INCL_WININPUT // WinQueryFocus
64
65#include "fm3dll.h"
66#include "fm3dll2.h" // #define's for UM_*, control id's, etc.
67#include "mainwnd2.h" // Data declaration(s)
68#include "arccnrs.h" // Data declaration(s)
69#include "init.h" // Data declaration(s)
70#include "defview.h" // Data declaration(s)
71#include "newview.h" // Data declarations
72#include "fm3dlg.h"
73#include "fm3str.h"
74#include "comp.h" // FCOMPARE
75#include "pathutil.h" // BldQuotedFileName
76#include "makelist.h" // AddToList
77#include "errutil.h" // Dos_Error...
78#include "strutil.h" // GetPString
79#include "notebook.h" // External viewers
80#include "worker.h" // Action
81#include "notify.h" // AddNote
82#include "copyf.h" // AdjustWildcardName, make_deleteable
83#include "attribs.h" // AttrListDlgProc
84#include "chklist.h" // CheckListProc
85#include "info.h" // DrvInfoProc
86#include "extract.h" // ExtractDlgProc
87#include "info.h" // FileInfoProc
88#include "valid.h" // GetDesktopName, IsNewer
89#include "saveclip.h" // ListToClipboardHab
90#include "shadow.h" // MakeShadows
91#include "mkdir.h" // MassMkdir
92#include "uudecode.h" // MergeDlgProc
93#include "objcnr.h" // ObjCnrDlgProc
94#include "printer.h" // PrintDlgProc, PrintListThread
95#include "rename.h" // RenameProc
96#include "srchpath.h" // RunFM2Util
97#include "mainwnd.h" // TopWindowName
98#include "uudecode.h" // UUD
99#include "walkem.h" // WalkCopyDlgProc, WalkDlgProc, WalkMoveDlgProc
100#include "archive.h" // ArchiveDlgProc
101#include "misc.h" // Broadcast
102#include "common.h" // DecrThreadUsage, IncrThreadUsage
103#include "eas.h" // DisplayEAsProc
104#include "systemf.h" // ExecOnList
105#include "avl.h" // SBoxDlgProc
106#include "subj.h" // Subject
107#include "grep.h" // hwndStatus
108#include "stristr.h" // stristr
109#include "wrappers.h" // xfopen
110#include "fortify.h"
111#include "excputil.h" // 06 May 08 SHL added
112
113// Data definitions
114#pragma data_seg(GLOBAL2)
115FILE *LogFileHandle;
116
117#pragma data_seg(DATA2)
118
119static PSZ pszSrcFile = __FILE__;
120
121#ifdef UNDO
122
123static VOID LINFO undo;
124
125VOID FreeUndo(VOID)
126{
127 if (undo->list)
128 FreeList(undo->list);
129 memset(&undo, 0, sizeof(undo));
130}
131
132VOID Undo(HWND hwndCnr, HWND hwndFrame, HWND hwndClient, HWND hwndParent)
133{
134 LISTINFO *li;
135 WORKER *wk;
136
137 if (undo->type && undo->list && undo->list[0]) {
138 switch (undo->type) {
139 case IDM_MOVE:
140 case IDM_COPY:
141 case IDM_EXTRACT:
142 {
143# ifdef FORTIFY
144 Fortify_EnterScope();
145# endif
146 li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
147 if (li) {
148 wk = xmallocz(sizeof(WORKER), pszSrcFile, __LINE__);
149 if (wk) {
150 wk->size = sizeof(WORKER);
151 wk->hwndCnr = hwndCnr;
152 wk->hwndParent = hwndParent;
153 wk->hwndFrame = hwndFrame;
154 wk->hwndClient = hwndClient;
155 wk->li = li;
156 *wk->li = *undo;
157 switch (undo->type) {
158 case IDM_COPY:
159 case IDM_EXTRACT:
160 li->type = IDM_PERMDELETE;
161 break;
162 }
163 if (xbeginthread(MassAction,
164 122880,
165 wk,
166 pszSrcFile,
167 __LINE__) == -1)
168 {
169 FreeListInfo(wk->li);
170 free(wk);
171# ifdef FORTIFY
172 Fortify_LeaveScope();
173# endif
174 }
175 }
176 else
177 FreeListInfo(li);
178 }
179 }
180 break;
181 } // switch
182 }
183 FreeUndo();
184# ifdef FORTIFY
185 Fortify_LeaveScope();
186# endif
187}
188
189#endif // defined(UNDO)
190
191VOID Action(VOID * args)
192{
193 WORKER *wk = (WORKER *)args;
194 HAB hab2;
195 HMQ hmq2;
196 CHAR **files = NULL;
197 UINT numfiles = 0, numalloc = 0;
198 INT plen = 0;
199 CHAR *p, *pp;
200 ULONG idTimerStarted = 0;
201 BOOL fActionPosted = FALSE;
202 HAB habForActions;
203 HWND hwndForActions;
204 CHAR szQuotedDirName[CCHMAXPATH];
205 CHAR szQuotedFileName[CCHMAXPATH];
206
207
208 if (wk) {
209# ifdef FORTIFY
210 Fortify_EnterScope();
211# endif
212 if (wk->li && wk->li->list && wk->li->list[0]) {
213 hab2 = WinInitialize(0);
214 if (hab2) {
215 hmq2 = WinCreateMsgQueue(hab2, 0);
216 if (hmq2) {
217 CHAR message[(CCHMAXPATH * 2) + 80], wildname[CCHMAXPATH];
218 INT x;
219 BOOL dontask = FALSE, wildcarding = FALSE, overold =
220 FALSE, overnew = FALSE, usedtarget;
221
222 WinCancelShutdown(hmq2, TRUE);
223 IncrThreadUsage();
224 *wildname = 0;
225 // Do action specific preprocessing
226 switch (wk->li->type) {
227 case IDM_MERGE:
228 if (wk->li->type == IDM_MERGE) {
229 if (TestBinary(wk->li->list[0]))
230 wk->li->type = IDM_MERGEBINARY;
231 else
232 wk->li->type = IDM_MERGETEXT;
233 }
234 strcpy(wk->li->targetpath, wk->li->list[0]);
235 p = strrchr(wk->li->targetpath, '\\');
236 if (p) {
237 p++;
238 *p = 0;
239 }
240 else
241 strcat(wk->li->targetpath, PCSZ_BACKSLASH);
242 sprintf(wk->li->targetpath + strlen(wk->li->targetpath),
243 "MERGE.%03x", (clock() & 4095L));
244 if (!WinDlgBox(HWND_DESKTOP,
245 wk->hwndFrame,
246 MergeDlgProc, FM3ModHandle, MRG_FRAME, (PVOID) wk))
247 goto Abort;
248 if (!wk->li->type ||
249 !*wk->li->targetpath || !wk->li->list || !wk->li->list[0])
250 goto Abort;
251 if (IsFile(wk->li->targetpath) != 1 && !wk->li->list[1]) {
252 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
253 wk->hwndFrame,
254 GetPString(IDS_AHEMTEXT),
255 GetPString(IDS_SILLYMERGETEXT));
256 goto Abort;
257 }
258 break;
259 case IDM_WILDMOVE:
260 wildcarding = TRUE;
261 wk->li->type = IDM_MOVE;
262 break;
263 case IDM_WILDRENAME:
264 wildcarding = TRUE;
265 wk->li->type = IDM_RENAME;
266 break;
267 case IDM_WILDCOPY:
268 wildcarding = TRUE;
269 wk->li->type = IDM_COPY;
270 break;
271 case IDM_MOVEPRESERVE:
272 {
273 CHAR preserve[CCHMAXPATH], *end;
274
275 wk->li->type = IDM_MOVE;
276 strcpy(preserve, wk->li->list[0] + 2);
277 end = strrchr(preserve, '\\');
278 if (end) {
279 end++;
280 for (x = 1; wk->li->list[x]; x++) {
281 p = preserve;
282 pp = wk->li->list[x] + 2;
283 while (p < end && toupper(*p) == toupper(*pp)) {
284 p++;
285 pp++;
286 }
287 if (*p == '\\')
288 p++;
289 if (p < end)
290 end = p;
291 }
292 *end = 0;
293 }
294 else
295 *preserve = 0;
296 plen = strlen(preserve);
297 if (plen)
298 plen += 2;
299 }
300 break;
301 case IDM_COPYPRESERVE:
302 {
303 CHAR preserve[CCHMAXPATH], *end;
304
305 wk->li->type = IDM_COPY;
306 strcpy(preserve, wk->li->list[0] + 2);
307 end = strrchr(preserve, '\\');
308 if (end) {
309 end++;
310 for (x = 1; wk->li->list[x]; x++) {
311 p = preserve;
312 pp = wk->li->list[x] + 2;
313 while (p < end && toupper(*p) == toupper(*pp)) {
314 p++;
315 pp++;
316 }
317 if (*p == '\\')
318 p++;
319 if (p < end)
320 end = p;
321 }
322 *end = 0;
323 }
324 else
325 *preserve = 0;
326 plen = strlen(preserve);
327 if (plen)
328 plen += 2;
329 }
330 break;
331 }
332 // Process each list item
333 if (wk->li && wk->li->list && wk->li->list[0]) {
334 // char ucClassname[8];
335 if (hwndStatus) {
336 // Send update request to source window or container
337 // 13 Jul 09 SHL fixme to be sure we pick window that understand UM_ACTIONSTATE wk->dcd->hwndCnr?
338 // 13 Jul 09 SHL fixme to ensure focus window is one that understands UM_ACTIONSTATE
339 HWND hwndFocus = WinQueryFocus(HWND_DESKTOP);
340 DbgMsg(pszSrcFile, __LINE__, "hwndFocus %lx", hwndFocus); // 13 Jul 09 SHL fixme debug
341 DbgMsg(pszSrcFile, __LINE__, "hwndCnr %lx", wk->hwndCnr); // 13 Jul 09 SHL fixme debug
342 // DbgMsg(pszSrcFile, __LINE__, "hwndS %lx", wk->li->hwndS); // 13 Jul 09 SHL fixme debug
343 DbgMsg(pszSrcFile, __LINE__, "hwnd %lx", wk->li->hwnd); // 13 Jul 09 SHL fixme debug
344 // DbgMsg(pszSrcFile, __LINE__, "hwndParent %lx", wk->hwndParent); // 13 Jul 09 SHL fixme debug
345 // DbgMsg(pszSrcFile, __LINE__, "hwndClient %lx", wk->hwndClient); // 13 Jul 09 SHL fixme debug
346 // DbgMsg(pszSrcFile, __LINE__, "hwndFrame %lx", wk->hwndFrame); // 13 Jul 09 SHL fixme debug
347 // hwndForActions = wk->li->hwnd == hwndFocus ? hwndFocus : wk->hwndCnr;
348 hwndForActions = WinQueryFocus(HWND_DESKTOP);
349#if 0 // 14 Jul 09 SHL fixme
350 hwndForActions = WinQueryFocus(HWND_DESKTOP);
351 if (WinQueryClassName(hwndForActions, sizeof(ucClassname), ucClassname)) {
352 // If not a container fall back to worker
353 if (strcmp(ucClassname, "#25"));
354 }
355#endif
356 habForActions = WinQueryAnchorBlock(hwndForActions);
357 DbgMsg(pszSrcFile, __LINE__, "habForActions %lx hwndForActions %lx", habForActions, hwndForActions); // 13 Jul 09 SHL fixme debug
358 // Ask container window to update status line every 5 seconds in case action is time intensive
359 idTimerStarted = WinStartTimer(habForActions, hwndForActions, ID_ACTION_TIMER, 2000); // 13 Jul 09 SHL fixme 5 sec
360 }
361 for (x = 0; wk->li->list[x]; x++) {
362 switch (wk->li->type) {
363 case IDM_COLLECTFROMFILE:
364 if (Collector) {
365
366 CHAR *temp = xstrdup(wk->li->list[x], pszSrcFile, __LINE__);
367
368 if (temp) {
369 if (!PostMsg(Collector,
370 UM_COLLECTFROMFILE, MPFROMP(temp), MPVOID))
371 free(temp);
372 }
373 }
374 break;
375
376 case IDM_MERGEBINARY:
377 case IDM_MERGETEXT:
378 case IDM_MERGEBINARYAPPEND:
379 case IDM_MERGETEXTAPPEND:
380 {
381 FILE *in, *out;
382 CHAR *moder, *modew;
383 int c;
384
385 switch (wk->li->type) {
386 case IDM_MERGEBINARY:
387 moder = "rb";
388 modew = "wb";
389 break;
390 case IDM_MERGEBINARYAPPEND:
391 moder = "rb";
392 modew = "a+b";
393 break;
394 case IDM_MERGETEXTAPPEND:
395 moder = "r";
396 modew = "a+";
397 break;
398 default:
399 moder = "r";
400 modew = "w";
401 break;
402 }
403 in = _fsopen(wk->li->list[x], moder, SH_DENYWR);
404 if (!in) {
405 if (saymsg(MB_ENTERCANCEL,
406 HWND_DESKTOP,
407 GetPString(IDS_MERGEERRORTEXT),
408 GetPString(IDS_CANTOPENINPUTTEXT),
409 wk->li->list[x]) == MBID_CANCEL)
410 goto Abort;
411 }
412 else {
413 out = _fsopen(wk->li->targetpath, modew, SH_DENYWR);
414 if (out) {
415 fseek(out, 0L, SEEK_END);
416 switch (wk->li->type) {
417 case IDM_MERGEBINARY:
418 wk->li->type = IDM_MERGEBINARYAPPEND;
419 break;
420 default:
421 wk->li->type = IDM_MERGETEXTAPPEND;
422 break;
423 }
424 sprintf(message,
425 GetPString(IDS_MERGINGTEXT),
426 wk->li->list[x], wk->li->targetpath);
427 AddNote(message);
428 while ((c = fgetc(in)) != EOF)
429 fputc(c, out);
430 fclose(out);
431 sprintf(message,
432 GetPString(IDS_MERGECOMPLETETEXT),
433 wk->li->list[x], wk->li->targetpath);
434 AddNote(message);
435 }
436 else {
437 saymsg(MB_CANCEL,
438 HWND_DESKTOP,
439 GetPString(IDS_MERGEERRORTEXT),
440 GetPString(IDS_CANTOPENOUTPUTTEXT),
441 wk->li->targetpath);
442 fclose(in);
443 goto Abort;
444 }
445 fclose(in);
446 }
447 }
448 break;
449
450 case IDM_UUDECODE:
451 {
452 CHAR outname[CCHMAXPATH + 2];
453
454 sprintf(message,
455 GetPString(IDS_UUDECODINGTEXT), wk->li->list[x]);
456 AddNote(message);
457 if (UUD(wk->li->list[x], outname) && *outname) {
458 sprintf(message,
459 GetPString(IDS_UUDECODECOMPLETETEXT),
460 wk->li->list[x]);
461 AddNote(message);
462 if (//fSyncUpdates ||
463 AddToList(outname, &files, &numfiles, &numalloc))
464 Broadcast(hab2,
465 wk->hwndCnr,
466 UM_UPDATERECORD, MPFROMP(outname), MPVOID);
467 }
468 else {
469 sprintf(message,
470 GetPString(IDS_UUDECODEABORTEDTEXT),
471 wk->li->list[x]);
472 AddNote(message);
473 }
474 }
475 break;
476
477 case IDM_VIEWARCHIVE:
478 if (IsFile(wk->li->list[x]) > 0) {
479
480 ARC_TYPE *info = NULL; // Say calling for editing - fixme to know why?
481
482 if (WinDlgBox(HWND_DESKTOP,
483 wk->hwndFrame,
484 SBoxDlgProc,
485 FM3ModHandle,
486 ASEL_FRAME, (PVOID) & info) && info) {
487 WinSendMsg(wk->hwndCnr,
488 UM_OPENWINDOWFORME,
489 MPFROMP(wk->li->list[x]), MPFROMP(info));
490 }
491 }
492 break;
493
494 case IDM_EXTRACT:
495 {
496 EXTRDATA ex;
497 BOOL maskspaces = FALSE;
498
499 memset(&ex, 0, sizeof(EXTRDATA));
500 ex.info = find_type(wk->li->list[x], NULL);
501 if (!ex.info || (!ex.info->extract && !ex.info->exwdirs))
502 break;
503 ex.size = sizeof(EXTRDATA);
504 ex.arcname = wk->li->list[x];
505 strcpy(ex.masks, "*");
506 strcpy(ex.extractdir, wk->li->targetpath);
507 if (!WinDlgBox(HWND_DESKTOP,
508 wk->hwndFrame,
509 ExtractDlgProc,
510 FM3ModHandle,
511 EXT_FRAME,
512 (PVOID) & ex) ||
513 !ex.ret ||
514 !*ex.command || !*ex.arcname || !*ex.extractdir)
515 goto Abort;
516 {
517 FILESTATUS3 fsa;
518
519 DosError(FERR_DISABLEHARDERR);
520 if (DosQueryPathInfo(ex.extractdir,
521 FIL_STANDARD,
522 &fsa,
523 (ULONG) sizeof(FILESTATUS3)) ||
524 !(fsa.attrFile & FILE_DIRECTORY))
525 goto Abort;
526 }
527 if (needs_quoting(ex.masks) && !strchr(ex.masks, '\"'))
528 maskspaces = TRUE;
529 if (!runemf2(SEPARATE | WINDOWED | WAIT |
530 fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED),
531 HWND_DESKTOP, pszSrcFile, __LINE__, ex.extractdir, NULL,
532 "%s %s %s%s%s",
533 ex.command,
534 ex.arcname,
535 maskspaces ? "\"" : NullStr,
536 *ex.masks ? ex.masks : "\"*\"",
537 maskspaces ? "\"" : NullStr) &&
538 !stricmp(ex.extractdir, wk->directory)) {
539 DosSleep(100); // wait for runemf2 to complete so rescan will actually show something
540 if (WinIsWindow((HAB) 0, wk->hwndCnr))
541 WinSendMsg(wk->hwndCnr,
542 WM_COMMAND,
543 MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
544 }
545 }
546 break;
547
548 case IDM_SUBJECT:
549 {
550 INT ret;
551
552 ret = Subject(wk->hwndFrame, wk->li->list[x]);
553 if (!ret)
554 goto Abort;
555 if (ret == 1) {
556 if (//fSyncUpdates ||
557 AddToList(wk->li->list[x],
558 &files, &numfiles, &numalloc))
559 Broadcast(hab2,
560 wk->hwndCnr,
561 UM_UPDATERECORD,
562 MPFROMP(wk->li->list[x]), MPVOID);
563 }
564 }
565 break;
566
567 case IDM_INFO:
568 if (IsFullName(wk->li->list[x]) &&
569 !(driveflags[toupper(*wk->li->list[x]) - 'A'] &
570 DRIVE_INVALID)) {
571 if (!IsRoot(wk->li->list[x])) {
572
573 CHAR *list[2];
574
575 list[0] = wk->li->list[x];
576 list[1] = NULL;
577 if (!WinDlgBox(HWND_DESKTOP,
578 HWND_DESKTOP,
579 FileInfoProc,
580 FM3ModHandle, FLE_FRAME, (PVOID) list)) {
581 goto Abort;
582 }
583 }
584 else {
585 if (!WinDlgBox(HWND_DESKTOP,
586 HWND_DESKTOP,
587 DrvInfoProc,
588 FM3ModHandle,
589 INFO_FRAME, (PVOID) wk->li->list[x]))
590 goto Abort;
591 }
592 }
593 break;
594
595 case IDM_OPENWINDOW:
596 if (!IsFile(wk->li->list[x]) &&
597 WinIsWindow(hab2, wk->hwndCnr))
598 WinSendMsg(wk->hwndCnr,
599 UM_OPENWINDOWFORME,
600 MPFROMP(wk->li->list[x]), MPVOID);
601 break;
602
603 case IDM_OPENICON:
604 case IDM_OPENDETAILS:
605 case IDM_OPENTREE:
606 {
607 FILESTATUS3 fsa;
608
609 DosError(FERR_DISABLEHARDERR);
610 if (DosQueryPathInfo(wk->li->list[x],
611 FIL_STANDARD,
612 &fsa,
613 (ULONG) sizeof(FILESTATUS3)) ||
614 !(fsa.attrFile & FILE_DIRECTORY))
615 break;
616 }
617 /* else intentional fallthru */
618 case IDM_OPENDEFAULT:
619 case IDM_OPENSETTINGS:
620 {
621 CHAR *s;
622
623 switch (wk->li->type) {
624 case IDM_OPENICON:
625 s = (PSZ) PCSZ_ICON;
626 break;
627 case IDM_OPENDETAILS:
628 s = (PSZ) Details;
629 break;
630 case IDM_OPENTREE:
631 s = (PSZ) PCSZ_TREE;
632 break;
633 case IDM_OPENSETTINGS:
634 s = (PSZ) Settings;
635 break;
636 default:
637 s = (PSZ) Default;
638 break;
639 }
640 OpenObject(wk->li->list[x], s, wk->hwndFrame);
641 }
642 break;
643
644 case IDM_WPSMOVE:
645 case IDM_WPSCOPY:
646 case IDM_MOVE:
647 case IDM_COPY:
648 case IDM_RENAME:
649 {
650
651 if (!*wk->li->targetpath && (wk->li->type == IDM_MOVE ||
652 wk->li->type == IDM_COPY ||
653 wk->li->type == IDM_WPSMOVE ||
654 wk->li->type == IDM_WPSCOPY)) {
655
656 APIRET rc = 1;
657
658 usedtarget = FALSE;
659 if (hwndMain) {
660 if (!*targetdir)
661 TopWindowName(hwndMain,
662 wk->hwndFrame, wk->li->targetpath);
663 else {
664 strcpy(wk->li->targetpath, targetdir);
665 usedtarget = TRUE;
666 }
667 }
668 if (!*wk->li->targetpath)
669 strcpy(wk->li->targetpath, wk->directory);
670 if (!*wk->li->targetpath) {
671 strcpy(wk->li->targetpath, wk->li->list[0]);
672 p = strrchr(wk->li->targetpath, '\\');
673 if (p) {
674 if (*(p - 1) == ':')
675 p++;
676 *p = 0;
677 }
678 }
679 MakeValidDir(wk->li->targetpath);
680 if (fConfirmTarget ||
681 (!*targetdir && strcmp(realappname, "FM/4"))) {
682 RetryPath:
683 usedtarget = FALSE;
684 if (wk->li->type == IDM_MOVE ||
685 wk->li->type == IDM_WPSMOVE) {
686 rc = WinDlgBox(HWND_DESKTOP,
687 wk->hwndFrame,
688 WalkMoveDlgProc,
689 FM3ModHandle,
690 WALK_FRAME, MPFROMP(wk->li->targetpath));
691 }
692 else if (wk->li->type == IDM_COPY ||
693 wk->li->type == IDM_WPSCOPY) {
694 rc = WinDlgBox(HWND_DESKTOP,
695 wk->hwndFrame,
696 WalkCopyDlgProc,
697 FM3ModHandle,
698 WALK_FRAME, MPFROMP(wk->li->targetpath));
699 }
700 else
701 rc = WinDlgBox(HWND_DESKTOP,
702 wk->hwndFrame,
703 WalkDlgProc,
704 FM3ModHandle,
705 WALK_FRAME, MPFROMP(wk->li->targetpath));
706 }
707 if (!rc || !*wk->li->targetpath)
708 goto Abort;
709 if (driveflags[toupper(*wk->li->targetpath) - 'A'] &
710 DRIVE_NOTWRITEABLE) {
711 saymsg(MB_CANCEL,
712 wk->hwndFrame,
713 GetPString(IDS_ERRORTEXT),
714 GetPString(IDS_NOTWRITENOTARGETTEXT));
715 goto RetryPath;
716 }
717 }
718 Retry:
719 {
720 CHAR newname[CCHMAXPATH];
721 PCSZ moving, move, moved;
722 APIRET rc;
723 INT type;
724 FILESTATUS4L fs4;
725 BOOL isnewer, existed, fResetVerify = FALSE;
726
727 type = (wk->li->type == IDM_RENAME) ? MOVE :
728 (wk->li->type == IDM_MOVE) ? MOVE :
729 (wk->li->type == IDM_WPSMOVE) ? WPSMOVE :
730 (wk->li->type == IDM_WPSCOPY) ? WPSCOPY : COPY;
731 moving = (wk->li->type == IDM_RENAME) ?
732 GetPString(IDS_RENAMINGTEXT) :
733 (wk->li->type == IDM_MOVE ||
734 wk->li->type == IDM_WPSMOVE) ?
735 GetPString(IDS_MOVINGTEXT) : GetPString(IDS_COPYINGTEXT);
736 move = (wk->li->type == IDM_RENAME) ?
737 GetPString(IDS_RENAMETEXT) :
738 (wk->li->type == IDM_MOVE ||
739 wk->li->type == IDM_WPSMOVE) ?
740 GetPString(IDS_MOVETEXT) : GetPString(IDS_COPYTEXT);
741 moved = (wk->li->type == IDM_RENAME) ?
742 GetPString(IDS_RENAMEDTEXT) :
743 (wk->li->type == IDM_MOVE ||
744 wk->li->type == IDM_WPSMOVE) ?
745 GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT);
746 if (*wk->li->targetpath) {
747 strcpy(newname, wk->li->targetpath);
748 AddBackslashToPath(newname);
749 //if (newname[strlen(newname) - 1] != '\\')
750 // strcat(newname, "\\");
751 if (plen)
752 p = wk->li->list[x] + plen;
753 else {
754 p = strrchr(wk->li->list[x], '\\');
755 if (p)
756 p++;
757 else
758 p = wk->li->list[x];
759 }
760 strcat(newname, p);
761 }
762 else
763 strcpy(newname, wk->li->list[x]);
764 if ((wildcarding || wk->li->type == IDM_RENAME) &&
765 *wildname) {
766
767 CHAR testname[CCHMAXPATH];
768
769 strcpy(testname, wildname);
770 if (AdjustWildcardName(newname, testname))
771 strcpy(newname, testname);
772 }
773 existed = (IsFile(newname) != -1);
774 isnewer = IsNewer(wk->li->list[x], newname);
775 if (existed && wk->li->type != IDM_RENAME && dontask) {
776 if (!overold && !overnew)
777 break;
778 if (!overold && !isnewer)
779 break;
780 if (!overnew && isnewer)
781 break;
782 }
783 if ((wk->li->type == IDM_RENAME &&
784 (!dontask || !*wildname)) ||
785 (!dontask && existed) ||
786 (!dontask && wildcarding) ||
787 (IsFile(newname) == 0 && IsFile(wk->li->list[x]) > 0)) {
788
789 MOVEIT mv;
790
791 memset(&mv, 0, sizeof(MOVEIT));
792 mv.rename = (wk->li->type == IDM_RENAME);
793 mv.source = wk->li->list[x];
794 strcpy(mv.target, newname);
795 rc = WinDlgBox(HWND_DESKTOP,
796 wk->hwndFrame,
797 RenameProc,
798 FM3ModHandle, REN_FRAME, (PVOID) & mv);
799 if (!rc)
800 goto Abort;
801 DosSleep(1);
802 if (mv.skip || !*mv.target)
803 break;
804 if (mv.dontask)
805 dontask = TRUE;
806 if (mv.overold)
807 overold = TRUE;
808 if (mv.overnew)
809 overnew = TRUE;
810 if (wildcarding || wk->li->type == IDM_RENAME) {
811 p = strrchr(mv.target, '\\');
812 if (p && (strchr(p, '*') || strchr(p, '?'))) {
813 strcpy(wildname, mv.target);
814 AdjustWildcardName(wk->li->list[x], mv.target);
815 }
816 else
817 *wildname = 0;
818 }
819 strcpy(newname, mv.target);
820 existed = (IsFile(newname) != -1);
821 isnewer = IsNewer(wk->li->list[x], newname);
822 if (!mv.overwrite) {
823 if (existed && wk->li->type != IDM_RENAME && dontask) {
824 if (!overold && !overnew)
825 break;
826 if (!overold && !isnewer)
827 break;
828 if (!overnew && isnewer)
829 break;
830 }
831 }
832 }
833 if (!strcmp(wk->li->list[x], newname) ||
834 (wk->li->type == IDM_COPY &&
835 !stricmp(wk->li->list[x], newname)))
836 break;
837 sprintf(message,
838 " %s \"%s\" %s\"%s\"%s",
839 moving,
840 wk->li->list[x],
841 GetPString(IDS_TOTEXT),
842 newname,
843 (usedtarget) ? GetPString(IDS_TOTARGETTEXT) :
844 NullStr);
845 AddNote(message);
846 if (fVerify && (driveflags[toupper(*wk->li->targetpath) - 'A'] & DRIVE_WRITEVERIFYOFF) |
847 (driveflags[toupper(*wk->li->list[x]) - 'A'] & DRIVE_WRITEVERIFYOFF)) {
848 DosSetVerify(FALSE);
849 fResetVerify = TRUE;
850 }
851 if (plen) {
852 /* make directory/ies, if required */
853
854 CHAR dirpart[CCHMAXPATH];
855
856 strcpy(dirpart, newname);
857 p = strrchr(dirpart, '\\');
858 if (p) {
859 *p = 0;
860 if (p > dirpart + 3)
861 MassMkdir((hwndMain) ? hwndMain : wk->hwndCnr,
862 dirpart);
863 }
864 }
865 if (fRealIdle)
866 priority_idle();
867
868 rc = docopyf(type, wk->li->list[x], newname);
869 if (fResetVerify) {
870 DosSetVerify(fVerify);
871 fResetVerify = FALSE;
872 }
873 priority_normal();
874 if (rc) {
875 if ((rc == ERROR_DISK_FULL ||
876 rc == ERROR_HANDLE_DISK_FULL) &&
877 isalpha(*newname) &&
878 (driveflags[toupper(*newname) - 'A'] &
879 DRIVE_REMOVABLE)
880 && !(driveflags[toupper(*newname) - 'A'] &
881 DRIVE_NOTWRITEABLE)
882 && toupper(*newname) != toupper(*wk->li->list[x])
883 && !DosQueryPathInfo(wk->li->list[x], FIL_QUERYEASIZEL,
884 &fs4, sizeof(fs4))
885 && !(fs4.attrFile & FILE_DIRECTORY)) {
886
887 FSALLOCATE fsa;
888 ULONGLONG ullFreeBytes;
889 CHAR *ptr;
890 INT cntr;
891
892 Notify(GetPString(IDS_FITTINGTEXT));
893 DosError(FERR_DISABLEHARDERR);
894 if (!DosQueryFSInfo(toupper(*newname) - '@',
895 FSIL_ALLOC,
896 &fsa, sizeof(FSALLOCATE))) {
897 // Assume large file support
898 ullFreeBytes = (ULONGLONG) fsa.cUnitAvail * fsa.cSectorUnit *
899 fsa.cbSector;
900 if (ullFreeBytes) {
901 // Find item that will fit in available space
902 for (cntr = x + 1; wk->li->list[cntr]; cntr++) {
903 DosError(FERR_DISABLEHARDERR);
904 if (!DosQueryPathInfo(wk->li->list[cntr],
905 FIL_QUERYEASIZEL,
906 &fs4,
907 sizeof(fs4)) &&
908 !(fs4.attrFile & FILE_DIRECTORY) &&
909 // fixme to use CBLIST_TO_EASIZE?
910 fs4.cbFile + fs4.cbList <= ullFreeBytes) {
911 // Swap with failing item
912 ptr = wk->li->list[x];
913 wk->li->list[x] = wk->li->list[cntr];
914 wk->li->list[cntr] = ptr;
915 goto Retry;
916 }
917 }
918 Notify(GetPString(IDS_COULDNTFITTEXT));
919 }
920 }
921 rc = saymsg(MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION,
922 wk->hwndFrame,
923 GetPString(IDS_DISKFULLTEXT),
924 GetPString(IDS_ANOTHERDISKTEXT));
925 if (rc == MBID_RETRY)
926 goto Retry;
927 if (rc == MBID_ABORT)
928 goto Abort;
929 }
930 else {
931 if (LogFileHandle) {
932 fprintf(LogFileHandle,
933 GetPString(IDS_LOGTOFAILEDTEXT),
934 move, wk->li->list[x], newname, rc);
935 }
936 rc = Dos_Error(MB_ENTERCANCEL,
937 rc,
938 wk->hwndFrame,
939 pszSrcFile,
940 __LINE__,
941 "%s %s \"%s\" %s\"%s\" %s.",
942 move,
943 GetPString(IDS_OFTEXT),
944 wk->li->list[x],
945 GetPString(IDS_TOTEXT),
946 newname, GetPString(IDS_FAILEDTEXT));
947 if (rc == MBID_CANCEL)
948 goto Abort;
949 }
950 }
951 else {
952 if (LogFileHandle) {
953 fprintf(LogFileHandle,
954 "%s \"%s\" %s\"%s\"\n",
955 moved,
956 wk->li->list[x],
957 GetPString(IDS_TOTEXT), newname);
958 }
959 if ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
960 AddToList(wk->li->list[x],
961 &files, &numfiles, &numalloc))
962 Broadcast(hab2,
963 wk->hwndCnr,
964 UM_UPDATERECORD,
965 MPFROMP(wk->li->list[x]), MPVOID);
966 if ((driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED) &&
967 AddToList(newname, &files, &numfiles, &numalloc))
968 Broadcast(hab2,
969 wk->hwndCnr,
970 UM_UPDATERECORD, MPFROMP(newname), MPVOID);
971 }
972 }
973 break;
974 }
975
976 case IDM_COMPARE:
977 if ((!IsFile(wk->li->targetpath) ||
978 IsRoot(wk->li->targetpath)) &&
979 (!IsFile(wk->li->list[x]) || IsRoot(wk->li->list[x]))) {
980 if (!*dircompare && WinIsWindow(hab2, wk->hwndCnr))
981 WinSendMsg(wk->hwndCnr,
982 UM_COMPARE,
983 MPFROMP(wk->li->targetpath),
984 MPFROMP(wk->li->list[x]));
985 else {
986 runemf2(SEPARATE,
987 HWND_DESKTOP, pszSrcFile, __LINE__,
988 NULL, NULL,
989 "%s %s %s",
990 dircompare,
991 BldQuotedFileName(szQuotedDirName, wk->li->targetpath),
992 BldQuotedFileName(szQuotedFileName, wk->li->list[x]));
993 }
994 }
995 else if (*compare) {
996 CHAR *fakelist[3];
997
998 fakelist[0] = wk->li->list[x];
999 fakelist[1] = wk->li->targetpath;
1000 fakelist[2] = NULL;
1001 ExecOnList(wk->hwndFrame,
1002 compare,
1003 WINDOWED | SEPARATEKEEP, NULL, fakelist, NULL,
1004 pszSrcFile, __LINE__);
1005 }
1006 else {
1007 FCOMPARE fc;
1008
1009 memset(&fc, 0, sizeof(fc));
1010 fc.size = sizeof(fc);
1011 fc.hwndParent = wk->hwndParent;
1012 strcpy(fc.file1, wk->li->list[x]);
1013 strcpy(fc.file2, wk->li->targetpath);
1014 if (WinDlgBox(HWND_DESKTOP,
1015 wk->hwndFrame,
1016 CFileDlgProc,
1017 FM3ModHandle, FCMP_FRAME, (PVOID) & fc))
1018 goto Abort;
1019 }
1020 break;
1021 } // switch
1022 DosSleep(0);
1023 } // for list
1024
1025 // Do actio specific post-processing
1026 switch (wk->li->type) {
1027 case IDM_MOVE:
1028 case IDM_COPY:
1029 case IDM_WPSMOVE:
1030 case IDM_WPSCOPY:
1031 case IDM_RENAME:
1032 sprintf(message,
1033 GetPString(IDS_OPSCOMPLETETEXT),
1034 (wk->li->type == IDM_MOVE) ?
1035 GetPString(IDS_MOVETEXT) :
1036 (wk->li->type == IDM_COPY) ?
1037 GetPString(IDS_COPYTEXT) :
1038 (wk->li->type == IDM_WPSMOVE) ?
1039 GetPString(IDS_WPSMOVETEXT) :
1040 (wk->li->type == IDM_WPSCOPY) ?
1041 GetPString(IDS_WPSCOPYTEXT) :
1042 GetPString(IDS_RENAMETEXT),
1043 &"s"[x == 1],
1044 (wk->li->type == IDM_MOVE ||
1045 wk->li->type == IDM_COPY ||
1046 wk->li->type == IDM_WPSMOVE ||
1047 wk->li->type == IDM_WPSCOPY) ?
1048 GetPString(IDS_TOTEXT) :
1049 NullStr,
1050 (wk->li->type == IDM_MOVE ||
1051 wk->li->type == IDM_COPY ||
1052 wk->li->type == IDM_WPSMOVE ||
1053 wk->li->type == IDM_WPSCOPY) ?
1054 wk->li->targetpath :
1055 NullStr,
1056 (x != 1) ?
1057 GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
1058 Notify(message);
1059 if (toupper(*wk->li->targetpath) < 'C' && !fAlertBeepOff)
1060 DosBeep(1000, 25); // Wake up user
1061 DosSleep(16);//05 Aug 07 GKY 33
1062 if (wk->li->type == IDM_WPSMOVE || wk->li->type == IDM_WPSCOPY)
1063 DosSleep(48);//05 Aug 07 GKY 96
1064 break;
1065 default:
1066 break;
1067 }
1068 if (idTimerStarted)
1069 WinStopTimer(habForActions, hwndForActions, ID_ACTION_TIMER); // 13 Jul 09 SHL
1070 } // if have non-empty list
1071
1072 Abort:
1073
1074 if (files) {
1075 if (driveflags[*wk->li->targetpath - 'A'] & DRIVE_RSCANNED)
1076 Broadcast(hab2,
1077 wk->hwndCnr,
1078 UM_UPDATERECORDLIST, MPFROMP(files), MPVOID);
1079 FreeList(files);
1080 }
1081
1082 if (WinIsWindow(hab2, wk->hwndCnr))
1083 PostMsg(wk->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
1084
1085 WinDestroyMsgQueue(hmq2);
1086 }
1087 DecrThreadUsage();
1088 WinTerminate(hab2);
1089 }
1090 }
1091
1092 if (fActionPosted)
1093 DosSleep(2000); // Alloc container time to process queued UM_ACTIONSTATE messages 13 Jul 09 SHL
1094 if (wk->li)
1095 FreeListInfo(wk->li);
1096 free(wk);
1097# ifdef FORTIFY
1098 Fortify_LeaveScope();
1099# endif
1100 DosPostEventSem(CompactSem);
1101 }
1102}
1103
1104VOID MassAction(VOID * args)
1105{
1106 WORKER *wk = (WORKER *) args;
1107 HAB hab2;
1108 HMQ hmq2;
1109 CHAR **files = NULL;
1110 register CHAR *p, *pp;
1111 UINT numfiles = 0, numalloc = 0;
1112
1113
1114 if (wk) {
1115# ifdef FORTIFY
1116 // Fortify_BecomeOwner(wk);
1117 Fortify_EnterScope();
1118# endif
1119 if (wk->li && wk->li->list && wk->li->list[0]) {
1120 hab2 = WinInitialize(0);
1121 if (hab2) {
1122 hmq2 = WinCreateMsgQueue(hab2, 0);
1123 if (hmq2) {
1124 WinCancelShutdown(hmq2, TRUE);
1125 IncrThreadUsage();
1126 DosError(FERR_DISABLEHARDERR);
1127 if (IsRoot(wk->li->list[0]) || !IsFile(wk->li->list[0])) {
1128 if (wk->li->type == IDM_VIEW)
1129 wk->li->type = IDM_INFO;
1130 if (wk->li->type == IDM_EDIT)
1131 wk->li->type = IDM_EAS;
1132 }
1133 switch (wk->li->type) {
1134 case IDM_INFO:
1135 if (WinDlgBox(HWND_DESKTOP,
1136 wk->hwndFrame,
1137 FileInfoProc,
1138 FM3ModHandle, FLE_FRAME, (PVOID) wk->li->list) != 2)
1139 {
1140 break;
1141 }
1142 /* else intentional fallthru */
1143 case IDM_UPDATE:
1144 Broadcast(hab2,
1145 wk->hwndCnr,
1146 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1147 break;
1148
1149 case IDM_EAS:
1150 if (WinDlgBox(HWND_DESKTOP,
1151 wk->hwndFrame,
1152 DisplayEAsProc,
1153 FM3ModHandle, EA_FRAME, (PVOID) wk->li->list))
1154 Broadcast(hab2,
1155 wk->hwndCnr,
1156 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1157 break;
1158
1159 case IDM_DOITYOURSELF:
1160 ExecOnList(wk->hwndFrame,
1161 "%a",
1162 WINDOWED | SEPARATE | PROMPT,
1163 NULL, wk->li->list, GetPString(IDS_DOITYOURSELFTEXT),
1164 pszSrcFile, __LINE__);
1165 break;
1166
1167 case IDM_MCIPLAY:
1168 {
1169 INT x, MaxFM2playStrLen = 24;
1170 ULONG total;
1171 CHAR fbuf[CCHMAXPATH];
1172
1173 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
1174 SEARCH_CUR_DIRECTORY,
1175 PCSZ_PATH, PCSZ_FM2PLAYEXE, (PBYTE)fbuf, CCHMAXPATH - 1))
1176 total += MaxFM2playStrLen;
1177 else
1178 total = strlen(fbuf);
1179 for (x = 0; wk->li->list[x]; x++)
1180 total += (strlen(wk->li->list[x]) + 1 +
1181 (needs_quoting(wk->li->list[x]) * 2));
1182 if (total > 1000) {
1183
1184 FILE *fp;
1185 CHAR szTempFile[CCHMAXPATH];
1186
1187 BldFullPathName(szTempFile, pTmpDir, PCSZ_FM2PLAYTEMP);
1188 fp = xfopen(szTempFile, "w", pszSrcFile, __LINE__);
1189 if (fp) {
1190 fprintf(fp, "%s", ";AV/2-built FM2Play listfile\n");
1191 for (x = 0; wk->li->list[x]; x++)
1192 fprintf(fp, "%s\n", wk->li->list[x]);
1193 fprintf(fp, ";end\n");
1194 fclose(fp);
1195 strrev(szTempFile);
1196 strcat(szTempFile, "@/");
1197 strrev(szTempFile);
1198 RunFM2Util(PCSZ_FM2PLAYEXE, szTempFile);
1199 }
1200 }
1201 }
1202 /* intentional fallthru */
1203 case IDM_FAKEEXTRACT:
1204 case IDM_FAKEEXTRACTM:
1205 if (wk->li->type == IDM_MCIPLAY ||
1206 (*wk->li->arcname && wk->li->info &&
1207 wk->li->info->extract && *wk->li->targetpath)) {
1208
1209 CHAR szBuffer[1025];
1210 CHAR fbuf[CCHMAXPATH];
1211 register INT x;
1212
1213 if (wk->li->type == IDM_FAKEEXTRACT ||
1214 wk->li->type == IDM_FAKEEXTRACTM) {
1215 strcpy(szBuffer,
1216 (wk->li->info->exwdirs) ?
1217 wk->li->info->exwdirs : wk->li->info->extract);
1218 strcat(szBuffer, " ");
1219 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->arcname);
1220 }
1221 else {
1222 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT |
1223 SEARCH_CUR_DIRECTORY,
1224 PCSZ_PATH, PCSZ_FM2PLAYEXE, (PBYTE)fbuf, CCHMAXPATH - 1))
1225 strcpy(szBuffer, "UTILS\\FM2PLAY.EXE");
1226 else
1227 strcpy(szBuffer, PCSZ_FM2PLAYEXE);
1228 }
1229 p = &szBuffer[strlen(szBuffer)];
1230 strcat(szBuffer, " ");
1231 x = 0;
1232 while (wk->li->list[x]) {
1233 pp = wk->li->list[x];
1234 while (*pp) {
1235 if (*pp == '/')
1236 *pp = '\\';
1237 pp++;
1238 }
1239 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]);
1240 x++;
1241 if (!wk->li->list[x] || strlen(szBuffer) +
1242 strlen(wk->li->list[x]) + 5 > 1024) {
1243 runemf2(SEPARATE | WINDOWED | BACKGROUND | MINIMIZED | WAIT,
1244 HWND_DESKTOP, pszSrcFile, __LINE__,
1245 (wk->li->type == IDM_FAKEEXTRACT ||
1246 wk->li->type == IDM_FAKEEXTRACTM) ?
1247 wk->li->targetpath : NULL,
1248 NULL,
1249 "%s", szBuffer);
1250 DosSleep(1);
1251 *p = 0;
1252 }
1253 strcat(szBuffer, " ");
1254 }
1255 if (wk->li->type == IDM_MCIPLAY)
1256 break;
1257 strcpy(szBuffer, wk->li->targetpath);
1258 AddBackslashToPath(wk->li->targetpath);
1259 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] != '\\')
1260 // strcat(szBuffer, "\\");
1261 p = szBuffer + strlen(szBuffer);
1262 for (x = 0; wk->li->list[x]; x++) {
1263 strcpy(p, wk->li->list[x]);
1264 free(wk->li->list[x]);
1265 wk->li->list[x] = xstrdup(szBuffer, pszSrcFile, __LINE__);
1266 }
1267 if (wk->li->list[0])
1268 Broadcast(hab2,
1269 wk->hwndCnr,
1270 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1271 }
1272 break;
1273
1274 case IDM_SETICON:
1275 if (*wk->li->targetpath) {
1276
1277 ICONINFO ici;
1278
1279 memset(&ici, 0, sizeof(ICONINFO));
1280 ici.cb = sizeof(ICONINFO);
1281 ici.fFormat = ICON_FILE;
1282 ici.pszFileName = wk->li->list[0];
1283 if (!WinSetFileIcon((PSZ) wk->li->targetpath,
1284 (PICONINFO) & ici)) {
1285 ici.fFormat = ICON_CLEAR;
1286 WinSetFileIcon((PSZ) wk->li->targetpath, (PICONINFO) & ici);
1287 }
1288 Broadcast(hab2,
1289 wk->hwndCnr,
1290 UM_UPDATERECORD, MPFROMP(wk->li->targetpath), MPVOID);
1291 }
1292 break;
1293
1294 case IDM_APPENDTOCLIP:
1295 case IDM_SAVETOCLIP:
1296 case IDM_SAVETOCLIPFILENAME:
1297 case IDM_APPENDTOCLIPFILENAME:
1298 ListToClipboardHab(hab2,
1299 wk->li->list,
1300 wk->li->type);
1301 break;
1302
1303 case IDM_ARCHIVEM:
1304 case IDM_ARCHIVE:
1305 {
1306 DIRCNRDATA ad;
1307 CHAR szBuffer[1025];
1308 ARC_TYPE *info = NULL;
1309 char *pch;
1310 register INT x;
1311
1312 memset(&ad, 0, sizeof(DIRCNRDATA));
1313 strcpy(ad.arcname, wk->li->targetpath);
1314 if (*wk->li->targetpath && IsFile(wk->li->targetpath) > 0) {
1315 info = find_type(wk->li->targetpath, NULL);
1316 ad.namecanchange = 0;
1317 }
1318 else {
1319 if (*wk->li->targetpath && !IsFile(wk->li->targetpath))
1320 AddBackslashToPath(wk->li->targetpath);
1321 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] !=
1322 // '\\')
1323 // strcat(wk->li->targetpath, "\\");
1324 ad.namecanchange = 1;
1325 }
1326 strcpy(ad.arcname, wk->li->targetpath);
1327 if (wk->li->type == IDM_ARCHIVEM)
1328 ad.fmoving = TRUE;
1329 if (!info) {
1330 ad.info = arcsighead; // Hide dups
1331 if (!WinDlgBox(HWND_DESKTOP,
1332 wk->hwndFrame,
1333 SBoxDlgProc,
1334 FM3ModHandle,
1335 ASEL_FRAME, (PVOID) & ad.info) || !ad.info) {
1336 break; /* we blew it */
1337 }
1338 }
1339 else
1340 ad.info = info;
1341 if (!ad.info || (!ad.info->create &&
1342 !ad.info->move &&
1343 !ad.info->createwdirs &&
1344 !ad.info->movewdirs &&
1345 !ad.info->createrecurse))
1346 break;
1347 if (!*wk->li->targetpath && *wk->directory) {
1348 strcpy(ad.arcname, wk->directory);
1349 AddBackslashToPath(ad.arcname);
1350 //if (ad.arcname[strlen(ad.arcname) - 1] != '\\')
1351 // strcat(ad.arcname, "\\");
1352 }
1353 if (!WinDlgBox(HWND_DESKTOP, wk->hwndFrame, ArchiveDlgProc, FM3ModHandle,
1354 ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) /* we blew it */
1355 break;
1356 // Provide extension so containers work
1357 pch = strrchr(ad.arcname, '\\');
1358 if (pch)
1359 pch = strrchr(pch, '.');
1360 else
1361 pch = strrchr(ad.arcname, '.');
1362 if (!pch && ad.info->ext) {
1363 strcat(ad.arcname, ".");
1364 strcat(ad.arcname, ad.info->ext);
1365 }
1366 /* build the sucker */
1367 strcpy(szBuffer, ad.command);
1368 strcat(szBuffer, " ");
1369 BldQuotedFileName(szBuffer + strlen(szBuffer), ad.arcname);
1370 p = &szBuffer[strlen(szBuffer)];
1371 if (ad.mask.szMask) {
1372 strcat(szBuffer, " ");
1373 strcat(szBuffer, ad.mask.szMask);
1374 }
1375 strcat(szBuffer, " ");
1376 x = 0;
1377 while (wk->li->list[x]) {
1378 FILESTATUS3 fsa;
1379 memset(&fsa, 0, sizeof(FILESTATUS3));
1380 DosError(FERR_DISABLEHARDERR);
1381 DosQueryPathInfo(wk->li->list[x],
1382 FIL_STANDARD,
1383 &fsa, (ULONG) sizeof(FILESTATUS3));
1384 if (fsa.attrFile & FILE_DIRECTORY) {
1385 BldQuotedFullPathName(szBuffer + strlen(szBuffer), wk->li->list[x], "*");
1386 }
1387 else
1388 BldQuotedFileName(szBuffer + strlen(szBuffer), wk->li->list[x]);
1389 x++;
1390 if (!wk->li->list[x] ||
1391 strlen(szBuffer) + strlen(wk->li->list[x]) + 5 > 1024) {
1392 runemf2(SEPARATE | WINDOWED | WAIT |
1393 (fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED)),
1394 HWND_DESKTOP, pszSrcFile, __LINE__, NULL, NULL,
1395 "%s", szBuffer);
1396 DosSleep(1);
1397 *p = 0;
1398 }
1399 strcat(szBuffer, " ");
1400 }
1401 Broadcast(hab2,
1402 wk->hwndCnr,
1403 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1404 Broadcast(hab2,
1405 wk->hwndCnr,
1406 UM_UPDATERECORD, MPFROMP(ad.arcname), MPVOID);
1407 }
1408 break;
1409
1410 case IDM_VIEW:
1411 if (!TestBinary(wk->li->list[0])) {
1412 wk->li->type = IDM_VIEWTEXT;
1413 goto SkipViewing;
1414 }
1415 else
1416 wk->li->type = IDM_VIEWBINARY;
1417 /* intentional fallthru */
1418 case IDM_VIEWBINARY:
1419 if (*binview) {
1420 ExecOnList((HWND) 0,
1421 binview,
1422 WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
1423 pszSrcFile, __LINE__);
1424 break;
1425 }
1426 /* else intentional fallthru */
1427 case IDM_VIEWTEXT:
1428 SkipViewing:
1429 if (*viewer)
1430 ExecOnList((HWND) 0, viewer,
1431 WINDOWED | SEPARATE |
1432 ((fViewChild) ? CHILD : 0),
1433 NULL, wk->li->list, NULL,
1434 pszSrcFile, __LINE__);
1435 else {
1436
1437 CHAR *temp;
1438 register INT x;
1439 ULONG viewtype;
1440
1441 viewtype = (wk->li->type == IDM_VIEWTEXT) ? 8 :
1442 (wk->li->type == IDM_VIEWBINARY) ? 16 : 0;
1443 for (x = 0; wk->li->list[x]; x++) {
1444 temp = xstrdup(wk->li->list[x], pszSrcFile, __LINE__);
1445 if (temp && WinIsWindow(hab2, wk->hwndCnr)) {
1446 if (!PostMsg(wk->hwndCnr,
1447 UM_LOADFILE,
1448 MPFROMLONG(5 + viewtype), MPFROMP(temp)))
1449 free(temp);
1450 }
1451 DosSleep(1);
1452 }
1453 }
1454 break;
1455
1456 case IDM_EDIT:
1457 if (!TestBinary(wk->li->list[0])) {
1458 wk->li->type = IDM_EDITTEXT;
1459 goto SkipEditing;
1460 }
1461 else
1462 wk->li->type = IDM_EDITBINARY;
1463 /* intentional fallthru */
1464 case IDM_EDITBINARY:
1465 if (*bined) {
1466 ExecOnList((HWND) 0,
1467 bined,
1468 WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
1469 pszSrcFile, __LINE__);
1470 break;
1471 }
1472 /* else intentional fallthru */
1473 case IDM_EDITTEXT:
1474 SkipEditing:
1475 if (*editor)
1476 ExecOnList((HWND) 0,
1477 editor,
1478 WINDOWED | SEPARATE, NULL, wk->li->list, NULL,
1479 pszSrcFile, __LINE__);
1480 else {
1481
1482 CHAR *temp;
1483 register INT x;
1484 ULONG viewtype;
1485
1486 viewtype = (wk->li->type == IDM_EDITTEXT) ? 8 :
1487 (wk->li->type == IDM_EDITBINARY) ? 16 : 0;
1488 for (x = 0; wk->li->list[x]; x++) {
1489 temp = xstrdup(wk->li->list[x], pszSrcFile, __LINE__);
1490 if (temp && WinIsWindow(hab2, wk->hwndCnr)) {
1491 if (!PostMsg(wk->hwndCnr,
1492 UM_LOADFILE,
1493 MPFROMLONG(4 + viewtype), MPFROMP(temp)))
1494 free(temp);
1495 }
1496 DosSleep(1);
1497 }
1498 }
1499 break;
1500
1501 case IDM_SHADOW2:
1502 case IDM_OBJECT:
1503 case IDM_SHADOW:
1504 {
1505 CHAR objectpath[CCHMAXPATH];
1506 APIRET rc;
1507
1508 if (!*wk->li->targetpath || IsFile(wk->li->targetpath)) {
1509 GetDesktopName(objectpath, sizeof(objectpath));
1510 rc = WinDlgBox(HWND_DESKTOP,
1511 wk->hwndFrame,
1512 ObjCnrDlgProc,
1513 FM3ModHandle,
1514 OBJCNR_FRAME, MPFROMP(objectpath));
1515 if (rc) {
1516 if (rc > 1)
1517 strcpy(objectpath, "<WP_DESKTOP>");
1518 }
1519 else
1520 break;
1521 }
1522 else
1523 strcpy(objectpath, wk->li->targetpath);
1524 AddNote(GetPString(IDS_MAKINGOBJSTEXT));
1525 MakeShadows(wk->hwndFrame,
1526 wk->li->list,
1527 (wk->li->type == IDM_SHADOW) +
1528 (wk->li->type == IDM_SHADOW2) * 2,
1529 objectpath, NULL);
1530 AddNote(GetPString(IDS_MADEOBJSTEXT));
1531 }
1532 break;
1533
1534 case IDM_PRINT:
1535 if (WinDlgBox(HWND_DESKTOP,
1536 wk->hwndFrame,
1537 PrintDlgProc,
1538 FM3ModHandle, PRN_FRAME, MPFROMP(wk->li))) {
1539 if (wk->li && wk->li->list && wk->li->list[0]) {
1540 strcpy(wk->li->targetpath, printer);
1541 if (xbeginthread(PrintListThread,
1542 65536,
1543 wk->li,
1544 pszSrcFile,
1545 __LINE__) != -1)
1546 {
1547 wk->li = NULL; // prevent LISTINFO li from being freed here
1548 }
1549 }
1550 }
1551 break;
1552
1553 case IDM_ATTRS:
1554 if (WinDlgBox(HWND_DESKTOP,
1555 wk->hwndFrame,
1556 AttrListDlgProc,
1557 FM3ModHandle, ATR_FRAME, MPFROMP(wk->li))) {
1558 if (wk->li && wk->li->list && wk->li->list[0])
1559 Broadcast(hab2,
1560 wk->hwndCnr,
1561 UM_UPDATERECORDLIST, MPFROMP(wk->li->list), MPVOID);
1562 }
1563 break;
1564
1565 case IDM_PERMDELETE:
1566 case IDM_DELETE:
1567 {
1568 CHECKLIST cl;
1569 INT isdir = 0, sysdir = 0, ro = 0, hs = 0;
1570 register INT x;
1571 FILESTATUS3 fsa;
1572 CHAR prompt[CCHMAXPATH * 3];
1573 APIRET error = 0;
1574 HOBJECT hObjectdest, hObjectofObject;
1575 BYTE G_abSupportedDrives[24] = {0};
1576 ULONG cbSupportedDrives = sizeof(G_abSupportedDrives);
1577
1578 for (x = 0; wk->li->list[x]; x++) {
1579 if (IsRoot(wk->li->list[x])) {
1580 wk->li->list = RemoveFromList(wk->li->list,
1581 wk->li->list[x]);
1582 if (!wk->li->list)
1583 break;
1584 x--;
1585 continue;
1586 }
1587 DosError(FERR_DISABLEHARDERR);
1588 if (DosQueryPathInfo(wk->li->list[x],
1589 FIL_STANDARD, &fsa,
1590 (ULONG) sizeof(FILESTATUS3))) {
1591 wk->li->list = RemoveFromList(wk->li->list,
1592 wk->li->list[x]);
1593 if (!wk->li->list)
1594 break;
1595 x--;
1596 continue;
1597 }
1598 if (fsa.attrFile & FILE_DIRECTORY) {
1599 isdir++;
1600 if (stristr(wk->li->list[x], ":\\OS2\\") ||
1601 !stricmp(wk->li->list[x] + 1, ":\\OS2"))
1602 sysdir++;
1603 }
1604 else {
1605 if (fsa.attrFile & (FILE_HIDDEN | FILE_SYSTEM))
1606 hs++;
1607 if (fsa.attrFile & FILE_READONLY)
1608 ro++;
1609 }
1610 }
1611 if (!wk->li->list)
1612 break;
1613 if (fConfirmDelete || isdir || hs || ro) {
1614 memset(&cl, 0, sizeof(cl));
1615 cl.size = sizeof(cl);
1616 cl.list = wk->li->list;
1617 cl.prompt = prompt;
1618 cl.flags |= CHECK_FILES;
1619 cl.cmd = wk->li->type;
1620 sprintf(prompt,
1621 GetPString(IDS_DELPROMPT1TEXT),
1622 (wk->li->type == IDM_DELETE) ?
1623 NullStr :
1624 GetPString(IDS_PERMANENTLYTEXT),
1625 &"s"[wk->li->list[1] == NULL]);
1626 if (isdir) {
1627 sprintf(&prompt[strlen(prompt)],
1628 GetPString(IDS_DELPROMPT2TEXT),
1629 isdir,
1630 (isdir > 1) ?
1631 GetPString(IDS_ARETEXT) :
1632 GetPString(IDS_ISTEXT),
1633 (isdir == 1) ?
1634 GetPString(IDS_ATEXT) :
1635 NullStr,
1636 (isdir > 1) ?
1637 GetPString(IDS_IESTEXT) : GetPString(IDS_YTEXT));
1638 if (sysdir)
1639 sprintf(&prompt[strlen(prompt)],
1640 GetPString(IDS_DELPROMPT3TEXT),
1641 sysdir,
1642 (sysdir == 1) ?
1643 GetPString(IDS_YTEXT) : GetPString(IDS_IESTEXT));
1644 }
1645 if (ro)
1646 sprintf(&prompt[strlen(prompt)],
1647 GetPString(IDS_DELPROMPT4TEXT),
1648 ro,
1649 &"s"[ro == 1],
1650 (ro > 1) ?
1651 GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
1652 if (hs)
1653 sprintf(&prompt[strlen(prompt)],
1654 GetPString(IDS_DELPROMPT5TEXT),
1655 hs,
1656 &"s"[hs == 1],
1657 (hs > 1) ?
1658 GetPString(IDS_ARETEXT) : GetPString(IDS_ISTEXT));
1659 if ((ro || hs || sysdir) && !fAlertBeepOff)
1660 DosBeep(300, 100); // Wake up user
1661 strcat(prompt, GetPString(IDS_DELPROMPT6TEXT));
1662 error = WinDlgBox(HWND_DESKTOP,
1663 wk->hwndFrame,
1664 CheckListProc,
1665 FM3ModHandle, CHECK_FRAME, MPFROMP(&cl));
1666 if (!error || error == 65535)
1667 break;
1668 wk->li->list = cl.list;
1669 if (!wk->li->list || !wk->li->list[0])
1670 break;
1671 }
1672 if (fVerify && driveflags[toupper(*wk->li->list[0]) - 'A'] & DRIVE_WRITEVERIFYOFF)
1673 DosSetVerify(FALSE);
1674 DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY
1675 for (x = 0; wk->li->list[x]; x++) {
1676 fsa.attrFile = 0;
1677 DosError(FERR_DISABLEHARDERR);
1678 DosQueryPathInfo(wk->li->list[x],
1679 FIL_STANDARD,
1680 &fsa, (ULONG) sizeof(FILESTATUS3));
1681 if (fsa.attrFile & FILE_DIRECTORY) {
1682 error = (APIRET) wipeallf("%s%s*",
1683 wk->li->list[x],
1684 (*wk->li->list[x] &&
1685 wk->li->
1686 list[x][strlen(wk->li->list[x]) - 1]
1687 != '\\') ? PCSZ_BACKSLASH : NullStr);
1688 DosError(FERR_DISABLEHARDERR);
1689 if (!error)
1690 error = DosDeleteDir(wk->li->list[x]);
1691 else
1692 DosDeleteDir(wk->li->list[x]);
1693 }
1694 else {
1695
1696 DosError(FERR_DISABLEHARDERR);
1697 if (wk->li->type == IDM_DELETE) {
1698 hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
1699 PrfQueryProfileData(HINI_USER,
1700 "XWorkplace",
1701 "TrashCan::Drives",
1702 G_abSupportedDrives,
1703 &cbSupportedDrives);
1704 if (hObjectdest != NULLHANDLE && fTrashCan &&
1705 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] &
1706 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] &
1707 (DRIVE_REMOVABLE | DRIVE_IGNORE |
1708 DRIVE_REMOTE | DRIVE_VIRTUAL |
1709 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) {
1710 hObjectofObject = WinQueryObject(wk->li->list[x]);
1711 error = WinMoveObject(hObjectofObject, hObjectdest, 0);
1712 }
1713 else {
1714 error = DosDelete(wk->li->list[x]);
1715 }
1716 }
1717 else {
1718 error = DosForceDelete(wk->li->list[x]); ;
1719 }
1720 if (error) {
1721 DosError(FERR_DISABLEHARDERR);
1722 make_deleteable(wk->li->list[x]);
1723 if (wk->li->type == IDM_DELETE){
1724 hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
1725 PrfQueryProfileData(HINI_USER,
1726 "XWorkplace",
1727 "TrashCan::Drives",
1728 G_abSupportedDrives,
1729 &cbSupportedDrives);
1730 if (hObjectdest != NULLHANDLE && fTrashCan &&
1731 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] &
1732 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] &
1733 (DRIVE_REMOVABLE | DRIVE_IGNORE |
1734 DRIVE_REMOTE | DRIVE_VIRTUAL |
1735 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) {
1736 hObjectofObject = WinQueryObject(wk->li->list[x]);
1737 error = WinMoveObject(hObjectofObject, hObjectdest, 0);
1738 }
1739 else {
1740 error = DosDelete(wk->li->list[x]);
1741 }
1742 }
1743 else {
1744 error = DosForceDelete(wk->li->list[x]);
1745 }
1746 }
1747 DosReleaseMutexSem(hmtxFM2Delete);
1748 }
1749 if (error) {
1750 if (LogFileHandle)
1751 fprintf(LogFileHandle,
1752 GetPString(IDS_DELETEFAILED1TEXT),
1753 wk->li->list[x], error);
1754 if (Dos_Error(MB_ENTERCANCEL,
1755 error,
1756 wk->hwndFrame,
1757 pszSrcFile,
1758 __LINE__,
1759 GetPString(IDS_DELETEFAILED2TEXT),
1760 wk->li->list[x]) == MBID_CANCEL) {
1761 DosSetVerify(fVerify);
1762 break;
1763 }
1764 }
1765 else {
1766 if (LogFileHandle)
1767 fprintf(LogFileHandle,
1768 GetPString(IDS_DELETEDTEXT), wk->li->list[x]);
1769 sprintf(prompt,
1770 GetPString(IDS_DELETEDTEXT), wk->li->list[x]);
1771 AddNote(prompt);
1772 }
1773 if (//fSyncUpdates ||
1774 AddToList(wk->li->list[x], &files, &numfiles, &numalloc)) {
1775 Broadcast(hab2,
1776 wk->hwndCnr,
1777 UM_UPDATERECORD,
1778 MPFROMP(wk->li->list[x]), MPVOID);
1779 }
1780 } // for
1781 }
1782 if (fVerify)
1783 DosSetVerify(fVerify);
1784 break;
1785 } // switch
1786 if (files) {
1787 Broadcast(hab2,
1788 wk->hwndCnr,
1789 UM_UPDATERECORDLIST, MPFROMP(files), MPVOID);
1790 FreeList(files);
1791 }
1792 if (WinIsWindow(hab2, wk->hwndCnr))
1793 PostMsg(wk->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
1794
1795 WinDestroyMsgQueue(hmq2);
1796 }
1797 DecrThreadUsage();
1798 WinTerminate(hab2);
1799 }
1800 }
1801 FreeListInfo(wk->li);
1802 free(wk);
1803# ifdef FORTIFY
1804 Fortify_LeaveScope();
1805# endif
1806 DosPostEventSem(CompactSem);
1807 }
1808}
1809
1810// We can use static buffer for all in progress actions because we have only 1 status line
1811static WORKER *pCachedActionWorker; // Sent from Action thread via UM_ACTIONSTATE
1812static PSZ pszCachedActionListItem; // Sent from Action thread via UM_ACTIONSTATE
1813
1814MRESULT EXPENTRY ActionWMTimer(HWND hwnd, MPARAM mp1, MPARAM mp2)
1815{
1816 if (pCachedActionWorker != NULL && pszCachedActionListItem != NULL) {
1817 DbgMsg(pszSrcFile, __LINE__, "Using hWndStatus %lx pCachedActionWorker %p pszCachedActionListItem %s", hwndStatus, pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug
1818 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd) {
1819 CHAR s[CCHMAXPATH + 64];
1820 sprintf(s, "%s %s",
1821 pCachedActionWorker->li->type == IDM_MOVE ?
1822 GetPString(IDS_MOVINGTEXT) :
1823 GetPString(IDS_COPYINGTEXT),
1824 pszCachedActionListItem);
1825 // sprintf(s, "Moving/copying %s", pszCachedActionListItem); // 14 Jul 09 SHL fixme
1826 WinSetWindowText(hwndStatus, s);
1827 }
1828 }
1829 return 0;
1830}
1831
1832MRESULT EXPENTRY ActionUMWorkerState(HWND hwnd, MPARAM mp1, MPARAM mp2) {
1833 pCachedActionWorker = PVOIDFROMMP(mp1);
1834 pszCachedActionListItem = PVOIDFROMMP(mp2);
1835 DbgMsg(pszSrcFile, __LINE__, "Setting pCachedActionWorker %p pszCachedActionListItem %s", pCachedActionWorker, pszCachedActionListItem); // 13 Jul 09 SHL fixme debug
1836 if (hwndStatus && WinQueryFocus(HWND_DESKTOP) == hwnd)
1837 WinPostMsg(hwnd, WM_SETFOCUS, MPFROMLONG(hwnd), MPFROMLONG(TRUE)); // 14 Jul 09 SHL Force status line update
1838 return 0;
1839}
1840
1841#pragma alloc_text(MASSACTION,MassAction)
1842#pragma alloc_text(ACTION,Action)
1843#pragma alloc_text(UNDO,FreeUndo,Undo)
Note: See TracBrowser for help on using the repository browser.