Index: /trunk/include/VBox/settings.h
===================================================================
--- /trunk/include/VBox/settings.h	(revision 23642)
+++ /trunk/include/VBox/settings.h	(revision 23643)
@@ -234,5 +234,4 @@
     VRDPSettings()
         : fEnabled(true),
-          ulPort(0),
           authType(VRDPAuthType_Null),
           ulAuthTimeout(5000),
@@ -242,5 +241,5 @@
 
     bool            fEnabled;
-    uint32_t        ulPort;
+    com::Utf8Str    strPort;
     com::Utf8Str    strNetAddress;
     VRDPAuthType_T  authType;
Index: /trunk/include/VBox/vrdpapi.h
===================================================================
--- /trunk/include/VBox/vrdpapi.h	(revision 23642)
+++ /trunk/include/VBox/vrdpapi.h	(revision 23643)
@@ -571,4 +571,11 @@
 #define VRDP_QI_ENCRYPTION_STYLE       (13)
 
+/** TCP port where the server listens.
+ *  Values: 0 - VRDP server failed to start.
+ *          -1 - .
+ * int32_t.
+ */
+#define VRDP_QI_PORT                   (14)
+
 
 /** Hints what has been intercepted by the application. */
Index: /trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 23643)
@@ -199,4 +199,25 @@
     }
 
+    STDMETHOD(OnRemoteDisplayInfoChange)()
+    {
+#ifdef VBOX_WITH_VRDP
+        if (gConsole)
+        {
+            ComPtr<IRemoteDisplayInfo> info;
+            gConsole->COMGETTER(RemoteDisplayInfo)(info.asOutParam());
+            if (info)
+            {
+                LONG port;
+                info->COMGETTER(Port)(&port);
+                if (port != 0)
+                    RTPrintf("Listening on port %d\n", port);
+                else
+                    RTPrintf("VRDP server failed to start\n");
+            }
+        }
+#endif
+        return S_OK;
+    }
+
     STDMETHOD(OnUSBControllerChange)()
     {
@@ -398,5 +419,5 @@
 {
 #ifdef VBOX_WITH_VRDP
-    ULONG vrdpPort = ~0U;
+    const char *vrdpPort = NULL;
     const char *vrdpAddress = NULL;
     const char *vrdpEnabled = NULL;
@@ -505,5 +526,5 @@
 #ifdef VBOX_WITH_VRDP
             case 'p':
-                vrdpPort = ValueUnion.u32;
+                vrdpPort = ValueUnion.psz;
                 break;
             case 'a':
@@ -850,8 +871,9 @@
 
             /* set VRDP port if requested by the user */
-            if (vrdpPort != ~0U)
-                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Port)(vrdpPort));
-            else
-                CHECK_ERROR_BREAK(vrdpServer, COMGETTER(Port)(&vrdpPort));
+            if (vrdpPort != NULL)
+            {
+                Bstr bstr = vrdpPort;
+                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Ports)(bstr));
+            }
             /* set VRDP address if requested by the user */
             if (vrdpAddress != NULL)
@@ -875,8 +897,4 @@
 #endif
         Log (("VBoxHeadless: Powering up the machine...\n"));
