Changeset 1492 for trunk/dll/systemf.c


Ignore:
Timestamp:
Dec 28, 2009, 3:22:35 AM (16 years ago)
Author:
Gregg Young
Message:

Provide readable error message when DosQueryAppType fails because it can't find and exe. Ticket 403

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r1488 r1492  
    2828  12 Jul 09 GKY Allow FM/2 to load in high memory
    2929  21 Dec 09 GKY Added CheckExecutibleFlags to streamline code in command.c assoc.c & cmdline.c
     30  27 Dec 09 GKY Provide human readable error message when DosQueryAppType fails because it
     31                couldn't find the exe (such as missing archivers).
    3032
    3133***********************************************************************/
     
    876878            *pszDirectory)
    877879          switch_to(szSavedir);
    878         if (rc) {
    879           Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,
    880                     GetPString(IDS_DOSQAPPTYPEFAILEDTEXT),
    881                     pszPgm, pszCallingFile, uiLineNumber);      // 26 May 08 SHL
     880        if (rc) {
     881          if (rc == ERROR_FILE_NOT_FOUND || rc == ERROR_PATH_NOT_FOUND ||
     882              rc == ERROR_INVALID_EXE_SIGNATURE || rc == ERROR_EXE_MARKED_INVALID)
     883            saymsg(MB_OK, HWND_DESKTOP, NullStr,
     884                   GetPString(IDS_DOSQAPPTYPEFAILEDTEXT2), pszPgm);
     885          else if (rc == ERROR_INVALID_DRIVE || rc == ERROR_DRIVE_LOCKED)
     886            saymsg(MB_OK, HWND_DESKTOP, NullStr,
     887                   GetPString(IDS_DOSQAPPTYPEFAILEDTEXT3), pszPgm);
     888          else
     889            Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,
     890                      GetPString(IDS_DOSQAPPTYPEFAILEDTEXT),
     891                      pszPgm, pszCallingFile, uiLineNumber);      // 26 May 08 SHL
    882892          DosFreeMem(pszPgm);
    883893          if (pszArgs)
     
    10201030          pszDirectory &&
    10211031          *pszDirectory)
    1022         switch_to(szSavedir);
     1032        switch_to(szSavedir);
    10231033      if (rc) {
    1024         Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,
    1025                   GetPString(IDS_DOSQAPPTYPEFAILEDTEXT),
    1026                   pszPgm, pszCallingFile, uiLineNumber);        // 26 May 08 SHL
     1034        if (rc == ERROR_FILE_NOT_FOUND || rc == ERROR_PATH_NOT_FOUND ||
     1035            rc == ERROR_INVALID_EXE_SIGNATURE || rc == ERROR_EXE_MARKED_INVALID)
     1036          saymsg(MB_OK, HWND_DESKTOP, NullStr,
     1037                 GetPString(IDS_DOSQAPPTYPEFAILEDTEXT2), pszPgm);
     1038        else if (rc == ERROR_INVALID_DRIVE || rc == ERROR_DRIVE_LOCKED)
     1039          saymsg(MB_OK, HWND_DESKTOP, NullStr,
     1040                 GetPString(IDS_DOSQAPPTYPEFAILEDTEXT3), pszPgm);
     1041        else
     1042          Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,
     1043                    GetPString(IDS_DOSQAPPTYPEFAILEDTEXT),
     1044                    pszPgm, pszCallingFile, uiLineNumber);        // 26 May 08 SHL
    10271045        DosFreeMem(pszPgm);
    10281046        if (pszArgs)
Note: See TracChangeset for help on using the changeset viewer.