source: trunk/dll/init.c@ 1479

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

Work around MMIO's failure to recognize MPG files as media. Reorder file type checks to eliminate problem with MMIO identifying exes etc as media. Check for zero byte file and let user decide to open in an editor or abort (also prevents MMIO misidentification). Tickets 70, 405, 409, 410

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 60.0 KB
RevLine 
[32]1
2/***********************************************************************
3
4 $Id: init.c 1479 2009-11-15 22:40:25Z gyoung $
5
6 Initialization
7
8 Copyright (c) 1993-98 M. Kimes
[1394]9 Copyright (c) 2001, 2009 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
[860]38 10 Nov 07 GKY Get thousands separator from country info for file sizes.
[878]39 26 Nov 07 GKY Eliminate check of ext path on start up
[888]40 17 Dec 07 GKY Make WPURLDEFAULTSETTINGS the fall back for ftp/httprun
[940]41 13 Jan 08 GKY Get Subjectwidth/Subjectleft working in the collector.
[952]42 12 Feb 08 SHL Compile OpenWatcom version into binary
[985]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
[998]45 08 Mar 08 JBS Ticket 230: Replace prefixless INI keys for default directory containers with
[1335]46 keys using a "DirCnr." prefix
[1004]47 20 Apr 08 GKY Change default cmd line length to 1024 Ask once if user wants to reset it.
[1065]48 11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating
[1335]49 all the details view settings (both the global variables and those in the
50 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS.
[1075]51 16 JUL 08 GKY Use TMP directory for temp files
[1074]52 17 Jul 08 SHL Reduce code bulk in fUseTmp setup
[1082]53 19 Jul 08 GKY Use pFM2SaveDirectory, MakeTempName and move temp files to TMP subdirectory if (TMP).
[1083]54 20 Jul 08 JBS Ticket 114: Support user-selectable env. strings in Tree container.
[1089]55 20 Jul 08 GKY Add support to delete orphaned tmp directories without deleting tmp of other
[1335]56 running sessions
[1112]57 23 Aug 08 GKY Check that space on TMP & FM2 save drives exceed 5 GiB; Done to allow user setting of
[1335]58 minimum size in future
[1303]59 29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
[1306]60 30 Nov 08 GKY Add the option of creating a subdirectory from the arcname
[1335]61 for the extract path to arc container.
62 10 Dec 08 SHL Integrate exception handler support
[1358]63 25 Dec 08 GKY Add code to allow write verify to be turned off on a per drive basis
[1360]64 28 Dec 08 GKY Check for LVM.EXE and remove Refresh removable media menu item as appropriate
65 28 Dec 08 GKY Rework partition submenu to gray out unavailable items (check for existence of files)
[1394]66 and have no default choice.
[1375]67 01 Jan 09 GKY Add option to rescan tree container on eject of removable media
68 03 Jan 09 GKY Avoid dbl scan of drive on startup by checking for first rescan drive.
69 03 Jan 09 GKY Check for system that is protectonly to gray out Dos/Win command lines and prevent
[1394]70 Dos/Win programs from being inserted into the execute dialog with message why.
[1391]71 11 Jan 09 GKY Move strings that shouldn't be translated (font names etc) compile time variables
[1394]72 03 Feb 09 SHL Switch to STRINGTABLE
[1395]73 07 Feb 09 GKY Move repeated strings to PCSZs.
74 07 Feb 09 GKY Add *DateFormat functions to format dates based on locale
75 07 Feb 09 GKY Eliminate Win_Error2 by moving function names to PCSZs used in Win_Error
[1400]76 08 Mar 09 GKY Additional strings move to PCSZs in init.c
[1402]77 08 Mar 09 GKY Removed variable aurguments from docopyf and unlinkf (not used)
78 14 Mar 09 GKY PCSZ strings moved to compile time initialization
79 14 Mar 09 GKY Prevent execution of UM_SHOWME while drive scan is occuring replaces check for
[1471]80 saved drive containers.
[1429]81 06 Jun 09 GKY Add option to show file system type or drive label in tree
[1438]82 28 Jun 09 GKY Added AddBackslashToPath() to remove repeatative code.
[1439]83 12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
[1444]84 22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
85 22 Jul 09 GKY Fix failure to restore the notebook setting for saving container states or not
[1452]86 12 Sep 09 GKY Change protectonly check to check for VKBD being loaded instead of starting
[1471]87 command.com. Prevents hang (at least until a Dos program is started) on a system
88 that has a broken MDOS install.
[1479]89 15 Nov 09 GKY Add more PCSZs
[32]90
91***********************************************************************/
92
[2]93#include <stdlib.h>
94#include <string.h>
95#include <share.h>
[1335]96#include <process.h> // getpid
[1224]97#include <time.h>
[1326]98#include <ctype.h>
[133]99
[803]100#define INCL_DOS
101#define INCL_WIN
102#define INCL_MMIOOS2
103#define INCL_GPI
104#define INCL_DOSERRORS
[841]105#define INCL_LONGLONG
[860]106#define INCL_DOSNLS
[803]107#include <os2.h>
108#include <os2me.h>
109
110#define DEFINE_GLOBALS 1
111
[1177]112#include "fm3dll.h"
[1224]113#include "fm3dll2.h" // #define's for UM_*, control id's, etc.
114#include "init.h"
[1209]115#include "mkdir.h" // Data declaration(s)
116#include "dircnrs.h" // Data declaration(s)
117#include "comp.h" // Data declaration(s)
118#include "cmdline.h" // Data declaration(s)
119#include "fm2cmd.h" // Data declaration(s)
[1471]120#include "printer.h" // Data declaration(s)
121#include "flesh.h" // Data declaration(s)
122#include "worker.h" // Data declaration(s)
123#include "filldir.h" // Data declaration(s)
124#include "defview.h" // Data declaration(s)
125#include "draglist.h" // Data declaration(s)
[2]126#include "fm3dlg.h"
[133]127#include "datamin.h"
[2]128#include "tools.h"
129#include "fm3str.h"
130#include "version.h"
[1471]131#include "pathutil.h" // BldFullPathName
132#include "arccnrs.h" // ArcClientWndProc
133#include "errutil.h" // Dos_Error...
134#include "strutil.h" // GetPString
135#include "valid.h" // ArgDriveFlags
136#include "autoview.h" // AutoViewProc
[1156]137#include "mainwnd.h" // BubbleProc, ChildButtonProc, DriveBackProc,
[1335]138 // DriveProc, LEDProc, MainWndProc, StatusProc
139 // ToolBackProc
[1156]140#include "collect.h" // CollectorClientWndProc, CollectorTextProc
141#include "getnames.h" // CustomFileDlg
142#include "notify.h" // EndNote
143#include "valid.h" // FillInDriveFlags, IsValidDir
144#include "inis.h" // IniProc
145#include "viewer.h" // MLEEditorProc
146#include "mainwnd2.h" // MainWndProc2
147#include "notify.h" // NotifyWndProc
148#include "treecnr.h" // OpenButtonProc
[1209]149#include "seeall.h" // SeeAllWndProc, SeeStatusProc
150#include "timer.h" // StartTimer, StopTimer
151#include "treecnr.h" // TreeClientWndProc, TreeStatProc
152#include "newview.h" // ViewStatusProc, ViewWndProc
153#include "subj.h" // Subject
154#include "select.h" // UnHilite
155#include "dirs.h" // save_dir
156#include "copyf.h" // unlinkf
157#include "wrappers.h" // xDosSetPathInfo
[1156]158#include "misc.h" // HeapThread, LoadDetailsSwitches
159#include "notebook.h" // command line variables (editor etc)
[1209]160#include "strips.h" // bstrip
161#include "killproc.h" // GetDosPgmName
162#include "srchpath.h" // searchpath
[1012]163#include "fortify.h"
[1335]164#include "excputil.h" // xbeginthread
[1369]165#include "systemf.h" // runemf2
[2]166
[189]167extern int _CRT_init(void);
[2]168extern void _CRT_term(void);
169
[952]170#ifdef __WATCOMC__
171#define a(x) #x
172#define b(x) a(x)
173// Must be global to prevent warnings
174PSZ pszBuiltWith = "Built with OpenWatcom version " b(__WATCOMC__);
175#undef b
176#undef a
177#endif
178
[1224]179static VOID FindSwapperDat(VOID);
[1217]180
[1209]181// Data definitions
[339]182static PSZ pszSrcFile = __FILE__;
[1377]183unsigned __MaxThreads = {48};
[2]184
[1209]185#pragma data_seg(GLOBAL1)
[1313]186HMTX hmtxFM2Delete;
[1303]187HMTX hmtxFM2Globals;
[1444]188HMTX hmtFillingTreeCnr;
189HEV hevInitialCnrScanComplete;
[1209]190ULONG OS2ver[2];
191PFNWP PFNWPCnr;
192PFNWP PFNWPMLE;
193CHAR ThousandsSeparator[2];
[1395]194CHAR DateSeparator[2];
195CHAR TimeSeparator[2];
196ULONG ulTimeFmt;
197ULONG ulDateFmt;
[1451]198BOOL fDontSuggestAgain;
[1320]199BOOL fInitialDriveScan;
[1209]200BOOL fAmAV2;
201BOOL fChangeTarget;
202BOOL fIniExisted;
203BOOL fLogFile;
[1369]204BOOL fProtectOnly;
[1209]205BOOL fReminimize;
206BOOL fWantFirstTimeInit;
[1402]207//BOOL fDrivetoSkip[26];
[1209]208HPOINTER hptrApp;
209HPOINTER hptrArc;
210HPOINTER hptrArrow;
211HPOINTER hptrArt;
212HPOINTER hptrBusy;
213HPOINTER hptrCDROM;
214HPOINTER hptrDrive;
215HPOINTER hptrEW;
216HPOINTER hptrFloppy;
217HPOINTER hptrNS;
218HPOINTER hptrRamdisk;
219HPOINTER hptrRemote;
220HPOINTER hptrRemovable;
221HPOINTER hptrVirtual;
222HPOINTER hptrZipstrm;
223CHAR *pFM2SaveDirectory;
224CHAR *pTmpDir;
225
226#pragma data_seg(GLOBAL2)
[1402]227PCSZ PCSZ_ARCHIVERBB2 = "ARCHIVER.BB2";
228PCSZ PCSZ_ASSOCDAT = "ASSOC.DAT";
229PCSZ PCSZ_CMDLINESDAT = "CMDLINES.DAT";
230PCSZ PCSZ_CMDMINIDAT = "CMDMINI.DAT";
231PCSZ PCSZ_COMMANDSDAT = "COMMANDS.DAT";
232PCSZ PCSZ_FILTERSDAT = "FILTERS.DAT";
233PCSZ PCSZ_GREPMASKDAT = "GREPMASK.DAT";
234PCSZ PCSZ_PATTERNSDAT = "PATTERNS.DAT";
235PCSZ PCSZ_RESOURCEDAT = "RESOURCE.DAT";
236PCSZ PCSZ_QUICKTLSDAT = "QUICKTLS.DAT";
237PCSZ PCSZ_FM3TOOLSDAT = "FM3TOOLS.DAT";
238PCSZ PCSZ_USERDIRSDAT = "USERDIRS.DAT";
239PCSZ PCSZ_FM2PLAYEXE = "FM2PLAY.EXE";
[1479]240PCSZ PCSZ_IMAGEEXE = "IMAGE.EXE";
[1402]241PCSZ PCSZ_FM2PLAYTEMP = "$FM2PLAY.$$$";
242PCSZ PCSZ_LVMGUICMD = "LVMGUI.CMD";
243PCSZ PCSZ_DFSOS2EXE = "DFSOS2.EXE";
244PCSZ PCSZ_MINILVMEXE = "MINILVM.EXE";
245PCSZ PCSZ_FDISKPMEXE = "FDISKPM.EXE";
246PCSZ PCSZ_LVMEXE = "LVM.EXE";
247PCSZ PCSZ_ARCCNR = "ArcCnr";
248PCSZ PCSZ_COLLECTOR = "Collector";
249PCSZ PCSZ_DIRCNR = "DirCnr";
[1409]250PCSZ PCSZ_DIRCMP = "DirCmp";
[1402]251PCSZ PCSZ_DIRSIZES = "DirSizes";
252PCSZ PCSZ_TOOLBAR = "ToolBar";
253PCSZ PCSZ_TREECNR = "TreeCnr";
254PCSZ PCSZ_SHUTDOWNSTATE = "FM2Shutdown";
255PCSZ PCSZ_FM2TEMPTEXT = "FM/2_Temp";
256PCSZ DRF_FM2ARCHIVE = "DRF_FM2ARCHIVE";
257PCSZ DRMDRFFM2ARC = "<DRM_FM2ARCMEMBER,DRF_FM2ARCHIVE>";
258PCSZ DRMDRFOS2FILE = "<DRM_OS2FILE,DRF_UNKNOWN>";
259PCSZ DRM_FM2ARCMEMBER = "DRM_FM2ARCMEMBER";
260PCSZ DRM_OS2FILE = "DRM_OS2FILE";
261PCSZ FM2Str = "FM/2";
[1209]262HMODULE FM3DllHandle;
[1402]263PCSZ FM3Folder = "<FM3_Folder>";
[1436]264PCSZ FNT_HELVETICA = "Helvetica";
[1402]265PCSZ FNT_6HELVETICA = "6.Helvetica";
266PCSZ FNT_8HELVETICA = "8.Helvetica";
267PCSZ FNT_8HELVETICABOLD = "8.Helvetica.Bold";
268PCSZ FNT_10SYSTEMMONOTEXT = "10.System Monospaced";
269PCSZ FNT_10SYSTEMPROPORT = "10.System Proportional";
270PCSZ FNT_2SYSTEMVIO = "2.System VIO";
271PCSZ FNT_4SYSTEMVIO = "4.System VIO";
272PCSZ FNT_10SYSTEMVIO = "10.System VIO";
273PCSZ FNT_8TIMESNEWROMAN = "8.Times New Roman";
[1209]274CHAR HomePath[CCHMAXPATH];
[1402]275PCSZ LONGNAME = ".LONGNAME";
276CHAR *NullStr = "";
277PCSZ PCSZ_CM_ALLOCRECORD = "CM_ALLOCRECORD";
278PCSZ PCSZ_DOSCREATEMUTEXSEM = "DosCreateMutexSem";
[1450]279PCSZ PCSZ_DOSCREATEEVENTSEM = "DosCreateEventSem";
[1402]280PCSZ PCSZ_DOSDUPHANDLE = "DosDupHandle";
281PCSZ PCSZ_DOSGETINFOBLOCKS = "DosGetInfoBlocks";
282PCSZ PCSZ_DOSQUERYPATHINFO = "DosQueryPathInfo";
283PCSZ PCSZ_DOSSEARCHPATH = "DosSearchPath";
284PCSZ PCSZ_DRGACCESSDRAGINFO = "DrgAccessDraginfo";
285PCSZ PCSZ_POSTMSG = "PostMsg";
286PCSZ PCSZ_WINCREATEWINDOW = "WinCreateWindow";
287PCSZ PCSZ_WINLOADACCELTABLE = "WinLoadAccelTable";
288PCSZ PCSZ_WINSETACCELTABLE = "WinSetAccelTable";
289PCSZ PCSZ_INIQUERYPRFTEXT = "PrfQueryProfile";
290PCSZ PCSZ_PRFOPENPROFILEFAILED = "PrfOpenProfile failed for %s";
291PCSZ PCSZ_PRFQUERYPROFILEDATA = "PrfQueryProfileData";
292PCSZ PCSZ_PRFQUERYPROFILESIZE = "PrfQueryProfileSize";
293PCSZ PCSZ_PRFQUERYPROFILESTRING = "PrfQueryProfileString";
294PCSZ PCSZ_FILLDIRQCURERRTEXT = "DosQCurDisk";
295PCSZ PCSZ_NODATA = "No Data";
[1438]296PCSZ PCSZ_BACKSLASH = "\\";
[1402]297PCSZ PCSZ_STARDOTEXE = "*.EXE";
298PCSZ PCSZ_STARDOTINI = "*.INI";
299PCSZ PCSZ_STARDOTLST = "*.LST";
300PCSZ PCSZ_STARDOTPMD = "*.PMD";
301PCSZ PCSZ_STARDOTTXT = "*.TXT";
302PCSZ PCSZ_DOTEXE = ".EXE";
303PCSZ PCSZ_DOTCOM = ".COM";
304PCSZ PCSZ_DOTCMD = ".CMD";
305PCSZ PCSZ_DOTBTM = ".BTM";
306PCSZ PCSZ_DOTBAT = ".BAT";
307PCSZ PCSZ_DOTLST = ".LST";
308PCSZ PCSZ_DOTTLS = ".TLS";
309PCSZ PCSZ_DOTHLP = ".HLP";
310PCSZ PCSZ_DOTINF = ".INF";
311PCSZ PCSZ_DOTMP3 = ".MP3";
[1479]312PCSZ PCSZ_DOTMPG = ".MPG";
313PCSZ PCSZ_DOTMPEG = ".MPEG";
[1402]314PCSZ PCSZ_DOTOGG = ".OGG";
315PCSZ PCSZ_DOTFLAC = ".FLAC";
316PCSZ PCSZ_DOTJPEG = ".JPEG";
317PCSZ PCSZ_DOTJPG = ".JPG";
318PCSZ PCSZ_DOTICO = ".ICO";
319PCSZ PCSZ_DOTPTR = ".PTR";
320PCSZ PCSZ_DOTBB2 = ".BB2";
321PCSZ PCSZ_DOTBMP = ".BMP";
322PCSZ PCSZ_DOTCOMMENTS = ".COMMENTS";
323PCSZ PCSZ_PATH = "PATH";
324PCSZ PCSZ_LIBPATH = "LIBPATH";
325CHAR *pLibPathStrict = "SET LIBPATHSTRICT=TRUE";
326PCSZ PCSZ_WPURLDEFAULTSETTINGS = "WPURLDEFAULTSETTINGS";
327PCSZ Settings = "SETTINGS";
328PCSZ Details = "DETAILS";
329PCSZ PCSZ_TREE = "TREE";
330PCSZ PCSZ_ICON = "ICON";
[1209]331CHAR SwapperDat[CCHMAXPATH];
[1402]332PCSZ WC_OBJECTWINDOW = "WC_OBJECTWINDOW";
333PCSZ WC_BUBBLE = "WC_BUBBLE";
334PCSZ WC_TOOLBUTTONS = "WC_TOOLBUTTONS";
335PCSZ WC_DRIVEBUTTONS = "WC_DRIVEBUTTONS";
336PCSZ WC_DIRCONTAINER = "WC_DIRCONTAINER";
337PCSZ WC_DIRSTATUS = "WC_DIRSTATUS";
338PCSZ WC_TREECONTAINER = "WC_TREECONTAINER";
339PCSZ WC_TREEOPENBUTTON = "WC_TREEOPENBUTTON";
340PCSZ WC_TREESTATUS = "WC_TREESTATUS";
341PCSZ WC_MAINWND = "WC_MAINWND";
342PCSZ WC_MAINWND2 = "WC_MAINWND2";
343PCSZ WC_AUTOVIEW = "WC_AUTOVIEW";
344PCSZ WC_LED = "WC_LED";
345PCSZ WC_COLLECTOR = "WC_COLLECTOR";
346PCSZ WC_COLSTATUS = "WC_COLSTATUS";
347PCSZ WC_STATUS = "WC_STATUS";
348PCSZ WC_TOOLBACK = "WC_TOOLBACK";
349PCSZ WC_DRIVEBACK = "WC_DRIVEBACK";
350PCSZ WC_ARCCONTAINER = "WC_ARCCONTAINER";
351PCSZ WC_ARCSTATUS = "WC_ARCSTATUS";
352PCSZ WC_MLEEDITOR = "WC_MLEEDITOR";
353PCSZ WC_INIEDITOR = "WC_INIEDITOR";
354PCSZ WC_SEEALL = "WC_SEEALL";
355PCSZ WC_NEWVIEW = "WC_NEWVIEW";
356PCSZ WC_SEESTATUS = "WC_SEESTATUS";
357PCSZ WC_VIEWSTATUS = "WC_VIEWSTATUS";
358PCSZ WC_ERRORWND = "WC_ERRORWND";
359PCSZ WC_MINITIME = "WC_MINITIME";
360PCSZ WC_DATABAR = "WC_DATABAR";
[1209]361CHAR profile[CCHMAXPATH];
362ULONGLONG ullTmpSpaceNeeded;
[1156]363
[985]364BOOL CheckFileHeader(CHAR *filespec, CHAR *signature, LONG offset);
365
[189]366VOID FindSwapperDat(VOID)
367{
[201]368 CHAR filename[] = "C:\\CONFIG.SYS";
369 CHAR input[8192];
370 CHAR *p;
371 CHAR *pp;
[189]372 FILE *fp;
[849]373 FILEFINDBUF3L ffb;
[201]374 ULONG nm;
375 ULONG size = sizeof(SwapperDat);
[189]376 HDIR hdir = HDIR_CREATE;
[201]377 APIRET rc = 1;
[2]378
379 *SwapperDat = 0;
[201]380 // Check already known
[803]381 PrfQueryProfileData(fmprof, FM3Str, "SwapperDat", SwapperDat, &size);
[551]382 if (*SwapperDat) {
[201]383 nm = 1;
[843]384 rc = DosFindFirst(SwapperDat,
[1335]385 &hdir,
386 FILE_NORMAL | FILE_ARCHIVED |
387 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
388 &ffb, sizeof(ffb), &nm, FIL_STANDARDL);
[850]389 if (rc && rc != ERROR_FILE_NOT_FOUND && rc != ERROR_PATH_NOT_FOUND) {
[849]390 FILEFINDBUF3 ffb;
391 rc = DosFindFirst(SwapperDat,
[1335]392 &hdir,
393 FILE_NORMAL | FILE_ARCHIVED |
394 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
395 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
[849]396 fNoLargeFileSupport = TRUE;
397 }
[551]398 if (!rc) {
[2]399 DosFindClose(hdir);
[189]400 fp = fopen(SwapperDat, "r");
[551]401 if (fp) {
[1335]402 fclose(fp);
403 *SwapperDat = 0;
404 rc = 1; // Force config.sys scan
[2]405 }
406 }
407 else
408 *SwapperDat = 0;
409 }
[201]410 // If not defined in INI or INI wrong, scan config.sys for SWAPPATH statement
[551]411 if (rc) {
[189]412 if (DosQuerySysInfo(QSV_BOOT_DRIVE,
[1335]413 QSV_BOOT_DRIVE,
414 &nm,
415 sizeof(ULONG))) {
[1156]416 nm = 3; // Assume drive C:
[201]417 }
[551]418 *filename = (CHAR) nm + '@';
[404]419 fp = xfsopen(filename, "r", SH_DENYNO, pszSrcFile, __LINE__);
[551]420 if (fp) {
[404]421 while (!feof(fp)) {
[1335]422 if (!xfgets(input, sizeof(input), fp, pszSrcFile, __LINE__))
423 break;
424 lstrip(input);
425 if (!strnicmp(input, "SWAPPATH", 8)) {
426 p = input + 8;
427 while (*p == ' ')
428 p++;
429 if (*p == '=') {
430 p++;
431 stripcr(p);
432 rstrip(p);
433 while (*p == ' ')
434 p++;
435 if (*p == '\"') {
436 p++;
437 pp = p;
438 while (*pp && *pp != '\"')
439 *pp += 1;
440 if (*pp)
441 *pp = 0;
442 }
443 else {
444 pp = strchr(p, ' ');
445 if (pp)
446 *pp = 0;
447 }
448 if (*p) {
449 strncpy(SwapperDat, p, CCHMAXPATH);
450 SwapperDat[CCHMAXPATH - 1] = 0;
451 BldFullPathName(SwapperDat, SwapperDat, "SWAPPER.DAT");
452 hdir = HDIR_CREATE;
453 nm = 1;
454 rc = DosFindFirst(SwapperDat,
455 &hdir,
456 FILE_NORMAL | FILE_ARCHIVED |
457 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
458 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
459 if (rc){
460 FILEFINDBUF3 ffb;
461 rc = DosFindFirst(SwapperDat,
462 &hdir,
463 FILE_NORMAL | FILE_ARCHIVED |
464 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY,
465 &ffb, sizeof(ffb), &nm, FIL_STANDARD);
466 fNoLargeFileSupport = TRUE;
467 }
468 if (!rc) {
469 DosFindClose(hdir);
470 PrfWriteProfileString(fmprof,
471 FM3Str, "SwapperDat", SwapperDat);
472 }
473 else
474 *SwapperDat = 0;
475 break;
476 }
477 }
478 } // if SWAPPATH
[1156]479 } // while
[2]480 fclose(fp);
481 }
482 }
483}
484
[690]485unsigned APIENTRY LibMain(unsigned hModule,
[1335]486 unsigned ulFlag)
[690]487{
488 switch (ulFlag) {
489 case 0:
490 FM3DllHandle = hModule;
491
492 DosError(FERR_DISABLEHARDERR);
493 memset(&RGBBLACK, 0, sizeof(RGB2));
494 RGBGREY.bRed = RGBGREY.bGreen = RGBGREY.bBlue = (BYTE)204;
495 RGBGREY.fcOptions = 0;
[803]496 FM3UL = *(ULONG *)FM3Str;
[690]497 break;
498 case 1:
499 StopPrinting = 1;
500 if (fmprof)
501 PrfCloseProfile(fmprof);
502 DosError(FERR_ENABLEHARDERR);
503 break;
504 default:
505 return 0UL;
506 }
507 return 1UL;
508}
509
[189]510VOID APIENTRY DeInitFM3DLL(ULONG why)
511{
[2]512 /* cleanup */
[189]513 static CHAR s[CCHMAXPATH];
[1075]514 CHAR *enddir, szTempFile[CCHMAXPATH];
[189]515 HDIR search_handle;
516 ULONG num_matches;
[843]517 FILEFINDBUF3 ffb;
[2]518
519 StopTimer();
520 StopPrinting = 1;
521
[189]522 if (LogFileHandle)
[2]523 fclose(LogFileHandle);
524
[551]525 if (fmprof) {
[2]526 PrfCloseProfile(fmprof);
[189]527 fmprof = (HINI) 0;
[551]528 if (fIniExisted) {
[2]529 DosError(FERR_DISABLEHARDERR);
[551]530 DosCopy("FM3.INI", "FM3INI.BAK", DCPY_EXISTING);
[2]531 }
532 }
533
[189]534 if (fToolsChanged)
[2]535 save_tools(NULL);
[689]536 fcloseall();
[2]537 save_dir(s);
[1438]538 AddBackslashToPath(s);
539 //if (s[strlen(s) - 1] != '\\')
540 // strcat(s, "\\");
[2]541 enddir = &s[strlen(s)];
[551]542 if (*ArcTempRoot) {
[189]543 strcat(s, ArcTempRoot);
544 strcat(s, "*");
[2]545 search_handle = HDIR_CREATE;
546 num_matches = 1L;
[843]547 if (!DosFindFirst(s,
[1335]548 &search_handle,
549 FILE_NORMAL | FILE_DIRECTORY |
550 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
551 FILE_ARCHIVED,
552 &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) {
[551]553 do {
[1335]554 strcpy(enddir, ffb.achName);
555 if (ffb.attrFile & FILE_DIRECTORY) {
556 wipeallf("%s\\*", s);
557 DosDeleteDir(s);
558 }
559 else
[1402]560 unlinkf(s);
[189]561 }
[843]562 while (!DosFindNext(search_handle,
[1335]563 &ffb, sizeof(ffb), &num_matches));
[2]564 DosFindClose(search_handle);
565 }
566 }
[1082]567 if (pTmpDir)
568 strcpy(s, pTmpDir);
569 else
[1104]570 strcpy(s, pFM2SaveDirectory);
[1438]571 AddBackslashToPath(s);
572 //if (s[strlen(s) - 1] != '\\')
573 // strcat(s, "\\");
[2]574 enddir = &s[strlen(s)];
[1089]575 strcat(s, "$FM2LI$T.");
[189]576 strcat(s, "???");
[2]577 search_handle = HDIR_CREATE;
[838]578 num_matches = 1;
[843]579 if (!DosFindFirst(s,
[1335]580 &search_handle,
581 FILE_NORMAL | FILE_DIRECTORY |
582 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
583 FILE_ARCHIVED,
584 &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) {
[551]585 do {
[843]586 if (!(ffb.attrFile & FILE_DIRECTORY)) {
[1335]587 strcpy(enddir, ffb.achName);
[1402]588 unlinkf(s);
[2]589 }
[189]590 }
[843]591 while (!DosFindNext(search_handle,
[1335]592 &ffb, sizeof(ffb), &num_matches));
[2]593 DosFindClose(search_handle);
594 }
[1398]595 BldFullPathName(szTempFile, pTmpDir, PCSZ_FM2PLAYTEMP);
[1075]596 DosForceDelete(szTempFile);
[1082]597 if (pTmpDir) {
598 wipeallf("%s\\*", pTmpDir);
599 DosDeleteDir(pTmpDir);
600 }
[2]601 EndNote();
[189]602 if (FM3ModHandle)
[2]603 DosFreeModule(FM3ModHandle);
604
[551]605 DosExitList(EXLST_REMOVE, DeInitFM3DLL);
[2]606}
607
[189]608BOOL InitFM3DLL(HAB hab, int argc, char **argv)
609{
[2]610 /*
611 * this function should be called by any application using this DLL right
612 * after setting up a message queue
613 */
614
615 CLASSINFO clinfo;
[201]616 APIRET rc;
[1369]617 APIRET rcl;
618 APIRET rcq;
619 PFN pfnResVersion;
620 ULONG RVMajor;
621 ULONG RVMinor;
622 ULONG ret;
623 FILESTATUS3 fs3;
[803]624 PSZ env;
[201]625 CHAR dllfile[CCHMAXPATH];
626 ULONG size;
[2]627
[201]628 strcpy(dllfile, "FM3RES");
629 env = getenv("FM3INI");
[551]630 if (env) {
[201]631 DosError(FERR_DISABLEHARDERR);
[849]632 rc = DosQueryPathInfo(env, FIL_STANDARD, &fs3, sizeof(fs3));
[551]633 if (!rc) {
[803]634 if (fs3.attrFile & FILE_DIRECTORY) {
[1335]635 BldFullPathName(dllfile, env, "FM3RES"); // 23 Aug 07 SHL
636 DosError(FERR_DISABLEHARDERR);
637 if (DosQueryPathInfo(dllfile, FIL_STANDARD, &fs3, sizeof(fs3)))
638 strcpy(dllfile, "FM3RES");
[2]639 }
640 }
[201]641 }
[1369]642
[551]643 rcl = DosLoadModule(NULL, 0, dllfile, &FM3ModHandle);
644 if (rcl) {
[339]645 saymsg(MB_CANCEL | MB_ICONEXCLAMATION,
[1335]646 HWND_DESKTOP,
647 GetPString(IDS_ERRORTEXT), GetPString(IDS_FM3RESERROR1TEXT));
[339]648 return FALSE;
649 }
[1369]650
[339]651 rc = DosExitList(EXLST_ADD, DeInitFM3DLL);
[551]652 if (rc) {
[803]653 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
[1335]654 "DosExitList");
[339]655 }
[1369]656
[551]657 rcq = DosQueryProcAddr(FM3ModHandle, 1, "ResVersion", &pfnResVersion);
[201]658 if (!rcq)
659 ret = pfnResVersion(&RVMajor, &RVMinor);
[1369]660 else {
661 ret = 0;
662 RVMajor = 0;
663 RVMinor = 0;
[201]664 }
[1369]665
[551]666 if (RVMajor < VERMAJOR || (RVMajor == VERMAJOR && RVMinor < VERMINOR)) {
[201]667 saymsg(MB_ENTER,
[1335]668 HWND_DESKTOP,
669 GetPString(IDS_ERRORTEXT),
670 GetPString(IDS_FM3RESERROR2TEXT),
671 !rcq ?
672 GetPString(IDS_FM3RESERROR3TEXT) :
673 !rcl ?
674 GetPString(IDS_FM3RESERROR4TEXT) :
675 GetPString(IDS_FM3RESERROR5TEXT), RVMajor, RVMinor, rcl, rcq, ret);
[201]676 return FALSE;
[2]677 }
678
[189]679 if (!*profile)
680 strcpy(profile, "FM3.INI");
[2]681 mypid = getpid();
682 /* give default appname if none set by caller */
[189]683 if (!*appname)
684 strcpy(appname, FM3Str);
[2]685 /* save appname; may be reset below */
[189]686 strcpy(realappname, appname);
687 if (!strcmp(appname, FM3Str))
[803]688 DosSetMaxFH(100);
[189]689 else if (!strcmp(appname, "VDir") ||
[1335]690 !strcmp(appname, "VTree") ||
691 !strcmp(appname, "VCollect") ||
692 !strcmp(appname, "SEEALL") || !strcmp(appname, "FM/4"))
[803]693 DosSetMaxFH(60);
[2]694 else
[803]695 DosSetMaxFH(40);
[2]696
[189]697 if (DosQuerySysInfo(QSV_VERSION_MAJOR,
[1335]698 QSV_VERSION_MINOR,
699 OS2ver,
700 sizeof(OS2ver))) {
[2]701 OS2ver[0] = 2;
702 OS2ver[1] = 1;
703 }
704
[1082]705 // set up default root names for temp file storage and archive goodies
[1069]706 env = getenv("TMP");
[1074]707 if (env == NULL)
708 env = getenv("TEMP");
[1069]709 if (env != NULL) {
710 DosError(FERR_DISABLEHARDERR);
711 rc = DosQueryPathInfo(env, FIL_STANDARD, &fs3, sizeof(fs3));
712 if (!rc) {
[1089]713 CHAR *enddir, *p, szTempName[CCHMAXPATH], temp[CCHMAXPATH];
714 FILEFINDBUF3 ffb;
715 HDIR search_handle;
716 ULONG num_matches, ul;
717
718 strcpy(szTempName, env);
[1438]719 AddBackslashToPath(szTempName);
720 //if (szTempName[strlen(szTempName) - 1] != '\\')
721 // strcat(szTempName, "\\");
[1089]722 enddir = &szTempName[strlen(szTempName)];
723 strcat(szTempName, "$FM2????.");
724 strcat(szTempName, "???");
725 search_handle = HDIR_CREATE;
726 num_matches = 1;
727 if (!DosFindFirst(szTempName,
[1335]728 &search_handle,
729 FILE_NORMAL | FILE_DIRECTORY |
730 FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN |
731 FILE_ARCHIVED,
732 &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) {
733 do {
734 strcpy(enddir, ffb.achName);
735 p = strrchr(szTempName, '.');
736 if (p) {
737 p++;
738 ul = strtol(p, &p + 2, 16);
739 GetDosPgmName(ul, temp);
740 if (!strstr(temp, "FM/2") &&
741 !strstr(temp, "AV/2")) {
742 wipeallf("%s\\*", szTempName);
743 DosDeleteDir(szTempName);
744 }
745 }
746 }
[1089]747 while (!DosFindNext(search_handle,
[1335]748 &ffb, sizeof(ffb), &num_matches));
[1089]749 DosFindClose(search_handle);
750 }
[1069]751 if (fs3.attrFile & FILE_DIRECTORY) {
[1335]752 strcpy(szTempName, env);
753 MakeTempName(szTempName, NULL, 1);
[1369]754 rc = DosCreateDir(szTempName, 0);
755 if (!rc)
756 pTmpDir = xstrdup(szTempName, pszSrcFile, __LINE__); // if writable
[1335]757 }
[1069]758 }
759 }
[2]760
[1082]761 //Save the FM2 save directory name. This is the location of the ini, dat files etc.
762 {
763 CHAR temp[CCHMAXPATH];
764 save_dir2(temp);
765 pFM2SaveDirectory = xstrdup(temp, pszSrcFile, __LINE__);
766 }
[1120]767 // Check free space on TMP and FM2 Save drives
[1112]768 {
769 ullTmpSpaceNeeded = 5120000;
770 if (pTmpDir && CheckDriveSpaceAvail(pTmpDir, ullTmpSpaceNeeded, 0) == 1) {
771 if (CheckDriveSpaceAvail(pFM2SaveDirectory, ullTmpSpaceNeeded, 0) == 0){
[1335]772 ret = saymsg(MB_YESNO,
773 HWND_DESKTOP,
774 NullStr,
775 GetPString(IDS_TMPDRIVESPACELIMITED),
776 pTmpDir);
777 if (ret == MBID_YES)
778 pTmpDir = pFM2SaveDirectory;
[1112]779 }
780 else
[1335]781 saymsg(MB_OK,
782 HWND_DESKTOP,
783 NullStr,
784 GetPString(IDS_SAVETMPDRIVESPACELIMITED),
785 pTmpDir,
786 pFM2SaveDirectory);
[1112]787 }
788 else if (CheckDriveSpaceAvail(pFM2SaveDirectory, ullTmpSpaceNeeded, 0) == 1)
789 saymsg(MB_OK,
[1335]790 HWND_DESKTOP,
791 NullStr,
792 GetPString(IDS_SAVEDRIVESPACELIMITED),
793 pFM2SaveDirectory);
[1112]794 }
795 BldFullPathName(ArcTempRoot, pTmpDir, fAmAV2 ? "$AV$ARC$" : "$FM$ARC$");
796
[1082]797 // initialize random number generator
[2]798 srand(time(NULL) + clock());
799
800 priority_bumped();
801
802 /* _heapmin() is done in a separate thread -- start it */
[1335]803 if (xbeginthread(HeapThread,
804 32768,
805 MPVOID,
806 pszSrcFile,
807 __LINE__) == -1) {
[339]808 return FALSE;
809 }
[917]810
[189]811 /* timer messages are sent from a separate thread -- start it */
[803]812 if (!StartTimer()) {
813 Runtime_Error(pszSrcFile, __LINE__,
[1335]814 GetPString(IDS_COULDNTSTARTTHREADTEXT));
[2]815 return FALSE;
[803]816 }
[2]817
[718]818 /* Are we the workplace shell? */
[705]819 env = getenv("WORKPLACE_PROCESS");
[718]820 fWorkPlace = env != NULL &&
[1335]821 (stricmp(env, "YES") == 0 || atoi(env) == 1);
[718]822
[189]823 if ((!strchr(profile, '\\') && !strchr(profile, ':')) ||
[803]824 !(fmprof = PrfOpenProfile((HAB)0, profile)))
825 {
[2]826 /* figure out where to put INI file... */
[803]827 CHAR inipath[CCHMAXPATH];
[2]828
829 DosError(FERR_DISABLEHARDERR);
[1104]830 strcpy(HomePath, pFM2SaveDirectory);
[2]831 DosError(FERR_DISABLEHARDERR);
[189]832 memset(driveserial, -1, sizeof(driveserial));
[2]833 *inipath = 0;
834 env = getenv("FM3INI");
[551]835 if (env) {
[189]836 strcpy(inipath, env);
[2]837 DosError(FERR_DISABLEHARDERR);
[849]838 rc = DosQueryPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3));
[551]839 if (!rc) {
[1335]840 if (fs3.attrFile & FILE_DIRECTORY)
841 BldFullPathName(inipath, inipath, profile);
[2]842 }
843 }
[551]844 if (!env) {
[2]845 env = searchpath(profile);
[189]846 if (!env)
[1335]847 env = profile;
[189]848 strcpy(inipath, env);
[2]849 }
[201]850
[2]851 /* in some odd cases the INI file can get set to readonly status */
852 /* here we test it and reset the readonly bit if necessary */
[201]853 if (!*inipath)
854 strcpy(inipath, profile);
855 DosError(FERR_DISABLEHARDERR);
[1395]856 // fixme to check for backup if ini not found GKY 1-30-09
[917]857 rc = DosQueryPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3));
858 if (rc) {
859 if (rc == ERROR_FILE_NOT_FOUND)
860 fWantFirstTimeInit = TRUE;
861 }
[1395]862 else { //Check the ini file header and restore from backup if corupted
[989]863 if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
[1395]864 saymsg(MB_ENTER,HWND_DESKTOP, GetPString(IDS_DEBUG_STRING),
865 GetPString(IDS_INIFAILURETEXT));
[1335]866 DosCopy("FM3.INI", "FM3INI.BAD", DCPY_EXISTING);
867 DosCopy("FM3INI.BAK", "FM3.INI", DCPY_EXISTING);
868 if (!CheckFileHeader(inipath, "\xff\xff\xff\xff\x14\x00\x00\x00", 0L)) {
869 DosCopy("FM3.INI", "FM3INI2.BAD", DCPY_EXISTING);
870 fWantFirstTimeInit = TRUE;
871 }
[2]872 }
[989]873 if (!fWantFirstTimeInit) {
[1335]874 fIniExisted = TRUE;
875 if (fs3.attrFile & (FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM)) {
876 fs3.attrFile &= ~(FILE_READONLY | FILE_HIDDEN | FILE_SYSTEM);
877 rc = xDosSetPathInfo(inipath, FIL_STANDARD, &fs3, sizeof(fs3), 0);
878 if (rc) {
879 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
880 GetPString(IDS_INIREADONLYTEXT), inipath);
881 }
882 }
[989]883 }
[2]884 }
[803]885 fmprof = PrfOpenProfile((HAB)0, inipath);
[551]886 if (!fmprof) {
[189]887 strcpy(inipath, "FM3.INI");
[803]888 fmprof = PrfOpenProfile((HAB)0, inipath);
[2]889 }
[201]890
[917]891 // 10 Jan 08 SHL fixme to do first time if new ini
892 // 10 Jan 08 SHL post UM_FIRSTTIME to main window
[551]893 if (!fmprof) {
894 Win_Error(NULLHANDLE, NULLHANDLE, pszSrcFile, __LINE__,
[1402]895 PCSZ_PRFOPENPROFILEFAILED, inipath);
[2]896 return FALSE;
897 }
898 }
899
[1363]900 ArgDriveFlags(argc, argv);
901 FillInDriveFlags(NULL);
902
[2]903 FindSwapperDat();
904
[1328]905 size = sizeof(BOOL);
[201]906 PrfQueryProfileData(fmprof,
[1335]907 FM3Str,
908 "SeparateParms",
909 &fSeparateParms,
910 &size);
[201]911 if (!fSeparateParms)
912 strcpy(appname, FM3Str);
[2]913
914 /* start help */
[189]915 memset(&hini, 0, sizeof(HELPINIT));
[2]916 hini.cb = sizeof(HELPINIT);
[849]917 hini.ulReturnCode = 0;
[2]918 hini.pszTutorialName = NULL;
[189]919 hini.phtHelpTable = (PHELPTABLE) MAKELONG(ID_HELPTABLE, 0xffff);
920 hini.hmodAccelActionBarModule = (HMODULE) 0;
[2]921 hini.idAccelTable = 0;
922 hini.idActionBar = 0;
[1394]923 hini.pszHelpWindowTitle = (PSZ)GetPString(IDS_FM2HELPTITLETEXT);
[2]924 hini.fShowPanelId = CMIC_HIDE_PANEL_ID;
925 hini.pszHelpLibraryName = "FM3.HLP";
[189]926 hwndHelp = WinCreateHelpInstance(hab, &hini);
[551]927 if (!hwndHelp) {
[1156]928 static CHAR helppath[CCHMAXPATH]; // fixme to be local?
[2]929
930 env = getenv("FM3INI");
[551]931 if (env) {
[189]932 strcpy(helppath, env);
[2]933 DosError(FERR_DISABLEHARDERR);
[849]934 rc = DosQueryPathInfo(helppath, FIL_STANDARD, &fs3, sizeof(fs3));
[551]935 if (!rc) {
[1335]936 if (fs3.attrFile & FILE_DIRECTORY) {
937 BldFullPathName(helppath, helppath, "FM3.HLP");
938 hini.pszHelpLibraryName = helppath;
939 hwndHelp = WinCreateHelpInstance(hab, &hini);
940 }
[2]941 }
942 }
943 }
[551]944 if (!hwndHelp) {
[2]945 saymsg(MB_ENTER | MB_ICONEXCLAMATION,
[1335]946 HWND_DESKTOP,
947 GetPString(IDS_FM2TROUBLETEXT),
948 GetPString(IDS_CANTLOADHELPTEXT),
949 GetPString(IDS_NOHELPACCEPTTEXT));
[2]950 }
951
[1365]952 // a couple of default window procs so we don't have to look them up later
[189]953 if (WinQueryClassInfo(hab, WC_CONTAINER, &clinfo))
[2]954 PFNWPCnr = clinfo.pfnWindowProc;
[189]955 if (WinQueryClassInfo(hab, WC_FRAME, &clinfo))
[2]956 PFNWPFrame = clinfo.pfnWindowProc;
[189]957 if (WinQueryClassInfo(hab, WC_BUTTON, &clinfo))
[2]958 PFNWPButton = clinfo.pfnWindowProc;
[189]959 if (WinQueryClassInfo(hab, WC_STATIC, &clinfo))
[2]960 PFNWPStatic = clinfo.pfnWindowProc;
[189]961 if (WinQueryClassInfo(hab, WC_MLE, &clinfo))
[2]962 PFNWPMLE = clinfo.pfnWindowProc;
[551]963 if (!PFNWPCnr || !PFNWPFrame || !PFNWPButton || !PFNWPStatic || !PFNWPMLE) {
[339]964 Runtime_Error(pszSrcFile, __LINE__, "WinQueryClassInfo");
[2]965 return FALSE;
966 }
967
968 /* register window classes we use */
969 WinRegisterClass(hab,
[1335]970 WC_MAINWND,
971 MainWndProc,
972 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 8);
[2]973 WinRegisterClass(hab,
[1335]974 WC_MAINWND2,
975 MainWndProc2,
976 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 4);
[2]977 WinRegisterClass(hab,
[1335]978 WC_TREECONTAINER,
979 TreeClientWndProc,
980 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]981 WinRegisterClass(hab,
[1335]982 WC_DIRCONTAINER,
983 DirClientWndProc,
984 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]985 WinRegisterClass(hab,
[1335]986 WC_COLLECTOR,
987 CollectorClientWndProc,
988 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]989 WinRegisterClass(hab,
[1335]990 WC_ARCCONTAINER,
991 ArcClientWndProc,
992 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]993 WinRegisterClass(hab,
[1335]994 WC_MLEEDITOR,
995 MLEEditorProc,
996 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]997 WinRegisterClass(hab,
[1335]998 WC_INIEDITOR,
999 IniProc,
1000 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
[2]1001 WinRegisterClass(hab,
[1335]1002 WC_TOOLBACK,
1003 ToolBackProc,
1004 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1005 sizeof(PVOID));
[2]1006 WinRegisterClass(hab,
[1335]1007 WC_DRIVEBACK,
1008 DriveBackProc,
1009 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1010 sizeof(PVOID));
[2]1011 WinRegisterClass(hab,
[1335]1012 WC_SEEALL,
1013 SeeAllWndProc,
1014 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
[2]1015 WinRegisterClass(hab,
[1335]1016 WC_NEWVIEW,
1017 ViewWndProc,
1018 CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
[2]1019 WinRegisterClass(hab,
[1335]1020 WC_TOOLBUTTONS,
1021 ChildButtonProc,
1022 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1023 sizeof(PVOID));
[2]1024 WinRegisterClass(hab,
[1335]1025 WC_DRIVEBUTTONS,
1026 DriveProc,
1027 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1028 sizeof(PVOID));
[2]1029 WinRegisterClass(hab,
[1335]1030 WC_BUBBLE,
1031 BubbleProc,
1032 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1033 sizeof(ULONG) * 2);
[2]1034 WinRegisterClass(hab,
[1335]1035 WC_STATUS,
1036 StatusProc,
1037 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1038 sizeof(ULONG));
[2]1039 WinRegisterClass(hab,
[1335]1040 WC_DIRSTATUS,
1041 DirTextProc,
1042 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1043 sizeof(ULONG));
[2]1044 WinRegisterClass(hab,
[1335]1045 WC_TREESTATUS,
1046 TreeStatProc,
1047 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1048 sizeof(ULONG));
[2]1049 WinRegisterClass(hab,
[1335]1050 WC_ARCSTATUS,
1051 ArcTextProc,
1052 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1053 sizeof(ULONG));
[2]1054 WinRegisterClass(hab,
[1335]1055 WC_COLSTATUS,
1056 CollectorTextProc,
1057 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1058 sizeof(ULONG));
[2]1059 WinRegisterClass(hab,
[1335]1060 WC_SEESTATUS,
1061 SeeStatusProc,
1062 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1063 sizeof(ULONG));
[2]1064 WinRegisterClass(hab,
[1335]1065 WC_VIEWSTATUS,
1066 ViewStatusProc,
1067 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1068 sizeof(ULONG));
[2]1069 WinRegisterClass(hab,
[1335]1070 WC_ERRORWND,
1071 NotifyWndProc,
1072 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1073 sizeof(PVOID));
[2]1074 WinRegisterClass(hab,
[1335]1075 WC_MINITIME,
1076 MiniTimeProc,
1077 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1078 sizeof(PVOID) * 2);
[2]1079 WinRegisterClass(hab,
[1335]1080 WC_DATABAR,
1081 DataProc, CS_SIZEREDRAW, sizeof(PVOID));
[2]1082 WinRegisterClass(hab,
[1335]1083 WC_TREEOPENBUTTON,
1084 OpenButtonProc,
1085 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1086 sizeof(PVOID));
[2]1087 WinRegisterClass(hab,
[1335]1088 WC_AUTOVIEW,
1089 AutoViewProc,
1090 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1091 sizeof(PVOID));
[2]1092 WinRegisterClass(hab,
[1335]1093 WC_LED,
1094 LEDProc,
1095 CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
1096 sizeof(PVOID));
[2]1097
[1333]1098 if (DosCreateMutexSem(NULL, &hmtxFM2Globals, 0L, FALSE))
[1312]1099 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
[1398]1100 PCSZ_DOSCREATEMUTEXSEM);
[1333]1101 if (DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE))
[1312]1102 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
[1471]1103 PCSZ_DOSCREATEMUTEXSEM);
[1444]1104 if (DosCreateMutexSem(NULL, &hmtFillingTreeCnr, 0L, FALSE))
1105 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
[1479]1106 PCSZ_DOSCREATEMUTEXSEM);
[1444]1107 if (DosCreateEventSem(NULL, &hevInitialCnrScanComplete, 0L, FALSE))
1108 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
[1471]1109 PCSZ_DOSCREATEEVENTSEM);
[1320]1110
[1475]1111 /**
[201]1112 * set some defaults (note: everything else automatically initialized
[2]1113 * to 0)
1114 */
[1065]1115 dsDirCnrDefault.detailssize = dsDirCnrDefault.detailsea = dsDirCnrDefault.detailslwdate =
1116 dsDirCnrDefault.detailslwtime = dsDirCnrDefault.detailsattr = dsDirCnrDefault.detailsicon =
1117 fAutoTile = fConfirmDelete = fLoadSubject = fUnHilite =
[189]1118 fLoadLongnames = fToolbar = fSaveState = fGuessType = fToolbarHelp =
1119 fAutoAddDirs = fUseNewViewer = fDataToFore = fDataShowDrives =
1120 fSplitStatus = fDragndropDlg = fQuickArcFind = fKeepCmdLine =
1121 fMoreButtons = fDrivebar = fCollapseFirst = fSwitchTree =
1122 fSwitchTreeExpand = fNoSearch = fCustomFileDlg = fOtherHelp =
1123 fSaveMiniCmds = fUserComboBox = fFM2Deletes = fConfirmTarget =
[1376]1124 fShowTarget = fDrivebarHelp = fCheckMM = fInitialDriveScan =
1125 fEjectRemovableScan = fRScanLocal = TRUE;
[2]1126 ulCnrType = CCS_EXTENDSEL;
[789]1127 FilesToGet = FILESTOGET_MIN;
[985]1128 MaxComLineStrg = MAXCOMLINESTRGDEFAULT;
[752]1129 AutoviewHeight = 48;
[1333]1130 //strcpy(printer, "PRN");
[2]1131 prnwidth = 80;
1132 prnlength = 66;
1133 prntmargin = 6;
1134 prnbmargin = 6;
1135 prnlmargin = 6;
1136 prnrmargin = 3;
1137 prnspacing = 1;
1138 prntabspaces = 8;
1139 CollectorsortFlags = sortFlags = SORT_DIRSFIRST;
[1117]1140 ullDATFileSpaceNeeded = 10000;
[2]1141
[860]1142 //Get default Country info
1143 {
1144 COUNTRYCODE Country = {0};
1145 ULONG ulInfoLen = 0;
1146 COUNTRYINFO CtryInfo = {0};
1147
[1395]1148 if (!DosQueryCtryInfo(sizeof(CtryInfo), &Country, &CtryInfo, &ulInfoLen)) {
1149 *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
1150 strcpy(DateSeparator, CtryInfo.szDateSeparator);
1151 strcpy(TimeSeparator, CtryInfo.szTimeSeparator);
1152 ulDateFmt = CtryInfo.fsDateFmt;
1153 ulTimeFmt = CtryInfo.fsTimeFmt;
1154 //DbgMsg(pszSrcFile, __LINE__, "Date Fmt %x", ulDateFmt);
[860]1155 }
[1395]1156 else {
1157 strcpy(ThousandsSeparator, ",");
1158 strcpy(DateSeparator, "/");
1159 strcpy(TimeSeparator, ":");
1160 ulDateFmt = 0;
1161 ulTimeFmt = 0;
1162 }
1163 }
[1360]1164 { // Check for the existance of various partitioning tools to set up menu items
1165 CHAR *FullPath;
1166 ULONG ulAppType;
[860]1167
[1400]1168 FullPath = searchapath(PCSZ_PATH, PCSZ_LVMGUICMD);
[1369]1169 if (*FullPath)
1170 fLVMGui = TRUE;
[1439]1171 if (!xDosQueryAppType(PCSZ_DFSOS2EXE, &ulAppType))
[1360]1172 fDFSee = TRUE;
[1439]1173 if (!xDosQueryAppType(PCSZ_MINILVMEXE, &ulAppType))
[1369]1174 fMiniLVM = TRUE;
[1439]1175 if (!xDosQueryAppType(PCSZ_FDISKPMEXE, &ulAppType))
[1369]1176 fFDisk = TRUE;
[1439]1177 if (!xDosQueryAppType(PCSZ_LVMEXE, &ulAppType))
[1369]1178 fLVM = TRUE;
1179
1180 // Check to see if we are running protect only
[1439]1181 if (!xDosQueryAppType(GetCmdSpec(TRUE), &ulAppType)) {
[1452]1182 HMODULE hmod;
1183 APIRET rc;
1184
1185 rc = DosQueryModuleHandle("VKBD", &hmod);
1186 if (rc != NO_ERROR) {
[1471]1187 fProtectOnly = TRUE;
[1475]1188 //DbgMsg(pszSrcFile, __LINE__, "DosQModuleHandle VKBD returned %d fProtectOnly=%d", rc, fProtectOnly);
[1452]1189 }
1190 else {
[1471]1191 rc = DosQueryModuleHandle("VMOUSE", &hmod);
1192 if (rc != NO_ERROR) {
1193 fProtectOnly = TRUE;
[1475]1194 //DbgMsg(pszSrcFile, __LINE__, "DosQModuleHandle VMOUSE returned %d fProtectOnly=%d", rc, fProtectOnly);
[1471]1195 }
[1452]1196 }
[1369]1197 }
1198 else
1199 fProtectOnly = TRUE;
[1360]1200 }
1201
[201]1202 // load preferences from profile (INI) file
[1328]1203 size = sizeof(ULONG);
1204 PrfQueryProfileData(fmprof, appname, "MaxComLineStrg", &MaxComLineStrg, &size);
[1004]1205 // Give user one chance to reset the default command line length to 1024 (4os2's unexpanded max)
1206 if (MaxComLineStrg == 2048) {
1207 BOOL MaxComLineChecked = FALSE;
1208
[1328]1209 size = sizeof(BOOL);
1210 PrfQueryProfileData(fmprof, appname, "MaxComLineChecked", &MaxComLineChecked, &size);
[1004]1211 if (!MaxComLineChecked) {
1212 ret = saymsg(MB_YESNO,
[1335]1213 HWND_DESKTOP,
1214 NullStr,
1215 GetPString(IDS_CHANGECMDLINELENGTHDEFAULT));
[1004]1216 if (ret == MBID_YES)
[1335]1217 MaxComLineStrg = 1024;
[1004]1218 MaxComLineChecked = TRUE;
[1333]1219 PrfWriteProfileData(fmprof, appname, "MaxComLineChecked", &MaxComLineChecked, sizeof(BOOL));
[1004]1220 }
1221 }
[985]1222 if (MaxComLineStrg < CMDLNLNGTH_MIN)
1223 MaxComLineStrg = CMDLNLNGTH_MIN;
1224 else if (MaxComLineStrg > CMDLNLNGTH_MAX)
1225 MaxComLineStrg = CMDLNLNGTH_MAX;
1226 editor = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1227 if (!editor)
1228 return 0; //already complained
1229 viewer = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1230 if (!viewer)
1231 return 0; //already complained
1232 virus = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1233 if (!virus)
1234 return 0; //already complained
1235 compare = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1236 if (!compare)
1237 return 0; //already complained
1238 binview = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1239 if (!binview)
1240 return 0; //already complained
1241 bined = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1242 if (!bined)
1243 return 0; //already complained
1244 dircompare = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1245 if (!dircompare)
1246 return 0; //already complained
1247 ftprun = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1248 if (!ftprun)
1249 return 0; //already complained
1250 httprun = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1251 if (!httprun)
1252 return 0; //already complained
1253 mailrun = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1254 if (!mailrun)
1255 return 0; //already complained
[1083]1256 pszTreeEnvVarList = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
1257 if (!pszTreeEnvVarList)
1258 return 0; //already complained
[1333]1259 size = sizeof(BOOL);
[1451]1260 PrfQueryProfileData(fmprof, appname, "DontSuggestAgain", &fDontSuggestAgain, &size);
1261 size = sizeof(BOOL);
[1328]1262 PrfQueryProfileData(fmprof, appname, "ShowTarget", &fShowTarget, &size);
[1333]1263 size = sizeof(BOOL);
[1328]1264 PrfQueryProfileData(fmprof, appname, "CheckMM", &fCheckMM, &size);
[1333]1265 size = sizeof(BOOL);
[1328]1266 PrfQueryProfileData(fmprof, appname, "ChangeTarget", &fChangeTarget, &size);
[1333]1267 size = sizeof(BOOL);
[1328]1268 PrfQueryProfileData(fmprof, appname, "ConfirmTarget", &fConfirmTarget, &size);
[1333]1269 size = sizeof(BOOL);
[1328]1270 PrfQueryProfileData(fmprof, FM3Str, "CustomFileDlg", &fCustomFileDlg, &size);
[1333]1271 size = sizeof(BOOL);
[1328]1272 PrfQueryProfileData(fmprof, FM3Str, "SaveMiniCmds", &fSaveMiniCmds, &size);
[1333]1273 size = sizeof(BOOL);
[1328]1274 PrfQueryProfileData(fmprof, appname, "SaveBigCmds", &fSaveBigCmds, &size);
[1333]1275 size = sizeof(BOOL);
[1328]1276 PrfQueryProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu, &size);
[1333]1277 size = sizeof(BOOL);
[1328]1278 PrfQueryProfileData(fmprof, FM3Str, "ThreadNotes", &fThreadNotes, &size);
[1333]1279 size = sizeof(BOOL);
[1328]1280 PrfQueryProfileData(fmprof, FM3Str, "Prnpagenums", &prnpagenums, &size);
[1333]1281 size = sizeof(BOOL);
[1328]1282 PrfQueryProfileData(fmprof, FM3Str, "Prnalt", &prnalt, &size);
[1333]1283 size = sizeof(BOOL);
[1328]1284 PrfQueryProfileData(fmprof, FM3Str, "Prnformat", &prnformat, &size);
[1333]1285 size = sizeof(BOOL);
1286 PrfQueryProfileData(fmprof, FM3Str, "Prnformfeedbefore", &prnformfeedbefore, &size);
1287 size = sizeof(BOOL);
1288 PrfQueryProfileData(fmprof, FM3Str, "Prnformfeedafter",&prnformfeedafter, &size);
[1328]1289 size = sizeof(ULONG);
1290 PrfQueryProfileData(fmprof, FM3Str, "Prntabspaces", &prntabspaces, &size);
[1333]1291 size = sizeof(ULONG);
[1328]1292 PrfQueryProfileData(fmprof, FM3Str, "Prnwidth", &prnwidth, &size);
[1333]1293 size = sizeof(ULONG);
[1328]1294 PrfQueryProfileData(fmprof, FM3Str, "Prnlength", &prnlength, &size);
[1333]1295 size = sizeof(ULONG);
[1328]1296 PrfQueryProfileData(fmprof, FM3Str, "Prntmargin", &prntmargin, &size);
[1333]1297 size = sizeof(ULONG);
[1328]1298 PrfQueryProfileData(fmprof, FM3Str, "Prnbmargin", &prnbmargin, &size);
[1333]1299 size = sizeof(ULONG);
[1328]1300 PrfQueryProfileData(fmprof, FM3Str, "Prnlmargin", &prnlmargin, &size);
[1333]1301 size = sizeof(ULONG);
[1328]1302 PrfQueryProfileData(fmprof, FM3Str, "Prnrmargin", &prnrmargin, &size);
[1333]1303 size = sizeof(ULONG);
[1328]1304 PrfQueryProfileData(fmprof, FM3Str, "Prnspacing", &prnspacing, &size);
1305 size = sizeof(BOOL);
1306 PrfQueryProfileData(fmprof, FM3Str, "NoDead", &fNoDead, &size);
[1333]1307 size = sizeof(BOOL);
[1328]1308 PrfQueryProfileData(fmprof, FM3Str, "NoFinger", &fNoFinger, &size);
[1333]1309 size = sizeof(BOOL);
[1395]1310 PrfQueryProfileData(fmprof, FM3Str, "AlertBeepOff", &fAlertBeepOff, &size);
1311 size = sizeof(BOOL);
1312 PrfQueryProfileData(fmprof, FM3Str, "ErrorBeepOff", &fErrorBeepOff, &size);
1313 size = sizeof(BOOL);
[1328]1314 PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, &size);
[1333]1315 size = sizeof(BOOL);
1316 PrfQueryProfileData(fmprof, appname, "SwitchTreeExpand", &fSwitchTreeExpand, &size);
1317 size = sizeof(BOOL);
1318 PrfQueryProfileData(fmprof, appname, "SwitchTreeOnFocus", &fSwitchTreeOnFocus, &size);
1319 size = sizeof(BOOL);
1320 PrfQueryProfileData(fmprof, appname, "CollapseFirst", &fCollapseFirst, &size);
1321 size = sizeof(BOOL);
1322 PrfQueryProfileData(fmprof, appname, "FilesInTree", &fFilesInTree, &size);
1323 size = sizeof(BOOL);
[1328]1324 PrfQueryProfileData(fmprof, FM3Str, "TopDir", &fTopDir, &size);
[1333]1325 size = sizeof(BOOL);
[1328]1326 PrfQueryProfileData(fmprof, FM3Str, "LookInDir", &fLookInDir, &size);
[1333]1327 PrfQueryProfileString(fmprof, appname, "DefArc", NULL, szDefArc, sizeof(szDefArc));
[1328]1328 size = sizeof(ULONG);
[201]1329 PrfQueryProfileData(fmprof, FM3Str, "AutoviewHeight",
[1335]1330 &AutoviewHeight, &size);
[1328]1331 size = sizeof(BOOL);
1332 PrfQueryProfileData(fmprof, FM3Str, "KeepCmdLine", &fKeepCmdLine, &size);
[551]1333 if (strcmp(realappname, "FM/4")) {
[1333]1334 size = sizeof(BOOL);
[1328]1335 PrfQueryProfileData(fmprof, FM3Str, "MoreButtons", &fMoreButtons, &size);
[1333]1336 size = sizeof(BOOL);
[1328]1337 PrfQueryProfileData(fmprof, FM3Str, "Drivebar", &fDrivebar, &size);
[201]1338 }
1339 else
1340 fDrivebar = fMoreButtons = TRUE;
[1333]1341 size = sizeof(BOOL);
[1328]1342 PrfQueryProfileData(fmprof, appname, "NoSearch", &fNoSearch, &size);
[1333]1343 size = sizeof(BOOL);
[1328]1344 PrfQueryProfileData(fmprof, appname, "GuessType", &fGuessType, &size);
[1333]1345 size = sizeof(BOOL);
[1328]1346 PrfQueryProfileData(fmprof, appname, "ViewChild", &fViewChild, &size);
[1333]1347 size = sizeof(BOOL);
[1328]1348 PrfQueryProfileData(fmprof, appname, "ShowEnv", &fShowEnv, &size);
[1333]1349 PrfQueryProfileString(fmprof, appname, "TreeEnvVarList", "PATH;DPATH;LIBPATH;HELP;BOOKSHELF;",
[1471]1350 pszTreeEnvVarList, MaxComLineStrg);
[1328]1351 size = sizeof(BOOL);
[1431]1352 PrfQueryProfileData(fmprof, FM3Str, "ShowDriveOnly", &fShowDriveOnly, &size);
1353 size = sizeof(BOOL);
[1434]1354 PrfQueryProfileData(fmprof, FM3Str, "ShowFSTypeInTree", &fShowFSTypeInTree, &size);
[1424]1355 size = sizeof(BOOL);
[1434]1356 PrfQueryProfileData(fmprof, FM3Str, "ShowDriveLabelInTree", &fShowDriveLabelInTree, &size);
1357 if (!fShowDriveOnly && !fShowFSTypeInTree && !fShowDriveLabelInTree)
1358 fShowDriveOnly = TRUE;
[1424]1359 size = sizeof(BOOL);
[1328]1360 PrfQueryProfileData(fmprof, appname, "LeaveTree", &fLeaveTree, &size);
[1333]1361 size = sizeof(BOOL);
[1328]1362 PrfQueryProfileData(fmprof, FM3Str, "Comments", &fComments, &size);
1363 size = sizeof(ULONG);
1364 PrfQueryProfileData(fmprof, appname, "WS_ANIMATE", &fwsAnimate, &size);
[201]1365 if (fwsAnimate)
1366 fwsAnimate = WS_ANIMATE;
[1328]1367 size = sizeof(BOOL);
[1333]1368 PrfQueryProfileData(fmprof, appname, "SelectedAlways", &fSelectedAlways, &size);
1369 size = sizeof(BOOL);
[1328]1370 PrfQueryProfileData(fmprof, FM3Str, "ToolbarHelp", &fToolbarHelp, &size);
[1333]1371 size = sizeof(BOOL);
[1328]1372 PrfQueryProfileData(fmprof, FM3Str, "OtherHelp", &fOtherHelp, &size);
[1333]1373 size = sizeof(BOOL);
[1328]1374 PrfQueryProfileData(fmprof, FM3Str, "DrivebarHelp", &fDrivebarHelp, &size);
[1333]1375 size = sizeof(BOOL);
[1328]1376 PrfQueryProfileData(fmprof, appname, "AutoAddDirs", &fAutoAddDirs, &size);
[1333]1377 size = sizeof(BOOL);
1378 PrfQueryProfileData(fmprof, appname, "AutoAddAllDirs", &fAutoAddAllDirs, &size);
1379 size = sizeof(BOOL);
1380 PrfQueryProfileData(fmprof, FM3Str, "UserListSwitches", &fUserListSwitches, &size);
1381 size = sizeof(BOOL);
1382 PrfQueryProfileData(fmprof, appname, "UseNewViewer", &fUseNewViewer, &size);
1383 size = sizeof(BOOL);
1384 PrfQueryProfileData(fmprof, appname, "DefaultDeletePerm", &fDefaultDeletePerm, &size);
1385 size = sizeof(BOOL);
1386 PrfQueryProfileData(fmprof, FM3Str, "ExternalINIs", &fExternalINIs, &size);
1387 size = sizeof(BOOL);
1388 PrfQueryProfileData(fmprof, FM3Str, "ExternalCollector", &fExternalCollector, &size);
1389 size = sizeof(BOOL);
1390 PrfQueryProfileData(fmprof, FM3Str, "ExternalArcboxes", &fExternalArcboxes, &size);
1391 size = sizeof(BOOL);
1392 PrfQueryProfileData(fmprof, FM3Str, "ExternalViewer", &fExternalViewer, &size);
1393 size = sizeof(BOOL);
1394 PrfQueryProfileData(fmprof, FM3Str, "UseQProcStat", &fUseQProcStat, &size);
1395 size = sizeof(BOOL);
1396 PrfQueryProfileData(fmprof, FM3Str, "UseQSysState", &fUseQSysState, &size);
1397 size = sizeof(BOOL);
[1328]1398 PrfQueryProfileData(fmprof, FM3Str, "DataMin", &fDataMin, &size);
[1333]1399 size = sizeof(BOOL);
[1328]1400 PrfQueryProfileData(fmprof, appname, "DataToFore", &fDataToFore, &size);
[1333]1401 size = sizeof(BOOL);
1402 PrfQueryProfileData(fmprof, appname, "DataShowDrives", &fDataShowDrives, &size);
1403 size = sizeof(BOOL);
1404 PrfQueryProfileData(fmprof, appname, "DataInclRemote", &fDataInclRemote, &size);
1405 size = sizeof(BOOL);
[1328]1406 PrfQueryProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus, &size);
[1333]1407 size = sizeof(BOOL);
1408 PrfQueryProfileData(fmprof, appname, "FolderAfterExtract", &fFolderAfterExtract, &size);
1409 size = sizeof(BOOL);
[1328]1410 PrfQueryProfileData(fmprof, FM3Str, "DullDatabar", &fDullMin, &size);
[1333]1411 size = sizeof(BOOL);
[1328]1412 PrfQueryProfileData(fmprof, appname, "BlueLED", &fBlueLED, &size);
[1333]1413 size = sizeof(BOOL);
1414 PrfQueryProfileData(fmprof, appname, "ConfirmDelete", &fConfirmDelete, &size);
[1471]1415 size = sizeof(BOOL);
[1328]1416 PrfQueryProfileData(fmprof, FM3Str, "SaveState", &fSaveState, &size);
1417 size = sizeof(BOOL);
1418 PrfQueryProfileData(fmprof, appname, "SyncUpdates", &fSyncUpdates, &size);
[1333]1419 size = sizeof(BOOL);
[1328]1420 PrfQueryProfileData(fmprof, appname, "LoadSubject", &fLoadSubject, &size);
[1333]1421 size = sizeof(BOOL);
[1328]1422 PrfQueryProfileData(fmprof, appname, "UnHilite", &fUnHilite, &size);
[1333]1423 size = sizeof(BOOL);
[1328]1424 PrfQueryProfileData(fmprof, FM3Str, "TileBackwards", &fTileBackwards, &size);
[1333]1425 size = sizeof(BOOL);
[1328]1426 PrfQueryProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames, &size);
[1333]1427 size = sizeof(BOOL);
[1328]1428 PrfQueryProfileData(fmprof, appname, "VerifyWrites", &fVerify, &size);
[201]1429 DosSetVerify(fVerify);
[1333]1430 size = sizeof(BOOL);
[1328]1431 PrfQueryProfileData(fmprof, appname, "DontMoveMouse", &fDontMoveMouse, &size);
[1333]1432 size = sizeof(BOOL);
[1328]1433 PrfQueryProfileData(fmprof, appname, "NoIconsFiles", &fNoIconsFiles, &size);
[1333]1434 size = sizeof(BOOL);
[1328]1435 PrfQueryProfileData(fmprof, appname, "NoIconsDirs", &fNoIconsDirs, &size);
[1333]1436 size = sizeof(BOOL);
[1328]1437 PrfQueryProfileData(fmprof, appname, "ForceUpper", &fForceUpper, &size);
[1333]1438 size = sizeof(BOOL);
[1328]1439 PrfQueryProfileData(fmprof, appname, "ForceLower", &fForceLower, &size);
[1333]1440 size = sizeof(BOOL);
[1328]1441 PrfQueryProfileData(fmprof, FM3Str, "TextTools", &fTextTools, &size);
[1333]1442 size = sizeof(BOOL);
[1328]1443 PrfQueryProfileData(fmprof, FM3Str, "ToolTitles", &fToolTitles, &size);
[1333]1444 size = sizeof(BOOL);
[1328]1445 PrfQueryProfileData(fmprof, appname, "DoubleClickOpens", &fDCOpens, &size);
[1333]1446 size = sizeof(BOOL);
[1328]1447 PrfQueryProfileData(fmprof, appname, "LinkSetsIcon", &fLinkSetsIcon, &size);
1448 size = sizeof(INT);
1449 PrfQueryProfileData(fmprof, appname, "Sort", &sortFlags, &size);
[1333]1450 size = sizeof(INT);
[1328]1451 PrfQueryProfileData(fmprof, appname, "TreeSort", &TreesortFlags, &size);
[1333]1452 size = sizeof(INT);
1453 PrfQueryProfileData(fmprof, appname, "CollectorSort", &CollectorsortFlags, &size);
1454 PrfQueryProfileString(fmprof, appname, "Targetdir", NULL, targetdir, sizeof(targetdir));
[201]1455 if (!IsValidDir(targetdir))
1456 *targetdir = 0;
[1333]1457 PrfQueryProfileString(fmprof, appname, "ExtractPath", NULL, extractpath, sizeof(extractpath));
[1328]1458 size = sizeof(BOOL);
1459 PrfQueryProfileData(fmprof, FM3Str, "FileNamePathCnr", &fFileNameCnrPath, &size);
[1333]1460 PrfQueryProfileString(fmprof, appname, "Printer", "PRN", printer, sizeof(printer));
1461 PrfQueryProfileString(fmprof, appname, "DirCompare", NULL, dircompare, MaxComLineStrg);
1462 PrfQueryProfileString(fmprof, appname, "Viewer", NULL, viewer, MaxComLineStrg);
1463 PrfQueryProfileString(fmprof, appname, "Editor", NULL, editor, MaxComLineStrg);
1464 PrfQueryProfileString(fmprof, appname, "BinView", NULL, binview, MaxComLineStrg);
1465 PrfQueryProfileString(fmprof, appname, "BinEd", NULL, bined, MaxComLineStrg);
1466 PrfQueryProfileString(fmprof, appname, "Compare", NULL, compare, MaxComLineStrg);
1467 PrfQueryProfileString(fmprof, appname, "Virus", NULL, virus, MaxComLineStrg);
[1328]1468 size = sizeof(BOOL);
1469 PrfQueryProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, &size);
[1333]1470 PrfQueryProfileString(fmprof, appname, "FTPRun", NULL, ftprun, MaxComLineStrg);
[917]1471 if (!*ftprun)
[892]1472 fFtpRunWPSDefault = TRUE;
[1328]1473 size = sizeof(BOOL);
1474 PrfQueryProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, &size);
[1333]1475 PrfQueryProfileString(fmprof, appname, "HTTPRun", NULL, httprun, MaxComLineStrg);
[917]1476 if (!*httprun)
[892]1477 fHttpRunWPSDefault = TRUE;
[1333]1478 PrfQueryProfileString(fmprof, appname, "MailRun", NULL, mailrun, MaxComLineStrg);
1479 PrfQueryProfileString(fmprof, appname, "FtpRunDir", NULL, ftprundir, sizeof(ftprundir));
1480 PrfQueryProfileString(fmprof, appname, "HttpRunDir", NULL, httprundir, sizeof(httprundir));
1481 PrfQueryProfileString(fmprof, appname, "MailRunDir", NULL, mailrundir, sizeof(mailrundir));
1482 PrfQueryProfileString(fmprof, appname, "LastToolbar", NULL, lasttoolbar, sizeof(lasttoolbar));
[1328]1483 size = sizeof(BOOL);
[1333]1484 PrfQueryProfileData(fmprof, appname, "LibPathStrictHttpRun", &fLibPathStrictHttpRun, &size);
1485 size = sizeof(BOOL);
1486 PrfQueryProfileData(fmprof, appname, "LibPathStrictFtpRun", &fLibPathStrictFtpRun, &size);
1487 size = sizeof(BOOL);
1488 PrfQueryProfileData(fmprof, appname, "LibPathStrictMailRun", &fLibPathStrictMailRun, &size);
1489 size = sizeof(BOOL);
1490 PrfQueryProfileData(fmprof, appname, "NoMailtoMailRun", &fNoMailtoMailRun, &size);
1491 size = sizeof(BOOL);
1492 PrfQueryProfileData(fmprof, appname, "FollowTree", &fFollowTree, &size);
1493 size = sizeof(BOOL);
1494 PrfQueryProfileData(fmprof, appname, "StartMaximized", &fStartMaximized, &size);
[551]1495 if (!fStartMaximized) {
[1333]1496 size = sizeof(BOOL);
1497 PrfQueryProfileData(fmprof, appname, "StartMinimized", &fStartMinimized, &size);
[2]1498 }
[1333]1499 size = sizeof(BOOL);
[1328]1500 PrfQueryProfileData(fmprof, appname, "DefaultCopy", &fCopyDefault, &size);
[1333]1501 size = sizeof(BOOL);
[1328]1502 PrfQueryProfileData(fmprof, appname, "IdleCopy", &fRealIdle, &size);
[1333]1503 size = sizeof(BOOL);
1504 PrfQueryProfileData(fmprof, appname, "ArcStuffVisible", &fArcStuffVisible, &size);
1505 size = sizeof(BOOL);
[1328]1506 PrfQueryProfileData(fmprof, FM3Str, "NoTreeGap", &fNoTreeGap, &size);
[1333]1507 size = sizeof(BOOL);
1508 PrfQueryProfileData(fmprof, FM3Str, "VTreeOpensWPS", &fVTreeOpensWPS, &size);
1509 size = sizeof(BOOL);
[1328]1510 PrfQueryProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, &size);
[1333]1511 size = sizeof(BOOL);
[1354]1512 PrfQueryProfileData(fmprof, appname, "RScanLocal", &fRScanLocal, &size);
1513 size = sizeof(BOOL);
1514 PrfQueryProfileData(fmprof, appname, "RScanRemote", &fRScanRemote, &size);
1515 size = sizeof(BOOL);
1516 PrfQueryProfileData(fmprof, appname, "RScanVirtual", &fRScanVirtual, &size);
1517 size = sizeof(BOOL);
1518 PrfQueryProfileData(fmprof, appname, "RScanSlow", &fRScanSlow, &size);
1519 size = sizeof(BOOL);
1520 PrfQueryProfileData(fmprof, appname, "RScanNoWrite", &fRScanNoWrite, &size);
1521 size = sizeof(BOOL);
[1365]1522 PrfQueryProfileData(fmprof, appname, "EjectRemovableScan", &fEjectRemovableScan, &size);
1523 size = sizeof(BOOL);
1524 PrfQueryProfileData(fmprof, appname, "EjectCDScan", &fEjectCDScan, &size);
1525 size = sizeof(BOOL);
1526 PrfQueryProfileData(fmprof, appname, "EjectFlpyScan", &fEjectFlpyScan, &size);
1527 size = sizeof(BOOL);
[1333]1528 PrfQueryProfileData(fmprof, appname, "Drag&DropDlg", &fDragndropDlg, &size);
1529 size = sizeof(BOOL);
[1328]1530 PrfQueryProfileData(fmprof, FM3Str, "UserComboBox", &fUserComboBox, &size);
[1333]1531 size = sizeof(BOOL);
[1328]1532 PrfQueryProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen, &size);
[1333]1533 size = sizeof(BOOL);
1534 PrfQueryProfileData(fmprof, appname, "QuickArcFind", &fQuickArcFind, &size);
1535 size = sizeof(BOOL);
1536 PrfQueryProfileData(fmprof, FM3Str, "NoRemovableScan", &fNoRemovableScan, &size);
[1328]1537 size = sizeof(ULONG);
[1333]1538 PrfQueryProfileData(fmprof, FM3Str, "NoBrokenNotify", &NoBrokenNotify, &size);
1539 size = sizeof(ULONG);
1540 PrfQueryProfileData(fmprof, appname, "ContainerType", &ulCnrType, &size);
1541 size = sizeof(ULONG);
[1328]1542 PrfQueryProfileData(fmprof, appname, "FilesToGet", &FilesToGet, &size);
[789]1543 if (FilesToGet < FILESTOGET_MIN)
1544 FilesToGet = FILESTOGET_MIN;
1545 else if (FilesToGet > FILESTOGET_MAX)
1546 FilesToGet = FILESTOGET_MAX;
[1328]1547 size = sizeof(BOOL);
1548 PrfQueryProfileData(fmprof, FM3Str, "AutoView", &fAutoView, &size);
[1333]1549 size = sizeof(BOOL);
[1328]1550 PrfQueryProfileData(fmprof, FM3Str, "FM2Deletes", &fFM2Deletes, &size);
[1333]1551 size = sizeof(BOOL);
[1328]1552 PrfQueryProfileData(fmprof, FM3Str, "TrashCan", &fTrashCan, &size);
[2]1553
[1409]1554 LoadDetailsSwitches(PCSZ_DIRCNR, &dsDirCnrDefault, FALSE);
[784]1555
[2]1556 /* load pointers and icons we use */
[189]1557 hptrArrow = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE);
1558 hptrBusy = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE);
1559 hptrNS = WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZENS, FALSE);
1560 hptrEW = WinQuerySysPointer(HWND_DESKTOP, SPTR_SIZEWE, FALSE);
1561 hptrFloppy = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FLOPPY_ICON);
1562 hptrDrive = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DRIVE_ICON);
1563 hptrRemovable = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, REMOVABLE_ICON);
1564 hptrCDROM = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, CDROM_ICON);
1565 hptrFile = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_ICON);
1566 hptrDir = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DIR_FRAME);
1567 hptrArc = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ARC_FRAME);
1568 hptrArt = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ART_ICON);
1569 hptrSystem = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_SYSTEM_ICON);
1570 hptrHidden = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_HIDDEN_ICON);
[552]1571 hptrReadonly = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FILE_READONLY_ICON);
[189]1572 hptrLast = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, LASTITEM_ICON);
1573 hptrRemote = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, REMOTE_ICON);
[552]1574 hptrVirtual = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, VIRTUAL_ICON);
1575 hptrRamdisk = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, RAMDISK_ICON);
[189]1576 if (!fNoDead)
1577 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER_ICON);
[2]1578 else
[189]1579 hptrFinger = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, FINGER2_ICON);
1580 hptrApp = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, APP_ICON);
1581 hptrDunno = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, DUNNO_ICON);
1582 hptrEnv = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ENV_ICON);
1583 hptrZipstrm = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, ZIPSTREAM_ICON);
[2]1584
[201]1585 // set up color array used by seeall.c and newview.c color dialog
1586
[189]1587 standardcolors[0] = CLR_WHITE;
1588 standardcolors[1] = CLR_BLACK;
1589 standardcolors[2] = CLR_BLUE;
1590 standardcolors[3] = CLR_RED;
1591 standardcolors[4] = CLR_PINK;
1592 standardcolors[5] = CLR_GREEN;
1593 standardcolors[6] = CLR_CYAN;
1594 standardcolors[7] = CLR_YELLOW;
1595 standardcolors[8] = CLR_DARKGRAY;
1596 standardcolors[9] = CLR_DARKBLUE;
[2]1597 standardcolors[10] = CLR_DARKRED;
1598 standardcolors[11] = CLR_DARKPINK;
1599 standardcolors[12] = CLR_DARKGREEN;
1600 standardcolors[13] = CLR_DARKCYAN;
1601 standardcolors[14] = CLR_BROWN;
1602 standardcolors[15] = CLR_PALEGRAY;
1603
1604 return TRUE;
1605}
1606
[189]1607HWND StartFM3(HAB hab, INT argc, CHAR ** argv)
1608{
[201]1609 HWND hwndFrame;
1610 HWND hwndClient;
1611 UINT x;
[189]1612 ULONG FrameFlags = FCF_TITLEBAR | FCF_SYSMENU |
[551]1613 FCF_SIZEBORDER | FCF_MINMAX |
1614 FCF_ACCELTABLE | FCF_MENU | FCF_ICON | FCF_TASKLIST | FCF_NOBYTEALIGN;
[2]1615
[551]1616 for (x = 1; x < argc; x++) {
[201]1617 if (*argv[x] == '~' && !argv[x][1])
1618 fReminimize = TRUE;
1619 if (*argv[x] == '+' && !argv[x][1])
1620 fLogFile = TRUE;
[551]1621 if (*argv[x] == '-') {
[201]1622 if (!argv[x][1])
[1335]1623 fNoSaveState = TRUE;
[201]1624 else
[1335]1625 strcpy(profile, &argv[x][1]);
[2]1626 }
1627 }
1628
1629 hwndFrame = WinCreateStdWindow(HWND_DESKTOP,
[1335]1630 WS_VISIBLE,
1631 &FrameFlags,
1632 WC_MAINWND,
1633 NULL,
1634 WS_VISIBLE | WS_ANIMATE,
1635 FM3ModHandle, MAIN_FRAME, &hwndClient);
[551]1636 if (hwndFrame) {
1637 WinSetWindowUShort(hwndFrame, QWS_ID, MAIN_FRAME);
[875]1638 hwndMainMenu = WinWindowFromID(hwndFrame, FID_MENU);
[551]1639 if (!WinRestoreWindowPos(FM2Str, "MainWindowPos", hwndFrame)) {
[2]1640
1641 ULONG fl = SWP_MOVE | SWP_SIZE;
1642 RECTL rcl;
[189]1643 ULONG icz = WinQuerySysValue(HWND_DESKTOP, SV_CYICON) * 3L;
1644 ULONG bsz = WinQuerySysValue(HWND_DESKTOP, SV_CYSIZEBORDER);
[2]1645
[551]1646 WinQueryWindowRect(HWND_DESKTOP, &rcl);
[2]1647 rcl.yBottom += icz;
1648 rcl.yTop -= bsz;
1649 rcl.xLeft += bsz;
1650 rcl.xRight -= bsz;
1651 WinSetWindowPos(hwndFrame,
[1335]1652 HWND_TOP,
1653 rcl.xLeft,
1654 rcl.yBottom,
1655 rcl.xRight - rcl.xLeft, rcl.yTop - rcl.yBottom, fl);
[2]1656 }
[189]1657 if (fLogFile)
[551]1658 LogFileHandle = _fsopen("FM2.LOG", "a+", SH_DENYWR);
[189]1659 if (hwndHelp)
[551]1660 WinAssociateHelpInstance(hwndHelp, hwndFrame);
1661 PostMsg(hwndClient, UM_SETUP, MPFROMLONG(argc), MPFROMP(argv));
[2]1662 }
1663 return hwndFrame;
1664}
[32]1665
[985]1666BOOL CheckFileHeader(CHAR *filespec, CHAR *signature, LONG offset)
1667{
1668 HFILE handle;
1669 ULONG action;
1670 ULONG len = strlen(signature);
1671 ULONG l;
[1156]1672 CHAR buffer[4096]; // 06 Oct 07 SHL Protect against NTFS defect
[985]1673 BOOL ret = FALSE;
1674
1675 DosError(FERR_DISABLEHARDERR);
1676 if (DosOpen(filespec,
[1335]1677 &handle,
1678 &action,
1679 0,
1680 0,
1681 OPEN_ACTION_FAIL_IF_NEW |
1682 OPEN_ACTION_OPEN_IF_EXISTS,
1683 OPEN_FLAGS_FAIL_ON_ERROR |
1684 OPEN_FLAGS_NOINHERIT |
1685 OPEN_FLAGS_RANDOMSEQUENTIAL |
1686 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, 0))
[985]1687 ret = FALSE;
1688 else {
1689 // Try signature match
1690 l = len;
1691 l = min(l, 79);
1692 if (!DosChgFilePtr(handle,
[1335]1693 abs(offset),
1694 (offset >= 0) ?
1695 FILE_BEGIN : FILE_END, &len)) {
[985]1696 if (!DosRead(handle, buffer, l, &len) && len == l) {
[1335]1697 if (!memcmp(signature, buffer, l))
1698 ret = TRUE; // Matched
[985]1699 }
1700 }
1701 }
[1156]1702 DosClose(handle); /* Either way, we're done for now */
1703 return ret; /* Return TRUE if matched */
[985]1704}
1705
[189]1706int CheckVersion(int vermajor, int verminor)
1707{
[179]1708 int ok = 0;
[32]1709
[179]1710 // fixme to do useful check - was missing in base source
1711
[32]1712#if 0
[551]1713 if (vermajor && verminor) {
[32]1714 *vermajor = VERMAJOR;
1715 *verminor = VERMINOR;
[179]1716 ok = 1;
[32]1717 }
1718#endif
[189]1719
[179]1720 ok = 1;
[32]1721
[179]1722 return ok;
[32]1723}
[783]1724
1725#ifdef __WATCOMC__
1726#pragma alloc_text(INIT,LibMain,InitFM3DLL,DeInitFM3DLL)
1727#pragma alloc_text(INIT1,StartFM3,FindSwapperDat)
1728#endif
Note: See TracBrowser for help on using the repository browser.