VirtualBox

Changeset 50727 in vbox


Ignore:
Timestamp:
Mar 7, 2014 6:21:44 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92699
Message:

6813 src-client/GuestSessionImpl.cpp

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestSessionImpl.h

    r49948 r50727  
    2020#define ____H_GUESTSESSIONIMPL
    2121
    22 #include "VirtualBoxBase.h"
     22#include "GuestSessionWrap.h"
    2323#include "EventImpl.h"
    2424
     
    5353
    5454    int getGuestProperty(const ComObjPtr<Guest> &pGuest,
    55                          const Utf8Str &strPath, Utf8Str &strValue);
     55                           const Utf8Str &strPath, Utf8Str &strValue);
    5656    int setProgress(ULONG uPercent);
    5757    int setProgressSuccess(void);
     
    221221    };
    222222
    223     int addProcessArguments(ProcessArguments &aArgumentsDest,
    224                             const ProcessArguments &aArgumentsSource);
    225     int copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO,
    226                         Utf8Str const &strFileSource, const Utf8Str &strFileDest,
    227                         bool fOptional, uint32_t *pcbSize);
    228     int runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo);
     223    int i_addProcessArguments(ProcessArguments &aArgumentsDest,
     224                              const ProcessArguments &aArgumentsSource);
     225    int i_copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO,
     226                          Utf8Str const &strFileSource, const Utf8Str &strFileDest,
     227                          bool fOptional, uint32_t *pcbSize);
     228    int i_runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo);
    229229
    230230    /** Files to handle. */
     
    243243 */
    244244class ATL_NO_VTABLE GuestSession :
    245     public VirtualBoxBase,
    246     public GuestBase,
    247     VBOX_SCRIPTABLE_IMPL(IGuestSession)
     245    public GuestSessionWrap,
     246    public GuestBase
    248247{
    249248public:
    250249    /** @name COM and internal init/term/mapping cruft.
    251250     * @{ */
    252     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(GuestSession, IGuestSession)
    253     DECLARE_NOT_AGGREGATABLE(GuestSession)
    254     DECLARE_PROTECT_FINAL_CONSTRUCT()
    255     BEGIN_COM_MAP(GuestSession)
    256         VBOX_DEFAULT_INTERFACE_ENTRIES(IGuestSession)
    257     END_COM_MAP()
    258251    DECLARE_EMPTY_CTOR_DTOR(GuestSession)
    259252
     
    264257    /** @}  */
    265258
    266     /** @name IGuestSession properties.
    267      * @{ */
    268     STDMETHOD(COMGETTER(User))(BSTR *aName);
    269     STDMETHOD(COMGETTER(Domain))(BSTR *aDomain);
    270     STDMETHOD(COMGETTER(Name))(BSTR *aName);
    271     STDMETHOD(COMGETTER(Id))(ULONG *aId);
    272     STDMETHOD(COMGETTER(Status))(GuestSessionStatus_T *aStatus);
    273     STDMETHOD(COMGETTER(Timeout))(ULONG *aTimeout);
    274     STDMETHOD(COMSETTER(Timeout))(ULONG aTimeout);
    275     STDMETHOD(COMGETTER(ProtocolVersion))(ULONG *aVersion);
    276     STDMETHOD(COMGETTER(Environment))(ComSafeArrayOut(BSTR, aEnvironment));
    277     STDMETHOD(COMSETTER(Environment))(ComSafeArrayIn(IN_BSTR, aEnvironment));
    278     STDMETHOD(COMGETTER(Processes))(ComSafeArrayOut(IGuestProcess *, aProcesses));
    279     STDMETHOD(COMGETTER(Directories))(ComSafeArrayOut(IGuestDirectory *, aDirectories));
    280     STDMETHOD(COMGETTER(Files))(ComSafeArrayOut(IGuestFile *, aFiles));
    281     STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
    282     /** @}  */
    283 
    284     /** @name IGuestSession methods.
    285      * @{ */
    286     STDMETHOD(Close)(void);
    287     STDMETHOD(CopyFrom)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(CopyFileFlag_T, aFlags), IProgress **aProgress);
    288     STDMETHOD(CopyTo)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(CopyFileFlag_T, aFlags), IProgress **aProgress);
    289     STDMETHOD(DirectoryCreate)(IN_BSTR aPath, ULONG aMode, ComSafeArrayIn(DirectoryCreateFlag_T, aFlags));
    290     STDMETHOD(DirectoryCreateTemp)(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aPath, BOOL aSecure, BSTR *aDirectory);
    291     STDMETHOD(DirectoryExists)(IN_BSTR aPath, BOOL *aExists);
    292     STDMETHOD(DirectoryOpen)(IN_BSTR aPath, IN_BSTR aFilter, ComSafeArrayIn(DirectoryOpenFlag_T, aFlags), IGuestDirectory **aDirectory);
    293     STDMETHOD(DirectoryQueryInfo)(IN_BSTR aPath, IGuestFsObjInfo **aInfo);
    294     STDMETHOD(DirectoryRemove)(IN_BSTR aPath);
    295     STDMETHOD(DirectoryRemoveRecursive)(IN_BSTR aPath, ComSafeArrayIn(DirectoryRemoveRecFlag_T, aFlags), IProgress **aProgress);
    296     STDMETHOD(DirectoryRename)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(PathRenameFlag_T, aFlags));
    297     STDMETHOD(DirectorySetACL)(IN_BSTR aPath, IN_BSTR aACL);
    298     STDMETHOD(EnvironmentClear)(void);
    299     STDMETHOD(EnvironmentGet)(IN_BSTR aName, BSTR *aValue);
    300     STDMETHOD(EnvironmentSet)(IN_BSTR aName, IN_BSTR aValue);
    301     STDMETHOD(EnvironmentUnset)(IN_BSTR aName);
    302     STDMETHOD(FileCreateTemp)(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aPath, BOOL aSecure, IGuestFile **aFile);
    303     STDMETHOD(FileExists)(IN_BSTR aPath, BOOL *aExists);
    304     STDMETHOD(FileRemove)(IN_BSTR aPath);
    305     STDMETHOD(FileOpen)(IN_BSTR aPath, IN_BSTR aOpenMode, IN_BSTR aDisposition, ULONG aCreationMode, IGuestFile **aFile);
    306     STDMETHOD(FileOpenEx)(IN_BSTR aPath, IN_BSTR aOpenMode, IN_BSTR aDisposition, IN_BSTR aSharingMode, ULONG aCreationMode, LONG64 aOffset, IGuestFile **aFile);
    307     STDMETHOD(FileQueryInfo)(IN_BSTR aPath, IGuestFsObjInfo **aInfo);
    308     STDMETHOD(FileQuerySize)(IN_BSTR aPath, LONG64 *aSize);
    309     STDMETHOD(FileRename)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(PathRenameFlag_T, aFlags));
    310     STDMETHOD(FileSetACL)(IN_BSTR aPath, IN_BSTR aACL);
    311     STDMETHOD(ProcessCreate)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    312                              ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess);
    313     STDMETHOD(ProcessCreateEx)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    314                                ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
    315                                ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
    316                                IGuestProcess **aProcess);
    317     STDMETHOD(ProcessGet)(ULONG aPID, IGuestProcess **aProcess);
    318     STDMETHOD(SymlinkCreate)(IN_BSTR aSource, IN_BSTR aTarget, SymlinkType_T aType);
    319     STDMETHOD(SymlinkExists)(IN_BSTR aSymlink, BOOL *aExists);
    320     STDMETHOD(SymlinkRead)(IN_BSTR aSymlink, ComSafeArrayIn(SymlinkReadFlag_T, aFlags), BSTR *aTarget);
    321     STDMETHOD(SymlinkRemoveDirectory)(IN_BSTR aPath);
    322     STDMETHOD(SymlinkRemoveFile)(IN_BSTR aFile);
    323     STDMETHOD(WaitFor)(ULONG aWaitFlags, ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason);
    324     STDMETHOD(WaitForArray)(ComSafeArrayIn(GuestSessionWaitForFlag_T, aFlags), ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason);
    325     /** @}  */
    326 
    327259private:
     260
     261    // Wrapped GuuestSession Properties
     262    HRESULT getUser(com::Utf8Str &aUser);
     263    HRESULT getDomain(com::Utf8Str &aDomain);
     264    HRESULT getName(com::Utf8Str &aName);
     265    HRESULT getId(ULONG *aId);
     266    HRESULT getTimeout(ULONG *aTimeout);
     267    HRESULT setTimeout(ULONG aTimeout);
     268    HRESULT getProtocolVersion(ULONG *aProtocolVersion);
     269    HRESULT getStatus(GuestSessionStatus_T *aStatus);
     270    HRESULT getEnvironment(std::vector<com::Utf8Str> &aEnvironment);
     271    HRESULT setEnvironment(const std::vector<com::Utf8Str> &aEnvironment);
     272    HRESULT getProcesses(std::vector<ComPtr<IGuestProcess> > &aProcesses);
     273    HRESULT getDirectories(std::vector<ComPtr<IGuestDirectory> > &aDirectories);
     274    HRESULT getFiles(std::vector<ComPtr<IGuestFile> > &aFiles);
     275    HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
     276
     277    // Wrapped GuuestSession Methods
     278    HRESULT close();
     279    HRESULT copyFrom(const com::Utf8Str &aSource,
     280                     const com::Utf8Str &aDest,
     281                     const std::vector<CopyFileFlag_T> &aFlags,
     282                     ComPtr<IProgress> &aProgress);
     283    HRESULT copyTo(const com::Utf8Str &aSource,
     284                   const com::Utf8Str &aDest,
     285                   const std::vector<CopyFileFlag_T> &aFlags,
     286                   ComPtr<IProgress> &aProgress);
     287    HRESULT directoryCreate(const com::Utf8Str &aPath,
     288                            ULONG aMode,
     289                            const std::vector<DirectoryCreateFlag_T> &aFlags);
     290    HRESULT directoryCreateTemp(const com::Utf8Str &aTemplateName,
     291                                ULONG aMode,
     292                                const com::Utf8Str &aPath,
     293                                BOOL aSecure,
     294                                com::Utf8Str &aDirectory);
     295    HRESULT directoryExists(const com::Utf8Str &aPath,
     296                            BOOL *aExists);
     297    HRESULT directoryOpen(const com::Utf8Str &aPath,
     298                          const com::Utf8Str &aFilter,
     299                          const std::vector<DirectoryOpenFlag_T> &aFlags,
     300                          ComPtr<IGuestDirectory> &aDirectory);
     301    HRESULT directoryQueryInfo(const com::Utf8Str &aPath,
     302                               ComPtr<IGuestFsObjInfo> &aInfo);
     303    HRESULT directoryRemove(const com::Utf8Str &aPath);
     304    HRESULT directoryRemoveRecursive(const com::Utf8Str &aPath,
     305                                     const std::vector<DirectoryRemoveRecFlag_T> &aFlags,
     306                                     ComPtr<IProgress> &aProgress);
     307    HRESULT directoryRename(const com::Utf8Str &aSource,
     308                            const com::Utf8Str &aDest,
     309                            const std::vector<PathRenameFlag_T> &aFlags);
     310    HRESULT directorySetACL(const com::Utf8Str &aPath,
     311                             const com::Utf8Str &aAcl);
     312    HRESULT environmentClear();
     313    HRESULT environmentGet(const com::Utf8Str &aName,
     314                           com::Utf8Str &aValue);
     315    HRESULT environmentSet(const com::Utf8Str &aName,
     316                           const com::Utf8Str &aValue);
     317    HRESULT environmentUnset(const com::Utf8Str &aName);
     318    HRESULT fileCreateTemp(const com::Utf8Str &aTemplateName,
     319                           ULONG aMode,
     320                           const com::Utf8Str &aPath,
     321                           BOOL aSecure,
     322                           ComPtr<IGuestFile> &aFile);
     323    HRESULT fileExists(const com::Utf8Str &aPath,
     324                       BOOL *aExists);
     325    HRESULT fileRemove(const com::Utf8Str &aPath);
     326    HRESULT fileOpen(const com::Utf8Str &aPath,
     327                     const com::Utf8Str &aOpenMode,
     328                     const com::Utf8Str &aDisposition,
     329                     ULONG aCreationMode,
     330                     ComPtr<IGuestFile> &aFile);
     331    HRESULT fileOpenEx(const com::Utf8Str &aPath,
     332                       const com::Utf8Str &aOpenMode,
     333                       const com::Utf8Str &aDisposition,
     334                       const com::Utf8Str &aSharingMode,
     335                       ULONG aCreationMode,
     336                       LONG64 aOffset,
     337                       ComPtr<IGuestFile> &aFile);
     338    HRESULT fileQueryInfo(const com::Utf8Str &aPath,
     339                          ComPtr<IGuestFsObjInfo> &aInfo);
     340    HRESULT fileQuerySize(const com::Utf8Str &aPath,
     341                          LONG64 *aSize);
     342    HRESULT fileRename(const com::Utf8Str &aSource,
     343                       const com::Utf8Str &aDest,
     344                       const std::vector<PathRenameFlag_T> &aFlags);
     345    HRESULT fileSetACL(const com::Utf8Str &aFile,
     346                       const com::Utf8Str &aAcl);
     347    HRESULT processCreate(const com::Utf8Str &aCommand,
     348                          const std::vector<com::Utf8Str> &aArguments,
     349                          const std::vector<com::Utf8Str> &aEnvironment,
     350                          const std::vector<ProcessCreateFlag_T> &aFlags,
     351                          ULONG aTimeoutMS,
     352                          ComPtr<IGuestProcess> &aGuestProcess);
     353    HRESULT processCreateEx(const com::Utf8Str &aCommand,
     354                            const std::vector<com::Utf8Str> &aArguments,
     355                            const std::vector<com::Utf8Str> &aEnvironment,
     356                            const std::vector<ProcessCreateFlag_T> &aFlags,
     357                            ULONG aTimeoutMS,
     358                            ProcessPriority_T aPriority,
     359                            const std::vector<LONG> &aAffinity,
     360                            ComPtr<IGuestProcess> &aGuestProcess);
     361    HRESULT processGet(ULONG aPid,
     362                       ComPtr<IGuestProcess> &aGuestProcess);
     363    HRESULT symlinkCreate(const com::Utf8Str &aSource,
     364                          const com::Utf8Str &aTarget,
     365                          SymlinkType_T aType);
     366    HRESULT symlinkExists(const com::Utf8Str &aSymlink,
     367                          BOOL *aExists);
     368    HRESULT symlinkRead(const com::Utf8Str &aSymlink,
     369                        const std::vector<SymlinkReadFlag_T> &aFlags,
     370                        com::Utf8Str &aTarget);
     371    HRESULT symlinkRemoveDirectory(const com::Utf8Str &aPath);
     372    HRESULT symlinkRemoveFile(const com::Utf8Str &aFile);
     373    HRESULT waitFor(ULONG aWaitFor,
     374                    ULONG aTimeoutMS,
     375                    GuestSessionWaitResult_T *aReason);
     376    HRESULT waitForArray(const std::vector<GuestSessionWaitForFlag_T> &aWaitFor,
     377                         ULONG aTimeoutMS,
     378                         GuestSessionWaitResult_T *aReason);
     379
    328380
    329381    /** Map of guest directories. The key specifies the internal directory ID. */
     
    338390    /** @name Public internal methods.
    339391     * @{ */
    340     int                     closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *pGuestRc);
    341     inline bool             directoryExists(uint32_t uDirID, ComObjPtr<GuestDirectory> *pDir);
    342     int                     directoryRemoveFromList(GuestDirectory *pDirectory);
    343     int                     directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags, int *pGuestRc);
    344     int                     directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode, uint32_t uFlags, int *pGuestRc);
    345     int                     objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath, bool fDirectory, Utf8Str &strName, int *pGuestRc);
    346     int                     directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo, ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc);
    347     int                     directoryQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
    348     int                     dispatchToDirectory(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    349     int                     dispatchToFile(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    350     int                     dispatchToObject(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    351     int                     dispatchToProcess(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    352     int                     dispatchToThis(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    353     inline bool             fileExists(uint32_t uFileID, ComObjPtr<GuestFile> *pFile);
    354     int                     fileRemoveFromList(GuestFile *pFile);
    355     int                     fileRemoveInternal(const Utf8Str &strPath, int *pGuestRc);
    356     int                     fileOpenInternal(const GuestFileOpenInfo &openInfo, ComObjPtr<GuestFile> &pFile, int *pGuestRc);
    357     int                     fileQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
    358     int                     fileQuerySizeInternal(const Utf8Str &strPath, int64_t *pllSize, int *pGuestRc);
    359     int                     fsQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
    360     const GuestCredentials &getCredentials(void);
    361     const GuestEnvironment &getEnvironment(void);
    362     EventSource            *getEventSource(void) { return mEventSource; }
    363     Utf8Str                 getName(void);
    364     ULONG                   getId(void) { return mData.mSession.mID; }
    365     static Utf8Str          guestErrorToString(int guestRc);
    366     HRESULT                 isReadyExternal(void);
    367     int                     onRemove(void);
    368     int                     onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
    369     int                     startSessionInternal(int *pGuestRc);
    370     int                     startSessionAsync(void);
     392    int                     i_closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *pGuestRc);
     393    inline bool             i_directoryExists(uint32_t uDirID, ComObjPtr<GuestDirectory> *pDir);
     394    int                     i_directoryRemoveFromList(GuestDirectory *pDirectory);
     395    int                     i_directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags, int *pGuestRc);
     396    int                     i_directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode, uint32_t uFlags, int *pGuestRc);
     397    int                     i_objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath, bool fDirectory, Utf8Str &strName, int *pGuestRc);
     398    int                     i_directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo, ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc);
     399    int                     i_directoryQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
     400    int                     i_dispatchToDirectory(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     401    int                     i_dispatchToFile(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     402    int                     i_dispatchToObject(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     403    int                     i_dispatchToProcess(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     404    int                     i_dispatchToThis(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     405    inline bool             i_fileExists(uint32_t uFileID, ComObjPtr<GuestFile> *pFile);
     406    int                     i_fileRemoveFromList(GuestFile *pFile);
     407    int                     i_fileRemoveInternal(const Utf8Str &strPath, int *pGuestRc);
     408    int                     i_fileOpenInternal(const GuestFileOpenInfo &openInfo, ComObjPtr<GuestFile> &pFile, int *pGuestRc);
     409    int                     i_fileQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
     410    int                     i_fileQuerySizeInternal(const Utf8Str &strPath, int64_t *pllSize, int *pGuestRc);
     411    int                     i_fsQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
     412    const GuestCredentials  &i_getCredentials(void);
     413    const GuestEnvironment  &i_getEnvironment(void);
     414    EventSource            *i_getEventSource(void) { return mEventSource; }
     415    Utf8Str                 i_getName(void);
     416    ULONG                   i_getId(void) { return mData.mSession.mID; }
     417    static Utf8Str          i_guestErrorToString(int guestRc);
     418    HRESULT                 i_isReadyExternal(void);
     419    int                     i_onRemove(void);
     420    int                     i_onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData);
     421    int                     i_startSessionInternal(int *pGuestRc);
     422    int                     i_startSessionAsync(void);
    371423    static DECLCALLBACK(int)
    372                             startSessionThread(RTTHREAD Thread, void *pvUser);
    373     Guest                  *getParent(void) { return mParent; }
    374     uint32_t                getProtocolVersion(void) { return mData.mProtocolVersion; }
    375     int                     pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags, int *pGuestRc);
    376     int                     processRemoveFromList(GuestProcess *pProcess);
    377     int                     processCreateExInteral(GuestProcessStartupInfo &procInfo, ComObjPtr<GuestProcess> &pProgress);
    378     inline bool             processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess);
    379     inline int              processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess);
    380     int                     sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms);
    381     static HRESULT          setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
    382     int                     setSessionStatus(GuestSessionStatus_T sessionStatus, int sessionRc);
    383     int                     signalWaiters(GuestSessionWaitResult_T enmWaitResult, int rc /*= VINF_SUCCESS */);
    384     int                     startTaskAsync(const Utf8Str &strTaskDesc, GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress);
    385     int                     queryInfo(void);
    386     int                     waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc);
    387     int                     waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS, GuestSessionStatus_T *pSessionStatus, int *pGuestRc);
     424                            i_startSessionThread(RTTHREAD Thread, void *pvUser);
     425    Guest                  *i_getParent(void) { return mParent; }
     426    uint32_t                i_getProtocolVersion(void) { return mData.mProtocolVersion; }
     427    int                     i_pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest, uint32_t uFlags, int *pGuestRc);
     428    int                     i_processRemoveFromList(GuestProcess *pProcess);
     429    int                     i_processCreateExInteral(GuestProcessStartupInfo &procInfo, ComObjPtr<GuestProcess> &pProgress);
     430    inline bool             i_processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess);
     431    inline int              i_processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess);
     432    int                     i_sendCommand(uint32_t uFunction, uint32_t uParms, PVBOXHGCMSVCPARM paParms);
     433    static HRESULT          i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
     434    int                     i_setSessionStatus(GuestSessionStatus_T sessionStatus, int sessionRc);
     435    int                     i_signalWaiters(GuestSessionWaitResult_T enmWaitResult, int rc /*= VINF_SUCCESS */);
     436    int                     i_startTaskAsync(const Utf8Str &strTaskDesc, GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress);
     437    int                     i_queryInfo(void);
     438    int                     i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc);
     439    int                     i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS, GuestSessionStatus_T *pSessionStatus, int *pGuestRc);
    388440    /** @}  */
    389441
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r49684 r50727  
    193193        Assert(!pSession.isNull());
    194194        int guestRc;
    195         rc = pSession->startSessionInternal(&guestRc);
     195        rc = pSession->i_startSessionInternal(&guestRc);
    196196        if (RT_FAILURE(rc))
    197197        {
     
    207207                SessionTaskUpdateAdditions *pTask = new SessionTaskUpdateAdditions(pSession /* GuestSession */,
    208208                                                                                   Utf8Str(aSource), aArgs, fFlags);
    209                 rc = pSession->startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress);
     209                rc = pSession->i_startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress);
    210210                if (RT_SUCCESS(rc))
    211211                {
     
    294294            {
    295295                case GUEST_DISCONNECTED:
    296                     rc = pSession->dispatchToThis(pCtxCb, pSvcCb);
     296                    rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb);
    297297                    break;
    298298
     
    301301                case GUEST_EXEC_INPUT_STATUS:
    302302                case GUEST_EXEC_IO_NOTIFY:
    303                     rc = pSession->dispatchToProcess(pCtxCb, pSvcCb);
     303                    rc = pSession->i_dispatchToProcess(pCtxCb, pSvcCb);
    304304                    break;
    305305
    306306                case GUEST_FILE_NOTIFY:
    307                     rc = pSession->dispatchToFile(pCtxCb, pSvcCb);
     307                    rc = pSession->i_dispatchToFile(pCtxCb, pSvcCb);
    308308                    break;
    309309
    310310                case GUEST_SESSION_NOTIFY:
    311                     rc = pSession->dispatchToThis(pCtxCb, pSvcCb);
     311                    rc = pSession->i_dispatchToThis(pCtxCb, pSvcCb);
    312312                    break;
    313313
     
    320320                     * in this session object.
    321321                     */
    322                     rc = pSession->dispatchToObject(pCtxCb, pSvcCb);
     322                    rc = pSession->i_dispatchToObject(pCtxCb, pSvcCb);
    323323                    if (   rc == VERR_NOT_FOUND
    324324                        || rc == VERR_NOT_SUPPORTED)
     
    355355    int rc = VERR_NOT_FOUND;
    356356
    357     LogFlowThisFunc(("Removing session (ID=%RU32) ...\n", pSession->getId()));
     357    LogFlowThisFunc(("Removing session (ID=%RU32) ...\n", pSession->i_getId()));
    358358
    359359    GuestSessions::iterator itSessions = mData.mGuestSessions.begin();
     
    373373
    374374            LogFlowThisFunc(("Removing session (pSession=%p, ID=%RU32) (now total %ld sessions)\n",
    375                              pSession, pSession->getId(), mData.mGuestSessions.size() - 1));
    376 
    377             rc = pSession->onRemove();
     375                             pSession, pSession->i_getId(), mData.mGuestSessions.size() - 1));
     376
     377            rc = pSession->i_onRemove();
    378378            mData.mGuestSessions.erase(itSessions);
    379379
     
    525525        /* Start (fork) the session asynchronously
    526526         * on the guest. */
    527         rc = pSession->startSessionAsync();
     527        rc = pSession->i_startSessionAsync();
    528528    }
    529529
     
    570570    while (itSessions != mData.mGuestSessions.end())
    571571    {
    572         if (strName.contains(itSessions->second->getName())) /** @todo Use a (simple) pattern match (IPRT?). */
     572        if (strName.contains(itSessions->second->i_getName())) /** @todo Use a (simple) pattern match (IPRT?). */
    573573            listSessions.push_back(itSessions->second);
    574574        itSessions++;
  • trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp

    r49948 r50727  
    12261226{
    12271227    AssertPtr(mSession);
    1228     return GuestBase::registerWaitEvent(mSession->getId(), mObjectID, lstEvents, ppEvent);
     1228    return GuestBase::registerWaitEvent(mSession->i_getId(), mObjectID, lstEvents, ppEvent);
    12291229}
    12301230
  • trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp

    r50709 r50727  
    299299
    300300    AssertPtr(mSession);
    301     int rc2 = mSession->directoryRemoveFromList(this);
     301    int rc2 = mSession->i_directoryRemoveFromList(this);
    302302    if (RT_SUCCESS(rc))
    303303        rc = rc2;
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r50618 r50727  
    12381238
    12391239    AssertPtr(mSession);
    1240     int rc2 = mSession->fileRemoveFromList(this);
     1240    int rc2 = mSession->i_fileRemoveFromList(this);
    12411241    if (RT_SUCCESS(rc))
    12421242        rc = rc2;
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r50709 r50727  
    884884         * output event.
    885885         */
    886         if (mSession->getProtocolVersion() >= 2)
     886        if (mSession->i_getProtocolVersion() >= 2)
    887887            eventTypes.push_back(VBoxEventType_OnGuestProcessStateChanged);
    888888        eventTypes.push_back(VBoxEventType_OnGuestProcessOutput);
     
    10001000    LogFlowThisFunc(("uTimeoutMS=%RU32, procCmd=%s, procTimeoutMS=%RU32, procFlags=%x, sessionID=%RU32\n",
    10011001                     uTimeoutMS, mData.mProcess.mCommand.c_str(), mData.mProcess.mTimeoutMS, mData.mProcess.mFlags,
    1002                      mSession->getId()));
     1002                     mSession->i_getId()));
    10031003
    10041004    /* Wait until the caller function (if kicked off by a thread)
     
    10291029    AssertPtr(pSession);
    10301030
    1031     const GuestCredentials &sessionCreds = pSession->getCredentials();
     1031    const GuestCredentials &sessionCreds = pSession->i_getCredentials();
    10321032
    10331033    /* Prepare arguments. */
     
    10771077    {
    10781078        AssertPtr(mSession);
    1079         uint32_t uProtocol = mSession->getProtocolVersion();
     1079        uint32_t uProtocol = mSession->i_getProtocolVersion();
    10801080
    10811081        /* Prepare HGCM call. */
     
    12151215        /* Note: VBox < 4.3 (aka protocol version 1) does not
    12161216         *       support this, so just skip. */
    1217         if (mSession->getProtocolVersion() < 2)
     1217        if (mSession->i_getProtocolVersion() < 2)
    12181218            vrc = VERR_NOT_SUPPORTED;
    12191219
     
    13601360    return GuestProcess::i_waitFlagsToResultEx(fWaitFlags,
    13611361                                               mData.mStatus /* curStatus */, mData.mStatus /* newStatus */,
    1362                                                mData.mProcess.mFlags, mSession->getProtocolVersion());
     1362                                               mData.mProcess.mFlags, mSession->i_getProtocolVersion());
    13631363}
    13641364
     
    14441444
    14451445            waitResult = i_waitFlagsToResultEx(fWaitFlags, curStatus, newStatus,
    1446                                                mData.mProcess.mFlags, mSession->getProtocolVersion());
     1446                                               mData.mProcess.mFlags, mSession->i_getProtocolVersion());
    14471447#ifdef DEBUG
    14481448            LogFlowThisFunc(("Got new status change: fWaitFlags=0x%x, newStatus=%RU32, waitResult=%RU32\n",
     
    16901690         * input event.
    16911691         */
    1692         if (mSession->getProtocolVersion() >= 2)
     1692        if (mSession->i_getProtocolVersion() >= 2)
    16931693            eventTypes.push_back(VBoxEventType_OnGuestProcessStateChanged);
    16941694        eventTypes.push_back(VBoxEventType_OnGuestProcessInputNotify);
     
    18241824     * still can hold references to it. */
    18251825    AssertPtr(mSession);
    1826     int rc2 = mSession->processRemoveFromList(this);
     1826    int rc2 = mSession->i_processRemoveFromList(this);
    18271827    if (RT_SUCCESS(vrc))
    18281828        vrc = rc2;
     
    19791979    mStartupInfo.mFlags |= ProcessCreateFlag_Hidden;
    19801980
    1981     int vrc = pSession->processCreateExInteral(mStartupInfo, pProcess);
     1981    int vrc = pSession->i_processCreateExInteral(mStartupInfo, pProcess);
    19821982    if (RT_SUCCESS(vrc))
    19831983        vrc = fAsync
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r50709 r50727  
    204204    HRESULT hr;
    205205
    206     int rc = queryInfo();
     206    int rc = i_queryInfo();
    207207    if (RT_SUCCESS(rc))
    208208    {
     
    333333/////////////////////////////////////////////////////////////////////////////
    334334
    335 STDMETHODIMP GuestSession::COMGETTER(User)(BSTR *aUser)
    336 {
    337 #ifndef VBOX_WITH_GUEST_CONTROL
    338     ReturnComNotImplemented();
    339 #else
    340     LogFlowThisFuncEnter();
    341 
    342     CheckComArgOutPointerValid(aUser);
    343 
    344     AutoCaller autoCaller(this);
    345     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     335HRESULT GuestSession::getUser(com::Utf8Str &aUser)
     336{
     337#ifndef VBOX_WITH_GUEST_CONTROL
     338    ReturnComNotImplemented();
     339#else
     340
     341    LogFlowThisFuncEnter();
    346342
    347343    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    348344
    349     mData.mCredentials.mUser.cloneTo(aUser);
     345    aUser = mData.mCredentials.mUser;
    350346
    351347    LogFlowThisFuncLeave();
     
    354350}
    355351
    356 STDMETHODIMP GuestSession::COMGETTER(Domain)(BSTR *aDomain)
    357 {
    358 #ifndef VBOX_WITH_GUEST_CONTROL
    359     ReturnComNotImplemented();
    360 #else
    361     LogFlowThisFuncEnter();
    362 
    363     CheckComArgOutPointerValid(aDomain);
    364 
    365     AutoCaller autoCaller(this);
    366     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     352HRESULT GuestSession::getDomain(com::Utf8Str &aDomain)
     353{
     354#ifndef VBOX_WITH_GUEST_CONTROL
     355    ReturnComNotImplemented();
     356#else
     357    LogFlowThisFuncEnter();
    367358
    368359    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    369360
    370     mData.mCredentials.mDomain.cloneTo(aDomain);
     361    aDomain = mData.mCredentials.mDomain;
    371362
    372363    LogFlowThisFuncLeave();
     
    375366}
    376367
    377 STDMETHODIMP GuestSession::COMGETTER(Name)(BSTR *aName)
    378 {
    379 #ifndef VBOX_WITH_GUEST_CONTROL
    380     ReturnComNotImplemented();
    381 #else
    382     LogFlowThisFuncEnter();
    383 
    384     CheckComArgOutPointerValid(aName);
    385 
    386     AutoCaller autoCaller(this);
    387     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     368HRESULT GuestSession::getName(com::Utf8Str &aName)
     369{
     370#ifndef VBOX_WITH_GUEST_CONTROL
     371    ReturnComNotImplemented();
     372#else
     373    LogFlowThisFuncEnter();
    388374
    389375    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    390376
    391     mData.mSession.mName.cloneTo(aName);
     377    aName = mData.mSession.mName;
    392378
    393379    LogFlowThisFuncLeave();
     
    396382}
    397383
    398 STDMETHODIMP GuestSession::COMGETTER(Id)(ULONG *aId)
    399 {
    400 #ifndef VBOX_WITH_GUEST_CONTROL
    401     ReturnComNotImplemented();
    402 #else
    403     LogFlowThisFuncEnter();
    404 
    405     CheckComArgOutPointerValid(aId);
    406 
    407     AutoCaller autoCaller(this);
    408     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     384HRESULT GuestSession::getId(ULONG *aId)
     385{
     386#ifndef VBOX_WITH_GUEST_CONTROL
     387    ReturnComNotImplemented();
     388#else
     389    LogFlowThisFuncEnter();
    409390
    410391    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    417398}
    418399
    419 STDMETHODIMP GuestSession::COMGETTER(Status)(GuestSessionStatus_T *aStatus)
    420 {
    421 #ifndef VBOX_WITH_GUEST_CONTROL
    422     ReturnComNotImplemented();
    423 #else
    424     LogFlowThisFuncEnter();
    425 
    426     CheckComArgOutPointerValid(aStatus);
    427 
    428     AutoCaller autoCaller(this);
    429     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     400HRESULT GuestSession::getStatus(GuestSessionStatus_T *aStatus)
     401{
     402#ifndef VBOX_WITH_GUEST_CONTROL
     403    ReturnComNotImplemented();
     404#else
     405    LogFlowThisFuncEnter();
    430406
    431407    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    438414}
    439415
    440 STDMETHODIMP GuestSession::COMGETTER(Timeout)(ULONG *aTimeout)
    441 {
    442 #ifndef VBOX_WITH_GUEST_CONTROL
    443     ReturnComNotImplemented();
    444 #else
    445     LogFlowThisFuncEnter();
    446 
    447     CheckComArgOutPointerValid(aTimeout);
    448 
    449     AutoCaller autoCaller(this);
    450     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     416HRESULT GuestSession::getTimeout(ULONG *aTimeout)
     417{
     418#ifndef VBOX_WITH_GUEST_CONTROL
     419    ReturnComNotImplemented();
     420#else
     421    LogFlowThisFuncEnter();
    451422
    452423    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    459430}
    460431
    461 STDMETHODIMP GuestSession::COMSETTER(Timeout)(ULONG aTimeout)
    462 {
    463 #ifndef VBOX_WITH_GUEST_CONTROL
    464     ReturnComNotImplemented();
    465 #else
    466     LogFlowThisFuncEnter();
    467 
    468     AutoCaller autoCaller(this);
    469     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     432HRESULT GuestSession::setTimeout(ULONG aTimeout)
     433{
     434#ifndef VBOX_WITH_GUEST_CONTROL
     435    ReturnComNotImplemented();
     436#else
     437    LogFlowThisFuncEnter();
    470438
    471439    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    478446}
    479447
    480 STDMETHODIMP GuestSession::COMGETTER(ProtocolVersion)(ULONG *aVersion)
    481 {
    482 #ifndef VBOX_WITH_GUEST_CONTROL
    483     ReturnComNotImplemented();
    484 #else
    485     LogFlowThisFuncEnter();
    486 
    487     CheckComArgOutPointerValid(aVersion);
    488 
    489     AutoCaller autoCaller(this);
    490     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     448HRESULT GuestSession::getProtocolVersion(ULONG *aProtocolVersion)
     449{
     450#ifndef VBOX_WITH_GUEST_CONTROL
     451    ReturnComNotImplemented();
     452#else
     453    LogFlowThisFuncEnter();
    491454
    492455    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    493456
    494     *aVersion = mData.mProtocolVersion;
     457    *aProtocolVersion = mData.mProtocolVersion;
    495458
    496459    LogFlowThisFuncLeave();
     
    499462}
    500463
    501 STDMETHODIMP GuestSession::COMGETTER(Environment)(ComSafeArrayOut(BSTR, aEnvironment))
    502 {
    503 #ifndef VBOX_WITH_GUEST_CONTROL
    504     ReturnComNotImplemented();
    505 #else
    506     LogFlowThisFuncEnter();
    507 
    508     CheckComArgOutSafeArrayPointerValid(aEnvironment);
    509 
    510     AutoCaller autoCaller(this);
    511     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     464HRESULT GuestSession::getEnvironment(std::vector<com::Utf8Str> &aEnvironment)
     465{
     466#ifndef VBOX_WITH_GUEST_CONTROL
     467    ReturnComNotImplemented();
     468#else
     469    LogFlowThisFuncEnter();
    512470
    513471    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    516474    LogFlowThisFunc(("[%s]: cEnvVars=%RU32\n",
    517475                     mData.mSession.mName.c_str(), cEnvVars));
    518     com::SafeArray<BSTR> environment(cEnvVars);
    519476
    520477    for (size_t i = 0; i < cEnvVars; i++)
    521     {
    522         Bstr strEnv(mData.mEnvironment.Get(i));
    523         strEnv.cloneTo(&environment[i]);
    524     }
    525     environment.detachTo(ComSafeArrayOutArg(aEnvironment));
     478        aEnvironment[i] = mData.mEnvironment.Get(i);
    526479
    527480    LogFlowThisFuncLeave();
     
    530483}
    531484
    532 STDMETHODIMP GuestSession::COMSETTER(Environment)(ComSafeArrayIn(IN_BSTR, aValues))
    533 {
    534 #ifndef VBOX_WITH_GUEST_CONTROL
    535     ReturnComNotImplemented();
    536 #else
    537     LogFlowThisFuncEnter();
    538 
    539     AutoCaller autoCaller(this);
    540     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     485HRESULT GuestSession::setEnvironment(const std::vector<com::Utf8Str> &aEnvironment)
     486{
     487#ifndef VBOX_WITH_GUEST_CONTROL
     488    ReturnComNotImplemented();
     489#else
     490    LogFlowThisFuncEnter();
    541491
    542492    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    543493
    544     com::SafeArray<IN_BSTR> environment(ComSafeArrayInArg(aValues));
    545 
    546494    int rc = VINF_SUCCESS;
    547     for (size_t i = 0; i < environment.size() && RT_SUCCESS(rc); i++)
    548     {
    549         Utf8Str strEnv(environment[i]);
    550         if (!strEnv.isEmpty()) /* Silently skip empty entries. */
    551             rc = mData.mEnvironment.Set(strEnv);
    552     }
     495    for (size_t i = 0; i < aEnvironment.size() && RT_SUCCESS(rc); ++i)
     496        if (!aEnvironment[i].isEmpty()) /* Silently skip empty entries. */
     497            rc = mData.mEnvironment.Set(aEnvironment[i]);
    553498
    554499    HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
     
    558503}
    559504
    560 STDMETHODIMP GuestSession::COMGETTER(Processes)(ComSafeArrayOut(IGuestProcess *, aProcesses))
    561 {
    562 #ifndef VBOX_WITH_GUEST_CONTROL
    563     ReturnComNotImplemented();
    564 #else
    565     LogFlowThisFuncEnter();
    566 
    567     CheckComArgOutSafeArrayPointerValid(aProcesses);
    568 
    569     AutoCaller autoCaller(this);
    570     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     505HRESULT GuestSession::getProcesses(std::vector<ComPtr<IGuestProcess> > &aProcesses)
     506{
     507#ifndef VBOX_WITH_GUEST_CONTROL
     508    ReturnComNotImplemented();
     509#else
     510    LogFlowThisFuncEnter();
    571511
    572512    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    573 
    574     SafeIfaceArray<IGuestProcess> collection(mData.mProcesses);
    575     collection.detachTo(ComSafeArrayOutArg(aProcesses));
    576 
    577     LogFlowFunc(("mProcesses=%zu\n", collection.size()));
     513    aProcesses.resize(mData.mProcesses.size());
     514    size_t i = 0;
     515    for(SessionProcesses::iterator it = mData.mProcesses.begin(); it != mData.mProcesses.end(); ++it, ++i)
     516        it->second.queryInterfaceTo(aProcesses[i].asOutParam());
     517
     518    LogFlowFunc(("mProcesses=%zu\n", aProcesses.size()));
    578519    return S_OK;
    579520#endif /* VBOX_WITH_GUEST_CONTROL */
    580521}
    581522
    582 STDMETHODIMP GuestSession::COMGETTER(Directories)(ComSafeArrayOut(IGuestDirectory *, aDirectories))
    583 {
    584 #ifndef VBOX_WITH_GUEST_CONTROL
    585     ReturnComNotImplemented();
    586 #else
    587     LogFlowThisFuncEnter();
    588 
    589     CheckComArgOutSafeArrayPointerValid(aDirectories);
    590 
    591     AutoCaller autoCaller(this);
    592     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     523HRESULT GuestSession::getDirectories(std::vector<ComPtr<IGuestDirectory> > &aDirectories)
     524{
     525#ifndef VBOX_WITH_GUEST_CONTROL
     526    ReturnComNotImplemented();
     527#else
     528    LogFlowThisFuncEnter();
    593529
    594530    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    595 
    596     SafeIfaceArray<IGuestDirectory> collection(mData.mDirectories);
    597     collection.detachTo(ComSafeArrayOutArg(aDirectories));
    598 
    599     LogFlowFunc(("mDirectories=%zu\n", collection.size()));
     531    aDirectories.resize(mData.mDirectories.size());
     532    size_t i = 0;
     533    for(SessionDirectories::iterator it = mData.mDirectories.begin(); it != mData.mDirectories.end(); ++it, ++i)
     534        it->second.queryInterfaceTo(aDirectories[i].asOutParam());
     535
     536    LogFlowFunc(("mDirectories=%zu\n", aDirectories.size()));
    600537    return S_OK;
    601538#endif /* VBOX_WITH_GUEST_CONTROL */
    602539}
    603540
    604 STDMETHODIMP GuestSession::COMGETTER(Files)(ComSafeArrayOut(IGuestFile *, aFiles))
    605 {
    606 #ifndef VBOX_WITH_GUEST_CONTROL
    607     ReturnComNotImplemented();
    608 #else
    609     LogFlowThisFuncEnter();
    610 
    611     CheckComArgOutSafeArrayPointerValid(aFiles);
    612 
    613     AutoCaller autoCaller(this);
    614     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     541HRESULT GuestSession::getFiles(std::vector<ComPtr<IGuestFile> > &aFiles)
     542{
     543#ifndef VBOX_WITH_GUEST_CONTROL
     544    ReturnComNotImplemented();
     545#else
     546    LogFlowThisFuncEnter();
    615547
    616548    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    617549
    618     SafeIfaceArray<IGuestFile> collection(mData.mFiles);
    619     collection.detachTo(ComSafeArrayOutArg(aFiles));
    620 
    621     LogFlowFunc(("mFiles=%zu\n", collection.size()));
     550    aFiles.resize(mData.mFiles.size());
     551    size_t i = 0;
     552    for(SessionFiles::iterator it = mData.mFiles.begin(); it != mData.mFiles.end(); ++it, ++i)
     553        it->second.queryInterfaceTo(aFiles[i].asOutParam());
     554
     555    LogFlowFunc(("mDirectories=%zu\n", aFiles.size()));
     556
    622557    return S_OK;
    623558#endif /* VBOX_WITH_GUEST_CONTROL */
    624559}
    625560
    626 STDMETHODIMP GuestSession::COMGETTER(EventSource)(IEventSource ** aEventSource)
    627 {
    628 #ifndef VBOX_WITH_GUEST_CONTROL
    629     ReturnComNotImplemented();
    630 #else
    631     LogFlowThisFuncEnter();
    632 
    633     CheckComArgOutPointerValid(aEventSource);
    634 
    635     AutoCaller autoCaller(this);
    636     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     561HRESULT GuestSession::getEventSource(ComPtr<IEventSource> &aEventSource)
     562{
     563#ifndef VBOX_WITH_GUEST_CONTROL
     564    ReturnComNotImplemented();
     565#else
     566    LogFlowThisFuncEnter();
    637567
    638568    // no need to lock - lifetime constant
    639     mEventSource.queryInterfaceTo(aEventSource);
     569    mEventSource.queryInterfaceTo(aEventSource.asOutParam());
    640570
    641571    LogFlowThisFuncLeave();
     
    647577///////////////////////////////////////////////////////////////////////////////
    648578
    649 int GuestSession::closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *pGuestRc)
     579int GuestSession::i_closeSession(uint32_t uFlags, uint32_t uTimeoutMS, int *pGuestRc)
    650580{
    651581    LogFlowThisFunc(("uFlags=%x, uTimeoutMS=%RU32\n", uFlags, uTimeoutMS));
     
    699629    alock.release(); /* Drop the write lock before waiting. */
    700630
    701     vrc = sendCommand(HOST_SESSION_CLOSE, i, paParms);
     631    vrc = i_sendCommand(HOST_SESSION_CLOSE, i, paParms);
    702632    if (RT_SUCCESS(vrc))
    703         vrc = waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
     633        vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Terminate, uTimeoutMS,
    704634                                  NULL /* Session status */, pGuestRc);
    705635
     
    710640}
    711641
    712 int GuestSession::directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode,
     642int GuestSession::i_directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode,
    713643                                          uint32_t uFlags, int *pGuestRc)
    714644{
     
    759689}
    760690
    761 inline bool GuestSession::directoryExists(uint32_t uDirID, ComObjPtr<GuestDirectory> *pDir)
     691inline bool GuestSession::i_directoryExists(uint32_t uDirID, ComObjPtr<GuestDirectory> *pDir)
    762692{
    763693    SessionDirectories::const_iterator it = mData.mDirectories.find(uDirID);
     
    771701}
    772702
    773 int GuestSession::directoryQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc)
     703int GuestSession::i_directoryQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc)
    774704{
    775705    LogFlowThisFunc(("strPath=%s\n", strPath.c_str()));
    776706
    777     int vrc = fsQueryInfoInternal(strPath, objData, pGuestRc);
     707    int vrc = i_fsQueryInfoInternal(strPath, objData, pGuestRc);
    778708    if (RT_SUCCESS(vrc))
    779709    {
     
    786716}
    787717
    788 int GuestSession::directoryRemoveFromList(GuestDirectory *pDirectory)
     718int GuestSession::i_directoryRemoveFromList(GuestDirectory *pDirectory)
    789719{
    790720    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    825755}
    826756
    827 int GuestSession::directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags,
    828                                           int *pGuestRc)
     757int GuestSession::i_directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags,
     758                                            int *pGuestRc)
    829759{
    830760    AssertReturn(!(uFlags & ~DIRREMOVE_FLAG_VALID_MASK), VERR_INVALID_PARAMETER);
     
    850780    alock.release(); /* Drop write lock before sending. */
    851781
    852     vrc = sendCommand(HOST_DIR_REMOVE, i, paParms);
     782    vrc = i_sendCommand(HOST_DIR_REMOVE, i, paParms);
    853783    if (RT_SUCCESS(vrc))
    854784    {
     
    865795}
    866796
    867 int GuestSession::objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath,
    868                                            bool fDirectory, Utf8Str &strName, int *pGuestRc)
     797int GuestSession::i_objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath,
     798                                             bool fDirectory, Utf8Str &strName, int *pGuestRc)
    869799{
    870800    LogFlowThisFunc(("strTemplate=%s, strPath=%s, fDirectory=%RTbool\n",
     
    928858}
    929859
    930 int GuestSession::directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo,
    931                                         ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc)
     860int GuestSession::i_directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo,
     861                                          ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc)
    932862{
    933863    LogFlowThisFunc(("strPath=%s, strPath=%s, uFlags=%x\n",
     
    947877    {
    948878        /* Is the directory ID already used? */
    949         if (!directoryExists(uNewDirID, NULL /* pDirectory */))
     879        if (!i_directoryExists(uNewDirID, NULL /* pDirectory */))
    950880        {
    951881            /* Callback with context ID was not found. This means
     
    1016946}
    1017947
    1018 int GuestSession::dispatchToDirectory(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     948int GuestSession::i_dispatchToDirectory(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    1019949{
    1020950    LogFlowFunc(("pCtxCb=%p, pSvcCb=%p\n", pCtxCb, pSvcCb));
     
    1052982}
    1053983
    1054 int GuestSession::dispatchToFile(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     984int GuestSession::i_dispatchToFile(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    1055985{
    1056986    LogFlowFunc(("pCtxCb=%p, pSvcCb=%p\n", pCtxCb, pSvcCb));
     
    10851015}
    10861016
    1087 int GuestSession::dispatchToObject(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     1017int GuestSession::i_dispatchToObject(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    10881018{
    10891019    LogFlowFunc(("pCtxCb=%p, pSvcCb=%p\n", pCtxCb, pSvcCb));
     
    11081038            alock.release();
    11091039
    1110             rc = dispatchToFile(pCtxCb, pSvcCb);
     1040            rc = i_dispatchToFile(pCtxCb, pSvcCb);
    11111041        }
    11121042        else
     
    11171047                alock.release();
    11181048
    1119                 rc = dispatchToDirectory(pCtxCb, pSvcCb);
     1049                rc = i_dispatchToDirectory(pCtxCb, pSvcCb);
    11201050            }
    11211051            else
     
    11271057        alock.release();
    11281058
    1129         rc = dispatchToProcess(pCtxCb, pSvcCb);
     1059        rc = i_dispatchToProcess(pCtxCb, pSvcCb);
    11301060    }
    11311061
     
    11341064}
    11351065
    1136 int GuestSession::dispatchToProcess(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     1066int GuestSession::i_dispatchToProcess(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    11371067{
    11381068    LogFlowFunc(("pCtxCb=%p, pSvcCb=%p\n", pCtxCb, pSvcCb));
     
    11761106}
    11771107
    1178 int GuestSession::dispatchToThis(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     1108int GuestSession::i_dispatchToThis(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    11791109{
    11801110    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
     
    11981128        case GUEST_SESSION_NOTIFY: /* Guest Additions >= 4.3.0. */
    11991129        {
    1200             rc = onSessionStatusChange(pCbCtx, pSvcCb);
     1130            rc = i_onSessionStatusChange(pCbCtx, pSvcCb);
    12011131            break;
    12021132        }
     
    12121142}
    12131143
    1214 inline bool GuestSession::fileExists(uint32_t uFileID, ComObjPtr<GuestFile> *pFile)
     1144inline bool GuestSession::i_fileExists(uint32_t uFileID, ComObjPtr<GuestFile> *pFile)
    12151145{
    12161146    SessionFiles::const_iterator it = mData.mFiles.find(uFileID);
     
    12241154}
    12251155
    1226 int GuestSession::fileRemoveFromList(GuestFile *pFile)
     1156int GuestSession::i_fileRemoveFromList(GuestFile *pFile)
    12271157{
    12281158    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    12661196}
    12671197
    1268 int GuestSession::fileRemoveInternal(const Utf8Str &strPath, int *pGuestRc)
     1198int GuestSession::i_fileRemoveInternal(const Utf8Str &strPath, int *pGuestRc)
    12691199{
    12701200    LogFlowThisFunc(("strPath=%s\n", strPath.c_str()));
     
    12951225}
    12961226
    1297 int GuestSession::fileOpenInternal(const GuestFileOpenInfo &openInfo,
    1298                                    ComObjPtr<GuestFile> &pFile, int *pGuestRc)
     1227int GuestSession::i_fileOpenInternal(const GuestFileOpenInfo &openInfo,
     1228                                     ComObjPtr<GuestFile> &pFile, int *pGuestRc)
    12991229{
    13001230    LogFlowThisFunc(("strPath=%s, strOpenMode=%s, strDisposition=%s, uCreationMode=%x, uOffset=%RU64\n",
     
    13231253    {
    13241254        /* Is the file ID already used? */
    1325         if (!fileExists(uNewFileID, NULL /* pFile */))
     1255        if (!i_fileExists(uNewFileID, NULL /* pFile */))
    13261256        {
    13271257            /* Callback with context ID was not found. This means
     
    13971327}
    13981328
    1399 int GuestSession::fileQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc)
     1329int GuestSession::i_fileQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc)
    14001330{
    14011331    LogFlowThisFunc(("strPath=%s\n", strPath.c_str()));
    14021332
    1403     int vrc = fsQueryInfoInternal(strPath, objData, pGuestRc);
     1333    int vrc = i_fsQueryInfoInternal(strPath, objData, pGuestRc);
    14041334    if (RT_SUCCESS(vrc))
    14051335    {
     
    14121342}
    14131343
    1414 int GuestSession::fileQuerySizeInternal(const Utf8Str &strPath, int64_t *pllSize, int *pGuestRc)
     1344int GuestSession::i_fileQuerySizeInternal(const Utf8Str &strPath, int64_t *pllSize, int *pGuestRc)
    14151345{
    14161346    AssertPtrReturn(pllSize, VERR_INVALID_POINTER);
    14171347
    14181348    GuestFsObjData objData;
    1419     int vrc = fileQueryInfoInternal(strPath, objData, pGuestRc);
     1349    int vrc = i_fileQueryInfoInternal(strPath, objData, pGuestRc);
    14201350    if (RT_SUCCESS(vrc))
    14211351        *pllSize = objData.mObjectSize;
     
    14241354}
    14251355
    1426 int GuestSession::fsQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc)
     1356int GuestSession::i_fsQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc)
    14271357{
    14281358    LogFlowThisFunc(("strPath=%s\n", strPath.c_str()));
     
    14691399}
    14701400
    1471 const GuestCredentials& GuestSession::getCredentials(void)
     1401const GuestCredentials& GuestSession::i_getCredentials(void)
    14721402{
    14731403    return mData.mCredentials;
    14741404}
    14751405
    1476 const GuestEnvironment& GuestSession::getEnvironment(void)
     1406const GuestEnvironment& GuestSession::i_getEnvironment(void)
    14771407{
    14781408    return mData.mEnvironment;
    14791409}
    14801410
    1481 Utf8Str GuestSession::getName(void)
     1411Utf8Str GuestSession::i_getName(void)
    14821412{
    14831413    return mData.mSession.mName;
     
    14851415
    14861416/* static */
    1487 Utf8Str GuestSession::guestErrorToString(int guestRc)
     1417Utf8Str GuestSession::i_guestErrorToString(int guestRc)
    14881418{
    14891419    Utf8Str strError;
     
    15421472 * error when not ready.
    15431473 */
    1544 HRESULT GuestSession::isReadyExternal(void)
     1474HRESULT GuestSession::i_isReadyExternal(void)
    15451475{
    15461476    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    15571487 * the public session list.
    15581488 */
    1559 int GuestSession::onRemove(void)
     1489int GuestSession::i_onRemove(void)
    15601490{
    15611491    LogFlowThisFuncEnter();
     
    15821512
    15831513/** No locking! */
    1584 int GuestSession::onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
     1514int GuestSession::i_onSessionStatusChange(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCbData)
    15851515{
    15861516    AssertPtrReturn(pCbCtx, VERR_INVALID_POINTER);
     
    16461576    /* Set the session status. */
    16471577    if (RT_SUCCESS(vrc))
    1648         vrc = setSessionStatus(sessionStatus, guestRc);
     1578        vrc = i_setSessionStatus(sessionStatus, guestRc);
    16491579
    16501580    LogFlowThisFunc(("ID=%RU32, guestRc=%Rrc\n", mData.mSession.mID, guestRc));
     
    16541584}
    16551585
    1656 int GuestSession::startSessionInternal(int *pGuestRc)
     1586int GuestSession::i_startSessionInternal(int *pGuestRc)
    16571587{
    16581588    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    17151645    alock.release(); /* Drop write lock before sending. */
    17161646
    1717     vrc = sendCommand(HOST_SESSION_CREATE, i, paParms);
     1647    vrc = i_sendCommand(HOST_SESSION_CREATE, i, paParms);
    17181648    if (RT_SUCCESS(vrc))
    17191649    {
    1720         vrc = waitForStatusChange(pEvent, GuestSessionWaitForFlag_Start,
    1721                                   30 * 1000 /* 30s timeout */,
    1722                                   NULL /* Session status */, pGuestRc);
     1650        vrc = i_waitForStatusChange(pEvent, GuestSessionWaitForFlag_Start,
     1651                                    30 * 1000 /* 30s timeout */,
     1652                                    NULL /* Session status */, pGuestRc);
    17231653    }
    17241654    else
     
    17401670}
    17411671
    1742 int GuestSession::startSessionAsync(void)
     1672int GuestSession::i_startSessionAsync(void)
    17431673{
    17441674    LogFlowThisFuncEnter();
     
    17531683        AssertReturn(pTask->isOk(), pTask->rc());
    17541684
    1755         vrc = RTThreadCreate(NULL, GuestSession::startSessionThread,
     1685        vrc = RTThreadCreate(NULL, GuestSession::i_startSessionThread,
    17561686                             (void *)pTask.get(), 0,
    17571687                             RTTHREADTYPE_MAIN_WORKER, 0,
     
    17731703
    17741704/* static */
    1775 DECLCALLBACK(int) GuestSession::startSessionThread(RTTHREAD Thread, void *pvUser)
     1705DECLCALLBACK(int) GuestSession::i_startSessionThread(RTTHREAD Thread, void *pvUser)
    17761706{
    17771707    LogFlowFunc(("pvUser=%p\n", pvUser));
     
    17861716    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    17871717
    1788     int vrc = pSession->startSessionInternal(NULL /* Guest rc, ignored */);
     1718    int vrc = pSession->i_startSessionInternal(NULL /* Guest rc, ignored */);
    17891719    /* Nothing to do here anymore. */
    17901720
     
    17931723}
    17941724
    1795 int GuestSession::pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest,
     1725int GuestSession::i_pathRenameInternal(const Utf8Str &strSource, const Utf8Str &strDest,
    17961726                                     uint32_t uFlags, int *pGuestRc)
    17971727{
     
    18211751    alock.release(); /* Drop write lock before sending. */
    18221752
    1823     vrc = sendCommand(HOST_PATH_RENAME, i, paParms);
     1753    vrc = i_sendCommand(HOST_PATH_RENAME, i, paParms);
    18241754    if (RT_SUCCESS(vrc))
    18251755    {
     
    18361766}
    18371767
    1838 int GuestSession::processRemoveFromList(GuestProcess *pProcess)
     1768int GuestSession::i_processRemoveFromList(GuestProcess *pProcess)
    18391769{
    18401770    AssertPtrReturn(pProcess, VERR_INVALID_POINTER);
     
    19021832 * @param   pProcess
    19031833 */
    1904 int GuestSession::processCreateExInteral(GuestProcessStartupInfo &procInfo, ComObjPtr<GuestProcess> &pProcess)
     1834int GuestSession::i_processCreateExInteral(GuestProcessStartupInfo &procInfo, ComObjPtr<GuestProcess> &pProcess)
    19051835{
    19061836    LogFlowFunc(("mCmd=%s, mFlags=%x, mTimeoutMS=%RU32\n",
     
    19631893    {
    19641894        /* Is the context ID already used? */
    1965         if (!processExists(uNewProcessID, NULL /* pProcess */))
     1895        if (!i_processExists(uNewProcessID, NULL /* pProcess */))
    19661896        {
    19671897            /* Callback with context ID was not found. This means
     
    20151945}
    20161946
    2017 inline bool GuestSession::processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess)
     1947inline bool GuestSession::i_processExists(uint32_t uProcessID, ComObjPtr<GuestProcess> *pProcess)
    20181948{
    20191949    SessionProcesses::const_iterator it = mData.mProcesses.find(uProcessID);
     
    20271957}
    20281958
    2029 inline int GuestSession::processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess)
     1959inline int GuestSession::i_processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess)
    20301960{
    20311961    AssertReturn(uPID, false);
     
    20551985}
    20561986
    2057 int GuestSession::sendCommand(uint32_t uFunction,
    2058                               uint32_t uParms, PVBOXHGCMSVCPARM paParms)
     1987int GuestSession::i_sendCommand(uint32_t uFunction,
     1988                                uint32_t uParms, PVBOXHGCMSVCPARM paParms)
    20591989{
    20601990    LogFlowThisFuncEnter();
     
    20832013
    20842014/* static */
    2085 HRESULT GuestSession::setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
     2015HRESULT GuestSession::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
    20862016{
    20872017    AssertPtr(pInterface);
    20882018    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
    20892019
    2090     return pInterface->setError(VBOX_E_IPRT_ERROR, GuestSession::guestErrorToString(guestRc).c_str());
     2020    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestSession::i_guestErrorToString(guestRc).c_str());
    20912021}
    20922022
    20932023/* Does not do locking; caller is responsible for that! */
    2094 int GuestSession::setSessionStatus(GuestSessionStatus_T sessionStatus, int sessionRc)
     2024int GuestSession::i_setSessionStatus(GuestSessionStatus_T sessionStatus, int sessionRc)
    20952025{
    20962026    LogFlowThisFunc(("oldStatus=%RU32, newStatus=%RU32, sessionRc=%Rrc\n",
     
    21172047        int rc2 = errorInfo->initEx(VBOX_E_IPRT_ERROR, sessionRc,
    21182048                                    COM_IIDOF(IGuestSession), getComponentName(),
    2119                                     guestErrorToString(sessionRc));
     2049                                    i_guestErrorToString(sessionRc));
    21202050        AssertRC(rc2);
    21212051
     
    21272057}
    21282058
    2129 int GuestSession::signalWaiters(GuestSessionWaitResult_T enmWaitResult, int rc /*= VINF_SUCCESS */)
     2059int GuestSession::i_signalWaiters(GuestSessionWaitResult_T enmWaitResult, int rc /*= VINF_SUCCESS */)
    21302060{
    21312061    /*LogFlowThisFunc(("enmWaitResult=%d, rc=%Rrc, mWaitCount=%RU32, mWaitEvent=%p\n",
     
    21412071}
    21422072
    2143 int GuestSession::startTaskAsync(const Utf8Str &strTaskDesc,
    2144                                  GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress)
     2073int GuestSession::i_startTaskAsync(const Utf8Str &strTaskDesc,
     2074                                   GuestSessionTask *pTask, ComObjPtr<Progress> &pProgress)
    21452075{
    21462076    LogFlowThisFunc(("strTaskDesc=%s, pTask=%p\n", strTaskDesc.c_str(), pTask));
     
    21802110 * @return  IPRT status code.
    21812111 */
    2182 int GuestSession::queryInfo(void)
     2112int GuestSession::i_queryInfo(void)
    21832113{
    21842114    /*
     
    22202150}
    22212151
    2222 int GuestSession::waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc)
     2152int GuestSession::i_waitFor(uint32_t fWaitFlags, ULONG uTimeoutMS, GuestSessionWaitResult_T &waitResult, int *pGuestRc)
    22232153{
    22242154    LogFlowThisFuncEnter();
     
    23472277
    23482278    GuestSessionStatus_T sessionStatus;
    2349     vrc = waitForStatusChange(pEvent, fWaitFlags,
    2350                               uTimeoutMS, &sessionStatus, pGuestRc);
     2279    vrc = i_waitForStatusChange(pEvent, fWaitFlags,
     2280                                uTimeoutMS, &sessionStatus, pGuestRc);
    23512281    if (RT_SUCCESS(vrc))
    23522282    {
     
    23862316}
    23872317
    2388 int GuestSession::waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS,
    2389                                       GuestSessionStatus_T *pSessionStatus, int *pGuestRc)
     2318int GuestSession::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t fWaitFlags, uint32_t uTimeoutMS,
     2319                                        GuestSessionStatus_T *pSessionStatus, int *pGuestRc)
    23902320{
    23912321    AssertPtrReturn(pEvent, VERR_INVALID_POINTER);
     
    24312361/////////////////////////////////////////////////////////////////////////////
    24322362
    2433 STDMETHODIMP GuestSession::Close(void)
     2363STDMETHODIMP GuestSession::close(void)
    24342364{
    24352365#ifndef VBOX_WITH_GUEST_CONTROL
     
    24432373    /* Close session on guest. */
    24442374    int guestRc = VINF_SUCCESS;
    2445     int rc = closeSession(0 /* Flags */, 30 * 1000 /* Timeout */,
    2446                           &guestRc);
     2375    int rc = i_closeSession(0 /* Flags */, 30 * 1000 /* Timeout */,
     2376                            &guestRc);
    24472377    /* On failure don't return here, instead do all the cleanup
    24482378     * work first and then return an error. */
     
    24612391    {
    24622392        if (rc == VERR_GSTCTL_GUEST_ERROR)
    2463             return GuestSession::setErrorExternal(this, guestRc);
     2393            return GuestSession::i_setErrorExternal(this, guestRc);
    24642394
    24652395        return setError(VBOX_E_IPRT_ERROR,
     
    24712401}
    24722402
    2473 STDMETHODIMP GuestSession::CopyFrom(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(CopyFileFlag_T, aFlags), IProgress **aProgress)
    2474 {
    2475 #ifndef VBOX_WITH_GUEST_CONTROL
    2476     ReturnComNotImplemented();
    2477 #else
    2478     CheckComArgStrNotEmptyOrNull(aSource);
    2479     CheckComArgStrNotEmptyOrNull(aDest);
    2480     CheckComArgOutPointerValid(aProgress);
    2481 
    2482     LogFlowThisFuncEnter();
    2483 
    2484     if (RT_UNLIKELY((aSource) == NULL || *(aSource) == '\0'))
     2403HRESULT GuestSession::copyFrom(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<CopyFileFlag_T> &aFlags, ComPtr<IProgress> &aProgress)
     2404{
     2405#ifndef VBOX_WITH_GUEST_CONTROL
     2406    ReturnComNotImplemented();
     2407#else
     2408
     2409    LogFlowThisFuncEnter();
     2410
     2411    if (RT_UNLIKELY((aSource.c_str()) == NULL || *(aSource.c_str()) == '\0'))
    24852412        return setError(E_INVALIDARG, tr("No source specified"));
    2486     if (RT_UNLIKELY((aDest) == NULL || *(aDest) == '\0'))
     2413    if (RT_UNLIKELY((aDest.c_str()) == NULL || *(aDest.c_str()) == '\0'))
    24872414        return setError(E_INVALIDARG, tr("No destination specified"));
    24882415
    2489     AutoCaller autoCaller(this);
    2490     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2491 
    24922416    uint32_t fFlags = CopyFileFlag_None;
    2493     if (aFlags)
    2494     {
    2495         com::SafeArray<CopyFileFlag_T> flags(ComSafeArrayInArg(aFlags));
    2496         for (size_t i = 0; i < flags.size(); i++)
    2497             fFlags |= flags[i];
     2417    if (aFlags.size())
     2418    {
     2419        for (size_t i = 0; i < aFlags.size(); i++)
     2420            fFlags |= aFlags[i];
    24982421    }
    24992422
     
    25062429        ComObjPtr<Progress> pProgress;
    25072430        SessionTaskCopyFrom *pTask = new SessionTaskCopyFrom(this /* GuestSession */,
    2508                                                              Utf8Str(aSource), Utf8Str(aDest), fFlags);
    2509         int rc = startTaskAsync(Utf8StrFmt(tr("Copying \"%ls\" from guest to \"%ls\" on the host"), aSource, aDest),
     2431                                                             aSource, aDest, fFlags);
     2432        int rc = i_startTaskAsync(Utf8StrFmt(tr("Copying \"%s\" from guest to \"%s\" on the host"), aSource.c_str(), aDest.c_str()),
    25102433                                pTask, pProgress);
    25112434        if (RT_SUCCESS(rc))
    2512         {
    25132435            /* Return progress to the caller. */
    2514             hr = pProgress.queryInterfaceTo(aProgress);
    2515         }
     2436            hr = pProgress.queryInterfaceTo(aProgress.asOutParam());
    25162437        else
    25172438            hr = setError(VBOX_E_IPRT_ERROR,
    2518                           tr("Starting task for copying file \"%ls\" from guest to \"%ls\" on the host failed: %Rrc"), rc);
     2439                          tr("Starting task for copying file \"%s\" from guest to \"%s\" on the host failed: %Rrc"), rc);
    25192440    }
    25202441    catch(std::bad_alloc &)
     
    25272448}
    25282449
    2529 STDMETHODIMP GuestSession::CopyTo(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(CopyFileFlag_T, aFlags), IProgress **aProgress)
    2530 {
    2531 #ifndef VBOX_WITH_GUEST_CONTROL
    2532     ReturnComNotImplemented();
    2533 #else
    2534     CheckComArgStrNotEmptyOrNull(aSource);
    2535     CheckComArgStrNotEmptyOrNull(aDest);
    2536     CheckComArgOutPointerValid(aProgress);
    2537 
    2538     LogFlowThisFuncEnter();
    2539 
    2540     if (RT_UNLIKELY((aSource) == NULL || *(aSource) == '\0'))
     2450HRESULT GuestSession::copyTo(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<CopyFileFlag_T> &aFlags, ComPtr<IProgress> &aProgress)
     2451{
     2452#ifndef VBOX_WITH_GUEST_CONTROL
     2453    ReturnComNotImplemented();
     2454#else
     2455
     2456    LogFlowThisFuncEnter();
     2457
     2458    if (RT_UNLIKELY((aSource.c_str()) == NULL || *(aSource.c_str()) == '\0'))
    25412459        return setError(E_INVALIDARG, tr("No source specified"));
    2542     if (RT_UNLIKELY((aDest) == NULL || *(aDest) == '\0'))
     2460    if (RT_UNLIKELY((aDest.c_str()) == NULL || *(aDest.c_str()) == '\0'))
    25432461        return setError(E_INVALIDARG, tr("No destination specified"));
    25442462
    2545     AutoCaller autoCaller(this);
    2546     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2547 
    25482463    uint32_t fFlags = CopyFileFlag_None;
    2549     if (aFlags)
    2550     {
    2551         com::SafeArray<CopyFileFlag_T> flags(ComSafeArrayInArg(aFlags));
    2552         for (size_t i = 0; i < flags.size(); i++)
    2553             fFlags |= flags[i];
     2464    if (aFlags.size())
     2465    {
     2466        for (size_t i = 0; i < aFlags.size(); i++)
     2467            fFlags |= aFlags[i];
    25542468    }
    25552469
     
    25622476        ComObjPtr<Progress> pProgress;
    25632477        SessionTaskCopyTo *pTask = new SessionTaskCopyTo(this /* GuestSession */,
    2564                                                          Utf8Str(aSource), Utf8Str(aDest), fFlags);
     2478                                                         aSource, aDest, fFlags);
    25652479        AssertPtrReturn(pTask, E_OUTOFMEMORY);
    2566         int rc = startTaskAsync(Utf8StrFmt(tr("Copying \"%ls\" from host to \"%ls\" on the guest"), aSource, aDest),
     2480        int rc = i_startTaskAsync(Utf8StrFmt(tr("Copying \"%s\" from host to \"%s\" on the guest"), aSource.c_str(), aDest.c_str()),
    25672481                                pTask, pProgress);
    25682482        if (RT_SUCCESS(rc))
    25692483        {
    25702484            /* Return progress to the caller. */
    2571             hr = pProgress.queryInterfaceTo(aProgress);
     2485            hr = pProgress.queryInterfaceTo(aProgress.asOutParam());
    25722486        }
    25732487        else
    25742488            hr = setError(VBOX_E_IPRT_ERROR,
    2575                           tr("Starting task for copying file \"%ls\" from host to \"%ls\" on the guest failed: %Rrc"), rc);
     2489                          tr("Starting task for copying file \"%s\" from host to \"%s\" on the guest failed: %Rrc"), rc);
    25762490    }
    25772491    catch(std::bad_alloc &)
     
    25842498}
    25852499
    2586 STDMETHODIMP GuestSession::DirectoryCreate(IN_BSTR aPath, ULONG aMode,
    2587                                            ComSafeArrayIn(DirectoryCreateFlag_T, aFlags))
    2588 {
    2589 #ifndef VBOX_WITH_GUEST_CONTROL
    2590     ReturnComNotImplemented();
    2591 #else
    2592     LogFlowThisFuncEnter();
    2593 
    2594     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2500HRESULT GuestSession::directoryCreate(const com::Utf8Str &aPath, ULONG aMode,
     2501                                      const std::vector<DirectoryCreateFlag_T> &aFlags)
     2502{
     2503#ifndef VBOX_WITH_GUEST_CONTROL
     2504    ReturnComNotImplemented();
     2505#else
     2506    LogFlowThisFuncEnter();
     2507
     2508    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    25952509        return setError(E_INVALIDARG, tr("No directory to create specified"));
    25962510
    2597     AutoCaller autoCaller(this);
    2598     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2599 
    26002511    uint32_t fFlags = DirectoryCreateFlag_None;
    2601     if (aFlags)
    2602     {
    2603         com::SafeArray<DirectoryCreateFlag_T> flags(ComSafeArrayInArg(aFlags));
    2604         for (size_t i = 0; i < flags.size(); i++)
    2605             fFlags |= flags[i];
     2512    if (aFlags.size())
     2513    {
     2514        for (size_t i = 0; i < aFlags.size(); i++)
     2515            fFlags |= aFlags[i];
    26062516
    26072517        if (fFlags)
    2608         {
    26092518            if (!(fFlags & DirectoryCreateFlag_Parents))
    26102519                return setError(E_INVALIDARG, tr("Unknown flags (%#x)"), fFlags);
    2611         }
    26122520    }
    26132521
     
    26152523
    26162524    ComObjPtr <GuestDirectory> pDirectory; int guestRc;
    2617     int rc = directoryCreateInternal(Utf8Str(aPath), (uint32_t)aMode, fFlags, &guestRc);
     2525    int rc = i_directoryCreateInternal(aPath, (uint32_t)aMode, fFlags, &guestRc);
    26182526    if (RT_FAILURE(rc))
    26192527    {
     
    26432551}
    26442552
    2645 STDMETHODIMP GuestSession::DirectoryCreateTemp(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aPath, BOOL aSecure, BSTR *aDirectory)
    2646 {
    2647 #ifndef VBOX_WITH_GUEST_CONTROL
    2648     ReturnComNotImplemented();
    2649 #else
    2650     LogFlowThisFuncEnter();
    2651 
    2652     if (RT_UNLIKELY((aTemplate) == NULL || *(aTemplate) == '\0'))
     2553HRESULT GuestSession::directoryCreateTemp(const com::Utf8Str &aTemplateName, ULONG aMode, const com::Utf8Str &aPath, BOOL aSecure, com::Utf8Str &aDirectory)
     2554{
     2555#ifndef VBOX_WITH_GUEST_CONTROL
     2556    ReturnComNotImplemented();
     2557#else
     2558    LogFlowThisFuncEnter();
     2559
     2560    if (RT_UNLIKELY((aTemplateName.c_str()) == NULL || *(aTemplateName.c_str()) == '\0'))
    26532561        return setError(E_INVALIDARG, tr("No template specified"));
    2654     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2562    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    26552563        return setError(E_INVALIDARG, tr("No directory name specified"));
    2656     CheckComArgOutPointerValid(aDirectory);
    2657 
    2658     AutoCaller autoCaller(this);
    2659     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    26602564
    26612565    HRESULT hr = S_OK;
    26622566
    2663     Utf8Str strName; int guestRc;
    2664     int rc = objectCreateTempInternal(Utf8Str(aTemplate),
    2665                                       Utf8Str(aPath),
    2666                                       true /* Directory */, strName, &guestRc);
    2667     if (RT_SUCCESS(rc))
    2668     {
    2669         strName.cloneTo(aDirectory);
    2670     }
    2671     else
     2567    int guestRc;
     2568    int rc = i_objectCreateTempInternal(aTemplateName,
     2569                                        aPath,
     2570                                        true /* Directory */, aDirectory, &guestRc);
     2571    if (!RT_SUCCESS(rc))
    26722572    {
    26732573        switch (rc)
     
    26792579            default:
    26802580               hr = setError(VBOX_E_IPRT_ERROR, tr("Temporary directory creation \"%s\" with template \"%s\" failed: %Rrc"),
    2681                              Utf8Str(aPath).c_str(), Utf8Str(aTemplate).c_str(), rc);
     2581                             aPath.c_str(), aTemplateName.c_str(), rc);
    26822582               break;
    26832583        }
     
    26882588}
    26892589
    2690 STDMETHODIMP GuestSession::DirectoryExists(IN_BSTR aPath, BOOL *aExists)
    2691 {
    2692 #ifndef VBOX_WITH_GUEST_CONTROL
    2693     ReturnComNotImplemented();
    2694 #else
    2695     LogFlowThisFuncEnter();
    2696 
    2697     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2590HRESULT GuestSession::directoryExists(const com::Utf8Str &aPath, BOOL *aExists)
     2591{
     2592#ifndef VBOX_WITH_GUEST_CONTROL
     2593    ReturnComNotImplemented();
     2594#else
     2595    LogFlowThisFuncEnter();
     2596
     2597    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    26982598        return setError(E_INVALIDARG, tr("No directory to check existence for specified"));
    2699     CheckComArgOutPointerValid(aExists);
    2700 
    2701     AutoCaller autoCaller(this);
    2702     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    27032599
    27042600    HRESULT hr = S_OK;
    27052601
    27062602    GuestFsObjData objData; int guestRc;
    2707     int rc = directoryQueryInfoInternal(Utf8Str(aPath), objData, &guestRc);
     2603    int rc = i_directoryQueryInfoInternal(aPath, objData, &guestRc);
    27082604    if (RT_SUCCESS(rc))
    2709     {
    27102605        *aExists = objData.mType == FsObjType_Directory;
    2711     }
    27122606    else
    27132607    {
     
    27202614            default:
    27212615               hr = setError(VBOX_E_IPRT_ERROR, tr("Querying directory existence \"%s\" failed: %Rrc"),
    2722                              Utf8Str(aPath).c_str(), rc);
     2616                             aPath.c_str(), rc);
    27232617               break;
    27242618        }
     
    27292623}
    27302624
    2731 STDMETHODIMP GuestSession::DirectoryOpen(IN_BSTR aPath, IN_BSTR aFilter, ComSafeArrayIn(DirectoryOpenFlag_T, aFlags), IGuestDirectory **aDirectory)
    2732 {
    2733 #ifndef VBOX_WITH_GUEST_CONTROL
    2734     ReturnComNotImplemented();
    2735 #else
    2736     LogFlowThisFuncEnter();
    2737 
    2738     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2625HRESULT GuestSession::directoryOpen(const com::Utf8Str &aPath, const com::Utf8Str &aFilter, const std::vector<DirectoryOpenFlag_T> &aFlags, ComPtr<IGuestDirectory> &aDirectory)
     2626{
     2627#ifndef VBOX_WITH_GUEST_CONTROL
     2628    ReturnComNotImplemented();
     2629#else
     2630    LogFlowThisFuncEnter();
     2631
     2632    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    27392633        return setError(E_INVALIDARG, tr("No directory to open specified"));
    2740     if (RT_UNLIKELY((aFilter) != NULL && *(aFilter) != '\0'))
     2634    if (RT_UNLIKELY((aFilter.c_str()) != NULL && *(aFilter.c_str()) != '\0'))
    27412635        return setError(E_INVALIDARG, tr("Directory filters are not implemented yet"));
    2742     CheckComArgOutPointerValid(aDirectory);
    2743 
    2744     AutoCaller autoCaller(this);
    2745     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    27462636
    27472637    uint32_t fFlags = DirectoryOpenFlag_None;
    2748     if (aFlags)
    2749     {
    2750         com::SafeArray<DirectoryOpenFlag_T> flags(ComSafeArrayInArg(aFlags));
    2751         for (size_t i = 0; i < flags.size(); i++)
    2752             fFlags |= flags[i];
     2638    if (aFlags.size())
     2639    {
     2640        for (size_t i = 0; i < aFlags.size(); i++)
     2641            fFlags |= aFlags[i];
    27532642
    27542643        if (fFlags)
     
    27592648
    27602649    GuestDirectoryOpenInfo openInfo;
    2761     openInfo.mPath = Utf8Str(aPath);
    2762     openInfo.mFilter = Utf8Str(aFilter);
     2650    openInfo.mPath = aPath;
     2651    openInfo.mFilter = aFilter;
    27632652    openInfo.mFlags = fFlags;
    27642653
    27652654    ComObjPtr <GuestDirectory> pDirectory; int guestRc;
    2766     int rc = directoryOpenInternal(openInfo, pDirectory, &guestRc);
     2655    int rc = i_directoryOpenInternal(openInfo, pDirectory, &guestRc);
    27672656    if (RT_SUCCESS(rc))
    27682657    {
    27692658        /* Return directory object to the caller. */
    2770         hr = pDirectory.queryInterfaceTo(aDirectory);
     2659        hr = pDirectory.queryInterfaceTo(aDirectory.asOutParam());
    27712660    }
    27722661    else
     
    27762665            case VERR_INVALID_PARAMETER:
    27772666               hr = setError(VBOX_E_IPRT_ERROR, tr("Opening directory \"%s\" failed; invalid parameters given",
    2778                                                    Utf8Str(aPath).c_str()));
     2667                                                   aPath.c_str()));
    27792668               break;
    27802669
     
    27852674            default:
    27862675               hr = setError(VBOX_E_IPRT_ERROR, tr("Opening directory \"%s\" failed: %Rrc"),
    2787                              Utf8Str(aPath).c_str(),rc);
     2676                             aPath.c_str(),rc);
    27882677               break;
    27892678        }
     
    27942683}
    27952684
    2796 STDMETHODIMP GuestSession::DirectoryQueryInfo(IN_BSTR aPath, IGuestFsObjInfo **aInfo)
    2797 {
    2798 #ifndef VBOX_WITH_GUEST_CONTROL
    2799     ReturnComNotImplemented();
    2800 #else
    2801     LogFlowThisFuncEnter();
    2802 
    2803     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2685HRESULT GuestSession::directoryQueryInfo(const com::Utf8Str &aPath, ComPtr<IGuestFsObjInfo> &aInfo)
     2686{
     2687#ifndef VBOX_WITH_GUEST_CONTROL
     2688    ReturnComNotImplemented();
     2689#else
     2690    LogFlowThisFuncEnter();
     2691
     2692    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    28042693        return setError(E_INVALIDARG, tr("No directory to query information for specified"));
    2805     CheckComArgOutPointerValid(aInfo);
    2806 
    2807     AutoCaller autoCaller(this);
    2808     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    28092694
    28102695    HRESULT hr = S_OK;
    28112696
    28122697    GuestFsObjData objData; int guestRc;
    2813     int vrc = directoryQueryInfoInternal(Utf8Str(aPath), objData, &guestRc);
     2698    int vrc = i_directoryQueryInfoInternal(aPath, objData, &guestRc);
    28142699    if (RT_SUCCESS(vrc))
    28152700    {
     
    28232708            if (RT_SUCCESS(vrc))
    28242709            {
    2825                 hr = pFsObjInfo.queryInterfaceTo(aInfo);
     2710                hr = pFsObjInfo.queryInterfaceTo(aInfo.asOutParam());
    28262711                if (FAILED(hr)) return hr;
    28272712            }
     
    28392724            case VERR_NOT_A_DIRECTORY:
    28402725                hr = setError(VBOX_E_IPRT_ERROR, tr("Element \"%s\" exists but is not a directory",
    2841                                                     Utf8Str(aPath).c_str()));
     2726                                                    aPath.c_str()));
    28422727                break;
    28432728
    28442729            default:
    28452730                hr = setError(VBOX_E_IPRT_ERROR, tr("Querying directory information for \"%s\" failed: %Rrc"),
    2846                               Utf8Str(aPath).c_str(), vrc);
     2731                              aPath.c_str(), vrc);
    28472732                break;
    28482733        }
     
    28532738}
    28542739
    2855 STDMETHODIMP GuestSession::DirectoryRemove(IN_BSTR aPath)
    2856 {
    2857 #ifndef VBOX_WITH_GUEST_CONTROL
    2858     ReturnComNotImplemented();
    2859 #else
    2860     LogFlowThisFuncEnter();
    2861 
    2862     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2740HRESULT GuestSession::directoryRemove(const com::Utf8Str &aPath)
     2741{
     2742#ifndef VBOX_WITH_GUEST_CONTROL
     2743    ReturnComNotImplemented();
     2744#else
     2745    LogFlowThisFuncEnter();
     2746
     2747    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    28632748        return setError(E_INVALIDARG, tr("No directory to remove specified"));
    28642749
    2865     AutoCaller autoCaller(this);
    2866     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2867 
    2868     HRESULT hr = isReadyExternal();
     2750    HRESULT hr = i_isReadyExternal();
    28692751    if (FAILED(hr))
    28702752        return hr;
     
    28742756
    28752757    int guestRc;
    2876     int vrc = directoryRemoveInternal(Utf8Str(aPath), uFlags, &guestRc);
     2758    int vrc = i_directoryRemoveInternal(aPath, uFlags, &guestRc);
    28772759    if (RT_FAILURE(vrc))
    28782760    {
     
    28902772            default:
    28912773                hr = setError(VBOX_E_IPRT_ERROR, tr("Removing guest directory \"%s\" failed: %Rrc"),
    2892                               Utf8Str(aPath).c_str(), vrc);
     2774                              aPath.c_str(), vrc);
    28932775                break;
    28942776        }
     
    28992781}
    29002782
    2901 STDMETHODIMP GuestSession::DirectoryRemoveRecursive(IN_BSTR aPath, ComSafeArrayIn(DirectoryRemoveRecFlag_T, aFlags), IProgress **aProgress)
    2902 {
    2903 #ifndef VBOX_WITH_GUEST_CONTROL
    2904     ReturnComNotImplemented();
    2905 #else
    2906     LogFlowThisFuncEnter();
    2907 
    2908     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2783HRESULT GuestSession::directoryRemoveRecursive(const com::Utf8Str &aPath, const std::vector<DirectoryRemoveRecFlag_T> &aFlags, ComPtr<IProgress> &aProgress)
     2784{
     2785#ifndef VBOX_WITH_GUEST_CONTROL
     2786    ReturnComNotImplemented();
     2787#else
     2788    LogFlowThisFuncEnter();
     2789
     2790    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    29092791        return setError(E_INVALIDARG, tr("No directory to remove recursively specified"));
    29102792
    2911     AutoCaller autoCaller(this);
    2912     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2913 
    2914     HRESULT hr = isReadyExternal();
     2793    HRESULT hr = i_isReadyExternal();
    29152794    if (FAILED(hr))
    29162795        return hr;
     
    29372816                    | DIRREMOVE_FLAG_CONTENT_AND_DIR;
    29382817    int guestRc;
    2939     int vrc = directoryRemoveInternal(Utf8Str(aPath), uFlags, &guestRc);
     2818    int vrc = i_directoryRemoveInternal(aPath, uFlags, &guestRc);
    29402819    if (RT_FAILURE(vrc))
    29412820    {
     
    29532832            default:
    29542833                hr = setError(VBOX_E_IPRT_ERROR, tr("Recursively removing guest directory \"%s\" failed: %Rrc"),
    2955                               Utf8Str(aPath).c_str(), vrc);
     2834                              aPath.c_str(), vrc);
    29562835                break;
    29572836        }
     
    29592838    else
    29602839    {
    2961         pProgress.queryInterfaceTo(aProgress);
     2840        pProgress.queryInterfaceTo(aProgress.asOutParam());
    29622841    }
    29632842
     
    29662845}
    29672846
    2968 STDMETHODIMP GuestSession::DirectoryRename(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(PathRenameFlag_T, aFlags))
    2969 {
    2970 #ifndef VBOX_WITH_GUEST_CONTROL
    2971     ReturnComNotImplemented();
    2972 #else
    2973     LogFlowThisFuncEnter();
    2974 
    2975     if (RT_UNLIKELY((aSource) == NULL || *(aSource) == '\0'))
     2847HRESULT GuestSession::directoryRename(const com::Utf8Str &aSource,
     2848                                      const com::Utf8Str &aDest,
     2849                                      const std::vector<PathRenameFlag_T> &aFlags)
     2850{
     2851#ifndef VBOX_WITH_GUEST_CONTROL
     2852    ReturnComNotImplemented();
     2853#else
     2854    LogFlowThisFuncEnter();
     2855
     2856    if (RT_UNLIKELY((aSource.c_str()) == NULL || *(aSource.c_str()) == '\0'))
    29762857        return setError(E_INVALIDARG, tr("No source directory to rename specified"));
    29772858
    2978     if (RT_UNLIKELY((aDest) == NULL || *(aDest) == '\0'))
     2859    if (RT_UNLIKELY((aDest.c_str()) == NULL || *(aDest.c_str()) == '\0'))
    29792860        return setError(E_INVALIDARG, tr("No destination directory to rename the source to specified"));
    29802861
    2981     AutoCaller autoCaller(this);
    2982     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    2983 
    2984     HRESULT hr = isReadyExternal();
     2862    HRESULT hr = i_isReadyExternal();
    29852863    if (FAILED(hr))
    29862864        return hr;
     
    29902868
    29912869    int guestRc;
    2992     int vrc = pathRenameInternal(Utf8Str(aSource), Utf8Str(aDest), uFlags, &guestRc);
     2870    int vrc = i_pathRenameInternal(aSource, aDest, uFlags, &guestRc);
    29932871    if (RT_FAILURE(vrc))
    29942872    {
     
    30072885            default:
    30082886                hr = setError(VBOX_E_IPRT_ERROR, tr("Renaming guest directory \"%s\" failed: %Rrc"),
    3009                               Utf8Str(aSource).c_str(), vrc);
     2887                              aSource.c_str(), vrc);
    30102888                break;
    30112889        }
     
    30162894}
    30172895
    3018 STDMETHODIMP GuestSession::DirectorySetACL(IN_BSTR aPath, IN_BSTR aACL)
    3019 {
    3020 #ifndef VBOX_WITH_GUEST_CONTROL
    3021     ReturnComNotImplemented();
    3022 #else
    3023     LogFlowThisFuncEnter();
    3024 
    3025     AutoCaller autoCaller(this);
    3026     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3027 
    3028     ReturnComNotImplemented();
    3029 #endif /* VBOX_WITH_GUEST_CONTROL */
    3030 }
    3031 
    3032 STDMETHODIMP GuestSession::EnvironmentClear(void)
    3033 {
    3034 #ifndef VBOX_WITH_GUEST_CONTROL
    3035     ReturnComNotImplemented();
    3036 #else
    3037     LogFlowThisFuncEnter();
    3038 
    3039     AutoCaller autoCaller(this);
    3040     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     2896HRESULT GuestSession::directorySetACL(const com::Utf8Str &aPath, const com::Utf8Str &aAcl)
     2897{
     2898#ifndef VBOX_WITH_GUEST_CONTROL
     2899    ReturnComNotImplemented();
     2900#else
     2901    LogFlowThisFuncEnter();
     2902
     2903    ReturnComNotImplemented();
     2904#endif /* VBOX_WITH_GUEST_CONTROL */
     2905}
     2906
     2907HRESULT GuestSession::environmentClear()
     2908{
     2909#ifndef VBOX_WITH_GUEST_CONTROL
     2910    ReturnComNotImplemented();
     2911#else
     2912    LogFlowThisFuncEnter();
    30412913
    30422914    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    30492921}
    30502922
    3051 STDMETHODIMP GuestSession::EnvironmentGet(IN_BSTR aName, BSTR *aValue)
    3052 {
    3053 #ifndef VBOX_WITH_GUEST_CONTROL
    3054     ReturnComNotImplemented();
    3055 #else
    3056     LogFlowThisFuncEnter();
    3057 
    3058     if (RT_UNLIKELY((aName) == NULL || *(aName) == '\0'))
     2923HRESULT GuestSession::environmentGet(const com::Utf8Str &aName, com::Utf8Str &aValue)
     2924{
     2925#ifndef VBOX_WITH_GUEST_CONTROL
     2926    ReturnComNotImplemented();
     2927#else
     2928    LogFlowThisFuncEnter();
     2929
     2930    if (RT_UNLIKELY(aName.c_str() == NULL) || *(aName.c_str()) == '\0')
    30592931        return setError(E_INVALIDARG, tr("No value name specified"));
    30602932
    3061     CheckComArgOutPointerValid(aValue);
    3062 
    3063     AutoCaller autoCaller(this);
    3064     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3065 
    30662933    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    30672934
    3068     Bstr strValue(mData.mEnvironment.Get(Utf8Str(aName)));
    3069     strValue.cloneTo(aValue);
     2935    aValue =  mData.mEnvironment.Get(aName);
    30702936
    30712937    LogFlowThisFuncLeave();
     
    30742940}
    30752941
    3076 STDMETHODIMP GuestSession::EnvironmentSet(IN_BSTR aName, IN_BSTR aValue)
    3077 {
    3078 #ifndef VBOX_WITH_GUEST_CONTROL
    3079     ReturnComNotImplemented();
    3080 #else
    3081     LogFlowThisFuncEnter();
    3082 
    3083     if (RT_UNLIKELY((aName) == NULL || *(aName) == '\0'))
     2942HRESULT GuestSession::environmentSet(const com::Utf8Str &aName, const com::Utf8Str &aValue)
     2943{
     2944#ifndef VBOX_WITH_GUEST_CONTROL
     2945    ReturnComNotImplemented();
     2946#else
     2947    LogFlowThisFuncEnter();
     2948
     2949    if (RT_UNLIKELY((aName.c_str() == NULL) || *(aName.c_str()) == '\0'))
    30842950        return setError(E_INVALIDARG, tr("No value name specified"));
    30852951
    3086     AutoCaller autoCaller(this);
    3087     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3088 
    30892952    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    30902953
    3091     int rc = mData.mEnvironment.Set(Utf8Str(aName), Utf8Str(aValue));
     2954    int rc = mData.mEnvironment.Set(aName, aValue);
    30922955
    30932956    HRESULT hr = RT_SUCCESS(rc) ? S_OK : VBOX_E_IPRT_ERROR;
     
    30972960}
    30982961
    3099 STDMETHODIMP GuestSession::EnvironmentUnset(IN_BSTR aName)
    3100 {
    3101 #ifndef VBOX_WITH_GUEST_CONTROL
    3102     ReturnComNotImplemented();
    3103 #else
    3104     LogFlowThisFuncEnter();
    3105 
    3106     AutoCaller autoCaller(this);
    3107     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     2962HRESULT GuestSession::environmentUnset(const com::Utf8Str &aName)
     2963{
     2964#ifndef VBOX_WITH_GUEST_CONTROL
     2965    ReturnComNotImplemented();
     2966#else
     2967    LogFlowThisFuncEnter();
    31082968
    31092969    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    31102970
    3111     mData.mEnvironment.Unset(Utf8Str(aName));
     2971    mData.mEnvironment.Unset(aName);
    31122972
    31132973    LogFlowThisFuncLeave();
     
    31162976}
    31172977
    3118 STDMETHODIMP GuestSession::FileCreateTemp(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aPath, BOOL aSecure, IGuestFile **aFile)
    3119 {
    3120 #ifndef VBOX_WITH_GUEST_CONTROL
    3121     ReturnComNotImplemented();
    3122 #else
    3123     LogFlowThisFuncEnter();
    3124 
    3125     AutoCaller autoCaller(this);
    3126     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3127 
    3128     ReturnComNotImplemented();
    3129 #endif /* VBOX_WITH_GUEST_CONTROL */
    3130 }
    3131 
    3132 STDMETHODIMP GuestSession::FileExists(IN_BSTR aPath, BOOL *aExists)
    3133 {
    3134 #ifndef VBOX_WITH_GUEST_CONTROL
    3135     ReturnComNotImplemented();
    3136 #else
    3137     LogFlowThisFuncEnter();
    3138 
    3139     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     2978HRESULT GuestSession::fileCreateTemp(const com::Utf8Str &aTemplateName, ULONG aMode, const com::Utf8Str &aPath, BOOL aSecure, ComPtr<IGuestFile> &aFile)
     2979{
     2980#ifndef VBOX_WITH_GUEST_CONTROL
     2981    ReturnComNotImplemented();
     2982#else
     2983    LogFlowThisFuncEnter();
     2984
     2985
     2986    ReturnComNotImplemented();
     2987#endif /* VBOX_WITH_GUEST_CONTROL */
     2988}
     2989
     2990HRESULT GuestSession::fileExists(const com::Utf8Str &aPath, BOOL *aExists)
     2991{
     2992#ifndef VBOX_WITH_GUEST_CONTROL
     2993    ReturnComNotImplemented();
     2994#else
     2995    LogFlowThisFuncEnter();
     2996
     2997    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    31402998        return setError(E_INVALIDARG, tr("No file to check existence for specified"));
    3141     CheckComArgOutPointerValid(aExists);
    3142 
    3143     AutoCaller autoCaller(this);
    3144     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    31452999
    31463000    GuestFsObjData objData; int guestRc;
    3147     int vrc = fileQueryInfoInternal(Utf8Str(aPath), objData, &guestRc);
     3001    int vrc = i_fileQueryInfoInternal(aPath, objData, &guestRc);
    31483002    if (RT_SUCCESS(vrc))
    31493003    {
     
    31663020        default:
    31673021            hr = setError(VBOX_E_IPRT_ERROR, tr("Querying file information for \"%s\" failed: %Rrc"),
    3168                           Utf8Str(aPath).c_str(), vrc);
     3022                          aPath.c_str(), vrc);
    31693023            break;
    31703024    }
     
    31743028}
    31753029
    3176 STDMETHODIMP GuestSession::FileRemove(IN_BSTR aPath)
    3177 {
    3178 #ifndef VBOX_WITH_GUEST_CONTROL
    3179     ReturnComNotImplemented();
    3180 #else
    3181     LogFlowThisFuncEnter();
    3182 
    3183     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     3030HRESULT GuestSession::fileRemove(const com::Utf8Str &aPath)
     3031{
     3032#ifndef VBOX_WITH_GUEST_CONTROL
     3033    ReturnComNotImplemented();
     3034#else
     3035    LogFlowThisFuncEnter();
     3036
     3037    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    31843038        return setError(E_INVALIDARG, tr("No file to remove specified"));
    31853039
    3186     AutoCaller autoCaller(this);
    3187     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3188 
    31893040    HRESULT hr = S_OK;
    31903041
    31913042    int guestRc;
    3192     int vrc = fileRemoveInternal(Utf8Str(aPath), &guestRc);
     3043    int vrc = i_fileRemoveInternal(aPath, &guestRc);
    31933044    if (RT_FAILURE(vrc))
    31943045    {
     
    32013052            default:
    32023053                hr = setError(VBOX_E_IPRT_ERROR, tr("Removing file \"%s\" failed: %Rrc"),
    3203                               Utf8Str(aPath).c_str(), vrc);
     3054                              aPath.c_str(), vrc);
    32043055                break;
    32053056        }
     
    32103061}
    32113062
    3212 STDMETHODIMP GuestSession::FileOpen(IN_BSTR aPath, IN_BSTR aOpenMode, IN_BSTR aDisposition, ULONG aCreationMode, IGuestFile **aFile)
     3063HRESULT GuestSession::fileOpen(const com::Utf8Str &aPath, const com::Utf8Str &aOpenMode, const com::Utf8Str &aDisposition, ULONG aCreationMode, ComPtr<IGuestFile> &aFile)
    32133064{
    32143065#ifndef VBOX_WITH_GUEST_CONTROL
     
    32193070    Bstr strSharingMode = ""; /* Sharing mode is ignored. */
    32203071
    3221     return FileOpenEx(aPath, aOpenMode, aDisposition, strSharingMode.raw(), aCreationMode,
     3072    return fileOpenEx(aPath, aOpenMode, aDisposition, strSharingMode.raw(), aCreationMode,
    32223073                      0 /* aOffset */, aFile);
    32233074#endif /* VBOX_WITH_GUEST_CONTROL */
    32243075}
    32253076
    3226 STDMETHODIMP GuestSession::FileOpenEx(IN_BSTR aPath, IN_BSTR aOpenMode, IN_BSTR aDisposition, IN_BSTR aSharingMode,
    3227                                       ULONG aCreationMode, LONG64 aOffset, IGuestFile **aFile)
    3228 {
    3229 #ifndef VBOX_WITH_GUEST_CONTROL
    3230     ReturnComNotImplemented();
    3231 #else
    3232     LogFlowThisFuncEnter();
    3233 
    3234     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     3077HRESULT GuestSession::fileOpenEx(const com::Utf8Str &aPath, const com::Utf8Str &aOpenMode, const com::Utf8Str &aDisposition, const com::Utf8Str &aSharingMode, ULONG aCreationMode, LONG64 aOffset, ComPtr<IGuestFile> &aFile)
     3078
     3079{
     3080#ifndef VBOX_WITH_GUEST_CONTROL
     3081    ReturnComNotImplemented();
     3082#else
     3083    LogFlowThisFuncEnter();
     3084
     3085    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    32353086        return setError(E_INVALIDARG, tr("No file to open specified"));
    3236     if (RT_UNLIKELY((aOpenMode) == NULL || *(aOpenMode) == '\0'))
     3087    if (RT_UNLIKELY((aOpenMode.c_str()) == NULL || *(aOpenMode.c_str()) == '\0'))
    32373088        return setError(E_INVALIDARG, tr("No open mode specified"));
    3238     if (RT_UNLIKELY((aDisposition) == NULL || *(aDisposition) == '\0'))
     3089    if (RT_UNLIKELY((aDisposition.c_str()) == NULL || *(aDisposition.c_str()) == '\0'))
    32393090        return setError(E_INVALIDARG, tr("No disposition mode specified"));
    32403091    /* aSharingMode is optional. */
    32413092
    3242     CheckComArgOutPointerValid(aFile);
    3243 
    3244     AutoCaller autoCaller(this);
    3245     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3246 
    3247     HRESULT hr = isReadyExternal();
     3093    HRESULT hr = i_isReadyExternal();
    32483094    if (FAILED(hr))
    32493095        return hr;
     
    32533099
    32543100    GuestFileOpenInfo openInfo;
    3255     openInfo.mFileName = Utf8Str(aPath);
    3256     openInfo.mOpenMode = Utf8Str(aOpenMode);
    3257     openInfo.mDisposition = Utf8Str(aDisposition);
    3258     openInfo.mSharingMode = Utf8Str(aSharingMode);
     3101    openInfo.mFileName = aPath;
     3102    openInfo.mOpenMode = aOpenMode;
     3103    openInfo.mDisposition = aDisposition;
     3104    openInfo.mSharingMode = aSharingMode;
    32593105    openInfo.mCreationMode = aCreationMode;
    32603106    openInfo.mInitialOffset = aOffset;
     
    32693115
    32703116    ComObjPtr <GuestFile> pFile; int guestRc;
    3271     vrc = fileOpenInternal(openInfo, pFile, &guestRc);
     3117    vrc = i_fileOpenInternal(openInfo, pFile, &guestRc);
    32723118    if (RT_SUCCESS(vrc))
    3273     {
    32743119        /* Return directory object to the caller. */
    3275         hr = pFile.queryInterfaceTo(aFile);
    3276     }
     3120        hr = pFile.queryInterfaceTo(aFile.asOutParam());
    32773121    else
    32783122    {
     
    32903134            default:
    32913135                hr = setError(VBOX_E_IPRT_ERROR, tr("Opening guest file \"%s\" failed: %Rrc"),
    3292                               Utf8Str(aPath).c_str(), vrc);
     3136                              aPath.c_str(), vrc);
    32933137                break;
    32943138        }
     
    32993143}
    33003144
    3301 STDMETHODIMP GuestSession::FileQueryInfo(IN_BSTR aPath, IGuestFsObjInfo **aInfo)
    3302 {
    3303 #ifndef VBOX_WITH_GUEST_CONTROL
    3304     ReturnComNotImplemented();
    3305 #else
    3306     LogFlowThisFuncEnter();
    3307 
    3308     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     3145HRESULT GuestSession::fileQueryInfo(const com::Utf8Str &aPath, ComPtr<IGuestFsObjInfo> &aInfo)
     3146
     3147{
     3148#ifndef VBOX_WITH_GUEST_CONTROL
     3149    ReturnComNotImplemented();
     3150#else
     3151    LogFlowThisFuncEnter();
     3152
     3153    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    33093154        return setError(E_INVALIDARG, tr("No file to query information for specified"));
    3310     CheckComArgOutPointerValid(aInfo);
    3311 
    3312     AutoCaller autoCaller(this);
    3313     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    33143155
    33153156    HRESULT hr = S_OK;
    33163157
    33173158    GuestFsObjData objData; int guestRc;
    3318     int vrc = fileQueryInfoInternal(Utf8Str(aPath), objData, &guestRc);
     3159    int vrc = i_fileQueryInfoInternal(aPath, objData, &guestRc);
    33193160    if (RT_SUCCESS(vrc))
    33203161    {
     
    33263167        if (RT_SUCCESS(vrc))
    33273168        {
    3328             hr = pFsObjInfo.queryInterfaceTo(aInfo);
     3169            hr = pFsObjInfo.queryInterfaceTo(aInfo.asOutParam());
    33293170            if (FAILED(hr)) return hr;
    33303171        }
     
    33533194}
    33543195
    3355 STDMETHODIMP GuestSession::FileQuerySize(IN_BSTR aPath, LONG64 *aSize)
    3356 {
    3357 #ifndef VBOX_WITH_GUEST_CONTROL
    3358     ReturnComNotImplemented();
    3359 #else
    3360     LogFlowThisFuncEnter();
    3361 
    3362     if (RT_UNLIKELY((aPath) == NULL || *(aPath) == '\0'))
     3196HRESULT GuestSession::fileQuerySize(const com::Utf8Str &aPath, LONG64 *aSize)
     3197{
     3198#ifndef VBOX_WITH_GUEST_CONTROL
     3199    ReturnComNotImplemented();
     3200#else
     3201    LogFlowThisFuncEnter();
     3202
     3203    if (RT_UNLIKELY((aPath.c_str()) == NULL || *(aPath.c_str()) == '\0'))
    33633204        return setError(E_INVALIDARG, tr("No file to query size for specified"));
    3364     CheckComArgOutPointerValid(aSize);
    3365 
    3366     AutoCaller autoCaller(this);
    3367     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    33683205
    33693206    HRESULT hr = S_OK;
    33703207
    33713208    int64_t llSize; int guestRc;
    3372     int vrc = fileQuerySizeInternal(Utf8Str(aPath), &llSize, &guestRc);
     3209    int vrc = i_fileQuerySizeInternal(aPath, &llSize, &guestRc);
    33733210    if (RT_SUCCESS(vrc))
    3374     {
    33753211        *aSize = llSize;
    3376     }
    33773212    else
    33783213    {
     
    33933228}
    33943229
    3395 STDMETHODIMP GuestSession::FileRename(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(PathRenameFlag_T, aFlags))
    3396 {
    3397 #ifndef VBOX_WITH_GUEST_CONTROL
    3398     ReturnComNotImplemented();
    3399 #else
    3400     LogFlowThisFuncEnter();
    3401 
    3402     if (RT_UNLIKELY((aSource) == NULL || *(aSource) == '\0'))
     3230HRESULT GuestSession::fileRename(const com::Utf8Str &aSource, const com::Utf8Str &aDest, const std::vector<PathRenameFlag_T> &aFlags)
     3231{
     3232#ifndef VBOX_WITH_GUEST_CONTROL
     3233    ReturnComNotImplemented();
     3234#else
     3235    LogFlowThisFuncEnter();
     3236
     3237    if (RT_UNLIKELY((aSource.c_str()) == NULL || *(aSource.c_str()) == '\0'))
    34033238        return setError(E_INVALIDARG, tr("No source file to rename specified"));
    34043239
    3405     if (RT_UNLIKELY((aDest) == NULL || *(aDest) == '\0'))
     3240    if (RT_UNLIKELY((aDest.c_str()) == NULL || *(aDest.c_str()) == '\0'))
    34063241        return setError(E_INVALIDARG, tr("No destination file to rename the source to specified"));
    34073242
    3408     AutoCaller autoCaller(this);
    3409     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3410 
    3411     HRESULT hr = isReadyExternal();
     3243    HRESULT hr = i_isReadyExternal();
    34123244    if (FAILED(hr))
    34133245        return hr;
     
    34173249
    34183250    int guestRc;
    3419     int vrc = pathRenameInternal(Utf8Str(aSource), Utf8Str(aDest), uFlags, &guestRc);
     3251    int vrc = i_pathRenameInternal(aSource, aDest, uFlags, &guestRc);
    34203252    if (RT_FAILURE(vrc))
    34213253    {
     
    34353267            default:
    34363268                hr = setError(VBOX_E_IPRT_ERROR, tr("Renaming guest file \"%s\" failed: %Rrc"),
    3437                               Utf8Str(aSource).c_str(), vrc);
     3269                              aSource.c_str(), vrc);
    34383270                break;
    34393271        }
     
    34433275#endif /* VBOX_WITH_GUEST_CONTROL */
    34443276}
    3445 
    3446 STDMETHODIMP GuestSession::FileSetACL(IN_BSTR aPath, IN_BSTR aACL)
    3447 {
    3448 #ifndef VBOX_WITH_GUEST_CONTROL
    3449     ReturnComNotImplemented();
    3450 #else
    3451     LogFlowThisFuncEnter();
    3452 
    3453     AutoCaller autoCaller(this);
    3454     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3455 
    3456     ReturnComNotImplemented();
    3457 #endif /* VBOX_WITH_GUEST_CONTROL */
    3458 }
    3459 
    3460 STDMETHODIMP GuestSession::ProcessCreate(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    3461                                          ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess)
    3462 {
    3463 #ifndef VBOX_WITH_GUEST_CONTROL
    3464     ReturnComNotImplemented();
    3465 #else
    3466     LogFlowThisFuncEnter();
    3467 
    3468     com::SafeArray<LONG> affinityIgnored;
    3469 
    3470     return ProcessCreateEx(aCommand, ComSafeArrayInArg(aArguments), ComSafeArrayInArg(aEnvironment),
    3471                            ComSafeArrayInArg(aFlags), aTimeoutMS, ProcessPriority_Default, ComSafeArrayAsInParam(affinityIgnored), aProcess);
    3472 #endif /* VBOX_WITH_GUEST_CONTROL */
    3473 }
    3474 
    3475 STDMETHODIMP GuestSession::ProcessCreateEx(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
    3476                                            ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
    3477                                            ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
    3478                                            IGuestProcess **aProcess)
    3479 {
    3480 #ifndef VBOX_WITH_GUEST_CONTROL
    3481     ReturnComNotImplemented();
    3482 #else
    3483     LogFlowThisFuncEnter();
    3484 
    3485     if (RT_UNLIKELY((aCommand) == NULL || *(aCommand) == '\0'))
     3277HRESULT GuestSession::fileSetACL(const com::Utf8Str &aFile, const com::Utf8Str &aAcl)
     3278{
     3279#ifndef VBOX_WITH_GUEST_CONTROL
     3280    ReturnComNotImplemented();
     3281#else
     3282    LogFlowThisFuncEnter();
     3283
     3284    ReturnComNotImplemented();
     3285#endif /* VBOX_WITH_GUEST_CONTROL */
     3286}
     3287
     3288HRESULT GuestSession::processCreate(const com::Utf8Str &aCommand, const std::vector<com::Utf8Str> &aArguments, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ComPtr<IGuestProcess> &aGuestProcess)
     3289{
     3290#ifndef VBOX_WITH_GUEST_CONTROL
     3291    ReturnComNotImplemented();
     3292#else
     3293    LogFlowThisFuncEnter();
     3294
     3295    std::vector<LONG> affinityIgnored;
     3296
     3297    return processCreateEx(aCommand, aArguments, aEnvironment, aFlags, aTimeoutMS, ProcessPriority_Default, affinityIgnored, aGuestProcess);
     3298#endif /* VBOX_WITH_GUEST_CONTROL */
     3299}
     3300
     3301HRESULT GuestSession::processCreateEx(const com::Utf8Str &aCommand, const std::vector<com::Utf8Str> &aArguments, const std::vector<com::Utf8Str> &aEnvironment, const std::vector<ProcessCreateFlag_T> &aFlags, ULONG aTimeoutMS, ProcessPriority_T aPriority, const std::vector<LONG> &aAffinity, ComPtr<IGuestProcess> &aGuestProcess)
     3302{
     3303#ifndef VBOX_WITH_GUEST_CONTROL
     3304    ReturnComNotImplemented();
     3305#else
     3306    LogFlowThisFuncEnter();
     3307
     3308    if (RT_UNLIKELY((aCommand.c_str()) == NULL || *(aCommand.c_str()) == '\0'))
    34863309        return setError(E_INVALIDARG, tr("No command to execute specified"));
    3487     CheckComArgOutPointerValid(aProcess);
    3488 
    3489     AutoCaller autoCaller(this);
    3490     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3491 
    3492     HRESULT hr = isReadyExternal();
     3310
     3311    HRESULT hr = i_isReadyExternal();
    34933312    if (FAILED(hr))
    34943313        return hr;
    34953314
    34963315    GuestProcessStartupInfo procInfo;
    3497     procInfo.mCommand = Utf8Str(aCommand);
    3498 
    3499     if (aArguments)
    3500     {
    3501         com::SafeArray<IN_BSTR> arguments(ComSafeArrayInArg(aArguments));
    3502         for (size_t i = 0; i < arguments.size(); i++)
    3503             procInfo.mArguments.push_back(Utf8Str(arguments[i]));
    3504     }
     3316    procInfo.mCommand = aCommand;
     3317
     3318    if (aArguments.size())
     3319        for (size_t i = 0; i < aArguments.size(); i++)
     3320            procInfo.mArguments.push_back(aArguments[i]);
    35053321
    35063322    int rc = VINF_SUCCESS;
     
    35143330    procInfo.mEnvironment = mData.mEnvironment; /* Apply original session environment. */
    35153331
    3516     if (aEnvironment)
    3517     {
    3518         com::SafeArray<IN_BSTR> environment(ComSafeArrayInArg(aEnvironment));
    3519         for (size_t i = 0; i < environment.size() && RT_SUCCESS(rc); i++)
    3520             rc = procInfo.mEnvironment.Set(Utf8Str(environment[i]));
    3521     }
     3332    if (aEnvironment.size())
     3333        for (size_t i = 0; i < aEnvironment.size() && RT_SUCCESS(rc); i++)
     3334            rc = procInfo.mEnvironment.Set(aEnvironment[i]);
    35223335
    35233336    if (RT_SUCCESS(rc))
    35243337    {
    3525         if (aFlags)
    3526         {
    3527             com::SafeArray<ProcessCreateFlag_T> flags(ComSafeArrayInArg(aFlags));
    3528             for (size_t i = 0; i < flags.size(); i++)
    3529                 procInfo.mFlags |= flags[i];
    3530         }
     3338        if (aFlags.size())
     3339            for (size_t i = 0; i < aFlags.size(); i++)
     3340                procInfo.mFlags |= aFlags[i];
    35313341
    35323342        procInfo.mTimeoutMS = aTimeoutMS;
    35333343
    3534         if (aAffinity)
    3535         {
    3536             com::SafeArray<LONG> affinity(ComSafeArrayInArg(aAffinity));
    3537             for (size_t i = 0; i < affinity.size(); i++)
    3538             {
    3539                 if (affinity[i])
     3344        if (aAffinity.size())
     3345            for (size_t i = 0; i < aAffinity.size(); i++)
     3346                if (aAffinity[i])
    35403347                    procInfo.mAffinity |= (uint64_t)1 << i;
    3541             }
    3542         }
    35433348
    35443349        procInfo.mPriority = aPriority;
    35453350
    35463351        ComObjPtr<GuestProcess> pProcess;
    3547         rc = processCreateExInteral(procInfo, pProcess);
     3352        rc = i_processCreateExInteral(procInfo, pProcess);
    35483353        if (RT_SUCCESS(rc))
    35493354        {
    35503355            /* Return guest session to the caller. */
    3551             HRESULT hr2 = pProcess.queryInterfaceTo(aProcess);
     3356            HRESULT hr2 = pProcess.queryInterfaceTo(aGuestProcess.asOutParam());
    35523357            if (FAILED(hr2))
    35533358                rc = VERR_COM_OBJECT_NOT_FOUND;
     
    35803385}
    35813386
    3582 STDMETHODIMP GuestSession::ProcessGet(ULONG aPID, IGuestProcess **aProcess)
    3583 {
    3584 #ifndef VBOX_WITH_GUEST_CONTROL
    3585     ReturnComNotImplemented();
    3586 #else
    3587     LogFlowThisFunc(("PID=%RU32\n", aPID));
    3588 
    3589     CheckComArgOutPointerValid(aProcess);
    3590     if (aPID == 0)
     3387HRESULT GuestSession::processGet(ULONG aPid, ComPtr<IGuestProcess> &aGuestProcess)
     3388
     3389{
     3390#ifndef VBOX_WITH_GUEST_CONTROL
     3391    ReturnComNotImplemented();
     3392#else
     3393    LogFlowThisFunc(("PID=%RU32\n", aPid));
     3394
     3395    if (aPid == 0)
    35913396        return setError(E_INVALIDARG, tr("No valid process ID (PID) specified"));
    35923397
    3593     AutoCaller autoCaller(this);
    3594     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3595 
    35963398    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    35973399
     
    35993401
    36003402    ComObjPtr<GuestProcess> pProcess;
    3601     int rc = processGetByPID(aPID, &pProcess);
     3403    int rc = i_processGetByPID(aPid, &pProcess);
    36023404    if (RT_FAILURE(rc))
    3603         hr = setError(E_INVALIDARG, tr("No process with PID %RU32 found"), aPID);
     3405        hr = setError(E_INVALIDARG, tr("No process with PID %RU32 found"), aPid);
    36043406
    36053407    /* This will set (*aProcess) to NULL if pProgress is NULL. */
    3606     HRESULT hr2 = pProcess.queryInterfaceTo(aProcess);
     3408    HRESULT hr2 = pProcess.queryInterfaceTo(aGuestProcess.asOutParam());
    36073409    if (SUCCEEDED(hr))
    36083410        hr = hr2;
    36093411
    3610     LogFlowThisFunc(("aProcess=%p, hr=%Rhrc\n", *aProcess, hr));
     3412    LogFlowThisFunc(("aProcess=%p, hr=%Rhrc\n", (IGuestProcess*)aGuestProcess, hr));
    36113413    return hr;
    36123414#endif /* VBOX_WITH_GUEST_CONTROL */
    36133415}
    36143416
    3615 STDMETHODIMP GuestSession::SymlinkCreate(IN_BSTR aSource, IN_BSTR aTarget, SymlinkType_T aType)
    3616 {
    3617 #ifndef VBOX_WITH_GUEST_CONTROL
    3618     ReturnComNotImplemented();
    3619 #else
    3620     LogFlowThisFuncEnter();
    3621 
    3622     AutoCaller autoCaller(this);
    3623     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3624 
    3625     ReturnComNotImplemented();
    3626 #endif /* VBOX_WITH_GUEST_CONTROL */
    3627 }
    3628 
    3629 STDMETHODIMP GuestSession::SymlinkExists(IN_BSTR aSymlink, BOOL *aExists)
    3630 {
    3631 #ifndef VBOX_WITH_GUEST_CONTROL
    3632     ReturnComNotImplemented();
    3633 #else
    3634     LogFlowThisFuncEnter();
    3635 
    3636     AutoCaller autoCaller(this);
    3637     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3638 
    3639     ReturnComNotImplemented();
    3640 #endif /* VBOX_WITH_GUEST_CONTROL */
    3641 }
    3642 
    3643 STDMETHODIMP GuestSession::SymlinkRead(IN_BSTR aSymlink, ComSafeArrayIn(SymlinkReadFlag_T, aFlags), BSTR *aTarget)
    3644 {
    3645 #ifndef VBOX_WITH_GUEST_CONTROL
    3646     ReturnComNotImplemented();
    3647 #else
    3648     LogFlowThisFuncEnter();
    3649 
    3650     AutoCaller autoCaller(this);
    3651     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3652 
    3653     ReturnComNotImplemented();
    3654 #endif /* VBOX_WITH_GUEST_CONTROL */
    3655 }
    3656 
    3657 STDMETHODIMP GuestSession::SymlinkRemoveDirectory(IN_BSTR aPath)
    3658 {
    3659 #ifndef VBOX_WITH_GUEST_CONTROL
    3660     ReturnComNotImplemented();
    3661 #else
    3662     LogFlowThisFuncEnter();
    3663 
    3664     AutoCaller autoCaller(this);
    3665     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3666 
    3667     ReturnComNotImplemented();
    3668 #endif /* VBOX_WITH_GUEST_CONTROL */
    3669 }
    3670 
    3671 STDMETHODIMP GuestSession::SymlinkRemoveFile(IN_BSTR aFile)
    3672 {
    3673 #ifndef VBOX_WITH_GUEST_CONTROL
    3674     ReturnComNotImplemented();
    3675 #else
    3676     LogFlowThisFuncEnter();
    3677 
    3678     AutoCaller autoCaller(this);
    3679     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    3680 
    3681     ReturnComNotImplemented();
    3682 #endif /* VBOX_WITH_GUEST_CONTROL */
    3683 }
    3684 
    3685 STDMETHODIMP GuestSession::WaitFor(ULONG aWaitFlags, ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason)
    3686 {
    3687 #ifndef VBOX_WITH_GUEST_CONTROL
    3688     ReturnComNotImplemented();
    3689 #else
    3690     LogFlowThisFuncEnter();
    3691 
    3692     CheckComArgOutPointerValid(aReason);
    3693 
    3694     AutoCaller autoCaller(this);
    3695     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     3417HRESULT GuestSession::symlinkCreate(const com::Utf8Str &aSource, const com::Utf8Str &aTarget, SymlinkType_T aType)
     3418{
     3419#ifndef VBOX_WITH_GUEST_CONTROL
     3420    ReturnComNotImplemented();
     3421#else
     3422    LogFlowThisFuncEnter();
     3423
     3424    ReturnComNotImplemented();
     3425#endif /* VBOX_WITH_GUEST_CONTROL */
     3426}
     3427
     3428HRESULT GuestSession::symlinkExists(const com::Utf8Str &aSymlink, BOOL *aExists)
     3429
     3430{
     3431#ifndef VBOX_WITH_GUEST_CONTROL
     3432    ReturnComNotImplemented();
     3433#else
     3434    LogFlowThisFuncEnter();
     3435
     3436    ReturnComNotImplemented();
     3437#endif /* VBOX_WITH_GUEST_CONTROL */
     3438}
     3439
     3440HRESULT GuestSession::symlinkRead(const com::Utf8Str &aSymlink, const std::vector<SymlinkReadFlag_T> &aFlags, com::Utf8Str &aTarget)
     3441{
     3442#ifndef VBOX_WITH_GUEST_CONTROL
     3443    ReturnComNotImplemented();
     3444#else
     3445    LogFlowThisFuncEnter();
     3446
     3447    ReturnComNotImplemented();
     3448#endif /* VBOX_WITH_GUEST_CONTROL */
     3449}
     3450
     3451HRESULT GuestSession::symlinkRemoveDirectory(const com::Utf8Str &aPath)
     3452{
     3453#ifndef VBOX_WITH_GUEST_CONTROL
     3454    ReturnComNotImplemented();
     3455#else
     3456    LogFlowThisFuncEnter();
     3457
     3458    ReturnComNotImplemented();
     3459#endif /* VBOX_WITH_GUEST_CONTROL */
     3460}
     3461
     3462HRESULT GuestSession::symlinkRemoveFile(const com::Utf8Str &aFile)
     3463{
     3464#ifndef VBOX_WITH_GUEST_CONTROL
     3465    ReturnComNotImplemented();
     3466#else
     3467    LogFlowThisFuncEnter();
     3468
     3469    ReturnComNotImplemented();
     3470#endif /* VBOX_WITH_GUEST_CONTROL */
     3471}
     3472
     3473HRESULT GuestSession::waitFor(ULONG aWaitFor, ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason)
     3474{
     3475#ifndef VBOX_WITH_GUEST_CONTROL
     3476    ReturnComNotImplemented();
     3477#else
     3478    LogFlowThisFuncEnter();
    36963479
    36973480    /*
     
    37013484
    37023485    int guestRc; GuestSessionWaitResult_T waitResult;
    3703     int vrc = waitFor(aWaitFlags, aTimeoutMS, waitResult, &guestRc);
     3486    int vrc = i_waitFor(aWaitFor, aTimeoutMS, waitResult, &guestRc);
    37043487    if (RT_SUCCESS(vrc))
    3705     {
    37063488        *aReason = waitResult;
    3707     }
    37083489    else
    37093490    {
     
    37113492        {
    37123493            case VERR_GSTCTL_GUEST_ERROR:
    3713                 hr = GuestSession::setErrorExternal(this, guestRc);
     3494                hr = GuestSession::i_setErrorExternal(this, guestRc);
    37143495                break;
    37153496
     
    37343515}
    37353516
    3736 STDMETHODIMP GuestSession::WaitForArray(ComSafeArrayIn(GuestSessionWaitForFlag_T, aFlags), ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason)
    3737 {
    3738 #ifndef VBOX_WITH_GUEST_CONTROL
    3739     ReturnComNotImplemented();
    3740 #else
    3741     LogFlowThisFuncEnter();
    3742 
    3743     CheckComArgOutPointerValid(aReason);
    3744 
    3745     AutoCaller autoCaller(this);
    3746     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     3517HRESULT GuestSession::waitForArray(const std::vector<GuestSessionWaitForFlag_T> &aWaitFor, ULONG aTimeoutMS, GuestSessionWaitResult_T *aReason)
     3518{
     3519#ifndef VBOX_WITH_GUEST_CONTROL
     3520    ReturnComNotImplemented();
     3521#else
     3522    LogFlowThisFuncEnter();
    37473523
    37483524    /*
     
    37503526     */
    37513527    uint32_t fWaitFor = GuestSessionWaitForFlag_None;
    3752     com::SafeArray<GuestSessionWaitForFlag_T> flags(ComSafeArrayInArg(aFlags));
    3753     for (size_t i = 0; i < flags.size(); i++)
    3754         fWaitFor |= flags[i];
     3528    for (size_t i = 0; i < aWaitFor.size(); i++)
     3529        fWaitFor |= aWaitFor[i];
    37553530
    37563531    return WaitFor(fWaitFor, aTimeoutMS, aReason);
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r50709 r50727  
    186186    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    187187
    188     int vrc = pSession->startSessionInternal(pGuestRc);
     188    int vrc = pSession->i_startSessionInternal(pGuestRc);
    189189    /* Nothing to do here anymore. */
    190190
     
    319319    ComObjPtr<GuestProcess> pProcess; int guestRc;
    320320    if (RT_SUCCESS(rc))
    321         rc = pSession->processCreateExInteral(procInfo, pProcess);
     321        rc = pSession->i_processCreateExInteral(procInfo, pProcess);
    322322    if (RT_SUCCESS(rc))
    323323    {
     
    603603     */
    604604    GuestFsObjData objData; int guestRc;
    605     int rc = pSession->fileQueryInfoInternal(Utf8Str(mSource), objData, &guestRc);
     605    int rc = pSession->i_fileQueryInfoInternal(Utf8Str(mSource), objData, &guestRc);
    606606    if (RT_FAILURE(rc))
    607607    {
     
    641641            /* Startup process. */
    642642            ComObjPtr<GuestProcess> pProcess;
    643             rc = pSession->processCreateExInteral(procInfo, pProcess);
     643            rc = pSession->i_processCreateExInteral(procInfo, pProcess);
    644644            if (RT_SUCCESS(rc))
    645645                rc = pProcess->i_startProcess(30 * 1000 /* 30s timeout */,
     
    858858}
    859859
    860 int SessionTaskUpdateAdditions::addProcessArguments(ProcessArguments &aArgumentsDest,
    861                                                     const ProcessArguments &aArgumentsSource)
     860int SessionTaskUpdateAdditions::i_addProcessArguments(ProcessArguments &aArgumentsDest,
     861                                                      const ProcessArguments &aArgumentsSource)
    862862{
    863863    int rc = VINF_SUCCESS;
     
    897897}
    898898
    899 int SessionTaskUpdateAdditions::copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO,
    900                                                 Utf8Str const &strFileSource, const Utf8Str &strFileDest,
    901                                                 bool fOptional, uint32_t *pcbSize)
     899int SessionTaskUpdateAdditions::i_copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO,
     900                                                  Utf8Str const &strFileSource, const Utf8Str &strFileDest,
     901                                                  bool fOptional, uint32_t *pcbSize)
    902902{
    903903    AssertPtrReturn(pSession, VERR_INVALID_POINTER);
     
    935935
    936936            ComObjPtr<Progress> pProgressCopyTo;
    937             rc = pSession->startTaskAsync(Utf8StrFmt(GuestSession::tr("Copying Guest Additions installer file \"%s\" to \"%s\" on guest"),
    938                                                      mSource.c_str(), strFileDest.c_str()),
    939                                                      pTask, pProgressCopyTo);
     937            rc = pSession->i_startTaskAsync(Utf8StrFmt(GuestSession::tr("Copying Guest Additions installer file \"%s\" to \"%s\" on guest"),
     938                                                       mSource.c_str(), strFileDest.c_str()),
     939                                                       pTask, pProgressCopyTo);
    940940            if (RT_SUCCESS(rc))
    941941            {
     
    967967        GuestFsObjData objData;
    968968        int64_t cbSizeOnGuest; int guestRc;
    969         rc = pSession->fileQuerySizeInternal(strFileDest, &cbSizeOnGuest, &guestRc);
     969        rc = pSession->i_fileQuerySizeInternal(strFileDest, &cbSizeOnGuest, &guestRc);
    970970        if (   RT_SUCCESS(rc)
    971971            && cbSize == (uint64_t)cbSizeOnGuest)
     
    10101010}
    10111011
    1012 int SessionTaskUpdateAdditions::runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo)
     1012int SessionTaskUpdateAdditions::i_runFileOnGuest(GuestSession *pSession, GuestProcessStartupInfo &procInfo)
    10131013{
    10141014    AssertPtrReturn(pSession, VERR_INVALID_POINTER);
     
    10771077    LogRel(("Automatic update of Guest Additions started, using \"%s\"\n", mSource.c_str()));
    10781078
    1079     ComObjPtr<Guest> pGuest(mSession->getParent());
     1079    ComObjPtr<Guest> pGuest(mSession->i_getParent());
    10801080#if 0
    10811081    /*
     
    12801280            /* Create the installation directory. */
    12811281            int guestRc;
    1282             rc = pSession->directoryCreateInternal(strUpdateDir,
    1283                                                    755 /* Mode */, DirectoryCreateFlag_Parents, &guestRc);
     1282            rc = pSession->i_directoryCreateInternal(strUpdateDir,
     1283                                                     755 /* Mode */, DirectoryCreateFlag_Parents, &guestRc);
    12841284            if (RT_FAILURE(rc))
    12851285            {
     
    13781378                        /* Add optional installer command line arguments from the API to the
    13791379                         * installer's startup info. */
    1380                         rc = addProcessArguments(siInstaller.mArguments, mArguments);
     1380                        rc = i_addProcessArguments(siInstaller.mArguments, mArguments);
    13811381                        AssertRC(rc);
    13821382                        /* If the caller does not want to wait for out guest update process to end,
     
    14181418                        if (itFiles->fFlags & UPDATEFILE_FLAG_OPTIONAL)
    14191419                            fOptional = true;
    1420                         rc = copyFileToGuest(pSession, &iso, itFiles->strSource, itFiles->strDest,
    1421                                              fOptional, NULL /* cbSize */);
     1420                        rc = i_copyFileToGuest(pSession, &iso, itFiles->strSource, itFiles->strDest,
     1421                                               fOptional, NULL /* cbSize */);
    14221422                        if (RT_FAILURE(rc))
    14231423                        {
     
    14551455                    if (itFiles->fFlags & UPDATEFILE_FLAG_EXECUTE)
    14561456                    {
    1457                         rc = runFileOnGuest(pSession, itFiles->mProcInfo);
     1457                        rc = i_runFileOnGuest(pSession, itFiles->mProcInfo);
    14581458                        if (RT_FAILURE(rc))
    14591459                            break;
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r50709 r50727  
    6868NS_DECL_CLASSINFO(Guest)
    6969NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest)
    70  #ifdef VBOX_WITH_GUEST_CONTROL
    71 NS_DECL_CLASSINFO(GuestSession)
    72 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(GuestSession, IGuestSession)
    73  #endif
    7470NS_DECL_CLASSINFO(Keyboard)
    7571NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Keyboard, IKeyboard)
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