VirtualBox

Changeset 34709 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Dec 3, 2010 5:38:01 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
68511
Message:

Guest execution: Implemented ability to start guest processes hidden.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp

    r34255 r34709  
    12101210        if (RT_SUCCESS(rc))
    12111211        {
    1212             /* If no user name specified run with current credentials.
    1213              * This is prohibited via official Main API! */
    1214             if (!strlen(pszAsUser))
    1215                 fFlags &= ~RTPROC_FLAGS_SERVICE;
     1212            uint32_t uProcFlags = 0;
     1213            if (fFlags)
     1214            {
     1215                /* Process Main flag "ExecuteProcessFlag_Hidden". */
     1216                if (fFlags & RT_BIT(2))
     1217                    uProcFlags = RTPROC_FLAGS_HIDDEN;
     1218            }
     1219
     1220            /* If no user name specified run with current credentials (e.g.
     1221             * full service/system rights). This is prohibited via official Main API!
     1222             *
     1223             * Otherwise use the RTPROC_FLAGS_SERVICE to use some special authentication
     1224             * code (at least on Windows) for running processes as different users
     1225             * started from our system service. */
     1226            if (strlen(pszAsUser))
     1227                uProcFlags |= RTPROC_FLAGS_SERVICE;
    12161228
    12171229            /* Do normal execution. */
    1218             rc = RTProcCreateEx(szExecExp, papszArgsExp, hEnv, fFlags,
     1230            rc = RTProcCreateEx(szExecExp, papszArgsExp, hEnv, uProcFlags,
    12191231                                phStdIn, phStdOut, phStdErr,
    12201232                                strlen(pszAsUser) ? pszAsUser : NULL,
     
    13081320                            {
    13091321                                RTPROCESS hProcess;
    1310                                 rc = VBoxServiceControlExecCreateProcess(pData->pszCmd, pData->papszArgs, hEnv, RTPROC_FLAGS_SERVICE,
     1322                                rc = VBoxServiceControlExecCreateProcess(pData->pszCmd, pData->papszArgs, hEnv, pData->uFlags,
    13111323                                                                         phStdIn, phStdOut, phStdErr,
    13121324                                                                         pData->pszUser, pData->pszPassword,
Note: See TracChangeset for help on using the changeset viewer.

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