source: trunk/dll/init.c@ 998

Last change on this file since 998 was 998, checked in by John Small, 17 years ago

Added comments and removed dead code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 48.2 KB
Line 
1
2/***********************************************************************
3
4 $Id: init.c 998 2008-03-09 04:30:28Z jbs $
5
6 Initialization
7
8 Copyright (c) 1993-98 M. Kimes
9 Copyright (c) 2001, 2008 Steven H. Levine
10
11 11 Jun 02 SHL Add CheckVersion
12 11 Jun 03 SHL Add JFS and FAT32 support
13 25 Nov 03 SHL InitFM3DLL: correct strings error mesage
14 23 May 05 SHL Use datamin.h
15 26 May 05 SHL Comments
16 06 Jun 05 SHL indent -i2
17 06 Jun 05 SHL Rework FindSwapperDat for VAC3.65 compat
18 13 Jul 06 SHL Use Runtime_Error
19 13 Jul 06 SHL Sync with current style
20 29 Jul 06 SHL Use xfgets
21 22 Oct 06 GKY Add NDFS32 support
22 18 Feb 07 GKY Add ISOFS, RAMFS support
23 30 Mar 07 GKY Defined golbals for removing GetPString for window class names
24 21 Apr 07 GKY Find FM2Utils by path or utils directory eleminate fAddUtils global
25 15 Jun 07 SHL Make OpenWatcom compatible
26 23 Jun 07 GKY Fix WORPLACE_PROCESS enviroment check logic
27 28 Jun 07 SHL Rework WORKPLACE_PROCESS check to match reality
28 03 Aug 07 GKY Enlarged and made setable everywhere Findbuf (speed file loading)
29 06 Aug 07 GKY Reduce DosSleep times (ticket 148)
30 13 Aug 07 SHL Move #pragma alloc_text to end for OpenWatcom compat
31 18 Aug 07 JBS Added code to read Details* keys from the INI file (Ticket 118)
32 19 Aug 07 SHL Ensure FilesToGet in valid range
33 21 Aug 07 GKY Make Subject column in dircnr sizable and movable from the rigth to the left pane
34 23 Aug 07 SHL InitFM3DLL: report INI file DosSetPathInfo error correctly
35 23 Aug 07 SHL Use BldFullPathName
36 25 Aug 07 SHL Work around DosSetPathInfo kernel defect
37 01 Sep 07 GKY Use xDosSetPathInfo to fix case where FS3 buffer crosses 64k boundry
38 10 Nov 07 GKY Get thousands separator from country info for file sizes.
39 26 Nov 07 GKY Eliminate check of ext path on start up
40 17 Dec 07 GKY Make WPURLDEFAULTSETTINGS the fall back for ftp/httprun
41 13 Jan 08 GKY Get Subjectwidth/Subjectleft working in the collector.
42 12 Feb 08 SHL Compile OpenWatcom version into binary
43 29 Feb 08 GKY Changes to enable user settable command line length
44 29 Feb 08 GKY Refactor global command line variables to notebook.h
45 08 Mar 08 JBS Ticket 230: Replace prefixless INI keys for default directory containers with
46 keys using a "DirCnr." prefix
47
48***********************************************************************/
49
50#include <stdlib.h>
51#include <string.h>
52#include <share.h>
53#include <process.h>
54
55#define INCL_DOS
56#define INCL_WIN
57#define INCL_MMIOOS2
58#define INCL_GPI
59#define INCL_DOSERRORS
60#define INCL_LONGLONG
61#define INCL_DOSNLS
62#include <os2.h>
63#include <os2me.h>
64
65#define DEFINE_GLOBALS 1
66
67#include "fm3dlg.h"
68#include "datamin.h"
69#include "tools.h"
70#include "fm3str.h"
71#include "version.h"
72#include "pathutil.h" // BldFullPathName
73#include "arccnrs.h" // ArcClientWndProc
74#include "errutil.h" // Dos_Error...
75#include "strutil.h" // GetPString
76#include "fm3dll.h"
77#include "notebook.h" // command line variables (editor etc)
78
79#ifdef __IBMC__
80#pragma alloc_text(INIT,LibMain,InitFM3DLL,DeInitFM3DLL)
81#pragma alloc_text(INIT1,StartFM3,FindSwapperDat)
82#endif
83
84extern int _CRT_init(void);
85extern void _CRT_term(void);
86
87#ifdef __WATCOMC__
88#define a(x) #x
89#define b(x) a(x)
90// Must be global to prevent warnings
91PSZ pszBuiltWith = "Built with OpenWatcom version " b(__WATCOMC__);
92#undef b
93#undef a
94#endif
95
96static PSZ pszSrcFile = __FILE__;
97
98BOOL CheckFileHeader(CHAR *filespec, CHAR *signature, LONG offset);
99
100VOID FindSwapperDat(VOID)
101{
102 CHAR filename[] = "C:\\CONFIG.SYS";
103 CHAR input[8192];
104 CHAR *p;
105 CHAR *pp;
106 FILE *fp;
107 FILEFINDBUF3L ffb;
108 ULONG nm;
109 ULONG size = sizeof(SwapperDat);
110 HDIR hdir = HDIR_CREATE;
111 APIRET rc = 1;
112
113 *SwapperDat = 0;
114 // Check already known
115 PrfQueryProfileData(fmprof, FM3Str, "SwapperDat", SwapperDat, &size);
116 if (*SwapperDat) {
117 nm = 1;
118 rc = DosFindFirst(SwapperDat,
119 &hdir,
120 FILE_NORMAL | FILE_ARCHIVED |
121 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
122 &ffb, sizeof(ffb), &nm, FIL_STANDARDL);
123 if (rc && rc != ERROR_FILE_NOT_FOUND && rc != ERROR_PATH_NOT_FOUND) {
124 FILEFINDBUF3 ffb;
125 rc = DosFindFirst(SwapperDat,
126 &hdir,
127 FILE_NORMAL | FILE_ARCHIVED |
128 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
129 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
130 fNoLargeFileSupport = TRUE;
131 }
132 if (!rc) {
133 DosFindClose(hdir);
134 fp = fopen(SwapperDat, "r");
135 if (fp) {
136 fclose(fp);
137 *SwapperDat = 0;
138 rc = 1; // Force config.sys scan
139 }
140 }
141 else
142 *SwapperDat = 0;
143 }
144 // If not defined in INI or INI wrong, scan config.sys for SWAPPATH statement
145 if (rc) {
146 if (DosQuerySysInfo(QSV_BOOT_DRIVE,
147 QSV_BOOT_DRIVE,
148 &nm,
149 sizeof(ULONG))) {
150 nm = 3; // Assume drive C:
151 }
152 *filename = (CHAR) nm + '@';
153 fp = xfsopen(filename, "r", SH_DENYNO, pszSrcFile, __LINE__);
154 if (fp) {
155 while (!feof(fp)) {
156 if (!xfgets(input, sizeof(input), fp, pszSrcFile, __LINE__))
157 break;
158 lstrip(input);
159 if (!strnicmp(input, "SWAPPATH", 8)) {
160 p = input + 8;
161 while (*p == ' ')
162 p++;
163 if (*p == '=') {
164 p++;
165 stripcr(p);
166 rstrip(p);
167 while (*p == ' ')
168 p++;
169 if (*p == '\"') {
170 p++;
171 pp = p;
172 while (*pp && *pp != '\"')
173 *pp += 1;
174 if (*pp)
175 *pp = 0;
176 }
177 else {
178 pp = strchr(p, ' ');
179 if (pp)
180 *pp = 0;
181 }
182 if (*p) {
183 strncpy(SwapperDat, p, CCHMAXPATH);
184 SwapperDat[CCHMAXPATH - 1] = 0;
185 BldFullPathName(SwapperDat, SwapperDat, "SWAPPER.DAT");
186 hdir = HDIR_CREATE;
187 nm = 1;
188 rc = DosFindFirst(SwapperDat,
189 &hdir,
190 FILE_NORMAL | FILE_ARCHIVED |
191 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
192 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
193 if (rc){
194 FILEFINDBUF3 ffb;
195 rc = DosFindFirst(SwapperDat,
196 &hdir,
197 FILE_NORMAL | FILE_ARCHIVED |
198 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
199 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
200 fNoLargeFileSupport = TRUE;
201 }
202 if (!rc) {
203 DosFindClose(hdir);
204 PrfWriteProfileString(fmprof,
205 FM3Str, "SwapperDat", SwapperDat);
206 }
207 else
208 *SwapperDat = 0;
209 break;
210 }
211 }
212 } // if SWAPPATH
213 } // while
214 fclose(fp);
215 }
216 }
217}
218
219#ifdef __WATCOMC__
220
221unsigned APIENTRY LibMain(unsigned hModule,
222 unsigned ulFlag)
223{
224 CHAR *env;
225 CHAR stringfile[CCHMAXPATH];
226 FILESTATUS3 fsa;
227 APIRET rc;
228
229 switch (ulFlag) {
230 case 0:
231 // 14 Jun 07 SHL Already done for us
232 // if (_CRT_init() == -1)
233 // return 0UL;
234 FM3DllHandle = hModule;
235 strcpy(stringfile, "FM3RES.STR");
236 env = getenv("FM3INI");
237 if (env) {
238 DosError(FERR_DISABLEHARDERR);
239 rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, sizeof(fsa));
240 if (!rc) {
241 if (fsa.attrFile & FILE_DIRECTORY) {
242 BldFullPathName(stringfile, env, "FM3RES.STR");
243 DosError(FERR_DISABLEHARDERR);
244 if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa)))
245 strcpy(stringfile, "FM3RES.STR");
246 }
247 }
248 }
249 LoadStrings(stringfile);
250
251 DosError(FERR_DISABLEHARDERR);
252 /* strings here to prevent multiple occurences in DLL */
253 FM2Str = "FM/2";
254 FM3Str = "FM/3";
255 NullStr = "";
256 Default = "DEFAULT";
257 Settings = "SETTINGS";
258 WPProgram = "WPProgram";
259 FM3Folder = "<FM3_Folder>";
260 FM3Tools = "<FM3_Tools>";
261 DRM_OS2FILE = "DRM_OS2FILE";
262 DRM_FM2ARCMEMBER = "DRM_FM2ARCMEMBER";
263 DRF_FM2ARCHIVE = "DRF_FM2ARCHIVE";
264 DRMDRFLIST = "<DRM_OS2FILE,DRF_UNKNOWN>,"
265 "<DRM_DISCARD,DRF_UNKNOWN>," "<DRM_PRINT,DRF_UNKNOWN>";
266 DRMDRFOS2FILE = "<DRM_OS2FILE,DRF_UNKNOWN>";
267 DRMDRFFM2ARC = "<DRM_FM2ARCMEMBER,DRF_FM2ARCHIVE>";
268 DRM_FM2INIRECORD = "DRM_FM2INIRECORD";
269 DRF_FM2INI = "DRF_FM2INI";
270 SUBJECT = ".SUBJECT";
271 LONGNAME = ".LONGNAME";
272 HPFS = "HPFS";
273 JFS = "JFS";
274 CDFS = "CDFS";
275 ISOFS = "ISOFS";
276 FAT32 = "FAT32";
277 HPFS386 = "HPFS386";
278 CBSIFS = "CBSIFS";
279 NDFS32 = "NDFS32";
280 RAMFS = "RAMFS";
281 NTFS = "NTFS";
282 WC_OBJECTWINDOW = "WC_OBJECTWINDOW";
283 WC_BUBBLE = "WC_BUBBLE";
284 WC_TOOLBUTTONS = "WC_TOOLBUTTONS";
285 WC_DRIVEBUTTONS = "WC_DRIVEBUTTONS";
286 WC_DIRCONTAINER = "WC_DIRCONTAINER";
287 WC_DIRSTATUS = "WC_DIRSTATUS";
288 WC_TREECONTAINER = "WC_TREECONTAINER";
289 WC_TREEOPENBUTTON = "WC_TREEOPENBUTTON";
290 WC_TREESTATUS = "WC_TREESTATUS";
291 WC_MAINWND = "WC_MAINWND";
292 WC_MAINWND2 = "WC_MAINWND2";
293 WC_AUTOVIEW = "WC_AUTOVIEW";
294 WC_LED = "WC_LED";
295 WC_COLLECTOR = "WC_COLLECTOR";
296 WC_COLSTATUS = "WC_COLSTATUS";
297 WC_STATUS = "WC_STATUS";
298 WC_TOOLBACK = "WC_TOOLBACK";
299 WC_DRIVEBACK = "WC_DRIVEBACK";
300 WC_ARCCONTAINER = "WC_ARCCONTAINER";
301 WC_ARCSTATUS = "WC_ARCSTATUS";
302 WC_MLEEDITOR = "WC_MLEEDITOR";
303 WC_INIEDITOR = "WC_INIEDITOR";
304 WC_SEEALL = "WC_SEEALL";
305 WC_NEWVIEW = "WC_NEWVIEW";
306 WC_SEESTATUS = "WC_SEESTATUS";
307 WC_VIEWSTATUS = "WC_VIEWSTATUS";
308 WC_ERRORWND = "WC_ERRORWND";
309 WC_MINITIME = "WC_MINITIME";
310 WC_DATABAR = "WC_DATABAR";
311
312 /* end of strings */
313 memset(&RGBBLACK, 0, sizeof(RGB2));
314 RGBGREY.bRed = RGBGREY.bGreen = RGBGREY.bBlue = (BYTE)204;
315 RGBGREY.fcOptions = 0;
316 FM3UL = *(ULONG *)FM3Str;
317 DEBUG_STRING = "Debug -- please report to author";
318 break;
319 case 1:
320 StopPrinting = 1;
321 if (fmprof)
322 PrfCloseProfile(fmprof);
323 DosError(FERR_ENABLEHARDERR);
324 // 14 Jun 07 SHL Already done for us
325 // _CRT_term();
326 break;
327 default:
328 return 0UL;
329 }
330 return 1UL;
331}
332
333#else // __IBMC__
334
335unsigned long _System _DLL_InitTerm(unsigned long hModule,
336 unsigned long ulFlag)
337{
338 CHAR *env;
339 CHAR stringfile[CCHMAXPATH];
340 FILESTATUS3 fsa;
341 APIRET rc;
342
343 switch (ulFlag) {
344 case 0:
345 if (_CRT_init() == -1)
346 return 0UL;
347 FM3DllHandle = hModule;
348 strcpy(stringfile, "FM3RES.STR");
349 env = getenv("FM3INI");
350 if (env) {
351 DosError(FERR_DISABLEHARDERR);
352 rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, sizeof(fsa));
353 if (!rc) {
354 if (fsa.attrFile & FILE_DIRECTORY) {
355 BldFullPathName(stringfile, env, "FM3RES.STR");
356 DosError(FERR_DISABLEHARDERR);
357 if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa)))
358 strcpy(stringfile, "FM3RES.STR");
359 }
360 }
361 }
362 LoadStrings(stringfile);
363
364 DosError(FERR_DISABLEHARDERR);
365 /* strings here to prevent multiple occurences in DLL */
366 FM2Str = "FM/2";
367 FM3Str = "FM/3";
368 NullStr = "";
369 Default = "DEFAULT";
370 Settings = "SETTINGS";
371 WPProgram = "WPProgram";
372 FM3Folder = "<FM3_Folder>";
373 FM3Tools = "<FM3_Tools>";
374 DRM_OS2FILE = "DRM_OS2FILE";
375 DRM_FM2ARCMEMBER = "DRM_FM2ARCMEMBER";
376 DRF_FM2ARCHIVE = "DRF_FM2ARCHIVE";
377 DRMDRFLIST = "<DRM_OS2FILE,DRF_UNKNOWN>,"
378 "<DRM_DISCARD,DRF_UNKNOWN>," "<DRM_PRINT,DRF_UNKNOWN>";
379 DRMDRFOS2FILE = "<DRM_OS2FILE,DRF_UNKNOWN>";
380 DRMDRFFM2ARC = "<DRM_FM2ARCMEMBER,DRF_FM2ARCHIVE>";
381 DRM_FM2INIRECORD = "DRM_FM2INIRECORD";
382 DRF_FM2INI = "DRF_FM2INI";
383 SUBJECT = ".SUBJECT";
384 LONGNAME = ".LONGNAME";
385 HPFS = "HPFS";
386 JFS = "JFS";
387 CDFS = "CDFS";
388 ISOFS = "ISOFS";
389 FAT32 = "FAT32";
390 HPFS386 = "HPFS386";
391 CBSIFS = "CBSIFS";
392 NDFS32 = "NDFS32";
393 RAMFS = "RAMFS";
394 NTFS = "NTFS";
395 WC_OBJECTWINDOW = "WC_OBJECTWINDOW";
396 WC_BUBBLE = "WC_BUBBLE";
397 WC_TOOLBUTTONS = "WC_TOOLBUTTONS";
398 WC_DRIVEBUTTONS = "WC_DRIVEBUTTONS";
399 WC_DIRCONTAINER = "WC_DIRCONTAINER";
400 WC_DIRSTATUS = "WC_DIRSTATUS";
401 WC_TREECONTAINER = "WC_TREECONTAINER";
402 WC_TREEOPENBUTTON = "WC_TREEOPENBUTTON";
403 WC_TREESTATUS = "WC_TREESTATUS";
404 WC_MAINWND = "WC_MAINWND";
405 WC_MAINWND2 = "WC_MAINWND2";
406 WC_AUTOVIEW = "WC_AUTOVIEW";
407 WC_LED = "WC_LED";
408 WC_COLLECTOR = "WC_COLLECTOR";
409 WC_COLSTATUS = "WC_COLSTATUS";
410 WC_STATUS = "WC_STATUS";
411 WC_TOOLBACK = "WC_TOOLBACK";
412 WC_DRIVEBACK = "WC_DRIVEBACK";
413 WC_ARCCONTAINER = "WC_ARCCONTAINER";
414 WC_ARCSTATUS = "WC_ARCSTATUS";
415 WC_MLEEDITOR = "WC_MLEEDITOR";
416 WC_INIEDITOR = "WC_INIEDITOR";
417 WC_SEEALL = "WC_SEEALL";
418 WC_NEWVIEW = "WC_NEWVIEW";
419 WC_SEESTATUS = "WC_SEESTATUS";
420 WC_VIEWSTATUS = "WC_VIEWSTATUS";
421 WC_ERRORWND = "WC_ERRORWND";
422 WC_MINITIME = "WC_MINITIME";
423 WC_DATABAR = "WC_DATABAR";
424
425 /* end of strings */
426 memset(&RGBBLACK, 0, sizeof(RGB2));
427 RGBGREY.bRed = RGBGREY.bGreen = RGBGREY.bBlue = (BYTE)204;
428 RGBGREY.fcOptions = 0;
429 FM3UL = *(ULONG *)FM3Str;
430 DEBUG_STRING = "Debug -- please report to author";
431 break;
432 case 1:
433 StopPrinting = 1;
434 if (fmprof)
435 PrfCloseProfile(fmprof);
436 DosError(FERR_ENABLEHARDERR);
437 _CRT_term();
438 break;
439 default:
440 return 0UL;
441 }
442 return 1UL;
443}
444
445#endif // __IBMC__
446
447VOID APIENTRY DeInitFM3DLL(ULONG why)
448{
449 /* cleanup */
450 static CHAR s[CCHMAXPATH];
451 CHAR *enddir;
452 HDIR search_handle;
453 ULONG num_matches;
454 FILEFINDBUF3 ffb;
455
456 StopTimer();
457 StopPrinting = 1;
458
459 if (LogFileHandle)
460 fclose(LogFileHandle);
461
462 if (fmprof) {
463 PrfCloseProfile(fmprof);
464 fmprof = (HINI) 0;
465 if (fIniExisted) {
466 DosError(FERR_DISABLEHARDERR);
467 DosCopy("FM3.INI", "FM3INI.BAK", DCPY_EXISTING);
468 }
469 }
470
471 if (fToolsChanged)
472 save_tools(NULL);
473
474# ifdef __IBMC__
475 _fcloseall();
476# else // __WATCOMC__
477 fcloseall();
478# endif
479
480 save_dir(s);
481 if (s[strlen(s) - 1] != '\\')
482 strcat(s, "\\");
483 enddir = &s[strlen(s)];
484 if (*ArcTempRoot) {
485 strcat(s, ArcTempRoot);
486 strcat(s, "*");
487 search_handle = HDIR_CREATE;
488 num_matches = 1L;
489 if (!DosFindFirst(s,
490 &search_handle,
491 FILE_NORMAL | FILE_DIRECTORY |
492 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
493 FILE_ARCHIVED,
494 &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) {
495 do {
496 strcpy(enddir, ffb.achName);
497 if (ffb.attrFile & FILE_DIRECTORY) {
498 wipeallf("%s\\*", s);
499 DosDeleteDir(s);
500 }
501 else
502 unlinkf("%s", s);
503 }
504 while (!DosFindNext(search_handle,
505 &ffb, sizeof(ffb), &num_matches));
506 DosFindClose(search_handle);
507 }
508 }
509
510 save_dir(s);
511 if (s[strlen(s) - 1] != '\\')
512 strcat(s, "\\");
513 enddir = &s[strlen(s)];
514 strcat(s, LISTTEMPROOT);
515 strcat(s, "???");
516 search_handle = HDIR_CREATE;
517 num_matches = 1;
518 if (!DosFindFirst(s,
519 &search_handle,
520 FILE_NORMAL | FILE_DIRECTORY |
521 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
522 FILE_ARCHIVED,
523 &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) {
524 do {
525 if (!(ffb.attrFile & FILE_DIRECTORY)) {
526 strcpy(enddir, ffb.achName);
527 unlinkf("%s", s);
528 }
529 }
530 while (!DosFindNext(search_handle,
531 &ffb, sizeof(ffb), &num_matches));
532 DosFindClose(search_handle);
533 }
534
535 DosForceDelete("$FM2PLAY.$$$");
536
537 EndNote();
538
539 if (FM3ModHandle)
540 DosFreeModule(FM3ModHandle);
541
542 DosExitList(EXLST_REMOVE, DeInitFM3DLL);
543}
544
545BOOL InitFM3DLL(HAB hab, int argc, char **argv)
546{
547 /*
548 * this function should be called by any application using this DLL right
549 * after setting up a message queue
550 */
551
552 CLASSINFO clinfo;
553 APIRET rc;
554 APIRET rcl = 1;
555 APIRET rcq = 1;
556 PFN pfnResVersion = (PFN)NULL;
557 ULONG RVMajor = 0;
558 ULONG RVMinor = 0;
559 ULONG ret = 0;
560 FILESTATUS3 fs3; // 25 Aug 07 SHL
561 PSZ env;
562 CHAR dllfile[CCHMAXPATH];
563 ULONG size;
564
565 if (!StringsLoaded()) {
566 saymsg(MB_ENTER,
567 HWND_DESKTOP,
568 "Error",
569 "FM3RES.STR isn't in right format, at least "
570 "for this version of FM/2.");
571 return FALSE;
572 }
573
574 strcpy(dllfile, "FM3RES");
575 env = getenv("FM3INI");
576 if (env) {
577 DosError(FERR_DISABLEHARDERR);
578 rc = DosQueryPathInfo(env, FIL_STANDARD, &fs3, sizeof(fs3));
579 if (!rc) {
580 if (fs3.attrFile & FILE_DIRECTORY) {
581 BldFullPathName(dllfile, env, "FM3RES"); // 23 Aug 07 SHL
582 DosError(FERR_DISABLEHARDERR);
583 if (DosQueryPathInfo(dllfile, FIL_STANDARD, &fs3, sizeof(fs3)))
584 strcpy(dllfile, "FM3RES");
585 }
586 }
587 }
588 rcl = DosLoadModule(NULL, 0, dllfile, &FM3ModHandle);
589 if (rcl) {
590 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
591 HWND_DESKTOP,
592 GetPString(IDS_ERRORTEXT), GetPString(IDS_FM3RESERROR1TEXT));
593 return FALSE;
594 }
595 else {
596 rc = DosExitList(EXLST_ADD, DeInitFM3DLL);
597 if (rc) {
598 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
599 "DosExitList");
600 }
601 rcq = DosQueryProcAddr(FM3ModHandle, 1, "ResVersion", &pfnResVersion);
602 if (!rcq)
603 ret = pfnResVersion(&RVMajor, &RVMinor);
604 }
605
606 if (RVMajor < VERMAJOR || (RVMajor == VERMAJOR && RVMinor < VERMINOR)) {
607 saymsg(MB_ENTER,
608 HWND_DESKTOP,
609 GetPString(IDS_ERRORTEXT),
610 GetPString(IDS_FM3RESERROR2TEXT),
611 !rcq ?
612 GetPString(IDS_FM3RESERROR3TEXT) :
613 !rcl ?
614 GetPString(IDS_FM3RESERROR4TEXT) :
615 GetPString(IDS_FM3RESERROR5TEXT), RVMajor, RVMinor, rcl, rcq, ret);
616 return FALSE;
617 }
618
619 ArgDriveFlags(argc, argv);
620 FillInDriveFlags(NULL);
621
622 if (!*profile)
623 strcpy(profile, "FM3.INI");
624 mypid = getpid();
625 /* give default appname if none set by caller */
626 if (!*appname)
627 strcpy(appname, FM3Str);
628 /* save appname; may be reset below */
629 strcpy(realappname, appname);
630 if (!strcmp(appname, FM3Str))
631 DosSetMaxFH(100);
632 else if (!strcmp(appname, "VDir") ||
633 !strcmp(appname, "VTree") ||
634 !strcmp(appname, "VCollect") ||
635 !strcmp(appname, "SEEALL") || !strcmp(appname, "FM/4"))
636 DosSetMaxFH(60);
637 else
638 DosSetMaxFH(40);
639
640 if (DosQuerySysInfo(QSV_VERSION_MAJOR,
641 QSV_VERSION_MINOR,
642 OS2ver,
643 sizeof(OS2ver))) {
644 OS2ver[0] = 2;
645 OS2ver[1] = 1;
646 }
647
648 /* set up default root names for temp archive goodies */
649 if (!fAmAV2)
650 strcpy(ArcTempRoot, "$FM$ARC$");
651 else
652 strcpy(ArcTempRoot, "$AV$ARC$");
653
654 /* initialize random number generator */
655 srand(time(NULL) + clock());
656
657 priority_bumped();
658
659 /* _heapmin() is done in a separate thread -- start it */
660 if (_beginthread(HeapThread, NULL, 32768, NULL) == -1) {
661 Runtime_Error(pszSrcFile, __LINE__,
662 GetPString(IDS_COULDNTSTARTTHREADTEXT));
663 return FALSE;
664 }
665
666 /* timer messages are sent from a separate thread -- start it */
667 if (!StartTimer()) {
668 Runtime_Error(pszSrcFile, __LINE__,
669 GetPString(IDS_COULDNTSTARTTHREADTEXT));
670 return FALSE;
671 }
672
673 /* Are we the workplace shell? */
674 env = getenv("WORKPLACE_PROCESS");
675 fWorkPlace = env != NULL &&
676 (stricmp(env, "YES") == 0 || atoi(env) == 1);
677
678 if ((!strchr(profile, '\\') && !strchr(profile, ':')) ||
679 !(fmprof = PrfOpenProfile((HAB)0, profile)))
680 {
681 /* figure out where to put INI file... */
682 CHAR inipath[CCHMAXPATH];
683
684 DosError(FERR_DISABLEHARDERR);
685 save_dir2(HomePath);
686 DosError(FERR_DISABLEHARDERR);
687 memset(driveserial, -1, sizeof(driveserial));
688 *inipath = 0;
689 env = getenv("FM3INI");
690 if (env) {
691 strcpy(inipath, env);
692 DosError(FERR_DISABLEHARDERR);
693 rc = DosQueryPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3));
694 if (!rc) {
695 if (fs3.attrFile & FILE_DIRECTORY)
696 BldFullPathName(inipath, inipath, profile);
697 }
698 }
699 if (!env) {
700 env = searchpath(profile);
701 if (!env)
702 env = profile;
703 strcpy(inipath, env);
704 }
705
706 /* in some odd cases the INI file can get set to readonly status */
707 /* here we test it and reset the readonly bit if necessary */
708 if (!*inipath)
709 strcpy(inipath, profile);
710 DosError(FERR_DISABLEHARDERR);
711
712 rc = DosQueryPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3));
713 if (rc) {
714 if (rc == ERROR_FILE_NOT_FOUND)
715 fWantFirstTimeInit = TRUE;
716 }
717 else {
718 if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
719 saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,
720 "Check INI header failed will attempt to replace with backup \\
721 if backup fails or not found will open with new ini");
722 DosCopy("FM3.INI", "FM3INI.BAD", DCPY_EXISTING);
723 DosCopy("FM3INI.BAK", "FM3.INI", DCPY_EXISTING);
724 if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
725 DosCopy("FM3.INI", "FM3INI2.BAD", DCPY_EXISTING);
726 fWantFirstTimeInit = TRUE;
727 }
728 }
729 if (!fWantFirstTimeInit) {
730 fIniExisted = TRUE;
731 if (fs3.attrFile & (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM)) {
732 fs3.attrFile &= ~(FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM);
733 rc = xDosSetPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3), 0);
734 if (rc) {
735 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
736 GetPString(IDS_INIREADONLYTEXT), inipath);
737 }
738 }
739 }
740 }
741 fmprof = PrfOpenProfile((HAB)0, inipath);
742 if (!fmprof) {
743 strcpy(inipath, "FM3.INI");
744 fmprof = PrfOpenProfile((HAB)0, inipath);
745 }
746
747 // 10 Jan 08 SHL fixme to do first time if new ini
748 // 10 Jan 08 SHL post UM_FIRSTTIME to main window
749 if (!fmprof) {
750 Win_Error(NULLHANDLE, NULLHANDLE, pszSrcFile, __LINE__,
751 "PrfOpenProfile");
752 return FALSE;
753 }
754 }
755
756 FindSwapperDat();
757
758 size = sizeof(BOOL);
759 PrfQueryProfileData(fmprof,
760 FM3Str,
761 "SeparateParms",
762 &fSeparateParms,
763 &size);
764 if (!fSeparateParms)
765 strcpy(appname, FM3Str);
766
767 /* start help */
768 memset(&hini, 0, sizeof(HELPINIT));
769 hini.cb = sizeof(HELPINIT);
770 hini.ulReturnCode = 0;
771 hini.pszTutorialName = NULL;
772 hini.phtHelpTable = (PHELPTABLE) MAKELONG(ID_HELPTABLE, 0xffff);
773 hini.hmodAccelActionBarModule = (HMODULE) 0;
774 hini.idAccelTable = 0;
775 hini.idActionBar = 0;
776 hini.pszHelpWindowTitle = GetPString(IDS_FM2HELPTITLETEXT);
777 hini.fShowPanelId = CMIC_HIDE_PANEL_ID;
778 hini.pszHelpLibraryName = "FM3.HLP";
779 hwndHelp = WinCreateHelpInstance(hab, &hini);
780 if (!hwndHelp) {
781 static CHAR helppath[CCHMAXPATH]; // fixme to be local?
782
783 env = getenv("FM3INI");
784 if (env) {
785 strcpy(helppath, env);
786 DosError(FERR_DISABLEHARDERR);
787 rc = DosQueryPathInfo(helppath, FIL_STANDARD, &fs3, sizeof(fs3));
788 if (!rc) {
789 if (fs3.attrFile & FILE_DIRECTORY) {
790 BldFullPathName(helppath, helppath, "FM3.HLP");
791 hini.pszHelpLibraryName = helppath;
792 hwndHelp = WinCreateHelpInstance(hab, &hini);
793 }
794 }
795 }
796 }
797 if (!hwndHelp) {
798 saymsg(MB_ENTER | MB_ICONEXCLAMATION,
799 HWND_DESKTOP,
800 GetPString(IDS_FM2TROUBLETEXT),
801 GetPString(IDS_CANTLOADHELPTEXT),
802 GetPString(IDS_NOHELPACCEPTTEXT));
803 }
804
805 /* a couple of default window procs so we don't have to look them up later */
806 if (WinQueryClassInfo(hab, WC_CONTAINER, &clinfo))
807 PFNWPCnr = clinfo.pfnWindowProc;
808 // saymsg(MB_ENTER,HWND_DESKTOP,"Container flags:","%08lx",clinfo.flClassStyle);
809 if (WinQueryClassInfo(hab, WC_FRAME, &clinfo))
810 PFNWPFrame = clinfo.pfnWindowProc;
811 // saymsg(MB_ENTER,HWND_DESKTOP,"Frame flags:","%08lx",clinfo.flClassStyle);
812 if (WinQueryClassInfo(hab, WC_BUTTON, &clinfo))
813 PFNWPButton = clinfo.pfnWindowProc;
814 // saymsg(MB_ENTER,HWND_DESKTOP,"Button flags:","%08lx",clinfo.flClassStyle);
815 if (WinQueryClassInfo(hab, WC_STATIC, &clinfo))
816 PFNWPStatic = clinfo.pfnWindowProc;
817 // saymsg(MB_ENTER,HWND_DESKTOP,"Static flags:","%08lx",clinfo.flClassStyle);
818 if (WinQueryClassInfo(hab, WC_MLE, &clinfo))
819 PFNWPMLE = clinfo.pfnWindowProc;
820 // saymsg(MB_ENTER,HWND_DESKTOP,"MLE flags:","%08lx",clinfo.flClassStyle);
821 if (!PFNWPCnr || !PFNWPFrame || !PFNWPButton || !PFNWPStatic || !PFNWPMLE) {
822 Runtime_Error(pszSrcFile, __LINE__, "WinQueryClassInfo");
823 return FALSE;
824 }
825
826 /* register window classes we use */
827 WinRegisterClass(hab,
828 WC_MAINWND,
829 MainWndProc,
830 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 8);
831 WinRegisterClass(hab,
832 WC_MAINWND2,
833 MainWndProc2,
834 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 4);
835 WinRegisterClass(hab,
836 WC_TREECONTAINER,
837 TreeClientWndProc,
838 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
839 WinRegisterClass(hab,
840 WC_DIRCONTAINER,
841 DirClientWndProc,
842 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
843 WinRegisterClass(hab,
844 WC_COLLECTOR,
845 CollectorClientWndProc,
846 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
847 WinRegisterClass(hab,
848 WC_ARCCONTAINER,
849 ArcClientWndProc,
850 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
851 WinRegisterClass(hab,
852 WC_MLEEDITOR,
853 MLEEditorProc,
854 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
855 WinRegisterClass(hab,
856 WC_INIEDITOR,
857 IniProc,
858 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
859 WinRegisterClass(hab,
860 WC_TOOLBACK,
861 ToolBackProc,
862 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
863 sizeof(PVOID));
864 WinRegisterClass(hab,
865 WC_DRIVEBACK,
866 DriveBackProc,
867 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
868 sizeof(PVOID));
869 WinRegisterClass(hab,
870 WC_SEEALL,
871 SeeAllWndProc,
872 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
873 WinRegisterClass(hab,
874 WC_NEWVIEW,
875 ViewWndProc,
876 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
877 WinRegisterClass(hab,
878 WC_TOOLBUTTONS,
879 ChildButtonProc,
880 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
881 sizeof(PVOID));
882 WinRegisterClass(hab,
883 WC_DRIVEBUTTONS,
884 DriveProc,
885 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
886 sizeof(PVOID));
887 WinRegisterClass(hab,
888 WC_BUBBLE,
889 BubbleProc,
890 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
891 sizeof(ULONG) * 2);
892 WinRegisterClass(hab,
893 WC_STATUS,
894 StatusProc,
895 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
896 sizeof(ULONG));
897 WinRegisterClass(hab,
898 WC_DIRSTATUS,
899 DirTextProc,
900 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
901 sizeof(ULONG));
902 WinRegisterClass(hab,
903 WC_TREESTATUS,
904 TreeStatProc,
905 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
906 sizeof(ULONG));
907 WinRegisterClass(hab,
908 WC_ARCSTATUS,
909 ArcTextProc,
910 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
911 sizeof(ULONG));
912 WinRegisterClass(hab,
913 WC_COLSTATUS,
914 CollectorTextProc,
915 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
916 sizeof(ULONG));
917 WinRegisterClass(hab,
918 WC_SEESTATUS,
919 SeeStatusProc,
920 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
921 sizeof(ULONG));
922 WinRegisterClass(hab,
923 WC_VIEWSTATUS,
924 ViewStatusProc,
925 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
926 sizeof(ULONG));
927 WinRegisterClass(hab,
928 WC_ERRORWND,
929 NotifyWndProc,
930 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
931 sizeof(PVOID));
932 WinRegisterClass(hab,
933 WC_MINITIME,
934 MiniTimeProc,
935 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
936 sizeof(PVOID) * 2);
937 WinRegisterClass(hab,
938 WC_DATABAR,
939 DataProc, CS_SIZEREDRAW, sizeof(PVOID));
940 WinRegisterClass(hab,
941 WC_TREEOPENBUTTON,
942 OpenButtonProc,
943 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
944 sizeof(PVOID));
945 WinRegisterClass(hab,
946 WC_AUTOVIEW,
947 AutoViewProc,
948 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
949 sizeof(PVOID));
950 WinRegisterClass(hab,
951 WC_LED,
952 LEDProc,
953 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
954 sizeof(PVOID));
955
956 /*
957 * set some defaults (note: everything else automatically initialized
958 * to 0)
959 */
960 detailssize = detailsea = detailslwdate = detailslwtime = detailsattr =
961 detailsicon = fAutoTile = fConfirmDelete = fLoadSubject = fUnHilite =
962 fLoadLongnames = fToolbar = fSaveState = fGuessType = fToolbarHelp =
963 fAutoAddDirs = fUseNewViewer = fDataToFore = fDataShowDrives =
964 fSplitStatus = fDragndropDlg = fQuickArcFind = fKeepCmdLine =
965 fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree =
966 fSwitchTreeExpand = fNoSearch = fCustomFileDlg = fOtherHelp =
967 fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget =
968 fShowTarget = fDrivebarHelp = fCheckMM = TRUE;
969 ulCnrType = CCS_EXTENDSEL;
970 FilesToGet = FILESTOGET_MIN;
971 MaxComLineStrg = MAXCOMLINESTRGDEFAULT;
972 AutoviewHeight = 48;
973 strcpy(printer, "PRN");
974 prnwidth = 80;
975 prnlength = 66;
976 prntmargin = 6;
977 prnbmargin = 6;
978 prnlmargin = 6;
979 prnrmargin = 3;
980 prnspacing = 1;
981 prntabspaces = 8;
982 CollectorsortFlags = sortFlags = SORT_DIRSFIRST;
983
984 //Get default Country info
985 {
986 COUNTRYCODE Country = {0};
987 ULONG ulInfoLen = 0;
988 COUNTRYINFO CtryInfo = {0};
989
990 DosQueryCtryInfo(sizeof(CtryInfo), &Country,
991 &CtryInfo, &ulInfoLen);
992 *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
993 }
994
995 // load preferences from profile (INI) file
996 size = sizeof(ULONG);
997 PrfQueryProfileData(fmprof, appname, "MaxComLineStrg", &MaxComLineStrg, &size);
998 if (MaxComLineStrg < CMDLNLNGTH_MIN)
999 MaxComLineStrg = CMDLNLNGTH_MIN;
1000 else if (MaxComLineStrg > CMDLNLNGTH_MAX)
1001 MaxComLineStrg = CMDLNLNGTH_MAX;
1002 editor = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1003 if (!editor)
1004 return 0; //already complained
1005 viewer = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1006 if (!viewer)
1007 return 0; //already complained
1008 virus = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1009 if (!virus)
1010 return 0; //already complained
1011 compare = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1012 if (!compare)
1013 return 0; //already complained
1014 binview = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1015 if (!binview)
1016 return 0; //already complained
1017 bined = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1018 if (!bined)
1019 return 0; //already complained
1020 dircompare = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1021 if (!dircompare)
1022 return 0; //already complained
1023 ftprun = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1024 if (!ftprun)
1025 return 0; //already complained
1026 httprun = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1027 if (!httprun)
1028 return 0; //already complained
1029 mailrun = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1030 if (!mailrun)
1031 return 0; //already complained
1032 size = sizeof(BOOL);
1033 PrfQueryProfileData(fmprof, appname, "ShowTarget", &fShowTarget, &size);
1034 size = sizeof(BOOL);
1035 PrfQueryProfileData(fmprof, appname, "CheckMM", &fCheckMM, &size);
1036 size = sizeof(BOOL);
1037 PrfQueryProfileData(fmprof, appname, "ChangeTarget", &fChangeTarget, &size);
1038 size = sizeof(BOOL);
1039 PrfQueryProfileData(fmprof, appname, "ConfirmTarget", &fConfirmTarget, &size);
1040 size = sizeof(BOOL);
1041 PrfQueryProfileData(fmprof, FM3Str, "CustomFileDlg", &fCustomFileDlg, &size);
1042 size = sizeof(BOOL);
1043 PrfQueryProfileData(fmprof, FM3Str, "SaveMiniCmds", &fSaveMiniCmds, &size);
1044 size = sizeof(BOOL);
1045 PrfQueryProfileData(fmprof, appname, "SaveBigCmds", &fSaveBigCmds, &size);
1046 size = sizeof(BOOL);
1047 PrfQueryProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu, &size);
1048 size = sizeof(BOOL);
1049 PrfQueryProfileData(fmprof, FM3Str, "ThreadNotes", &fThreadNotes, &size);
1050 size = sizeof(BOOL);
1051 PrfQueryProfileData(fmprof, FM3Str, "Prnpagenums", &prnpagenums, &size);
1052 size = sizeof(BOOL);
1053 PrfQueryProfileData(fmprof, FM3Str, "Prnalt", &prnalt, &size);
1054 size = sizeof(BOOL);
1055 PrfQueryProfileData(fmprof, FM3Str, "Prnformat", &prnformat, &size);
1056 size = sizeof(BOOL);
1057 PrfQueryProfileData(fmprof, FM3Str, "Prnformfeedbefore",
1058 &prnformfeedbefore, &size);
1059 size = sizeof(BOOL);
1060 PrfQueryProfileData(fmprof, FM3Str,
1061 "Prnformfeedafter",&prnformfeedafter, &size);
1062 size = sizeof(ULONG);
1063 PrfQueryProfileData(fmprof, FM3Str, "Prntabspaces", &prntabspaces, &size);
1064 size = sizeof(ULONG);
1065 PrfQueryProfileData(fmprof, FM3Str, "Prnwidth", &prnwidth, &size);
1066 size = sizeof(ULONG);
1067 PrfQueryProfileData(fmprof, FM3Str, "Prnlength", &prnlength, &size);
1068 size = sizeof(ULONG);
1069 PrfQueryProfileData(fmprof, FM3Str, "Prntmargin", &prntmargin, &size);
1070 size = sizeof(ULONG);
1071 PrfQueryProfileData(fmprof, FM3Str, "Prnbmargin", &prnbmargin, &size);
1072 size = sizeof(ULONG);
1073 PrfQueryProfileData(fmprof, FM3Str, "Prnlmargin", &prnlmargin, &size);
1074 size = sizeof(ULONG);
1075 PrfQueryProfileData(fmprof, FM3Str, "Prnrmargin", &prnrmargin, &size);
1076 size = sizeof(ULONG);
1077 PrfQueryProfileData(fmprof, FM3Str, "Prnspacing", &prnspacing, &size);
1078 size = sizeof(BOOL);
1079 PrfQueryProfileData(fmprof, FM3Str, "NoDead", &fNoDead, &size);
1080 size = sizeof(BOOL);
1081 PrfQueryProfileData(fmprof, FM3Str, "NoFinger", &fNoFinger, &size);
1082 size = sizeof(BOOL);
1083 PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, &size);
1084 size = sizeof(BOOL);
1085 PrfQueryProfileData(fmprof, appname, "SwitchTreeExpand",
1086 &fSwitchTreeExpand, &size);
1087 size = sizeof(BOOL);
1088 PrfQueryProfileData(fmprof, appname, "SwitchTreeOnFocus",
1089 &fSwitchTreeOnFocus, &size);
1090 size = sizeof(BOOL);
1091 PrfQueryProfileData(fmprof, appname, "CollapseFirst",
1092 &fCollapseFirst, &size);
1093 size = sizeof(BOOL);
1094 PrfQueryProfileData(fmprof, appname, "FilesInTree",
1095 &fFilesInTree, &size);
1096 size = sizeof(BOOL);
1097 PrfQueryProfileData(fmprof, FM3Str, "TopDir", &fTopDir, &size);
1098 size = sizeof(BOOL);
1099 PrfQueryProfileData(fmprof, FM3Str, "LookInDir", &fLookInDir, &size);
1100 PrfQueryProfileString(fmprof, appname, "DefArc", NULL, szDefArc,
1101 sizeof(szDefArc));
1102 size = sizeof(ULONG);
1103 PrfQueryProfileData(fmprof, FM3Str, "AutoviewHeight",
1104 &AutoviewHeight, &size);
1105 size = sizeof(BOOL);
1106 PrfQueryProfileData(fmprof, FM3Str, "KeepCmdLine", &fKeepCmdLine, &size);
1107 if (strcmp(realappname, "FM/4")) {
1108 size = sizeof(BOOL);
1109 PrfQueryProfileData(fmprof, FM3Str, "MoreButtons", &fMoreButtons, &size);
1110 size = sizeof(BOOL);
1111 PrfQueryProfileData(fmprof, FM3Str, "Drivebar", &fDrivebar, &size);
1112 }
1113 else
1114 fDrivebar = fMoreButtons = TRUE;
1115 size = sizeof(BOOL);
1116 PrfQueryProfileData(fmprof, appname, "NoSearch", &fNoSearch, &size);
1117 size = sizeof(BOOL);
1118 PrfQueryProfileData(fmprof, appname, "GuessType", &fGuessType, &size);
1119 size = sizeof(BOOL);
1120 PrfQueryProfileData(fmprof, appname, "ViewChild", &fViewChild, &size);
1121 size = sizeof(BOOL);
1122 PrfQueryProfileData(fmprof, appname, "ShowEnv", &fShowEnv, &size);
1123 size = sizeof(BOOL);
1124 PrfQueryProfileData(fmprof, appname, "LeaveTree", &fLeaveTree, &size);
1125 size = sizeof(BOOL);
1126 PrfQueryProfileData(fmprof, FM3Str, "Comments", &fComments, &size);
1127 size = sizeof(ULONG);
1128 PrfQueryProfileData(fmprof, appname, "WS_ANIMATE", &fwsAnimate, &size);
1129 if (fwsAnimate)
1130 fwsAnimate = WS_ANIMATE;
1131 size = sizeof(ULONG);
1132 size = sizeof(BOOL);
1133 PrfQueryProfileData(fmprof, appname, "SelectedAlways",
1134 &fSelectedAlways, &size);
1135 size = sizeof(BOOL);
1136 PrfQueryProfileData(fmprof, FM3Str, "ToolbarHelp", &fToolbarHelp, &size);
1137 size = sizeof(BOOL);
1138 PrfQueryProfileData(fmprof, FM3Str, "OtherHelp", &fOtherHelp, &size);
1139 size = sizeof(BOOL);
1140 PrfQueryProfileData(fmprof, FM3Str, "DrivebarHelp", &fDrivebarHelp, &size);
1141 size = sizeof(BOOL);
1142 PrfQueryProfileData(fmprof, appname, "AutoAddDirs", &fAutoAddDirs, &size);
1143 size = sizeof(BOOL);
1144 PrfQueryProfileData(fmprof, appname,
1145 "AutoAddAllDirs", &fAutoAddAllDirs, &size);
1146 size = sizeof(BOOL);
1147 PrfQueryProfileData(fmprof, FM3Str, "UserListSwitches",
1148 &fUserListSwitches, &size);
1149 size = sizeof(BOOL);
1150 PrfQueryProfileData(fmprof, appname, "UseNewViewer",
1151 &fUseNewViewer, &size);
1152 size = sizeof(BOOL);
1153 PrfQueryProfileData(fmprof, appname, "DefaultDeletePerm",
1154 &fDefaultDeletePerm, &size);
1155 size = sizeof(BOOL);
1156 PrfQueryProfileData(fmprof, FM3Str, "ExternalINIs",
1157 &fExternalINIs, &size);
1158 size = sizeof(BOOL);
1159 PrfQueryProfileData(fmprof, FM3Str, "ExternalCollector",
1160 &fExternalCollector, &size);
1161 size = sizeof(BOOL);
1162 PrfQueryProfileData(fmprof, FM3Str, "ExternalArcboxes",
1163 &fExternalArcboxes, &size);
1164 size = sizeof(BOOL);
1165 PrfQueryProfileData(fmprof, FM3Str, "ExternalViewer",
1166 &fExternalViewer, &size);
1167 size = sizeof(BOOL);
1168 PrfQueryProfileData(fmprof, FM3Str, "UseQProcStat",
1169 &fUseQProcStat, &size);
1170 size = sizeof(BOOL);
1171 PrfQueryProfileData(fmprof, FM3Str, "UseQSysState",
1172 &fUseQSysState, &size);
1173 size = sizeof(BOOL);
1174 PrfQueryProfileData(fmprof, FM3Str, "DataMin", &fDataMin, &size);
1175 size = sizeof(BOOL);
1176 PrfQueryProfileData(fmprof, appname, "DataToFore", &fDataToFore, &size);
1177 size = sizeof(BOOL);
1178 PrfQueryProfileData(fmprof, appname, "DataShowDrives",
1179 &fDataShowDrives, &size);
1180 size = sizeof(BOOL);
1181 PrfQueryProfileData(fmprof, appname, "DataInclRemote",
1182 &fDataInclRemote, &size);
1183 size = sizeof(BOOL);
1184 PrfQueryProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus, &size);
1185 size = sizeof(BOOL);
1186 PrfQueryProfileData(fmprof, appname, "FolderAfterExtract",
1187 &fFolderAfterExtract, &size);
1188 size = sizeof(BOOL);
1189 PrfQueryProfileData(fmprof, FM3Str, "DullDatabar", &fDullMin, &size);
1190 size = sizeof(BOOL);
1191 PrfQueryProfileData(fmprof, appname, "BlueLED", &fBlueLED, &size);
1192 size = sizeof(BOOL);
1193 PrfQueryProfileData(fmprof, appname, "ConfirmDelete",
1194 &fConfirmDelete, &size);
1195 size = sizeof(BOOL);
1196 PrfQueryProfileData(fmprof, FM3Str, "SaveState", &fSaveState, &size);
1197 size = sizeof(BOOL);
1198 PrfQueryProfileData(fmprof, appname, "SyncUpdates", &fSyncUpdates, &size);
1199 size = sizeof(BOOL);
1200 PrfQueryProfileData(fmprof, appname, "LoadSubject", &fLoadSubject, &size);
1201 size = sizeof(BOOL);
1202 PrfQueryProfileData(fmprof, appname, "UnHilite", &fUnHilite, &size);
1203 size = sizeof(BOOL);
1204 PrfQueryProfileData(fmprof, FM3Str, "TileBackwards", &fTileBackwards, &size);
1205 size = sizeof(BOOL);
1206 PrfQueryProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames, &size);
1207 size = sizeof(BOOL);
1208 PrfQueryProfileData(fmprof, appname, "VerifyWrites", &fVerify, &size);
1209 DosSetVerify(fVerify);
1210 size = sizeof(BOOL);
1211 PrfQueryProfileData(fmprof, appname, "DontMoveMouse", &fDontMoveMouse, &size);
1212 size = sizeof(BOOL);
1213 PrfQueryProfileData(fmprof, appname, "NoIconsFiles", &fNoIconsFiles, &size);
1214 size = sizeof(BOOL);
1215 PrfQueryProfileData(fmprof, appname, "NoIconsDirs", &fNoIconsDirs, &size);
1216 size = sizeof(BOOL);
1217 PrfQueryProfileData(fmprof, appname, "ForceUpper", &fForceUpper, &size);
1218 size = sizeof(BOOL);
1219 PrfQueryProfileData(fmprof, appname, "ForceLower", &fForceLower, &size);
1220 size = sizeof(BOOL);
1221 PrfQueryProfileData(fmprof, FM3Str, "TextTools", &fTextTools, &size);
1222 size = sizeof(BOOL);
1223 PrfQueryProfileData(fmprof, FM3Str, "ToolTitles", &fToolTitles, &size);
1224 size = sizeof(BOOL);
1225 PrfQueryProfileData(fmprof, appname, "DoubleClickOpens", &fDCOpens, &size);
1226 size = sizeof(BOOL);
1227 PrfQueryProfileData(fmprof, appname, "LinkSetsIcon", &fLinkSetsIcon, &size);
1228 size = sizeof(INT);
1229 PrfQueryProfileData(fmprof, appname, "Sort", &sortFlags, &size);
1230 size = sizeof(INT);
1231 PrfQueryProfileData(fmprof, appname, "TreeSort", &TreesortFlags, &size);
1232 size = sizeof(INT);
1233 PrfQueryProfileData(fmprof, appname,
1234 "CollectorSort", &CollectorsortFlags, &size);
1235 size = sizeof(targetdir);
1236 PrfQueryProfileData(fmprof, appname, "Targetdir", targetdir, &size);
1237 if (!IsValidDir(targetdir))
1238 *targetdir = 0;
1239 size = sizeof(extractpath);
1240 PrfQueryProfileData(fmprof, appname, "ExtractPath", extractpath, &size);
1241 size = sizeof(printer);
1242 PrfQueryProfileData(fmprof, appname, "Printer", printer, &size);
1243 size = MaxComLineStrg;
1244 PrfQueryProfileData(fmprof, appname, "DirCompare", dircompare,
1245 &size);
1246 size = MaxComLineStrg;
1247 PrfQueryProfileData(fmprof, appname, "Viewer", viewer, &size);
1248 size = MaxComLineStrg;
1249 PrfQueryProfileData(fmprof, appname, "Editor", editor, &size);
1250 size = MaxComLineStrg;
1251 PrfQueryProfileData(fmprof, appname, "BinView", binview, &size);
1252 size = MaxComLineStrg;
1253 PrfQueryProfileData(fmprof, appname, "BinEd", bined, &size);
1254 size = MaxComLineStrg;
1255 PrfQueryProfileData(fmprof, appname, "Compare", compare, &size);
1256 size = MaxComLineStrg;
1257 PrfQueryProfileData(fmprof, appname, "Virus", virus, &size);
1258 size = sizeof(BOOL);
1259 PrfQueryProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, &size);
1260 size = MaxComLineStrg;
1261 PrfQueryProfileData(fmprof, appname, "FTPRun", ftprun, &size);
1262 if (!*ftprun)
1263 fFtpRunWPSDefault = TRUE;
1264 size = sizeof(BOOL);
1265 PrfQueryProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, &size);
1266 size = MaxComLineStrg;
1267 PrfQueryProfileData(fmprof, appname, "HTTPRun", httprun, &size);
1268 if (!*httprun)
1269 fHttpRunWPSDefault = TRUE;
1270 size = MaxComLineStrg;
1271 PrfQueryProfileData(fmprof, appname, "MailRun", mailrun, &size);
1272 size = sizeof(ftprundir);
1273 PrfQueryProfileData(fmprof, appname, "FtpRunDir", ftprundir, &size);
1274 size = sizeof(httprundir);
1275 PrfQueryProfileData(fmprof, appname, "HttpRunDir", httprundir, &size);
1276 size = sizeof(mailrundir);
1277 PrfQueryProfileData(fmprof, appname, "MailRunDir", mailrundir, &size);
1278 size = sizeof(lasttoolbox);
1279 PrfQueryProfileData(fmprof, FM3Str, "LastToolBox", lasttoolbox,
1280 &size);
1281 size = sizeof(BOOL);
1282 PrfQueryProfileData(fmprof, appname, "LibPathStrictHttpRun", &fLibPathStrictHttpRun,
1283 &size);
1284 size = sizeof(BOOL);
1285 PrfQueryProfileData(fmprof, appname, "LibPathStrictFtpRun", &fLibPathStrictFtpRun,
1286 &size);
1287 size = sizeof(BOOL);
1288 PrfQueryProfileData(fmprof, appname, "LibPathStrictMailRun", &fLibPathStrictMailRun,
1289 &size);
1290 size = sizeof(BOOL);
1291 PrfQueryProfileData(fmprof, appname, "NoMailtoMailRun", &fNoMailtoMailRun,
1292 &size);
1293 size = sizeof(BOOL);
1294 PrfQueryProfileData(fmprof, appname, "FollowTree", &fFollowTree,
1295 &size);
1296 size = sizeof(BOOL);
1297 PrfQueryProfileData(fmprof, appname, "StartMaximized",
1298 &fStartMaximized, &size);
1299 if (!fStartMaximized) {
1300 size = sizeof(BOOL);
1301 PrfQueryProfileData(fmprof, appname, "StartMinimized",
1302 &fStartMinimized, &size);
1303 }
1304 size = sizeof(BOOL);
1305 PrfQueryProfileData(fmprof, appname, "DefaultCopy", &fCopyDefault, &size);
1306 size = sizeof(BOOL);
1307 PrfQueryProfileData(fmprof, appname, "IdleCopy", &fRealIdle, &size);
1308 size = sizeof(BOOL);
1309 PrfQueryProfileData(fmprof, appname, "ArcStuffVisible",
1310 &fArcStuffVisible, &size);
1311 size = sizeof(BOOL);
1312 PrfQueryProfileData(fmprof, FM3Str, "NoTreeGap", &fNoTreeGap, &size);
1313 size = sizeof(BOOL);
1314 PrfQueryProfileData(fmprof, FM3Str, "VTreeOpensWPS",
1315 &fVTreeOpensWPS, &size);
1316 size = sizeof(BOOL);
1317 PrfQueryProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, &size);
1318 size = sizeof(BOOL);
1319 PrfQueryProfileData(fmprof, appname, "Drag&DropDlg",
1320 &fDragndropDlg, &size);
1321 size = sizeof(BOOL);
1322 PrfQueryProfileData(fmprof, FM3Str, "UserComboBox", &fUserComboBox, &size);
1323 size = sizeof(BOOL);
1324 PrfQueryProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen, &size);
1325 size = sizeof(BOOL);
1326 PrfQueryProfileData(fmprof, appname, "QuickArcFind",
1327 &fQuickArcFind, &size);
1328 size = sizeof(BOOL);
1329 PrfQueryProfileData(fmprof, FM3Str, "NoRemovableScan",
1330 &fNoRemovableScan, &size);
1331 size = sizeof(ULONG);
1332 PrfQueryProfileData(fmprof, FM3Str, "NoBrokenNotify",
1333 &NoBrokenNotify, &size);
1334 size = sizeof(ULONG);
1335 PrfQueryProfileData(fmprof, appname, "ContainerType", &ulCnrType,
1336 &size);
1337 size = sizeof(ULONG);
1338 PrfQueryProfileData(fmprof, appname, "FilesToGet", &FilesToGet, &size);
1339 if (FilesToGet < FILESTOGET_MIN)
1340 FilesToGet = FILESTOGET_MIN;
1341 else if (FilesToGet > FILESTOGET_MAX)
1342 FilesToGet = FILESTOGET_MAX;
1343 size = sizeof(BOOL);
1344 PrfQueryProfileData(fmprof, FM3Str, "AutoView", &fAutoView, &size);
1345 size = sizeof(BOOL);
1346 PrfQueryProfileData(fmprof, FM3Str, "FM2Deletes", &fFM2Deletes, &size);
1347
1348 LoadDetailsSwitches("DirCnr", NULL);
1349
1350 /* load pointers and icons we use */
1351 hptrArrow = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE);
1352 hptrBusy = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
1353 hptrNS = WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZENS, FALSE);
1354 hptrEW = WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZEWE, FALSE);
1355 hptrFloppy = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FLOPPY_ICON);
1356 hptrDrive = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DRIVE_ICON);
1357 hptrRemovable = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, REMOVABLE_ICON);
1358 hptrCDROM = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, CDROM_ICON);
1359 hptrFile = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_ICON);
1360 hptrDir = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DIR_FRAME);
1361 hptrArc = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ARC_FRAME);
1362 hptrArt = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ART_ICON);
1363 hptrSystem = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_SYSTEM_ICON);
1364 hptrHidden = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_HIDDEN_ICON);
1365 hptrReadonly = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_READONLY_ICON);
1366 hptrLast = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, LASTITEM_ICON);
1367 hptrRemote = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, REMOTE_ICON);
1368 hptrVirtual = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, VIRTUAL_ICON);
1369 hptrRamdisk = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, RAMDISK_ICON);
1370 if (!fNoDead)
1371 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER_ICON);
1372 else
1373 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER2_ICON);
1374 hptrApp = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, APP_ICON);
1375 hptrDunno = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DUNNO_ICON);
1376 hptrEnv = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ENV_ICON);
1377 hptrZipstrm = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ZIPSTREAM_ICON);
1378
1379 // set up color array used by seeall.c and newview.c color dialog
1380
1381 standardcolors[0] = CLR_WHITE;
1382 standardcolors[1] = CLR_BLACK;
1383 standardcolors[2] = CLR_BLUE;
1384 standardcolors[3] = CLR_RED;
1385 standardcolors[4] = CLR_PINK;
1386 standardcolors[5] = CLR_GREEN;
1387 standardcolors[6] = CLR_CYAN;
1388 standardcolors[7] = CLR_YELLOW;
1389 standardcolors[8] = CLR_DARKGRAY;
1390 standardcolors[9] = CLR_DARKBLUE;
1391 standardcolors[10] = CLR_DARKRED;
1392 standardcolors[11] = CLR_DARKPINK;
1393 standardcolors[12] = CLR_DARKGREEN;
1394 standardcolors[13] = CLR_DARKCYAN;
1395 standardcolors[14] = CLR_BROWN;
1396 standardcolors[15] = CLR_PALEGRAY;
1397
1398 return TRUE;
1399}
1400
1401HWND StartFM3(HAB hab, INT argc, CHAR ** argv)
1402{
1403 HWND hwndFrame;
1404 HWND hwndClient;
1405 UINT x;
1406 ULONG FrameFlags = FCF_TITLEBAR | FCF_SYSMENU |
1407 FCF_SIZEBORDER | FCF_MINMAX |
1408 FCF_ACCELTABLE | FCF_MENU | FCF_ICON | FCF_TASKLIST | FCF_NOBYTEALIGN;
1409
1410 for (x = 1; x < argc; x++) {
1411 if (*argv[x] == '~' && !argv[x][1])
1412 fReminimize = TRUE;
1413 if (*argv[x] == '+' && !argv[x][1])
1414 fLogFile = TRUE;
1415 if (*argv[x] == '-') {
1416 if (!argv[x][1])
1417 fNoSaveState = TRUE;
1418 else
1419 strcpy(profile, &argv[x][1]);
1420 }
1421 }
1422
1423 hwndFrame = WinCreateStdWindow(HWND_DESKTOP,
1424 WS_VISIBLE,
1425 &FrameFlags,
1426 WC_MAINWND,
1427 NULL,
1428 WS_VISIBLE | WS_ANIMATE,
1429 FM3ModHandle, MAIN_FRAME, &hwndClient);
1430 if (hwndFrame) {
1431 WinSetWindowUShort(hwndFrame, QWS_ID, MAIN_FRAME);
1432 hwndMainMenu = WinWindowFromID(hwndFrame, FID_MENU);
1433 if (!WinRestoreWindowPos(FM2Str, "MainWindowPos", hwndFrame)) {
1434
1435 ULONG fl = SWP_MOVE | SWP_SIZE;
1436 RECTL rcl;
1437 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 3L;
1438 ULONG bsz = WinQuerySysValue(HWND_DESKTOP, SV_CYSIZEBORDER);
1439
1440 WinQueryWindowRect(HWND_DESKTOP, &rcl);
1441 rcl.yBottom += icz;
1442 rcl.yTop -= bsz;
1443 rcl.xLeft += bsz;
1444 rcl.xRight -= bsz;
1445 WinSetWindowPos(hwndFrame,
1446 HWND_TOP,
1447 rcl.xLeft,
1448 rcl.yBottom,
1449 rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom, fl);
1450 }
1451 if (fLogFile)
1452 LogFileHandle = _fsopen("FM2.LOG", "a+", SH_DENYWR);
1453 if (hwndHelp)
1454 WinAssociateHelpInstance(hwndHelp, hwndFrame);
1455 PostMsg(hwndClient, UM_SETUP, MPFROMLONG(argc), MPFROMP(argv));
1456 }
1457 return hwndFrame;
1458}
1459
1460BOOL CheckFileHeader(CHAR *filespec, CHAR *signature, LONG offset)
1461{
1462 HFILE handle;
1463 ULONG action;
1464 ULONG len = strlen(signature);
1465 ULONG l;
1466 // CHAR buffer[80];
1467 CHAR buffer[4096]; // 06 Oct 07 SHL Protect against NTFS defect
1468 BOOL ret = FALSE;
1469
1470 DosError(FERR_DISABLEHARDERR);
1471 if (DosOpen(filespec,
1472 &handle,
1473 &action,
1474 0,
1475 0,
1476 OPEN_ACTION_FAIL_IF_NEW |
1477 OPEN_ACTION_OPEN_IF_EXISTS,
1478 OPEN_FLAGS_FAIL_ON_ERROR |
1479 OPEN_FLAGS_NOINHERIT |
1480 OPEN_FLAGS_RANDOMSEQUENTIAL |
1481 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, 0))
1482 ret = FALSE;
1483 else {
1484 // Try signature match
1485 l = len;
1486 l = min(l, 79);
1487 if (!DosChgFilePtr(handle,
1488 abs(offset),
1489 (offset >= 0) ?
1490 FILE_BEGIN : FILE_END, &len)) {
1491 if (!DosRead(handle, buffer, l, &len) && len == l) {
1492 if (!memcmp(signature, buffer, l))
1493 ret = TRUE; // Matched
1494 }
1495 }
1496 }
1497 DosClose(handle); /* Either way, we're done for now */
1498 return ret; /* Return TRUE if matched */
1499}
1500
1501int CheckVersion(int vermajor, int verminor)
1502{
1503 int ok = 0;
1504
1505 // fixme to do useful check - was missing in base source
1506
1507#if 0
1508 if (vermajor && verminor) {
1509 *vermajor = VERMAJOR;
1510 *verminor = VERMINOR;
1511 ok = 1;
1512 }
1513#endif
1514
1515 ok = 1;
1516
1517 return ok;
1518}
1519
1520#ifdef __WATCOMC__
1521#pragma alloc_text(INIT,LibMain,InitFM3DLL,DeInitFM3DLL)
1522#pragma alloc_text(INIT1,StartFM3,FindSwapperDat)
1523#endif
Note: See TracBrowser for help on using the repository browser.