Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 42104)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 42105)
@@ -9744,5 +9744,5 @@
   <interface
     name="IProcess" extends="$unknown"
-    uuid="031c6ba4-9005-486d-8333-b27bb009bba9"
+    uuid="8a308a2f-bea6-4786-80a0-4d07cd4bacaa"
     wsmap="managed"
     >
@@ -9851,5 +9851,5 @@
         <desc>TODO</desc>
       </param>
-      <param name="size" type="unsigned long" dir="in">
+      <param name="data" type="octet" dir="in" safearray="yes">
         <desc>TODO</desc>
       </param>
@@ -9857,8 +9857,5 @@
         <desc>TODO</desc>
       </param>
-      <param name="written" type="unsigned long" dir="out">
-        <desc>TODO</desc>
-      </param>
-      <param name="data" type="octet" dir="return" safearray="yes">
+      <param name="written" type="unsigned long" dir="return">
         <desc>TODO</desc>
       </param>
@@ -10286,5 +10283,5 @@
   <interface
     name="IGuest" extends="$unknown"
-    uuid="a115744a-0e0b-4193-b40c-40e0d66d0f8d"
+    uuid="1413d910-e533-47af-a71b-919c106d2472"
     wsmap="managed"
     >
@@ -10674,5 +10671,5 @@
     </method>
 
-    <method name="openSession">
+    <method name="createSession">
       <desc>
         TODO
Index: trunk/src/VBox/Main/include/GuestImpl.h
===================================================================
--- trunk/src/VBox/Main/include/GuestImpl.h	(revision 42104)
+++ trunk/src/VBox/Main/include/GuestImpl.h	(revision 42105)
@@ -133,5 +133,5 @@
                                      ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
     STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ULONG aFlags, IProgress **aProgress);
-    STDMETHOD(OpenSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
+    STDMETHOD(CreateSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
 
     // Public methods that are not in IDL (only called internally).
@@ -202,4 +202,10 @@
     void enableVMMStatistics(BOOL aEnable) { mCollectVMMStats = aEnable; };
 
+public:
+    /** @name Public internal methods.
+     * @{ */
+    int sessionClose(ComObjPtr<GuestSession> pSession);
+    /** @}  */
+
 private:
 
@@ -353,3 +359,3 @@
 
 #endif // ____H_GUESTIMPL
-/* vi: set tabstop=4 shiftwidth=4 expandtab: */
+
Index: trunk/src/VBox/Main/include/GuestProcessImpl.h
===================================================================
--- trunk/src/VBox/Main/include/GuestProcessImpl.h	(revision 42104)
+++ trunk/src/VBox/Main/include/GuestProcessImpl.h	(revision 42105)
@@ -22,4 +22,6 @@
 #include "VirtualBoxBase.h"
 
+class GuestSession;
+
 /**
  * TODO
@@ -40,5 +42,9 @@
     END_COM_MAP()
     DECLARE_EMPTY_CTOR_DTOR(GuestProcess)
-    HRESULT init(void);
+
+    int     init(GuestSession *pSession,
+                 const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
+                 ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
+                 ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity));
     void    uninit(void);
     HRESULT FinalConstruct(void);
@@ -52,10 +58,10 @@
     STDMETHOD(COMGETTER(ExecutablePath))(BSTR *aExecutablePath);
     STDMETHOD(COMGETTER(ExitCode))(LONG *aExitCode);
-    STDMETHOD(COMGETTER(PID))(ULONG *aPID);
+    STDMETHOD(COMGETTER(Pid))(ULONG *aPID);
     STDMETHOD(COMGETTER(Status))(ProcessStatus_T *aStatus);
 
     STDMETHOD(Read)(ULONG aHandle, ULONG aSize, ULONG aTimeoutMS, ComSafeArrayOut(BYTE, aData));
     STDMETHOD(Terminate)(void);
-    STDMETHOD(WaitFor)(ComSafeArrayOut(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason);
+    STDMETHOD(WaitFor)(ComSafeArrayIn(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason);
     STDMETHOD(Write)(ULONG aHandle, ComSafeArrayIn(BYTE, aData), ULONG aTimeoutMS, ULONG *aWritten);
     /** @}  */
@@ -72,4 +78,5 @@
     struct Data
     {
+        GuestSession        *mParent;
         Bstr                 mName;
     } mData;
Index: trunk/src/VBox/Main/include/GuestSessionImpl.h
===================================================================
--- trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 42104)
+++ trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 42105)
@@ -27,4 +27,6 @@
 #include "GuestFsObjInfoImpl.h"
 
