Changeset 15834 in vbox for trunk/src/VBox/Main/SessionImpl.cpp
- Timestamp:
- Jan 7, 2009 2:17:56 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SessionImpl.cpp
r15140 r15834 266 266 AutoReadLock alock (this); 267 267 268 AssertReturn (mState != SessionState_Closed, E_FAIL);268 AssertReturn (mState != SessionState_Closed, VBOX_E_INVALID_VM_STATE); 269 269 270 270 AssertMsgReturn (mType == SessionType_Direct && !!mConsole, 271 ("This is not a direct session!\n"), E_FAIL);271 ("This is not a direct session!\n"), VBOX_E_INVALID_OBJECT_STATE); 272 272 273 273 /* return a failure if the session already transitioned to Closing 274 274 * but the server hasn't processed Machine::OnSessionEnd() yet. */ 275 275 if (mState != SessionState_Open) 276 return E_UNEXPECTED;276 return VBOX_E_INVALID_VM_STATE; 277 277 278 278 mConsole.queryInterfaceTo (aConsole); … … 291 291 AutoWriteLock alock (this); 292 292 293 AssertReturn (mState == SessionState_Closed, E_FAIL);293 AssertReturn (mState == SessionState_Closed, VBOX_E_INVALID_VM_STATE); 294 294 295 295 if (!aMachine) … … 302 302 */ 303 303 304 AssertReturn (mType == SessionType_Null, E_FAIL);304 AssertReturn (mType == SessionType_Null, VBOX_E_INVALID_OBJECT_STATE); 305 305 mType = SessionType_Remote; 306 306 mState = SessionState_Spawning; … … 363 363 364 364 AssertReturn (mState == SessionState_Closed || 365 mState == SessionState_Spawning, E_FAIL);365 mState == SessionState_Spawning, VBOX_E_INVALID_VM_STATE); 366 366 367 367 HRESULT rc = E_FAIL; … … 369 369 /* query IInternalMachineControl interface */ 370 370 mControl = aMachine; 371 AssertReturn (!!mControl, E_FAIL); 371 AssertReturn (!!mControl, E_FAIL); // This test appears to be redundant --JS 372 372 373 373 /// @todo (dmik) … … 445 445 } 446 446 447 AssertReturn (mState == SessionState_Open &&448 mType == SessionType_Direct, E_FAIL);447 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 448 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 449 449 450 450 AssertReturn (!mControl.isNull(), E_FAIL); … … 476 476 477 477 AssertReturn (mState == SessionState_Open || 478 mState == SessionState_Spawning, E_FAIL);478 mState == SessionState_Spawning, VBOX_E_INVALID_VM_STATE); 479 479 480 480 /* close ourselves */ … … 509 509 510 510 AutoReadLock alock (this); 511 AssertReturn (mState == SessionState_Open &&512 mType == SessionType_Direct, E_FAIL);511 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 512 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 513 513 514 514 return mConsole->onDVDDriveChange(); … … 523 523 524 524 AutoReadLock alock (this); 525 AssertReturn (mState == SessionState_Open &&526 mType == SessionType_Direct, E_FAIL);525 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 526 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 527 527 528 528 return mConsole->onFloppyDriveChange(); … … 537 537 538 538 AutoReadLock alock (this); 539 AssertReturn (mState == SessionState_Open &&540 mType == SessionType_Direct, E_FAIL);539 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 540 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 541 541 542 542 return mConsole->onNetworkAdapterChange(networkAdapter); … … 551 551 552 552 AutoReadLock alock (this); 553 AssertReturn (mState == SessionState_Open &&554 mType == SessionType_Direct, E_FAIL);553 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 554 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 555 555 556 556 return mConsole->onSerialPortChange(serialPort); … … 565 565 566 566 AutoReadLock alock (this); 567 AssertReturn (mState == SessionState_Open &&568 mType == SessionType_Direct, E_FAIL);567 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 568 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 569 569 570 570 return mConsole->onParallelPortChange(parallelPort); … … 579 579 580 580 AutoReadLock alock (this); 581 AssertReturn (mState == SessionState_Open &&582 mType == SessionType_Direct, E_FAIL);581 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 582 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 583 583 584 584 return mConsole->onVRDPServerChange(); … … 593 593 594 594 AutoReadLock alock (this); 595 AssertReturn (mState == SessionState_Open &&596 mType == SessionType_Direct, E_FAIL);595 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 596 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 597 597 598 598 return mConsole->onUSBControllerChange(); … … 607 607 608 608 AutoReadLock alock (this); 609 AssertReturn (mState == SessionState_Open &&610 mType == SessionType_Direct, E_FAIL);609 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 610 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 611 611 612 612 return mConsole->onSharedFolderChange (aGlobal); … … 623 623 624 624 AutoReadLock alock (this); 625 AssertReturn (mState == SessionState_Open &&626 mType == SessionType_Direct, E_FAIL);625 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 626 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 627 627 628 628 return mConsole->onUSBDeviceAttach (aDevice, aError, aMaskedIfs); … … 638 638 639 639 AutoReadLock alock (this); 640 AssertReturn (mState == SessionState_Open &&641 mType == SessionType_Direct, E_FAIL);640 AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE); 641 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 642 642 643 643 return mConsole->onUSBDeviceDetach (aId, aError); … … 651 651 AutoReadLock alock (this); 652 652 653 AssertReturn (mType == SessionType_Direct, E_FAIL);653 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 654 654 655 655 if (mState != SessionState_Open) … … 678 678 tr ("Machine session is not open (session state: %d)."), 679 679 mState); 680 AssertReturn (mType == SessionType_Direct, E_UNEXPECTED);680 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 681 681 CheckComArgNotNull(aName); 682 682 if (!aIsSetter && !VALID_PTR (aRetValue)) … … 712 712 713 713 if (mState != SessionState_Open) 714 return setError ( E_FAIL,714 return setError (VBOX_E_INVALID_VM_STATE, 715 715 tr ("Machine session is not open (session state: %d)."), 716 716 mState); 717 AssertReturn (mType == SessionType_Direct, E_UNEXPECTED);717 AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE); 718 718 if (!VALID_PTR (aPatterns) && (aPatterns != NULL)) 719 719 return E_POINTER;
Note:
See TracChangeset
for help on using the changeset viewer.