VirtualBox

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


Ignore:
Timestamp:
Apr 9, 2013 9:30:55 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84855
Message:

GuestCtrl: Added EventSource getters + OnGuestFileRegistered event.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r45422 r45426  
    97509750      </desc>
    97519751    </attribute>
    9752 
    97539752    <attribute name="domain" type="wstring" readonly="yes">
    97549753      <desc>Returns the domain name used by this session to impersonate
     
    97569755      </desc>
    97579756    </attribute>
    9758 
    97599757    <attribute name="name" type="wstring" readonly="yes">
    97609758      <desc>Returns the session's friendly name.</desc>
    97619759    </attribute>
    9762 
    97639760    <attribute name="id" type="unsigned long" readonly="yes">
    97649761      <desc>Returns the internal session ID.</desc>
    97659762    </attribute>
    9766 
    97679763    <attribute name="timeout" type="unsigned long">
    97689764      <desc>
     
    97739769      </desc>
    97749770    </attribute>
    9775 
    97769771    <attribute name="status" type="GuestSessionStatus" readonly="yes">
    97779772      <desc>Returns the current session status.</desc>
    97789773    </attribute>
    9779 
    97809774    <attribute name="environment" type="wstring" safearray="yes">
    97819775      <desc>
     
    97839777      </desc>
    97849778    </attribute>
    9785 
    97869779    <attribute name="processes" type="IGuestProcess" readonly="yes" safearray="yes">
    97879780      <desc>
     
    97899782      </desc>
    97909783    </attribute>
    9791 
    97929784    <attribute name="directories" type="IGuestDirectory" readonly="yes" safearray="yes">
    97939785      <desc>
     
    97959787      </desc>
    97969788    </attribute>
    9797 
    97989789    <attribute name="files" type="IGuestFile" readonly="yes" safearray="yes">
    97999790      <desc>
     
    98019792      </desc>
    98029793    </attribute>
    9803 
    98049794    <attribute name="eventSource" type="IEventSource" readonly="yes">
    98059795      <desc>
     
    1058210572  <interface
    1058310573    name="IProcess" extends="$unknown"
    10584     uuid="08864d56-96ab-418b-adbc-5a679532aeb0"
     10574    uuid="5a4fe06d-8cb1-40ff-ac9e-9676e32f706e"
    1058510575    wsmap="managed"
    1058610576    >
     
    1058810578      Abstract parent interface for processes handled by VirtualBox.
    1058910579    </desc>
     10580
     10581    <attribute name="arguments" type="wstring" readonly="yes" safearray="yes">
     10582      <desc>
     10583        The arguments this process is using for execution.
     10584      </desc>
     10585    </attribute>
     10586    <attribute name="environment" type="wstring" readonly="yes" safearray="yes">
     10587      <desc>
     10588        The environment block this process is using during execution.
     10589      </desc>
     10590    </attribute>   
     10591    <attribute name="eventSource" type="IEventSource" readonly="yes">
     10592      <desc>
     10593        Event source for VirtualBox events.
     10594      </desc>
     10595    </attribute>
     10596    <attribute name="executablePath" type="wstring" readonly="yes">
     10597      <desc>Full path of the actual executable image.</desc>
     10598    </attribute>
     10599    <attribute name="exitCode" type="long" readonly="yes">
     10600      <desc>
     10601        The exit code. Only available when the process has been
     10602        terminated normally.
     10603      </desc>
     10604    </attribute>
     10605    <attribute name="name" type="wstring" readonly="yes">
     10606      <desc>
     10607        The friendly name of this process.
     10608      </desc>
     10609    </attribute>
    1059010610    <attribute name="PID" type="unsigned long" readonly="yes">
    1059110611      <desc>
     
    1059910619      </desc>
    1060010620    </attribute>
    10601     <attribute name="exitCode" type="long" readonly="yes">
    10602       <desc>
    10603         The exit code. Only available when the process has been
    10604         terminated normally.
    10605       </desc>
    10606     </attribute>
    10607     <attribute name="environment" type="wstring" readonly="yes" safearray="yes">
    10608       <desc>
    10609         The environment block this process is using during execution.
    10610       </desc>
    10611     </attribute>
    10612     <attribute name="arguments" type="wstring" readonly="yes" safearray="yes">
    10613       <desc>
    10614         The arguments this process is using for execution.
    10615       </desc>
    10616     </attribute>
    10617     <attribute name="executablePath" type="wstring" readonly="yes">
    10618       <desc>Full path of the actual executable image.</desc>
    10619     </attribute>
    10620     <attribute name="name" type="wstring" readonly="yes">
    10621       <desc>The friendly name of this process.</desc>
    10622     </attribute>
    10623 
     10621   
    1062410622    <method name="waitFor">
    1062510623      <desc>
     
    1082410822  <interface
    1082510823    name="IFile" extends="$unknown"
    10826     uuid="0b45a95f-6267-499e-a7f2-efa5f8e081f2"
     10824    uuid="ceb895d7-8b2d-4a39-8f7c-7d2270f341d5"
    1082710825    wsmap="managed"
    1082810826    >
     
    1083010828      Abstract parent interface for files handled by VirtualBox.
    1083110829    </desc>
     10830    <attribute name="creationMode" type="unsigned long" readonly="yes">
     10831      <desc>
     10832        The creation mode.
     10833      </desc>
     10834    </attribute>
     10835    <attribute name="disposition" type="unsigned long" readonly="yes">
     10836      <desc>
     10837        The disposition mode.
     10838      </desc>
     10839    </attribute>
     10840    <attribute name="eventSource" type="IEventSource" readonly="yes">
     10841      <desc>
     10842        Event source for guest session events.
     10843      </desc>
     10844    </attribute>
     10845    <attribute name="fileName" type="wstring" readonly="yes">
     10846      <desc>
     10847        Full path of the actual file name of this file.
     10848      </desc>
     10849    </attribute>
     10850    <attribute name="initialSize" type="long long" readonly="yes">
     10851      <desc>
     10852        The initial size in bytes when opened.
     10853      </desc>
     10854    </attribute>
     10855    <attribute name="openMode" type="unsigned long" readonly="yes">
     10856      <desc>
     10857        The open mode.
     10858      </desc>
     10859    </attribute>
     10860    <attribute name="offset" type="long long" readonly="yes">
     10861      <desc>
     10862        Current read/write offset in bytes.
     10863      </desc>
     10864    </attribute>
    1083210865    <attribute name="status" type="FileStatus" readonly="yes">
    1083310866      <desc>
    1083410867        TODO
    10835       </desc>
    10836     </attribute>
    10837     <attribute name="creationMode" type="unsigned long" readonly="yes">
    10838       <desc>
    10839         The creation mode.
    10840       </desc>
    10841     </attribute>
    10842     <attribute name="disposition" type="unsigned long" readonly="yes">
    10843       <desc>
    10844         The disposition mode.
    10845       </desc>
    10846     </attribute>
    10847     <attribute name="fileName" type="wstring" readonly="yes">
    10848       <desc>
    10849         Full path of the actual file name of this file.
    10850       </desc>
    10851     </attribute>
    10852     <attribute name="initialSize" type="long long" readonly="yes">
    10853       <desc>
    10854         The initial size in bytes when opened.
    10855       </desc>
    10856     </attribute>
    10857     <attribute name="openMode" type="unsigned long" readonly="yes">
    10858       <desc>
    10859         The open mode.
    10860       </desc>
    10861     </attribute>
    10862     <attribute name="offset" type="long long" readonly="yes">
    10863       <desc>
    10864         Current read/write offset in bytes.
    1086510868      </desc>
    1086610869    </attribute>
     
    1869618699  <enum
    1869718700    name="VBoxEventType"
    18698     uuid="83c03e4b-ffe5-421c-a0fb-0b27b2d56753"
     18701    uuid="c51645b3-7108-4dce-b5a3-bbf5e4f69ed2"
    1869918702    >
    1870018703
     
    1902419027      </desc>
    1902519028    </const>
    19026     <const name="OnGuestFileStateChanged" value="86">
     19029    <const name="OnGuestFileRegistered" value="86">
    1902719030      <desc>
    1902819031        TODO
    1902919032      </desc>
    1903019033    </const>
    19031     <const name="OnGuestFileOffsetChanged" value="87">
     19034    <const name="OnGuestFileStateChanged" value="87">
    1903219035      <desc>
    1903319036        TODO
    1903419037      </desc>
    1903519038    </const>
    19036     <const name="OnGuestFileRead" value="88">
     19039    <const name="OnGuestFileOffsetChanged" value="88">
     19040      <desc>
     19041        TODO
     19042      </desc>
     19043    </const>
     19044    <const name="OnGuestFileRead" value="89">
    1903719045      <desc>
    1903819046        For performance reasons ... TODO
    1903919047      </desc>
    1904019048    </const>
    19041     <const name="OnGuestFileWrite" value="89">
     19049    <const name="OnGuestFileWrite" value="90">
    1904219050      <desc>
    1904319051        For performance reasons ... TODO
     
    1904519053    </const>
    1904619054    <!-- Last event marker -->
    19047     <const name="Last" value="90">
     19055    <const name="Last" value="91">
    1904819056      <desc>
    1904919057        Must be last event, used for iterations and structures relying on numerical event values.
     
    2010020108  </interface>
    2010120109
     20110  <interface
     20111    name="IGuestFileRegisteredEvent" extends="IGuestFileEvent"
     20112    uuid="d0d93830-70a2-487e-895e-d3fc9679f7b3"
     20113    wsmap="managed" autogen="VBoxEvent" id="OnGuestFileRegistered"
     20114    >
     20115    <desc>
     20116      TODO
     20117    </desc>
     20118
     20119    <attribute name="registered" type="boolean" readonly="yes">
     20120      <desc>
     20121        TODO
     20122      </desc>
     20123    </attribute>
     20124
     20125  </interface>
     20126 
    2010220127  <interface
    2010320128    name="IGuestFileStateChangedEvent" extends="IGuestFileEvent"
  • trunk/src/VBox/Main/include/GuestFileImpl.h

    r45415 r45426  
    6060    STDMETHOD(COMGETTER(CreationMode))(ULONG *aCreationMode);
    6161    STDMETHOD(COMGETTER(Disposition))(ULONG *aDisposition);
     62    STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
    6263    STDMETHOD(COMGETTER(FileName))(BSTR *aFileName);
    6364    STDMETHOD(COMGETTER(InitialSize))(LONG64 *aInitialSize);
  • trunk/src/VBox/Main/include/GuestImpl.h

    r45415 r45426  
    8181    STDMETHOD(COMGETTER(AdditionsVersion))(BSTR *a_pbstrAdditionsVersion);
    8282    STDMETHOD(COMGETTER(AdditionsRevision))(ULONG *a_puAdditionsRevision);
     83    STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
    8384    STDMETHOD(COMGETTER(Facilities)) (ComSafeArrayOut(IAdditionsFacility *, aFacilities));
    8485    STDMETHOD(COMGETTER(Sessions)) (ComSafeArrayOut(IGuestSession *, aSessions));
     
    101102    STDMETHOD(DragGHDropped)(IN_BSTR strFormat, DragAndDropAction_T action, IProgress **ppProgress);
    102103    STDMETHOD(DragGHGetData)(ComSafeArrayOut(BYTE, data));
     104    // Guest control.
     105    STDMETHOD(CreateSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
     106    STDMETHOD(FindSession)(IN_BSTR aSessionName, ComSafeArrayOut(IGuestSession *, aSessions));
    103107    // Misc stuff
    104108    STDMETHOD(InternalGetStatistics)(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
     
    106110                                     ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
    107111    STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress);
    108     STDMETHOD(CreateSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
    109     STDMETHOD(FindSession)(IN_BSTR aSessionName, ComSafeArrayOut(IGuestSession *, aSessions));
    110112
    111113public:
  • trunk/src/VBox/Main/include/GuestProcessImpl.h

    r45415 r45426  
    5656    STDMETHOD(COMGETTER(Arguments))(ComSafeArrayOut(BSTR, aArguments));
    5757    STDMETHOD(COMGETTER(Environment))(ComSafeArrayOut(BSTR, aEnvironment));
     58    STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
    5859    STDMETHOD(COMGETTER(ExecutablePath))(BSTR *aExecutablePath);
    5960    STDMETHOD(COMGETTER(ExitCode))(LONG *aExitCode);
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r45418 r45426  
    169169    return S_OK;
    170170#endif /* VBOX_WITH_GUEST_CONTROL */
     171}
     172
     173STDMETHODIMP GuestFile::COMGETTER(EventSource)(IEventSource ** aEventSource)
     174{
     175    CheckComArgOutPointerValid(aEventSource);
     176
     177    AutoCaller autoCaller(this);
     178    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     179
     180    // no need to lock - lifetime constant
     181    mEventSource.queryInterfaceTo(aEventSource);
     182
     183    return S_OK;
    171184}
    172185
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r45415 r45426  
    489489}
    490490
     491STDMETHODIMP Guest::COMGETTER(EventSource)(IEventSource ** aEventSource)
     492{
     493#ifndef VBOX_WITH_GUEST_CONTROL
     494    ReturnComNotImplemented();
     495#else
     496    LogFlowThisFuncEnter();
     497
     498    CheckComArgOutPointerValid(aEventSource);
     499
     500    AutoCaller autoCaller(this);
     501    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     502
     503    // no need to lock - lifetime constant
     504    mEventSource.queryInterfaceTo(aEventSource);
     505
     506    LogFlowFuncLeaveRC(S_OK);
     507    return S_OK;
     508#endif /* VBOX_WITH_GUEST_CONTROL */
     509}
     510
    491511STDMETHODIMP Guest::COMGETTER(Facilities)(ComSafeArrayOut(IAdditionsFacility *, aFacilities))
    492512{
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r45415 r45426  
    9090{
    9191    LogFlowThisFuncEnter();
    92 
    93     mData.mExitCode = 0;
    94     mData.mPID = 0;
    95     mData.mRC = VINF_SUCCESS;
    96     mData.mStatus = ProcessStatus_Undefined;
    97 
    9892    return BaseFinalConstruct();
    9993}
     
    123117    AssertReturn(autoInitSpan.isOk(), VERR_OBJECT_DESTROYED);
    124118
     119#ifndef VBOX_WITH_GUEST_CONTROL
     120    autoInitSpan.setSucceeded();
     121    return VINF_SUCCESS;
     122#else
    125123    int vrc = bindToSession(aConsole, aSession, aProcessID /* Object ID */);
    126124    if (RT_SUCCESS(vrc))
     
    136134    {
    137135        mData.mProcess = aProcInfo;
     136        mData.mExitCode = 0;
     137        mData.mPID = 0;
     138        mData.mRC = VINF_SUCCESS;
     139        mData.mStatus = ProcessStatus_Undefined;
    138140        /* Everything else will be set by the actual starting routine. */
    139141
     
    146148    autoInitSpan.setFailed();
    147149    return vrc;
     150#endif
    148151}
    149152
     
    226229    arguments.detachTo(ComSafeArrayOutArg(aEnvironment));
    227230
     231    return S_OK;
     232#endif /* VBOX_WITH_GUEST_CONTROL */
     233}
     234
     235STDMETHODIMP GuestProcess::COMGETTER(EventSource)(IEventSource ** aEventSource)
     236{
     237#ifndef VBOX_WITH_GUEST_CONTROL
     238    ReturnComNotImplemented();
     239#else
     240    LogFlowThisFuncEnter();
     241
     242    CheckComArgOutPointerValid(aEventSource);
     243
     244    AutoCaller autoCaller(this);
     245    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     246
     247    // no need to lock - lifetime constant
     248    mEventSource.queryInterfaceTo(aEventSource);
     249
     250    LogFlowFuncLeaveRC(S_OK);
    228251    return S_OK;
    229252#endif /* VBOX_WITH_GUEST_CONTROL */
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r45418 r45426  
    9292{
    9393    LogFlowThisFunc(("\n"));
    94 
    95     mData.mRC = VINF_SUCCESS;
    96     mData.mStatus = GuestSessionStatus_Undefined;
    97 
    9894    return BaseFinalConstruct();
    9995}
     
    123119                      pGuest, &ssInfo, &guestCreds));
    124120
    125     AssertPtrReturn(pGuest, VERR_INVALID_POINTER);
    126 
    127121    /* Enclose the state transition NotReady->InInit->Ready. */
    128122    AutoInitSpan autoInitSpan(this);
    129123    AssertReturn(autoInitSpan.isOk(), VERR_OBJECT_DESTROYED);
     124
     125#ifndef VBOX_WITH_GUEST_CONTROL
     126    autoInitSpan.setSucceeded();
     127    return VINF_SUCCESS;
     128#else
     129    AssertPtrReturn(pGuest, VERR_INVALID_POINTER);
    130130
    131131    mParent = pGuest;
     
    144144    mData.mCredentials.mDomain = guestCreds.mDomain;
    145145
     146    mData.mRC = VINF_SUCCESS;
    146147    mData.mStatus = GuestSessionStatus_Undefined;
    147148    mData.mNumObjects = 0;
     
    167168    LogFlowFuncLeaveRC(rc);
    168169    return rc;
     170#endif /* VBOX_WITH_GUEST_CONTROL */
    169171}
    170172
     
    495497STDMETHODIMP GuestSession::COMGETTER(EventSource)(IEventSource ** aEventSource)
    496498{
     499#ifndef VBOX_WITH_GUEST_CONTROL
     500    ReturnComNotImplemented();
     501#else
     502    LogFlowThisFuncEnter();
     503
    497504    CheckComArgOutPointerValid(aEventSource);
    498505
     
    503510    mEventSource.queryInterfaceTo(aEventSource);
    504511
     512    LogFlowFuncLeaveRC(S_OK);
    505513    return S_OK;
     514#endif /* VBOX_WITH_GUEST_CONTROL */
    506515}
    507516
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