Changeset 14984


Ignore:
Timestamp:
Oct 3, 2000, 10:17:20 PM (25 years ago)
Author:
sandervl
Message:

CreateProcessA fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/kernel32/wprocess.cpp

    r14974 r14984  
    1 /* $Id: wprocess.cpp,v 1.99 2000-10-03 17:28:32 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.100 2000-10-03 20:17:20 sandervl Exp $ */
    22
    33/*
     
    15551555        if(lpCommandLine) {
    15561556            //skip exe name in lpCommandLine
     1557            //TODO: doesn't work for directories with spaces!
    15571558            while(*lpCommandLine != 0 && *lpCommandLine != ' ')
    15581559                lpCommandLine++;
     
    15731574        sprintf(cmdline, "PE.EXE %s", lpCommandLine);
    15741575    }
     1576    char szAppName[255];
     1577    char *exename = szAppName;
     1578    strncpy(szAppName, &cmdline[7], sizeof(szAppName)); //skip pe.exe
     1579    szAppName[254] = 0;
     1580    if(*exename == '"') {
     1581         exename++;
     1582    }
     1583
     1584    //TODO: doesn't work for directories with spaces!
     1585    while(*exename != 0 && *exename != ' ' && *exename != '"')
     1586         exename++;
     1587
     1588    if(*exename != 0) {
     1589         *exename = 0;
     1590    }
     1591    if(szAppName[0] == '"') {
     1592         exename = &szAppName[1];
     1593    }
     1594    else exename = szAppName;
     1595
     1596    if(GetFileAttributesA(exename) == -1) {
     1597        dprintf(("CreateProcess: can't find executable!"));
     1598        SetLastError(ERROR_FILE_NOT_FOUND);
     1599        return FALSE;
     1600    }   
    15751601    dprintf(("KERNEL32:  CreateProcess %s\n", cmdline));
    15761602    rc = O32_CreateProcess("PE.EXE", (LPCSTR)cmdline,lpProcessAttributes,
Note: See TracChangeset for help on using the changeset viewer.