- Timestamp:
- Mar 15, 2009 3:27:21 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DhcpServerImpl.cpp
r17881 r17887 49 49 AssertReturn (autoInitSpan.isOk(), E_FAIL); 50 50 51 /* share VirtualBox weakly (parent remains NULL so far) */ 52 unconst (mVirtualBox) = aVirtualBox; 53 51 54 unconst(mName) = aName; 55 m.IPAddress = "0.0.0.0"; 56 m.networkMask = "0.0.0.0"; 57 m.enabled = FALSE; 58 m.FromIPAddress = "0.0.0.0"; 59 m.ToIPAddress = "0.0.0.0"; 52 60 53 61 /* register with VirtualBox early, since uninit() will … … 68 76 AutoInitSpan autoInitSpan (this); 69 77 AssertReturn (autoInitSpan.isOk(), E_FAIL); 78 79 /* share VirtualBox weakly (parent remains NULL so far) */ 80 unconst (mVirtualBox) = aVirtualBox; 70 81 71 82 aVirtualBox->addDependentChild (this); … … 99 110 aNode.setValue <Bstr> ("IPAddress", m.IPAddress); 100 111 aNode.setValue <Bstr> ("networkMask", m.networkMask); 101 if(!m.FromIPAddress.isNull()) 102 aNode.setValue <Bstr> ("FromIPAddress", m.FromIPAddress); 103 if(!m.ToIPAddress.isNull()) 104 aNode.setValue <Bstr> ("ToIPAddress", m.ToIPAddress); 112 aNode.setValue <Bstr> ("FromIPAddress", m.FromIPAddress); 113 aNode.setValue <Bstr> ("ToIPAddress", m.ToIPAddress); 105 114 106 115 return S_OK; … … 138 147 CheckComRCReturnRC (autoCaller.rc()); 139 148 149 /* VirtualBox::saveSettings() needs a write lock */ 150 AutoMultiWriteLock2 alock (mVirtualBox, this); 151 140 152 m.enabled = aEnabled; 141 153 142 return S_OK; 143 154 HRESULT rc = mVirtualBox->saveSettings(); 155 156 return rc; 144 157 } 145 158 … … 203 216 AssertReturn (aToIPAddress != NULL, E_INVALIDARG); 204 217 218 AutoCaller autoCaller (this); 219 CheckComRCReturnRC (autoCaller.rc()); 220 221 /* VirtualBox::saveSettings() needs a write lock */ 222 AutoMultiWriteLock2 alock (mVirtualBox, this); 223 205 224 m.IPAddress = aIPAddress; 206 225 m.networkMask = aNetworkMask; … … 208 227 m.ToIPAddress = aToIPAddress; 209 228 210 return S_OK; 211 } 229 HRESULT rc = mVirtualBox->saveSettings(); 230 231 return rc; 232 } -
trunk/src/VBox/Main/include/DhcpServerImpl.h
r17881 r17887 79 79 80 80 private: 81 /** weak VirtualBox parent */ 82 const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox; 83 81 84 const Bstr mName; 82 85
Note:
See TracChangeset
for help on using the changeset viewer.