VirtualBox

Changeset 42105 in vbox


Ignore:
Timestamp:
Jul 11, 2012 11:53:22 AM (12 years ago)
Author:
vboxsync
Message:

Guest Control 2.0: Update.

Location:
trunk/src/VBox/Main
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r42096 r42105  
    97449744  <interface
    97459745    name="IProcess" extends="$unknown"
    9746     uuid="031c6ba4-9005-486d-8333-b27bb009bba9"
     9746    uuid="8a308a2f-bea6-4786-80a0-4d07cd4bacaa"
    97479747    wsmap="managed"
    97489748    >
     
    98519851        <desc>TODO</desc>
    98529852      </param>
    9853       <param name="size" type="unsigned long" dir="in">
     9853      <param name="data" type="octet" dir="in" safearray="yes">
    98549854        <desc>TODO</desc>
    98559855      </param>
     
    98579857        <desc>TODO</desc>
    98589858      </param>
    9859       <param name="written" type="unsigned long" dir="out">
    9860         <desc>TODO</desc>
    9861       </param>
    9862       <param name="data" type="octet" dir="return" safearray="yes">
     9859      <param name="written" type="unsigned long" dir="return">
    98639860        <desc>TODO</desc>
    98649861      </param>
     
    1028610283  <interface
    1028710284    name="IGuest" extends="$unknown"
    10288     uuid="a115744a-0e0b-4193-b40c-40e0d66d0f8d"
     10285    uuid="1413d910-e533-47af-a71b-919c106d2472"
    1028910286    wsmap="managed"
    1029010287    >
     
    1067410671    </method>
    1067510672
    10676     <method name="openSession">
     10673    <method name="createSession">
    1067710674      <desc>
    1067810675        TODO
  • trunk/src/VBox/Main/include/GuestImpl.h

    r42084 r42105  
    133133                                     ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
    134134    STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ULONG aFlags, IProgress **aProgress);
    135     STDMETHOD(OpenSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
     135    STDMETHOD(CreateSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
    136136
    137137    // Public methods that are not in IDL (only called internally).
     
    202202    void enableVMMStatistics(BOOL aEnable) { mCollectVMMStats = aEnable; };
    203203
     204public:
     205    /** @name Public internal methods.
     206     * @{ */
     207    int sessionClose(ComObjPtr<GuestSession> pSession);
     208    /** @}  */
     209
    204210private:
    205211
     
    353359
    354360#endif // ____H_GUESTIMPL
    355 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
     361
  • trunk/src/VBox/Main/include/GuestProcessImpl.h

    r42095 r42105  
    2222#include "VirtualBoxBase.h"
    2323
     24class GuestSession;
     25
    2426/**
    2527 * TODO
     
    4042    END_COM_MAP()
    4143    DECLARE_EMPTY_CTOR_DTOR(GuestProcess)
    42     HRESULT init(void);
     44
     45    int     init(GuestSession *pSession,
     46                 const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
     47                 ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
     48                 ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity));
    4349    void    uninit(void);
    4450    HRESULT FinalConstruct(void);
     
    5258    STDMETHOD(COMGETTER(ExecutablePath))(BSTR *aExecutablePath);
    5359    STDMETHOD(COMGETTER(ExitCode))(LONG *aExitCode);
    54     STDMETHOD(COMGETTER(PID))(ULONG *aPID);
     60    STDMETHOD(COMGETTER(Pid))(ULONG *aPID);
    5561    STDMETHOD(COMGETTER(Status))(ProcessStatus_T *aStatus);
    5662
    5763    STDMETHOD(Read)(ULONG aHandle, ULONG aSize, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
    5864    STDMETHOD(Terminate)(void);
    59     STDMETHOD(WaitFor)(ComSafeArrayOut(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason);
     65    STDMETHOD(WaitFor)(ComSafeArrayIn(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason);
    6066    STDMETHOD(Write)(ULONG aHandle, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten);
    6167    /** @}  */
     
    7278    struct Data
    7379    {
     80        GuestSession        *mParent;
    7481        Bstr                 mName;
    7582    } mData;
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r42094 r42105  
    2727#include "GuestFsObjInfoImpl.h"
    2828
     29class Guest;
     30
    2931/**
    3032 * TODO
     
    4547    DECLARE_EMPTY_CTOR_DTOR(GuestSession)
    4648
    47     HRESULT init(const ComPtr<IGuest> pGuest, Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName);
     49    int     init(Guest *aGuest, Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName);
    4850    void    uninit(void);
    4951    HRESULT FinalConstruct(void);
     
    9193    STDMETHOD(FileSetACL)(IN_BSTR aPath, IN_BSTR aACL);
    9294    STDMETHOD(ProcessCreate)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    93                              ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **IGuestProcess);
     95                             ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess);
    9496    STDMETHOD(ProcessCreateEx)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    9597                               ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
    9698                               ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
    97                                IGuestProcess **IGuestProcess);
    98     STDMETHOD(ProcessGet)(ULONG aPID, IGuestProcess **IGuestProcess);
     99                               IGuestProcess **aProcess);
     100    STDMETHOD(ProcessGet)(ULONG aPID, IGuestProcess **aProcess);
    99101    STDMETHOD(SetTimeout)(ULONG aTimeoutMS);
    100102    STDMETHOD(SymlinkCreate)(IN_BSTR aSource, IN_BSTR aTarget, SymlinkType_T aType);
     
    108110    /** @name Public internal methods.
    109111     * @{ */
     112    int directoryClose(ComObjPtr<GuestDirectory> pDirectory);
     113    int fileClose(ComObjPtr<GuestFile> pFile);
     114    int processClose(ComObjPtr<GuestProcess> pProcess);
     115    int processCreateExInteral(const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
     116                               ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
     117                               ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
     118                               IGuestProcess **aProcess);
    110119    /** @}  */
    111120
     
    113122
    114123    typedef std::map <Utf8Str, Utf8Str> SessionEnvironment;
    115     typedef std::list <ComObjPtr<GuestProcess> > SessionProcesses;
     124
    116125    typedef std::list <ComObjPtr<GuestDirectory> > SessionDirectories;
    117126    typedef std::list <ComObjPtr<GuestFile> > SessionFiles;
     127    typedef std::list <ComObjPtr<GuestProcess> > SessionProcesses;
    118128
    119129    struct Data
    120130    {
    121         ComPtr<IGuest>       mParent;
     131        /** Flag indicating if this is an internal session
     132         *  or not. Internal session are not accessible by clients. */
     133        bool                 fInternal;
     134        /** Pointer to the parent (IGuest). */
     135        Guest               *mParent;
     136        /** The session credentials. */
    122137        Utf8Str              mUser;
     138        Utf8Str              mPassword;
    123139        Utf8Str              mDomain;
    124         Utf8Str              mPassword;
     140        /** The (optional) session name. */
    125141        Utf8Str              mName;
     142        /** The session ID. */
    126143        ULONG                mId;
     144        /** The session timeout. Default is 30s. */
    127145        ULONG                mTimeout;
    128146        SessionEnvironment   mEnvironment;
    129         SessionProcesses     mProcesses;
    130147        SessionDirectories   mDirectories;
    131148        SessionFiles         mFiles;
     149        SessionProcesses     mProcesses;
    132150    } mData;
    133151};
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r42084 r42105  
    26612661}
    26622662
    2663 STDMETHODIMP Guest::OpenSession(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession)
     2663// private methods
     2664/////////////////////////////////////////////////////////////////////////////
     2665
     2666int Guest::sessionClose(ComObjPtr<GuestSession> pSession)
     2667{
     2668    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     2669
     2670    for (GuestSessions::iterator itSessions = mData.mGuestSessions.begin();
     2671         itSessions != mData.mGuestSessions.end(); ++itSessions)
     2672    {
     2673        if (pSession == (*itSessions))
     2674        {
     2675            mData.mGuestSessions.remove((*itSessions));
     2676            return VINF_SUCCESS;
     2677        }
     2678    }
     2679
     2680    return VERR_NOT_FOUND;
     2681}
     2682
     2683// implementation of public methods
     2684/////////////////////////////////////////////////////////////////////////////
     2685
     2686STDMETHODIMP Guest::CreateSession(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession)
    26642687{
    26652688#ifndef VBOX_WITH_GUEST_CONTROL
     
    26702693    if (RT_UNLIKELY((aUser) == NULL || *(aUser) == '\0'))
    26712694        return setError(E_INVALIDARG, tr("No user name specified"));
    2672     CheckComArgOutPointerValid(aSessionName);
     2695    CheckComArgOutPointerValid(aGuestSession);
    26732696
    26742697    AutoCaller autoCaller(this);
     
    26852708        if (FAILED(hr)) throw hr;
    26862709
    2687         hr = pGuestSession->init(static_cast<IGuest*>(this),
    2688                                  aUser, aPassword, aDomain, aSessionName);
    2689         if (FAILED(hr)) throw hr;
     2710        int rc = pGuestSession->init(this,
     2711                                     aUser, aPassword, aDomain, aSessionName);
     2712        if (RT_FAILURE(rc)) throw VBOX_E_IPRT_ERROR;
    26902713
    26912714        mData.mGuestSessions.push_back(pGuestSession);
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r42095 r42105  
    5050/////////////////////////////////////////////////////////////////////////////
    5151
    52 HRESULT GuestProcess::init(void)
     52int GuestProcess::init(GuestSession *pSession,
     53                       const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
     54                       ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
     55                       ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity))
    5356{
    5457    /* Enclose the state transition NotReady->InInit->Ready. */
    5558    AutoInitSpan autoInitSpan(this);
    56     AssertReturn(autoInitSpan.isOk(), E_FAIL);
     59    AssertReturn(autoInitSpan.isOk(), VERR_OBJECT_DESTROYED);
     60
     61    int rc = VINF_SUCCESS;
     62
     63    mData.mParent = pSession;
    5764
    5865    /* Confirm a successful initialization when it's the case. */
    59     autoInitSpan.setSucceeded();
     66    if (RT_SUCCESS(rc))
     67        autoInitSpan.setSucceeded();
    6068
    6169    return S_OK;
     
    131139}
    132140
    133 STDMETHODIMP GuestProcess::COMGETTER(PID)(ULONG *aPID)
     141STDMETHODIMP GuestProcess::COMGETTER(Pid)(ULONG *aPID)
    134142{
    135143#ifndef VBOX_WITH_GUEST_CONTROL
     
    182190}
    183191
    184 STDMETHODIMP GuestProcess::WaitFor(ComSafeArrayOut(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason)
     192STDMETHODIMP GuestProcess::WaitFor(ComSafeArrayIn(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason)
    185193{
    186194#ifndef VBOX_WITH_GUEST_CONTROL
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r42094 r42105  
    2121*   Header Files                                                               *
    2222*******************************************************************************/
     23#include "GuestImpl.h"
    2324#include "GuestSessionImpl.h"
    2425
     
    5253/////////////////////////////////////////////////////////////////////////////
    5354
    54 HRESULT GuestSession::init(const ComPtr<IGuest> pGuest,
    55                            Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName)
     55int GuestSession::init(Guest *aGuest,
     56                       Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName)
    5657{
    5758    /* Enclose the state transition NotReady->InInit->Ready. */
    5859    AutoInitSpan autoInitSpan(this);
    59     AssertReturn(autoInitSpan.isOk(), E_FAIL);
    60 
    61     mData.mParent = pGuest;
     60    AssertReturn(autoInitSpan.isOk(), VERR_OBJECT_DESTROYED);
     61
     62    mData.mParent = aGuest;
    6263
    6364    mData.mUser = aUser;
     
    6970    autoInitSpan.setSucceeded();
    7071
    71     return S_OK;
     72    return VINF_SUCCESS;
    7273}
    7374
     
    8687
    8788#ifdef VBOX_WITH_GUEST_CONTROL
    88     for (SessionFiles::const_iterator itFiles = mData.mFiles.begin();
     89    for (SessionDirectories::iterator itDirs = mData.mDirectories.begin();
     90         itDirs != mData.mDirectories.end(); ++itDirs)
     91    {
     92        (*itDirs)->uninit();
     93        (*itDirs).setNull();
     94    }
     95    mData.mDirectories.clear();
     96
     97    for (SessionFiles::iterator itFiles = mData.mFiles.begin();
    8998         itFiles != mData.mFiles.end(); ++itFiles)
    9099    {
    91         /** @todo */
    92     }
    93 
    94     for (SessionDirectories::const_iterator itDirs = mData.mDirectories.begin();
    95          itDirs != mData.mDirectories.end(); ++itDirs)
    96     {
    97         /** @todo */
    98     }
    99 
    100     for (SessionProcesses::const_iterator itProcs = mData.mProcesses.begin();
     100        (*itFiles)->uninit();
     101        (*itFiles).setNull();
     102    }
     103    mData.mFiles.clear();
     104
     105    for (SessionProcesses::iterator itProcs = mData.mProcesses.begin();
    101106         itProcs != mData.mProcesses.end(); ++itProcs)
    102107    {
    103         /** @todo */
    104     }
     108        (*itProcs)->uninit();
     109        (*itProcs).setNull();
     110    }
     111    mData.mProcesses.clear();
     112
     113    mData.mParent->sessionClose(this);
    105114#endif
    106115}
     
    283292}
    284293
     294// private methods
     295/////////////////////////////////////////////////////////////////////////////
     296
     297int GuestSession::directoryClose(ComObjPtr<GuestDirectory> pDirectory)
     298{
     299    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     300
     301    for (SessionDirectories::iterator itDirs = mData.mDirectories.begin();
     302         itDirs != mData.mDirectories.end(); ++itDirs)
     303    {
     304        if (pDirectory == (*itDirs))
     305        {
     306            mData.mDirectories.remove((*itDirs));
     307            return VINF_SUCCESS;
     308        }
     309    }
     310
     311    return VERR_NOT_FOUND;
     312}
     313
     314int GuestSession::fileClose(ComObjPtr<GuestFile> pFile)
     315{
     316    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     317
     318    for (SessionFiles::iterator itFiles = mData.mFiles.begin();
     319         itFiles != mData.mFiles.end(); ++itFiles)
     320    {
     321        if (pFile == (*itFiles))
     322        {
     323            mData.mFiles.remove((*itFiles));
     324            return VINF_SUCCESS;
     325        }
     326    }
     327
     328    return VERR_NOT_FOUND;
     329}
     330
     331int GuestSession::processClose(ComObjPtr<GuestProcess> pProcess)
     332{
     333    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     334
     335    for (SessionProcesses::iterator itProcs = mData.mProcesses.begin();
     336         itProcs != mData.mProcesses.end(); ++itProcs)
     337    {
     338        if (pProcess == (*itProcs))
     339        {
     340            mData.mProcesses.remove((*itProcs));
     341            return VINF_SUCCESS;
     342        }
     343    }
     344
     345    return VERR_NOT_FOUND;
     346}
     347
     348int GuestSession::processCreateExInteral(const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
     349                                         ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
     350                                         ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
     351                                         IGuestProcess **aProcess)
     352{
     353    AssertPtrReturn(aProcess, VERR_INVALID_POINTER);
     354
     355    /* Validate flags. */
     356    com::SafeArray<ProcessCreateFlag_T> arrFlags(ComSafeArrayInArg(aFlags));
     357    for (size_t i = 0; i < arrFlags.size(); i++)
     358    {
     359        if (arrFlags[i] == ExecuteProcessFlag_None)
     360            continue;
     361
     362        if (   !(arrFlags[i] & ExecuteProcessFlag_IgnoreOrphanedProcesses)
     363            && !(arrFlags[i] & ExecuteProcessFlag_WaitForProcessStartOnly)
     364            && !(arrFlags[i] & ExecuteProcessFlag_Hidden)
     365            && !(arrFlags[i] & ExecuteProcessFlag_NoProfile))
     366        {
     367            return VERR_INVALID_PARAMETER;
     368        }
     369    }
     370
     371    /* Adjust timeout. If set to 0, we define
     372     * an infinite timeout. */
     373    if (aTimeoutMS == 0)
     374        aTimeoutMS = UINT32_MAX;
     375
     376    /** @tood Implement process priority + affinity. */
     377
     378    int rc;
     379    ComObjPtr<GuestProcess> pGuestProcess;
     380    try
     381    {
     382        /* Create the session object. */
     383        HRESULT hr = pGuestProcess.createObject();
     384        if (FAILED(hr)) throw VERR_COM_UNEXPECTED;
     385
     386        rc = pGuestProcess->init(this,
     387                                 aCommand, aArguments, aEnvironment,
     388                                 aFlags, aTimeoutMS, aPriority, aAffinity);
     389        if (RT_FAILURE(rc)) throw rc;
     390
     391        mData.mProcesses.push_back(pGuestProcess);
     392
     393        /* Return guest session to the caller. */
     394        hr = pGuestProcess.queryInterfaceTo(aProcess);
     395        if (FAILED(hr)) throw VERR_COM_OBJECT_NOT_FOUND;
     396    }
     397    catch (int rc2)
     398    {
     399        rc = rc2;
     400    }
     401
     402    return rc;
     403
     404#if 0
     405    int rc = VINF_SUCCESS;
     406
     407    char **papszArgv = NULL;
     408    try
     409    {
     410        /* Prepare arguments. */
     411        uint32_t uNumArgs = 0;
     412        if (aArguments)
     413        {
     414            com::SafeArray<IN_BSTR> args(ComSafeArrayInArg(aArguments));
     415            uNumArgs = args.size();
     416            papszArgv = (char**)RTMemAlloc(sizeof(char*) * (uNumArgs + 1));
     417            AssertReturn(papszArgv, VERR_NO_MEMORY);
     418            for (unsigned i = 0; RT_SUCCESS(rc) && i < uNumArgs; i++)
     419                rc = RTUtf16ToUtf8(args[i], &papszArgv[i]);
     420            papszArgv[uNumArgs] = NULL;
     421
     422            if (RT_FAILURE(rc))
     423                return rc;
     424        }
     425
     426        char *pszArgs = NULL;
     427        if (uNumArgs)
     428        {
     429            rc = RTGetOptArgvToString(&pszArgs, papszArgv, RTGETOPTARGV_CNV_QUOTE_MS_CRT);
     430            if (RT_FAILURE(rc)) throw rc;
     431        }
     432
     433        /* Get number of arguments. */
     434        uint32_t cbArgs = pszArgs ? strlen(pszArgs) + 1 : 0; /* Include terminating zero. */
     435
     436        /* Prepare environment. */
     437        void *pvEnv = NULL;
     438        uint32_t uNumEnv = 0;
     439        uint32_t cbEnv = 0;
     440        if (aEnvironment)
     441        {
     442            com::SafeArray<IN_BSTR> env(ComSafeArrayInArg(aEnvironment));
     443
     444            for (unsigned i = 0; RT_SUCCESS(rc) && i < env.size(); i++)
     445                rc = prepareExecuteEnv(Utf8Str(env[i]).c_str(), &pvEnv, &cbEnv, &uNumEnv);
     446        }
     447    }
     448    catch (int eRc)
     449    {
     450
     451
     452        rc = exRc;
     453    }
     454
     455    for (unsigned i = 0; i < uNumArgs; i++)
     456        RTMemFree(papszArgv[i]);
     457            RTMemFree(papszArgv);
     458#endif
     459
     460    return rc;
     461}
     462
    285463// implementation of public methods
    286464/////////////////////////////////////////////////////////////////////////////
     
    291469    ReturnComNotImplemented();
    292470#else
    293     AutoCaller autoCaller(this);
    294     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    295 
    296471    uninit();
     472
     473    return S_OK;
    297474#endif /* VBOX_WITH_GUEST_CONTROL */
    298475}
     
    575752
    576753STDMETHODIMP GuestSession::ProcessCreate(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    577                                          ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **IGuestProcess)
    578 {
    579 #ifndef VBOX_WITH_GUEST_CONTROL
    580     ReturnComNotImplemented();
    581 #else
    582     AutoCaller autoCaller(this);
    583     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    584 
    585     ReturnComNotImplemented();
     754                                         ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess)
     755{
     756#ifndef VBOX_WITH_GUEST_CONTROL
     757    ReturnComNotImplemented();
     758#else
     759    AutoCaller autoCaller(this);
     760    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     761
     762    CheckComArgOutPointerValid(aProcess);
     763
     764    com::SafeArray<LONG> aAffinity; /** @todo Process affinity, not used yet. */
     765
     766    int rc = processCreateExInteral(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS,
     767                                    ProcessPriority_Default, ComSafeArrayAsInParam(aAffinity), aProcess);
     768    return RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
    586769#endif /* VBOX_WITH_GUEST_CONTROL */
    587770}
     
    590773                                           ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
    591774                                           ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
    592                                            IGuestProcess **IGuestProcess)
    593 {
    594 #ifndef VBOX_WITH_GUEST_CONTROL
    595     ReturnComNotImplemented();
    596 #else
    597     AutoCaller autoCaller(this);
    598     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    599 
    600     ReturnComNotImplemented();
    601 #endif /* VBOX_WITH_GUEST_CONTROL */
    602 }
    603 
    604 STDMETHODIMP GuestSession::ProcessGet(ULONG aPID, IGuestProcess **IGuestProcess)
     775                                           IGuestProcess **aProcess)
     776{
     777#ifndef VBOX_WITH_GUEST_CONTROL
     778    ReturnComNotImplemented();
     779#else
     780    AutoCaller autoCaller(this);
     781    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     782
     783    CheckComArgOutPointerValid(aProcess);
     784
     785    int rc = processCreateExInteral(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS,
     786                                    aPriority, aAffinity, aProcess);
     787    return RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
     788#endif /* VBOX_WITH_GUEST_CONTROL */
     789}
     790
     791STDMETHODIMP GuestSession::ProcessGet(ULONG aPID, IGuestProcess **aProcess)
    605792{
    606793#ifndef VBOX_WITH_GUEST_CONTROL
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