-#ifdef VBOX_WITH_VRDP
-        if (fVRDPEnable)
-            RTPrintf("Listening on port %d\n", !vrdpPort ? VRDP_DEFAULT_PORT : vrdpPort);
-#endif
 
         ComPtr <IProgress> progress;
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 23643)
@@ -1018,30 +1018,12 @@
             if (vrdpServer)
             {
-                uint16_t vrdpport;
+                Bstr vrdpports;
 
                 if (!strcmp(a->argv[2], "default"))
-                {
-                    vrdpport = 0;
-                }
+                    vrdpports = "0";
                 else
-                {
-                    int vrc = RTStrToUInt16Full(a->argv[2], 0, &vrdpport);
-
-                    if (vrc != VINF_SUCCESS)
-                    {
-                        vrdpport = UINT16_MAX;
-                    }
-                }
-
-                if (vrdpport != UINT16_MAX)
-                {
-                    CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Port)(vrdpport));
-                }
-                else
-                {
-                    errorArgument("Invalid vrdp server port '%s'", Utf8Str(a->argv[2]).raw());
-                    rc = E_FAIL;
-                    break;
-                }
+                    vrdpports = a->argv [2];
+
+                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Ports)(vrdpports));
             }
         }
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 23643)
@@ -989,6 +989,7 @@
         if (fEnabled)
         {
-            ULONG port;
-            vrdpServer->COMGETTER(Port)(&port);
+            LONG vrdpPort = -1;
+            Bstr ports;
+            vrdpServer->COMGETTER(Ports)(ports.asOutParam());
             Bstr address;
             vrdpServer->COMGETTER(NetAddress)(address.asOutParam());
@@ -1015,8 +1016,25 @@
                     break;
             }
+            if (console)
+            {
+                ComPtr<IRemoteDisplayInfo> remoteDisplayInfo;
+                CHECK_ERROR_RET(console, COMGETTER(RemoteDisplayInfo)(remoteDisplayInfo.asOutParam()), rc);
+                rc = remoteDisplayInfo->COMGETTER(Port)(&vrdpPort);
+                if (rc == E_ACCESSDENIED)
+                {
+                    vrdpPort = -1; /* VM not powered up */
+                }
+                if (FAILED(rc))
+                {
+                    com::ErrorInfo info (remoteDisplayInfo);
+                    GluePrintErrorInfo(info);
+                    return rc;
+                }
+            }
             if (details == VMINFO_MACHINEREADABLE)
             {
                 RTPrintf("vrdp=\"on\"\n");
-                RTPrintf("vrdpport=%d\n", port);
+                RTPrintf("vrdpport=%d\n", vrdpPort);
+                RTPrintf("vrdpports=\"%lS\"\n", ports.raw());
                 RTPrintf("vrdpaddress=\"%lS\"\n", address.raw());
                 RTPrintf("vrdpauthtype=\"%s\"\n", strAuthType);
@@ -1028,5 +1046,7 @@
                 if (address.isEmpty())
                     address = "0.0.0.0";
-                RTPrintf("VRDP:            enabled (Address %lS, Port %d, MultiConn: %s, ReuseSingleConn: %s, Authentication type: %s)\n", address.raw(), port, fMultiCon ? "on" : "off", fReuseCon ? "on" : "off", strAuthType);
+                RTPrintf("VRDP:            enabled (Address %lS, Ports %lS, MultiConn: %s, ReuseSingleConn: %s, Authentication type: %s)\n", address.raw(), ports.raw(), fMultiCon ? "on" : "off", fReuseCon ? "on" : "off", strAuthType);
+                if (console && vrdpPort != -1 && vrdpPort != 0)
+                   RTPrintf("VRDP port:       %d\n", vrdpPort);
             }
         }
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	(revision 23643)
@@ -93,5 +93,5 @@
 #ifdef VBOX_WITH_VRDP
     char *vrdp = NULL;
-    uint16_t vrdpport = UINT16_MAX;
+    char *vrdpport = NULL;
     char *vrdpaddress = NULL;
     char *vrdpauthtype = NULL;
@@ -609,7 +609,7 @@
             i++;
             if (!strcmp(a->argv[i], "default"))
-                vrdpport = 0;
-            else
-                vrdpport = RTStrToUInt16(a->argv[i]);
+                vrdpport = "0";
+            else
+                vrdpport = a->argv[i];
         }
         else if (   !strcmp(a->argv[i], "--vrdpaddress")
@@ -1812,5 +1812,5 @@
 
 #ifdef VBOX_WITH_VRDP
-        if (vrdp || (vrdpport != UINT16_MAX) || vrdpaddress || vrdpauthtype || vrdpmulticon || vrdpreusecon)
+        if (vrdp || vrdpport || vrdpaddress || vrdpauthtype || vrdpmulticon || vrdpreusecon)
         {
             ComPtr<IVRDPServer> vrdpServer;
@@ -1836,7 +1836,7 @@
                     }
                 }
