VirtualBox

Changeset 50547 in vbox


Ignore:
Timestamp:
Feb 21, 2014 6:45:43 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92400
Message:

6813 - src-client/GuestDirectoryImpl.cpp

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r50528 r50547  
    10311031        include/ConsoleImpl.h
    10321032
    1033 ifdef VBOX_WITH_GUEST_CONTROL
    10341033VBoxC_VBOX_INTERMEDIATES   = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
    10351034VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
    1036 endif # VBOX_WITH_GUEST_CONTROL
    10371035
    10381036VBoxC_VBOX_TRANSLATIONS = \
  • trunk/src/VBox/Main/include/GuestDirectoryImpl.h

    r49504 r50547  
    2020#define ____H_GUESTDIRECTORYIMPL
    2121
    22 #include "VirtualBoxBase.h"
    2322#include "GuestProcessImpl.h"
     23#include "GuestDirectoryWrap.h"
    2424
    2525class GuestSession;
     
    2929 */
    3030class ATL_NO_VTABLE GuestDirectory :
    31     public VirtualBoxBase,
    32     public GuestObject,
    33     VBOX_SCRIPTABLE_IMPL(IGuestDirectory)
     31    public GuestDirectoryWrap,
     32    public GuestObject
    3433{
    3534public:
    3635    /** @name COM and internal init/term/mapping cruft.
    3736     * @{ */
    38     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(GuestDirectory, IGuestDirectory)
    39     DECLARE_NOT_AGGREGATABLE(GuestDirectory)
    40     DECLARE_PROTECT_FINAL_CONSTRUCT()
    41     BEGIN_COM_MAP(GuestDirectory)
    42         VBOX_DEFAULT_INTERFACE_ENTRIES(IGuestDirectory)
    43         COM_INTERFACE_ENTRY(IDirectory)
    44     END_COM_MAP()
    4537    DECLARE_EMPTY_CTOR_DTOR(GuestDirectory)
    4638
    4739    int     init(Console *pConsole, GuestSession *pSession, ULONG uDirID, const GuestDirectoryOpenInfo &openInfo);
    4840    void    uninit(void);
     41
    4942    HRESULT FinalConstruct(void);
    5043    void    FinalRelease(void);
    5144    /** @}  */
    5245
    53     /** @name IDirectory interface.
    54      * @{ */
    55     STDMETHOD(COMGETTER(DirectoryName))(BSTR *aName);
    56     STDMETHOD(COMGETTER(Filter))(BSTR *aFilter);
    57     STDMETHOD(Close)(void);
    58     STDMETHOD(Read)(IFsObjInfo **aInfo);
    59     /** @}  */
    6046
    6147public:
     
    6349     * @{ */
    6450    int            callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    65     static Utf8Str guestErrorToString(int guestRc);
    6651    int            onRemove(void);
    67     static HRESULT setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
     52
     53    static Utf8Str i_guestErrorToString(int guestRc);
     54    static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
    6855    /** @}  */
    6956
    7057private:
    7158
    72     /** @name Private internal methods.
     59    /** @name Private Wrapped properties
    7360     * @{ */
    7461    /** @}  */
     62    HRESULT getDirectoryName(com::Utf8Str &aDirectoryName);
     63    HRESULT getFilter(com::Utf8Str &aFilter);
     64
     65    /** @name Wrapped Private internal methods.
     66     * @{ */
     67    /** @}  */
     68     HRESULT close();
     69     HRESULT read(ComPtr<IFsObjInfo> &aObjInfo);
    7570
    7671    struct Data
  • trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp

    r50213 r50547  
    143143}
    144144
    145 // implementation of public getters/setters for attributes
     145// implementation of private wrapped getters/setters for attributes
    146146/////////////////////////////////////////////////////////////////////////////
    147147
    148 STDMETHODIMP GuestDirectory::COMGETTER(DirectoryName)(BSTR *aName)
    149 {
    150     LogFlowThisFuncEnter();
    151 
    152     CheckComArgOutPointerValid(aName);
    153 
    154     AutoCaller autoCaller(this);
    155     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     148HRESULT GuestDirectory::getDirectoryName(com::Utf8Str &aDirectoryName)
     149{
     150    LogFlowThisFuncEnter();
    156151
    157152    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    158153
    159     mData.mOpenInfo.mPath.cloneTo(aName);
     154    aDirectoryName = mData.mOpenInfo.mPath;
    160155
    161156    return S_OK;
    162157}
    163158
    164 STDMETHODIMP GuestDirectory::COMGETTER(Filter)(BSTR *aFilter)
    165 {
    166     LogFlowThisFuncEnter();
    167 
    168     CheckComArgOutPointerValid(aFilter);
    169 
    170     AutoCaller autoCaller(this);
    171     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     159HRESULT GuestDirectory::getFilter(com::Utf8Str &aFilter)
     160{
     161    LogFlowThisFuncEnter();
    172162
    173163    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    174164
    175     mData.mOpenInfo.mFilter.cloneTo(aFilter);
     165    aFilter = mData.mOpenInfo.mFilter;
    176166
    177167    return S_OK;
     
    229219
    230220/* static */
    231 Utf8Str GuestDirectory::guestErrorToString(int guestRc)
     221Utf8Str GuestDirectory::i_guestErrorToString(int guestRc)
    232222{
    233223    Utf8Str strError;
     
    263253
    264254/* static */
    265 HRESULT GuestDirectory::setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
     255HRESULT GuestDirectory::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
    266256{
    267257    AssertPtr(pInterface);
    268258    AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
    269259
    270     return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::guestErrorToString(guestRc).c_str());
     260    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::i_guestErrorToString(guestRc).c_str());
    271261}
    272262
    273263// implementation of public methods
    274264/////////////////////////////////////////////////////////////////////////////
    275 
    276 STDMETHODIMP GuestDirectory::Close(void)
     265HRESULT GuestDirectory::close()
    277266{
    278267#ifndef VBOX_WITH_GUEST_CONTROL
     
    319308}
    320309
    321 STDMETHODIMP GuestDirectory::Read(IFsObjInfo **aInfo)
     310HRESULT GuestDirectory::read(ComPtr<IFsObjInfo> &aObjInfo)
    322311{
    323312#ifndef VBOX_WITH_GUEST_CONTROL
     
    370359                {
    371360                    /* Return info object to the caller. */
    372                     hr2 = pFsObjInfo.queryInterfaceTo(aInfo);
     361                    hr2 = pFsObjInfo.queryInterfaceTo(aObjInfo.asOutParam());
    373362                    if (FAILED(hr2))
    374363                        rc = VERR_COM_UNEXPECTED;
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r50544 r50547  
    27802780
    27812781            case VERR_GSTCTL_GUEST_ERROR:
    2782                 hr = GuestDirectory::setErrorExternal(this, guestRc);
     2782                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
    27832783                break;
    27842784
     
    28852885
    28862886            case VERR_GSTCTL_GUEST_ERROR:
    2887                 hr = GuestDirectory::setErrorExternal(this, guestRc);
     2887                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
    28882888                break;
    28892889
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r50528 r50547  
    6969NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest)
    7070 #ifdef VBOX_WITH_GUEST_CONTROL
    71 NS_DECL_CLASSINFO(GuestDirectory)
    72 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestDirectory, IGuestDirectory, IDirectory)
    7371NS_DECL_CLASSINFO(GuestFile)
    7472NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestFile, IGuestFile, IFile)
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