VirtualBox

Changeset 99150 in vbox for trunk


Ignore:
Timestamp:
Mar 23, 2023 6:00:47 PM (19 months ago)
Author:
vboxsync
Message:

Guest Control: Changed the parameter position of the CWD parameter, so that the image name and arguments are together again (feels more natural, was part of the initial patch). bugref:8053

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp

    r99120 r99150  
    13641364            ComPtr<IGuestProcess> pProcess;
    13651365            CHECK_ERROR_BREAK(pCtx->pGuestSession, ProcessCreate(Bstr(pszImage).raw(),
     1366                                                                 ComSafeArrayAsInParam(aArgs),
    13661367                                                                 Bstr(pszCwd).raw(),
    1367                                                                  ComSafeArrayAsInParam(aArgs),
    13681368                                                                 ComSafeArrayAsInParam(aEnv),
    13691369                                                                 ComSafeArrayAsInParam(aCreateFlags),
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlInterface.cpp

    r99121 r99150  
    558558    createFlags.push_back(KProcessCreateFlag_WaitForProcessStartOnly);
    559559    CGuestProcess process = guestSession.ProcessCreate(commandData.m_strExePath,
    560                                                        NULL /* CWD */,
    561560                                                       commandData.m_arguments,
     561                                                       "", /* Working directory. */
    562562                                                       commandData.m_environmentChanges,
    563563                                                       createFlags,
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r99120 r99150  
    1481414814  <interface
    1481514815    name="IGuestSession" extends="$unknown"
    14816     uuid="5591bead-9c1d-4cbd-9669-2d0b04fac0a8"
     14816    uuid="5e54f60b-6dcd-4594-a6c9-cf968f004341"
    1481714817    wsmap="managed"
    1481814818    reservedMethods="8" reservedAttributes="12"
     
    1596615966        </desc>
    1596715967      </param>
    15968       <param name="cwd" type="wstring" dir="in">
    15969         <desc>
    15970           Path to the directory in which to execute in the guest.  The
    15971           directory has to exist in the guest VM with search rights to the
    15972           session user in order to succeed.  If empty/null, the session
    15973           user's default (typically 'home') directory is used.  If not a
    15974           full path, it is interpreted relative to the default directory;
    15975           e.g. 'work' means '$HOME/work' (according to the guest's '$HOME'-
    15976           like concept).
    15977         </desc>
    15978       </param>
    1597915968      <param name="arguments" type="wstring" dir="in" safearray="yes">
    1598015969        <desc>Array of arguments passed to the new process.
     
    1598815977        </desc>
    1598915978      </param>
    15990       <param name="environmentChanges" type="wstring" dir="in" safearray="yes">
    15991         <desc>
    15992           Set of environment changes to complement
    15993           <link to="IGuestSession::environmentChanges"/>.  Takes precedence
    15994           over the session ones.  The changes are in putenv format, i.e.
    15995           "VAR=VALUE" for setting and "VAR" for unsetting.
    15996 
    15997           The changes are applied to the base environment of the impersonated
    15998           guest user (<link to="IGuestSession::environmentBase"/>) when
    15999           creating the process.  (This is done on the guest side of things in
    16000           order to be compatible with older Guest Additions.  That is one of
    16001           the motivations for not passing in the whole environment here.)
    16002         </desc>
    16003       </param>
    16004       <param name="flags" type="ProcessCreateFlag" dir="in" safearray="yes">
    16005         <desc>
    16006           Process creation flags;
    16007           see <link to="ProcessCreateFlag"/> for more information.
    16008         </desc>
    16009       </param>
    16010       <param name="timeoutMS" type="unsigned long" dir="in">
    16011         <desc>
    16012           Timeout (in ms) for limiting the guest process' running time.
    16013           Pass 0 for an infinite timeout. On timeout the guest process will be
    16014           killed and its status will be put to an appropriate value. See
    16015           <link to="ProcessStatus"/> for more information.
    16016         </desc>
    16017       </param>
    16018       <param name="guestProcess" type="IGuestProcess" dir="return">
    16019         <desc>Guest process object of the newly created process.</desc>
    16020       </param>
    16021     </method>
    16022 
    16023     <method name="processCreateEx">
    16024       <desc>
    16025         Creates a new process running in the guest with the extended options
    16026         for setting the process priority and affinity.
    16027 
    16028         See <link to="IGuestSession::processCreate"/> for more information.
    16029       </desc>
    1603015979      <param name="cwd" type="wstring" dir="in">
    1603115980        <desc>
     
    1603915988        </desc>
    1604015989      </param>
     15990      <param name="environmentChanges" type="wstring" dir="in" safearray="yes">
     15991        <desc>
     15992          Set of environment changes to complement
     15993          <link to="IGuestSession::environmentChanges"/>.  Takes precedence
     15994          over the session ones.  The changes are in putenv format, i.e.
     15995          "VAR=VALUE" for setting and "VAR" for unsetting.
     15996
     15997          The changes are applied to the base environment of the impersonated
     15998          guest user (<link to="IGuestSession::environmentBase"/>) when
     15999          creating the process.  (This is done on the guest side of things in
     16000          order to be compatible with older Guest Additions.  That is one of
     16001          the motivations for not passing in the whole environment here.)
     16002        </desc>
     16003      </param>
     16004      <param name="flags" type="ProcessCreateFlag" dir="in" safearray="yes">
     16005        <desc>
     16006          Process creation flags;
     16007          see <link to="ProcessCreateFlag"/> for more information.
     16008        </desc>
     16009      </param>
     16010      <param name="timeoutMS" type="unsigned long" dir="in">
     16011        <desc>
     16012          Timeout (in ms) for limiting the guest process' running time.
     16013          Pass 0 for an infinite timeout. On timeout the guest process will be
     16014          killed and its status will be put to an appropriate value. See
     16015          <link to="ProcessStatus"/> for more information.
     16016        </desc>
     16017      </param>
     16018      <param name="guestProcess" type="IGuestProcess" dir="return">
     16019        <desc>Guest process object of the newly created process.</desc>
     16020      </param>
     16021    </method>
     16022
     16023    <method name="processCreateEx">
     16024      <desc>
     16025        Creates a new process running in the guest with the extended options
     16026        for setting the process priority and affinity.
     16027
     16028        See <link to="IGuestSession::processCreate"/> for more information.
     16029      </desc>
    1604116030      <param name="executable" type="wstring" dir="in">
    1604216031        <desc>
     
    1605616045            <link to="IGuestSession::protocolVersion"/> is 3 or higher.
    1605716046          </note>
     16047        </desc>
     16048      </param>
     16049      <param name="cwd" type="wstring" dir="in">
     16050        <desc>
     16051          Path to the directory in which to execute in the guest.  The
     16052          directory has to exist in the guest VM with search rights to the
     16053          session user in order to succeed.  If empty/null, the session
     16054          user's default (typically 'home') directory is used.  If not a
     16055          full path, it is interpreted relative to the default directory;
     16056          e.g. 'work' means '$HOME/work' (according to the guest's '$HOME'-
     16057          like concept).
    1605816058        </desc>
    1605916059      </param>
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r99120 r99150  
    212212                        ULONG aMode);
    213213    HRESULT processCreate(const com::Utf8Str &aCommand,
     214                          const std::vector<com::Utf8Str> &aArguments,
    214215                          const com::Utf8Str &aCwd,
    215                           const std::vector<com::Utf8Str> &aArguments,
    216216                          const std::vector<com::Utf8Str> &aEnvironment,
    217217                          const std::vector<ProcessCreateFlag_T> &aFlags,
     
    219219                          ComPtr<IGuestProcess> &aGuestProcess);
    220220    HRESULT processCreateEx(const com::Utf8Str &aCommand,
     221                            const std::vector<com::Utf8Str> &aArguments,
    221222                            const com::Utf8Str &aCwd,
    222                             const std::vector<com::Utf8Str> &aArguments,
    223223                            const std::vector<com::Utf8Str> &aEnvironment,
    224224                            const std::vector<ProcessCreateFlag_T> &aFlags,
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r99122 r99150  
    49434943
    49444944
    4945 HRESULT GuestSession::processCreate(const com::Utf8Str &aExecutable, const com::Utf8Str &aCwd,
    4946                                     const std::vector<com::Utf8Str> &aArguments,
     4945HRESULT GuestSession::processCreate(const com::Utf8Str &aExecutable, const std::vector<com::Utf8Str> &aArguments,
     4946                                    const com::Utf8Str &aCwd,
    49474947                                    const std::vector<com::Utf8Str> &aEnvironment,
    49484948                                    const std::vector<ProcessCreateFlag_T> &aFlags,
     
    49524952
    49534953    std::vector<LONG> affinityIgnored;
    4954     return processCreateEx(aExecutable, aCwd, aArguments, aEnvironment, aFlags, aTimeoutMS,
     4954    return processCreateEx(aExecutable, aArguments, aCwd, aEnvironment, aFlags, aTimeoutMS,
    49554955                           ProcessPriority_Default, affinityIgnored, aGuestProcess);
    49564956}
    49574957
    4958 HRESULT GuestSession::processCreateEx(const com::Utf8Str &aExecutable, const com::Utf8Str &aCwd,
    4959                                       const std::vector<com::Utf8Str> &aArguments,
     4958HRESULT GuestSession::processCreateEx(const com::Utf8Str &aExecutable, const std::vector<com::Utf8Str> &aArguments,
     4959                                      const com::Utf8Str &aCwd,
    49604960                                      const std::vector<com::Utf8Str> &aEnvironment,
    49614961                                      const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS,
  • trunk/src/VBox/ValidationKit/tests/additions/tdAddGuestCtrl.py

    r99129 r99150  
    23202320        try:
    23212321            if self.oTstDrv.fpApiVer >= 7.1:
    2322                 oProcess = oGuestSession.processCreate(oTest.sCmd, oTest.sCwd,
     2322                oProcess = oGuestSession.processCreate(oTest.sCmd,
    23232323                                                       oTest.asArgs if self.oTstDrv.fpApiVer >= 5.0 else oTest.asArgs[1:],
     2324                                                       oTest.sCwd,
    23242325                                                       oTest.aEnv, oTest.afFlags, oTest.timeoutMS);
    23252326            else:
     
    28882889                reporter.log2('Starting stale process #%d...' % (i));
    28892890                if self.oTstDrv.fpApiVer >= 7.1:
    2890                     oGuestSession.processCreate(sShell, "",
     2891                    oGuestSession.processCreate(sShell,
    28912892                                                asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], [],
     2893                                                "", # Working directory.
    28922894                                                [ vboxcon.ProcessCreateFlag_WaitForStdOut ], 30 * 1000);
    28932895                else:
     
    29272929                    reporter.log2('Starting non-stale process #%d...' % (i));
    29282930                    if self.oTstDrv.fpApiVer >= 7.1:
    2929                         oCurProc = oGuestSession.processCreate(sShell, "", asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
     2931                        oCurProc = oGuestSession.processCreate(sShell, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
     2932                                                               "",         # Working directory.
    29302933                                                               [], [], 0); # Infinite timeout.
    29312934                    else:
     
    29842987                    reporter.log2('Starting blocking process #%d...' % (i));
    29852988                    if self.oTstDrv.fpApiVer >= 7.1:
    2986                         oCurProc = oGuestSession.processCreate(sCmd, "", asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
     2989                        oCurProc = oGuestSession.processCreate(sCmd, asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:],
     2990                                                               "", # Working directory.
    29872991                                                               [],  [], 30 * 1000);
    29882992                    else:
     
    34193423        try:
    34203424            if self.oTstDrv.fpApiVer >= 7.1:
    3421                 oGuestProcess = oGuestSession.processCreate(sImage, "",
     3425                oGuestProcess = oGuestSession.processCreate(sImage,
    34223426                                                            asArgs if self.oTstDrv.fpApiVer >= 5.0 else asArgs[1:], aEnv, afFlags,
     3427                                                            "", # Working directory.
    34233428                                                            30 * 1000);
    34243429            else:
     
    35403545        try:
    35413546            if self.oTstDrv.fpApiVer >= 7.1:
    3542                 oCurProcess = oGuestSession.processCreate(sShell, "", [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
     3547                oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
     3548                                                          "", # Working directory.
    35433549                                                          [], [], 30 * 1000);
    35443550            else:
     
    35823588            try:
    35833589                if self.oTstDrv.fpApiVer >= 7.1:
    3584                     oCurProcess = oGuestSession.processCreate(sShell, "", [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
    3585                                                           [], [], 3 * 1000);
     3590                    oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
     3591                                                              "", # Working directory.
     3592                                                              [], [], 3 * 1000);
    35863593                else:
    35873594                    oCurProcess = oGuestSession.processCreate(sShell, [sShell,] if self.oTstDrv.fpApiVer >= 5.0 else [],
     
    55775584
    55785585        for _ in xrange(100):
    5579             oProc = oGuestSession.processCreate(sCmd, "", asArgs if self.fpApiVer >= 5.0 else asArgs[1:],
     5586            oProc = oGuestSession.processCreate(sCmd, asArgs if self.fpApiVer >= 5.0 else asArgs[1:],
     5587                                                "", # Working directory.
    55805588                                                aEnv, afFlags, 30 * 1000);
    55815589
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