+class Guest;
+
 /**
  * TODO
@@ -45,5 +47,5 @@
     DECLARE_EMPTY_CTOR_DTOR(GuestSession)
 
-    HRESULT init(const ComPtr<IGuest> pGuest, Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName);
+    int     init(Guest *aGuest, Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName);
     void    uninit(void);
     HRESULT FinalConstruct(void);
@@ -91,10 +93,10 @@
     STDMETHOD(FileSetACL)(IN_BSTR aPath, IN_BSTR aACL);
     STDMETHOD(ProcessCreate)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
-                             ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **IGuestProcess);
+                             ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess);
     STDMETHOD(ProcessCreateEx)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
                                ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
                                ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
-                               IGuestProcess **IGuestProcess);
-    STDMETHOD(ProcessGet)(ULONG aPID, IGuestProcess **IGuestProcess);
+                               IGuestProcess **aProcess);
+    STDMETHOD(ProcessGet)(ULONG aPID, IGuestProcess **aProcess);
     STDMETHOD(SetTimeout)(ULONG aTimeoutMS);
     STDMETHOD(SymlinkCreate)(IN_BSTR aSource, IN_BSTR aTarget, SymlinkType_T aType);
@@ -108,4 +110,11 @@
     /** @name Public internal methods.
      * @{ */
+    int directoryClose(ComObjPtr<GuestDirectory> pDirectory);
+    int fileClose(ComObjPtr<GuestFile> pFile);
+    int processClose(ComObjPtr<GuestProcess> pProcess);
+    int processCreateExInteral(const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
+                               ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
+                               ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
+                               IGuestProcess **aProcess);
     /** @}  */
 
@@ -113,21 +122,30 @@
 
     typedef std::map <Utf8Str, Utf8Str> SessionEnvironment;
-    typedef std::list <ComObjPtr<GuestProcess> > SessionProcesses;
+
     typedef std::list <ComObjPtr<GuestDirectory> > SessionDirectories;
     typedef std::list <ComObjPtr<GuestFile> > SessionFiles;
+    typedef std::list <ComObjPtr<GuestProcess> > SessionProcesses;
 
     struct Data
     {
-        ComPtr<IGuest>       mParent;
+        /** Flag indicating if this is an internal session
+         *  or not. Internal session are not accessible by clients. */
+        bool                 fInternal;
+        /** Pointer to the parent (IGuest). */
+        Guest               *mParent;
+        /** The session credentials. */
         Utf8Str              mUser;
+        Utf8Str              mPassword;
         Utf8Str              mDomain;
-        Utf8Str              mPassword;
+        /** The (optional) session name. */
         Utf8Str              mName;
+        /** The session ID. */
         ULONG                mId;
+        /** The session timeout. Default is 30s. */
         ULONG                mTimeout;
         SessionEnvironment   mEnvironment;
-        SessionProcesses     mProcesses;
         SessionDirectories   mDirectories;
         SessionFiles         mFiles;
+        SessionProcesses     mProcesses;
     } mData;
 };
Index: trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 42104)
+++ trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 42105)
@@ -2661,5 +2661,28 @@
 }
 
-STDMETHODIMP Guest::OpenSession(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession)
+// private methods
+/////////////////////////////////////////////////////////////////////////////
+
+int Guest::sessionClose(ComObjPtr<GuestSession> pSession)
+{
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    for (GuestSessions::iterator itSessions = mData.mGuestSessions.begin();
+         itSessions != mData.mGuestSessions.end(); ++itSessions)
+    {
+        if (pSession == (*itSessions))
+        {
+            mData.mGuestSessions.remove((*itSessions));
+            return VINF_SUCCESS;
+        }
+    }
+
+    return VERR_NOT_FOUND;
+}
+
+// implementation of public methods
+/////////////////////////////////////////////////////////////////////////////
+
+STDMETHODIMP Guest::CreateSession(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -2670,5 +2693,5 @@
     if (RT_UNLIKELY((aUser) == NULL || *(aUser) == '\0'))
         return setError(E_INVALIDARG, tr("No user name specified"));
-    CheckComArgOutPointerValid(aSessionName);
+    CheckComArgOutPointerValid(aGuestSession);
 
     AutoCaller autoCaller(this);
@@ -2685,7 +2708,7 @@
         if (FAILED(hr)) throw hr;
 
-        hr = pGuestSession->init(static_cast<IGuest*>(this),
-                                 aUser, aPassword, aDomain, aSessionName);
-        if (FAILED(hr)) throw hr;
+        int rc = pGuestSession->init(this,
+                                     aUser, aPassword, aDomain, aSessionName);
+        if (RT_FAILURE(rc)) throw VBOX_E_IPRT_ERROR;
 
         mData.mGuestSessions.push_back(pGuestSession);
Index: trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 42104)
+++ trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 42105)
@@ -50,12 +50,20 @@
 /////////////////////////////////////////////////////////////////////////////
 
