Changeset 21878 in vbox for trunk/src/VBox/Main/SystemPropertiesImpl.cpp
- Timestamp:
- Jul 30, 2009 12:42:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SystemPropertiesImpl.cpp
r21446 r21878 67 67 HRESULT SystemProperties::init (VirtualBox *aParent) 68 68 { 69 LogFlowThisFunc 69 LogFlowThisFunc(("aParent=%p\n", aParent)); 70 70 71 71 ComAssertRet (aParent, E_FAIL); 72 72 73 73 /* Enclose the state transition NotReady->InInit->Ready */ 74 AutoInitSpan autoInitSpan 75 AssertReturn 76 77 unconst 74 AutoInitSpan autoInitSpan(this); 75 AssertReturn(autoInitSpan.isOk(), E_FAIL); 76 77 unconst(mParent) = aParent; 78 78 79 79 setDefaultMachineFolder (NULL); … … 99 99 int vrc = VDBackendInfo (RT_ELEMENTS (aVDInfo), aVDInfo, &cEntries); 100 100 AssertRC (vrc); 101 if (RT_SUCCESS 101 if (RT_SUCCESS(vrc)) 102 102 { 103 103 for (unsigned i = 0; i < cEntries; ++ i) 104 104 { 105 ComObjPtr 105 ComObjPtr<HardDiskFormat> hdf; 106 106 rc = hdf.createObject(); 107 107 CheckComRCBreakRC (rc); … … 149 149 150 150 /* Confirm a successful initialization */ 151 if (SUCCEEDED 151 if (SUCCEEDED(rc)) 152 152 autoInitSpan.setSucceeded(); 153 153 … … 161 161 void SystemProperties::uninit() 162 162 { 163 LogFlowThisFunc 163 LogFlowThisFunc(("\n")); 164 164 165 165 /* Enclose the state transition Ready->InUninit->NotReady */ 166 AutoUninitSpan autoUninitSpan 166 AutoUninitSpan autoUninitSpan(this); 167 167 if (autoUninitSpan.uninitDone()) 168 168 return; 169 169 170 unconst 170 unconst(mParent).setNull(); 171 171 } 172 172 … … 180 180 return E_POINTER; 181 181 182 AutoCaller autoCaller 183 CheckComRCReturnRC 182 AutoCaller autoCaller(this); 183 CheckComRCReturnRC(autoCaller.rc()); 184 184 185 185 /* no need to lock, this is const */ … … 195 195 return E_POINTER; 196 196 197 AutoCaller autoCaller 198 CheckComRCReturnRC 197 AutoCaller autoCaller(this); 198 CheckComRCReturnRC(autoCaller.rc()); 199 199 200 200 /* no need to lock, this is const */ … … 210 210 return E_POINTER; 211 211 212 AutoCaller autoCaller 213 CheckComRCReturnRC 212 AutoCaller autoCaller(this); 213 CheckComRCReturnRC(autoCaller.rc()); 214 214 215 215 /* no need to lock, this is const */ … … 224 224 return E_POINTER; 225 225 226 AutoCaller autoCaller 227 CheckComRCReturnRC 226 AutoCaller autoCaller(this); 227 CheckComRCReturnRC(autoCaller.rc()); 228 228 229 229 /* no need to lock, this is const */ … … 238 238 return E_POINTER; 239 239 240 AutoCaller autoCaller 241 CheckComRCReturnRC 240 AutoCaller autoCaller(this); 241 CheckComRCReturnRC(autoCaller.rc()); 242 242 243 243 /* no need to lock, this is const */ … … 252 252 return E_POINTER; 253 253 254 AutoCaller autoCaller 255 CheckComRCReturnRC 254 AutoCaller autoCaller(this); 255 CheckComRCReturnRC(autoCaller.rc()); 256 256 257 257 /* no need to lock, this is const */ … … 266 266 return E_POINTER; 267 267 268 AutoCaller autoCaller 269 CheckComRCReturnRC 268 AutoCaller autoCaller(this); 269 CheckComRCReturnRC(autoCaller.rc()); 270 270 271 271 /* no need to lock, this is const */ … … 280 280 return E_POINTER; 281 281 282 AutoCaller autoCaller 283 CheckComRCReturnRC 282 AutoCaller autoCaller(this); 283 CheckComRCReturnRC(autoCaller.rc()); 284 284 285 285 /** The BIOS supports currently 32 bit LBA numbers (implementing the full … … 303 303 return E_POINTER; 304 304 305 AutoCaller autoCaller 306 CheckComRCReturnRC 305 AutoCaller autoCaller(this); 306 CheckComRCReturnRC(autoCaller.rc()); 307 307 308 308 /* no need to lock, this is const */ … … 317 317 return E_POINTER; 318 318 319 AutoCaller autoCaller 320 CheckComRCReturnRC 319 AutoCaller autoCaller(this); 320 CheckComRCReturnRC(autoCaller.rc()); 321 321 322 322 /* no need to lock, this is const */ … … 331 331 return E_POINTER; 332 332 333 AutoCaller autoCaller 334 CheckComRCReturnRC 333 AutoCaller autoCaller(this); 334 CheckComRCReturnRC(autoCaller.rc()); 335 335 336 336 /* no need to lock, this is const */ … … 344 344 CheckComArgOutPointerValid(aMaxBootPosition); 345 345 346 AutoCaller autoCaller 347 CheckComRCReturnRC 346 AutoCaller autoCaller(this); 347 CheckComRCReturnRC(autoCaller.rc()); 348 348 349 349 /* no need to lock, this is const */ … … 357 357 CheckComArgOutPointerValid(aDefaultMachineFolder); 358 358 359 AutoCaller autoCaller 360 CheckComRCReturnRC 361 362 AutoReadLock alock 363 364 mDefaultMachineFolderFull.cloneTo 359 AutoCaller autoCaller(this); 360 CheckComRCReturnRC(autoCaller.rc()); 361 362 AutoReadLock alock(this); 363 364 mDefaultMachineFolderFull.cloneTo(aDefaultMachineFolder); 365 365 366 366 return S_OK; … … 369 369 STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder) (IN_BSTR aDefaultMachineFolder) 370 370 { 371 AutoCaller autoCaller 372 CheckComRCReturnRC 371 AutoCaller autoCaller(this); 372 CheckComRCReturnRC(autoCaller.rc()); 373 373 374 374 /* VirtualBox::saveSettings() needs a write lock */ … … 376 376 377 377 HRESULT rc = setDefaultMachineFolder (aDefaultMachineFolder); 378 if (SUCCEEDED 378 if (SUCCEEDED(rc)) 379 379 rc = mParent->saveSettings(); 380 380 … … 386 386 CheckComArgOutPointerValid(aDefaultHardDiskFolder); 387 387 388 AutoCaller autoCaller 389 CheckComRCReturnRC 390 391 AutoReadLock alock 392 393 mDefaultHardDiskFolderFull.cloneTo 388 AutoCaller autoCaller(this); 389 CheckComRCReturnRC(autoCaller.rc()); 390 391 AutoReadLock alock(this); 392 393 mDefaultHardDiskFolderFull.cloneTo(aDefaultHardDiskFolder); 394 394 395 395 return S_OK; … … 398 398 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder) (IN_BSTR aDefaultHardDiskFolder) 399 399 { 400 AutoCaller autoCaller 401 CheckComRCReturnRC 400 AutoCaller autoCaller(this); 401 CheckComRCReturnRC(autoCaller.rc()); 402 402 403 403 /* VirtualBox::saveSettings() needs a write lock */ … … 405 405 406 406 HRESULT rc = setDefaultHardDiskFolder (aDefaultHardDiskFolder); 407 if (SUCCEEDED 407 if (SUCCEEDED(rc)) 408 408 rc = mParent->saveSettings(); 409 409 … … 412 412 413 413 STDMETHODIMP SystemProperties:: 414 COMGETTER(HardDiskFormats) (ComSafeArrayOut 415 { 416 if (ComSafeArrayOutIsNull 417 return E_POINTER; 418 419 AutoCaller autoCaller 420 CheckComRCReturnRC 421 422 AutoReadLock alock 423 424 SafeIfaceArray 425 hardDiskFormats.detachTo (ComSafeArrayOutArg(aHardDiskFormats));414 COMGETTER(HardDiskFormats) (ComSafeArrayOut(IHardDiskFormat *, aHardDiskFormats)) 415 { 416 if (ComSafeArrayOutIsNull(aHardDiskFormats)) 417 return E_POINTER; 418 419 AutoCaller autoCaller(this); 420 CheckComRCReturnRC(autoCaller.rc()); 421 422 AutoReadLock alock(this); 423 424 SafeIfaceArray<IHardDiskFormat> hardDiskFormats (mHardDiskFormats); 425 hardDiskFormats.detachTo(ComSafeArrayOutArg(aHardDiskFormats)); 426 426 427 427 return S_OK; … … 432 432 CheckComArgOutPointerValid(aDefaultHardDiskFormat); 433 433 434 AutoCaller autoCaller 435 CheckComRCReturnRC 436 437 AutoReadLock alock 438 439 mDefaultHardDiskFormat.cloneTo 434 AutoCaller autoCaller(this); 435 CheckComRCReturnRC(autoCaller.rc()); 436 437 AutoReadLock alock(this); 438 439 mDefaultHardDiskFormat.cloneTo(aDefaultHardDiskFormat); 440 440 441 441 return S_OK; … … 444 444 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat) (IN_BSTR aDefaultHardDiskFormat) 445 445 { 446 AutoCaller autoCaller 447 CheckComRCReturnRC 446 AutoCaller autoCaller(this); 447 CheckComRCReturnRC(autoCaller.rc()); 448 448 449 449 /* VirtualBox::saveSettings() needs a write lock */ … … 451 451 452 452 HRESULT rc = setDefaultHardDiskFormat (aDefaultHardDiskFormat); 453 if (SUCCEEDED 453 if (SUCCEEDED(rc)) 454 454 rc = mParent->saveSettings(); 455 455 … … 461 461 CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary); 462 462 463 AutoCaller autoCaller 464 CheckComRCReturnRC 465 466 AutoReadLock alock 467 468 mRemoteDisplayAuthLibrary.cloneTo 463 AutoCaller autoCaller(this); 464 CheckComRCReturnRC(autoCaller.rc()); 465 466 AutoReadLock alock(this); 467 468 mRemoteDisplayAuthLibrary.cloneTo(aRemoteDisplayAuthLibrary); 469 469 470 470 return S_OK; … … 473 473 STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) (IN_BSTR aRemoteDisplayAuthLibrary) 474 474 { 475 AutoCaller autoCaller 476 CheckComRCReturnRC 475 AutoCaller autoCaller(this); 476 CheckComRCReturnRC(autoCaller.rc()); 477 477 478 478 /* VirtualBox::saveSettings() needs a write lock */ … … 480 480 481 481 HRESULT rc = setRemoteDisplayAuthLibrary (aRemoteDisplayAuthLibrary); 482 if (SUCCEEDED 482 if (SUCCEEDED(rc)) 483 483 rc = mParent->saveSettings(); 484 484 … … 490 490 CheckComArgOutPointerValid(aWebServiceAuthLibrary); 491 491 492 AutoCaller autoCaller 493 CheckComRCReturnRC 494 495 AutoReadLock alock 496 497 mWebServiceAuthLibrary.cloneTo 492 AutoCaller autoCaller(this); 493 CheckComRCReturnRC(autoCaller.rc()); 494 495 AutoReadLock alock(this); 496 497 mWebServiceAuthLibrary.cloneTo(aWebServiceAuthLibrary); 498 498 499 499 return S_OK; … … 502 502 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary) (IN_BSTR aWebServiceAuthLibrary) 503 503 { 504 AutoCaller autoCaller 505 CheckComRCReturnRC 504 AutoCaller autoCaller(this); 505 CheckComRCReturnRC(autoCaller.rc()); 506 506 507 507 /* VirtualBox::saveSettings() needs a write lock */ … … 509 509 510 510 HRESULT rc = setWebServiceAuthLibrary (aWebServiceAuthLibrary); 511 if (SUCCEEDED 511 if (SUCCEEDED(rc)) 512 512 rc = mParent->saveSettings(); 513 513 … … 520 520 return E_POINTER; 521 521 522 AutoCaller autoCaller 523 CheckComRCReturnRC 524 525 AutoReadLock alock 522 AutoCaller autoCaller(this); 523 CheckComRCReturnRC(autoCaller.rc()); 524 525 AutoReadLock alock(this); 526 526 527 527 *count = mLogHistoryCount; … … 532 532 STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount) (ULONG count) 533 533 { 534 AutoCaller autoCaller 535 CheckComRCReturnRC 534 AutoCaller autoCaller(this); 535 CheckComRCReturnRC(autoCaller.rc()); 536 536 537 537 /* VirtualBox::saveSettings() needs a write lock */ … … 550 550 return E_POINTER; 551 551 552 AutoCaller autoCaller 553 CheckComRCReturnRC 554 555 AutoReadLock alock 552 AutoCaller autoCaller(this); 553 CheckComRCReturnRC(autoCaller.rc()); 554 555 AutoReadLock alock(this); 556 556 557 557 *aAudioDriver = mDefaultAudioDriver; … … 567 567 using namespace settings; 568 568 569 AutoCaller autoCaller 570 CheckComRCReturnRC 571 572 AutoWriteLock alock 573 574 AssertReturn 569 AutoCaller autoCaller(this); 570 CheckComRCReturnRC(autoCaller.rc()); 571 572 AutoWriteLock alock(this); 573 574 AssertReturn(!aGlobal.isNull(), E_FAIL); 575 575 576 576 HRESULT rc = S_OK; … … 582 582 bstr = properties.stringValue ("defaultMachineFolder"); 583 583 rc = setDefaultMachineFolder (bstr); 584 CheckComRCReturnRC 584 CheckComRCReturnRC(rc); 585 585 586 586 bstr = properties.stringValue ("defaultHardDiskFolder"); 587 587 rc = setDefaultHardDiskFolder (bstr); 588 CheckComRCReturnRC 588 CheckComRCReturnRC(rc); 589 589 590 590 bstr = properties.stringValue ("defaultHardDiskFormat"); 591 591 rc = setDefaultHardDiskFormat (bstr); 592 CheckComRCReturnRC 592 CheckComRCReturnRC(rc); 593 593 594 594 bstr = properties.stringValue ("remoteDisplayAuthLibrary"); 595 595 rc = setRemoteDisplayAuthLibrary (bstr); 596 CheckComRCReturnRC 596 CheckComRCReturnRC(rc); 597 597 598 598 bstr = properties.stringValue ("webServiceAuthLibrary"); 599 599 rc = setWebServiceAuthLibrary (bstr); 600 CheckComRCReturnRC 600 CheckComRCReturnRC(rc); 601 601 602 602 mLogHistoryCount = properties.valueOr <ULONG> ("LogHistoryCount", 3); … … 609 609 using namespace settings; 610 610 611 AutoCaller autoCaller 612 CheckComRCReturnRC 613 614 AutoReadLock alock 611 AutoCaller autoCaller(this); 612 CheckComRCReturnRC(autoCaller.rc()); 613 614 AutoReadLock alock(this); 615 615 616 616 ComAssertRet (!aGlobal.isNull(), E_FAIL); … … 651 651 * @return ComObjPtr<HardDiskFormat> 652 652 */ 653 ComObjPtr 654 { 655 ComObjPtr 656 657 AutoCaller autoCaller 653 ComObjPtr<HardDiskFormat> SystemProperties::hardDiskFormat (CBSTR aFormat) 654 { 655 ComObjPtr<HardDiskFormat> format; 656 657 AutoCaller autoCaller(this); 658 658 AssertComRCReturn (autoCaller.rc(), format); 659 659 660 AutoReadLock alock 660 AutoReadLock alock(this); 661 661 662 662 for (HardDiskFormatList::const_iterator it = mHardDiskFormats.begin(); … … 689 689 Utf8Str folder; 690 690 int vrc = mParent->calculateFullPath (path, folder); 691 if (RT_FAILURE 691 if (RT_FAILURE(vrc)) 692 692 return setError (E_FAIL, 693 693 tr ("Invalid default machine folder '%ls' (%Rrc)"), … … 711 711 Utf8Str folder; 712 712 int vrc = mParent->calculateFullPath (path, folder); 713 if (RT_FAILURE 713 if (RT_FAILURE(vrc)) 714 714 return setError (E_FAIL, 715 715 tr ("Invalid default hard disk folder '%ls' (%Rrc)"),
Note:
See TracChangeset
for help on using the changeset viewer.