Ignore:
Timestamp:
Dec 8, 2001, 11:14:27 PM (24 years ago)
Author:
umoeller
Message:

Misc changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/apps.c

    r113 r122  
    782782 *
    783783 *      -- starting ".CMD" and ".BAT" files as
    784  *         PROGDETAILS.pszExecutable.
     784 *         PROGDETAILS.pszExecutable;
     785 *
     786 *      -- starting apps which are not fully qualified
     787 *         and therefore assumed to be on the PATH.
    785788 *
    786789 *      Unless it is "*", PROGDETAILS.pszExecutable must
     
    814817 *      -- To start a session minimized, set SWP_MINIMIZE.
    815818 *
    816  *      -- To start a VIO session auto-close disabled, set
    817  *         the half-documented SWP_NOAUTOCLOSE flag (0x8000)
     819 *      -- To start a VIO session with auto-close disabled,
     820 *         set the half-documented SWP_NOAUTOCLOSE flag (0x8000)
    818821 *         This flag is now in the newer toolkit headers.
    819822 *
     
    843846 *          WinStartApp completely hangs the session manager
    844847 *          if a Win-OS/2 full-screen session is started from
    845  *          a thread that is NOT thread1, this will fail
    846  *          with an error for safety (V0.9.16).
     848 *          a thread that is NOT thread 1, this will now fail
     849 *          with this error for safety (V0.9.16).
    847850 *
    848851 *      --  ERROR_INVALID_PARAMETER: pcProgDetails or
     
    866869 *@@changed V0.9.16 (2001-10-19) [umoeller]: added prototype to return APIRET
    867870 *@@changed V0.9.16 (2001-10-19) [umoeller]: added thread-1 check
     871 *@@changed V0.9.16 (2001-12-06) [umoeller]: now using doshSearchPath for finding pszExecutable if not qualified
    868872 */
    869873
     
    886890    // all this only makes sense if this contains something...
    887891    // besides, this crashed on string comparisons V0.9.9 (2001-01-27) [umoeller]
    888     if (!ProgDetails.pszExecutable)
     892    if (    (!ProgDetails.pszExecutable)
     893         || (!(*(ProgDetails.pszExecutable)))
     894       )
    889895        arc = ERROR_INVALID_PARAMETER;
    890896    else if (doshMyTID() != 1)          // V0.9.16 (2001-10-19) [umoeller]
     
    893899    {
    894900        ULONG           ulIsWinApp;
     901
     902        CHAR            szFQExecutable[CCHMAXPATH];
    895903
    896904        XSTRING         strParamsPatched;
     
    10101018        else
    10111019        {
    1012             // now check if the executable is valid
    1013             // V0.9.16 (2001-10-19) [umoeller]
    1014             ULONG ulAttr;
    1015             _Pmpf(("  %d now, checking %s", arc, ProgDetails.pszExecutable));
    1016             if (!(arc = doshQueryPathAttr(ProgDetails.pszExecutable,
    1017                                           &ulAttr)))
    1018             {
    1019                 // make sure startup dir is really a directory
    1020                 if (ProgDetails.pszStartupDir)
     1020            // check if the executable is fully qualified; if so,
     1021            // check if the executable file exists
     1022            if (    (ProgDetails.pszExecutable[1] == ':')
     1023                 && (strchr(ProgDetails.pszExecutable, '\\'))
     1024               )
     1025            {
     1026                ULONG ulAttr;
     1027                if (!(arc = doshQueryPathAttr(ProgDetails.pszExecutable,
     1028                                              &ulAttr)))
    10211029                {
    1022                     _Pmpf(("  checking %s", ProgDetails.pszStartupDir));
    1023                     if (!(arc = doshQueryPathAttr(ProgDetails.pszStartupDir,
    1024                                                   &ulAttr)))
    1025                         if (!(ulAttr & FILE_DIRECTORY))
    1026                             arc = ERROR_PATH_NOT_FOUND;
    1027                                         // @@todo
     1030                    // make sure startup dir is really a directory
     1031                    if (ProgDetails.pszStartupDir)
     1032                    {
     1033                        if (!(arc = doshQueryPathAttr(ProgDetails.pszStartupDir,
     1034                                                      &ulAttr)))
     1035                            if (!(ulAttr & FILE_DIRECTORY))
     1036                                arc = ERROR_PATH_NOT_FOUND;
     1037                    }
    10281038                }
    10291039            }
    1030 
    1031             _Pmpf(("  after checking %d", arc));
     1040            else
     1041            {
     1042                // _not_ fully qualified: look it up on the PATH then
     1043                // V0.9.16 (2001-12-06) [umoeller]
     1044                if (!(arc = doshSearchPath("PATH",
     1045                                           ProgDetails.pszExecutable,
     1046                                           szFQExecutable,
     1047                                           sizeof(szFQExecutable))))
     1048                    // alright, found it:
     1049                    ProgDetails.pszExecutable = szFQExecutable;
     1050            }
    10321051
    10331052            if (!arc)
Note: See TracChangeset for help on using the changeset viewer.