-HRESULT GuestProcess::init(void)
+int GuestProcess::init(GuestSession *pSession,
+                       const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
+                       ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
+                       ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity))
 {
     /* Enclose the state transition NotReady->InInit->Ready. */
     AutoInitSpan autoInitSpan(this);
-    AssertReturn(autoInitSpan.isOk(), E_FAIL);
+    AssertReturn(autoInitSpan.isOk(), VERR_OBJECT_DESTROYED);
+
+    int rc = VINF_SUCCESS;
+
+    mData.mParent = pSession;
 
     /* Confirm a successful initialization when it's the case. */
-    autoInitSpan.setSucceeded();
+    if (RT_SUCCESS(rc))
+        autoInitSpan.setSucceeded();
 
     return S_OK;
@@ -131,5 +139,5 @@
 }
 
-STDMETHODIMP GuestProcess::COMGETTER(PID)(ULONG *aPID)
+STDMETHODIMP GuestProcess::COMGETTER(Pid)(ULONG *aPID)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -182,5 +190,5 @@
 }
 
-STDMETHODIMP GuestProcess::WaitFor(ComSafeArrayOut(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason)
+STDMETHODIMP GuestProcess::WaitFor(ComSafeArrayIn(ProcessWaitForFlag_T, aFlags), ULONG aTimeoutMS, ProcessWaitReason_T *aReason)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
Index: trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 42104)
+++ trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 42105)
@@ -21,4 +21,5 @@
 *   Header Files                                                               *
 *******************************************************************************/
+#include "GuestImpl.h"
 #include "GuestSessionImpl.h"
 
@@ -52,12 +53,12 @@
 /////////////////////////////////////////////////////////////////////////////
 
-HRESULT GuestSession::init(const ComPtr<IGuest> pGuest,
-                           Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName)
+int GuestSession::init(Guest *aGuest,
+                       Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName)
 {
     /* Enclose the state transition NotReady->InInit->Ready. */
     AutoInitSpan autoInitSpan(this);
-    AssertReturn(autoInitSpan.isOk(), E_FAIL);
-
-    mData.mParent = pGuest;
+    AssertReturn(autoInitSpan.isOk(), VERR_OBJECT_DESTROYED);
+
+    mData.mParent = aGuest;
 
     mData.mUser = aUser;
@@ -69,5 +70,5 @@
     autoInitSpan.setSucceeded();
 
-    return S_OK;
+    return VINF_SUCCESS;
 }
 
@@ -86,21 +87,29 @@
 
 #ifdef VBOX_WITH_GUEST_CONTROL
-    for (SessionFiles::const_iterator itFiles = mData.mFiles.begin();
+    for (SessionDirectories::iterator itDirs = mData.mDirectories.begin();
+         itDirs != mData.mDirectories.end(); ++itDirs)
+    {
+        (*itDirs)->uninit();
+        (*itDirs).setNull();
+    }
+    mData.mDirectories.clear();
+
+    for (SessionFiles::iterator itFiles = mData.mFiles.begin();
          itFiles != mData.mFiles.end(); ++itFiles)
     {
-        /** @todo */
-    }
-
-    for (SessionDirectories::const_iterator itDirs = mData.mDirectories.begin();
-         itDirs != mData.mDirectories.end(); ++itDirs)
-    {
-        /** @todo */
-    }
-
-    for (SessionProcesses::const_iterator itProcs = mData.mProcesses.begin();
+        (*itFiles)->uninit();
+        (*itFiles).setNull();
+    }
+    mData.mFiles.clear();
+
+    for (SessionProcesses::iterator itProcs = mData.mProcesses.begin();
          itProcs != mData.mProcesses.end(); ++itProcs)
     {
-        /** @todo */
-    }
+        (*itProcs)->uninit();
+        (*itProcs).setNull();
+    }
+    mData.mProcesses.clear();
+
+    mData.mParent->sessionClose(this);
 #endif
 }
