Ignore:
Timestamp:
Jan 10, 2003, 4:19:54 PM (23 years ago)
Author:
sandervl
Message:

changes for inheritance (check security structure); workaround for PeekNamedPipe with unnamed pipes; support input/output redirection for child processes

File:
1 edited

Legend:

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

    r9634 r9660  
    1 /* $Id: wprocess.cpp,v 1.170 2003-01-06 14:43:51 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.171 2003-01-10 15:19:54 sandervl Exp $ */
    22
    33/*
     
    18081808                            LPPROCESS_INFORMATION lpProcessInfo )
    18091809{
     1810 STARTUPINFOA startinfo;
    18101811 TEB *pThreadDB = (TEB*)GetThreadTEB();
    18111812 char *cmdline = NULL;
     
    18181819#ifdef DEBUG
    18191820    if(lpStartupInfo) {
    1820     dprintf(("lpStartupInfo->lpReserved %x", lpStartupInfo->lpReserved));
    1821     dprintf(("lpStartupInfo->lpDesktop %x", lpStartupInfo->lpDesktop));
    1822     dprintf(("lpStartupInfo->lpTitle %s", lpStartupInfo->lpTitle));
    1823     dprintf(("lpStartupInfo->dwX %x", lpStartupInfo->dwX));
    1824     dprintf(("lpStartupInfo->dwY %x", lpStartupInfo->dwY));
    1825     dprintf(("lpStartupInfo->dwXSize %x", lpStartupInfo->dwXSize));
    1826     dprintf(("lpStartupInfo->dwYSize %x", lpStartupInfo->dwYSize));
    1827     dprintf(("lpStartupInfo->dwXCountChars %x", lpStartupInfo->dwXCountChars));
    1828     dprintf(("lpStartupInfo->dwYCountChars %x", lpStartupInfo->dwYCountChars));
    1829     dprintf(("lpStartupInfo->dwFillAttribute %x", lpStartupInfo->dwFillAttribute));
    1830     dprintf(("lpStartupInfo->dwFlags %x", lpStartupInfo->dwFlags));
    1831     dprintf(("lpStartupInfo->wShowWindow %x", lpStartupInfo->wShowWindow));
    1832     dprintf(("lpStartupInfo->hStdInput %x", lpStartupInfo->hStdInput));
    1833     dprintf(("lpStartupInfo->hStdOutput %x", lpStartupInfo->hStdOutput));
    1834     dprintf(("lpStartupInfo->hStdError %x", lpStartupInfo->hStdError));
     1821        dprintf(("lpStartupInfo->lpReserved %x", lpStartupInfo->lpReserved));
     1822        dprintf(("lpStartupInfo->lpDesktop %x", lpStartupInfo->lpDesktop));
     1823        dprintf(("lpStartupInfo->lpTitle %s", lpStartupInfo->lpTitle));
     1824        dprintf(("lpStartupInfo->dwX %x", lpStartupInfo->dwX));
     1825        dprintf(("lpStartupInfo->dwY %x", lpStartupInfo->dwY));
     1826        dprintf(("lpStartupInfo->dwXSize %x", lpStartupInfo->dwXSize));
     1827        dprintf(("lpStartupInfo->dwYSize %x", lpStartupInfo->dwYSize));
     1828        dprintf(("lpStartupInfo->dwXCountChars %x", lpStartupInfo->dwXCountChars));
     1829        dprintf(("lpStartupInfo->dwYCountChars %x", lpStartupInfo->dwYCountChars));
     1830        dprintf(("lpStartupInfo->dwFillAttribute %x", lpStartupInfo->dwFillAttribute));
     1831        dprintf(("lpStartupInfo->dwFlags %x", lpStartupInfo->dwFlags));
     1832        dprintf(("lpStartupInfo->wShowWindow %x", lpStartupInfo->wShowWindow));
     1833        dprintf(("lpStartupInfo->hStdInput %x", lpStartupInfo->hStdInput));
     1834        dprintf(("lpStartupInfo->hStdOutput %x", lpStartupInfo->hStdOutput));
     1835        dprintf(("lpStartupInfo->hStdError %x", lpStartupInfo->hStdError));
    18351836    }
    18361837#endif
     1838
     1839    if(bInheritHandles && lpStartupInfo->dwFlags & STARTF_USESTDHANDLES)
     1840    {
     1841        //Translate standard handles if the child needs to inherit them
     1842        int retcode = 0;
     1843
     1844        memcpy(&startinfo, lpStartupInfo, sizeof(startinfo));
     1845        retcode |= HMHandleTranslateToOS2(lpStartupInfo->hStdInput, &startinfo.hStdInput);
     1846        retcode |= HMHandleTranslateToOS2(lpStartupInfo->hStdOutput, &startinfo.hStdOutput);
     1847        retcode |= HMHandleTranslateToOS2(lpStartupInfo->hStdError, &startinfo.hStdError);
     1848
     1849        if(retcode) { 
     1850            SetLastError(ERROR_INVALID_HANDLE);
     1851            return FALSE;
     1852        }
     1853
     1854        lpStartupInfo = &startinfo;
     1855    }
    18371856
    18381857    // open32 does not support DEBUG_ONLY_THIS_PROCESS
Note: See TracChangeset for help on using the changeset viewer.