Changeset 1156

Show
Ignore:
Timestamp:
09/05/08 23:39:19 (3 months ago)
Author:
jbs
Message:

Ticket 187: Draft 1: Functions only

Location:
trunk/dll
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • trunk/dll/attribs.c

    r907 r1156  
    2525#include "errutil.h"                    // Runtime_Error 
    2626#include "strutil.h"                    // GetPString 
     27#include "defview.h"                    // QuickView 
     28#include "attribs.h" 
    2729#include "fm3dll.h" 
    2830 
  • trunk/dll/cmdline.c

    r1119 r1156  
    3737#include "errutil.h"                    // Dos_Error... 
    3838#include "strutil.h"                    // GetPString 
     39#include "mainwnd.h"                    // BubbleHelp 
     40#include "cmdline.h"                    // CmdLineDlgProc, CmdLine2DlgProc 
    3941#include "fm3dll.h" 
    4042#include "pathutil.h"                   // MaxCmdLineStr 
  • trunk/dll/datamin.c

    r1063 r1156  
    4141#include "errutil.h"                    // Dos_Error... 
    4242#include "strutil.h"                    // GetPString 
     43#include "commafmt.h"                   // CommaFmtUL 
     44#include "killproc.h"                   // KillDlgProc 
     45#include "sysinfo.h"                    // SysInfoDlgProc 
     46#include "mainwnd.h"                    // TopWindowName 
    4347#include "fm3dll.h" 
    4448#include "fortify.h" 
  • trunk/dll/dircnrs.c

    r1120 r1156  
    1  
    21/*********************************************************************** 
    32 
     
    7574#include "notebook.h"                   // CfgDlgProc 
    7675#include "command.h"                    // RunCommand 
     76#include "worker.h"                     // Action, MassAction 
     77#include "misc.h"                       // GetTidForThread, AdjustCnrColsForFSType, AdjustCnrColsForPref 
     78                                        // AdjustDetailsSwitches, CnrDirectEdit, OpenEdit, QuickPopup 
     79                                        // SayFilter, SaySort, SayView, SetCnrCols, SetDetailsSwitches 
     80                                        // SetSortChecks, SetViewMenu, SwitchCommand 
     81#include "chklist.h"                    // CenterOverWindow, DropListProc 
     82#include "common.h"                     // CommonCnrProc, CommonCreateTextChildren, CommonFrameWndProc 
     83                                        // CommonTextPaint 
     84#include "mainwnd.h"                    // CountDirCnrs, MakeBubble, TopWindow 
     85#include "select.h"                     // DeselectAll, HideAll, InvertAll, SelectAll, SelectList 
     86                                        // SpecialSelect2 
     87#include "dirsize.h"                    // DirSizeProc 
     88#include "flesh.h"                      // Flesh, Stubby, UnFlesh 
     89#include "valid.h"                      // IsValidDir 
     90#include "objwin.h"                     // MakeObjWin 
     91#include "notify.h"                     // NotifyError 
     92#include "objcnr.h"                     // ObjCnrDlgProc 
     93#include "draglist.h"                   // PickUp 
     94#include "saveclip.h"                   // SaveListDlgProc 
     95#include "findrec.h"                    // ShowCnrRecord 
     96#include "sortcnr.h"                    // SortDirCnr 
     97#include "seeall.h"                     // StartSeeAll 
     98#include "update.h"                     // UpdateCnrList, UpdateCnrRecord 
     99#include "walkem.h"                     // add_udir 
     100#include "strips.h"                     // chop_at_crnl 
    77101#include "fm3dll.h" 
    78102//#include "avl.h"                      // free_archivers 
    79 #ifdef FORTIFY 
    80 #include "misc.h"                       // GetTidForThread 
    81 #endif 
    82103#include "fortify.h" 
    83104 
  • trunk/dll/dirsize.c

    r1114 r1156  
    6161#include "strutil.h"                    // GetPString 
    6262#include "filldir.h"                    // EmptyCnr... 
     63#include "dirsize.h" 
     64#include "select.h"                     // ExpandAll 
    6365#include "fm3dll.h" 
    6466 
  • trunk/dll/init.c

    <
    r1130 r1156  
    4444  29 Feb 08 GKY Refactor global command line variables to notebook.h 
    4545  08 Mar 08 JBS Ticket 230: Replace prefixless INI keys for default directory containers with 
    46                 keys using a "DirCnr." prefix 
     46                keys using a "DirCnr." prefix 
    4747  20 Apr 08 GKY Change default cmd line length to 1024 Ask once if user wants to reset it. 
    4848  11 Jul 08 JBS Ticket 230: Simplified code and eliminated some local variables by incorporating 
    49                 all the details view settings (both the global variables and those in the 
    50                 DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 
     49                all the details view settings (both the global variables and those in the 
     50                DIRCNRDATA struct) into a new struct: DETAILS_SETTINGS. 
    5151  16 JUL 08 GKY Use TMP directory for temp files 
    5252  17 Jul 08 SHL Reduce code bulk in fUseTmp setup 
     
    8282#include "fm3str.h" 
    8383#include "version.h" 
    84 #include "pathutil.h"                   // BldFullPathName 
    85 #include "arccnrs.h"                    // ArcClientWndProc 
    86 #include "errutil.h"                    // Dos_Error... 
    87 #include "strutil.h"                    // GetPString 
     84#include "pathutil.h"                   // BldFullPathName 
     85#include "arccnrs.h"                    // ArcClientWndProc 
     86#include "errutil.h"                    // Dos_Error... 
     87#include "strutil.h"                    // GetPString 
     88#include "valid.h"                      // ArgDriveFlags 
     89#include "autoview.h"                   // AutoViewProc 
     90#include "mainwnd.h"                    // BubbleProc, ChildButtonProc, DriveBackProc, 
     91                                        // DriveProc, LEDProc, MainWndProc, StatusProc 
     92                                        // ToolBackProc 
     93#include "collect.h"                    // CollectorClientWndProc, CollectorTextProc 
     94#include "getnames.h"                   // CustomFileDlg 
     95#include "notify.h"                     // EndNote 
     96#include "valid.h"                      // FillInDriveFlags, IsValidDir 
     97#include "inis.h"                       // IniProc 
     98#include "viewer.h"                     // MLEEditorProc 
     99#include "mainwnd2.h"                   // MainWndProc2 
     100#include "notify.h"                     // NotifyWndProc 
     101#include "treecnr.h"                    // OpenButtonProc 
     102#include "seeall.h"                     // SeeAllWndProc, SeeStatusProc 
     103#include "init.h" 
     104#include "timer.h"                      // StartTimer, StopTimer 
     105#include "treecnr.h"                    // TreeClientWndProc, TreeStatProc 
     106#include "newview.h"                    // ViewStatusProc, ViewWndProc 
    88107#include "fm3dll.h" 
    89 #include "notebook.h"                   // command line variables (editor etc) 
     108#include "misc.h"                       // HeapThread, LoadDetailsSwitches 
     109#include "notebook.h"                   // command line variables (editor etc) 
    90110#include "fortify.h" 
    91111 
    92112#ifdef __IBMC__ 
    93113#pragma alloc_text(INIT,LibMain,InitFM3DLL,DeInitFM3DLL) 
    94 #pragma alloc_text(INIT1,StartFM3,FindSwapperDat) 
     114#pragma alloc_text(INIT1,StartFM3) 
    95115#endif 
    96116 
     
    108128 
    109129static PSZ pszSrcFile = __FILE__; 
     130 
     131VOID FindSwapperDat(VOID); 
    110132 
    111133BOOL CheckFileHeader(CHAR *filespec, CHAR *signature, LONG offset); 
     
    130152    nm = 1; 
    131153    rc = DosFindFirst(SwapperDat, 
    132                       &hdir, 
    133                       FILE_NORMAL | FILE_ARCHIVED | 
    134                       FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
    135                       &ffb, sizeof(ffb), &nm, FIL_STANDARDL); 
     154                      &hdir, 
     155                      FILE_NORMAL | FILE_ARCHIVED | 
     156                      FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
     157                      &ffb, sizeof(ffb), &nm, FIL_STANDARDL); 
    136158    if (rc && rc != ERROR_FILE_NOT_FOUND && rc != ERROR_PATH_NOT_FOUND) { 
    137159      FILEFINDBUF3 ffb; 
    138160      rc = DosFindFirst(SwapperDat, 
    139                         &hdir, 
    140                         FILE_NORMAL | FILE_ARCHIVED | 
    141                         FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
    142                         &ffb, sizeof(ffb), &nm, FIL_STANDARD); 
     161                        &hdir, 
     162                        FILE_NORMAL | FILE_ARCHIVED | 
     163                        FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
     164                        &ffb, sizeof(ffb), &nm, FIL_STANDARD); 
    143165      fNoLargeFileSupport = TRUE; 
    144166    } 
     
    147169      fp = fopen(SwapperDat, "r"); 
    148170      if (fp) { 
    149         fclose(fp); 
    150         *SwapperDat = 0; 
    151         rc = 1;                         // Force config.sys scan 
     171        fclose(fp); 
     172        *SwapperDat = 0; 
     173        rc = 1;                         // Force config.sys scan 
    152174      } 
    153175    } 
     
    158180  if (rc) { 
    159181    if (DosQuerySysInfo(QSV_BOOT_DRIVE, 
    160                         QSV_BOOT_DRIVE, 
    161                         &nm, 
    162                         sizeof(ULONG))) { 
    163       nm = 3;                           // Assume drive C: 
     182                        QSV_BOOT_DRIVE, 
     183                        &nm, 
     184                        sizeof(ULONG))) { 
     185      nm = 3;                           // Assume drive C: 
    164186    } 
    165187    *filename = (CHAR) nm + '@'; 
     
    167189    if (fp) { 
    168190      while (!feof(fp)) { 
    169         if (!xfgets(input, sizeof(input), fp, pszSrcFile, __LINE__)) 
    170           break; 
    171         lstrip(input); 
    172         if (!strnicmp(input, "SWAPPATH", 8)) { 
    173           p = input + 8; 
    174           while (*p == ' ') 
    175             p++; 
    176           if (*p == '=') { 
    177             p++; 
    178             stripcr(p); 
    179             rstrip(p); 
    180             while (*p == ' ') 
    181               p++; 
    182             if (*p == '\"') { 
    183               p++; 
    184               pp = p; 
    185               while (*pp && *pp != '\"') 
    186                 *pp += 1; 
    187               if (*pp) 
    188                 *pp = 0; 
    189             } 
    190             else { 
    191               pp = strchr(p, ' '); 
    192               if (pp) 
    193                 *pp = 0; 
    194             } 
    195             if (*p) { 
    196               strncpy(SwapperDat, p, CCHMAXPATH); 
    197               SwapperDat[CCHMAXPATH - 1] = 0; 
    198               BldFullPathName(SwapperDat, SwapperDat, "SWAPPER.DAT"); 
    199               hdir = HDIR_CREATE; 
    200               nm = 1; 
    201               rc = DosFindFirst(SwapperDat, 
    202                                 &hdir, 
    203                                 FILE_NORMAL | FILE_ARCHIVED | 
    204                                 FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
    205                                 &ffb, sizeof(ffb), &nm, FIL_STANDARD); 
    206               if (rc){ 
    207                 FILEFINDBUF3 ffb; 
    208                 rc = DosFindFirst(SwapperDat, 
    209                                   &hdir, 
    210                                   FILE_NORMAL | FILE_ARCHIVED | 
    211                                   FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
    212                                   &ffb, sizeof(ffb), &nm, FIL_STANDARD); 
    213                 fNoLargeFileSupport = TRUE; 
    214               } 
    215               if (!rc) { 
    216                 DosFindClose(hdir); 
    217                 PrfWriteProfileString(fmprof, 
    218                                       FM3Str, "SwapperDat", SwapperDat); 
    219               } 
    220               else 
    221                 *SwapperDat = 0; 
    222               break; 
    223             } 
    224           } 
    225         }                               // if SWAPPATH 
    226       }                                 // while 
     191        if (!xfgets(input, sizeof(input), fp, pszSrcFile, __LINE__)) 
     192          break; 
     193        lstrip(input); 
     194        if (!strnicmp(input, "SWAPPATH", 8)) { 
     195          p = input + 8; 
     196          while (*p == ' ') 
     197            p++; 
     198          if (*p == '=') { 
     199            p++; 
     200            stripcr(p); 
     201            rstrip(p); 
     202            while (*p == ' ') 
     203              p++; 
     204            if (*p == '\"') { 
     205              p++; 
     206              pp = p; 
     207              while (*pp && *pp != '\"') 
     208                *pp += 1; 
     209              if (*pp) 
     210                *pp = 0; 
     211            } 
     212            else { 
     213              pp = strchr(p, ' '); 
     214              if (pp) 
     215                *pp = 0; 
     216            } 
     217            if (*p) { 
     218              strncpy(SwapperDat, p, CCHMAXPATH); 
     219              SwapperDat[CCHMAXPATH - 1] = 0; 
     220              BldFullPathName(SwapperDat, SwapperDat, "SWAPPER.DAT"); 
     221              hdir = HDIR_CREATE; 
     222              nm = 1; 
     223              rc = DosFindFirst(SwapperDat, 
     224                                &hdir, 
     225                                FILE_NORMAL | FILE_ARCHIVED | 
     226                                FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
     227                                &ffb, sizeof(ffb), &nm, FIL_STANDARD); 
     228              if (rc){ 
     229                FILEFINDBUF3 ffb; 
     230                rc = DosFindFirst(SwapperDat, 
     231                                  &hdir, 
     232                                  FILE_NORMAL | FILE_ARCHIVED | 
     233                                  FILE_HIDDEN | FILE_SYSTEM | FILE_READONLY, 
     234                                  &ffb, sizeof(ffb), &nm, FIL_STANDARD); 
     235                fNoLargeFileSupport = TRUE; 
     236              } 
     237              if (!rc) { 
     238                DosFindClose(hdir); 
     239                PrfWriteProfileString(fmprof, 
     240                                      FM3Str, "SwapperDat", SwapperDat); 
     241              } 
     242              else 
     243                *SwapperDat = 0; 
     244              break; 
     245            } 
     246          } 
     247        }                               // if SWAPPATH 
     248      }                                 // while 
    227249      fclose(fp); 
    228250    } 
     
    233255 
    234256unsigned APIENTRY LibMain(unsigned hModule, 
    235                           unsigned ulFlag) 
     257                          unsigned ulFlag) 
    236258{ 
    237259  CHAR *env; 
     
    252274      rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, sizeof(fsa)); 
    253275      if (!rc) { 
    254         if (fsa.attrFile & FILE_DIRECTORY) { 
    255           BldFullPathName(stringfile, env, "FM3RES.STR"); 
    256           DosError(FERR_DISABLEHARDERR); 
    257           if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa))) 
    258             strcpy(stringfile, "FM3RES.STR"); 
    259         } 
     276        if (fsa.attrFile & FILE_DIRECTORY) { 
     277          BldFullPathName(stringfile, env, "FM3RES.STR"); 
     278          DosError(FERR_DISABLEHARDERR); 
     279          if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa))) 
     280            strcpy(stringfile, "FM3RES.STR"); 
     281        } 
    260282      } 
    261283    } 
     
    347369 
    348370unsigned long _System _DLL_InitTerm(unsigned long hModule, 
    349                                     unsigned long ulFlag) 
     371                                    unsigned long ulFlag) 
    350372{ 
    351373  CHAR *env; 
     
    365387      rc = DosQueryPathInfo(env, FIL_STANDARD, &fsa, sizeof(fsa)); 
    366388      if (!rc) { 
    367         if (fsa.attrFile & FILE_DIRECTORY) { 
    368           BldFullPathName(stringfile, env, "FM3RES.STR"); 
    369           DosError(FERR_DISABLEHARDERR); 
    370           if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa))) 
    371             strcpy(stringfile, "FM3RES.STR"); 
    372         } 
     389        if (fsa.attrFile & FILE_DIRECTORY) { 
     390          BldFullPathName(stringfile, env, "FM3RES.STR"); 
     391          DosError(FERR_DISABLEHARDERR); 
     392          if (DosQueryPathInfo(stringfile, FIL_STANDARD, &fsa, sizeof(fsa))) 
     393            strcpy(stringfile, "FM3RES.STR"); 
     394        } 
    373395      } 
    374396    } 
     
    501523    num_matches = 1L; 
    502524    if (!DosFindFirst(s, 
    503                       &search_handle, 
    504                       FILE_NORMAL | FILE_DIRECTORY | 
    505                       FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN | 
    506                       FILE_ARCHIVED, 
    507                       &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) { 
     525                      &search_handle, 
     526                      FILE_NORMAL | FILE_DIRECTORY | 
     527                      FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN | 
     528                      FILE_ARCHIVED, 
     529                      &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) { 
    508530      do { 
    509         strcpy(enddir, ffb.achName); 
    510         if (ffb.attrFile & FILE_DIRECTORY) { 
    511           wipeallf("%s\\*", s); 
    512           DosDeleteDir(s); 
    513         } 
    514         else 
    515           unlinkf("%s", s); 
     531        strcpy(enddir, ffb.achName); 
     532        if (ffb.attrFile & FILE_DIRECTORY) { 
     533          wipeallf("%s\\*", s); 
     534          DosDeleteDir(s); 
     535        } 
     536        else 
     537          unlinkf("%s", s); 
    516538      } 
    517539      while (!DosFindNext(search_handle, 
    518                           &ffb, sizeof(ffb), &num_matches)); 
     540                          &ffb, sizeof(ffb), &num_matches)); 
    519541      DosFindClose(search_handle); 
    520542    } 
     
    532554  num_matches = 1; 
    533555  if (!DosFindFirst(s, 
    534                     &search_handle, 
    535                     FILE_NORMAL | FILE_DIRECTORY | 
    536                     FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN | 
    537                     FILE_ARCHIVED, 
    538                     &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) { 
     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)) { 
    539561    do { 
    540562      if (!(ffb.attrFile & FILE_DIRECTORY)) { 
    541         strcpy(enddir, ffb.achName); 
    542         unlinkf("%s", s); 
     563        strcpy(enddir, ffb.achName); 
     564        unlinkf("%s", s); 
    543565      } 
    544566    } 
    545567    while (!DosFindNext(search_handle, 
    546                         &ffb, sizeof(ffb), &num_matches)); 
     568                        &ffb, sizeof(ffb), &num_matches)); 
    547569    DosFindClose(search_handle); 
    548570  } 
     
    575597  ULONG RVMinor = 0; 
    576598  ULONG ret = 0; 
    577   FILESTATUS3 fs3;                      // 25 Aug 07 SHL 
     599  FILESTATUS3 fs3;                      // 25 Aug 07 SHL 
    578600  PSZ env; 
    579601  CHAR dllfile[CCHMAXPATH]; 
     
    582604  if (!StringsLoaded()) { 
    583605    saymsg(MB_ENTER, 
    584            HWND_DESKTOP, 
    585            "Error", 
    586            "FM3RES.STR isn't in right format, at least " 
    587            "for this version of FM/2."); 
     606           HWND_DESKTOP, 
     607           "Error", 
     608           "FM3RES.STR isn't in right format, at least " 
     609           "for this version of FM/2."); 
    588610    return FALSE; 
    589611  } 
     
    596618    if (!rc) { 
    597619      if (fs3.attrFile & FILE_DIRECTORY) { 
    598         BldFullPathName(dllfile, env, "FM3RES");        // 23 Aug 07 SHL 
    599         DosError(FERR_DISABLEHARDERR); 
    600         if (DosQueryPathInfo(dllfile, FIL_STANDARD, &fs3, sizeof(fs3))) 
    601           strcpy(dllfile, "FM3RES"); 
     620        BldFullPathName(dllfile, env, "FM3RES");        // 23 Aug 07 SHL 
     621        DosError(FERR_DISABLEHARDERR); 
     622        if (DosQueryPathInfo(dllfile, FIL_STANDARD, &fs3, sizeof(fs3))) 
     623          strcpy(dllfile, "FM3RES"); 
    602624      } 
    603625    } 
     
    606628  if (rcl) { 
    607629    saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 
    608            HWND_DESKTOP, 
    609            GetPString(IDS_ERRORTEXT), GetPString(IDS_FM3RESERROR1TEXT)); 
     630           HWND_DESKTOP, 
     631           GetPString(IDS_ERRORTEXT), GetPString(IDS_FM3RESERROR1TEXT)); 
    610632    return FALSE; 
    611633  } 
     
    614636    if (rc) { 
    615637      Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 
    616                "DosExitList"); 
     638               "DosExitList"); 
    617639    } 
    618640    rcq = DosQueryProcAddr(FM3ModHandle, 1, "ResVersion", &pfnResVersion); 
     
    622644  if (RVMajor < VERMAJOR || (RVMajor == VERMAJOR && RVMinor < VERMINOR)) { 
    623645    saymsg(MB_ENTER, 
    624            HWND_DESKTOP, 
    625            GetPString(IDS_ERRORTEXT), 
    626            GetPString(IDS_FM3RESERROR2TEXT), 
    627            !rcq ? 
    628            GetPString(IDS_FM3RESERROR3TEXT) : 
    629            !rcl ? 
    630            GetPString(IDS_FM3RESERROR4TEXT) : 
    631            GetPString(IDS_FM3RESERROR5TEXT), RVMajor, RVMinor, rcl, rcq, ret); 
     646           HWND_DESKTOP, 
     647           GetPString(IDS_ERRORTEXT), 
     648           GetPString(IDS_FM3RESERROR2TEXT), 
     649           !rcq ? 
     650           GetPString(IDS_FM3RESERROR3TEXT) : 
     651           !rcl ? 
     652           GetPString(IDS_FM3RESERROR4TEXT) : 
     653           GetPString(IDS_FM3RESERROR5TEXT), RVMajor, RVMinor, rcl, rcq, ret); 
    632654    return FALSE; 
    633655  } 
     
    647669    DosSetMaxFH(100); 
    648670  else if (!strcmp(appname, "VDir") || 
    649            !strcmp(appname, "VTree") || 
    650            !strcmp(appname, "VCollect") || 
    651            !strcmp(appname, "SEEALL") || !strcmp(appname, "FM/4")) 
     671           !strcmp(appname, "VTree") || 
     672           !strcmp(appname, "VCollect") || 
     673           !strcmp(appname, "SEEALL") || !strcmp(appname, "FM/4")) 
    652674    DosSetMaxFH(60); 
    653675  else 
     
    655677 
    656678  if (DosQuerySysInfo(QSV_VERSION_MAJOR, 
    657                       QSV_VERSION_MINOR, 
    658                       OS2ver, 
    659                       sizeof(OS2ver))) { 
     679                      QSV_VERSION_MINOR, 
     680                      OS2ver, 
     681                      sizeof(OS2ver))) { 
    660682    OS2ver[0] = 2; 
    661683    OS2ver[1] = 1; 
     
    684706      num_matches = 1; 
    685707      if (!DosFindFirst(szTempName, 
    686                         &search_handle, 
    687                         FILE_NORMAL | FILE_DIRECTORY | 
    688                         FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN | 
    689                         FILE_ARCHIVED, 
    690                         &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) { 
     708                        &search_handle, 
     709                        FILE_NORMAL | FILE_DIRECTORY | 
     710                        FILE_SYSTEM | FILE_READONLY | FILE_HIDDEN | 
     711                        FILE_ARCHIVED, 
     712                        &ffb, sizeof(ffb), &num_matches, FIL_STANDARD)) { 
    691713        do { 
    692714          strcpy(enddir, ffb.achName); 
     
    704726        } 
    705727      while (!DosFindNext(search_handle, 
    706                           &ffb, sizeof(ffb), &num_matches)); 
     728                          &ffb, sizeof(ffb), &num_matches)); 
    707729      DosFindClose(search_handle); 
    708730    } 
     
    763785  if (_beginthread(HeapThread, NULL, 32768, NULL) == -1) { 
    764786    Runtime_Error(pszSrcFile, __LINE__, 
    765                   GetPString(IDS_COULDNTSTARTTHREADTEXT)); 
     787                  GetPString(IDS_COULDNTSTARTTHREADTEXT)); 
    766788    return FALSE; 
    767789  } 
     
    770792  if (!StartTimer()) { 
    771793    Runtime_Error(pszSrcFile, __LINE__, 
    772                   GetPString(IDS_COULDNTSTARTTHREADTEXT)); 
     794                  GetPString(IDS_COULDNTSTARTTHREADTEXT)); 
    773795    return FALSE; 
    774796  } 
     
    777799  env = getenv("WORKPLACE_PROCESS");