@@ -283,4 +292,173 @@
 }
 
+// private methods
+/////////////////////////////////////////////////////////////////////////////
+
+int GuestSession::directoryClose(ComObjPtr<GuestDirectory> pDirectory)
+{
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    for (SessionDirectories::iterator itDirs = mData.mDirectories.begin();
+         itDirs != mData.mDirectories.end(); ++itDirs)
+    {
+        if (pDirectory == (*itDirs))
+        {
+            mData.mDirectories.remove((*itDirs));
+            return VINF_SUCCESS;
+        }
+    }
+
+    return VERR_NOT_FOUND;
+}
+
+int GuestSession::fileClose(ComObjPtr<GuestFile> pFile)
+{
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    for (SessionFiles::iterator itFiles = mData.mFiles.begin();
+         itFiles != mData.mFiles.end(); ++itFiles)
+    {
+        if (pFile == (*itFiles))
+        {
+            mData.mFiles.remove((*itFiles));
+            return VINF_SUCCESS;
+        }
+    }
+
+    return VERR_NOT_FOUND;
+}
+
+int GuestSession::processClose(ComObjPtr<GuestProcess> pProcess)
+{
+    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
+
+    for (SessionProcesses::iterator itProcs = mData.mProcesses.begin();
+         itProcs != mData.mProcesses.end(); ++itProcs)
+    {
+        if (pProcess == (*itProcs))
+        {
+            mData.mProcesses.remove((*itProcs));
+            return VINF_SUCCESS;
+        }
+    }
+
+    return VERR_NOT_FOUND;
+}
+
+int GuestSession::processCreateExInteral(const Utf8Str &aCommand, ComSafeArrayIn(Utf8Str, aArguments), ComSafeArrayIn(Utf8Str, aEnvironment),
+                                         ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
+                                         ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
+                                         IGuestProcess **aProcess)
+{
+    AssertPtrReturn(aProcess, VERR_INVALID_POINTER);
+
+    /* Validate flags. */
+    com::SafeArray<ProcessCreateFlag_T> arrFlags(ComSafeArrayInArg(aFlags));
+    for (size_t i = 0; i < arrFlags.size(); i++)
+    {
+        if (arrFlags[i] == ExecuteProcessFlag_None)
+            continue;
+
+        if (   !(arrFlags[i] & ExecuteProcessFlag_IgnoreOrphanedProcesses)
+            && !(arrFlags[i] & ExecuteProcessFlag_WaitForProcessStartOnly)
+            && !(arrFlags[i] & ExecuteProcessFlag_Hidden)
+            && !(arrFlags[i] & ExecuteProcessFlag_NoProfile))
+        {
+            return VERR_INVALID_PARAMETER;
+        }
+    }
+
+    /* Adjust timeout. If set to 0, we define
+     * an infinite timeout. */
+    if (aTimeoutMS == 0)
+        aTimeoutMS = UINT32_MAX;
+
+    /** @tood Implement process priority + affinity. */
+
+    int rc;
+    ComObjPtr<GuestProcess> pGuestProcess;
+    try
+    {
+        /* Create the session object. */
+        HRESULT hr = pGuestProcess.createObject();
+        if (FAILED(hr)) throw VERR_COM_UNEXPECTED;
+
+        rc = pGuestProcess->init(this,
+                                 aCommand, aArguments, aEnvironment,
+                                 aFlags, aTimeoutMS, aPriority, aAffinity);
+        if (RT_FAILURE(rc)) throw rc;
+
+        mData.mProcesses.push_back(pGuestProcess);
+
+        /* Return guest session to the caller. */
+        hr = pGuestProcess.queryInterfaceTo(aProcess);
+        if (FAILED(hr)) throw VERR_COM_OBJECT_NOT_FOUND;
+    }
+    catch (int rc2)
+    {
+        rc = rc2;
+    }
+
+    return rc;
+
+#if 0
+    int rc = VINF_SUCCESS;
+
+    char **papszArgv = NULL;
+    try
+    {
+        /* Prepare arguments. */
+        uint32_t uNumArgs = 0;
+        if (aArguments)
+        {
+            com::SafeArray<IN_BSTR> args(ComSafeArrayInArg(aArguments));
+            uNumArgs = args.size();
+            papszArgv = (char**)RTMemAlloc(sizeof(char*) * (uNumArgs + 1));
+            AssertReturn(papszArgv, VERR_NO_MEMORY);
+            for (unsigned i = 0; RT_SUCCESS(rc) && i < uNumArgs; i++)
+                rc = RTUtf16ToUtf8(args[i], &papszArgv[i]);
+            papszArgv[uNumArgs] = NULL;
+
+            if (RT_FAILURE(rc))
+                return rc;
+        }
+
+        char *pszArgs = NULL;
+        if (uNumArgs)
+        {
+            rc = RTGetOptArgvToString(&pszArgs, papszArgv, RTGETOPTARGV_CNV_QUOTE_MS_CRT);
+            if (RT_FAILURE(rc)) throw rc;
+        }
+
+        /* Get number of arguments. */
+        uint32_t cbArgs = pszArgs ? strlen(pszArgs) + 1 : 0; /* Include terminating zero. */
+
+        /* Prepare environment. */
+        void *pvEnv = NULL;
+        uint32_t uNumEnv = 0;
+        uint32_t cbEnv = 0;
+        if (aEnvironment)
+        {
+            com::SafeArray<IN_BSTR> env(ComSafeArrayInArg(aEnvironment));
+
+            for (unsigned i = 0; RT_SUCCESS(rc) && i < env.size(); i++)
+                rc = prepareExecuteEnv(Utf8Str(env[i]).c_str(), &pvEnv, &cbEnv, &uNumEnv);
+        }
+    }
+    catch (int eRc)
+    {
+
+
+        rc = exRc;
+    }
+
+    for (unsigned i = 0; i < uNumArgs; i++)
+        RTMemFree(papszArgv[i]);
+            RTMemFree(papszArgv);
+#endif
+
+    return rc;
+}
+
 // implementation of public methods
 /////////////////////////////////////////////////////////////////////////////
