GuestSessionImpl.h revision ed9d3db07648c7e3a979105c15ad752ee9ea18de
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * VirtualBox Main - XXX.
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * Copyright (C) 2012 Oracle Corporation
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * available from http://www.virtualbox.org. This file is free software;
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * General Public License (GPL) as published by the Free Software
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync /** @name COM and internal init/term/mapping cruft.
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(GuestSession, IGuestSession)
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync int init(Guest *aGuest, ULONG aSessionID, Utf8Str aUser, Utf8Str aPassword, Utf8Str aDomain, Utf8Str aName);
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync /** @name IGuestSession properties.
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync STDMETHOD(COMGETTER(Environment))(ComSafeArrayOut(BSTR, aEnvironment));
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync STDMETHOD(COMGETTER(Processes))(ComSafeArrayOut(IGuestProcess *, aProcesses));
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync STDMETHOD(COMGETTER(Directories))(ComSafeArrayOut(IGuestDirectory *, aDirectories));
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync STDMETHOD(COMGETTER(Files))(ComSafeArrayOut(IGuestFile *, aFiles));
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync /** @name IGuestSession methods.
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(CopyFrom)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(ULONG, aFlags), IProgress **aProgress);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(CopyTo)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(ULONG, aFlags), IProgress **aProgress);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(DirectoryCreate)(IN_BSTR aPath, ULONG aMode, ULONG aFlags, IGuestDirectory **aDirectory);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(DirectoryCreateTemp)(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aName, IGuestDirectory **aDirectory);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(DirectoryExists)(IN_BSTR aPath, BOOL *aExists);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(DirectoryOpen)(IN_BSTR aPath, IN_BSTR aFilter, IN_BSTR aFlags, IGuestDirectory **aDirectory);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(DirectoryQueryInfo)(IN_BSTR aPath, IGuestFsObjInfo **aInfo);
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync STDMETHOD(DirectoryRemoveRecursive)(IN_BSTR aPath, ComSafeArrayIn(DirectoryRemoveRecFlag_T, aFlags), IProgress **aProgress);
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync STDMETHOD(DirectoryRename)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(PathRenameFlag_T, aFlags));
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(DirectorySetACL)(IN_BSTR aPath, IN_BSTR aACL);
702a8ee2dc1de96f2f77e97135015d3e243186fdvboxsync STDMETHOD(EnvironmentGet)(IN_BSTR aName, BSTR *aValue);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(EnvironmentSet)(IN_BSTR aName, IN_BSTR aValue);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(EnvironmentSetArray)(ComSafeArrayIn(IN_BSTR, aValues));
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(FileCreateTemp)(IN_BSTR aTemplate, ULONG aMode, IN_BSTR aName, IGuestFile **aFile);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(FileExists)(IN_BSTR aPath, BOOL *aExists);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(FileOpen)(IN_BSTR aPath, IN_BSTR aOpenMode, IN_BSTR aDisposition, ULONG aCreationMode, LONG64 aOffset, IGuestFile **aFile);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(FileQueryInfo)(IN_BSTR aPath, IGuestFsObjInfo **aInfo);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(FileQuerySize)(IN_BSTR aPath, LONG64 *aSize);
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync STDMETHOD(FileRename)(IN_BSTR aSource, IN_BSTR aDest, ComSafeArrayIn(PathRenameFlag_T, aFlags));
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(FileSetACL)(IN_BSTR aPath, IN_BSTR aACL);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(ProcessCreate)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS, IGuestProcess **aProcess);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(ProcessCreateEx)(IN_BSTR aCommand, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(IN_BSTR, aEnvironment),
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync ComSafeArrayIn(ProcessCreateFlag_T, aFlags), ULONG aTimeoutMS,
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync ProcessPriority_T aPriority, ComSafeArrayIn(LONG, aAffinity),
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync STDMETHOD(ProcessGet)(ULONG aPID, IGuestProcess **aProcess);
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync STDMETHOD(SymlinkCreate)(IN_BSTR aSource, IN_BSTR aTarget, SymlinkType_T aType);
9523921c89c66f4bececdbd5ac95aed0039eda1bvboxsync STDMETHOD(SymlinkExists)(IN_BSTR aSymlink, BOOL *aExists);
06ea6bcf23874b662d499b3f130024c98b2dd7a6vboxsync STDMETHOD(SymlinkRead)(IN_BSTR aSymlink, ComSafeArrayIn(SymlinkReadFlag_T, aFlags), BSTR *aTarget);
7862f4bd000f1eb6c86289f5ac2849e9cf943ca9vboxsync typedef std::vector <ComObjPtr<GuestDirectory> > SessionDirectories;
7862f4bd000f1eb6c86289f5ac2849e9cf943ca9vboxsync typedef std::vector <ComObjPtr<GuestFile> > SessionFiles;
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync /** Map of guest processes. The key specifies the internal process number.
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync * To retrieve the process' guest PID use the Id() method of the IProgress interface. */
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync typedef std::map <ULONG, ComObjPtr<GuestProcess> > SessionProcesses;
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync /** @name Public internal methods.
5f2b03bf7695dabd71222dba123532a3f76828c1vboxsync int directoryClose(ComObjPtr<GuestDirectory> pDirectory);
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync int dispatchToProcess(uint32_t uContextID, uint32_t uFunction, void *pvData, size_t cbData);
5f2b03bf7695dabd71222dba123532a3f76828c1vboxsync int processClose(ComObjPtr<GuestProcess> pProcess);
ed9d3db07648c7e3a979105c15ad752ee9ea18devboxsync int processCreateExInteral(GuestProcessInfo &procInfo, ComObjPtr<GuestProcess> &pProgress);
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync inline bool processExists(ULONG uProcessID, ComObjPtr<GuestProcess> *pProcess);
687794577e2e35c3cae67e692a7f2130d1262a82vboxsync inline int processGetByPID(ULONG uPID, ComObjPtr<GuestProcess> *pProcess);
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync /** Flag indicating if this is an internal session
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync * or not. Internal session are not accessible by clients. */
5f2b03bf7695dabd71222dba123532a3f76828c1vboxsync /** Pointer to the parent (Guest). */
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync /** The session credentials. */
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync /** The (optional) session name. */
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync /** The session ID. */
d4a9d525e6f2111d462d2d96462dced6b9ec00efvboxsync /** The session timeout. Default is 30s. */
2f3883b126a405f92b19e829472f614c7352b4f9vboxsync#endif /* !____H_GUESTSESSIONIMPL */