Changeset 1398 for trunk/dll/systemf.c


Ignore:
Timestamp:
Feb 21, 2009, 6:43:00 PM (16 years ago)
Author:
Gregg Young
Message:

Move embeded strings to PCSZ variables or string table; Eliminate Error2 functions Runtime_Error with NULL format string returns "No data" error. Change declares from PSZ to PCSZ in functions where the variable isn't changed. Added btm as an executable file type in several additional places. Use fProtectOnly to prevent attempt to execute Dos and Win programs on "Protect only" installs in several additional places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r1394 r1398  
    110110
    111111  if (!command || !*command) {
    112     Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
     112    Runtime_Error(pszSrcFile, __LINE__, NULL);
    113113    return -1;
    114114  }
     
    739739    strcpy(pszPgm, p);
    740740    if (!*pszPgm) {
    741       Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
     741      Runtime_Error(pszSrcFile, __LINE__, NULL);
    742742      return -1;
    743743    }
     
    929929        char temp[CCHMAXPATH + 1];
    930930
    931         if (!stricmp(p, ".BAT")) {
    932           strcpy(temp, pszPgm);
    933           strcpy(pszPgm, pszArgs);
    934           strcpy(pszArgs, "/C ");
    935           strcat(pszArgs, temp);
    936           strcat(pszArgs, " ");
    937           strcat(pszArgs, pszPgm);
    938           strcpy(pszPgm, GetCmdSpec(TRUE));             // DOS
    939         }
    940         else if (!stricmp(p, ".CMD") || !stricmp(p, ".BTM")) {
     931        if (!stricmp(p, PCSZ_DOTBAT)) {
     932          if (!fProtectOnly) {
     933            strcpy(temp, pszPgm);
     934            strcpy(pszPgm, pszArgs);
     935            strcpy(pszArgs, "/C ");
     936            strcat(pszArgs, temp);
     937            strcat(pszArgs, " ");
     938            strcat(pszArgs, pszPgm);
     939            strcpy(pszPgm, GetCmdSpec(TRUE));             // DOS
     940          }
     941          else
     942            saymsg(MB_OK,
     943                   HWND_DESKTOP,
     944                   NullStr,
     945                   GetPString(IDS_NOTPROTECTONLYEXE),
     946                   pszPgm);
     947        }
     948        else if (!stricmp(p, PCSZ_DOTCMD) || !stricmp(p, PCSZ_DOTBTM)) {
    941949          // Assume 4OS2 is BTM
    942950          strcpy(temp, pszPgm);
     
    12861294          strcpy(parameters, p);
    12871295
    1288         if (p && (!stricmp(p, ".BAT") || !stricmp(p, ".CMD"))) {
     1296        if (p && (!stricmp(p, PCSZ_DOTBAT) || !stricmp(p, PCSZ_DOTCMD) ||
     1297                  !stricmp(p, PCSZ_DOTBTM))) {
    12891298          char *temp;
    12901299
    12911300          temp = xmalloc(CCHMAXPATH * 2,pszSrcFile,__LINE__);
    12921301          if (temp) {
    1293             if (!stricmp(p, ".BAT")) {
    1294               strcpy(temp, executable);
    1295               strcpy(executable, parameters);
    1296               strcpy(parameters, "/C ");
    1297               strcat(parameters, temp);
    1298               strcat(parameters, " ");
    1299               strcat(parameters, executable);
    1300               strcpy(executable, GetCmdSpec(TRUE));
    1301             }
    1302             else if (!stricmp(p, ".CMD")) {
     1302            if (!stricmp(p, PCSZ_DOTBAT)) {
     1303              if (!fProtectOnly) {
     1304                strcpy(temp, executable);
     1305                strcpy(executable, parameters);
     1306                strcpy(parameters, "/C ");
     1307                strcat(parameters, temp);
     1308                strcat(parameters, " ");
     1309                strcat(parameters, executable);
     1310                strcpy(executable, GetCmdSpec(TRUE));
     1311              }
     1312              else
     1313                saymsg(MB_OK,
     1314                       HWND_DESKTOP,
     1315                       NullStr,
     1316                       GetPString(IDS_NOTPROTECTONLYEXE),
     1317                       filename);
     1318            }
     1319            else if (!stricmp(p, PCSZ_DOTCMD) || !stricmp(p, PCSZ_DOTBTM)) {
    13031320              strcpy(temp, executable);
    13041321              strcpy(executable, parameters);
Note: See TracChangeset for help on using the changeset viewer.