@@ -291,8 +469,7 @@
     ReturnComNotImplemented();
 #else
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
     uninit();
+
+    return S_OK;
 #endif /* VBOX_WITH_GUEST_CONTROL */
 }
@@ -575,13 +752,19 @@
 
 STDMETHODIMP GuestSession::ProcessCreate(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
-                                         ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **IGuestProcess)
-{
-#ifndef VBOX_WITH_GUEST_CONTROL
-    ReturnComNotImplemented();
-#else
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    ReturnComNotImplemented();
+                                         ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess)
+{
+#ifndef VBOX_WITH_GUEST_CONTROL
+    ReturnComNotImplemented();
+#else
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    CheckComArgOutPointerValid(aProcess);
+
+    com::SafeArray<LONG> aAffinity; /** @todo Process affinity, not used yet. */
+
+    int rc = processCreateExInteral(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS,
+                                    ProcessPriority_Default, ComSafeArrayAsInParam(aAffinity), aProcess);
+    return RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
 #endif /* VBOX_WITH_GUEST_CONTROL */
 }
@@ -590,17 +773,21 @@
                                            ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
                                            ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
-                                           IGuestProcess **IGuestProcess)
-{
-#ifndef VBOX_WITH_GUEST_CONTROL
-    ReturnComNotImplemented();
-#else
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
-
-    ReturnComNotImplemented();
-#endif /* VBOX_WITH_GUEST_CONTROL */
-}
-
-STDMETHODIMP GuestSession::ProcessGet(ULONG aPID, IGuestProcess **IGuestProcess)
+                                           IGuestProcess **aProcess)
+{
+#ifndef VBOX_WITH_GUEST_CONTROL
+    ReturnComNotImplemented();
+#else
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    CheckComArgOutPointerValid(aProcess);
+
+    int rc = processCreateExInteral(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS,
+                                    aPriority, aAffinity, aProcess);
+    return RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
+#endif /* VBOX_WITH_GUEST_CONTROL */
+}
+
+STDMETHODIMP GuestSession::ProcessGet(ULONG aPID, IGuestProcess **aProcess)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
