Index: trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 33313)
+++ trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp	(revision 33386)
@@ -180,7 +180,7 @@
                                 mfNoLoggedInUsers = true;
 
-                                /* If there is a VRDP connection, drop it. */
-                                ComPtr<IRemoteDisplayInfo> info;
-                                hrc = gConsole->COMGETTER(RemoteDisplayInfo)(info.asOutParam());
+                                /* If there is a connection, drop it. */
+                                ComPtr<IVRDEServerInfo> info;
+                                hrc = gConsole->COMGETTER(VRDEServerInfo)(info.asOutParam());
                                 if (SUCCEEDED(hrc) && info)
                                 {
@@ -189,10 +189,10 @@
                                     if (SUCCEEDED(hrc) && cClients > 0)
                                     {
-                                        ComPtr <IVRDPServer> vrdpServer;
-                                        hrc = machine->COMGETTER(VRDPServer)(vrdpServer.asOutParam());
-                                        if (SUCCEEDED(hrc) && vrdpServer)
+                                        ComPtr <IVRDEServer> vrdeServer;
+                                        hrc = machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());
+                                        if (SUCCEEDED(hrc) && vrdeServer)
                                         {
-                                            vrdpServer->COMSETTER(Enabled)(FALSE);
-                                            vrdpServer->COMSETTER(Enabled)(TRUE);
+                                            vrdeServer->COMSETTER(Enabled)(FALSE);
+                                            vrdeServer->COMSETTER(Enabled)(TRUE);
                                         }
                                     }
@@ -236,5 +236,5 @@
         refcnt = 0;
 #endif
-        mLastVRDPPort = -1;
+        mLastVRDEPort = -1;
     }
 
@@ -310,7 +310,7 @@
                 break;
             }
