Changeset 1326 for trunk/dll/init.c


Ignore:
Timestamp:
Dec 9, 2008, 3:18:36 AM (17 years ago)
Author:
Gregg Young
Message:

Changes to avoid duplicate directory names on scan using StubbyScanThread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/init.c

    r1320 r1326  
    6868#include <process.h>
    6969#include <time.h>
     70#include <ctype.h>
    7071
    7172#define INCL_DOS
     
    158159
    159160#pragma data_seg(GLOBAL1)
    160 HEV  DriveScanStart;
    161161HMTX hmtxFM2Delete;
    162162HMTX hmtxFM2Globals;
    163163ULONG OS2ver[2];
     164ULONG sizeBool;
     165ULONG sizeUlong;
     166ULONG sizeInt;
     167ULONG sizePvoid;
    164168PFNWP PFNWPCnr;
    165169PFNWP PFNWPMLE;
     
    172176BOOL fReminimize;
    173177BOOL fWantFirstTimeInit;
     178BOOL fDrivetoSkip[26];
    174179HPOINTER hptrApp;
    175180HPOINTER hptrArc;
     
    707712  ULONG size;
    708713
     714  sizeBool = sizeof(BOOL);
     715  sizeUlong = sizeof(ULONG);
     716  sizeInt = sizeof(INT);
     717  sizePvoid = sizeof(PVOID);
    709718  if (!StringsLoaded()) {
    710719    saymsg(MB_ENTER,
     
    986995  FindSwapperDat();
    987996
    988   size = sizeof(BOOL);
     997  //size = sizeof(BOOL);
    989998  PrfQueryProfileData(fmprof,
    990999                      FM3Str,
    9911000                      "SeparateParms",
    9921001                      &fSeparateParms,
    993                       &size);
     1002                      &sizeBool);
    9941003  if (!fSeparateParms)
    9951004    strcpy(appname, FM3Str);
     
    10581067                   WC_MAINWND,
    10591068                   MainWndProc,
    1060                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 8);
     1069                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 8);
    10611070  WinRegisterClass(hab,
    10621071                   WC_MAINWND2,
    10631072                   MainWndProc2,
    1064                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 4);
     1073                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 4);
    10651074  WinRegisterClass(hab,
    10661075                   WC_TREECONTAINER,
    10671076                   TreeClientWndProc,
    1068                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
     1077                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 2);
    10691078  WinRegisterClass(hab,
    10701079                   WC_DIRCONTAINER,
    10711080                   DirClientWndProc,
    1072                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
     1081                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 2);
    10731082  WinRegisterClass(hab,
    10741083                   WC_COLLECTOR,
    10751084                   CollectorClientWndProc,
    1076                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
     1085                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 2);
    10771086  WinRegisterClass(hab,
    10781087                   WC_ARCCONTAINER,
    10791088                   ArcClientWndProc,
    1080                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
     1089                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 2);
    10811090  WinRegisterClass(hab,
    10821091                   WC_MLEEDITOR,
    10831092                   MLEEditorProc,
    1084                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
     1093                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 2);
    10851094  WinRegisterClass(hab,
    10861095                   WC_INIEDITOR,
    10871096                   IniProc,
    1088                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID) * 2);
     1097                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid * 2);
    10891098  WinRegisterClass(hab,
    10901099                   WC_TOOLBACK,
    10911100                   ToolBackProc,
    10921101                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1093                    sizeof(PVOID));
     1102                   sizePvoid);
    10941103  WinRegisterClass(hab,
    10951104                   WC_DRIVEBACK,
    10961105                   DriveBackProc,
    10971106                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1098                    sizeof(PVOID));
     1107                   sizePvoid);
    10991108  WinRegisterClass(hab,
    11001109                   WC_SEEALL,
    11011110                   SeeAllWndProc,
    1102                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
     1111                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid);
    11031112  WinRegisterClass(hab,
    11041113                   WC_NEWVIEW,
    11051114                   ViewWndProc,
    1106                    CS_SIZEREDRAW | CS_CLIPCHILDREN, sizeof(PVOID));
     1115                   CS_SIZEREDRAW | CS_CLIPCHILDREN, sizePvoid);
    11071116  WinRegisterClass(hab,
    11081117                   WC_TOOLBUTTONS,
    11091118                   ChildButtonProc,
    11101119                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1111                    sizeof(PVOID));
     1120                   sizePvoid);
    11121121  WinRegisterClass(hab,
    11131122                   WC_DRIVEBUTTONS,
    11141123                   DriveProc,
    11151124                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1116                    sizeof(PVOID));
     1125                   sizePvoid);
    11171126  WinRegisterClass(hab,
    11181127                   WC_BUBBLE,
    11191128                   BubbleProc,
    11201129                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1121                    sizeof(ULONG) * 2);
     1130                   sizeUlong * 2);
    11221131  WinRegisterClass(hab,
    11231132                   WC_STATUS,
    11241133                   StatusProc,
    11251134                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1126                    sizeof(ULONG));
     1135                   sizeUlong);
    11271136  WinRegisterClass(hab,
    11281137                   WC_DIRSTATUS,
    11291138                   DirTextProc,
    11301139                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1131                    sizeof(ULONG));
     1140                   sizeUlong);
    11321141  WinRegisterClass(hab,
    11331142                   WC_TREESTATUS,
    11341143                   TreeStatProc,
    11351144                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1136                    sizeof(ULONG));
     1145                   sizeUlong);
    11371146  WinRegisterClass(hab,
    11381147                   WC_ARCSTATUS,
    11391148                   ArcTextProc,
    11401149                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1141                    sizeof(ULONG));
     1150                   sizeUlong);
    11421151  WinRegisterClass(hab,
    11431152                   WC_COLSTATUS,
    11441153                   CollectorTextProc,
    11451154                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1146                    sizeof(ULONG));
     1155                   sizeUlong);
    11471156  WinRegisterClass(hab,
    11481157                   WC_SEESTATUS,
    11491158                   SeeStatusProc,
    11501159                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1151                    sizeof(ULONG));
     1160                   sizeUlong);
    11521161  WinRegisterClass(hab,
    11531162                   WC_VIEWSTATUS,
    11541163                   ViewStatusProc,
    11551164                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1156                    sizeof(ULONG));
     1165                   sizeUlong);
    11571166  WinRegisterClass(hab,
    11581167                   WC_ERRORWND,
    11591168                   NotifyWndProc,
    11601169                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1161                    sizeof(PVOID));
     1170                   sizePvoid);
    11621171  WinRegisterClass(hab,
    11631172                   WC_MINITIME,
    11641173                   MiniTimeProc,
    11651174                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1166                    sizeof(PVOID) * 2);
     1175                   sizePvoid * 2);
    11671176  WinRegisterClass(hab,
    11681177                   WC_DATABAR,
    1169                    DataProc, CS_SIZEREDRAW, sizeof(PVOID));
     1178                   DataProc, CS_SIZEREDRAW, sizePvoid);
    11701179  WinRegisterClass(hab,
    11711180                   WC_TREEOPENBUTTON,
    11721181                   OpenButtonProc,
    11731182                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1174                    sizeof(PVOID));
     1183                   sizePvoid);
    11751184  WinRegisterClass(hab,
    11761185                   WC_AUTOVIEW,
    11771186                   AutoViewProc,
    11781187                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1179                    sizeof(PVOID));
     1188                   sizePvoid);
    11801189  WinRegisterClass(hab,
    11811190                   WC_LED,
    11821191                   LEDProc,
    11831192                   CS_SYNCPAINT | CS_SIZEREDRAW | CS_PARENTCLIP,
    1184                    sizeof(PVOID));
     1193                   sizePvoid);
    11851194
    11861195  if (DosCreateMutexSem("\\SEM\\GLOBAL1", &hmtxFM2Globals, 0L, FALSE))
     
    11901199    Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    11911200              "DosCreateMutexSem");
    1192   if (DosCreateEventSem("\\SEM32\\DRIVESCAN", &DriveScanStart, 0L, FALSE))
     1201  /*if (DosCreateEventSem("\\SEM32\\DRIVESCAN", &DriveScanStart, 0L, FALSE))
    11931202    Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    11941203              GetPString(IDS_CREATESEMFAILED));
    1195   fInitialDriveScan = TRUE;
     1204  fInitialDriveScan = TRUE;*/
    11961205
    11971206  /*
     
    12371246
    12381247  // load preferences from profile (INI) file
    1239   size = sizeof(ULONG);
    1240   PrfQueryProfileData(fmprof, appname, "MaxComLineStrg", &MaxComLineStrg, &size);
     1248  PrfQueryProfileData(fmprof, appname, "MaxComLineStrg", &MaxComLineStrg, &sizeUlong);
    12411249  // Give user one chance to reset the default command line length to 1024 (4os2's unexpanded max)
    12421250  if (MaxComLineStrg == 2048) {
    12431251    BOOL MaxComLineChecked = FALSE;
    12441252
    1245     size = sizeof(BOOL);
    1246     PrfQueryProfileData(fmprof, appname, "MaxComLineChecked", &MaxComLineChecked, &size);
     1253    PrfQueryProfileData(fmprof, appname, "MaxComLineChecked", &MaxComLineChecked, &sizeBool);
    12471254    if (!MaxComLineChecked) {
    12481255      ret = saymsg(MB_YESNO,
     
    12531260        MaxComLineStrg = 1024;
    12541261      MaxComLineChecked = TRUE;
    1255       PrfWriteProfileData(fmprof, appname, "MaxComLineChecked", &MaxComLineChecked, sizeof(BOOL));
     1262      PrfWriteProfileData(fmprof, appname, "MaxComLineChecked", &MaxComLineChecked, sizeBool);
    12561263    }
    12571264  }
     
    12931300  if (!pszTreeEnvVarList)
    12941301    return 0; //already complained
    1295   size = sizeof(BOOL);
    1296   PrfQueryProfileData(fmprof, appname, "ShowTarget", &fShowTarget, &size);
    1297   size = sizeof(BOOL);
    1298   PrfQueryProfileData(fmprof, appname, "CheckMM", &fCheckMM, &size);
    1299   size = sizeof(BOOL);
    1300   PrfQueryProfileData(fmprof, appname, "ChangeTarget", &fChangeTarget, &size);
    1301   size = sizeof(BOOL);
    1302   PrfQueryProfileData(fmprof, appname, "ConfirmTarget", &fConfirmTarget, &size);
    1303   size = sizeof(BOOL);
    1304   PrfQueryProfileData(fmprof, FM3Str, "CustomFileDlg", &fCustomFileDlg, &size);
    1305   size = sizeof(BOOL);
    1306   PrfQueryProfileData(fmprof, FM3Str, "SaveMiniCmds", &fSaveMiniCmds, &size);
    1307   size = sizeof(BOOL);
    1308   PrfQueryProfileData(fmprof, appname, "SaveBigCmds", &fSaveBigCmds, &size);
    1309   size = sizeof(BOOL);
    1310   PrfQueryProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu, &size);
    1311   size = sizeof(BOOL);
    1312   PrfQueryProfileData(fmprof, FM3Str, "ThreadNotes", &fThreadNotes, &size);
    1313   size = sizeof(BOOL);
    1314   PrfQueryProfileData(fmprof, FM3Str, "Prnpagenums", &prnpagenums, &size);
    1315   size = sizeof(BOOL);
    1316   PrfQueryProfileData(fmprof, FM3Str, "Prnalt", &prnalt, &size);
    1317   size = sizeof(BOOL);
    1318   PrfQueryProfileData(fmprof, FM3Str, "Prnformat", &prnformat, &size);
    1319   size = sizeof(BOOL);
     1302  PrfQueryProfileData(fmprof, appname, "ShowTarget", &fShowTarget, &sizeBool);
     1303  PrfQueryProfileData(fmprof, appname, "CheckMM", &fCheckMM, &sizeBool);
     1304  PrfQueryProfileData(fmprof, appname, "ChangeTarget", &fChangeTarget, &sizeBool);
     1305  PrfQueryProfileData(fmprof, appname, "ConfirmTarget", &fConfirmTarget, &sizeBool);
     1306  PrfQueryProfileData(fmprof, FM3Str, "CustomFileDlg", &fCustomFileDlg, &sizeBool);
     1307  PrfQueryProfileData(fmprof, FM3Str, "SaveMiniCmds", &fSaveMiniCmds, &sizeBool);
     1308  PrfQueryProfileData(fmprof, appname, "SaveBigCmds", &fSaveBigCmds, &sizeBool);
     1309  PrfQueryProfileData(fmprof, appname, "NoFoldMenu", &fNoFoldMenu, &sizeBool);
     1310  PrfQueryProfileData(fmprof, FM3Str, "ThreadNotes", &fThreadNotes, &sizeBool);
     1311  PrfQueryProfileData(fmprof, FM3Str, "Prnpagenums", &prnpagenums, &sizeBool);
     1312  PrfQueryProfileData(fmprof, FM3Str, "Prnalt", &prnalt, &sizeBool);
     1313  PrfQueryProfileData(fmprof, FM3Str, "Prnformat", &prnformat, &sizeBool);
    13201314  PrfQueryProfileData(fmprof, FM3Str, "Prnformfeedbefore",
    1321                       &prnformfeedbefore, &size);
    1322   size = sizeof(BOOL);
     1315                      &prnformfeedbefore, &sizeBool);
    13231316  PrfQueryProfileData(fmprof, FM3Str,
    1324                       "Prnformfeedafter",&prnformfeedafter, &size);
    1325   size = sizeof(ULONG);
    1326   PrfQueryProfileData(fmprof, FM3Str, "Prntabspaces", &prntabspaces, &size);
    1327   size = sizeof(ULONG);
    1328   PrfQueryProfileData(fmprof, FM3Str, "Prnwidth", &prnwidth, &size);
    1329   size = sizeof(ULONG);
    1330   PrfQueryProfileData(fmprof, FM3Str, "Prnlength", &prnlength, &size);
    1331   size = sizeof(ULONG);
    1332   PrfQueryProfileData(fmprof, FM3Str, "Prntmargin", &prntmargin, &size);
    1333   size = sizeof(ULONG);
    1334   PrfQueryProfileData(fmprof, FM3Str, "Prnbmargin", &prnbmargin, &size);
    1335   size = sizeof(ULONG);
    1336   PrfQueryProfileData(fmprof, FM3Str, "Prnlmargin", &prnlmargin, &size);
    1337   size = sizeof(ULONG);
    1338   PrfQueryProfileData(fmprof, FM3Str, "Prnrmargin", &prnrmargin, &size);
    1339   size = sizeof(ULONG);
    1340   PrfQueryProfileData(fmprof, FM3Str, "Prnspacing", &prnspacing, &size);
    1341   size = sizeof(BOOL);
    1342   PrfQueryProfileData(fmprof, FM3Str, "NoDead", &fNoDead, &size);
    1343   size = sizeof(BOOL);
    1344   PrfQueryProfileData(fmprof, FM3Str, "NoFinger", &fNoFinger, &size);
    1345   size = sizeof(BOOL);
    1346   PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, &size);
    1347   size = sizeof(BOOL);
     1317                      "Prnformfeedafter",&prnformfeedafter, &sizeBool);
     1318  PrfQueryProfileData(fmprof, FM3Str, "Prntabspaces", &prntabspaces, &sizeUlong);
     1319  PrfQueryProfileData(fmprof, FM3Str, "Prnwidth", &prnwidth, &sizeUlong);
     1320  PrfQueryProfileData(fmprof, FM3Str, "Prnlength", &prnlength, &sizeUlong);
     1321  PrfQueryProfileData(fmprof, FM3Str, "Prntmargin", &prntmargin, &sizeUlong);
     1322  PrfQueryProfileData(fmprof, FM3Str, "Prnbmargin", &prnbmargin, &sizeUlong);
     1323  PrfQueryProfileData(fmprof, FM3Str, "Prnlmargin", &prnlmargin, &sizeUlong);
     1324  PrfQueryProfileData(fmprof, FM3Str, "Prnrmargin", &prnrmargin, &sizeUlong);
     1325  PrfQueryProfileData(fmprof, FM3Str, "Prnspacing", &prnspacing, &sizeUlong);
     1326  PrfQueryProfileData(fmprof, FM3Str, "NoDead", &fNoDead, &sizeBool);
     1327  PrfQueryProfileData(fmprof, FM3Str, "NoFinger", &fNoFinger, &sizeBool);
     1328  PrfQueryProfileData(fmprof, appname, "SwitchTree", &fSwitchTree, &sizeBool);
    13481329  PrfQueryProfileData(fmprof, appname, "SwitchTreeExpand",
    1349                       &fSwitchTreeExpand, &size);
    1350   size = sizeof(BOOL);
     1330                      &fSwitchTreeExpand, &sizeBool);
    13511331  PrfQueryProfileData(fmprof, appname, "SwitchTreeOnFocus",
    1352                       &fSwitchTreeOnFocus, &size);
    1353   size = sizeof(BOOL);
     1332                      &fSwitchTreeOnFocus, &sizeBool);
    13541333  PrfQueryProfileData(fmprof, appname, "CollapseFirst",
    1355                       &fCollapseFirst, &size);
    1356   size = sizeof(BOOL);
     1334                      &fCollapseFirst, &sizeBool);
    13571335  PrfQueryProfileData(fmprof, appname, "FilesInTree",
    1358                       &fFilesInTree, &size);
    1359   size = sizeof(BOOL);
    1360   PrfQueryProfileData(fmprof, FM3Str, "TopDir", &fTopDir, &size);
    1361   size = sizeof(BOOL);
    1362   PrfQueryProfileData(fmprof, FM3Str, "LookInDir", &fLookInDir, &size);
     1336                      &fFilesInTree, &sizeBool);
     1337  PrfQueryProfileData(fmprof, FM3Str, "TopDir", &fTopDir, &sizeBool);
     1338  PrfQueryProfileData(fmprof, FM3Str, "LookInDir", &fLookInDir, &sizeBool);
    13631339  PrfQueryProfileString(fmprof, appname, "DefArc", NULL, szDefArc,
    13641340                        sizeof(szDefArc));
    1365   size = sizeof(ULONG);
    13661341  PrfQueryProfileData(fmprof, FM3Str, "AutoviewHeight",
    1367                       &AutoviewHeight, &size);
    1368   size = sizeof(BOOL);
    1369   PrfQueryProfileData(fmprof, FM3Str, "KeepCmdLine", &fKeepCmdLine, &size);
     1342                      &AutoviewHeight, &sizeUlong);
     1343  PrfQueryProfileData(fmprof, FM3Str, "KeepCmdLine", &fKeepCmdLine, &sizeBool);
    13701344  if (strcmp(realappname, "FM/4")) {
    1371     size = sizeof(BOOL);
    1372     PrfQueryProfileData(fmprof, FM3Str, "MoreButtons", &fMoreButtons, &size);
    1373     size = sizeof(BOOL);
    1374     PrfQueryProfileData(fmprof, FM3Str, "Drivebar", &fDrivebar, &size);
     1345    PrfQueryProfileData(fmprof, FM3Str, "MoreButtons", &fMoreButtons, &sizeBool);
     1346    PrfQueryProfileData(fmprof, FM3Str, "Drivebar", &fDrivebar, &sizeBool);
    13751347  }
    13761348  else
    13771349    fDrivebar = fMoreButtons = TRUE;
    1378   size = sizeof(BOOL);
    1379   PrfQueryProfileData(fmprof, appname, "NoSearch", &fNoSearch, &size);
    1380   size = sizeof(BOOL);
    1381   PrfQueryProfileData(fmprof, appname, "GuessType", &fGuessType, &size);
    1382   size = sizeof(BOOL);
    1383   PrfQueryProfileData(fmprof, appname, "ViewChild", &fViewChild, &size);
    1384   size = sizeof(BOOL);
    1385   PrfQueryProfileData(fmprof, appname, "ShowEnv", &fShowEnv, &size);
     1350  PrfQueryProfileData(fmprof, appname, "NoSearch", &fNoSearch, &sizeBool);
     1351  PrfQueryProfileData(fmprof, appname, "GuessType", &fGuessType, &sizeBool);
     1352  PrfQueryProfileData(fmprof, appname, "ViewChild", &fViewChild, &sizeBool);
     1353  PrfQueryProfileData(fmprof, appname, "ShowEnv", &fShowEnv, &sizeBool);
    13861354  size = MaxComLineStrg;
    13871355  PrfQueryProfileData(fmprof, appname, "TreeEnvVarList", pszTreeEnvVarList, &size);
    1388   size = sizeof(BOOL);
    1389   PrfQueryProfileData(fmprof, appname, "LeaveTree", &fLeaveTree, &size);
    1390   size = sizeof(BOOL);
    1391   PrfQueryProfileData(fmprof, FM3Str, "Comments", &fComments, &size);
    1392   size = sizeof(ULONG);
    1393   PrfQueryProfileData(fmprof, appname, "WS_ANIMATE", &fwsAnimate, &size);
     1356  PrfQueryProfileData(fmprof, appname, "LeaveTree", &fLeaveTree, &sizeBool);
     1357  PrfQueryProfileData(fmprof, FM3Str, "Comments", &fComments, &sizeBool);
     1358  PrfQueryProfileData(fmprof, appname, "WS_ANIMATE", &fwsAnimate, &sizeUlong);
    13941359  if (fwsAnimate)
    13951360    fwsAnimate = WS_ANIMATE;
    1396   size = sizeof(ULONG);
    1397   size = sizeof(BOOL);
    13981361  PrfQueryProfileData(fmprof, appname, "SelectedAlways",
    1399                       &fSelectedAlways, &size);
    1400   size = sizeof(BOOL);
    1401   PrfQueryProfileData(fmprof, FM3Str, "ToolbarHelp", &fToolbarHelp, &size);
    1402   size = sizeof(BOOL);
    1403   PrfQueryProfileData(fmprof, FM3Str, "OtherHelp", &fOtherHelp, &size);
    1404   size = sizeof(BOOL);
    1405   PrfQueryProfileData(fmprof, FM3Str, "DrivebarHelp", &fDrivebarHelp, &size);
    1406   size = sizeof(BOOL);
    1407   PrfQueryProfileData(fmprof, appname, "AutoAddDirs", &fAutoAddDirs, &size);
    1408   size = sizeof(BOOL);
     1362                      &fSelectedAlways, &sizeBool);
     1363  PrfQueryProfileData(fmprof, FM3Str, "ToolbarHelp", &fToolbarHelp, &sizeBool);
     1364  PrfQueryProfileData(fmprof, FM3Str, "OtherHelp", &fOtherHelp, &sizeBool);
     1365  PrfQueryProfileData(fmprof, FM3Str, "DrivebarHelp", &fDrivebarHelp, &sizeBool);
     1366  PrfQueryProfileData(fmprof, appname, "AutoAddDirs", &fAutoAddDirs, &sizeBool);
    14091367  PrfQueryProfileData(fmprof, appname,
    1410                       "AutoAddAllDirs", &fAutoAddAllDirs, &size);
    1411   size = sizeof(BOOL);
     1368                      "AutoAddAllDirs", &fAutoAddAllDirs, &sizeBool);
    14121369  PrfQueryProfileData(fmprof, FM3Str, "UserListSwitches",
    1413                       &fUserListSwitches, &size);
    1414   size = sizeof(BOOL);
     1370                      &fUserListSwitches, &sizeBool);
    14151371  PrfQueryProfileData(fmprof, appname, "UseNewViewer",
    1416                       &fUseNewViewer, &size);
    1417   size = sizeof(BOOL);
     1372                      &fUseNewViewer, &sizeBool);
    14181373  PrfQueryProfileData(fmprof, appname, "DefaultDeletePerm",
    1419                       &fDefaultDeletePerm, &size);
    1420   size = sizeof(BOOL);
     1374                      &fDefaultDeletePerm, &sizeBool);
    14211375  PrfQueryProfileData(fmprof, FM3Str, "ExternalINIs",
    1422                       &fExternalINIs, &size);
    1423   size = sizeof(BOOL);
     1376                      &fExternalINIs, &sizeBool);
    14241377  PrfQueryProfileData(fmprof, FM3Str, "ExternalCollector",
    1425                       &fExternalCollector, &size);
    1426   size = sizeof(BOOL);
     1378                      &fExternalCollector, &sizeBool);
    14271379  PrfQueryProfileData(fmprof, FM3Str, "ExternalArcboxes",
    1428                       &fExternalArcboxes, &size);
    1429   size = sizeof(BOOL);
     1380                      &fExternalArcboxes, &sizeBool);
    14301381  PrfQueryProfileData(fmprof, FM3Str, "ExternalViewer",
    1431                       &fExternalViewer, &size);
    1432   size = sizeof(BOOL);
     1382                      &fExternalViewer, &sizeBool);
    14331383  PrfQueryProfileData(fmprof, FM3Str, "UseQProcStat",
    1434                       &fUseQProcStat, &size);
    1435   size = sizeof(BOOL);
     1384                      &fUseQProcStat, &sizeBool);
    14361385  PrfQueryProfileData(fmprof, FM3Str, "UseQSysState",
    1437                       &fUseQSysState, &size);
    1438   size = sizeof(BOOL);
    1439   PrfQueryProfileData(fmprof, FM3Str, "DataMin", &fDataMin, &size);
    1440   size = sizeof(BOOL);
    1441   PrfQueryProfileData(fmprof, appname, "DataToFore", &fDataToFore, &size);
    1442   size = sizeof(BOOL);
     1386                      &fUseQSysState, &sizeBool);
     1387  PrfQueryProfileData(fmprof, FM3Str, "DataMin", &fDataMin, &sizeBool);
     1388  PrfQueryProfileData(fmprof, appname, "DataToFore", &fDataToFore, &sizeBool);
    14431389  PrfQueryProfileData(fmprof, appname, "DataShowDrives",
    1444                       &fDataShowDrives, &size);
    1445   size = sizeof(BOOL);
     1390                      &fDataShowDrives, &sizeBool);
    14461391  PrfQueryProfileData(fmprof, appname, "DataInclRemote",
    1447                       &fDataInclRemote, &size);
    1448   size = sizeof(BOOL);
    1449   PrfQueryProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus, &size);
    1450   size = sizeof(BOOL);
     1392                      &fDataInclRemote, &sizeBool);
     1393  PrfQueryProfileData(fmprof, FM3Str, "SplitStatus", &fSplitStatus, &sizeBool);
    14511394  PrfQueryProfileData(fmprof, appname, "FolderAfterExtract",
    1452                       &fFolderAfterExtract, &size);
    1453   size = sizeof(BOOL);
    1454   PrfQueryProfileData(fmprof, FM3Str, "DullDatabar", &fDullMin, &size);
    1455   size = sizeof(BOOL);
    1456   PrfQueryProfileData(fmprof, appname, "BlueLED", &fBlueLED, &size);
    1457   size = sizeof(BOOL);
     1395                      &fFolderAfterExtract, &sizeBool);
     1396  PrfQueryProfileData(fmprof, FM3Str, "DullDatabar", &fDullMin, &sizeBool);
     1397  PrfQueryProfileData(fmprof, appname, "BlueLED", &fBlueLED, &sizeBool);
    14581398  PrfQueryProfileData(fmprof, appname, "ConfirmDelete",
    1459                       &fConfirmDelete, &size);
    1460   size = sizeof(BOOL);
    1461   PrfQueryProfileData(fmprof, FM3Str, "SaveState", &fSaveState, &size);
    1462   size = sizeof(BOOL);
    1463   PrfQueryProfileData(fmprof, appname, "SyncUpdates", &fSyncUpdates, &size);
    1464   size = sizeof(BOOL);
    1465   PrfQueryProfileData(fmprof, appname, "LoadSubject", &fLoadSubject, &size);
    1466   size = sizeof(BOOL);
    1467   PrfQueryProfileData(fmprof, appname, "UnHilite", &fUnHilite, &size);
    1468   size = sizeof(BOOL);
    1469   PrfQueryProfileData(fmprof, FM3Str, "TileBackwards", &fTileBackwards, &size);
    1470   size = sizeof(BOOL);
    1471   PrfQueryProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames, &size);
    1472   size = sizeof(BOOL);
    1473   PrfQueryProfileData(fmprof, appname, "VerifyWrites", &fVerify, &size);
     1399                      &fConfirmDelete, &sizeBool);
     1400  PrfQueryProfileData(fmprof, FM3Str, "SaveState", &fSaveState, &sizeBool);
     1401  if (fSaveState) {
     1402    ULONG numsaves = 0;
     1403    CHAR szKey[STATE_NAME_MAX_BYTES + 80];
     1404    CHAR szDir[CCHMAXPATH];
     1405    ULONG drvNum;
     1406    INT x;
     1407
     1408    fInitialDriveScan = TRUE;
     1409    sprintf(szKey, "%s.NumDirsLastTime", GetPString(IDS_SHUTDOWNSTATE));
     1410    if (PrfQueryProfileData(fmprof,
     1411                            FM3Str, szKey, (PVOID) &numsaves, &sizeUlong)) {
     1412      for (x = numsaves - 1; x >= 0; x--) {
     1413        sprintf(szKey, "%s.DirCnrDir.%lu", GetPString(IDS_SHUTDOWNSTATE), x);
     1414        size = sizeof(szDir);
     1415        if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) szDir, &size)) {
     1416          drvNum = toupper(*szDir) - 'A';
     1417          fDrivetoSkip[drvNum] = TRUE;
     1418        }
     1419      }
     1420    }
     1421  }
     1422  PrfQueryProfileData(fmprof, appname, "SyncUpdates", &fSyncUpdates, &sizeBool);
     1423  PrfQueryProfileData(fmprof, appname, "LoadSubject", &fLoadSubject, &sizeBool);
     1424  PrfQueryProfileData(fmprof, appname, "UnHilite", &fUnHilite, &sizeBool);
     1425  PrfQueryProfileData(fmprof, FM3Str, "TileBackwards", &fTileBackwards, &sizeBool);
     1426  PrfQueryProfileData(fmprof, appname, "LoadLongname", &fLoadLongnames, &sizeBool);
     1427  PrfQueryProfileData(fmprof, appname, "VerifyWrites", &fVerify, &sizeBool);
    14741428  DosSetVerify(fVerify);
    1475   size = sizeof(BOOL);
    1476   PrfQueryProfileData(fmprof, appname, "DontMoveMouse", &fDontMoveMouse, &size);
    1477   size = sizeof(BOOL);
    1478   PrfQueryProfileData(fmprof, appname, "NoIconsFiles", &fNoIconsFiles, &size);
    1479   size = sizeof(BOOL);
    1480   PrfQueryProfileData(fmprof, appname, "NoIconsDirs", &fNoIconsDirs, &size);
    1481   size = sizeof(BOOL);
    1482   PrfQueryProfileData(fmprof, appname, "ForceUpper", &fForceUpper, &size);
    1483   size = sizeof(BOOL);
    1484   PrfQueryProfileData(fmprof, appname, "ForceLower", &fForceLower, &size);
    1485   size = sizeof(BOOL);
    1486   PrfQueryProfileData(fmprof, FM3Str, "TextTools", &fTextTools, &size);
    1487   size = sizeof(BOOL);
    1488   PrfQueryProfileData(fmprof, FM3Str, "ToolTitles", &fToolTitles, &size);
    1489   size = sizeof(BOOL);
    1490   PrfQueryProfileData(fmprof, appname, "DoubleClickOpens", &fDCOpens, &size);
    1491   size = sizeof(BOOL);
    1492   PrfQueryProfileData(fmprof, appname, "LinkSetsIcon", &fLinkSetsIcon, &size);
    1493   size = sizeof(INT);
    1494   PrfQueryProfileData(fmprof, appname, "Sort", &sortFlags, &size);
    1495   size = sizeof(INT);
    1496   PrfQueryProfileData(fmprof, appname, "TreeSort", &TreesortFlags, &size);
    1497   size = sizeof(INT);
     1429  PrfQueryProfileData(fmprof, appname, "DontMoveMouse", &fDontMoveMouse, &sizeBool);
     1430  PrfQueryProfileData(fmprof, appname, "NoIconsFiles", &fNoIconsFiles, &sizeBool);
     1431  PrfQueryProfileData(fmprof, appname, "NoIconsDirs", &fNoIconsDirs, &sizeBool);
     1432  PrfQueryProfileData(fmprof, appname, "ForceUpper", &fForceUpper, &sizeBool);
     1433  PrfQueryProfileData(fmprof, appname, "ForceLower", &fForceLower, &sizeBool);
     1434  PrfQueryProfileData(fmprof, FM3Str, "TextTools", &fTextTools, &sizeBool);
     1435  PrfQueryProfileData(fmprof, FM3Str, "ToolTitles", &fToolTitles, &sizeBool);
     1436  PrfQueryProfileData(fmprof, appname, "DoubleClickOpens", &fDCOpens, &sizeBool);
     1437  PrfQueryProfileData(fmprof, appname, "LinkSetsIcon", &fLinkSetsIcon, &sizeBool);
     1438  PrfQueryProfileData(fmprof, appname, "Sort", &sortFlags, &sizeInt);
     1439  PrfQueryProfileData(fmprof, appname, "TreeSort", &TreesortFlags, &sizeInt);
    14981440  PrfQueryProfileData(fmprof, appname,
    1499                       "CollectorSort", &CollectorsortFlags, &size);
     1441                      "CollectorSort", &CollectorsortFlags, &sizeInt);
    15001442  size = sizeof(targetdir);
    15011443  PrfQueryProfileData(fmprof, appname, "Targetdir", targetdir, &size);
     
    15041446  size = sizeof(extractpath);
    15051447  PrfQueryProfileData(fmprof, appname, "ExtractPath", extractpath, &size);
    1506   size = sizeof(BOOL);
    1507   PrfQueryProfileData(fmprof, FM3Str, "FileNamePathCnr", &fFileNameCnrPath, &size);
     1448  PrfQueryProfileData(fmprof, FM3Str, "FileNamePathCnr", &fFileNameCnrPath, &sizeBool);
    15081449  size = sizeof(printer);
    15091450  PrfQueryProfileData(fmprof, appname, "Printer", printer, &size);
     
    15231464  size = MaxComLineStrg;
    15241465  PrfQueryProfileData(fmprof, appname, "Virus", virus, &size);
    1525   size = sizeof(BOOL);
    1526   PrfQueryProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, &size);
     1466  PrfQueryProfileData(fmprof, appname, "FtpRunWPSDefault", &fFtpRunWPSDefault, &sizeBool);
    15271467  size = MaxComLineStrg;
    15281468  PrfQueryProfileData(fmprof, appname, "FTPRun", ftprun, &size);
    15291469  if (!*ftprun)
    15301470    fFtpRunWPSDefault = TRUE;
    1531   size = sizeof(BOOL);
    1532   PrfQueryProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, &size);
     1471  PrfQueryProfileData(fmprof, appname, "HttpRunWPSDefault", &fHttpRunWPSDefault, &sizeBool);
    15331472  size = MaxComLineStrg;
    15341473  PrfQueryProfileData(fmprof, appname, "HTTPRun", httprun, &size);
     
    15461485  PrfQueryProfileData(fmprof, appname, "LastToolbar", lasttoolbar,
    15471486                      &size);
    1548   size = sizeof(BOOL);
    15491487  PrfQueryProfileData(fmprof, appname, "LibPathStrictHttpRun", &fLibPathStrictHttpRun,
    1550                       &size);
    1551   size = sizeof(BOOL);
     1488                      &sizeBool);
    15521489  PrfQueryProfileData(fmprof, appname, "LibPathStrictFtpRun", &fLibPathStrictFtpRun,
    1553                       &size);
    1554   size = sizeof(BOOL);
     1490                      &sizeBool);
    15551491  PrfQueryProfileData(fmprof, appname, "LibPathStrictMailRun", &fLibPathStrictMailRun,
    1556                       &size);
    1557   size = sizeof(BOOL);
     1492                      &sizeBool);
    15581493  PrfQueryProfileData(fmprof, appname, "NoMailtoMailRun", &fNoMailtoMailRun,
    1559                       &size);
    1560   size = sizeof(BOOL);
     1494                      &sizeBool);
    15611495  PrfQueryProfileData(fmprof, appname, "FollowTree", &fFollowTree,
    1562                       &size);
    1563   size = sizeof(BOOL);
     1496                      &sizeBool);
    15641497  PrfQueryProfileData(fmprof, appname, "StartMaximized",
    1565                       &fStartMaximized, &size);
     1498                      &fStartMaximized, &sizeBool);
    15661499  if (!fStartMaximized) {
    1567     size = sizeof(BOOL);
    15681500    PrfQueryProfileData(fmprof, appname, "StartMinimized",
    1569                         &fStartMinimized, &size);
    1570   }
    1571   size = sizeof(BOOL);
    1572   PrfQueryProfileData(fmprof, appname, "DefaultCopy", &fCopyDefault, &size);
    1573   size = sizeof(BOOL);
    1574   PrfQueryProfileData(fmprof, appname, "IdleCopy", &fRealIdle, &size);
    1575   size = sizeof(BOOL);
     1501                        &fStartMinimized, &sizeBool);
     1502  }
     1503  PrfQueryProfileData(fmprof, appname, "DefaultCopy", &fCopyDefault, &sizeBool);
     1504  PrfQueryProfileData(fmprof, appname, "IdleCopy", &fRealIdle, &sizeBool);
    15761505  PrfQueryProfileData(fmprof, appname, "ArcStuffVisible",
    1577                       &fArcStuffVisible, &size);
    1578   size = sizeof(BOOL);
    1579   PrfQueryProfileData(fmprof, FM3Str, "NoTreeGap", &fNoTreeGap, &size);
    1580   size = sizeof(BOOL);
     1506                      &fArcStuffVisible, &sizeBool);
     1507  PrfQueryProfileData(fmprof, FM3Str, "NoTreeGap", &fNoTreeGap, &sizeBool);
    15811508  PrfQueryProfileData(fmprof, FM3Str, "VTreeOpensWPS",
    1582                       &fVTreeOpensWPS, &size);
    1583   size = sizeof(BOOL);
    1584   PrfQueryProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, &size);
    1585   size = sizeof(BOOL);
     1509                      &fVTreeOpensWPS, &sizeBool);
     1510  PrfQueryProfileData(fmprof, appname, "RemoteBug", &fRemoteBug, &sizeBool);
    15861511  PrfQueryProfileData(fmprof, appname, "Drag&DropDlg",
    1587                       &fDragndropDlg, &size);
    1588   size = sizeof(BOOL);
    1589   PrfQueryProfileData(fmprof, FM3Str, "UserComboBox", &fUserComboBox, &size);
    1590   size = sizeof(BOOL);
    1591   PrfQueryProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen, &size);
    1592   size = sizeof(BOOL);
     1512                      &fDragndropDlg, &sizeBool);
     1513  PrfQueryProfileData(fmprof, FM3Str, "UserComboBox", &fUserComboBox, &sizeBool);
     1514  PrfQueryProfileData(fmprof, FM3Str, "MinDirOnOpen", &fMinOnOpen, &sizeBool);
    15931515  PrfQueryProfileData(fmprof, appname, "QuickArcFind",
    1594                       &fQuickArcFind, &size);
    1595   size = sizeof(BOOL);
     1516                      &fQuickArcFind, &sizeBool);
    15961517  PrfQueryProfileData(fmprof, FM3Str, "NoRemovableScan",
    1597                       &fNoRemovableScan, &size);
    1598   size = sizeof(ULONG);
     1518                      &fNoRemovableScan, &sizeBool);
    15991519  PrfQueryProfileData(fmprof, FM3Str, "NoBrokenNotify",
    1600                       &NoBrokenNotify, &size);
    1601   size = sizeof(ULONG);
     1520                      &NoBrokenNotify, &sizeUlong);
    16021521  PrfQueryProfileData(fmprof, appname, "ContainerType", &ulCnrType,
    1603                       &size);
    1604   size = sizeof(ULONG);
    1605   PrfQueryProfileData(fmprof, appname, "FilesToGet", &FilesToGet, &size);
     1522                      &sizeUlong);
     1523  PrfQueryProfileData(fmprof, appname, "FilesToGet", &FilesToGet, &sizeUlong);
    16061524  if (FilesToGet < FILESTOGET_MIN)
    16071525    FilesToGet = FILESTOGET_MIN;
    16081526  else if (FilesToGet > FILESTOGET_MAX)
    16091527    FilesToGet = FILESTOGET_MAX;
    1610   size = sizeof(BOOL);
    1611   PrfQueryProfileData(fmprof, FM3Str, "AutoView", &fAutoView, &size);
    1612   size = sizeof(BOOL);
    1613   PrfQueryProfileData(fmprof, FM3Str, "FM2Deletes", &fFM2Deletes, &size);
    1614   size = sizeof(BOOL);
    1615   PrfQueryProfileData(fmprof, FM3Str, "TrashCan", &fTrashCan, &size);
     1528  PrfQueryProfileData(fmprof, FM3Str, "AutoView", &fAutoView, &sizeBool);
     1529  PrfQueryProfileData(fmprof, FM3Str, "FM2Deletes", &fFM2Deletes, &sizeBool);
     1530  PrfQueryProfileData(fmprof, FM3Str, "TrashCan", &fTrashCan, &sizeBool);
    16161531
    16171532  LoadDetailsSwitches("DirCnr", &dsDirCnrDefault);
Note: See TracChangeset for help on using the changeset viewer.