VirtualBox

Changeset 78786 in vbox for trunk


Ignore:
Timestamp:
May 27, 2019 2:53:06 PM (6 years ago)
Author:
vboxsync
Message:

Main/MediumAttachment: add attribute for querying the associated Machine object

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

Legend:

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

    r78784 r78786  
    1537315373  <interface
    1537415374    name="IMediumAttachment" extends="$unknown"
    15375     uuid="cbc97ce0-dfae-4c70-a6aa-769e5186363b"
     15375    uuid="8d095cb0-0126-43e0-b05d-326e74abb356"
    1537615376    wsmap="struct"
    1537715377    reservedAttributes="8"
     
    1555515555
    1555615556    </desc>
     15557
     15558    <attribute name="machine" type="IMachine" readonly="yes">
     15559      <desc>Machine object for this medium attachment.</desc>
     15560    </attribute>
    1555715561
    1555815562    <attribute name="medium" type="IMedium" readonly="yes">
  • trunk/src/VBox/Main/include/MediumAttachmentImpl.h

    r76562 r78786  
    113113
    114114    // Wrapped IMediumAttachment properties
     115    HRESULT getMachine(ComPtr<IMachine> &aMachine);
    115116    HRESULT getMedium(ComPtr<IMedium> &aHardDisk);
    116117    HRESULT getController(com::Utf8Str &aController);
  • trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp

    r76592 r78786  
    218218
    219219
     220HRESULT MediumAttachment::getMachine(ComPtr<IMachine> &aMachine)
     221{
     222    LogFlowThisFuncEnter();
     223
     224    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     225
     226    ComObjPtr<Machine> pMachine(m->pMachine);
     227    pMachine.queryInterfaceTo(aMachine.asOutParam());
     228
     229    LogFlowThisFuncLeave();
     230    return S_OK;
     231}
     232
     233
    220234HRESULT MediumAttachment::getMedium(ComPtr<IMedium> &aHardDisk)
    221235{
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette