Changeset 49871 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Dec 10, 2013 4:49:59 PM (11 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/AudioAdapterImpl.cpp
r44528 r49871 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 #include "AutoCaller.h" 27 27 #include "Logging.h" 28 29 struct AudioAdapter::Data 30 { 31 Data(); 32 BOOL mEnabled; 33 AudioDriverType_T mAudioDriver; 34 AudioControllerType_T mAudioController; 35 }; 28 36 29 37 // constructor / destructor … … 180 188 ///////////////////////////////////////////////////////////////////////////// 181 189 182 STDMETHODIMP AudioAdapter::COMGETTER(Enabled)(BOOL *aEnabled) 183 { 184 CheckComArgOutPointerValid(aEnabled); 185 186 AutoCaller autoCaller(this); 187 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 188 190 HRESULT AudioAdapter::getEnabled(BOOL *aEnabled) 191 { 189 192 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 190 193 … … 194 197 } 195 198 196 STDMETHODIMP AudioAdapter::COMSETTER(Enabled)(BOOL aEnabled) 197 { 198 AutoCaller autoCaller(this); 199 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 200 199 HRESULT AudioAdapter::setEnabled(BOOL aEnabled) 200 { 201 201 /* the machine needs to be mutable */ 202 202 AutoMutableStateDependency adep(mParent); … … 218 218 } 219 219 220 STDMETHODIMP AudioAdapter::COMGETTER(AudioDriver)(AudioDriverType_T *aAudioDriver) 221 { 222 CheckComArgOutPointerValid(aAudioDriver); 223 224 AutoCaller autoCaller(this); 225 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 226 220 HRESULT AudioAdapter::getAudioDriver(AudioDriverType_T *aAudioDriver) 221 { 227 222 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 228 223 … … 232 227 } 233 228 234 STDMETHODIMP AudioAdapter::COMSETTER(AudioDriver)(AudioDriverType_T aAudioDriver) 235 { 236 AutoCaller autoCaller(this); 237 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 229 HRESULT AudioAdapter::setAudioDriver(AudioDriverType_T aAudioDriver) 230 { 238 231 239 232 /* the machine needs to be mutable */ … … 251 244 mData.backup(); 252 245 mData->mAudioDriver = aAudioDriver; 253 254 246 alock.release(); 255 247 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking … … 266 258 } 267 259 268 STDMETHODIMP AudioAdapter::COMGETTER(AudioController)(AudioControllerType_T *aAudioController) 269 { 270 CheckComArgOutPointerValid(aAudioController); 271 272 AutoCaller autoCaller(this); 273 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 274 260 HRESULT AudioAdapter::getAudioController(AudioControllerType_T *aAudioController) 261 { 275 262 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 276 263 … … 280 267 } 281 268 282 STDMETHODIMP AudioAdapter::COMSETTER(AudioController)(AudioControllerType_T aAudioController) 283 { 284 AutoCaller autoCaller(this); 285 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 286 269 HRESULT AudioAdapter::setAudioController(AudioControllerType_T aAudioController) 270 { 287 271 /* the machine needs to be mutable */ 288 272 AutoMutableStateDependency adep(mParent); … … 306 290 mData.backup(); 307 291 mData->mAudioController = aAudioController; 308 309 292 alock.release(); 310 293 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking … … 346 329 * @note Locks this object for writing. 347 330 */ 348 HRESULT AudioAdapter:: loadSettings(const settings::AudioAdapter &data)331 HRESULT AudioAdapter::i_loadSettings(const settings::AudioAdapter &data) 349 332 { 350 333 AutoCaller autoCaller(this); … … 378 361 * @note Locks this object for reading. 379 362 */ 380 HRESULT AudioAdapter:: saveSettings(settings::AudioAdapter &data)363 HRESULT AudioAdapter::i_saveSettings(settings::AudioAdapter &data) 381 364 { 382 365 AutoCaller autoCaller(this); … … 394 377 * @note Locks this object for writing. 395 378 */ 396 void AudioAdapter:: rollback()379 void AudioAdapter::i_rollback() 397 380 { 398 381 /* sanity */ … … 409 392 * for writing) if there is one. 410 393 */ 411 void AudioAdapter:: commit()394 void AudioAdapter::i_commit() 412 395 { 413 396 /* sanity */ … … 438 421 * represented by @a aThat (locked for reading). 439 422 */ 440 void AudioAdapter:: copyFrom(AudioAdapter *aThat)423 void AudioAdapter::i_copyFrom(AudioAdapter *aThat) 441 424 { 442 425 AssertReturnVoid (aThat != NULL); -
trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp
r49644 r49871 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 49 49 ///////////////////////////////////////////////////////////////////////////// 50 50 51 DEFINE_EMPTY_CTOR_DTOR(BIOSSettings) 52 51 53 HRESULT BIOSSettings::FinalConstruct() 52 54 { … … 182 184 ///////////////////////////////////////////////////////////////////////////// 183 185 184 STDMETHODIMP BIOSSettings::COMGETTER(LogoFadeIn)(BOOL *enabled) 185 { 186 if (!enabled) 187 return E_POINTER; 188 189 AutoCaller autoCaller(this); 190 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 191 186 187 HRESULT BIOSSettings::getLogoFadeIn(BOOL *enabled) 188 { 192 189 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 193 190 … … 197 194 } 198 195 199 STDMETHODIMP BIOSSettings::COMSETTER(LogoFadeIn)(BOOL enable) 200 { 201 AutoCaller autoCaller(this); 202 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 203 196 HRESULT BIOSSettings::setLogoFadeIn(BOOL enable) 197 { 204 198 /* the machine needs to be mutable */ 205 199 AutoMutableStateDependency adep(m->pMachine); … … 218 212 } 219 213 220 STDMETHODIMP BIOSSettings::COMGETTER(LogoFadeOut)(BOOL *enabled) 221 { 222 if (!enabled) 223 return E_POINTER; 224 225 AutoCaller autoCaller(this); 226 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 227 214 215 HRESULT BIOSSettings::getLogoFadeOut(BOOL *enabled) 216 { 228 217 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 229 218 … … 233 222 } 234 223 235 STDMETHODIMP BIOSSettings::COMSETTER(LogoFadeOut)(BOOL enable) 236 { 237 AutoCaller autoCaller(this); 238 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 239 224 225 HRESULT BIOSSettings::setLogoFadeOut(BOOL enable) 226 { 240 227 /* the machine needs to be mutable */ 241 228 AutoMutableStateDependency adep(m->pMachine); … … 254 241 } 255 242 256 STDMETHODIMP BIOSSettings::COMGETTER(LogoDisplayTime)(ULONG *displayTime) 243 244 HRESULT BIOSSettings::getLogoDisplayTime(ULONG *displayTime) 257 245 { 258 246 if (!displayTime) 259 247 return E_POINTER; 260 248 261 AutoCaller autoCaller(this);262 if (FAILED(autoCaller.rc())) return autoCaller.rc();263 264 249 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 265 250 … … 269 254 } 270 255 271 STDMETHODIMP BIOSSettings::COMSETTER(LogoDisplayTime)(ULONG displayTime) 272 { 273 AutoCaller autoCaller(this); 274 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 275 256 257 HRESULT BIOSSettings::setLogoDisplayTime(ULONG displayTime) 258 { 276 259 /* the machine needs to be mutable */ 277 260 AutoMutableStateDependency adep(m->pMachine); … … 290 273 } 291 274 292 STDMETHODIMP BIOSSettings::COMGETTER(LogoImagePath)(BSTR *imagePath) 293 { 294 if (!imagePath) 295 return E_POINTER; 296 297 AutoCaller autoCaller(this); 298 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 299 300 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 301 302 m->bd->strLogoImagePath.cloneTo(imagePath); 303 return S_OK; 304 } 305 306 STDMETHODIMP BIOSSettings::COMSETTER(LogoImagePath)(IN_BSTR imagePath) 307 { 308 /* NULL strings are not allowed */ 309 if (!imagePath) 310 return E_INVALIDARG; 311 312 AutoCaller autoCaller(this); 313 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 314 275 276 HRESULT BIOSSettings::getLogoImagePath(com::Utf8Str &imagePath) 277 { 278 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 279 280 imagePath = m->bd->strLogoImagePath; 281 return S_OK; 282 } 283 284 285 HRESULT BIOSSettings::setLogoImagePath(const com::Utf8Str &imagePath) 286 { 315 287 /* the machine needs to be mutable */ 316 288 AutoMutableStateDependency adep(m->pMachine); … … 329 301 } 330 302 331 STDMETHODIMP BIOSSettings::COMGETTER(BootMenuMode)(BIOSBootMenuMode_T *bootMenuMode) 332 { 333 if (!bootMenuMode) 334 return E_POINTER; 335 336 AutoCaller autoCaller(this); 337 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 338 303 HRESULT BIOSSettings::getBootMenuMode(BIOSBootMenuMode_T *bootMenuMode) 304 { 339 305 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 340 306 … … 343 309 } 344 310 345 STDMETHODIMP BIOSSettings::COMSETTER(BootMenuMode)(BIOSBootMenuMode_T bootMenuMode) 346 { 347 AutoCaller autoCaller(this); 348 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 349 311 312 HRESULT BIOSSettings::setBootMenuMode(BIOSBootMenuMode_T bootMenuMode) 313 { 350 314 /* the machine needs to be mutable */ 351 315 AutoMutableStateDependency adep(m->pMachine); … … 364 328 } 365 329 366 STDMETHODIMP BIOSSettings::COMGETTER(ACPIEnabled)(BOOL *enabled) 367 { 368 if (!enabled) 369 return E_POINTER; 370 371 AutoCaller autoCaller(this); 372 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 373 330 331 HRESULT BIOSSettings::getACPIEnabled(BOOL *enabled) 332 { 374 333 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 375 334 … … 379 338 } 380 339 381 STDMETHODIMP BIOSSettings::COMSETTER(ACPIEnabled)(BOOL enable) 382 { 383 AutoCaller autoCaller(this); 384 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 385 340 341 HRESULT BIOSSettings::setACPIEnabled(BOOL enable) 342 { 386 343 /* the machine needs to be mutable */ 387 344 AutoMutableStateDependency adep(m->pMachine); … … 400 357 } 401 358 402 STDMETHODIMP BIOSSettings::COMGETTER(IOAPICEnabled)(BOOL *enabled) 403 { 404 if (!enabled) 405 return E_POINTER; 406 407 AutoCaller autoCaller(this); 408 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 409 410 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 411 412 *enabled = m->bd->fIOAPICEnabled; 413 414 return S_OK; 415 } 416 417 STDMETHODIMP BIOSSettings::COMSETTER(IOAPICEnabled)(BOOL enable) 418 { 419 AutoCaller autoCaller(this); 420 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 421 422 /* the machine needs to be mutable */ 423 AutoMutableStateDependency adep(m->pMachine); 424 if (FAILED(adep.rc())) return adep.rc(); 425 426 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 427 428 m->bd.backup(); 429 m->bd->fIOAPICEnabled = !!enable; 430 431 alock.release(); 432 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking 433 m->pMachine->setModified(Machine::IsModified_BIOS); 434 435 return S_OK; 436 } 437 438 STDMETHODIMP BIOSSettings::COMGETTER(PXEDebugEnabled)(BOOL *enabled) 439 { 440 if (!enabled) 441 return E_POINTER; 442 443 AutoCaller autoCaller(this); 444 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 445 359 360 HRESULT BIOSSettings::getIOAPICEnabled(BOOL *aIOAPICEnabled) 361 { 362 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 363 364 *aIOAPICEnabled = m->bd->fIOAPICEnabled; 365 366 return S_OK; 367 } 368 369 370 HRESULT BIOSSettings::setIOAPICEnabled(BOOL aIOAPICEnabled) 371 { 372 /* the machine needs to be mutable */ 373 AutoMutableStateDependency adep(m->pMachine); 374 if (FAILED(adep.rc())) return adep.rc(); 375 376 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 377 378 m->bd.backup(); 379 380 m->bd->fIOAPICEnabled = !!aIOAPICEnabled; 381 alock.release(); 382 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking 383 m->pMachine->setModified(Machine::IsModified_BIOS); 384 385 return S_OK; 386 } 387 388 389 HRESULT BIOSSettings::getPXEDebugEnabled(BOOL *enabled) 390 { 446 391 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 447 392 … … 451 396 } 452 397 453 STDMETHODIMP BIOSSettings::COMSETTER(PXEDebugEnabled)(BOOL enable) 454 { 455 AutoCaller autoCaller(this); 456 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 457 398 399 HRESULT BIOSSettings::setPXEDebugEnabled(BOOL enable) 400 { 458 401 /* the machine needs to be mutable */ 459 402 AutoMutableStateDependency adep(m->pMachine); … … 472 415 } 473 416 474 STDMETHODIMP BIOSSettings::COMGETTER(TimeOffset)(LONG64 *offset) 475 { 476 if (!offset) 477 return E_POINTER; 478 479 AutoCaller autoCaller(this); 480 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 481 417 HRESULT BIOSSettings::getTimeOffset(LONG64 *offset) 418 { 482 419 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 483 420 … … 487 424 } 488 425 489 STDMETHODIMP BIOSSettings::COMSETTER(TimeOffset)(LONG64 offset) 490 { 491 AutoCaller autoCaller(this); 492 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 493 426 427 HRESULT BIOSSettings::setTimeOffset(LONG64 offset) 428 { 494 429 /* the machine needs to be mutable */ 495 430 AutoMutableStateDependency adep(m->pMachine); … … 508 443 } 509 444 510 STDMETHODIMP BIOSSettings::COMGETTER(NonVolatileStorageFile)(BSTR *pbstrPath) 511 { 512 CheckComArgOutPointerValid(pbstrPath); 513 514 AutoCaller autoCaller(this); 515 HRESULT hrc = autoCaller.rc(); 516 if (SUCCEEDED(hrc)) 517 { 518 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 519 Bstr bstrEmpty(""); 520 hrc = bstrEmpty.cloneToEx(pbstrPath); 521 } 522 523 return hrc; 445 HRESULT BIOSSettings::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile) 446 { 447 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 448 449 aNonVolatileStorageFile = ""; 450 451 return S_OK; 524 452 } 525 453 … … 540 468 * @note Locks this object for writing. 541 469 */ 542 HRESULT BIOSSettings:: loadSettings(const settings::BIOSSettings &data)470 HRESULT BIOSSettings::i_loadSettings(const settings::BIOSSettings &data) 543 471 { 544 472 AutoCaller autoCaller(this); … … 560 488 * @note Locks this object for reading. 561 489 */ 562 HRESULT BIOSSettings:: saveSettings(settings::BIOSSettings &data)490 HRESULT BIOSSettings::i_saveSettings(settings::BIOSSettings &data) 563 491 { 564 492 AutoCaller autoCaller(this); … … 572 500 } 573 501 574 void BIOSSettings:: rollback()502 void BIOSSettings::i_rollback() 575 503 { 576 504 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 578 506 } 579 507 580 void BIOSSettings:: commit()508 void BIOSSettings::i_commit() 581 509 { 582 510 /* sanity */ … … 604 532 } 605 533 606 void BIOSSettings:: copyFrom (BIOSSettings *aThat)534 void BIOSSettings::i_copyFrom (BIOSSettings *aThat) 607 535 { 608 536 AssertReturnVoid (aThat != NULL); … … 625 553 } 626 554 627 void BIOSSettings:: applyDefaults (GuestOSType *aOsType)555 void BIOSSettings::i_applyDefaults (GuestOSType *aOsType) 628 556 { 629 557 AssertReturnVoid (aOsType != NULL); -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r49795 r49871 2999 2999 { 3000 3000 # ifdef VBOX_WITH_RESOURCE_USAGE_API 3001 (*itOld)-> unregisterMetrics(aCollector, this);3001 (*itOld)->i_unregisterMetrics(aCollector, this); 3002 3002 # endif 3003 3003 } … … 3008 3008 */ 3009 3009 for (itNew = list.begin(); itNew != list.end(); ++itNew) 3010 (*itNew)-> setVirtualBox(m->pParent);3010 (*itNew)->i_setVirtualBox(m->pParent); 3011 3011 /* At this point listCopy will contain newly discovered interfaces only. */ 3012 3012 for (itNew = listCopy.begin(); itNew != listCopy.end(); ++itNew) … … 3023 3023 { 3024 3024 # ifdef VBOX_WITH_RESOURCE_USAGE_API 3025 (*itNew)-> registerMetrics(aCollector, this);3025 (*itNew)->i_registerMetrics(aCollector, this); 3026 3026 # endif 3027 3027 } -
trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp
r49400 r49871 17 17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 18 18 */ 19 20 19 #include "HostNetworkInterfaceImpl.h" 21 20 #include "AutoCaller.h" … … 33 32 #endif /* RT_OS_FREEBSD */ 34 33 34 #include "VirtualBoxImpl.h" 35 35 36 // constructor / destructor 36 37 ///////////////////////////////////////////////////////////////////////////// … … 79 80 80 81 unconst(mInterfaceName) = aInterfaceName; 81 unconst(mNetworkName) = composeNetworkName(aShortName);82 unconst(mNetworkName) = i_composeNetworkName(aShortName); 82 83 unconst(mShortName) = aShortName; 83 84 unconst(mGuid) = aGuid; … … 92 93 #ifdef VBOX_WITH_RESOURCE_USAGE_API 93 94 94 void HostNetworkInterface:: registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)95 void HostNetworkInterface::i_registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr) 95 96 { 96 97 LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}, mSpeedMbits=%u\n", … … 137 138 } 138 139 139 void HostNetworkInterface:: unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)140 void HostNetworkInterface::i_unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr) 140 141 { 141 142 LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}\n", … … 175 176 } 176 177 177 Bstr HostNetworkInterface:: composeNetworkName(const Utf8Str aShortName)178 Bstr HostNetworkInterface::i_composeNetworkName(const Utf8Str aShortName) 178 179 { 179 180 return Utf8Str("HostInterfaceNetworking-").append(aShortName); … … 203 204 if (pIf->szShortName[0]) 204 205 { 205 unconst(mNetworkName) = composeNetworkName(pIf->szShortName);206 unconst(mNetworkName) = i_composeNetworkName(pIf->szShortName); 206 207 unconst(mShortName) = pIf->szShortName; 207 208 } 208 209 else 209 210 { 210 unconst(mNetworkName) = composeNetworkName(aInterfaceName);211 unconst(mNetworkName) = i_composeNetworkName(aInterfaceName); 211 212 unconst(mShortName) = aInterfaceName; 212 213 } … … 235 236 #endif 236 237 237 // IHostNetworkInterface properties238 // wrapped IHostNetworkInterface properties 238 239 ///////////////////////////////////////////////////////////////////////////// 239 240 240 /** 241 241 * Returns the name of the host network interface. 242 242 * 243 243 * @returns COM status code 244 * @param aInterfaceName address of result pointer 245 */ 246 STDMETHODIMP HostNetworkInterface::COMGETTER(Name)(BSTR *aInterfaceName) 247 { 248 CheckComArgOutPointerValid(aInterfaceName); 249 250 AutoCaller autoCaller(this); 251 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 252 253 mInterfaceName.cloneTo(aInterfaceName); 254 244 * @param aInterfaceName - Interface Name 245 */ 246 247 HRESULT HostNetworkInterface::getName(com::Utf8Str &aInterfaceName) 248 { 249 aInterfaceName = mInterfaceName; 255 250 return S_OK; 256 251 } … … 259 254 * Returns the short name of the host network interface. 260 255 * 261 * @returns COM status code 262 * @param aShortName address of result pointer 263 */ 264 STDMETHODIMP HostNetworkInterface::COMGETTER(ShortName)(BSTR *aShortName) 265 { 266 CheckComArgOutPointerValid(aShortName); 267 268 AutoCaller autoCaller(this); 269 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 270 271 mShortName.cloneTo(aShortName); 256 * @returns COM status code 257 * @param aShortName Short Name 258 */ 259 260 HRESULT HostNetworkInterface::getShortName(com::Utf8Str &aShortName) 261 { 262 aShortName = mShortName; 272 263 273 264 return S_OK; … … 278 269 * 279 270 * @returns COM status code 280 * @param aGuid address of result pointer 281 */ 282 STDMETHODIMP HostNetworkInterface::COMGETTER(Id)(BSTR *aGuid) 283 { 284 CheckComArgOutPointerValid(aGuid); 285 286 AutoCaller autoCaller(this); 287 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 288 289 mGuid.toUtf16().cloneTo(aGuid); 290 291 return S_OK; 292 } 293 294 STDMETHODIMP HostNetworkInterface::COMGETTER(DHCPEnabled)(BOOL *aDHCPEnabled) 295 { 296 CheckComArgOutPointerValid(aDHCPEnabled); 297 298 AutoCaller autoCaller(this); 299 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 300 271 * @param aGuid GUI Id 272 */ 273 HRESULT HostNetworkInterface::getId(com::Guid &aGuiId) 274 { 275 aGuiId = mGuid; 276 277 return S_OK; 278 } 279 280 HRESULT HostNetworkInterface::getDHCPEnabled(BOOL *aDHCPEnabled) 281 { 301 282 *aDHCPEnabled = m.dhcpEnabled; 302 283 … … 309 290 * 310 291 * @returns COM status code 311 * @param aIPAddress address of result pointer 312 */ 313 STDMETHODIMP HostNetworkInterface::COMGETTER(IPAddress)(BSTR *aIPAddress) 314 { 315 CheckComArgOutPointerValid(aIPAddress); 316 317 AutoCaller autoCaller(this); 318 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 319 292 * @param aIPAddress Address name 293 */ 294 HRESULT HostNetworkInterface::getIPAddress(com::Utf8Str &aIPAddress) 295 { 320 296 in_addr tmp; 321 297 #if defined(RT_OS_WINDOWS) … … 327 303 if (addr) 328 304 { 329 Bstr(addr).detachTo(aIPAddress);305 aIPAddress = addr; 330 306 return S_OK; 331 307 } … … 338 314 * 339 315 * @returns COM status code 340 * @param aNetworkMask address of result pointer 341 */ 342 STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkMask)(BSTR *aNetworkMask) 343 { 344 CheckComArgOutPointerValid(aNetworkMask); 345 346 AutoCaller autoCaller(this); 347 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 316 * @param aNetworkMask name. 317 */ 318 HRESULT HostNetworkInterface::getNetworkMask(com::Utf8Str &aNetworkMask) 319 { 348 320 349 321 in_addr tmp; … … 356 328 if (addr) 357 329 { 358 Bstr(addr).detachTo(aNetworkMask);330 aNetworkMask = Utf8Str(addr); 359 331 return S_OK; 360 332 } … … 363 335 } 364 336 365 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Supported)(BOOL *aIPV6Supported) 366 { 367 CheckComArgOutPointerValid(aIPV6Supported); 337 HRESULT HostNetworkInterface::getIPV6Supported(BOOL *aIPV6Supported) 338 { 368 339 #if defined(RT_OS_WINDOWS) 369 340 *aIPV6Supported = FALSE; … … 379 350 * 380 351 * @returns COM status code 381 * @param aIPV6Address address of result pointer 382 */ 383 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Address)(BSTR *aIPV6Address) 384 { 385 CheckComArgOutPointerValid(aIPV6Address); 386 387 AutoCaller autoCaller(this); 388 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 389 390 m.IPV6Address.cloneTo(aIPV6Address); 391 352 * @param aIPV6Address 353 */ 354 HRESULT HostNetworkInterface::getIPV6Address(com::Utf8Str &aIPV6Address) 355 { 356 aIPV6Address = m.IPV6Address; 392 357 return S_OK; 393 358 } … … 399 364 * @param aIPV6Mask address of result pointer 400 365 */ 401 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6NetworkMaskPrefixLength)(ULONG *aIPV6NetworkMaskPrefixLength) 402 { 403 CheckComArgOutPointerValid(aIPV6NetworkMaskPrefixLength); 404 405 AutoCaller autoCaller(this); 406 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 407 366 HRESULT HostNetworkInterface::getIPV6NetworkMaskPrefixLength(ULONG *aIPV6NetworkMaskPrefixLength) 367 { 408 368 *aIPV6NetworkMaskPrefixLength = m.IPV6NetworkMaskPrefixLength; 409 369 … … 415 375 * 416 376 * @returns COM status code 417 * @param aHardwareAddress address of result pointer 418 */ 419 STDMETHODIMP HostNetworkInterface::COMGETTER(HardwareAddress)(BSTR *aHardwareAddress) 420 { 421 CheckComArgOutPointerValid(aHardwareAddress); 422 423 AutoCaller autoCaller(this); 424 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 425 426 m.hardwareAddress.cloneTo(aHardwareAddress); 427 377 * @param aHardwareAddress hardware address 378 */ 379 HRESULT HostNetworkInterface::getHardwareAddress(com::Utf8Str &aHardwareAddress) 380 { 381 aHardwareAddress = m.hardwareAddress; 428 382 return S_OK; 429 383 } … … 435 389 * @param aType address of result pointer 436 390 */ 437 STDMETHODIMP HostNetworkInterface::COMGETTER(MediumType)(HostNetworkInterfaceMediumType_T *aType) 438 { 439 CheckComArgOutPointerValid(aType); 440 441 AutoCaller autoCaller(this); 442 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 443 391 HRESULT HostNetworkInterface::getMediumType(HostNetworkInterfaceMediumType_T *aType) 392 { 444 393 *aType = m.mediumType; 445 394 … … 453 402 * @param aStatus address of result pointer 454 403 */ 455 STDMETHODIMP HostNetworkInterface::COMGETTER(Status)(HostNetworkInterfaceStatus_T *aStatus) 456 { 457 CheckComArgOutPointerValid(aStatus); 458 459 AutoCaller autoCaller(this); 460 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 461 404 HRESULT HostNetworkInterface::getStatus(HostNetworkInterfaceStatus_T *aStatus) 405 { 462 406 *aStatus = m.status; 463 407 … … 471 415 * @param aType address of result pointer 472 416 */ 473 STDMETHODIMP HostNetworkInterface::COMGETTER(InterfaceType)(HostNetworkInterfaceType_T *aType) 474 { 475 CheckComArgOutPointerValid(aType); 476 477 AutoCaller autoCaller(this); 478 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 479 417 HRESULT HostNetworkInterface::getInterfaceType(HostNetworkInterfaceType_T *aType) 418 { 480 419 *aType = mIfType; 481 420 … … 484 423 } 485 424 486 STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkName)(BSTR *aNetworkName) 487 { 488 CheckComArgOutPointerValid(aNetworkName); 489 490 AutoCaller autoCaller(this); 491 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 492 493 mNetworkName.cloneTo(aNetworkName); 494 495 return S_OK; 496 } 497 498 STDMETHODIMP HostNetworkInterface::EnableStaticIPConfig(IN_BSTR aIPAddress, IN_BSTR aNetMask) 425 HRESULT HostNetworkInterface::getNetworkName(com::Utf8Str &aNetworkName) 426 { 427 aNetworkName = mNetworkName; 428 429 return S_OK; 430 } 431 432 HRESULT HostNetworkInterface::enableStaticIPConfig(const com::Utf8Str &aIPAddress, 433 const com::Utf8Str &aNetworkMask) 499 434 { 500 435 #ifndef VBOX_WITH_HOSTNETIF_API 501 436 return E_NOTIMPL; 502 437 #else 503 AutoCaller autoCaller(this); 504 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 505 506 if (Bstr(aIPAddress).isEmpty()) 438 if (aIPAddress.isEmpty()) 507 439 { 508 440 if (m.IPAddress) … … 524 456 525 457 ULONG ip, mask; 526 ip = inet_addr( Utf8Str(aIPAddress).c_str());458 ip = inet_addr(aIPAddress.c_str()); 527 459 if (ip != INADDR_NONE) 528 460 { 529 if ( Bstr(aNetMask).isEmpty())461 if (aNetworkMask.isEmpty()) 530 462 mask = 0xFFFFFF; 531 463 else 532 mask = inet_addr( Utf8Str(aNetMask).c_str());464 mask = inet_addr(aNetworkMask.c_str()); 533 465 if (mask != INADDR_NONE) 534 466 { … … 541 473 m.realNetworkMask = mask; 542 474 if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPAddress", mInterfaceName.raw()).raw(), 543 475 Bstr(aIPAddress).raw()))) 544 476 return E_FAIL; 545 477 if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPNetMask", mInterfaceName.raw()).raw(), 546 Bstr(aNet Mask).raw())))478 Bstr(aNetworkMask).raw()))) 547 479 return E_FAIL; 548 480 return S_OK; … … 560 492 } 561 493 562 STDMETHODIMP HostNetworkInterface::EnableStaticIPConfigV6(IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength) 494 HRESULT HostNetworkInterface::enableStaticIPConfigV6(const com::Utf8Str &aIPV6Address, 495 ULONG aIPV6NetworkMaskPrefixLength) 563 496 { 564 497 #ifndef VBOX_WITH_HOSTNETIF_API 565 498 return E_NOTIMPL; 566 499 #else 567 if ( !aIPV6Address)500 if (aIPV6NetworkMaskPrefixLength > 128) 568 501 return E_INVALIDARG; 569 if (aIPV6MaskPrefixLength > 128)570 return E_INVALIDARG;571 572 AutoCaller autoCaller(this);573 if (FAILED(autoCaller.rc())) return autoCaller.rc();574 502 575 503 int rc = S_OK; 576 if (m.realIPV6Address != aIPV6Address || m.realIPV6PrefixLength != aIPV6MaskPrefixLength) 577 { 578 if (aIPV6MaskPrefixLength == 0) 579 aIPV6MaskPrefixLength = 64; 580 rc = NetIfEnableStaticIpConfigV6(mVBox, this, m.IPV6Address.raw(), aIPV6Address, aIPV6MaskPrefixLength); 504 if (m.realIPV6Address != aIPV6Address || m.realIPV6PrefixLength != aIPV6NetworkMaskPrefixLength) 505 { 506 BSTR bstr; 507 aIPV6Address.cloneTo(&bstr); 508 if (aIPV6NetworkMaskPrefixLength == 0) 509 aIPV6NetworkMaskPrefixLength = 64; 510 rc = NetIfEnableStaticIpConfigV6(mVBox, this, m.IPV6Address.raw(), bstr, aIPV6NetworkMaskPrefixLength); 581 511 if (RT_FAILURE(rc)) 582 512 { … … 587 517 { 588 518 m.realIPV6Address = aIPV6Address; 589 m.realIPV6PrefixLength = aIPV6 MaskPrefixLength;519 m.realIPV6PrefixLength = aIPV6NetworkMaskPrefixLength; 590 520 if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPV6Address", mInterfaceName.raw()).raw(), 591 521 Bstr(aIPV6Address).raw()))) 592 522 return E_FAIL; 593 523 if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPV6NetMask", mInterfaceName.raw()).raw(), 594 BstrFmt("%u", aIPV6 MaskPrefixLength).raw())))524 BstrFmt("%u", aIPV6NetworkMaskPrefixLength).raw()))) 595 525 return E_FAIL; 596 526 } … … 601 531 } 602 532 603 STDMETHODIMP HostNetworkInterface::EnableDynamicIPConfig()533 HRESULT HostNetworkInterface::HostNetworkInterface::enableDynamicIPConfig() 604 534 { 605 535 #ifndef VBOX_WITH_HOSTNETIF_API 606 536 return E_NOTIMPL; 607 537 #else 608 AutoCaller autoCaller(this);609 if (FAILED(autoCaller.rc())) return autoCaller.rc();610 611 538 int rc = NetIfEnableDynamicIpConfig(mVBox, this); 612 539 if (RT_FAILURE(rc)) … … 619 546 } 620 547 621 STDMETHODIMP HostNetworkInterface::DHCPRediscover()548 HRESULT HostNetworkInterface::dHCPRediscover() 622 549 { 623 550 #ifndef VBOX_WITH_HOSTNETIF_API 624 551 return E_NOTIMPL; 625 552 #else 553 int rc = NetIfDhcpRediscover(mVBox, this); 554 if (RT_FAILURE(rc)) 555 { 556 LogRel(("Failed to DhcpRediscover with rc=%Rrc\n", rc)); 557 return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL; 558 } 559 return S_OK; 560 #endif 561 } 562 563 HRESULT HostNetworkInterface::i_setVirtualBox(VirtualBox *pVBox) 564 { 626 565 AutoCaller autoCaller(this); 627 566 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 628 567 629 int rc = NetIfDhcpRediscover(mVBox, this);630 if (RT_FAILURE(rc))631 {632 LogRel(("Failed to DhcpRediscover with rc=%Rrc\n", rc));633 return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL;634 }635 return S_OK;636 #endif637 }638 639 HRESULT HostNetworkInterface::setVirtualBox(VirtualBox *pVBox)640 {641 AutoCaller autoCaller(this);642 if (FAILED(autoCaller.rc())) return autoCaller.rc();643 568 AssertReturn(mVBox != pVBox, S_OK); 644 569 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r49795 r49871 340 340 341 341 /* Apply BIOS defaults */ 342 mBIOSSettings-> applyDefaults(aOsType);342 mBIOSSettings->i_applyDefaults(aOsType); 343 343 344 344 /* Apply network adapters defaults */ … … 4080 4080 aDevice))) 4081 4081 { 4082 Medium *pMedium = pAttachTemp-> getMedium();4082 Medium *pMedium = pAttachTemp->i_getMedium(); 4083 4083 if (pMedium) 4084 4084 { … … 4163 4163 4164 4164 /* see if it's the same bus/channel/device */ 4165 if (pAttachTemp-> matches(aControllerName, aControllerPort, aDevice))4165 if (pAttachTemp->i_matches(aControllerName, aControllerPort, aDevice)) 4166 4166 { 4167 4167 /* the simplest case: restore the whole attachment … … 4244 4244 uint32_t level = 0; 4245 4245 MediumAttachment *pAttach = *it; 4246 ComObjPtr<Medium> pMedium = pAttach-> getMedium();4247 Assert(!pMedium.isNull() || pAttach-> getType() != DeviceType_HardDisk);4246 ComObjPtr<Medium> pMedium = pAttach->i_getMedium(); 4247 Assert(!pMedium.isNull() || pAttach->i_getType() != DeviceType_HardDisk); 4248 4248 if (pMedium.isNull()) 4249 4249 continue; … … 4262 4262 * descendant of medium will be used 4263 4263 */ 4264 if (pAttach-> matches(aControllerName, aControllerPort, aDevice))4264 if (pAttach->i_matches(aControllerName, aControllerPort, aDevice)) 4265 4265 { 4266 4266 /* the simplest case: restore the whole attachment … … 4322 4322 { 4323 4323 /* use the previously attached hard disk */ 4324 medium = (*foundIt)-> getMedium();4324 medium = (*foundIt)->i_getMedium(); 4325 4325 mediumCaller.attach(medium); 4326 4326 if (FAILED(mediumCaller.rc())) return mediumCaller.rc(); … … 4358 4358 { 4359 4359 MediumAttachment *pAttach = *it; 4360 ComObjPtr<Medium> pMedium = pAttach-> getMedium();4361 Assert(!pMedium.isNull() || pAttach-> getType() != DeviceType_HardDisk);4360 ComObjPtr<Medium> pMedium = pAttach->i_getMedium(); 4361 Assert(!pMedium.isNull() || pAttach->i_getType() != DeviceType_HardDisk); 4362 4362 if (pMedium.isNull()) 4363 4363 continue; … … 4371 4371 * descendant of medium will be used 4372 4372 */ 4373 if ( pAttach-> getDevice() == aDevice4374 && pAttach-> getPort() == aControllerPort4375 && pAttach-> getControllerName() == aControllerName4373 if ( pAttach->i_getDevice() == aDevice 4374 && pAttach->i_getPort() == aControllerPort 4375 && pAttach->i_getControllerName() == aControllerName 4376 4376 ) 4377 4377 { … … 4391 4391 if (pAttachFound) 4392 4392 { 4393 base = pAttachFound-> getMedium();4393 base = pAttachFound->i_getMedium(); 4394 4394 break; 4395 4395 } … … 4641 4641 aDevice, aControllerPort, aControllerName); 4642 4642 4643 if (fHotplug && !pAttach-> getHotPluggable())4643 if (fHotplug && !pAttach->i_getHotPluggable()) 4644 4644 return setError(VBOX_E_NOT_SUPPORTED, 4645 4645 tr("The device slot %d on port %d of controller '%ls' does not support hotplugging"), … … 4706 4706 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4707 4707 4708 if (pAttach-> getType() != DeviceType_DVD)4708 if (pAttach->i_getType() != DeviceType_DVD) 4709 4709 return setError(E_INVALIDARG, 4710 4710 tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"), 4711 4711 aDevice, aControllerPort, aControllerName); 4712 pAttach-> updatePassthrough(!!aPassthrough);4712 pAttach->i_updatePassthrough(!!aPassthrough); 4713 4713 4714 4714 return S_OK; … … 4746 4746 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4747 4747 4748 if (pAttach-> getType() != DeviceType_DVD)4748 if (pAttach->i_getType() != DeviceType_DVD) 4749 4749 return setError(E_INVALIDARG, 4750 4750 tr("Setting temporary eject flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"), 4751 4751 aDevice, aControllerPort, aControllerName); 4752 pAttach-> updateTempEject(!!aTemporaryEject);4752 pAttach->i_updateTempEject(!!aTemporaryEject); 4753 4753 4754 4754 return S_OK; … … 4793 4793 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4794 4794 4795 if (pAttach-> getType() != DeviceType_HardDisk)4795 if (pAttach->i_getType() != DeviceType_HardDisk) 4796 4796 return setError(E_INVALIDARG, 4797 4797 tr("Setting the non-rotational medium flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a hard disk"), 4798 4798 aDevice, aControllerPort, aControllerName); 4799 pAttach-> updateNonRotational(!!aNonRotational);4799 pAttach->i_updateNonRotational(!!aNonRotational); 4800 4800 4801 4801 return S_OK; … … 4840 4840 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4841 4841 4842 if (pAttach-> getType() != DeviceType_HardDisk)4842 if (pAttach->i_getType() != DeviceType_HardDisk) 4843 4843 return setError(E_INVALIDARG, 4844 4844 tr("Setting the discard medium flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a hard disk"), 4845 4845 aDevice, aControllerPort, aControllerName); 4846 pAttach-> updateDiscard(!!aDiscard);4846 pAttach->i_updateDiscard(!!aDiscard); 4847 4847 4848 4848 return S_OK; … … 4903 4903 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4904 4904 4905 if (pAttach-> getType() == DeviceType_Floppy)4905 if (pAttach->i_getType() == DeviceType_Floppy) 4906 4906 return setError(E_INVALIDARG, 4907 4907 tr("Setting the hot-pluggable device flag rejected as the device attached to device slot %d on port %d of controller '%ls' is a floppy drive"), 4908 4908 aDevice, aControllerPort, aControllerName); 4909 pAttach-> updateHotPluggable(!!aHotPluggable);4909 pAttach->i_updateHotPluggable(!!aHotPluggable); 4910 4910 4911 4911 return S_OK; … … 4966 4966 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4967 4967 4968 const Utf8Str strBandwidthGroupOld = pAttach-> getBandwidthGroup();4968 const Utf8Str strBandwidthGroupOld = pAttach->i_getBandwidthGroup(); 4969 4969 if (strBandwidthGroupOld.isNotEmpty()) 4970 4970 { … … 4975 4975 4976 4976 pBandwidthGroupOld->i_release(); 4977 pAttach-> updateBandwidthGroup(Utf8Str::Empty);4977 pAttach->i_updateBandwidthGroup(Utf8Str::Empty); 4978 4978 } 4979 4979 … … 4981 4981 { 4982 4982 group->i_reference(); 4983 pAttach-> updateBandwidthGroup(group->i_getName());4983 pAttach->i_updateBandwidthGroup(group->i_getName()); 4984 4984 } 4985 4985 … … 5051 5051 * backup is not necessarily the same thing. */ 5052 5052 ComObjPtr<Medium> oldmedium; 5053 oldmedium = pAttach-> getMedium();5053 oldmedium = pAttach->i_getMedium(); 5054 5054 5055 5055 ComObjPtr<Medium> pMedium = static_cast<Medium*>(aMedium); … … 5063 5063 if (pMedium) 5064 5064 { 5065 DeviceType_T mediumType = pAttach-> getType();5065 DeviceType_T mediumType = pAttach->i_getType(); 5066 5066 switch (mediumType) 5067 5067 { … … 5103 5103 5104 5104 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 5105 pAttach-> updateMedium(pMedium);5105 pAttach->i_updateMedium(pMedium); 5106 5106 } 5107 5107 … … 5129 5129 if (!oldmedium.isNull()) 5130 5130 oldmedium->i_addBackReference(mData->mUuid); 5131 pAttach-> updateMedium(oldmedium);5131 pAttach->i_updateMedium(oldmedium); 5132 5132 } 5133 5133 … … 5167 5167 aDevice, aControllerPort, aControllerName); 5168 5168 5169 pAttach-> getMedium().queryInterfaceTo(aMedium);5169 pAttach->i_getMedium().queryInterfaceTo(aMedium); 5170 5170 5171 5171 return S_OK; … … 6605 6605 AutoReadLock local_alock(pAttachTemp COMMA_LOCKVAL_SRC_POS); 6606 6606 6607 if (pAttachTemp-> getControllerName() == aName)6607 if (pAttachTemp->i_getControllerName() == aName) 6608 6608 { 6609 6609 rc = detachDevice(pAttachTemp, alock, NULL); … … 6743 6743 mUSBControllers.backup(); 6744 6744 6745 ctrl-> unshare();6745 ctrl->i_unshare(); 6746 6746 6747 6747 mUSBControllers->remove(ctrl); … … 8820 8820 ++it) 8821 8821 { 8822 ComObjPtr<Medium> pMedium = (*it)-> getMedium();8822 ComObjPtr<Medium> pMedium = (*it)->i_getMedium(); 8823 8823 if (pMedium.isNull()) 8824 8824 continue; … … 9355 9355 9356 9356 /* BIOS */ 9357 rc = mBIOSSettings-> loadSettings(data.biosSettings);9357 rc = mBIOSSettings->i_loadSettings(data.biosSettings); 9358 9358 if (FAILED(rc)) return rc; 9359 9359 … … 9425 9425 9426 9426 AssertBreak(p.ulSlot < RT_ELEMENTS(mParallelPorts)); 9427 rc = mParallelPorts[p.ulSlot]-> loadSettings(p);9427 rc = mParallelPorts[p.ulSlot]->i_loadSettings(p); 9428 9428 if (FAILED(rc)) return rc; 9429 9429 } 9430 9430 9431 9431 /* AudioAdapter */ 9432 rc = mAudioAdapter-> loadSettings(data.audioAdapter);9432 rc = mAudioAdapter->i_loadSettings(data.audioAdapter); 9433 9433 if (FAILED(rc)) return rc; 9434 9434 … … 9963 9963 ++it) 9964 9964 { 9965 if ((*it)-> getName() == aName)9965 if ((*it)->i_getName() == aName) 9966 9966 { 9967 9967 aUSBController = (*it); … … 9990 9990 ++it) 9991 9991 { 9992 if ((*it)-> getControllerType() == enmType)9992 if ((*it)->i_getControllerType() == enmType) 9993 9993 cCtrls++; 9994 9994 } … … 10023 10023 AutoReadLock attLock(pAtt COMMA_LOCKVAL_SRC_POS); 10024 10024 10025 if (pAtt-> getControllerName() == aName)10025 if (pAtt->i_getControllerName() == aName) 10026 10026 atts.push_back(pAtt); 10027 10027 } … … 10405 10405 * with it. 10406 10406 * 10407 Caller must hold the machine lock!10407 * Caller must hold the machine lock! 10408 10408 * 10409 10409 * This throws XML errors and HRESULT, so the caller must have a catch block! … … 10660 10660 10661 10661 /* BIOS (required) */ 10662 rc = mBIOSSettings-> saveSettings(data.biosSettings);10662 rc = mBIOSSettings->i_saveSettings(data.biosSettings); 10663 10663 if (FAILED(rc)) throw rc; 10664 10664 … … 10671 10671 settings::USBController settingsCtrl; 10672 10672 10673 settingsCtrl.strName = ctrl-> getName();10674 settingsCtrl.enmType = ctrl-> getControllerType();10673 settingsCtrl.strName = ctrl->i_getName(); 10674 settingsCtrl.enmType = ctrl->i_getControllerType(); 10675 10675 10676 10676 data.usbSettings.llUSBControllers.push_back(settingsCtrl); … … 10723 10723 settings::ParallelPort p; 10724 10724 p.ulSlot = slot; 10725 rc = mParallelPorts[slot]-> saveSettings(p);10725 rc = mParallelPorts[slot]->i_saveSettings(p); 10726 10726 if (FAILED(rc)) return rc; 10727 10727 … … 10730 10730 10731 10731 /* Audio adapter */ 10732 rc = mAudioAdapter-> saveSettings(data.audioAdapter);10732 rc = mAudioAdapter->i_saveSettings(data.audioAdapter); 10733 10733 if (FAILED(rc)) return rc; 10734 10734 … … 10905 10905 10906 10906 MediumAttachment *pAttach = *it; 10907 Medium *pMedium = pAttach-> getMedium();10908 10909 dev.deviceType = pAttach-> getType();10910 dev.lPort = pAttach-> getPort();10911 dev.lDevice = pAttach-> getDevice();10912 dev.fPassThrough = pAttach-> getPassthrough();10913 dev.fHotPluggable = pAttach-> getHotPluggable();10907 Medium *pMedium = pAttach->i_getMedium(); 10908 10909 dev.deviceType = pAttach->i_getType(); 10910 dev.lPort = pAttach->i_getPort(); 10911 dev.lDevice = pAttach->i_getDevice(); 10912 dev.fPassThrough = pAttach->i_getPassthrough(); 10913 dev.fHotPluggable = pAttach->i_getHotPluggable(); 10914 10914 if (pMedium) 10915 10915 { … … 10918 10918 else 10919 10919 dev.uuid = pMedium->i_getId(); 10920 dev.fTempEject = pAttach-> getTempEject();10921 dev.fNonRotational = pAttach-> getNonRotational();10922 dev.fDiscard = pAttach-> getDiscard();10923 } 10924 10925 dev.strBwGroup = pAttach-> getBandwidthGroup();10920 dev.fTempEject = pAttach->i_getTempEject(); 10921 dev.fNonRotational = pAttach->i_getNonRotational(); 10922 dev.fDiscard = pAttach->i_getDiscard(); 10923 } 10924 10925 dev.strBwGroup = pAttach->i_getBandwidthGroup(); 10926 10926 10927 10927 data.llAttachedDevices.push_back(dev); … … 11106 11106 { 11107 11107 MediumAttachment* pAtt = *it; 11108 if (pAtt-> getType() == DeviceType_HardDisk)11108 if (pAtt->i_getType() == DeviceType_HardDisk) 11109 11109 { 11110 Medium* pMedium = pAtt-> getMedium();11110 Medium* pMedium = pAtt->i_getMedium(); 11111 11111 Assert(pMedium); 11112 11112 … … 11158 11158 MediumAttachment* pAtt = *it; 11159 11159 11160 DeviceType_T devType = pAtt-> getType();11161 Medium* pMedium = pAtt-> getMedium();11160 DeviceType_T devType = pAtt->i_getType(); 11161 Medium* pMedium = pAtt->i_getMedium(); 11162 11162 11163 11163 if ( devType != DeviceType_HardDisk … … 11245 11245 rc = attachment->init(this, 11246 11246 diff, 11247 pAtt-> getControllerName(),11248 pAtt-> getPort(),11249 pAtt-> getDevice(),11247 pAtt->i_getControllerName(), 11248 pAtt->i_getPort(), 11249 pAtt->i_getDevice(), 11250 11250 DeviceType_HardDisk, 11251 11251 true /* aImplicit */, 11252 11252 false /* aPassthrough */, 11253 11253 false /* aTempEject */, 11254 pAtt-> getNonRotational(),11255 pAtt-> getDiscard(),11256 pAtt-> getHotPluggable(),11257 pAtt-> getBandwidthGroup());11254 pAtt->i_getNonRotational(), 11255 pAtt->i_getDiscard(), 11256 pAtt->i_getHotPluggable(), 11257 pAtt->i_getBandwidthGroup()); 11258 11258 if (FAILED(rc)) throw rc; 11259 11259 … … 11306 11306 { 11307 11307 const ComObjPtr<MediumAttachment> &pAtt = *it; 11308 if (pAtt->i sImplicit())11308 if (pAtt->i_isImplicit()) 11309 11309 { 11310 11310 fImplicitDiffs = true; … … 11356 11356 { 11357 11357 MediumAttachment* pAtt = *it; 11358 if (pAtt-> getType() == DeviceType_HardDisk)11358 if (pAtt->i_getType() == DeviceType_HardDisk) 11359 11359 { 11360 Medium* pMedium = pAtt-> getMedium();11360 Medium* pMedium = pAtt->i_getMedium(); 11361 11361 Assert(pMedium); 11362 11362 … … 11396 11396 { 11397 11397 ComObjPtr<MediumAttachment> pAtt = *it; 11398 ComObjPtr<Medium> pMedium = pAtt-> getMedium();11398 ComObjPtr<Medium> pMedium = pAtt->i_getMedium(); 11399 11399 if (pMedium.isNull()) 11400 11400 continue; 11401 11401 11402 11402 // Implicit attachments go on the list for deletion and back references are removed. 11403 if (pAtt->i sImplicit())11403 if (pAtt->i_isImplicit()) 11404 11404 { 11405 11405 /* Deassociate and mark for deletion */ 11406 LogFlowThisFunc(("Detaching '%s', pending deletion\n", pAtt-> getLogName()));11406 LogFlowThisFunc(("Detaching '%s', pending deletion\n", pAtt->i_getLogName())); 11407 11407 rc = pMedium->i_removeBackReference(mData->mUuid); 11408 11408 if (FAILED(rc)) … … 11416 11416 { 11417 11417 /* no: de-associate */ 11418 LogFlowThisFunc(("Detaching '%s', no deletion\n", pAtt-> getLogName()));11418 LogFlowThisFunc(("Detaching '%s', no deletion\n", pAtt->i_getLogName())); 11419 11419 rc = pMedium->i_removeBackReference(mData->mUuid); 11420 11420 if (FAILED(rc)) … … 11422 11422 continue; 11423 11423 } 11424 LogFlowThisFunc(("Not detaching '%s'\n", pAtt-> getLogName()));11424 LogFlowThisFunc(("Not detaching '%s'\n", pAtt->i_getLogName())); 11425 11425 } 11426 11426 … … 11456 11456 ComObjPtr<MediumAttachment> pAtt = *it; 11457 11457 Assert(pAtt); 11458 LogFlowThisFunc(("Deleting '%s'\n", pAtt-> getLogName()));11459 ComObjPtr<Medium> pMedium = pAtt-> getMedium();11458 LogFlowThisFunc(("Deleting '%s'\n", pAtt->i_getLogName())); 11459 ComObjPtr<Medium> pMedium = pAtt->i_getMedium(); 11460 11460 Assert(pMedium); 11461 11461 11462 11462 rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/); 11463 11463 // continue on delete failure, just collect error messages 11464 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt-> getLogName(), pMedium->i_getLocationFull().c_str() ));11464 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->i_getLogName(), pMedium->i_getLocationFull().c_str() )); 11465 11465 mrc = rc; 11466 11466 } … … 11524 11524 { 11525 11525 MediumAttachment *pAttach = *it; 11526 if (pAttach-> matches(aControllerName, aControllerPort, aDevice))11526 if (pAttach->i_matches(aControllerName, aControllerPort, aDevice)) 11527 11527 return pAttach; 11528 11528 } … … 11550 11550 { 11551 11551 MediumAttachment *pAttach = *it; 11552 ComObjPtr<Medium> pMediumThis = pAttach-> getMedium();11552 ComObjPtr<Medium> pMediumThis = pAttach->i_getMedium(); 11553 11553 if (pMediumThis == pMedium) 11554 11554 return pAttach; … … 11577 11577 { 11578 11578 MediumAttachment *pAttach = *it; 11579 ComObjPtr<Medium> pMediumThis = pAttach-> getMedium();11579 ComObjPtr<Medium> pMediumThis = pAttach->i_getMedium(); 11580 11580 if (pMediumThis->i_getId() == id) 11581 11581 return pAttach; … … 11598 11598 Snapshot *pSnapshot) 11599 11599 { 11600 ComObjPtr<Medium> oldmedium = pAttach-> getMedium();11601 DeviceType_T mediumType = pAttach-> getType();11600 ComObjPtr<Medium> oldmedium = pAttach->i_getMedium(); 11601 DeviceType_T mediumType = pAttach->i_getType(); 11602 11602 11603 11603 LogFlowThisFunc(("Entering, medium of attachment is %s\n", oldmedium ? oldmedium->i_getLocationFull().c_str() : "NULL")); 11604 11604 11605 if (pAttach->i sImplicit())11605 if (pAttach->i_isImplicit()) 11606 11606 { 11607 11607 /* attempt to implicitly delete the implicitly created diff */ … … 11689 11689 { 11690 11690 ComObjPtr<MediumAttachment> &pAttach = *it; 11691 ComObjPtr<Medium> pMedium = pAttach-> getMedium();11691 ComObjPtr<Medium> pMedium = pAttach->i_getMedium(); 11692 11692 11693 11693 if (!pMedium.isNull()) … … 11780 11780 MediumAttachment *pAttach = *it; 11781 11781 11782 pAttach-> commit();11783 11784 Medium* pMedium = pAttach-> getMedium();11785 bool fImplicit = pAttach->i sImplicit();11782 pAttach->i_commit(); 11783 11784 Medium* pMedium = pAttach->i_getMedium(); 11785 bool fImplicit = pAttach->i_isImplicit(); 11786 11786 11787 11787 LogFlowThisFunc(("Examining current medium '%s' (implicit: %d)\n", … … 11794 11794 { 11795 11795 /* convert implicit attachment to normal */ 11796 pAttach-> setImplicit(false);11796 pAttach->i_setImplicit(false); 11797 11797 11798 11798 if ( aOnline 11799 11799 && pMedium 11800 && pAttach-> getType() == DeviceType_HardDisk11800 && pAttach->i_getType() == DeviceType_HardDisk 11801 11801 ) 11802 11802 { … … 11835 11835 { 11836 11836 MediumAttachment *pOldAttach = *oldIt; 11837 if (pOldAttach-> getMedium() == pMedium)11837 if (pOldAttach->i_getMedium() == pMedium) 11838 11838 { 11839 11839 LogFlowThisFunc(("--> medium '%s' was attached before, will not remove\n", pMedium->i_getName().c_str())); … … 11854 11854 { 11855 11855 MediumAttachment *pAttach = *it; 11856 Medium* pMedium = pAttach-> getMedium();11856 Medium* pMedium = pAttach->i_getMedium(); 11857 11857 11858 11858 /* Detach only hard disks, since DVD/floppy media is detached 11859 11859 * instantly in MountMedium. */ 11860 if (pAttach-> getType() == DeviceType_HardDisk && pMedium)11860 if (pAttach->i_getType() == DeviceType_HardDisk && pMedium) 11861 11861 { 11862 11862 LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium->i_getName().c_str())); … … 11919 11919 ++it) 11920 11920 { 11921 (*it)-> updateParentMachine(mPeer);11921 (*it)->i_updateParentMachine(mPeer); 11922 11922 } 11923 11923 … … 11958 11958 MediumAttachment *pAttach = *it; 11959 11959 /* Fix up the backrefs for DVD/floppy media. */ 11960 if (pAttach-> getType() != DeviceType_HardDisk)11961 { 11962 Medium* pMedium = pAttach-> getMedium();11960 if (pAttach->i_getType() != DeviceType_HardDisk) 11961 { 11962 Medium* pMedium = pAttach->i_getMedium(); 11963 11963 if (pMedium) 11964 11964 { … … 11968 11968 } 11969 11969 11970 (*it)-> rollback();11970 (*it)->i_rollback(); 11971 11971 11972 11972 pAttach = *it; 11973 11973 /* Fix up the backrefs for DVD/floppy media. */ 11974 if (pAttach-> getType() != DeviceType_HardDisk)11975 { 11976 Medium* pMedium = pAttach-> getMedium();11974 if (pAttach->i_getType() != DeviceType_HardDisk) 11975 { 11976 Medium* pMedium = pAttach->i_getMedium(); 11977 11977 if (pMedium) 11978 11978 { … … 12097 12097 while (it != mUSBControllers->end()) 12098 12098 { 12099 (*it)-> rollback();12099 (*it)->i_rollback(); 12100 12100 ++it; 12101 12101 } … … 12111 12111 12112 12112 if (mBIOSSettings) 12113 mBIOSSettings-> rollback();12113 mBIOSSettings->i_rollback(); 12114 12114 12115 12115 if (mVRDEServer && (mData->flModifications & IsModified_VRDEServer)) … … 12117 12117 12118 12118 if (mAudioAdapter) 12119 mAudioAdapter-> rollback();12119 mAudioAdapter->i_rollback(); 12120 12120 12121 12121 if (mUSBDeviceFilters && (mData->flModifications & IsModified_USB)) … … 12152 12152 for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++) 12153 12153 if ( mParallelPorts[slot] 12154 && mParallelPorts[slot]->i sModified())12154 && mParallelPorts[slot]->i_isModified()) 12155 12155 { 12156 mParallelPorts[slot]-> rollback();12156 mParallelPorts[slot]->i_rollback(); 12157 12157 parallelPorts[slot] = mParallelPorts[slot]; 12158 12158 } … … 12222 12222 commitMedia(Global::IsOnline(mData->mMachineState)); 12223 12223 12224 mBIOSSettings-> commit();12224 mBIOSSettings->i_commit(); 12225 12225 mVRDEServer->i_commit(); 12226 mAudioAdapter-> commit();12226 mAudioAdapter->i_commit(); 12227 12227 mUSBDeviceFilters->commit(); 12228 12228 mBandwidthControl->i_commit(); … … 12282 12282 mSerialPorts[slot]->i_commit(); 12283 12283 for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++) 12284 mParallelPorts[slot]-> commit();12284 mParallelPorts[slot]->i_commit(); 12285 12285 12286 12286 bool commitStorageControllers = false; … … 12369 12369 while (it != mUSBControllers->end()) 12370 12370 { 12371 (*it)-> commit();12371 (*it)->i_commit(); 12372 12372 12373 12373 /* look if this controller has a peer device */ 12374 ComObjPtr<USBController> peer = (*it)-> getPeer();12374 ComObjPtr<USBController> peer = (*it)->i_getPeer(); 12375 12375 if (!peer) 12376 12376 { … … 12421 12421 while (it != mUSBControllers->end()) 12422 12422 { 12423 (*it)-> commit();12423 (*it)->i_commit(); 12424 12424 ++it; 12425 12425 } … … 12471 12471 } 12472 12472 12473 mBIOSSettings-> copyFrom(aThat->mBIOSSettings);12473 mBIOSSettings->i_copyFrom(aThat->mBIOSSettings); 12474 12474 mVRDEServer->i_copyFrom(aThat->mVRDEServer); 12475 mAudioAdapter-> copyFrom(aThat->mAudioAdapter);12475 mAudioAdapter->i_copyFrom(aThat->mAudioAdapter); 12476 12476 mUSBDeviceFilters->copyFrom(aThat->mUSBDeviceFilters); 12477 12477 mBandwidthControl->i_copyFrom(aThat->mBandwidthControl); … … 12509 12509 mSerialPorts[slot]->i_copyFrom(aThat->mSerialPorts[slot]); 12510 12510 for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++) 12511 mParallelPorts[slot]-> copyFrom(aThat->mParallelPorts[slot]);12511 mParallelPorts[slot]->i_copyFrom(aThat->mParallelPorts[slot]); 12512 12512 } 12513 12513 … … 12555 12555 AutoReadLock local_alockA(pAttach COMMA_LOCKVAL_SRC_POS); 12556 12556 12557 if (pAttach-> getType() == DeviceType_HardDisk)12558 list.push_back(pAttach-> getMedium());12557 if (pAttach->i_getType() == DeviceType_HardDisk) 12558 list.push_back(pAttach->i_getMedium()); 12559 12559 } 12560 12560 } … … 13964 13964 /* Need to query the details first, as the IMediumAttachment reference 13965 13965 * might be to the original settings, which we are going to change. */ 13966 ctrlName = pAttach-> getControllerName();13967 lPort = pAttach-> getPort();13968 lDevice = pAttach-> getDevice();13969 fTempEject = pAttach-> getTempEject();13966 ctrlName = pAttach->i_getControllerName(); 13967 lPort = pAttach->i_getPort(); 13968 lDevice = pAttach->i_getDevice(); 13969 fTempEject = pAttach->i_getTempEject(); 13970 13970 } 13971 13971 … … 13975 13975 * backup is not necessarily the same thing. */ 13976 13976 ComObjPtr<Medium> oldmedium; 13977 oldmedium = pAttach-> getMedium();13977 oldmedium = pAttach->i_getMedium(); 13978 13978 13979 13979 setModified(IsModified_Storage); … … 13995 13995 oldmedium->i_removeBackReference(mData->mUuid); 13996 13996 13997 pAttach-> updateMedium(NULL);13998 pAttach-> updateEjected();13997 pAttach->i_updateMedium(NULL); 13998 pAttach->i_updateEjected(); 13999 13999 } 14000 14000 … … 14005 14005 { 14006 14006 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 14007 pAttach-> updateEjected();14007 pAttach->i_updateEjected(); 14008 14008 } 14009 14009 } … … 14715 14715 { 14716 14716 MediumAttachment* pAtt = *it; 14717 DeviceType_T devType = pAtt-> getType();14718 Medium *pMedium = pAtt-> getMedium();14717 DeviceType_T devType = pAtt->i_getType(); 14718 Medium *pMedium = pAtt->i_getMedium(); 14719 14719 14720 14720 MediumLockList *pMediumLockList(new MediumLockList()); -
trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp
r48880 r49871 86 86 ///////////////////////////////////////////////////////////////////////////// 87 87 88 DEFINE_EMPTY_CTOR_DTOR(MediumAttachment) 89 88 90 HRESULT MediumAttachment::FinalConstruct() 89 91 { … … 169 171 m->bd->fImplicit ? ":I" : ""); 170 172 171 LogFlowThisFunc(("LEAVE - %s\n", getLogName()));173 LogFlowThisFunc(("LEAVE - %s\n", i_getLogName())); 172 174 return S_OK; 173 175 } … … 209 211 void MediumAttachment::uninit() 210 212 { 211 LogFlowThisFunc(("ENTER - %s\n", getLogName()));213 LogFlowThisFunc(("ENTER - %s\n", i_getLogName())); 212 214 213 215 /* Enclose the state transition Ready->InUninit->NotReady */ … … 229 231 ///////////////////////////////////////////////////////////////////////////// 230 232 231 STDMETHODIMP MediumAttachment::COMGETTER(Medium)(IMedium **aHardDisk) 232 { 233 LogFlowThisFuncEnter(); 234 235 CheckComArgOutPointerValid(aHardDisk); 236 237 AutoCaller autoCaller(this); 238 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 233 234 HRESULT MediumAttachment::getMedium(ComPtr<IMedium> &aHardDisk) 235 { 236 LogFlowThisFuncEnter(); 239 237 240 238 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 241 239 242 m->bd->pMedium.queryInterfaceTo(aHardDisk); 243 244 LogFlowThisFuncLeave(); 245 return S_OK; 246 } 247 248 STDMETHODIMP MediumAttachment::COMGETTER(Controller)(BSTR *aController) 249 { 250 LogFlowThisFuncEnter(); 251 252 CheckComArgOutPointerValid(aController); 253 254 AutoCaller autoCaller(this); 255 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 240 aHardDisk = m->bd->pMedium; 241 242 LogFlowThisFuncLeave(); 243 return S_OK; 244 } 245 246 247 HRESULT MediumAttachment::getController(com::Utf8Str &aController) 248 { 249 LogFlowThisFuncEnter(); 256 250 257 251 /* m->controller is constant during life time, no need to lock */ 258 m->bd->bstrControllerName.cloneTo(aController); 259 260 LogFlowThisFuncLeave(); 261 return S_OK; 262 } 263 264 STDMETHODIMP MediumAttachment::COMGETTER(Port)(LONG *aPort) 265 { 266 LogFlowThisFuncEnter(); 267 268 CheckComArgOutPointerValid(aPort); 269 270 AutoCaller autoCaller(this); 271 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 252 aController = Utf8Str(m->bd->bstrControllerName); 253 254 LogFlowThisFuncLeave(); 255 return S_OK; 256 } 257 258 259 HRESULT MediumAttachment::getPort(LONG *aPort) 260 { 261 LogFlowThisFuncEnter(); 272 262 273 263 /* m->bd->port is constant during life time, no need to lock */ … … 278 268 } 279 269 280 STDMETHODIMP MediumAttachment::COMGETTER(Device)(LONG *aDevice) 281 { 282 LogFlowThisFuncEnter(); 283 284 CheckComArgOutPointerValid(aDevice); 285 286 AutoCaller autoCaller(this); 287 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 270 HRESULT MediumAttachment::getDevice(LONG *aDevice) 271 { 272 LogFlowThisFuncEnter(); 288 273 289 274 /* m->bd->device is constant during life time, no need to lock */ … … 294 279 } 295 280 296 STDMETHODIMP MediumAttachment::COMGETTER(Type)(DeviceType_T *aType) 297 { 298 LogFlowThisFuncEnter(); 299 300 CheckComArgOutPointerValid(aType); 301 302 AutoCaller autoCaller(this); 303 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 281 HRESULT MediumAttachment::getType(DeviceType_T *aType) 282 { 283 LogFlowThisFuncEnter(); 304 284 305 285 /* m->bd->type is constant during life time, no need to lock */ … … 310 290 } 311 291 312 STDMETHODIMP MediumAttachment::COMGETTER(Passthrough)(BOOL *aPassthrough) 313 { 314 LogFlowThisFuncEnter(); 315 316 CheckComArgOutPointerValid(aPassthrough); 317 318 AutoCaller autoCaller(this); 319 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 292 293 HRESULT MediumAttachment::getPassthrough(BOOL *aPassthrough) 294 { 295 LogFlowThisFuncEnter(); 320 296 321 297 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 327 303 } 328 304 329 STDMETHODIMP MediumAttachment::COMGETTER(TemporaryEject)(BOOL *aTemporaryEject) 330 { 331 LogFlowThisFuncEnter(); 332 333 CheckComArgOutPointerValid(aTemporaryEject); 334 335 AutoCaller autoCaller(this); 336 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 305 306 HRESULT MediumAttachment::getTemporaryEject(BOOL *aTemporaryEject) 307 { 308 LogFlowThisFuncEnter(); 337 309 338 310 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 344 316 } 345 317 346 STDMETHODIMP MediumAttachment::COMGETTER(IsEjected)(BOOL *aEjected) 347 { 348 LogFlowThisFuncEnter(); 349 350 CheckComArgOutPointerValid(aEjected); 351 352 AutoCaller autoCaller(this); 353 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 318 319 HRESULT MediumAttachment::getIsEjected(BOOL *aEjected) 320 { 321 LogFlowThisFuncEnter(); 354 322 355 323 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 361 329 } 362 330 363 STDMETHODIMP MediumAttachment::COMGETTER(NonRotational)(BOOL *aNonRotational) 364 { 365 LogFlowThisFuncEnter(); 366 367 CheckComArgOutPointerValid(aNonRotational); 368 369 AutoCaller autoCaller(this); 370 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 331 332 HRESULT MediumAttachment::getNonRotational(BOOL *aNonRotational) 333 { 334 LogFlowThisFuncEnter(); 371 335 372 336 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 378 342 } 379 343 380 STDMETHODIMP MediumAttachment::COMGETTER(Discard)(BOOL *aDiscard) 381 { 382 LogFlowThisFuncEnter(); 383 384 CheckComArgOutPointerValid(aDiscard); 385 386 AutoCaller autoCaller(this); 387 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 344 HRESULT MediumAttachment::getDiscard(BOOL *aDiscard) 345 { 346 LogFlowThisFuncEnter(); 388 347 389 348 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 395 354 } 396 355 397 STDMETHODIMP MediumAttachment::COMGETTER(BandwidthGroup) (IBandwidthGroup **aBwGroup) 398 { 399 LogFlowThisFuncEnter(); 400 CheckComArgOutPointerValid(aBwGroup); 401 402 AutoCaller autoCaller(this); 403 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 356 357 HRESULT MediumAttachment::getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup) 358 { 359 LogFlowThisFuncEnter(); 404 360 405 361 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 414 370 415 371 if (SUCCEEDED(hrc)) 416 pBwGroup.queryInterfaceTo(aB wGroup);372 pBwGroup.queryInterfaceTo(aBandwidthGroup.asOutParam()); 417 373 } 418 374 … … 421 377 } 422 378 423 STDMETHODIMP MediumAttachment::COMGETTER(HotPluggable)(BOOL *aHotPluggable) 424 { 425 LogFlowThisFuncEnter(); 426 427 CheckComArgOutPointerValid(aHotPluggable); 428 429 AutoCaller autoCaller(this); 430 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 379 HRESULT MediumAttachment::getHotPluggable(BOOL *aHotPluggable) 380 { 381 LogFlowThisFuncEnter(); 431 382 432 383 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 441 392 * @note Locks this object for writing. 442 393 */ 443 void MediumAttachment:: rollback()444 { 445 LogFlowThisFunc(("ENTER - %s\n", getLogName()));394 void MediumAttachment::i_rollback() 395 { 396 LogFlowThisFunc(("ENTER - %s\n", i_getLogName())); 446 397 447 398 /* sanity */ … … 453 404 m->bd.rollback(); 454 405 455 LogFlowThisFunc(("LEAVE - %s\n", getLogName()));406 LogFlowThisFunc(("LEAVE - %s\n", i_getLogName())); 456 407 } 457 408 … … 459 410 * @note Locks this object for writing. 460 411 */ 461 void MediumAttachment:: commit()462 { 463 LogFlowThisFunc(("ENTER - %s\n", getLogName()));412 void MediumAttachment::i_commit() 413 { 414 LogFlowThisFunc(("ENTER - %s\n", i_getLogName())); 464 415 465 416 /* sanity */ … … 472 423 m->bd.commit(); 473 424 474 LogFlowThisFunc(("LEAVE - %s\n", getLogName()));475 } 476 477 bool MediumAttachment::i sImplicit() const425 LogFlowThisFunc(("LEAVE - %s\n", i_getLogName())); 426 } 427 428 bool MediumAttachment::i_isImplicit() const 478 429 { 479 430 return m->bd->fImplicit; 480 431 } 481 432 482 void MediumAttachment:: setImplicit(bool aImplicit)433 void MediumAttachment::i_setImplicit(bool aImplicit) 483 434 { 484 435 m->bd->fImplicit = aImplicit; 485 436 } 486 437 487 const ComObjPtr<Medium>& MediumAttachment:: getMedium() const438 const ComObjPtr<Medium>& MediumAttachment::i_getMedium() const 488 439 { 489 440 return m->bd->pMedium; 490 441 } 491 442 492 Bstr MediumAttachment::getControllerName() const443 const Bstr MediumAttachment::i_getControllerName() const 493 444 { 494 445 return m->bd->bstrControllerName; 495 446 } 496 447 497 LONG MediumAttachment:: getPort() const448 LONG MediumAttachment::i_getPort() const 498 449 { 499 450 return m->bd->lPort; 500 451 } 501 452 502 LONG MediumAttachment:: getDevice() const453 LONG MediumAttachment::i_getDevice() const 503 454 { 504 455 return m->bd->lDevice; 505 456 } 506 457 507 DeviceType_T MediumAttachment:: getType() const458 DeviceType_T MediumAttachment::i_getType() const 508 459 { 509 460 return m->bd->type; 510 461 } 511 462 512 bool MediumAttachment:: getPassthrough() const463 bool MediumAttachment::i_getPassthrough() const 513 464 { 514 465 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 516 467 } 517 468 518 bool MediumAttachment:: getTempEject() const469 bool MediumAttachment::i_getTempEject() const 519 470 { 520 471 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 522 473 } 523 474 524 bool MediumAttachment:: getNonRotational() const475 bool MediumAttachment::i_getNonRotational() const 525 476 { 526 477 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 528 479 } 529 480 530 bool MediumAttachment:: getDiscard() const481 bool MediumAttachment::i_getDiscard() const 531 482 { 532 483 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 534 485 } 535 486 536 bool MediumAttachment:: getHotPluggable() const487 bool MediumAttachment::i_getHotPluggable() const 537 488 { 538 489 AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS); … … 540 491 } 541 492 542 const Utf8Str& MediumAttachment::getBandwidthGroup() const493 Utf8Str& MediumAttachment::i_getBandwidthGroup() const 543 494 { 544 495 return m->bd->strBandwidthGroup; 545 496 } 546 497 547 bool MediumAttachment:: matches(CBSTR aControllerName, LONG aPort, LONG aDevice)498 bool MediumAttachment::i_matches(CBSTR aControllerName, LONG aPort, LONG aDevice) 548 499 { 549 500 return ( aControllerName == m->bd->bstrControllerName … … 556 507 * @param aMedium 557 508 */ 558 void MediumAttachment:: updateMedium(const ComObjPtr<Medium> &aMedium)509 void MediumAttachment::i_updateMedium(const ComObjPtr<Medium> &aMedium) 559 510 { 560 511 Assert(isWriteLockOnCurrentThread()); … … 567 518 568 519 /** Must be called from under this object's write lock. */ 569 void MediumAttachment:: updatePassthrough(bool aPassthrough)520 void MediumAttachment::i_updatePassthrough(bool aPassthrough) 570 521 { 571 522 Assert(isWriteLockOnCurrentThread()); … … 576 527 577 528 /** Must be called from under this object's write lock. */ 578 void MediumAttachment:: updateTempEject(bool aTempEject)529 void MediumAttachment::i_updateTempEject(bool aTempEject) 579 530 { 580 531 Assert(isWriteLockOnCurrentThread()); … … 585 536 586 537 /** Must be called from under this object's write lock. */ 587 void MediumAttachment:: updateEjected()538 void MediumAttachment::i_updateEjected() 588 539 { 589 540 Assert(isWriteLockOnCurrentThread()); … … 593 544 594 545 /** Must be called from under this object's write lock. */ 595 void MediumAttachment:: updateNonRotational(bool aNonRotational)546 void MediumAttachment::i_updateNonRotational(bool aNonRotational) 596 547 { 597 548 Assert(isWriteLockOnCurrentThread()); … … 602 553 603 554 /** Must be called from under this object's write lock. */ 604 void MediumAttachment:: updateDiscard(bool aDiscard)555 void MediumAttachment::i_updateDiscard(bool aDiscard) 605 556 { 606 557 Assert(isWriteLockOnCurrentThread()); … … 611 562 612 563 /** Must be called from under this object's write lock. */ 613 void MediumAttachment:: updateHotPluggable(bool aHotPluggable)564 void MediumAttachment::i_updateHotPluggable(bool aHotPluggable) 614 565 { 615 566 Assert(isWriteLockOnCurrentThread()); … … 619 570 } 620 571 621 void MediumAttachment:: updateBandwidthGroup(const Utf8Str &aBandwidthGroup)572 void MediumAttachment::i_updateBandwidthGroup(const Utf8Str &aBandwidthGroup) 622 573 { 623 574 LogFlowThisFuncEnter(); … … 630 581 } 631 582 632 void MediumAttachment::updateParentMachine(Machine * const pMachine) 633 { 634 LogFlowThisFunc(("ENTER - %s\n", getLogName())); 635 583 void MediumAttachment::i_updateParentMachine(Machine * const pMachine) 584 { 585 LogFlowThisFunc(("ENTER - %s\n", i_getLogName())); 636 586 /* sanity */ 637 587 AutoCaller autoCaller(this); … … 642 592 unconst(m->pMachine) = pMachine; 643 593 644 LogFlowThisFunc(("LEAVE - %s\n", getLogName()));645 } 646 594 LogFlowThisFunc(("LEAVE - %s\n", i_getLogName())); 595 } 596 -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r49866 r49871 1474 1474 /// registries of portable VMs referring to this medium), this will also 1475 1475 /// require to add the mRegistered flag to data 1476 1476 NOREF(aDescription); 1477 1477 ReturnComNotImplemented(); 1478 1478 } … … 1704 1704 HRESULT Medium::getAllowedTypes(std::vector<MediumType_T> &aAllowedTypes) 1705 1705 { 1706 NOREF(aAllowedTypes); 1706 1707 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1707 1708 … … 2662 2663 { 2663 2664 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2665 NOREF(aLocation); 2666 NOREF(aProgress); 2664 2667 2665 2668 /// @todo NEWMEDIA for file names, add the default extension if no extension -
trunk/src/VBox/Main/src-server/NATEngineImpl.cpp
r46820 r49871 29 29 #include <VBox/com/array.h> 30 30 31 struct NATEngine::Data 32 { 33 Data() : mMtu(0), 34 mSockRcv(0), 35 mSockSnd(0), 36 mTcpRcv(0), 37 mTcpSnd(0), 38 mDNSPassDomain(TRUE), 39 mDNSProxy(FALSE), 40 mDNSUseHostResolver(FALSE), 41 mAliasMode(0) 42 {} 43 44 com::Utf8Str mNetwork; 45 com::Utf8Str mBindIP; 46 uint32_t mMtu; 47 uint32_t mSockRcv; 48 uint32_t mSockSnd; 49 uint32_t mTcpRcv; 50 uint32_t mTcpSnd; 51 /* TFTP service */ 52 Utf8Str mTFTPPrefix; 53 Utf8Str mTFTPBootFile; 54 Utf8Str mTFTPNextServer; 55 /* DNS service */ 56 BOOL mDNSPassDomain; 57 BOOL mDNSProxy; 58 BOOL mDNSUseHostResolver; 59 /* Alias service */ 60 ULONG mAliasMode; 61 }; 62 63 31 64 32 65 // constructor / destructor … … 38 71 HRESULT NATEngine::FinalConstruct() 39 72 { 40 return S_OK; 41 } 73 return BaseFinalConstruct(); 74 } 75 76 void NATEngine::FinalRelease() 77 { 78 uninit(); 79 BaseFinalRelease(); 80 } 81 42 82 43 83 HRESULT NATEngine::init(Machine *aParent, INetworkAdapter *aAdapter) … … 106 146 107 147 108 void NATEngine::FinalRelease()109 {110 uninit();111 BaseFinalRelease();112 }113 114 148 void NATEngine::uninit() 115 149 { … … 124 158 } 125 159 126 bool NATEngine::i sModified()160 bool NATEngine::i_isModified() 127 161 { 128 162 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 131 165 } 132 166 133 bool NATEngine:: rollback()167 bool NATEngine::i_rollback() 134 168 { 135 169 AutoCaller autoCaller(this); … … 149 183 } 150 184 151 void NATEngine:: commit()185 void NATEngine::i_commit() 152 186 { 153 187 AutoCaller autoCaller(this); … … 178 212 } 179 213 180 STDMETHODIMP 181 NATEngine::GetNetworkSettings(ULONG *aMtu, ULONG *aSockSnd, ULONG *aSockRcv, ULONG *aTcpWndSnd, ULONG *aTcpWndRcv) 182 { 183 AutoCaller autoCaller(this); 184 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 185 214 HRESULT NATEngine::getNetworkSettings(ULONG *aMtu, ULONG *aSockSnd, ULONG *aSockRcv, ULONG *aTcpWndSnd, ULONG *aTcpWndRcv) 215 { 186 216 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 187 217 if (aMtu) … … 190 220 *aSockSnd = mData->mSockSnd; 191 221 if (aSockRcv) 192 222 *aSockRcv = mData->mSockRcv; 193 223 if (aTcpWndSnd) 194 224 *aTcpWndSnd = mData->mTcpSnd; 195 225 if (aTcpWndRcv) 196 *aTcpWndRcv = mData->mTcpRcv; 197 198 return S_OK; 199 } 200 201 STDMETHODIMP 202 NATEngine::SetNetworkSettings(ULONG aMtu, ULONG aSockSnd, ULONG aSockRcv, ULONG aTcpWndSnd, ULONG aTcpWndRcv) 203 { 204 AutoCaller autoCaller(this); 205 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 206 226 *aTcpWndRcv = mData->mTcpRcv; 227 228 return S_OK; 229 } 230 231 HRESULT NATEngine::setNetworkSettings(ULONG aMtu, ULONG aSockSnd, ULONG aSockRcv, ULONG aTcpWndSnd, ULONG aTcpWndRcv) 232 { 207 233 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 208 234 if ( aMtu || aSockSnd || aSockRcv … … 228 254 } 229 255 230 STDMETHODIMP 231 NATEngine::COMGETTER(Redirects)(ComSafeArrayOut(BSTR , aNatRules)) 232 { 233 CheckComArgOutSafeArrayPointerValid(aNatRules); 234 235 AutoCaller autoCaller(this); 236 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 237 238 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 239 240 241 SafeArray<BSTR> sf(mNATRules.size()); 256 257 HRESULT NATEngine::getRedirects(std::vector<com::Utf8Str> &aRedirects) 258 { 259 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 260 261 aRedirects.resize(mNATRules.size()); 242 262 size_t i = 0; 243 263 NATRuleMap::const_iterator it; 244 for (it = mNATRules.begin(); 245 it != mNATRules.end(); ++it, ++i) 264 for (it = mNATRules.begin(); it != mNATRules.end(); ++it, ++i) 246 265 { 247 266 settings::NATRule r = it->second; 248 BstrFmt bstr("%s,%d,%s,%d,%s,%d", 249 r.strName.c_str(), 250 r.proto, 251 r.strHostIP.c_str(), 252 r.u16HostPort, 253 r.strGuestIP.c_str(), 254 r.u16GuestPort); 255 bstr.detachTo(&sf[i]); 256 } 257 sf.detachTo(ComSafeArrayOutArg(aNatRules)); 258 return S_OK; 259 } 260 261 262 STDMETHODIMP 263 NATEngine::AddRedirect(IN_BSTR aName, NATProtocol_T aProto, IN_BSTR aBindIp, USHORT aHostPort, IN_BSTR aGuestIP, USHORT aGuestPort) 264 { 265 266 AutoCaller autoCaller(this); 267 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 268 267 aRedirects[i] = Utf8StrFmt("%s,%d,%s,%d,%s,%d", 268 r.strName.c_str(), 269 r.proto, 270 r.strHostIP.c_str(), 271 r.u16HostPort, 272 r.strGuestIP.c_str(), 273 r.u16GuestPort); 274 } 275 return S_OK; 276 } 277 278 HRESULT NATEngine::addRedirect(const com::Utf8Str &aName, NATProtocol_T aProto, const com::Utf8Str &aHostIP, USHORT aHostPort, const com::Utf8Str &aGuestIP, USHORT aGuestPort) 279 { 269 280 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 270 281 Utf8Str name = aName; … … 292 303 return setError(E_INVALIDARG, 293 304 tr("A NAT rule of this name already exists")); 294 if ( r.strHostIP == Utf8Str(aBindIp)305 if ( r.strHostIP == aHostIP 295 306 && r.u16HostPort == aHostPort 296 307 && r.proto == aProto) … … 301 312 r.strName = name.c_str(); 302 313 r.proto = aProto; 303 r.strHostIP = a BindIp;314 r.strHostIP = aHostIP; 304 315 r.u16HostPort = aHostPort; 305 316 r.strGuestIP = aGuestIP; … … 317 328 } 318 329 319 STDMETHODIMP 320 NATEngine::RemoveRedirect(IN_BSTR aName) 321 { 322 AutoCaller autoCaller(this); 323 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 324 330 HRESULT NATEngine::removeRedirect(const com::Utf8Str &aName) 331 { 325 332 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 326 333 NATRuleMap::iterator it = mNATRules.find(aName); … … 342 349 mData.commit(); 343 350 alock.release(); 344 mParent->onNATRedirectRuleChange(ulSlot, TRUE, aName, proto, Bstr(strHostIP).raw(), u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort);345 return S_OK; 346 } 347 348 HRESULT NATEngine:: loadSettings(const settings::NAT &data)351 mParent->onNATRedirectRuleChange(ulSlot, TRUE, Bstr(aName).raw(), proto, Bstr(strHostIP).raw(), u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort); 352 return S_OK; 353 } 354 355 HRESULT NATEngine::i_loadSettings(const settings::NAT &data) 349 356 { 350 357 AutoCaller autoCaller(this); … … 383 390 384 391 385 HRESULT NATEngine:: saveSettings(settings::NAT &data)392 HRESULT NATEngine::i_saveSettings(settings::NAT &data) 386 393 { 387 394 AutoCaller autoCaller(this); … … 417 424 } 418 425 419 420 STDMETHODIMP 421 NATEngine::COMSETTER(Network)(IN_BSTR aNetwork) 422 { 423 AutoCaller autoCaller(this); 424 AssertComRCReturnRC(autoCaller.rc()); 426 HRESULT NATEngine::setNetwork(const com::Utf8Str &aNetwork) 427 { 425 428 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 426 429 if (Bstr(mData->mNetwork) != aNetwork) … … 434 437 } 435 438 436 STDMETHODIMP 437 NATEngine::COMGETTER(Network)(BSTR *aNetwork) 438 { 439 CheckComArgNotNull(aNetwork); 440 AutoCaller autoCaller(this); 441 AssertComRCReturnRC(autoCaller.rc()); 442 439 440 HRESULT NATEngine::getNetwork(com::Utf8Str &aNetwork) 441 { 443 442 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 444 443 if (!mData->mNetwork.isEmpty()) 445 444 { 446 mData->mNetwork.cloneTo(aNetwork);445 aNetwork = mData->mNetwork; 447 446 Log(("Getter (this:%p) Network: %s\n", this, mData->mNetwork.c_str())); 448 447 } … … 450 449 } 451 450 452 STDMETHODIMP 453 NATEngine::COMSETTER(HostIP)(IN_BSTR aBindIP) 454 { 455 AutoCaller autoCaller(this); 456 AssertComRCReturnRC(autoCaller.rc()); 457 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 458 if (Bstr(mData->mBindIP) != aBindIP) 459 { 460 mData.backup(); 461 mData->mBindIP = aBindIP; 462 mParent->setModified(Machine::IsModified_NetworkAdapters); 463 m_fModified = true; 464 } 465 return S_OK; 466 } 467 STDMETHODIMP NATEngine::COMGETTER(HostIP)(BSTR *aBindIP) 468 { 469 AutoCaller autoCaller(this); 470 AssertComRCReturnRC(autoCaller.rc()); 471 472 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 451 HRESULT NATEngine::setHostIP(const com::Utf8Str &aHostIP) 452 { 453 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 454 if (Bstr(mData->mBindIP) != aHostIP) 455 { 456 mData.backup(); 457 mData->mBindIP = aHostIP; 458 mParent->setModified(Machine::IsModified_NetworkAdapters); 459 m_fModified = true; 460 } 461 return S_OK; 462 } 463 464 HRESULT NATEngine::getHostIP(com::Utf8Str &aBindIP) 465 { 466 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 467 473 468 if (!mData->mBindIP.isEmpty()) 474 mData->mBindIP.cloneTo(aBindIP); 475 return S_OK; 476 } 477 478 479 STDMETHODIMP 480 NATEngine::COMSETTER(TFTPPrefix)(IN_BSTR aTFTPPrefix) 481 { 482 AutoCaller autoCaller(this); 483 AssertComRCReturnRC(autoCaller.rc()); 469 aBindIP = mData->mBindIP; 470 return S_OK; 471 } 472 473 HRESULT NATEngine::setTFTPPrefix(const com::Utf8Str &aTFTPPrefix) 474 { 484 475 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 485 476 if (Bstr(mData->mTFTPPrefix) != aTFTPPrefix) … … 493 484 } 494 485 495 STDMETHODIMP 496 NATEngine::COMGETTER(TFTPPrefix)(BSTR *aTFTPPrefix) 497 { 498 AutoCaller autoCaller(this); 499 AssertComRCReturnRC(autoCaller.rc()); 500 501 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 486 487 HRESULT NATEngine::getTFTPPrefix(com::Utf8Str &aTFTPPrefix) 488 { 489 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 490 502 491 if (!mData->mTFTPPrefix.isEmpty()) 503 492 { 504 mData->mTFTPPrefix.cloneTo(aTFTPPrefix);493 aTFTPPrefix = mData->mTFTPPrefix; 505 494 Log(("Getter (this:%p) TFTPPrefix: %s\n", this, mData->mTFTPPrefix.c_str())); 506 495 } … … 508 497 } 509 498 510 STDMETHODIMP 511 NATEngine::COMSETTER(TFTPBootFile)(IN_BSTR aTFTPBootFile) 512 { 513 AutoCaller autoCaller(this); 514 AssertComRCReturnRC(autoCaller.rc()); 499 HRESULT NATEngine::setTFTPBootFile(const com::Utf8Str &aTFTPBootFile) 500 { 515 501 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 516 502 if (Bstr(mData->mTFTPBootFile) != aTFTPBootFile) … … 524 510 } 525 511 526 STDMETHODIMP 527 NATEngine::COMGETTER(TFTPBootFile)(BSTR *aTFTPBootFile) 528 { 529 AutoCaller autoCaller(this); 530 AssertComRCReturnRC(autoCaller.rc()); 531 512 513 HRESULT NATEngine::getTFTPBootFile(com::Utf8Str &aTFTPBootFile) 514 { 532 515 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 533 516 if (!mData->mTFTPBootFile.isEmpty()) 534 517 { 535 mData->mTFTPBootFile.cloneTo(aTFTPBootFile);518 aTFTPBootFile = mData->mTFTPBootFile; 536 519 Log(("Getter (this:%p) BootFile: %s\n", this, mData->mTFTPBootFile.c_str())); 537 520 } … … 539 522 } 540 523 541 STDMETHODIMP 542 NATEngine::COMSETTER(TFTPNextServer)(IN_BSTR aTFTPNextServer) 543 { 544 AutoCaller autoCaller(this); 545 AssertComRCReturnRC(autoCaller.rc()); 524 525 HRESULT NATEngine::setTFTPNextServer(const com::Utf8Str &aTFTPNextServer) 526 { 546 527 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 547 528 if (Bstr(mData->mTFTPNextServer) != aTFTPNextServer) … … 555 536 } 556 537 557 STDMETHODIMP 558 NATEngine::COMGETTER(TFTPNextServer)(BSTR *aTFTPNextServer) 559 { 560 AutoCaller autoCaller(this); 561 AssertComRCReturnRC(autoCaller.rc()); 562 538 HRESULT NATEngine::getTFTPNextServer(com::Utf8Str &aTFTPNextServer) 539 { 563 540 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 564 541 if (!mData->mTFTPNextServer.isEmpty()) 565 542 { 566 mData->mTFTPNextServer.cloneTo(aTFTPNextServer);543 aTFTPNextServer = mData->mTFTPNextServer; 567 544 Log(("Getter (this:%p) NextServer: %s\n", this, mData->mTFTPNextServer.c_str())); 568 545 } 569 546 return S_OK; 570 547 } 548 571 549 /* DNS */ 572 STDMETHODIMP 573 NATEngine::COMSETTER(DNSPassDomain) (BOOL aDNSPassDomain) 574 { 575 AutoCaller autoCaller(this); 576 AssertComRCReturnRC(autoCaller.rc()); 550 HRESULT NATEngine::setDNSPassDomain(BOOL aDNSPassDomain) 551 { 577 552 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 578 553 … … 586 561 return S_OK; 587 562 } 588 STDMETHODIMP 589 NATEngine::COMGETTER(DNSPassDomain)(BOOL *aDNSPassDomain) 590 { 591 AutoCaller autoCaller(this); 592 AssertComRCReturnRC(autoCaller.rc()); 593 563 564 HRESULT NATEngine::getDNSPassDomain(BOOL *aDNSPassDomain) 565 { 594 566 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 595 567 *aDNSPassDomain = mData->mDNSPassDomain; 596 568 return S_OK; 597 569 } 598 STDMETHODIMP 599 NATEngine::COMSETTER(DNSProxy)(BOOL aDNSProxy) 600 { 601 AutoCaller autoCaller(this); 602 AssertComRCReturnRC(autoCaller.rc()); 570 571 572 HRESULT NATEngine::setDNSProxy(BOOL aDNSProxy) 573 { 603 574 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 604 575 … … 612 583 return S_OK; 613 584 } 614 STDMETHODIMP 615 NATEngine::COMGETTER(DNSProxy)(BOOL *aDNSProxy) 616 { 617 AutoCaller autoCaller(this); 618 AssertComRCReturnRC(autoCaller.rc()); 619 585 586 HRESULT NATEngine::getDNSProxy(BOOL *aDNSProxy) 587 { 620 588 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 621 589 *aDNSProxy = mData->mDNSProxy; 622 590 return S_OK; 623 591 } 624 STDMETHODIMP 625 NATEngine::COMGETTER(DNSUseHostResolver)(BOOL *aDNSUseHostResolver) 626 { 627 AutoCaller autoCaller(this); 628 AssertComRCReturnRC(autoCaller.rc()); 592 593 594 HRESULT NATEngine::getDNSUseHostResolver(BOOL *aDNSUseHostResolver) 595 { 629 596 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 630 597 *aDNSUseHostResolver = mData->mDNSUseHostResolver; 631 598 return S_OK; 632 599 } 633 STDMETHODIMP 634 NATEngine::COMSETTER(DNSUseHostResolver)(BOOL aDNSUseHostResolver) 635 { 636 AutoCaller autoCaller(this); 637 AssertComRCReturnRC(autoCaller.rc()); 638 639 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 640 600 601 602 HRESULT NATEngine::setDNSUseHostResolver(BOOL aDNSUseHostResolver) 603 { 641 604 if (mData->mDNSUseHostResolver != aDNSUseHostResolver) 642 605 { … … 649 612 } 650 613 651 STDMETHODIMP NATEngine::COMSETTER(AliasMode)(ULONG aAliasMode) 652 { 653 AutoCaller autoCaller(this); 654 AssertComRCReturnRC(autoCaller.rc()); 655 614 HRESULT NATEngine::setAliasMode(ULONG aAliasMode) 615 { 656 616 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 657 617 … … 666 626 } 667 627 668 STDMETHODIMP NATEngine::COMGETTER(AliasMode)(ULONG *aAliasMode) 669 { 670 AutoCaller autoCaller(this); 671 AssertComRCReturnRC(autoCaller.rc()); 628 HRESULT NATEngine::getAliasMode(ULONG *aAliasMode) 629 { 672 630 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 673 631 *aAliasMode = mData->mAliasMode; -
trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
r49742 r49871 1251 1251 } 1252 1252 1253 mNATEngine-> loadSettings(data.nat);1253 mNATEngine->i_loadSettings(data.nat); 1254 1254 mData->mBridgedInterface = data.strBridgedName; 1255 1255 mData->mInternalNetwork = data.strInternalNetworkName; … … 1306 1306 data.mode = mData->mAttachmentType; 1307 1307 1308 mNATEngine-> commit();1309 mNATEngine-> saveSettings(data.nat);1308 mNATEngine->i_commit(); 1309 mNATEngine->i_saveSettings(data.nat); 1310 1310 1311 1311 data.strBridgedName = mData->mBridgedInterface; … … 1333 1333 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1334 1334 bool fChanged = m_fModified; 1335 fChanged |= (mData->mAdapterType == NetworkAttachmentType_NAT? mNATEngine->i sModified() : false);1335 fChanged |= (mData->mAdapterType == NetworkAttachmentType_NAT? mNATEngine->i_isModified() : false); 1336 1336 return fChanged; 1337 1337 } -
trunk/src/VBox/Main/src-server/ParallelPortImpl.cpp
r44528 r49871 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 52 52 // constructor / destructor 53 53 ///////////////////////////////////////////////////////////////////////////// 54 DEFINE_EMPTY_CTOR_DTOR(ParallelPort) 54 55 55 56 HRESULT ParallelPort::FinalConstruct() … … 194 195 ///////////////////////////////////////////////////////////////////////////// 195 196 196 STDMETHODIMP ParallelPort::COMGETTER(Enabled) (BOOL *aEnabled) 197 { 198 CheckComArgOutPointerValid(aEnabled); 199 200 AutoCaller autoCaller(this); 201 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 202 197 HRESULT ParallelPort::getEnabled(BOOL *aEnabled) 198 { 203 199 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 204 200 … … 208 204 } 209 205 210 STDMETHODIMP ParallelPort::COMSETTER(Enabled)(BOOL aEnabled)206 HRESULT ParallelPort::setEnabled(BOOL aEnabled) 211 207 { 212 208 LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled)); 213 214 AutoCaller autoCaller(this);215 if (FAILED(autoCaller.rc())) return autoCaller.rc();216 217 209 /* the machine needs to be mutable */ 218 210 AutoMutableStateDependency adep(m->pMachine); … … 246 238 } 247 239 248 STDMETHODIMP ParallelPort::COMGETTER(Slot) (ULONG *aSlot) 249 { 250 CheckComArgOutPointerValid(aSlot); 251 252 AutoCaller autoCaller(this); 253 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 254 240 HRESULT ParallelPort::getSlot(ULONG *aSlot) 241 { 255 242 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 256 243 … … 260 247 } 261 248 262 STDMETHODIMP ParallelPort::COMGETTER(IRQ) (ULONG *aIRQ) 263 { 264 CheckComArgOutPointerValid(aIRQ); 265 266 AutoCaller autoCaller(this); 267 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 268 249 HRESULT ParallelPort::getIRQ(ULONG *aIRQ) 250 { 269 251 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 270 252 … … 274 256 } 275 257 276 STDMETHODIMP ParallelPort::COMSETTER(IRQ)(ULONG aIRQ)258 HRESULT ParallelPort::setIRQ(ULONG aIRQ) 277 259 { 278 260 /* check IRQ limits … … 283 265 m->bd->ulSlot, aIRQ, 255); 284 266 285 AutoCaller autoCaller(this);286 if (FAILED(autoCaller.rc())) return autoCaller.rc();287 288 267 /* the machine needs to be mutable */ 289 268 AutoMutableStateDependency adep(m->pMachine); … … 311 290 } 312 291 313 STDMETHODIMP ParallelPort::COMGETTER(IOBase) (ULONG *aIOBase) 314 { 315 CheckComArgOutPointerValid(aIOBase); 316 317 AutoCaller autoCaller(this); 318 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 319 292 HRESULT ParallelPort::getIOBase(ULONG *aIOBase) 293 { 320 294 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 321 295 … … 325 299 } 326 300 327 STDMETHODIMP ParallelPort::COMSETTER(IOBase)(ULONG aIOBase)301 HRESULT ParallelPort::setIOBase(ULONG aIOBase) 328 302 { 329 303 /* check IOBase limits … … 334 308 m->bd->ulSlot, aIOBase, 0, 0xFFFF); 335 309 336 AutoCaller autoCaller(this);337 if (FAILED(autoCaller.rc())) return autoCaller.rc();338 339 310 /* the machine needs to be mutable */ 340 311 AutoMutableStateDependency adep(m->pMachine); … … 362 333 } 363 334 364 STDMETHODIMP ParallelPort::COMGETTER(Path) (BSTR *aPath) 365 { 366 CheckComArgOutPointerValid(aPath); 367 368 AutoCaller autoCaller(this); 369 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 370 371 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 372 373 m->bd->strPath.cloneTo(aPath); 374 375 return S_OK; 376 } 377 378 STDMETHODIMP ParallelPort::COMSETTER(Path) (IN_BSTR aPath) 379 { 380 AutoCaller autoCaller(this); 381 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 382 335 336 HRESULT ParallelPort::getPath(com::Utf8Str &aPath) 337 { 338 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 339 aPath = m->bd->strPath; 340 return S_OK; 341 } 342 343 344 HRESULT ParallelPort::setPath(const com::Utf8Str &aPath) 345 { 383 346 /* the machine needs to be mutable */ 384 347 AutoMutableStateDependency adep(m->pMachine); … … 387 350 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 388 351 389 Utf8Str str(aPath); 390 if (str != m->bd->strPath) 352 if (aPath != m->bd->strPath) 391 353 { 392 HRESULT rc = checkSetPath(str);354 HRESULT rc = i_checkSetPath(aPath); 393 355 if (FAILED(rc)) return rc; 394 356 395 357 m->bd.backup(); 396 m->bd->strPath = str;358 m->bd->strPath = aPath; 397 359 398 360 m->fModified = true; 361 399 362 // leave the lock before informing callbacks 400 363 alock.release(); … … 421 384 * @note Locks this object for writing. 422 385 */ 423 HRESULT ParallelPort:: loadSettings(const settings::ParallelPort &data)386 HRESULT ParallelPort::i_loadSettings(const settings::ParallelPort &data) 424 387 { 425 388 AutoCaller autoCaller(this); … … 439 402 * Note that the given Port node is completely empty on input. 440 403 * 441 * @param aPortNode <Port> node.404 * @param <data> node. 442 405 * 443 406 * @note Locks this object for reading. 444 407 */ 445 HRESULT ParallelPort:: saveSettings(settings::ParallelPort &data)408 HRESULT ParallelPort::i_saveSettings(settings::ParallelPort &data) 446 409 { 447 410 AutoCaller autoCaller(this); … … 460 423 * @return 461 424 */ 462 bool ParallelPort::i sModified()425 bool ParallelPort::i_isModified() 463 426 { 464 427 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); … … 469 432 * @note Locks this object for writing. 470 433 */ 471 void ParallelPort:: rollback()434 void ParallelPort::i_rollback() 472 435 { 473 436 /* sanity */ … … 484 447 * for writing) if there is one. 485 448 */ 486 void ParallelPort:: commit()449 void ParallelPort::i_commit() 487 450 { 488 451 /* sanity */ … … 513 476 * represented by @a aThat (locked for reading). 514 477 */ 515 void ParallelPort:: copyFrom(ParallelPort *aThat)478 void ParallelPort::i_copyFrom(ParallelPort *aThat) 516 479 { 517 480 AssertReturnVoid (aThat != NULL); … … 537 500 * Validates COMSETTER(Path) arguments. 538 501 */ 539 HRESULT ParallelPort:: checkSetPath(const Utf8Str &str)502 HRESULT ParallelPort::i_checkSetPath(const Utf8Str &str) 540 503 { 541 504 AssertReturn(isWriteLockOnCurrentThread(), E_FAIL); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r49795 r49871 1045 1045 { 1046 1046 MediumAttachment *pAtt = *it; 1047 Medium *pMedium = pAtt-> getMedium();1047 Medium *pMedium = pAtt->i_getMedium(); 1048 1048 if (pMedium) // can be NULL for non-harddisk 1049 1049 { … … 1777 1777 ComObjPtr<MediumAttachment> &pAttach = *it; 1778 1778 AutoReadLock attachLock(pAttach COMMA_LOCKVAL_SRC_POS); 1779 if (pAttach-> getType() == DeviceType_HardDisk)1779 if (pAttach->i_getType() == DeviceType_HardDisk) 1780 1780 { 1781 1781 ++ulOpCount; 1782 1782 ++ulTotalWeight; // assume one MB weight for each differencing hard disk to manage 1783 Assert(pAttach-> getMedium());1784 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach-> getMedium()->i_getName().c_str()));1783 Assert(pAttach->i_getMedium()); 1784 LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach->i_getMedium()->i_getName().c_str())); 1785 1785 } 1786 1786 } … … 1964 1964 { 1965 1965 ComObjPtr<MediumAttachment> pAttach = *it; 1966 ComObjPtr<Medium> pMedium = pAttach-> getMedium();1966 ComObjPtr<Medium> pMedium = pAttach->i_getMedium(); 1967 1967 1968 1968 /* while the hard disk is attached, the number of children or the 1969 1969 * parent cannot change, so no lock */ 1970 1970 if ( !pMedium.isNull() 1971 && pAttach-> getType() == DeviceType_HardDisk1971 && pAttach->i_getType() == DeviceType_HardDisk 1972 1972 && !pMedium->i_getParent().isNull() 1973 1973 && pMedium->i_getChildren().size() == 0 … … 2008 2008 { 2009 2009 ComObjPtr<MediumAttachment> pAttach = *it; // guaranteed to have only attachments where medium != NULL 2010 ComObjPtr<Medium> pMedium = pAttach-> getMedium();2010 ComObjPtr<Medium> pMedium = pAttach->i_getMedium(); 2011 2011 2012 2012 AutoWriteLock mlock(pMedium COMMA_LOCKVAL_SRC_POS); … … 2176 2176 mUserData->s.strName.c_str()); 2177 2177 2178 2179 2178 /* If the snapshot being deleted is the current one, ensure current 2180 2179 * settings are committed and saved. … … 2214 2213 ComObjPtr<MediumAttachment> &pAttach = *it; 2215 2214 AutoReadLock attachLock(pAttach COMMA_LOCKVAL_SRC_POS); 2216 if (pAttach-> getType() == DeviceType_HardDisk)2217 { 2218 ComObjPtr<Medium> pHD = pAttach-> getMedium();2215 if (pAttach->i_getType() == DeviceType_HardDisk) 2216 { 2217 ComObjPtr<Medium> pHD = pAttach->i_getMedium(); 2219 2218 Assert(pHD); 2220 2219 AutoReadLock mlock(pHD COMMA_LOCKVAL_SRC_POS); … … 2437 2436 ComObjPtr<MediumAttachment> &pAttach = *it; 2438 2437 AutoReadLock attachLock(pAttach COMMA_LOCKVAL_SRC_POS); 2439 if (pAttach-> getType() != DeviceType_HardDisk)2438 if (pAttach->i_getType() != DeviceType_HardDisk) 2440 2439 continue; 2441 2440 2442 ComObjPtr<Medium> pHD = pAttach-> getMedium();2441 ComObjPtr<Medium> pHD = pAttach->i_getMedium(); 2443 2442 Assert(!pHD.isNull()); 2444 2443 … … 2479 2478 pOnlineMediumAttachment = 2480 2479 findAttachment(mMediaData->mAttachments, 2481 pAttach-> getControllerName().raw(),2482 pAttach-> getPort(),2483 pAttach-> getDevice());2480 pAttach->i_getControllerName().raw(), 2481 pAttach->i_getPort(), 2482 pAttach->i_getDevice()); 2484 2483 if (pOnlineMediumAttachment) 2485 2484 { … … 2873 2872 { 2874 2873 AutoWriteLock attLock(pAtt COMMA_LOCKVAL_SRC_POS); 2875 pAtt-> updateMedium(it->mpTarget);2874 pAtt->i_updateMedium(it->mpTarget); 2876 2875 it->mpTarget->i_addBackReference(pMachine->mData->mUuid, childSnapshotId); 2877 2876 } … … 3649 3648 { 3650 3649 AutoWriteLock attLock(pDeleteRec->mpOnlineMediumAttachment COMMA_LOCKVAL_SRC_POS); 3651 pDeleteRec->mpOnlineMediumAttachment-> updateMedium(pDeleteRec->mpTarget);3650 pDeleteRec->mpOnlineMediumAttachment->i_updateMedium(pDeleteRec->mpTarget); 3652 3651 } 3653 3652 -
trunk/src/VBox/Main/src-server/USBControllerImpl.cpp
r47401 r49871 234 234 235 235 236 // IUSBController properties 237 ///////////////////////////////////////////////////////////////////////////// 238 STDMETHODIMP USBController::COMGETTER(Name) (BSTR *aName) 239 { 240 CheckComArgOutPointerValid(aName); 241 242 AutoCaller autoCaller(this); 243 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 244 236 // Wrapped IUSBController properties 237 ///////////////////////////////////////////////////////////////////////////// 238 HRESULT USBController::getName(com::Utf8Str &aName) 239 { 245 240 /* strName is constant during life time, no need to lock */ 246 m->bd->strName.cloneTo(aName); 247 248 return S_OK; 249 } 250 251 STDMETHODIMP USBController::COMGETTER(Type)(USBControllerType_T *aType) 252 { 253 CheckComArgOutPointerValid(aType); 254 255 AutoCaller autoCaller(this); 256 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 257 241 aName = m->bd->strName; 242 243 return S_OK; 244 } 245 246 HRESULT USBController::getType(USBControllerType_T *aType) 247 { 258 248 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 259 249 … … 263 253 } 264 254 265 STDMETHODIMP USBController::COMGETTER(USBStandard)(USHORT *aUSBStandard) 266 { 267 CheckComArgOutPointerValid(aUSBStandard); 268 269 AutoCaller autoCaller(this); 270 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 271 255 HRESULT USBController::getUSBStandard(USHORT *aUSBStandard) 256 { 272 257 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 273 258 … … 292 277 293 278 /** @note Locks objects for writing! */ 294 void USBController:: rollback()279 void USBController::i_rollback() 295 280 { 296 281 AutoCaller autoCaller(this); … … 310 295 * for writing) if there is one. 311 296 */ 312 void USBController:: commit()297 void USBController::i_commit() 313 298 { 314 299 /* sanity */ … … 340 325 * represented by @a aThat (locked for reading). 341 326 */ 342 void USBController:: copyFrom(USBController *aThat)327 void USBController::i_copyFrom(USBController *aThat) 343 328 { 344 329 AssertReturnVoid(aThat != NULL); … … 374 359 * represented by @a aThat (locked for reading). 375 360 */ 376 void USBController:: unshare()361 void USBController::i_unshare() 377 362 { 378 363 /* sanity */ … … 400 385 } 401 386 402 const Utf8Str & USBController::getName() const387 const Utf8Str &USBController::i_getName() const 403 388 { 404 389 return m->bd->strName; 405 390 } 406 391 407 USBControllerType_T USBController::getControllerType() const392 const USBControllerType_T &USBController::i_getControllerType() const 408 393 { 409 394 return m->bd->enmType; 410 395 } 411 396 412 ComObjPtr<USBController> USBController:: getPeer()397 ComObjPtr<USBController> USBController::i_getPeer() 413 398 { 414 399 return m->pPeer; 415 400 } 416 401 417 // private methods418 402 ///////////////////////////////////////////////////////////////////////////// 419 403 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp
r49644 r49871 36 36 37 37 #include <memory> 38 39 struct VFSExplorer::Data 40 { 41 struct DirEntry 42 { 43 DirEntry(Utf8Str strName, VFSFileType_T fileType, uint64_t cbSize, uint32_t fMode) 44 : name(strName) 45 , type(fileType) 46 , size(cbSize) 47 , mode(fMode) {} 48 49 Utf8Str name; 50 VFSFileType_T type; 51 uint64_t size; 52 uint32_t mode; 53 }; 54 55 VFSType_T storageType; 56 Utf8Str strUsername; 57 Utf8Str strPassword; 58 Utf8Str strHostname; 59 Utf8Str strPath; 60 Utf8Str strBucket; 61 std::list<DirEntry> entryList; 62 }; 63 38 64 39 65 VFSExplorer::VFSExplorer() … … 538 564 539 565 if (SUCCEEDED(rc)) 540 /* Return progress to the caller */541 progress.queryInterfaceTo(aProgress.asOutParam());566 /* Return progress to the caller */ 567 progress.queryInterfaceTo(aProgress.asOutParam()); 542 568 543 569 return rc; -
trunk/src/VBox/Main/src-server/generic/NetIf-generic.cpp
r49586 r49871 266 266 iface.createObject(); 267 267 iface->init(IfName, HostNetworkInterfaceType_HostOnly, pInfo); 268 iface-> setVirtualBox(pVBox);268 iface->i_setVirtualBox(pVBox); 269 269 iface.queryInterfaceTo(aHostNetworkInterface); 270 270 } -
trunk/src/VBox/Main/src-server/xpcom/server.cpp
r49795 r49871 113 113 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Snapshot, ISnapshot) 114 114 115 NS_DECL_CLASSINFO(MediumAttachment)116 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(MediumAttachment, IMediumAttachment)117 118 115 NS_DECL_CLASSINFO(Progress) 119 116 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress) … … 125 122 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SharedFolder, ISharedFolder) 126 123 127 NS_DECL_CLASSINFO(HostNetworkInterface)128 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterface, IHostNetworkInterface)129 130 124 NS_DECL_CLASSINFO(NetworkAdapter) 131 125 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NetworkAdapter, INetworkAdapter) 132 133 NS_DECL_CLASSINFO(NATEngine)134 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NATEngine, INATEngine)135 136 NS_DECL_CLASSINFO(ParallelPort)137 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(ParallelPort, IParallelPort)138 139 NS_DECL_CLASSINFO(USBController)140 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBController, IUSBController)141 126 142 127 NS_DECL_CLASSINFO(USBDeviceFilters) … … 153 138 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDeviceFilter, IUSBDeviceFilter, IHostUSBDeviceFilter) 154 139 #endif 155 156 NS_DECL_CLASSINFO(AudioAdapter)157 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(AudioAdapter, IAudioAdapter)158 140 159 141 NS_DECL_CLASSINFO(SystemProperties) … … 166 148 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(PerformanceMetric, IPerformanceMetric) 167 149 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 168 169 NS_DECL_CLASSINFO(BIOSSettings)170 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(BIOSSettings, IBIOSSettings)171 150 172 151 #ifdef VBOX_WITH_EXTPACK
Note:
See TracChangeset
for help on using the changeset viewer.