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