-            case VBoxEventType_OnRemoteDisplayInfoChanged:
-            {
-                ComPtr<IRemoteDisplayInfoChangedEvent> rdicev = aEvent;
+            case VBoxEventType_OnVRDEServerInfoChanged:
+            {
+                ComPtr<IVRDEServerInfoChangedEvent> rdicev = aEvent;
                 Assert(rdicev);
 
@@ -318,20 +318,20 @@
                 if (gConsole)
                 {
-                    ComPtr<IRemoteDisplayInfo> info;
-                    gConsole->COMGETTER(RemoteDisplayInfo)(info.asOutParam());
+                    ComPtr<IVRDEServerInfo> info;
+                    gConsole->COMGETTER(VRDEServerInfo)(info.asOutParam());
                     if (info)
                     {
                         LONG port;
                         info->COMGETTER(Port)(&port);
-                        if (port != mLastVRDPPort)
+                        if (port != mLastVRDEPort)
                         {
                             if (port == -1)
-                                RTPrintf("VRDP server is inactive.\n");
+                                RTPrintf("VRDE server is inactive.\n");
                             else if (port == 0)
-                                RTPrintf("VRDP server failed to start.\n");
+                                RTPrintf("VRDE server failed to start.\n");
                             else
-                                RTPrintf("Listening on port %d.\n", port);
-
-                            mLastVRDPPort = port;
+                                RTPrintf("VRDE server is listening on port %d.\n", port);
+
+                            mLastVRDEPort = port;
                         }
                     }
@@ -365,5 +365,5 @@
     long refcnt;
 #endif
-    long mLastVRDPPort;
+    long mLastVRDEPort;
 };
 
@@ -446,10 +446,12 @@
 #endif
 #ifdef VBOX_WITH_VRDP
-             "   -v, -vrdp, --vrdp on|off|config       Enable (default) or disable the VRDP\n"
+             "   -v, -vrde, --vrde on|off|config       Enable (default) or disable the VRDE\n"
              "                                         server or don't change the setting\n"
-             "   -p, -vrdpport, --vrdpport <ports>     Comma-separated list of ports the VRDP\n"
-             "                                         server can bind to. Use a dash between\n"
+             "   -e, -vrdeproperty, --vrdeproperty <name=[value]> Set a VRDE property:\n"
+             "                                         \"TCP/Ports\" - comma-separated list of ports\n"
+             "                                         the VRDE server can bind to. Use a dash between\n"
              "                                         two port numbers to specify a range\n"
-             "   -a, -vrdpaddress, --vrdpaddress <ip>  Interface IP the VRDP will bind to \n"
+             "                                         \"TCP/Address\" - interface IP the VRDE server\n"
+             "                                         will bind to\n"
 #endif
 #ifdef VBOX_FFMPEG
@@ -517,7 +519,9 @@
 {
 #ifdef VBOX_WITH_VRDP
-    const char *vrdpPort = NULL;
-    const char *vrdpAddress = NULL;
-    const char *vrdpEnabled = NULL;
+    const char *vrdePort = NULL;
+    const char *vrdeAddress = NULL;
+    const char *vrdeEnabled = NULL;
+    int cVRDEProperties = 0;
+    const char *aVRDEProperties[16];
 #endif
 #ifdef VBOX_WITH_VNC
@@ -572,10 +576,14 @@
         { "--startvm", 's', RTGETOPT_REQ_STRING },
 #ifdef VBOX_WITH_VRDP
-        { "-vrdpport", 'p', RTGETOPT_REQ_STRING },
-        { "--vrdpport", 'p', RTGETOPT_REQ_STRING },
-        { "-vrdpaddress", 'a', RTGETOPT_REQ_STRING },
-        { "--vrdpaddress", 'a', RTGETOPT_REQ_STRING },
-        { "-vrdp", 'v', RTGETOPT_REQ_STRING },
-        { "--vrdp", 'v', RTGETOPT_REQ_STRING },
+        { "-vrdpport", 'p', RTGETOPT_REQ_STRING },     /* VRDE: deprecated. */
+        { "--vrdpport", 'p', RTGETOPT_REQ_STRING },    /* VRDE: deprecated. */
+        { "-vrdpaddress", 'a', RTGETOPT_REQ_STRING },  /* VRDE: deprecated. */
+        { "--vrdpaddress", 'a', RTGETOPT_REQ_STRING }, /* VRDE: deprecated. */
+        { "-vrdp", 'v', RTGETOPT_REQ_STRING },         /* VRDE: deprecated. */
+        { "--vrdp", 'v', RTGETOPT_REQ_STRING },        /* VRDE: deprecated. */
+        { "-vrde", 'v', RTGETOPT_REQ_STRING },
+        { "--vrde", 'v', RTGETOPT_REQ_STRING },
+        { "-vrdesetproperty", 'e', RTGETOPT_REQ_STRING },
+        { "--vrdesetproperty", 'e', RTGETOPT_REQ_STRING },
 #endif /* VBOX_WITH_VRDP defined */
 #ifdef VBOX_WITH_VNC
@@ -628,11 +636,19 @@
 #ifdef VBOX_WITH_VRDP
             case 'p':
-                vrdpPort = ValueUnion.psz;
+                RTPrintf("Warning: '-p' or '-vrdpport' are deprecated. Use '-e \"TCP/Ports=%s\"'\n", ValueUnion.psz);
+                vrdePort = ValueUnion.psz;
                 break;
             case 'a':
-                vrdpAddress = ValueUnion.psz;
+                RTPrintf("Warning: '-a' or '-vrdpaddress' are deprecated. Use '-e \"TCP/Address=%s\"'\n", ValueUnion.psz);
+                vrdeAddress = ValueUnion.psz;
                 break;
             case 'v':
-                vrdpEnabled = ValueUnion.psz;
+                vrdeEnabled = ValueUnion.psz;
+                break;
+            case 'e':
+                if (cVRDEProperties < RT_ELEMENTS(aVRDEProperties))
+                    aVRDEProperties[cVRDEProperties++] = ValueUnion.psz;
+                else
+                     RTPrintf("Warning: too many VRDE properties. Ignored: '%s'\n", ValueUnion.psz);
                 break;
 #endif /* VBOX_WITH_VRDP defined */
@@ -995,5 +1011,5 @@
             eventTypes.push_back(VBoxEventType_OnMouseCapabilityChanged);
             eventTypes.push_back(VBoxEventType_OnStateChanged);
-            eventTypes.push_back(VBoxEventType_OnRemoteDisplayInfoChanged);
+            eventTypes.push_back(VBoxEventType_OnVRDEServerInfoChanged);
             eventTypes.push_back(VBoxEventType_OnCanShowWindow);
             eventTypes.push_back(VBoxEventType_OnShowWindow);
@@ -1002,55 +1018,95 @@
 
 #ifdef VBOX_WITH_VRDP
-        /* default is to enable the RDP server (backward compatibility) */
-        BOOL fVRDPEnable = true;
-        BOOL fVRDPEnabled;
-        ComPtr <IVRDPServer> vrdpServer;
-        CHECK_ERROR_BREAK(machine, COMGETTER(VRDPServer)(vrdpServer.asOutParam()));
-        CHECK_ERROR_BREAK(vrdpServer, COMGETTER(Enabled)(&fVRDPEnabled));
-
-        if (vrdpEnabled != NULL)
-        {
-            /* -vrdp on|off|config */
-            if (!strcmp(vrdpEnabled, "off") || !strcmp(vrdpEnabled, "disable"))
-                fVRDPEnable = false;
-            else if (!strcmp(vrdpEnabled, "config"))
-            {
-                if (!fVRDPEnabled)
-                    fVRDPEnable = false;
-            }
-            else if (strcmp(vrdpEnabled, "on") && strcmp(vrdpEnabled, "enable"))
-            {
-                RTPrintf("-vrdp requires an argument (on|off|config)\n");
-                break;
-            }
-        }
-
-        if (fVRDPEnable)
-        {
-            Log(("VBoxHeadless: Enabling VRDP server...\n"));
-
-            /* set VRDP port if requested by the user */
-            if (vrdpPort != NULL)
-            {
-                Bstr bstr = vrdpPort;
-                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Ports)(bstr.raw()));
-            }
-            /* set VRDP address if requested by the user */
-            if (vrdpAddress != NULL)
-            {
-                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(NetAddress)(Bstr(vrdpAddress).raw()));
-            }
-            /* enable VRDP server (only if currently disabled) */
-            if (!fVRDPEnabled)
-            {
-                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Enabled)(TRUE));
+        /* default is to enable the remote desktop server (backward compatibility) */
+        BOOL fVRDEEnable = true;
+        BOOL fVRDEEnabled;
+        ComPtr <IVRDEServer> vrdeServer;
+        CHECK_ERROR_BREAK(machine, COMGETTER(VRDEServer)(vrdeServer.asOutParam()));
+        CHECK_ERROR_BREAK(vrdeServer, COMGETTER(Enabled)(&fVRDEEnabled));
+
+        if (vrdeEnabled != NULL)
+        {
+            /* -vrdeServer on|off|config */
+            if (!strcmp(vrdeEnabled, "off") || !strcmp(vrdeEnabled, "disable"))
+                fVRDEEnable = false;
+            else if (!strcmp(vrdeEnabled, "config"))
+            {
+                if (!fVRDEEnabled)
+                    fVRDEEnable = false;
+            }
+            else if (strcmp(vrdeEnabled, "on") && strcmp(vrdeEnabled, "enable"))
+            {
+                RTPrintf("-vrdeServer requires an argument (on|off|config)\n");
+                break;
+            }
+        }
+
+        if (fVRDEEnable)
+        {
+            Log(("VBoxHeadless: Enabling VRDE server...\n"));
+
+            /* set VRDE port if requested by the user */
+            if (vrdePort != NULL)
+            {
+                Bstr bstr = vrdePort;
+                CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(Bstr("TCP/Ports").raw(), bstr.raw()));
+            }
+            /* set VRDE address if requested by the user */
+            if (vrdeAddress != NULL)
+            {
+                CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(Bstr("TCP/Address").raw(), Bstr(vrdeAddress).raw()));
+            }
+
+            /* Set VRDE properties. */
+            if (cVRDEProperties > 0)
+            {
+                int i;
+                for (i = 0; i < cVRDEProperties; i++)
+                {
+                    /* Parse 'name=value' */
+                    char *pszProperty = RTStrDup(aVRDEProperties[i]);
+                    if (pszProperty)
+                    {
+                        char *pDelimiter = strchr(pszProperty, '=');
+                        if (pDelimiter)
+                        {
+                            *pDelimiter = '\0';
+
+                            Bstr bstrName = pszProperty;
+                            Bstr bstrValue = &pDelimiter[1];
+                            CHECK_ERROR_BREAK(vrdeServer, SetVRDEProperty(bstrName.raw(), bstrValue.raw()));
+                        }
+                        else
+                        {
+                            RTPrintf("Error: Invalid VRDE property '%s'\n", aVRDEProperties[i]);
+                            RTStrFree(pszProperty);
+                            rc = E_INVALIDARG;
+                            break;
+                        }
+                        RTStrFree(pszProperty);
+                    }
+                    else
+                    {
+                        RTPrintf("Error: Failed to allocate memory for VRDE property '%s'\n", aVRDEProperties[i]);
+                        rc = E_OUTOFMEMORY;
+                        break;
+                    }
+                }
+                if (FAILED(rc))
+                    break;
+            }
+
+            /* enable VRDE server (only if currently disabled) */
+            if (!fVRDEEnabled)
+            {
+                CHECK_ERROR_BREAK(vrdeServer, COMSETTER(Enabled)(TRUE));
             }
         }
         else
         {
-            /* disable VRDP server (only if currently enabled */
-            if (fVRDPEnabled)
-            {
-                CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Enabled)(FALSE));
+            /* disable VRDE server (only if currently enabled */
+            if (fVRDEEnabled)
+            {
+                CHECK_ERROR_BREAK(vrdeServer, COMSETTER(Enabled)(FALSE));
             }
         }
@@ -1137,5 +1193,5 @@
 #endif /* defined(VBOX_FFMPEG) */
 
-        /* we don't have to disable VRDP here because we don't save the settings of the VM */
+        /* we don't have to disable VRDE here because we don't save the settings of the VM */
     }
     while (0);
Index: trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.h	(revision 33313)
+++ trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.h	(revision 33386)
@@ -1,10 +1,10 @@
 /** @file
  *
- * VBox frontends: VRDP (headless RDP server):
+ * VBox frontends: VRDE (headless Remote Desktop server):
  * Header file with registration call for ffmpeg framebuffer
  */
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -17,6 +17,6 @@
  */
 
-#ifndef __H_VBOXVRDP
-#define __H_VBOXVRDP
+#ifndef __H_VBOXHEADLESS
+#define __H_VBOXHEADLESS
 
 #include <VBox/com/VirtualBox.h>
@@ -47,3 +47,3 @@
 typedef FNREGISTERFFMPEGFB *PFNREGISTERFFMPEGFB;
 
-#endif // __H_VBOXVRDP
+#endif // __H_VBOXHEADLESS
