VirtualBox

Changeset 34708 in vbox for trunk


Ignore:
Timestamp:
Dec 3, 2010 5:30:45 PM (14 years ago)
Author:
vboxsync
Message:

IPRT/RTProc: Added RTPROC_FLAGS_HIDDEN for starting hidden processes.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/process.h

    r33806 r34708  
    186186 * be possible to wait for it, i.e. @a phProcess shall be NULL. */
    187187#define RTPROC_FLAGS_DETACHED               RT_BIT(0)
    188 
     188/** Don't show the started process according to the specific
     189 *  OS guidelines. */
     190#define RTPROC_FLAGS_HIDDEN                 RT_BIT(1)
    189191/** Use special code path for starting child processes from
    190192 * a service (daemon). On Windows this is required for services
  • trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp

    r33772 r34708  
    265265    AssertPtrReturn(pszExec, VERR_INVALID_POINTER);
    266266    AssertReturn(*pszExec, VERR_INVALID_PARAMETER);
    267     AssertReturn(!(fFlags & ~(RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_SERVICE)), VERR_INVALID_PARAMETER);
     267    AssertReturn(!(fFlags & ~(RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_HIDDEN | RTPROC_FLAGS_SERVICE)), VERR_INVALID_PARAMETER);
    268268    AssertReturn(!(fFlags & RTPROC_FLAGS_DETACHED) || !phProcess, VERR_INVALID_PARAMETER);
    269269    AssertReturn(hEnv != NIL_RTENV, VERR_INVALID_PARAMETER);
  • trunk/src/VBox/Runtime/r3/win/process-win.cpp

    r34251 r34708  
    949949    AssertPtrReturn(pszExec, VERR_INVALID_POINTER);
    950950    AssertReturn(*pszExec, VERR_INVALID_PARAMETER);
    951     AssertReturn(!(fFlags & ~(RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_SERVICE)), VERR_INVALID_PARAMETER);
     951    AssertReturn(!(fFlags & ~(RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_HIDDEN |RTPROC_FLAGS_SERVICE)), VERR_INVALID_PARAMETER);
    952952    AssertReturn(!(fFlags & RTPROC_FLAGS_DETACHED) || !phProcess, VERR_INVALID_PARAMETER);
    953953    AssertReturn(hEnv != NIL_RTENV, VERR_INVALID_PARAMETER);
     
    984984    StartupInfo.hStdError  = _get_osfhandle(2);
    985985#endif
     986    /* If we want to have a hidden process (e.g. not visible to
     987     * to the user) use the STARTUPINFO flags. */
     988    if (fFlags & RTPROC_FLAGS_HIDDEN)
     989    {
     990        StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
     991        StartupInfo.wShowWindow = SW_HIDE;
     992    }
     993
    986994    PCRTHANDLE  paHandles[3] = { phStdIn, phStdOut, phStdErr };
    987995    HANDLE     *aphStds[3]   = { &StartupInfo.hStdInput, &StartupInfo.hStdOutput, &StartupInfo.hStdError };
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette