Changeset 15834 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jan 7, 2009 2:17:56 PM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 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; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r15828 r15834 11144 11144 11145 11145 <method name="getRemoteConsole"> 11146 <desc>Returns the console object suitable for remote control.</desc> 11146 <desc> 11147 Returns the console object suitable for remote control. 11148 11149 <result name="VBOX_E_INVALID_VM_STATE"> 11150 Session state prevents operation. 11151 </result> 11152 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11153 Session type prevents operation. 11154 </result> 11155 11156 </desc> 11147 11157 <param name="console" type="IConsole" dir="return"/> 11148 11158 </method> … … 11152 11162 Assigns the machine object associated with this direct-type 11153 11163 session or informs the session that it will be a remote one 11154 (if machine = NULL). 11164 (if @a machine == NULL). 11165 11166 <result name="VBOX_E_INVALID_VM_STATE"> 11167 Session state prevents operation. 11168 </result> 11169 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11170 Session type prevents operation. 11171 </result> 11172 11155 11173 </desc> 11156 11174 <param name="machine" type="IMachine" dir="in"/> … … 11161 11179 Assigns the machine and the (remote) console object associated with 11162 11180 this remote-type session. 11181 11182 <result name="VBOX_E_INVALID_VM_STATE"> 11183 Session state prevents operation. 11184 </result> 11185 11163 11186 </desc> 11164 11187 <param name="machine" type="IMachine" dir="in"/> … … 11171 11194 Must be called only in certain cases 11172 11195 (see the method implementation). 11196 11197 <result name="VBOX_E_INVALID_VM_STATE"> 11198 Session state prevents operation. 11199 </result> 11200 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11201 Session type prevents operation. 11202 </result> 11203 11173 11204 </desc> 11174 11205 <param name="aMachineState" type="MachineState" dir="in"/> … … 11180 11211 the corresponding remote session when the direct session dies 11181 11212 or gets closed. 11213 11214 <result name="VBOX_E_INVALID_VM_STATE"> 11215 Session state prevents operation. 11216 </result> 11217 11182 11218 </desc> 11183 11219 </method> … … 11187 11223 Triggered when settings of the DVD drive object of the 11188 11224 associated virtual machine have changed. 11225 11226 <result name="VBOX_E_INVALID_VM_STATE"> 11227 Session state prevents operation. 11228 </result> 11229 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11230 Session type prevents operation. 11231 </result> 11232 11189 11233 </desc> 11190 11234 </method> … … 11194 11238 Triggered when settings of the floppy drive object of the 11195 11239 associated virtual machine have changed. 11240 11241 <result name="VBOX_E_INVALID_VM_STATE"> 11242 Session state prevents operation. 11243 </result> 11244 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11245 Session type prevents operation. 11246 </result> 11247 11196 11248 </desc> 11197 11249 </method> … … 11201 11253 Triggered when settings of a network adapter of the 11202 11254 associated virtual machine have changed. 11255 11256 <result name="VBOX_E_INVALID_VM_STATE"> 11257 Session state prevents operation. 11258 </result> 11259 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11260 Session type prevents operation. 11261 </result> 11262 11203 11263 </desc> 11204 11264 <param name="networkAdapter" type="INetworkAdapter" dir="in"/> … … 11209 11269 Triggered when settings of a serial port of the 11210 11270 associated virtual machine have changed. 11271 11272 <result name="VBOX_E_INVALID_VM_STATE"> 11273 Session state prevents operation. 11274 </result> 11275 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11276 Session type prevents operation. 11277 </result> 11278 11211 11279 </desc> 11212 11280 <param name="serialPort" type="ISerialPort" dir="in"/> … … 11217 11285 Triggered when settings of a parallel port of the 11218 11286 associated virtual machine have changed. 11287 11288 <result name="VBOX_E_INVALID_VM_STATE"> 11289 Session state prevents operation. 11290 </result> 11291 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11292 Session type prevents operation. 11293 </result> 11294 11219 11295 </desc> 11220 11296 <param name="parallelPort" type="IParallelPort" dir="in"/> … … 11225 11301 Triggered when settings of the VRDP server object of the 11226 11302 associated virtual machine have changed. 11303 11304 <result name="VBOX_E_INVALID_VM_STATE"> 11305 Session state prevents operation. 11306 </result> 11307 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11308 Session type prevents operation. 11309 </result> 11310 11227 11311 </desc> 11228 11312 </method> … … 11232 11316 Triggered when settings of the USB controller object of the 11233 11317 associated virtual machine have changed. 11318 11319 <result name="VBOX_E_INVALID_VM_STATE"> 11320 Session state prevents operation. 11321 </result> 11322 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11323 Session type prevents operation. 11324 </result> 11325 11234 11326 </desc> 11235 11327 </method> … … 11245 11337 time of processing this notification. 11246 11338 </note> 11339 11340 <result name="VBOX_E_INVALID_VM_STATE"> 11341 Session state prevents operation. 11342 </result> 11343 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11344 Session type prevents operation. 11345 </result> 11346 11247 11347 </desc> 11248 11348 <param name="global" type="boolean" dir="in"/> … … 11256 11356 A @c null @a error object means success, otherwise it 11257 11357 describes a failure. 11358 11359 <result name="VBOX_E_INVALID_VM_STATE"> 11360 Session state prevents operation. 11361 </result> 11362 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11363 Session type prevents operation. 11364 </result> 11365 11258 11366 </desc> 11259 11367 <param name="device" type="IUSBDevice" dir="in"/> … … 11268 11376 <link to="IConsole::detachUSBDevice"/>) has completed. 11269 11377 A @c null @a error object means success, otherwise it 11378 11379 <result name="VBOX_E_INVALID_VM_STATE"> 11380 Session state prevents operation. 11381 </result> 11382 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11383 Session type prevents operation. 11384 </result> 11385 11270 11386 </desc> 11271 11387 <param name="id" type="uuid" dir="in"/> … … 11280 11396 <link to="IConsoleCallback::onCanShowWindow()"/> 11281 11397 and <link to="IConsoleCallback::onShowWindow()"/>. 11398 11399 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11400 Session type prevents operation. 11401 </result> 11402 11282 11403 </desc> 11283 11404 <param name="check" type="boolean" dir="in"/> … … 11291 11412 <link to="IMachine::setGuestProperty()"/> in order to read and 11292 11413 modify guest properties. 11414 11415 <result name="VBOX_E_INVALID_VM_STATE"> 11416 Machine session is not open. 11417 </result> 11418 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11419 Session type is not direct. 11420 </result> 11421 11293 11422 </desc> 11294 11423 <param name="name" type="wstring" dir="in"/> … … 11305 11434 Return a list of the guest properties matching a set of patterns along 11306 11435 with their values, time stamps and flags. 11436 11437 <result name="VBOX_E_INVALID_VM_STATE"> 11438 Machine session is not open. 11439 </result> 11440 <result name="VBOX_E_INVALID_OBJECT_STATE"> 11441 Session type is not direct. 11442 </result> 11443 11307 11444 </desc> 11308 11445 <param name="patterns" type="wstring" dir="in">
Note:
See TracChangeset
for help on using the changeset viewer.