source: trunk/dll/init.c@ 850

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

Rework large file support wrappers (ticket #41)
Add code to avoid NTFS driver small file read defect (ticket #159)
Add debug code to try to catch David's drive bar exception
Another attempt to correct newview fast viewer text load failure

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