Changeset 23643 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 9, 2009 12:23:32 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r23633 r23643 3585 3585 3586 3586 /** 3587 * @note Locks this object for reading. 3588 */ 3589 void Console::onRemoteDisplayInfoChange() 3590 { 3591 AutoCaller autoCaller(this); 3592 AssertComRCReturnVoid(autoCaller.rc()); 3593 3594 AutoReadLock alock(this); 3595 3596 CallbackList::iterator it = mCallbacks.begin(); 3597 while (it != mCallbacks.end()) 3598 (*it++)->OnRemoteDisplayInfoChange(); 3599 } 3600 3601 3602 3603 /** 3587 3604 * Called by IInternalSessionControl::OnUSBControllerChange(). 3588 3605 * … … 6581 6598 { 6582 6599 Utf8Str errMsg; 6583 ULONG port = 0; 6584 console->mVRDPServer->COMGETTER(Port)(&port); 6585 errMsg = Utf8StrFmt(tr("VRDP server port %d is already in use"), 6586 port); 6600 Bstr bstr; 6601 console->mVRDPServer->COMGETTER(Ports)(bstr.asOutParam()); 6602 Utf8Str ports = bstr; 6603 errMsg = Utf8StrFmt(tr("VRDP server can't bind to a port: %s"), 6604 ports.raw()); 6587 6605 LogRel(("Warning: failed to launch VRDP server (%Rrc): '%s'\n", 6588 6606 vrc, errMsg.raw())); -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r23223 r23643 143 143 144 144 STDMETHOD(OnVRDPServerChange)() 145 { 146 return S_OK; 147 } 148 149 STDMETHOD(OnRemoteDisplayInfoChange)() 145 150 { 146 151 return S_OK; … … 622 627 case VRDP_QP_NETWORK_PORT: 623 628 { 629 /* This is obsolete, the VRDP server uses VRDP_QP_NETWORK_PORT_RANGE instead. */ 624 630 ULONG port = 0; 625 server->mConsole->getVRDPServer ()->COMGETTER(Port) (&port);626 if (port == 0)627 {628 port = VRDP_DEFAULT_PORT;629 }630 631 631 632 if (cbBuffer >= sizeof (uint32_t)) … … 707 708 com::Bstr bstr; 708 709 HRESULT hrc = server->mConsole->machine ()->GetExtraData(Bstr("VBoxInternal2/VRDPPortRange"), bstr.asOutParam()); 710 if (hrc != S_OK || bstr == "") 711 { 712 hrc = server->mConsole->getVRDPServer ()->COMGETTER(Ports) (bstr.asOutParam()); 713 } 709 714 if (hrc != S_OK) 710 715 { 711 716 bstr = ""; 717 } 718 719 if (bstr == "0") 720 { 721 bstr = "3389"; 712 722 } 713 723 … … 758 768 759 769 ULONG port = *(uint32_t *)pvBuffer; 770 771 server->mVRDPBindPort = port; 760 772 761 773 com::Bstr bstr = Utf8StrFmt("%d", port); … … 769 781 *pcbOut = sizeof (uint32_t); 770 782 } 783 784 server->mConsole->onRemoteDisplayInfoChange (); 771 785 } break; 772 786 … … 1130 1144 1131 1145 mConsole->machine ()->SetExtraData(Bstr("VBoxInternal2/VRDPPortRange"), Bstr("")); 1146 mVRDPBindPort = -1; 1132 1147 #endif /* VBOX_WITH_VRDP */ 1133 1148 … … 2019 2034 { 2020 2035 #ifdef VBOX_WITH_VRDP 2021 if (mpEntryPoints && mhServer) 2036 if (index == VRDP_QI_PORT) 2037 { 2038 uint32_t cbOut = sizeof (int32_t); 2039 2040 if (cbBuffer >= cbOut) 2041 { 2042 *pcbOut = cbOut; 2043 *(int32_t *)pvBuffer = (int32_t)mVRDPBindPort; 2044 } 2045 } 2046 else if (mpEntryPoints && mhServer) 2022 2047 { 2023 2048 mpEntryPoints->VRDPQueryInfo (mhServer, index, pvBuffer, cbBuffer, pcbOut); … … 2242 2267 2243 2268 IMPL_GETTER_BOOL (BOOL, Active, VRDP_QI_ACTIVE); 2269 IMPL_GETTER_SCALAR (LONG, Port, VRDP_QI_PORT); 2244 2270 IMPL_GETTER_SCALAR (ULONG, NumberOfClients, VRDP_QI_NUMBER_OF_CLIENTS); 2245 2271 IMPL_GETTER_SCALAR (LONG64, BeginTime, VRDP_QI_BEGIN_TIME); -
trunk/src/VBox/Main/VirtualBoxCallbackImpl.cpp
r23223 r23643 230 230 return mConsoleCallback->OnParallelPortChange(aParallelPort); 231 231 } 232 233 STDMETHODIMP CallbackWrapper::OnRemoteDisplayInfoChange() 234 { 235 if (mConsoleCallback.isNull()) 236 return S_OK; 237 238 return mConsoleCallback->OnRemoteDisplayInfoChange(); 239 } 240 232 241 STDMETHODIMP CallbackWrapper::OnVRDPServerChange() 233 242 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r23601 r23643 5441 5441 <interface 5442 5442 name="IConsoleCallback" extends="$unknown" 5443 uuid="d b67f6e5-799d-474c-8452-b10d7736a412"5443 uuid="d6239535-bda2-4ef7-83f4-f4722e4a3b2c" 5444 5444 wsmap="suppress" 5445 5445 > … … 5625 5625 Interested callees should use IVRDPServer methods and attributes to 5626 5626 find out what has changed. 5627 </desc> 5628 </method> 5629 5630 <method name="onRemoteDisplayInfoChange"> 5631 <desc> 5632 Notification when the status of the VRDP server changes. Interested callees 5633 should use <link to="IConsole::RemoteDisplayInfo">IRemoteDisplayInfo</link> 5634 attributes to find out what is the current status. 5627 5635 </desc> 5628 5636 </method> … … 5842 5850 <interface 5843 5851 name="IRemoteDisplayInfo" extends="$unknown" 5844 uuid=" 550104cd-2dfd-4a6c-857d-f6f8e088e62c"5852 uuid="b3741084-806f-4c3b-8c42-ebad1a81e45a" 5845 5853 wsmap="struct" 5846 5854 > … … 5853 5861 <desc> 5854 5862 Whether the remote display connection is active. 5863 </desc> 5864 </attribute> 5865 5866 <attribute name="port" type="long" readonly="yes"> 5867 <desc> 5868 VRDP server port number. If this property is equal to <tt>0</tt>, then 5869 the VRDP server failed to start, usually because there are no free TCP 5870 ports to bind to. If this property is equal to <tt>-1</tt>, then the VRDP 5871 server has not yet been started. 5855 5872 </desc> 5856 5873 </attribute> … … 11789 11806 <interface 11790 11807 name="IVRDPServer" extends="$unknown" 11791 uuid=" f4584ae7-6bce-474b-83d6-17d235e6aa89"11808 uuid="72e671bc-1712-4052-ad6b-e45e76d9d3e4" 11792 11809 wsmap="managed" 11793 11810 > … … 11796 11813 </attribute> 11797 11814 11798 <attribute name="port " type="unsigned long">11799 <desc> 11800 VRDP server port number .11815 <attribute name="ports" type="wstring"> 11816 <desc> 11817 VRDP server port numbers. 11801 11818 <note> 11802 Setting the value of this property to <tt>0</tt> will reset the port 11803 number to the default value which is 11804 currently <tt>3389</tt>. Reading this property will always return a 11805 real port number, even after it has been set to <tt>0</tt> (in which 11806 case the default port is returned). 11819 This is a string of comma separated TCP port numbers or port number ranges. 11820 The server will try to bind to one of ports from the list. Example 11821 <tt>3000,3010-3012,3015</tt> 11807 11822 </note> 11808 11823 </desc> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r23633 r23643 214 214 void onRuntimeError (BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage); 215 215 HRESULT onShowWindow (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId); 216 void onRemoteDisplayInfoChange(); 216 217 217 218 static const PDMDRVREG DrvStatusReg; -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r23223 r23643 185 185 186 186 VRDPInputSynch m_InputSynch; 187 188 int32_t mVRDPBindPort; 187 189 #endif /* VBOX_WITH_VRDP */ 188 190 … … 264 266 #define DECL_GETTER(_aType, _aName) STDMETHOD(COMGETTER(_aName)) (_aType *a##_aName) 265 267 DECL_GETTER (BOOL, Active); 268 DECL_GETTER (LONG, Port); 266 269 DECL_GETTER (ULONG, NumberOfClients); 267 270 DECL_GETTER (LONG64, BeginTime); -
trunk/src/VBox/Main/include/DisplayImpl.h
r23223 r23643 198 198 } 199 199 200 STDMETHOD(OnRemoteDisplayInfoChange)() 201 { 202 return S_OK; 203 } 204 200 205 STDMETHOD(OnUSBControllerChange)() 201 206 { -
trunk/src/VBox/Main/include/VRDPServerImpl.h
r23223 r23643 50 50 return this == &that || 51 51 (mEnabled == that.mEnabled && 52 mVRDPPort == that.mVRDPPort&&52 mVRDPPorts == that.mVRDPPorts && 53 53 mVRDPAddress == that.mVRDPAddress && 54 54 mAuthType == that.mAuthType && … … 59 59 60 60 BOOL mEnabled; 61 ULONG mVRDPPort;61 Bstr mVRDPPorts; 62 62 Bstr mVRDPAddress; 63 63 VRDPAuthType_T mAuthType; … … 93 93 STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled); 94 94 STDMETHOD(COMSETTER(Enabled)) (BOOL aEnable); 95 STDMETHOD(COMGETTER(Port )) (ULONG *aPort);96 STDMETHOD(COMSETTER(Port )) (ULONG aPort);95 STDMETHOD(COMGETTER(Ports)) (BSTR *aPorts); 96 STDMETHOD(COMSETTER(Ports)) (IN_BSTR aPorts); 97 97 STDMETHOD(COMGETTER(NetAddress)) (BSTR *aAddress); 98 98 STDMETHOD(COMSETTER(NetAddress)) (IN_BSTR aAddress); -
trunk/src/VBox/Main/include/VirtualBoxCallbackImpl.h
r23223 r23643 87 87 STDMETHOD(OnParallelPortChange) (IParallelPort *aParallelPort); 88 88 STDMETHOD(OnVRDPServerChange)(); 89 STDMETHOD(OnRemoteDisplayInfoChange)(); 89 90 STDMETHOD(OnUSBControllerChange)(); 90 91 STDMETHOD(OnUSBDeviceStateChange) (IUSBDevice *aDevice, BOOL aAttached, -
trunk/src/VBox/Main/xml/Settings.cpp
r23600 r23643 1545 1545 { 1546 1546 pelmHwChild->getAttributeValue("enabled", hw.vrdpSettings.fEnabled); 1547 pelmHwChild->getAttributeValue("port", hw.vrdpSettings. ulPort);1547 pelmHwChild->getAttributeValue("port", hw.vrdpSettings.strPort); 1548 1548 pelmHwChild->getAttributeValue("netAddress", hw.vrdpSettings.strNetAddress); 1549 1549 … … 2357 2357 xml::ElementNode *pelmVRDP = pelmHardware->createChild("RemoteDisplay"); 2358 2358 pelmVRDP->setAttribute("enabled", hw.vrdpSettings.fEnabled); 2359 pelmVRDP->setAttribute("port", hw.vrdpSettings. ulPort);2359 pelmVRDP->setAttribute("port", hw.vrdpSettings.strPort); 2360 2360 if (hw.vrdpSettings.strNetAddress.length()) 2361 2361 pelmVRDP->setAttribute("netAddress", hw.vrdpSettings.strNetAddress); -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r23465 r23643 506 506 <xsd:complexType name="TRemoteDisplay"> 507 507 <xsd:attribute name="enabled" type="xsd:boolean" use="required"/> 508 <xsd:attribute name="port" type="xsd: unsignedInt" default="0"/>508 <xsd:attribute name="port" type="xsd:token" default="0"/> 509 509 <xsd:attribute name="netAddress" type="xsd:token" default=""/> 510 510 <xsd:attribute name="authType" type="TVRDPAuthType" default="Null"/>
Note:
See TracChangeset
for help on using the changeset viewer.