-                if (vrdpport != UINT16_MAX)
-                {
-                    CHECK_ERROR(vrdpServer, COMSETTER(Port)(vrdpport));
+                if (vrdpport)
+                {
+                    CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr(vrdpport)));
                 }
                 if (vrdpaddress)
Index: /trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp	(revision 23643)
@@ -509,4 +509,9 @@
 
     STDMETHOD(OnVRDPServerChange)()
+    {
+        return S_OK;
+    }
+
+    STDMETHOD(OnRemoteDisplayInfoChange)()
     {
         return S_OK;
@@ -865,5 +870,5 @@
     char *fdaFile   = NULL;
 #ifdef VBOX_WITH_VRDP
-    int portVRDP = ~0;
+    char *portVRDP = NULL;
 #endif
     bool fDiscardState = false;
@@ -1273,17 +1278,12 @@
         {
             // start with the standard VRDP port
-            portVRDP = 0;
+            portVRDP = "0";
 
             // is there another argument
             if (argc > (curArg + 1))
             {
-                // check if the next argument is a number
-                int port = atoi(argv[curArg + 1]);
-                if (port > 0)
-                {
-                    curArg++;
-                    portVRDP = port;
-                    LogFlow(("Using non standard VRDP port %d\n", portVRDP));
-                }
+                curArg++;
+                portVRDP = argv[curArg];
+                LogFlow(("Using non standard VRDP port %s\n", portVRDP));
             }
         }
@@ -1838,5 +1838,5 @@
 
 #ifdef VBOX_WITH_VRDP
-    if (portVRDP != ~0)
+    if (portVRDP)
     {
         rc = gMachine->COMGETTER(VRDPServer)(gVrdpServer.asOutParam());
@@ -1847,5 +1847,6 @@
             if (portVRDP > 0)
             {
-                rc = gVrdpServer->COMSETTER(Port)(portVRDP);
+                Bstr bstr = portVRDP;
+                rc = gVrdpServer->COMSETTER(Ports)(bstr);
                 if (rc != S_OK)
                 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp	(revision 23643)
@@ -564,4 +564,9 @@
 
     STDMETHOD(OnVRDPServerChange)()
+    {
+        return S_OK;
+    }
+
+    STDMETHOD(OnRemoteDisplayInfoChange)()
     {
         return S_OK;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp	(revision 23643)
@@ -1696,5 +1696,5 @@
                 item += QString (sSectionItemTpl2)
                         .arg (tr ("Remote Display Server Port", "details report (VRDP Server)"))
-                        .arg (srv.GetPort());
+                        .arg (srv.GetPorts());
             else
                 item += QString (sSectionItemTpl2)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp	(revision 23643)
@@ -463,8 +463,12 @@
         else
             osType = vboxGlobal().vmGuestOSTypeDescription (osType);
+        int vrdpPort = console.GetRemoteDisplayInfo().GetPort();
+        QString vrdpInfo = (vrdpPort == 0 || vrdpPort == -1)?
+            tr ("Not Available", "details report (VRDP server port)") :
+            QString ("%1").arg (vrdpPort);
 
         /* Searching for longest string */
         QStringList valuesList;
-        valuesList << resolution << virtualization << nested << addVerisonStr << osType;
+        valuesList << resolution << virtualization << nested << addVerisonStr << osType << vrdpInfo;
         int maxLength = 0;
         foreach (const QString &value, valuesList)
@@ -478,4 +482,5 @@
         result += formatValue (tr ("Guest Additions"), addVerisonStr, maxLength);
         result += formatValue (tr ("Guest OS Type"), osType, maxLength);
+        result += formatValue (tr ("Remote Display Server Port"), vrdpInfo, maxLength);
         result += paragraph;
     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsDisplay.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsDisplay.cpp	(revision 23642)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsDisplay.cpp	(revision 23643)
@@ -58,5 +58,5 @@
     /* Setup validators */
     mLeMemory->setValidator (new QIntValidator (MinVRAM, MaxVRAM, this));
-    mLeVRDPPort->setValidator (new QIntValidator (0, 0xFFFF, this));
+    mLeVRDPPort->setValidator (new QRegExpValidator (QRegExp ("(([0-9]{1,5}(\\-[0-9]{1,5}){0,1}),)*([0-9]{1,5}(\\-[0-9]{1,5}){0,1})"), this));
     mLeVRDPTimeout->setValidator (new QIntValidator (this));
 
@@ -123,5 +123,5 @@
     {
         mCbVRDP->setChecked (vrdp.GetEnabled());
-        mLeVRDPPort->setText (QString::number (vrdp.GetPort()));
+        mLeVRDPPort->setText (vrdp.GetPorts());
         mCbVRDPMethod->setCurrentIndex (mCbVRDPMethod->
                                         findText (vboxGlobal().toString (vrdp.GetAuthType())));
@@ -153,5 +153,5 @@
     {
         vrdp.SetEnabled (mCbVRDP->isChecked());
-        vrdp.SetPort (mLeVRDPPort->text().toULong());
+        vrdp.SetPorts (mLeVRDPPort->text());
         vrdp.SetAuthType (vboxGlobal().toVRDPAuthType (mCbVRDPMethod->currentText()));
         vrdp.SetAuthTimeout (mLeVRDPTimeout->text().toULong());
Index: /trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 23642)
+++ /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 23643)
@@ -3585,4 +3585,21 @@
 
 /**
+ * @note Locks this object for reading.
+ */
+void Console::onRemoteDisplayInfoChange()
+{
+    AutoCaller autoCaller(this);
+    AssertComRCReturnVoid(autoCaller.rc());
+
+    AutoReadLock alock(this);
+
+    CallbackList::iterator it = mCallbacks.begin();
+    while (it != mCallbacks.end())
+        (*it++)->OnRemoteDisplayInfoChange();
+}
+
+
+
+/**
  * Called by IInternalSessionControl::OnUSBControllerChange().
  *
@@ -6581,8 +6598,9 @@
         {
             Utf8Str errMsg;
-            ULONG port = 0;
-            console->mVRDPServer->COMGETTER(Port)(&port);
-            errMsg = Utf8StrFmt(tr("VRDP server port %d is already in use"),
-                                port);
+            Bstr bstr;
+            console->mVRDPServer->COMGETTER(Ports)(bstr.asOutParam());
+            Utf8Str ports = bstr;
+            errMsg = Utf8StrFmt(tr("VRDP server can't bind to a port: %s"),
+                                ports.raw());
             LogRel(("Warning: failed to launch VRDP server (%Rrc): '%s'\n",
                     vrc, errMsg.raw()));
Index: /trunk/src/VBox/Main/ConsoleVRDPServer.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleVRDPServer.cpp	(revision 23642)
+++ /trunk/src/VBox/Main/ConsoleVRDPServer.cpp	(revision 23643)
@@ -143,4 +143,9 @@
 
     STDMETHOD(OnVRDPServerChange)()
+    {
+        return S_OK;
+    }
+
+    STDMETHOD(OnRemoteDisplayInfoChange)()
     {
         return S_OK;
@@ -622,10 +627,6 @@
         case VRDP_QP_NETWORK_PORT:
         {
+            /* This is obsolete, the VRDP server uses VRDP_QP_NETWORK_PORT_RANGE instead. */
             ULONG port = 0;
-            server->mConsole->getVRDPServer ()->COMGETTER(Port) (&port);
-            if (port == 0)
-            {
-                port = VRDP_DEFAULT_PORT;
-            }
 
             if (cbBuffer >= sizeof (uint32_t))
@@ -707,7 +708,16 @@
             com::Bstr bstr;
             HRESULT hrc = server->mConsole->machine ()->GetExtraData(Bstr("VBoxInternal2/VRDPPortRange"), bstr.asOutParam());
+            if (hrc != S_OK || bstr == "")
+            {
+                hrc = server->mConsole->getVRDPServer ()->COMGETTER(Ports) (bstr.asOutParam());
+            }
             if (hrc != S_OK)
             {
                 bstr = "";
+            }
+
+            if (bstr == "0")
+            {
+                bstr = "3389";
             }
 
@@ -758,4 +768,6 @@
 
             ULONG port = *(uint32_t *)pvBuffer;
+            
+            server->mVRDPBindPort = port;
 
             com::Bstr bstr = Utf8StrFmt("%d", port);
@@ -769,4 +781,6 @@
                 *pcbOut = sizeof (uint32_t);
             }
+
+            server->mConsole->onRemoteDisplayInfoChange ();
         } break;
 
@@ -1130,4 +1144,5 @@
 
     mConsole->machine ()->SetExtraData(Bstr("VBoxInternal2/VRDPPortRange"), Bstr(""));
+    mVRDPBindPort = -1;
 #endif /* VBOX_WITH_VRDP */
 
@@ -2019,5 +2034,15 @@
 {
 #ifdef VBOX_WITH_VRDP
-    if (mpEntryPoints && mhServer)
+    if (index == VRDP_QI_PORT)
+    {
+        uint32_t cbOut = sizeof (int32_t);
+
+        if (cbBuffer >= cbOut)
+        {
+            *pcbOut = cbOut;
+            *(int32_t *)pvBuffer = (int32_t)mVRDPBindPort;
+        }
+    }
+    else if (mpEntryPoints && mhServer)
     {
         mpEntryPoints->VRDPQueryInfo (mhServer, index, pvBuffer, cbBuffer, pcbOut);
@@ -2242,4 +2267,5 @@
 
 IMPL_GETTER_BOOL   (BOOL,    Active,             VRDP_QI_ACTIVE);
+IMPL_GETTER_SCALAR (LONG,    Port,               VRDP_QI_PORT);
 IMPL_GETTER_SCALAR (ULONG,   NumberOfClients,    VRDP_QI_NUMBER_OF_CLIENTS);
 IMPL_GETTER_SCALAR (LONG64,  BeginTime,          VRDP_QI_BEGIN_TIME);
Index: /trunk/src/VBox/Main/VirtualBoxCallbackImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxCallbackImpl.cpp	(revision 23642)
+++ /trunk/src/VBox/Main/VirtualBoxCallbackImpl.cpp	(revision 23643)
@@ -230,4 +230,13 @@
     return mConsoleCallback->OnParallelPortChange(aParallelPort);
 }
+
+STDMETHODIMP CallbackWrapper::OnRemoteDisplayInfoChange()
+{
+    if (mConsoleCallback.isNull())
+        return S_OK;
+
+    return mConsoleCallback->OnRemoteDisplayInfoChange();
+}
+
 STDMETHODIMP CallbackWrapper::OnVRDPServerChange()
 {
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 23642)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 23643)
@@ -5441,5 +5441,5 @@
   <interface
      name="IConsoleCallback" extends="$unknown"
-     uuid="db67f6e5-799d-474c-8452-b10d7736a412"
+     uuid="d6239535-bda2-4ef7-83f4-f4722e4a3b2c"
      wsmap="suppress"
      >
@@ -5625,4 +5625,12 @@
         Interested callees should use IVRDPServer methods and attributes to
         find out what has changed.
+      </desc>
+    </method>
+
+    <method name="onRemoteDisplayInfoChange">
+      <desc>
+        Notification when the status of the VRDP server changes. Interested callees
+        should use <link to="IConsole::RemoteDisplayInfo">IRemoteDisplayInfo</link>
+        attributes to find out what is the current status.
       </desc>
     </method>
@@ -5842,5 +5850,5 @@
   <interface
      name="IRemoteDisplayInfo" extends="$unknown"
-     uuid="550104cd-2dfd-4a6c-857d-f6f8e088e62c"
+     uuid="b3741084-806f-4c3b-8c42-ebad1a81e45a"
      wsmap="struct"
      >
@@ -5853,4 +5861,13 @@
       <desc>
         Whether the remote display connection is active.
+      </desc>
+    </attribute>
+
+    <attribute name="port" type="long" readonly="yes">
+      <desc>
+        VRDP server port number. If this property is equal to <tt>0</tt>, then
+        the VRDP server failed to start, usually because there are no free TCP
+        ports to bind to. If this property is equal to <tt>-1</tt>, then the VRDP
+        server has not yet been started.
       </desc>
     </attribute>
@@ -11789,5 +11806,5 @@
   <interface
      name="IVRDPServer" extends="$unknown"
-     uuid="f4584ae7-6bce-474b-83d6-17d235e6aa89"
+     uuid="72e671bc-1712-4052-ad6b-e45e76d9d3e4"
      wsmap="managed"
      >
@@ -11796,13 +11813,11 @@
     </attribute>
 
-    <attribute name="port" type="unsigned long">
-      <desc>
-        VRDP server port number.
+    <attribute name="ports" type="wstring">
+      <desc>
+        VRDP server port numbers.
         <note>
-          Setting the value of this property to <tt>0</tt> will reset the port
-          number to the default value which is
-          currently <tt>3389</tt>. Reading this property will always return a
-          real port number, even after it has been set to <tt>0</tt> (in which
-          case the default port is returned).
+          This is a string of comma separated TCP port numbers or port number ranges.
+          The server will try to bind to one of ports from the list. Example
+          <tt>3000,3010-3012,3015</tt>
         </note>
       </desc>
Index: /trunk/src/VBox/Main/include/ConsoleImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/ConsoleImpl.h	(revision 23642)
+++ /trunk/src/VBox/Main/include/ConsoleImpl.h	(revision 23643)
@@ -214,4 +214,5 @@
     void onRuntimeError (BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage);
     HRESULT onShowWindow (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId);
+    void onRemoteDisplayInfoChange();
 
     static const PDMDRVREG DrvStatusReg;
Index: /trunk/src/VBox/Main/include/ConsoleVRDPServer.h
===================================================================
--- /trunk/src/VBox/Main/include/ConsoleVRDPServer.h	(revision 23642)
+++ /trunk/src/VBox/Main/include/ConsoleVRDPServer.h	(revision 23643)
@@ -185,4 +185,6 @@
 
     VRDPInputSynch m_InputSynch;
+
+    int32_t mVRDPBindPort;
 #endif /* VBOX_WITH_VRDP */
 
@@ -264,4 +266,5 @@
     #define DECL_GETTER(_aType, _aName) STDMETHOD(COMGETTER(_aName)) (_aType *a##_aName)
         DECL_GETTER (BOOL,    Active);
+        DECL_GETTER (LONG,    Port);
         DECL_GETTER (ULONG,   NumberOfClients);
         DECL_GETTER (LONG64,  BeginTime);
Index: /trunk/src/VBox/Main/include/DisplayImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/DisplayImpl.h	(revision 23642)
+++ /trunk/src/VBox/Main/include/DisplayImpl.h	(revision 23643)
@@ -198,4 +198,9 @@
     }
 
+    STDMETHOD(OnRemoteDisplayInfoChange)()
+    {
+        return S_OK;
+    }
+
     STDMETHOD(OnUSBControllerChange)()
     {
Index: /trunk/src/VBox/Main/include/VRDPServerImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/VRDPServerImpl.h	(revision 23642)
+++ /trunk/src/VBox/Main/include/VRDPServerImpl.h	(revision 23643)
@@ -50,5 +50,5 @@
             return this == &that ||
                    (mEnabled == that.mEnabled &&
-                    mVRDPPort == that.mVRDPPort &&
+                    mVRDPPorts == that.mVRDPPorts &&
                     mVRDPAddress == that.mVRDPAddress &&
                     mAuthType == that.mAuthType &&
@@ -59,5 +59,5 @@
 
         BOOL mEnabled;
-        ULONG mVRDPPort;
+        Bstr mVRDPPorts;
         Bstr mVRDPAddress;
         VRDPAuthType_T mAuthType;
@@ -93,6 +93,6 @@
     STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
     STDMETHOD(COMSETTER(Enabled)) (BOOL aEnable);
-    STDMETHOD(COMGETTER(Port)) (ULONG *aPort);
-    STDMETHOD(COMSETTER(Port)) (ULONG aPort);
+    STDMETHOD(COMGETTER(Ports)) (BSTR *aPorts);
+    STDMETHOD(COMSETTER(Ports)) (IN_BSTR aPorts);
     STDMETHOD(COMGETTER(NetAddress)) (BSTR *aAddress);
     STDMETHOD(COMSETTER(NetAddress)) (IN_BSTR aAddress);
Index: /trunk/src/VBox/Main/include/VirtualBoxCallbackImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/VirtualBoxCallbackImpl.h	(revision 23642)
+++ /trunk/src/VBox/Main/include/VirtualBoxCallbackImpl.h	(revision 23643)
@@ -87,4 +87,5 @@
     STDMETHOD(OnParallelPortChange) (IParallelPort *aParallelPort);
     STDMETHOD(OnVRDPServerChange)();
+    STDMETHOD(OnRemoteDisplayInfoChange)();
     STDMETHOD(OnUSBControllerChange)();
     STDMETHOD(OnUSBDeviceStateChange) (IUSBDevice *aDevice, BOOL aAttached,
Index: /trunk/src/VBox/Main/xml/Settings.cpp
===================================================================
--- /trunk/src/VBox/Main/xml/Settings.cpp	(revision 23642)
+++ /trunk/src/VBox/Main/xml/Settings.cpp	(revision 23643)
@@ -1545,5 +1545,5 @@
         {
             pelmHwChild->getAttributeValue("enabled", hw.vrdpSettings.fEnabled);
-            pelmHwChild->getAttributeValue("port", hw.vrdpSettings.ulPort);
+            pelmHwChild->getAttributeValue("port", hw.vrdpSettings.strPort);
             pelmHwChild->getAttributeValue("netAddress", hw.vrdpSettings.strNetAddress);
 
@@ -2357,5 +2357,5 @@
     xml::ElementNode *pelmVRDP = pelmHardware->createChild("RemoteDisplay");
     pelmVRDP->setAttribute("enabled", hw.vrdpSettings.fEnabled);
-    pelmVRDP->setAttribute("port", hw.vrdpSettings.ulPort);
+    pelmVRDP->setAttribute("port", hw.vrdpSettings.strPort);
     if (hw.vrdpSettings.strNetAddress.length())
         pelmVRDP->setAttribute("netAddress", hw.vrdpSettings.strNetAddress);
Index: /trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
===================================================================
--- /trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 23642)
+++ /trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 23643)
@@ -506,5 +506,5 @@
 <xsd:complexType name="TRemoteDisplay">
   <xsd:attribute name="enabled" type="xsd:boolean" use="required"/>
-  <xsd:attribute name="port" type="xsd:unsignedInt" default="0"/>
+  <xsd:attribute name="port" type="xsd:token" default="0"/>
   <xsd:attribute name="netAddress" type="xsd:token" default=""/>
   <xsd:attribute name="authType" type="TVRDPAuthType" default="Null"/>
