source: trunk/dll/remap.c@ 907

Last change on this file since 907 was 907, checked in by Steven Levine, 18 years ago

Avoid out of memory traps in Compare Directories
Rework Compare Directories progress display for 2 second update rate
Start refactoring to reduce dependence on fm3dll.h
Add timer services (IsITimerExpired etc.)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.7 KB
Line 
1
2/***********************************************************************
3
4 $Id: remap.c 907 2008-01-06 07:26:17Z stevenhl $
5
6 Copyright (c) 1993, 1998 M. Kimes
7 Copyright (c) 2004, 2006 Steven H.Levine
8
9 01 Aug 04 SHL Rework lstrip/rstrip usage
10 06 Aug 05 SHL Renames
11 22 Jul 06 SHL Check more run time errors
12 29 Jul 06 SHL Use xfgets
13 31 Aug 06 SHL Use _fsopen to avoid noise complaints
14 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
15
16***********************************************************************/
17
18#include <stdlib.h>
19#include <string.h>
20#include <share.h>
21#include <io.h> // unlink
22
23#define INCL_DOS
24#define INCL_WIN
25#define INCL_LONGLONG // dircnrs.h
26
27#include "fm3dlg.h"
28#include "fm3str.h"
29#include "errutil.h" // Dos_Error...
30#include "strutil.h" // GetPString
31#include "fm3dll.h"
32
33#pragma data_seg(DATA1)
34
35static PSZ pszSrcFile = __FILE__;
36
37typedef struct APPNOTIFY
38{
39 HAPP happ;
40 BOOL attach;
41 BOOL failedonce;
42 CHAR uncname[CCHMAXPATH];
43 CHAR device;
44 struct APPNOTIFY *next;
45 struct APPNOTIFY *prev;
46}
47APPNOTIFY;
48
49typedef struct LINKRES
50{
51 CHAR *res;
52 struct LINKRES *next;
53}
54LINKRES;
55
56static LINKRES *reshead = NULL;
57static BOOL loadedres = FALSE;
58
59#define MAXNUMRES 200
60
61VOID load_resources(VOID)
62{
63 /* load linked list of resources from RESOURCE.DAT file */
64
65 FILE *fp;
66 LINKRES *info, *last = NULL;
67 CHAR s[CCHMAXPATH + 14];
68 INT x = 0;
69
70 loadedres = TRUE;
71 save_dir2(s);
72 if (s[strlen(s) - 1] != '\\')
73 strcat(s, "\\");
74 strcat(s, "RESOURCE.DAT");
75 fp = _fsopen(s, "r", SH_DENYWR);
76 if (fp) {
77 while (x < MAXNUMRES && !feof(fp)) {
78 if (!xfgets_bstripcr(s, sizeof(s), fp, pszSrcFile, __LINE__))
79 break;
80 if (*s && *s != ';') {
81 info = xmalloc(sizeof(LINKRES), pszSrcFile, __LINE__);
82 if (info) {
83 info->res = xstrdup(s, pszSrcFile, __LINE__);
84 if (!info->res)
85 free(info);
86 else {
87 x++;
88 info->next = NULL;
89 if (!reshead)
90 reshead = info;
91 else
92 last->next = info;
93 last = info;
94 }
95 }
96 }
97 }
98 fclose(fp);
99 }
100}
101
102VOID save_resources(VOID)
103{
104 /* save linked list of resources to RESOURCE.DAT file */
105
106 LINKRES *info;
107 FILE *fp;
108 CHAR s[CCHMAXPATH + 14];
109
110 if (!loadedres)
111 return;
112 save_dir2(s);
113 if (s[strlen(s) - 1] != '\\')
114 strcat(s, "\\");
115 strcat(s, "RESOURCE.DAT");
116 if (reshead) {
117 fp = xfopen(s, "w", pszSrcFile, __LINE__);
118 if (fp) {
119 fputs(GetPString(IDS_REMOTEFILETEXT), fp);
120 info = reshead;
121 while (info) {
122 fprintf(fp, "%0.*s\n", CCHMAXPATH, info->res);
123 info = info->next;
124 }
125 fclose(fp);
126 }
127 }
128 else
129 unlink(s);
130}
131
132BOOL add_resource(CHAR * res)
133{
134 LINKRES *info, *last = NULL;
135 INT x = 0;
136
137 if (!res || !*res)
138 return FALSE;
139 if (!loadedres)
140 load_resources();
141 info = reshead;
142 while (info) {
143 if (!stricmp(info->res, res))
144 return FALSE;
145 last = info;
146 info = info->next;
147 x++;
148 }
149 info = xmalloc(sizeof(LINKRES), pszSrcFile, __LINE__);
150 if (info) {
151 info->res = xstrdup(res, pszSrcFile, __LINE__);
152 if (!info->res)
153 free(info);
154 else {
155 info->next = NULL;
156 if (!reshead)
157 reshead = info;
158 else
159 last->next = info;
160 if (x > MAXNUMRES) {
161 info = reshead;
162 reshead = reshead->next;
163 free(info);
164 }
165 return TRUE;
166 }
167 }
168 return FALSE;
169}
170
171BOOL remove_resource(CHAR * res)
172{
173 LINKRES *info, *last = NULL;
174
175 if (!res || !*res)
176 return FALSE;
177 if (!loadedres)
178 load_resources();
179 info = reshead;
180 while (info) {
181 if (!stricmp(info->res, res)) {
182 if (last)
183 last->next = info->next;
184 else
185 reshead = info->next;
186 free(info->res);
187 free(info);
188 return TRUE;
189 }
190 last = info;
191 info = info->next;
192 }
193 return FALSE;
194}
195
196VOID free_resources(VOID)
197{
198 LINKRES *info, *next;
199
200 info = reshead;
201 while (info) {
202 next = info->next;
203 free(info->res);
204 free(info);
205 info = next;
206 }
207 reshead = NULL;
208 DosPostEventSem(CompactSem);
209}
210
211MRESULT EXPENTRY RemapDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
212{
213 static BOOL fRemapped;
214 static APPNOTIFY *apphead = NULL, *apptail = NULL;
215
216 switch (msg) {
217 case WM_INITDLG:
218 WinSendDlgItemMsg(hwnd,
219 MAP_ATTACHTO,
220 EM_SETTEXTLIMIT, MPFROM2SHORT(CCHMAXPATH, 0), MPVOID);
221 fRemapped = FALSE;
222 if (!loadedres)
223 load_resources();
224 {
225 LINKRES *info;
226
227 info = reshead;
228 while (info) {
229 WinSendDlgItemMsg(hwnd,
230 MAP_ATTACHTO,
231 LM_INSERTITEM,
232 MPFROM2SHORT(LIT_END, 0), MPFROMP(info->res));
233 info = info->next;
234 }
235 }
236 {
237 ULONG ulDriveMap, ulDriveNum, x, ulType;
238 CHAR s[3] = " :";
239
240 DosError(FERR_DISABLEHARDERR);
241 if (!DosQCurDisk(&ulDriveNum, &ulDriveMap)) {
242 for (x = 0; x < 26; x++) {
243 if (!(driveflags[x] & DRIVE_IGNORE)) {
244 *s = (CHAR) x + 'A';
245 if (!(ulDriveMap & (1 << x)))
246 WinSendDlgItemMsg(hwnd,
247 MAP_ATTACHLIST,
248 LM_INSERTITEM,
249 MPFROM2SHORT(LIT_END, 0), MPFROMP(s));
250 else {
251 CheckDrive((CHAR) x + 'A', NULL, &ulType);
252 if (ulType & DRIVE_REMOTE)
253 WinSendDlgItemMsg(hwnd,
254 MAP_DETACHLIST,
255 LM_INSERTITEM,
256 MPFROM2SHORT(LIT_END, 0), MPFROMP(s));
257 }
258 }
259 }
260 }
261 else
262 WinDismissDlg(hwnd, 0);
263 }
264 break;
265
266 case WM_CONTROL:
267 switch (SHORT1FROMMP(mp1)) {
268 case MAP_ATTACHLIST:
269 switch (SHORT2FROMMP(mp1)) {
270 case LN_ENTER:
271 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(MAP_ATTACH, 0), MPVOID);
272 break;
273 }
274 break;
275 case MAP_DETACHLIST:
276 switch (SHORT2FROMMP(mp1)) {
277 case LN_ENTER:
278 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(MAP_DETACH, 0), MPVOID);
279 break;
280 case LN_SELECT:
281 {
282 SHORT x;
283 CHAR d[3];
284
285 WinSetDlgItemText(hwnd, MAP_ATTACHTO, NullStr);
286 x = (SHORT) WinSendDlgItemMsg(hwnd,
287 MAP_DETACHLIST,
288 LM_QUERYSELECTION,
289 MPFROMSHORT(LIT_FIRST), MPVOID);
290 if (x >= 0) {
291 *d = 0;
292 WinSendDlgItemMsg(hwnd,
293 MAP_DETACHLIST,
294 LM_QUERYITEMTEXT,
295 MPFROM2SHORT(x, sizeof(d)), MPFROMP(d));
296 if (*d) {
297
298 CHAR buf[2048];
299 ULONG len;
300 APIRET rc;
301 FSQBUFFER2 *p2;
302
303 memset(buf, 0, sizeof(buf));
304 len = sizeof(buf);
305 p2 = (FSQBUFFER2 *) buf;
306 DosError(FERR_DISABLEHARDERR);
307 rc = DosQueryFSAttach(d, 0, FSAIL_QUERYNAME, p2, &len);
308 if (!rc) {
309
310 CHAR *p;
311
312 p = (char *)p2->szName;
313 p += p2->cbName + 1;
314 p += p2->cbFSDName + 1;
315 if (p2->cbFSAData)
316 WinSetDlgItemText(hwnd, MAP_ATTACHTO, p);
317 else
318 WinSetDlgItemText(hwnd,
319 MAP_ATTACHTO,
320 GetPString(IDS_UNKNOWNBRKTTEXT));
321 }
322 else
323 WinSetDlgItemText(hwnd,
324 MAP_ATTACHTO,
325 GetPString(IDS_UNKNOWNBRKTTEXT));
326 }
327 }
328 }
329 break;
330 }
331 break;
332 }
333 break;
334
335 case WM_APPTERMINATENOTIFY:
336 {
337 APPNOTIFY *info;
338 SHORT x, c;
339 CHAR d[3];
340 HWND hwndList;
341
342 if (!mp2)
343 fRemapped = TRUE;
344 info = apphead;
345 GetRidOfIt:
346 while (info) {
347 if (info->happ == (HAPP) mp1) {
348/* Note: if this next line is removed, FM/2 will start the attach/detach
349 * request again, once for each request, to see if it might succeed and to
350 * ensure the request is seen by the user in case interaction is required.
351 */
352 info->failedonce = TRUE;
353 hwndList = WinWindowFromID(hwnd,
354 (info->attach) ?
355 MAP_ATTACHLIST : MAP_DETACHLIST);
356 if (!mp2 || (ULONG) mp2 == 1041 || info->failedonce) {
357 if (info->prev)
358 info->prev->next = info->next;
359 if (info->next)
360 info->next->prev = info->prev;
361 if (apphead == info)
362 apphead = info->next;
363 if (apptail == info)
364 apptail = info->prev;
365 }
366 if (!mp2) {
367 if (*info->uncname &&
368 stricmp(info->uncname, GetPString(IDS_UNKNOWNBRKTTEXT)) &&
369 add_resource(info->uncname)) {
370 save_resources();
371 WinSendDlgItemMsg(hwnd,
372 MAP_ATTACHTO,
373 LM_INSERTITEM,
374 MPFROM2SHORT(LIT_END, 0),
375 MPFROMP(info->uncname));
376 }
377 c = (SHORT) WinSendMsg(hwndList,
378 LM_QUERYITEMCOUNT, MPVOID, MPVOID);
379 if (c > 0) {
380 for (x = 0; x < c; x++) {
381 *d = 0;
382 WinSendMsg(hwndList,
383 LM_QUERYITEMTEXT,
384 MPFROM2SHORT(x, sizeof(d)), MPFROMP(d));
385 if (*d == info->device) {
386 WinSendMsg(hwndList, LM_DELETEITEM, MPFROMSHORT(x), MPVOID);
387 hwndList = WinWindowFromID(hwnd,
388 (info->attach) ?
389 MAP_DETACHLIST : MAP_ATTACHLIST);
390 d[1] = ':';
391 d[2] = 0;
392 WinSendMsg(hwndList,
393 LM_INSERTITEM,
394 MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(d));
395 break;
396 }
397 }
398 }
399 }
400 else if ((ULONG) mp2 != 1041 && !info->failedonce) {
401
402 PROGDETAILS pgd;
403 CHAR params[368], *p;
404 HAPP happ;
405
406 *d = info->device;
407 d[1] = ':';
408 d[2] = 0;
409 p = GetCmdSpec(FALSE);
410 memset(&pgd, 0, sizeof(pgd));
411 pgd.Length = sizeof(pgd);
412 pgd.progt.progc = PROG_WINDOWABLEVIO;
413 pgd.progt.fbVisible = SHE_VISIBLE;
414 pgd.pszTitle = (info->attach) ? GetPString(IDS_ATTACHREQTEXT) :
415 GetPString(IDS_DETACHREQTEXT);
416 pgd.pszExecutable = p;
417 pgd.pszParameters = params;
418 pgd.pszStartupDir = NULL;
419 pgd.pszIcon = NULL;
420 pgd.pszEnvironment = NULL;
421 pgd.swpInitial.hwndInsertBehind = HWND_TOP;
422 pgd.swpInitial.hwnd = hwnd;
423 pgd.swpInitial.fl = SWP_SHOW | SWP_ACTIVATE;
424 if (info->attach)
425 sprintf(params, "/C NET USE %s \"%s\"", d, info->uncname);
426 else
427 sprintf(params, "/C NET USE %s /D", d);
428 info->failedonce = TRUE;
429 happ = WinStartApp(hwnd, &pgd, pgd.pszParameters,
430 NULL, SAF_MAXIMIZED);
431 if (!happ)
432 goto GetRidOfIt;
433 info->happ = happ;
434 break;
435 }
436 else if ((ULONG) mp2 == 1041)
437 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, hwnd,
438 GetPString(IDS_ERRORTEXT),
439 "%s", GetPString(IDS_CANTSTARTNETUSETEXT));
440 if (!mp2 || (ULONG) mp2 == 1041 || info->failedonce)
441 free(info);
442 break;
443 }
444 info = info->next;
445 }
446 }
447 break;
448
449 case WM_COMMAND:
450 switch (SHORT1FROMMP(mp1)) {
451 case MAP_DELETE:
452 {
453 SHORT x;
454 CHAR resource[CCHMAXPATH];
455
456 x = (SHORT) WinSendDlgItemMsg(hwnd,
457 MAP_ATTACHTO,
458 LM_QUERYSELECTION,
459 MPFROMSHORT(LIT_FIRST), MPVOID);
460 if (x >= 0) {
461 *resource = 0;
462 WinSendDlgItemMsg(hwnd,
463 MAP_ATTACHTO,
464 LM_QUERYITEMTEXT,
465 MPFROM2SHORT(x, sizeof(resource)),
466 MPFROMP(resource));
467 bstrip(resource);
468 if (*resource) {
469 if (remove_resource(resource)) {
470 save_resources();
471 WinSendDlgItemMsg(hwnd,
472 MAP_ATTACHTO,
473 LM_DELETEITEM, MPFROMSHORT(x), MPVOID);
474 if (x)
475 x--;
476 WinSendDlgItemMsg(hwnd,
477 MAP_ATTACHTO,
478 LM_SELECTITEM,
479 MPFROMSHORT(x), MPFROMSHORT(TRUE));
480 if (!(SHORT) WinSendDlgItemMsg(hwnd,
481 MAP_ATTACHTO,
482 LM_QUERYITEMCOUNT,
483 MPVOID, MPVOID))
484 WinSetDlgItemText(hwnd, MAP_ATTACHTO, NullStr);
485 }
486 }
487 }
488 }
489 break;
490
491 case MAP_CLEAR:
492 free_resources();
493 save_resources();
494 WinSendDlgItemMsg(hwnd, MAP_ATTACHTO, LM_DELETEALL, MPVOID, MPVOID);
495 WinSetDlgItemText(hwnd, MAP_ATTACHTO, NullStr);
496 break;
497
498 case MAP_INFO:
499 case MAP_DETACH:
500 {
501 CHAR d[3], s[CCHMAXPATH];
502 SHORT x;
503
504 *s = 0;
505 WinQueryDlgItemText(hwnd, MAP_ATTACHTO, sizeof(s), s);
506 bstrip(s);
507 x = (SHORT) WinSendDlgItemMsg(hwnd,
508 MAP_DETACHLIST,
509 LM_QUERYSELECTION,
510 MPFROMSHORT(LIT_FIRST), MPVOID);
511 if (x >= 0) {
512 *d = 0;
513 WinSendDlgItemMsg(hwnd,
514 MAP_DETACHLIST,
515 LM_QUERYITEMTEXT,
516 MPFROM2SHORT(x, sizeof(d)), MPFROMP(d));
517 if (*d) {
518 switch (SHORT1FROMMP(mp1)) {
519 case MAP_DETACH:
520 {
521 PROGDETAILS pgd;
522 CHAR params[368], *p;
523 HAPP happ;
524
525 p = GetCmdSpec(FALSE);
526 memset(&pgd, 0, sizeof(pgd));
527 pgd.Length = sizeof(pgd);
528 pgd.progt.progc = PROG_WINDOWABLEVIO;
529 pgd.progt.fbVisible = SHE_VISIBLE;
530 pgd.pszTitle = GetPString(IDS_DETACHREQTEXT);
531 pgd.pszExecutable = p;
532 pgd.pszParameters = params;
533 pgd.pszStartupDir = NULL;
534 pgd.pszIcon = NULL;
535 pgd.pszEnvironment = NULL;
536 pgd.swpInitial.hwndInsertBehind = HWND_TOP;
537 pgd.swpInitial.hwnd = hwnd;
538 pgd.swpInitial.fl = SWP_SHOW | SWP_ACTIVATE;
539 sprintf(params, "/C NET USE %s /D", d);
540 happ = WinStartApp(hwnd,
541 &pgd,
542 pgd.pszParameters, NULL, SAF_MAXIMIZED);
543 if (happ) {
544
545 APPNOTIFY *info;
546
547 WinSetDlgItemText(hwnd, MAP_ATTACHTO, NullStr);
548 info = xmallocz(sizeof(APPNOTIFY), pszSrcFile, __LINE__);
549 if (info) {
550 info->happ = happ;
551 info->attach = FALSE;
552 info->failedonce = FALSE;
553 strcpy(info->uncname, s);
554 info->device = *d;
555 if (!apphead)
556 apphead = info;
557 else {
558 apptail->next = info;
559 info->prev = apptail;
560 }
561 apptail = info;
562 }
563 }
564 else
565 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
566 hwnd,
567 GetPString(IDS_ERRORTEXT),
568 GetPString(IDS_CANTSTARTTEXT), p, params);
569 }
570#ifdef NEVER // fixme to be gone?
571 DosError(FERR_DISABLEHARDERR);
572 rc = DosFSAttach(d, s, d, strlen(d) + 1, FS_DETACH);
573 if (rc) {
574 Dos_Error(MB_CANCEL,
575 rc,
576 hwnd,
577 pszSrcFile,
578 __LINE__, GetPString(IDS_DETACHFAILEDTEXT), d, s);
579 }
580 else {
581 fRemapped = TRUE;
582 WinSendDlgItemMsg(hwnd,
583 MAP_DETACHLIST,
584 LM_DELETEITEM, MPFROMSHORT(x), MPVOID);
585 WinSendDlgItemMsg(hwnd,
586 MAP_ATTACHLIST,
587 LM_INSERTITEM,
588 MPFROM2SHORT(LIT_SORTASCENDING, 0),
589 MPFROMP(d));
590 }
591#endif // fixme to be gone?
592 break;
593
594 case MAP_INFO:
595 runemf2(SEPARATEKEEP | WINDOWED | MAXIMIZED,
596 hwnd, pszSrcFile, __LINE__,
597 NULL, NULL, "%s /C NET USE %s", GetCmdSpec(FALSE), d);
598 break;
599 }
600 }
601 }
602 }
603 break;
604
605 case MAP_ATTACH:
606 {
607 CHAR d[3], s[CCHMAXPATH];
608 SHORT x;
609
610 *s = 0;
611 WinQueryDlgItemText(hwnd, MAP_ATTACHTO, sizeof(s), s);
612 bstrip(s);
613 if (*s) {
614 x = (SHORT) WinSendDlgItemMsg(hwnd,
615 MAP_ATTACHLIST,
616 LM_QUERYSELECTION,
617 MPFROMSHORT(LIT_FIRST), MPVOID);
618 if (x >= 0) {
619 *d = 0;
620 WinSendDlgItemMsg(hwnd,
621 MAP_ATTACHLIST,
622 LM_QUERYITEMTEXT,
623 MPFROM2SHORT(x, sizeof(d)), MPFROMP(d));
624 if (*d) {
625
626 PROGDETAILS pgd;
627 CHAR params[368], *p;
628 HAPP happ;
629
630 p = GetCmdSpec(FALSE);
631 memset(&pgd, 0, sizeof(pgd));
632 pgd.Length = sizeof(pgd);
633 pgd.progt.progc = PROG_WINDOWABLEVIO;
634 pgd.progt.fbVisible = SHE_VISIBLE;
635 pgd.pszTitle = GetPString(IDS_ATTACHREQTEXT);
636 pgd.pszExecutable = p;
637 pgd.pszParameters = params;
638 pgd.pszStartupDir = NULL;
639 pgd.pszIcon = NULL;
640 pgd.pszEnvironment = NULL;
641 pgd.swpInitial.hwndInsertBehind = HWND_TOP;
642 pgd.swpInitial.hwnd = hwnd;
643 pgd.swpInitial.fl = SWP_SHOW | SWP_ACTIVATE;
644 sprintf(params, "/C NET USE %s \"%s\"", d, s);
645 happ = WinStartApp(hwnd,
646 &pgd,
647 pgd.pszParameters, NULL, SAF_MAXIMIZED);
648 if (happ) {
649
650 APPNOTIFY *info;
651
652 info = xmallocz(sizeof(APPNOTIFY), pszSrcFile, __LINE__);
653 if (info) {
654 info->happ = happ;
655 info->attach = TRUE;
656 info->failedonce = FALSE;
657 strcpy(info->uncname, s);
658 info->device = *d;
659 if (!apphead)
660 apphead = info;
661 else {
662 apptail->next = info;
663 info->prev = apptail;
664 }
665 apptail = info;
666 }
667 }
668 else
669 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
670 hwnd,
671 GetPString(IDS_ERRORTEXT),
672 GetPString(IDS_CANTSTARTTEXT), p, params);
673#ifdef NEVER // fixme to be gone?
674 DosError(FERR_DISABLEHARDERR);
675 rc = DosFSAttach(d, s, s, strlen(s) + 1, FS_ATTACH);
676 if (rc) {
677 Dos_Error(MB_CANCEL,
678 rc,
679 hwnd,
680 pszSrcFile,
681 __LINE__, GetPString(IDS_ATTACHFAILEDTEXT), s, d);
682 }
683 else {
684 fRemapped = TRUE;
685 WinSendDlgItemMsg(hwnd,
686 MAP_ATTACHLIST,
687 LM_DELETEITEM, MPFROMSHORT(x), MPVOID);
688 WinSendDlgItemMsg(hwnd,
689 MAP_DETACHLIST,
690 LM_INSERTITEM,
691 MPFROM2SHORT(LIT_SORTASCENDING, 0),
692 MPFROMP(d));
693 }
694#endif // fixme to be gone?
695 }
696 }
697 }
698 }
699 break;
700
701 case IDM_HELP:
702 if (hwndHelp)
703 WinSendMsg(hwndHelp,
704 HM_DISPLAY_HELP,
705 MPFROM2SHORT(HELP_REMAP, 0), MPFROMSHORT(HM_RESOURCEID));
706 break;
707
708 case DID_CANCEL:
709 if (fRemapped) {
710 if (hwndTree)
711 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
712 else
713 FillInDriveFlags(NULL);
714 if (hwndMain)
715 PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID);
716 }
717 WinDismissDlg(hwnd, 0);
718 break;
719 }
720 return 0;
721
722 case WM_DESTROY:
723 if (apphead) {
724
725 APPNOTIFY *info, *next;
726
727 info = apphead;
728 while (info) {
729 next = info->next;
730 free(info);
731 info = next;
732 }
733 apphead = apptail = NULL;
734 saymsg(MB_YESNOCANCEL,
735 HWND_DESKTOP,
736 GetPString(IDS_NOTICETITLETEXT),
737 "%s", GetPString(IDS_REMAPNOTICETEXT));
738 }
739 free_resources();
740 loadedres = FALSE;
741 break;
742 }
743 return WinDefDlgProc(hwnd, msg, mp1, mp2);
744}
745
746#pragma alloc_text(FMREMAP,RemapDlgProc,load_resources,save_resources)
747#pragma alloc_text(FMREMAP,add_resource,remove_resource,free_resources)
Note: See TracBrowser for help on using the repository browser.