Changeset 1326 for trunk/dll/mainwnd.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/mainwnd.c

    r1321 r1326  
    29132913 */
    29142914
    2915 #define STATE_NAME_MAX_BYTES    256
    2916 
    29172915INT SaveDirCnrState(HWND hwndClient, PSZ pszStateName)
    29182916{
     
    29742972              sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, numsaves);
    29752973              PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->sortFlags,
    2976                                   sizeof(INT));
     2974                                  sizeInt);
    29772975              sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, numsaves);
    29782976              PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & dcd->mask,
     
    30513049      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(SWP));
    30523050      sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, ulTemp);
    3053       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(INT));
     3051      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeInt);
    30543052      sprintf(szKey, "%sDirCnrFilter.%lu", szPrefix, ulTemp);
    30553053      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(MASK));
    30563054      sprintf(szKey, "%sDirCnrView.%lu", szPrefix, ulTemp);
    3057       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(ULONG));
     3055      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeUlong);
    30583056      sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, ulTemp);
    3059       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3057      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30603058      sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, ulTemp);
    3061       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3059      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30623060      sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, ulTemp);
    3063       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3061      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30643062      sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, ulTemp);
    3065       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3063      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30663064      sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, ulTemp);
    3067       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3065      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30683066      sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, ulTemp);
    3069       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3067      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30703068      sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, ulTemp);
    3071       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3069      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30723070      sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, ulTemp);
    3073       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3071      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30743072      sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, ulTemp);
    3075       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3073      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30763074      sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, ulTemp);
    3077       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3075      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30783076      sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, ulTemp);
    3079       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3077      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30803078      sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, ulTemp);
    3081       PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeof(BOOL));
     3079      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, sizeBool);
    30823080      sprintf(szKey, "%sDirCnrDir.%lu", szPrefix, ulTemp);
    30833081      PrfWriteProfileString(fmprof, FM3Str, szKey, NULL);
     
    30873085  sprintf(szKey, "%sNumDirsLastTime", szPrefix);
    30883086  if (numsaves) {
    3089     PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & numsaves, sizeof(ULONG));
     3087    PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & numsaves, sizeUlong);
    30903088    WinQueryWindowPos(WinQueryWindow(hwndClient, QW_PARENT), &swp);
    30913089    sprintf(szKey, "%sMySizeLastTime", szPrefix);
     
    30973095  }
    30983096  else if (fIsShutDownState) {
    3099     PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & numsaves, sizeof(ULONG));
     3097    PrfWriteProfileData(fmprof, FM3Str, szKey, (PVOID) & numsaves, sizeUlong);
    31003098  }
    31013099
     
    31873185    PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);
    31883186  }
    3189   DosWaitEventSem(DriveScanStart, 20000);
    31903187  size = (ULONG)0;
    31913188  sprintf(szKey, "%sTargetDir", szPrefix);
     
    32013198                           FM3Str,
    32023199                           szKey,
    3203                            (PVOID) & swpO,
     3200                           (PVOID) &swpO,
    32043201                           &size) ||
    32053202      size != sizeof(SWP) || !swp.cx || !swp.cy)
     
    32173214  size = sizeof(SWP);
    32183215  sprintf(szKey, "%sLastTreePos", szPrefix);
    3219   if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) & swp, &size)) {
     3216  if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) &swp, &size)) {
    32203217    if (fDeleteState)
    32213218      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
     
    32463243    }
    32473244  }
    3248   size = sizeof(ULONG);
    32493245  sprintf(szKey, "%sNumDirsLastTime", szPrefix);
    32503246  if (PrfQueryProfileData(fmprof,
    3251                           FM3Str, szKey, (PVOID) & numsaves, &size)) {
     3247                          FM3Str, szKey, (PVOID) &numsaves, &sizeUlong)) {
    32523248    if (fDeleteState)
    32533249      PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
     
    32713267            PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    32723268          localdcd.ds.detailslongname = dsDirCnrDefault.detailslongname;  // Set default
    3273           size = sizeof(BOOL);
    32743269          sprintf(szKey, "%sDirCnr.%lu.DetailsLongname", szPrefix, x);
    32753270          if (PrfQueryProfileData(fmprof,
    32763271                                  FM3Str,
    32773272                                  szKey,
    3278                                   (PVOID)&localdcd.ds.detailslongname,
    3279                                   &size) &&
    3280               size == sizeof(BOOL))
     3273                                  (PVOID) &localdcd.ds.detailslongname,
     3274                                  &sizeBool))
    32813275          {
    32823276            if (fDeleteState)
     
    32843278          }
    32853279          localdcd.ds.detailssubject = dsDirCnrDefault.detailssubject;  // Set default
    3286           size = sizeof(BOOL);
    32873280          sprintf(szKey, "%sDirCnr.%lu.DetailsSubject", szPrefix, x);
    32883281          if (PrfQueryProfileData(fmprof,
    32893282                                  FM3Str,
    32903283                                  szKey,
    3291                                   (PVOID)&localdcd.ds.detailssubject,
    3292                                   &size) &&
    3293               size == sizeof(BOOL))
     3284                                  (PVOID) &localdcd.ds.detailssubject,
     3285                                  &sizeBool))
    32943286          {
    32953287            if (fDeleteState)
     
    32973289          }
    32983290          localdcd.ds.detailsea = dsDirCnrDefault.detailsea;  // Set default
    3299           size = sizeof(BOOL);
    33003291          sprintf(szKey, "%sDirCnr.%lu.DetailsEA", szPrefix, x);
    33013292          if (PrfQueryProfileData(fmprof,
    33023293                                  FM3Str,
    33033294                                  szKey,
    3304                                   (PVOID) & localdcd.ds.detailsea,
    3305                                   &size) &&
    3306               size == sizeof(BOOL))
     3295                                  (PVOID) &localdcd.ds.detailsea,
     3296                                  &sizeBool))
    33073297          {
    33083298            if (fDeleteState)
     
    33103300          }
    33113301          localdcd.ds.detailssize = dsDirCnrDefault.detailssize;  // Set default
    3312           size = sizeof(BOOL);
    33133302          sprintf(szKey, "%sDirCnr.%lu.DetailsSize", szPrefix, x);
    33143303          if (PrfQueryProfileData(fmprof,
    33153304                                  FM3Str,
    33163305                                  szKey,
    3317                                   (PVOID) & localdcd.ds.detailssize,
    3318                                   &size) &&
    3319               size == sizeof(BOOL))
     3306                                  (PVOID) &localdcd.ds.detailssize,
     3307                                  &sizeBool))
    33203308          {
    33213309            if (fDeleteState)
     
    33233311          }
    33243312          localdcd.ds.detailsicon = dsDirCnrDefault.detailsicon;  // Set default
    3325           size = sizeof(BOOL);
    33263313          sprintf(szKey, "%sDirCnr.%lu.DetailsIcon", szPrefix, x);
    33273314          if (PrfQueryProfileData(fmprof,
    33283315                                  FM3Str,
    33293316                                  szKey,
    3330                                   (PVOID) & localdcd.ds.detailsicon,
    3331                                   &size) &&
    3332               size == sizeof(BOOL))
     3317                                  (PVOID) &localdcd.ds.detailsicon,
     3318                                  &sizeBool))
    33333319          {
    33343320            if (fDeleteState)
     
    33363322          }
    33373323          localdcd.ds.detailsattr = dsDirCnrDefault.detailsattr;  // Set default
    3338           size = sizeof(BOOL);
    33393324          sprintf(szKey, "%sDirCnr.%lu.DetailsAttr", szPrefix, x);
    33403325          if (PrfQueryProfileData(fmprof,
    33413326                                  FM3Str,
    33423327                                  szKey,
    3343                                   (PVOID)&localdcd.ds.detailsattr,
    3344                                   &size) &&
    3345               size == sizeof(BOOL))
     3328                                  (PVOID) &localdcd.ds.detailsattr,
     3329                                  &sizeBool))
    33463330          {
    33473331            if (fDeleteState)
     
    33493333          }
    33503334          localdcd.ds.detailscrdate = dsDirCnrDefault.detailscrdate;  // Set default
    3351           size = sizeof(BOOL);
    33523335          sprintf(szKey, "%sDirCnr.%lu.DetailsCRDate", szPrefix, x);
    33533336          if (PrfQueryProfileData(fmprof,
    33543337                                  FM3Str,
    33553338                                  szKey,
    3356                                   (PVOID) & localdcd.ds.detailscrdate,
    3357               &size) && size == sizeof(BOOL))
     3339                                  (PVOID) &localdcd.ds.detailscrdate,
     3340                                  &sizeBool))
    33583341          {
    33593342            if (fDeleteState)
     
    33613344          }
    33623345          localdcd.ds.detailscrtime = dsDirCnrDefault.detailscrtime;  // Set default
    3363           size = sizeof(BOOL);
    33643346          sprintf(szKey, "%sDirCnr.%lu.DetailsCRTime", szPrefix, x);
    33653347          if (PrfQueryProfileData(fmprof,
    33663348                                  FM3Str,
    33673349                                  szKey,
    3368                                   (PVOID)&localdcd.ds.detailscrtime,
    3369                                   &size) &&
    3370               size == sizeof(BOOL))
     3350                                  (PVOID) &localdcd.ds.detailscrtime,
     3351                                  &sizeBool))
    33713352          {
    33723353            if (fDeleteState)
     
    33743355          }
    33753356          localdcd.ds.detailslwdate = dsDirCnrDefault.detailslwdate;  // Set default
    3376           size = sizeof(BOOL);
    33773357          sprintf(szKey, "%sDirCnr.%lu.DetailsLWDate", szPrefix, x);
    33783358          if (PrfQueryProfileData(fmprof,
    33793359                                  FM3Str,
    33803360                                  szKey,
    3381                                   (PVOID) & localdcd.ds.detailslwdate,
    3382                                   &size) &&
    3383               size == sizeof(BOOL))
     3361                                  (PVOID) &localdcd.ds.detailslwdate,
     3362                                  &sizeBool))
    33843363          {
    33853364            if (fDeleteState)
     
    33873366          }
    33883367          localdcd.ds.detailslwtime = dsDirCnrDefault.detailslwtime;  // Set default
    3389           size = sizeof(BOOL);
    33903368          sprintf(szKey, "%sDirCnr.%lu.DetailsLWTime", szPrefix, x);
    33913369          if (PrfQueryProfileData(fmprof,
    33923370                                  FM3Str,
    33933371                                  szKey,
    3394                                   (PVOID) & localdcd.ds.detailslwtime,
    3395                                   &size) &&
    3396               size == sizeof(BOOL))
     3372                                  (PVOID) &localdcd.ds.detailslwtime,
     3373                                  &sizeBool))
    33973374          {
    33983375            if (fDeleteState)
     
    34003377          }
    34013378          localdcd.ds.detailsladate = dsDirCnrDefault.detailsladate;  // Set default
    3402           size = sizeof(BOOL);
    34033379          sprintf(szKey, "%sDirCnr.%lu.DetailsLADate", szPrefix, x);
    34043380          if (PrfQueryProfileData(fmprof,
    34053381                                  FM3Str,
    34063382                                  szKey,
    3407                                   (PVOID) & localdcd.ds.detailsladate,
    3408                                   &size) &&
    3409               size == sizeof(BOOL))
     3383                                  (PVOID) &localdcd.ds.detailsladate,
     3384                                  &sizeBool))
    34103385          {
    34113386            if (fDeleteState)
     
    34133388          }
    34143389          localdcd.ds.detailslatime = dsDirCnrDefault.detailslatime;  // Set default
    3415           size = sizeof(BOOL);
    34163390          sprintf(szKey, "%sDirCnr.%lu.DetailsLATime", szPrefix, x);
    34173391          if (PrfQueryProfileData(fmprof,
    34183392                                  FM3Str,
    34193393                                  szKey,
    3420                                   (PVOID) & localdcd.ds.detailslatime,
    3421                                   &size) &&
    3422               size == sizeof(BOOL))
     3394                                  (PVOID) &localdcd.ds.detailslatime,
     3395                                  &sizeBool))
    34233396          {
    34243397            if (fDeleteState)
     
    34373410                                             NULL,
    34383411                                             CCS_AUTOPOSITION | CCS_MINIICONS |
    3439                                              CCS_MINIRECORDCORE | ulCnrType |
    3440                                              WS_VISIBLE,
     3412                                             CCS_MINIRECORDCORE | ulCnrType, //| WS_VISIBLE,
    34413413                                             0,
    34423414                                             0,
     
    34643436                dcd->ds.detailslwdate   = localdcd.ds.detailslwdate  ;
    34653437                dcd->ds.detailslwtime   = localdcd.ds.detailslwtime  ;
    3466                 size = sizeof(INT);
    34673438                sprintf(szKey, "%sDirCnrSort.%lu", szPrefix, x);
    34683439                if (PrfQueryProfileData(fmprof,
    34693440                                        FM3Str,
    34703441                                        szKey,
    3471                                         (PVOID) & dcd->sortFlags,
    3472                                         &size) && size == sizeof(INT)) {
     3442                                        (PVOID) &dcd->sortFlags,
     3443                                        &sizeInt)) {
    34733444                  if (!dcd->sortFlags)
    34743445                    dcd->sortFlags = SORT_PATHNAME;
     
    34813452                                        FM3Str,
    34823453                                        szKey,
    3483                                         (PVOID) & dcd->mask, &size) && size) {
     3454                                        (PVOID) &dcd->mask, &size)) {
    34843455                  if (*dcd->mask.szMask)
    34853456                    WinSendMsg(WinWindowFromID(hwndC, DIR_CNR),
     
    34893460                if (fDeleteState)
    34903461                  PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L);
    3491                 size = sizeof(ULONG);
    34923462                sprintf(szKey, "%sDirCnrView.%lu", szPrefix, x);
    34933463                if (!noview) {
     
    34953465                                          FM3Str,
    34963466                                          szKey,
    3497                                           (PVOID) & dcd->flWindowAttr,
    3498                                           &size) && size == sizeof(ULONG)) {
     3467                                          (PVOID) &dcd->flWindowAttr,
     3468                                          &sizeUlong)) {
    34993469
    35003470                    CNRINFO cnri;
     
    35453515    } // for
    35463516    if (hwndPPSave) {
    3547        SavePresParams(hwndPPSave, "DirCnr");
    3548        WinDestroyWindow(hwndPPSave);
     3517      SavePresParams(hwndPPSave, "DirCnr");
     3518      WinDestroyWindow(hwndPPSave);
    35493519    }
    35503520  }
Note: See TracChangeset for help on using the changeset viewer.