VirtualBox

Changeset 42546 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 2, 2012 2:45:37 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
79722
Message:

Guest Control 2.0: Update.

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

Legend:

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

    r42530 r42546  
    131131    const GuestCredentials &getCredentials(void);
    132132    const GuestEnvironment &getEnvironment(void);
     133    Utf8Str                 getName(void);
    133134    uint32_t                getProtocolVersion(void) { return mData.mProtocolVersion; }
    134135    int                     processClose(ComObjPtr<GuestProcess> pProcess);
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r42478 r42546  
    28442844STDMETHODIMP Guest::FindSession(IN_BSTR aSessionName, ComSafeArrayOut(IGuestSession *, aSessions))
    28452845{
     2846#ifndef VBOX_WITH_GUEST_CONTROL
    28462847    ReturnComNotImplemented();
    2847 }
    2848 
     2848#else /* VBOX_WITH_GUEST_CONTROL */
     2849
     2850    CheckComArgOutSafeArrayPointerValid(aSessions);
     2851
     2852    LogFlowFuncEnter();
     2853
     2854    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     2855
     2856    Utf8Str strName(aSessionName);
     2857    std::list < ComObjPtr<GuestSession> > listSessions;
     2858
     2859    GuestSessions::const_iterator itSessions = mData.mGuestSessions.begin();
     2860    while (itSessions != mData.mGuestSessions.end())
     2861    {
     2862        if (strName.equals(itSessions->second->getName()))
     2863            listSessions.push_back(itSessions->second);
     2864        itSessions++;
     2865    }
     2866
     2867    LogFlowFunc(("Sessions with \"%ls\" = %RU32\n",
     2868                 aSessionName, listSessions.size()));
     2869
     2870    if (listSessions.size())
     2871    {
     2872        SafeIfaceArray<IGuestSession> sessionIfacs(listSessions);
     2873        sessionIfacs.detachTo(ComSafeArrayOutArg(aSessions));
     2874
     2875        return S_OK;
     2876    }
     2877
     2878    return setErrorNoLog(VBOX_E_OBJECT_NOT_FOUND,
     2879                         tr("Could not find sessions with name '%ls'"),
     2880                         aSessionName);
     2881#endif /* VBOX_WITH_GUEST_CONTROL */
     2882}
     2883
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r42531 r42546  
    596596}
    597597
     598Utf8Str GuestSession::getName(void)
     599{
     600    return mData.mName;
     601}
     602
    598603int GuestSession::processClose(ComObjPtr<GuestProcess> pProcess)
    599604{
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