Changeset 50922 in vbox for trunk/src/VBox
- Timestamp:
- Mar 28, 2014 4:16:41 PM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/PCIDeviceAttachmentImpl.h
r46373 r50922 21 21 #define ____H_PCIDEVICEATTACHMENTIMPL 22 22 23 #include " VirtualBoxBase.h"23 #include "PCIDeviceAttachmentWrap.h" 24 24 #include <VBox/settings.h> 25 25 26 26 class ATL_NO_VTABLE PCIDeviceAttachment : 27 public VirtualBoxBase, 28 VBOX_SCRIPTABLE_IMPL(IPCIDeviceAttachment) 27 public PCIDeviceAttachmentWrap 29 28 { 30 29 public: 31 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(PCIDeviceAttachment, IPCIDeviceAttachment)32 30 33 DECLARE_NOT_AGGREGATABLE(PCIDeviceAttachment) 34 35 DECLARE_PROTECT_FINAL_CONSTRUCT() 36 37 BEGIN_COM_MAP(PCIDeviceAttachment) 38 VBOX_DEFAULT_INTERFACE_ENTRIES(IPCIDeviceAttachment) 39 END_COM_MAP() 40 41 PCIDeviceAttachment() { } 42 ~PCIDeviceAttachment() { } 31 DECLARE_EMPTY_CTOR_DTOR(PCIDeviceAttachment) 43 32 44 33 // public initializer/uninitializer for internal purposes only … … 52 41 53 42 // settings 54 HRESULT loadSettings(IMachine * aParent,55 const settings::HostPCIDeviceAttachment& aHpda);56 HRESULT saveSettings(settings::HostPCIDeviceAttachment &data);43 HRESULT i_loadSettings(IMachine * aParent, 44 const settings::HostPCIDeviceAttachment& aHpda); 45 HRESULT i_saveSettings(settings::HostPCIDeviceAttachment &data); 57 46 58 47 HRESULT FinalConstruct(); 59 48 void FinalRelease(); 60 49 61 // IPCIDeviceAttachment properties 62 STDMETHOD(COMGETTER(Name))(BSTR * aName); 63 STDMETHOD(COMGETTER(IsPhysicalDevice))(BOOL * aPhysical); 64 STDMETHOD(COMGETTER(HostAddress))(LONG * hostAddress); 65 STDMETHOD(COMGETTER(GuestAddress))(LONG * guestAddress); 50 private: 66 51 67 private: 52 // wrapped IPCIDeviceAttachment properties 53 HRESULT getName(com::Utf8Str &aName); 54 HRESULT getIsPhysicalDevice(BOOL *aIsPhysicalDevice); 55 HRESULT getHostAddress(LONG *aHostAddress); 56 HRESULT getGuestAddress(LONG *aGuestAddress); 57 68 58 struct Data; 69 59 Data* m; -
trunk/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp
r42551 r50922 43 43 // constructor / destructor 44 44 ///////////////////////////////////////////////////////////////////////////// 45 DEFINE_EMPTY_CTOR_DTOR(PCIDeviceAttachment) 45 46 46 47 HRESULT PCIDeviceAttachment::FinalConstruct() … … 71 72 } 72 73 73 HRESULT PCIDeviceAttachment:: loadSettings(IMachine *aParent,74 const settings::HostPCIDeviceAttachment &hpda)74 HRESULT PCIDeviceAttachment::i_loadSettings(IMachine *aParent, 75 const settings::HostPCIDeviceAttachment &hpda) 75 76 { 76 77 Bstr bname(hpda.strDeviceName); … … 79 80 80 81 81 HRESULT PCIDeviceAttachment:: saveSettings(settings::HostPCIDeviceAttachment &data)82 HRESULT PCIDeviceAttachment::i_saveSettings(settings::HostPCIDeviceAttachment &data) 82 83 { 83 84 Assert(m); … … 104 105 // IPCIDeviceAttachment properties 105 106 ///////////////////////////////////////////////////////////////////////////// 106 107 STDMETHODIMP PCIDeviceAttachment::COMGETTER(Name)(BSTR * aName) 107 HRESULT PCIDeviceAttachment::getName(com::Utf8Str &aName) 108 108 { 109 CheckComArgOutPointerValid(aName); 110 m->DevName.cloneTo(aName); 109 aName = m->DevName; 111 110 return S_OK; 112 111 } 113 112 114 STDMETHODIMP PCIDeviceAttachment::COMGETTER(IsPhysicalDevice)(BOOL * aPhysical)113 HRESULT PCIDeviceAttachment::getIsPhysicalDevice(BOOL *aIsPhysicalDevice) 115 114 { 116 CheckComArgOutPointerValid(aPhysical); 117 *aPhysical = m->fPhysical; 115 *aIsPhysicalDevice = m->fPhysical; 118 116 return S_OK; 119 117 } 120 118 121 STDMETHODIMP PCIDeviceAttachment::COMGETTER(HostAddress)(LONG *aHostAddress)119 HRESULT PCIDeviceAttachment::getHostAddress(LONG *aHostAddress) 122 120 { 123 121 *aHostAddress = m->HostAddress; 124 122 return S_OK; 125 123 } 126 127 STDMETHODIMP PCIDeviceAttachment::COMGETTER(GuestAddress)(LONG * aGuestAddress) 124 HRESULT PCIDeviceAttachment::getGuestAddress(LONG *aGuestAddress) 128 125 { 129 126 *aGuestAddress = m->GuestAddress; 130 127 return S_OK; 131 128 } 132 133 #ifdef VBOX_WITH_XPCOM134 NS_DECL_CLASSINFO(PCIDeviceAttachment)135 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(PCIDeviceAttachment, IPCIDeviceAttachment)136 #endif -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r50919 r50922 9498 9498 9499 9499 pda.createObject(); 9500 pda-> loadSettings(this, hpda);9500 pda->i_loadSettings(this, hpda); 9501 9501 mHWData->mPCIDeviceAssignments.push_back(pda); 9502 9502 } … … 10791 10791 settings::HostPCIDeviceAttachment hpda; 10792 10792 10793 rc = pda-> saveSettings(hpda);10793 rc = pda->i_saveSettings(hpda); 10794 10794 if (FAILED(rc)) throw rc; 10795 10795
Note:
See TracChangeset
for help on using the changeset viewer.