Changeset 46610 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 18, 2013 8:23:31 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86490
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r46584 r46610 4438 4438 HRESULT rc = S_OK; 4439 4439 4440 /* don't trigger network change if the VM isn't running */4440 /* don't trigger network changes if the VM isn't running */ 4441 4441 SafeVMPtrQuiet ptrVM(this); 4442 4442 if (ptrVM.isOk()) … … 4551 4551 HRESULT rc = S_OK; 4552 4552 4553 /* don't trigger nat engine changeif the VM isn't running */4553 /* don't trigger NAT engine changes if the VM isn't running */ 4554 4554 SafeVMPtrQuiet ptrVM(this); 4555 4555 if (ptrVM.isOk()) … … 4860 4860 HRESULT rc = S_OK; 4861 4861 4862 /* don't trigger medium change if the VM isn't running */4862 /* don't trigger medium changes if the VM isn't running */ 4863 4863 SafeVMPtrQuiet ptrVM(this); 4864 4864 if (ptrVM.isOk()) … … 4890 4890 HRESULT rc = S_OK; 4891 4891 4892 /* don't trigger CPU change if the VM isn't running */4892 /* don't trigger CPU changes if the VM isn't running */ 4893 4893 SafeVMPtrQuiet ptrVM(this); 4894 4894 if (ptrVM.isOk()) … … 4969 4969 HRESULT rc = S_OK; 4970 4970 4971 /* don't trigger the Clipboard mode change if the VM isn't running */4971 /* don't trigger the clipboard mode change if the VM isn't running */ 4972 4972 SafeVMPtrQuiet ptrVM(this); 4973 4973 if (ptrVM.isOk()) … … 5009 5009 HRESULT rc = S_OK; 5010 5010 5011 /* don't trigger the Drag'n'drop mode change if the VM isn't running */5011 /* don't trigger the drag'n'drop mode change if the VM isn't running */ 5012 5012 SafeVMPtrQuiet ptrVM(this); 5013 5013 if (ptrVM.isOk()) … … 5047 5047 HRESULT rc = S_OK; 5048 5048 5049 if ( mVRDEServer 5050 && ( mMachineState == MachineState_Running 5051 || mMachineState == MachineState_Teleporting 5052 || mMachineState == MachineState_LiveSnapshotting 5053 || mMachineState == MachineState_Paused 5054 ) 5055 ) 5056 { 5057 BOOL vrdpEnabled = FALSE; 5058 5059 rc = mVRDEServer->COMGETTER(Enabled)(&vrdpEnabled); 5060 ComAssertComRCRetRC(rc); 5061 5062 if (aRestart) 5063 { 5064 /* VRDP server may call this Console object back from other threads (VRDP INPUT or OUTPUT). */ 5065 alock.release(); 5066 5067 if (vrdpEnabled) 5049 /* don't trigger VRDE server changes if the VM isn't running */ 5050 SafeVMPtrQuiet ptrVM(this); 5051 if (ptrVM.isOk()) 5052 { 5053 if ( mVRDEServer 5054 && ( mMachineState == MachineState_Running 5055 || mMachineState == MachineState_Teleporting 5056 || mMachineState == MachineState_LiveSnapshotting 5057 || mMachineState == MachineState_Paused 5058 ) 5059 ) 5060 { 5061 BOOL vrdpEnabled = FALSE; 5062 5063 rc = mVRDEServer->COMGETTER(Enabled)(&vrdpEnabled); 5064 ComAssertComRCRetRC(rc); 5065 5066 if (aRestart) 5068 5067 { 5069 // If there was no VRDP server started the 'stop' will do nothing. 5070 // However if a server was started and this notification was called, 5071 // we have to restart the server. 5072 mConsoleVRDPServer->Stop(); 5073 5074 if (RT_FAILURE(mConsoleVRDPServer->Launch())) 5075 rc = E_FAIL; 5068 /* VRDP server may call this Console object back from other threads (VRDP INPUT or OUTPUT). */ 5069 alock.release(); 5070 5071 if (vrdpEnabled) 5072 { 5073 // If there was no VRDP server started the 'stop' will do nothing. 5074 // However if a server was started and this notification was called, 5075 // we have to restart the server. 5076 mConsoleVRDPServer->Stop(); 5077 5078 if (RT_FAILURE(mConsoleVRDPServer->Launch())) 5079 rc = E_FAIL; 5080 else 5081 mConsoleVRDPServer->EnableConnections(); 5082 } 5076 5083 else 5077 mConsoleVRDPServer->EnableConnections(); 5084 mConsoleVRDPServer->Stop(); 5085 5086 alock.acquire(); 5087 } 5088 } 5089 else 5090 rc = setInvalidMachineStateError(); 5091 ptrVM.release(); 5092 } 5093 5094 /* notify console callbacks on success */ 5095 if (SUCCEEDED(rc)) 5096 { 5097 alock.release(); 5098 fireVRDEServerChangedEvent(mEventSource); 5099 } 5100 5101 return rc; 5102 } 5103 5104 void Console::onVRDEServerInfoChange() 5105 { 5106 AutoCaller autoCaller(this); 5107 AssertComRCReturnVoid(autoCaller.rc()); 5108 5109 fireVRDEServerInfoChangedEvent(mEventSource); 5110 } 5111 5112 HRESULT Console::onVideoCaptureChange() 5113 { 5114 AutoCaller autoCaller(this); 5115 AssertComRCReturnRC(autoCaller.rc()); 5116 5117 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5118 5119 HRESULT rc = S_OK; 5120 5121 /* don't trigger video capture changes if the VM isn't running */ 5122 SafeVMPtrQuiet ptrVM(this); 5123 if (ptrVM.isOk()) 5124 { 5125 BOOL fEnabled; 5126 rc = mMachine->COMGETTER(VideoCaptureEnabled)(&fEnabled); 5127 SafeArray<BOOL> screens; 5128 if (SUCCEEDED(rc)) 5129 rc = mMachine->COMGETTER(VideoCaptureScreens)(ComSafeArrayAsOutParam(screens)); 5130 if (mDisplay) 5131 { 5132 int vrc = VINF_SUCCESS; 5133 if (SUCCEEDED(rc)) 5134 vrc = mDisplay->VideoCaptureEnableScreens(ComSafeArrayAsInParam(screens)); 5135 if (RT_SUCCESS(vrc)) 5136 { 5137 if (fEnabled) 5138 { 5139 vrc = mDisplay->VideoCaptureStart(); 5140 if (RT_FAILURE(vrc)) 5141 rc = E_FAIL; 5142 } 5143 else 5144 mDisplay->VideoCaptureStop(); 5078 5145 } 5079 5146 else 5080 { 5081 mConsoleVRDPServer->Stop(); 5082 } 5083 5084 alock.acquire(); 5085 } 5086 } 5087 else 5088 rc = setInvalidMachineStateError(); 5147 rc = E_FAIL; 5148 } 5149 ptrVM.release(); 5150 } 5089 5151 5090 5152 /* notify console callbacks on success */ … … 5092 5154 { 5093 5155 alock.release(); 5094 fireVRDEServerChangedEvent(mEventSource); 5095 } 5096 5097 return rc; 5098 } 5099 5100 void Console::onVRDEServerInfoChange() 5101 { 5102 AutoCaller autoCaller(this); 5103 AssertComRCReturnVoid(autoCaller.rc()); 5104 5105 fireVRDEServerInfoChangedEvent(mEventSource); 5106 } 5107 5108 HRESULT Console::onVideoCaptureChange() 5109 { 5110 AutoCaller autoCaller(this); 5111 AssertComRCReturnRC(autoCaller.rc()); 5112 5113 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5114 5115 BOOL fEnabled; 5116 HRESULT rc = mMachine->COMGETTER(VideoCaptureEnabled)(&fEnabled); 5117 SafeArray<BOOL> screens; 5118 if (SUCCEEDED(rc)) 5119 rc = mMachine->COMGETTER(VideoCaptureScreens)(ComSafeArrayAsOutParam(screens)); 5120 if (mDisplay) 5121 { 5122 int vrc = VINF_SUCCESS; 5123 if (SUCCEEDED(rc)) 5124 vrc = mDisplay->VideoCaptureEnableScreens(ComSafeArrayAsInParam(screens)); 5125 if (RT_SUCCESS(vrc)) 5126 { 5127 if (fEnabled) 5128 vrc = mDisplay->VideoCaptureStart(); 5129 else 5130 mDisplay->VideoCaptureStop(); 5131 if (RT_SUCCESS(vrc)) 5132 fireVideoCaptureChangedEvent(mEventSource); 5133 else 5134 rc = E_FAIL; 5135 } 5156 fireVideoCaptureChangedEvent(mEventSource); 5136 5157 } 5137 5158 … … 5363 5384 HRESULT rc = S_OK; 5364 5385 5365 /* don't trigger the CPU priority changeif the VM isn't running */5386 /* don't trigger bandwidth group changes if the VM isn't running */ 5366 5387 SafeVMPtrQuiet ptrVM(this); 5367 5388 if (ptrVM.isOk()) … … 5426 5447 HRESULT rc = S_OK; 5427 5448 5428 /* don't trigger medium change if the VM isn't running */5449 /* don't trigger medium changes if the VM isn't running */ 5429 5450 SafeVMPtrQuiet ptrVM(this); 5430 5451 if (ptrVM.isOk()) -
trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp
r46609 r46610 289 289 } 290 290 291 #if 0292 291 return rc; 293 #else294 return S_OK;295 #endif296 292 } 297 293
Note:
See TracChangeset
for help on using the changeset viewer.