Index: trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h
===================================================================
--- trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h	(revision 51329)
+++ trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h	(revision 51330)
@@ -60,5 +60,6 @@
 #define SHCRGL_GUEST_FN_WRITE_BUFFER        (13)
 #define SHCRGL_GUEST_FN_WRITE_READ_BUFFERED (14)
-#define SHCRGL_GUEST_FN_GET_CAPS            (15)
+#define SHCRGL_GUEST_FN_GET_CAPS_LEGACY     (15)
+#define SHCRGL_GUEST_FN_GET_CAPS_NEW     (16)
 
 /* Parameters count */
@@ -80,5 +81,6 @@
 #define SHCRGL_CPARMS_VIEWPORT_CHANGED (5)
 #define SHCRGL_CPARMS_VIEWPORT_CHANGED2 (1)
-#define SHCRGL_CPARMS_GET_CAPS (1)
+#define SHCRGL_CPARMS_GET_CAPS_LEGACY (1)
+#define SHCRGL_CPARMS_GET_CAPS_NEW (1)
 
 /* @todo Move to H3DOR.h begin */
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp	(revision 51329)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPCr.cpp	(revision 51330)
@@ -25,10 +25,10 @@
 #include <cr_protocol.h>
 
-static uint32_t g_VBoxMpCrHostCaps = 0;
+CR_CAPS_INFO g_VBoxMpCrHostCapsInfo;
 static uint32_t g_VBoxMpCr3DSupported = 0;
 
 uint32_t VBoxMpCrGetHostCaps()
 {
-    return g_VBoxMpCrHostCaps;
+    return g_VBoxMpCrHostCapsInfo.u32Caps;
 }
 
@@ -815,5 +815,5 @@
 }
 
-static int vboxMpCrCtlConGetCaps(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, uint32_t *pu32Caps)
+static int vboxMpCrCtlConGetCapsLegacy(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, uint32_t *pu32Caps)
 {
     CRVBOXHGCMGETCAPS parms;
@@ -822,6 +822,6 @@
     parms.hdr.result      = VERR_WRONG_ORDER;
     parms.hdr.u32ClientID = u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS;
-    parms.hdr.cParms      = SHCRGL_CPARMS_GET_CAPS;
+    parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_LEGACY;
+    parms.hdr.cParms      = SHCRGL_CPARMS_GET_CAPS_LEGACY;
 
     parms.Caps.type      = VMMDevHGCMParmType_32bit;
@@ -839,9 +839,54 @@
     if (RT_FAILURE(parms.hdr.result))
     {
-        WARN(("SHCRGL_GUEST_FN_GET_CAPS failed, rc (%d)", parms.hdr.result));
+        WARN(("SHCRGL_GUEST_FN_GET_CAPS_LEGACY failed, rc (%d)", parms.hdr.result));
         return parms.hdr.result;
     }
 
+    /* if host reports it supports CR_VBOX_CAP_CMDVBVA, clean it up,
+     * we only support CR_VBOX_CAP_CMDVBVA of the proper version reported by SHCRGL_GUEST_FN_GET_CAPS_NEW */
+    parms.Caps.u.value32 &= ~CR_VBOX_CAP_CMDVBVA;
+
     *pu32Caps = parms.Caps.u.value32;
+
+    return VINF_SUCCESS;
+}
+
+static int vboxMpCrCtlConGetCapsNew(PVBOXMP_CRCTLCON pCrCtlCon, uint32_t u32ClientID, CR_CAPS_INFO *pCapsInfo)
+{
+    pCapsInfo->u32Caps = CR_VBOX_CAPS_ALL;
+    pCapsInfo->u32CmdVbvaVersion = CR_CMDVBVA_VERSION;
+
+    CRVBOXHGCMGETCAPS parms;
+    int rc;
+
+    parms.hdr.result      = VERR_WRONG_ORDER;
+    parms.hdr.u32ClientID = u32ClientID;
+    parms.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_NEW;
+    parms.hdr.cParms      = SHCRGL_CPARMS_GET_CAPS_NEW;
+
+    parms.Caps.type      = VMMDevHGCMParmType_LinAddr;
+    parms.Caps.u.Pointer.u.linearAddr = (uintptr_t)pCapsInfo;
+    parms.Caps.u.Pointer.size = sizeof (*pCapsInfo);
+
+    rc = vboxCrCtlConCall(pCrCtlCon->hCrCtl, &parms.hdr, sizeof (parms));
+    if (RT_FAILURE(rc))
+    {
+        WARN(("vboxCrCtlConCall failed, rc (%d)", rc));
+        return rc;
+    }
+
+    if (RT_FAILURE(parms.hdr.result))
+    {
+        WARN(("SHCRGL_GUEST_FN_GET_CAPS_NEW failed, rc (%d)", parms.hdr.result));
+        return parms.hdr.result;
+    }
+
+    if (pCapsInfo->u32CmdVbvaVersion != CR_CMDVBVA_VERSION)
+    {
+        WARN(("CmdVbva version mismatch (%d), expected(%d)", pCapsInfo->u32CmdVbvaVersion, CR_CMDVBVA_VERSION));
+        pCapsInfo->u32Caps &= ~CR_VBOX_CAP_CMDVBVA;
+    }
+
+    pCapsInfo->u32Caps &= CR_VBOX_CAPS_ALL;
 
     return VINF_SUCCESS;
@@ -1008,5 +1053,5 @@
 {
     g_VBoxMpCr3DSupported = 0;
-    g_VBoxMpCrHostCaps = 0;
+    memset(&g_VBoxMpCrHostCapsInfo, 0, sizeof (g_VBoxMpCrHostCapsInfo));
 
     VBOXMP_CRCTLCON CrCtlCon = {0};
@@ -1021,13 +1066,20 @@
     g_VBoxMpCr3DSupported = 1;
 
-    rc = vboxMpCrCtlConGetCaps(&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCaps);
+    rc = vboxMpCrCtlConGetCapsNew(&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCapsInfo);
     if (RT_FAILURE(rc))
     {
-        WARN(("vboxMpCrCtlConGetCaps failed rc (%d), ignoring..", rc));
-        g_VBoxMpCrHostCaps = 0;
+        WARN(("vboxMpCrCtlConGetCapsNew failed rc (%d), ignoring..", rc));
+        g_VBoxMpCrHostCapsInfo.u32CmdVbvaVersion = 0;
+        rc = vboxMpCrCtlConGetCapsLegacy(&CrCtlCon, u32ClientID, &g_VBoxMpCrHostCapsInfo.u32Caps);
+        if (RT_FAILURE(rc))
+        {
+            WARN(("vboxMpCrCtlConGetCapsLegacy failed rc (%d), ignoring..", rc));
+            g_VBoxMpCrHostCapsInfo.u32Caps = 0;
+        }
     }
 
 #if 0 //ndef DEBUG_misha
-    g_VBoxMpCrHostCaps &= ~CR_VBOX_CAP_CMDVBVA;
+    g_VBoxMpCrHostCapsInfo.u32Caps &= ~CR_VBOX_CAP_CMDVBVA;
+    g_VBoxMpCrHostCapsInfo.u32CmdVbvaVersion = 0;
 #endif
 
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp	(revision 51329)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp	(revision 51330)
@@ -1161,5 +1161,5 @@
     }
 
-    NTSTATUS Status = STATUS_UNSUCCESSFUL;
+    NTSTATUS Status = STATUS_SUCCESS;
     uint32_t hostID = pSrcAllocData->hostID;
     int rc;
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp	(revision 51329)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp	(revision 51330)
@@ -1893,5 +1893,4 @@
 NTSTATUS VBoxVidPnCheckTopology(PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface, BOOLEAN *pfSupported)
 {
-    UINT i;
     VBOXVIDPNGETPATHSINFO CbContext = {0};
     CbContext.pDevExt = pDevExt;
Index: trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h
===================================================================
--- trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h	(revision 51329)
+++ trunk/src/VBox/GuestHost/OpenGL/include/cr_protocol.h	(revision 51330)
@@ -17,4 +17,15 @@
 extern "C" {
 #endif
+
+#define CR_CMDVBVA_VERSION              1
+
+#pragma pack(1)
+typedef struct CR_CAPS_INFO
+{
+    uint32_t u32Caps;
+    uint32_t u32CmdVbvaVersion;
+} CR_CAPS_INFO;
+#pragma pack()
+
 
 /*For now guest is allowed to connect host opengl service if protocol version matches exactly*/
Index: trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h
===================================================================
--- trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h	(revision 51329)
+++ trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h	(revision 51330)
@@ -520,5 +520,6 @@
 extern DECLEXPORT(int32_t) crVBoxServerClientRead(uint32_t u32ClientID, uint8_t *pBuffer, uint32_t *pcbBuffer);
 extern DECLEXPORT(int32_t) crVBoxServerClientSetVersion(uint32_t u32ClientID, uint32_t vMajor, uint32_t vMinor);
-extern DECLEXPORT(int32_t) crVBoxServerClientGetCaps(uint32_t u32ClientID, uint32_t *pu32Caps);
+extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsLegacy(uint32_t u32ClientID, uint32_t *pu32Caps);
+extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsNew(uint32_t u32ClientID, CR_CAPS_INFO *pInfo);
 extern DECLEXPORT(int32_t) crVBoxServerClientSetPID(uint32_t u32ClientID, uint64_t pid);
 
Index: trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
===================================================================
--- trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 51329)
+++ trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 51330)
@@ -1287,5 +1287,5 @@
 }
 
-static int crVBoxHGCMGetHostCaps(CRConnection *conn, uint32_t *pu32HostCaps)
+static int crVBoxHGCMGetHostCapsLegacy(CRConnection *conn, uint32_t *pu32HostCaps)
 {
     CRVBOXHGCMGETCAPS caps;
@@ -1294,6 +1294,6 @@
     caps.hdr.result      = VERR_WRONG_ORDER;
     caps.hdr.u32ClientID = conn->u32ClientID;
-    caps.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS;
-    caps.hdr.cParms      = SHCRGL_CPARMS_GET_CAPS;
+    caps.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_LEGACY;
+    caps.hdr.cParms      = SHCRGL_CPARMS_GET_CAPS_LEGACY;
 
     caps.Caps.type       = VMMDevHGCMParmType_32bit;
@@ -1321,5 +1321,4 @@
     return rc;
 }
-
 
 static int crVBoxHGCMSetPID(CRConnection *conn, unsigned long long pid)
@@ -1445,5 +1444,5 @@
             if (!g_crvboxhgcm.fHostCapsInitialized)
             {
-                rc = crVBoxHGCMGetHostCaps(conn, &g_crvboxhgcm.u32HostCaps);
+                rc = crVBoxHGCMGetHostCapsLegacy(conn, &g_crvboxhgcm.u32HostCaps);
                 if (RT_FAILURE(rc))
                 {
Index: trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
===================================================================
--- trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp	(revision 51329)
+++ trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp	(revision 51330)
@@ -904,15 +904,47 @@
         }
 
-        case SHCRGL_GUEST_FN_GET_CAPS:
-        {
-            Log(("svcCall: SHCRGL_GUEST_FN_GET_CAPS\n"));
-
-            /* Verify parameter count and types. */
-            if (cParms != SHCRGL_CPARMS_GET_CAPS)
-            {
-                rc = VERR_INVALID_PARAMETER;
-            }
-            else
-            if (paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT)
+        case SHCRGL_GUEST_FN_GET_CAPS_NEW:
+        {
+            Log(("svcCall: SHCRGL_GUEST_FN_GET_CAPS_NEW\n"));
+
+            /* Verify parameter count and types. */
+            if (cParms != SHCRGL_CPARMS_GET_CAPS_NEW)
+            {
+                WARN(("invalid parameter count"));
+                rc = VERR_INVALID_PARAMETER;
+                break;
+            }
+
+            if (paParms[0].type != VBOX_HGCM_SVC_PARM_PTR)
+            {
+                WARN(("invalid parameter"));
+                rc = VERR_INVALID_PARAMETER;
+                break;
+            }
+
+            if (paParms[0].u.pointer.size < sizeof (CR_CAPS_INFO))
+            {
+                WARN(("invalid buffer size"));
+                rc = VERR_INVALID_PARAMETER;
+                break;
+            }
+
+            CR_CAPS_INFO *pInfo = (CR_CAPS_INFO*)paParms[0].u.pointer.addr;
+            rc = crVBoxServerClientGetCapsNew(u32ClientID, pInfo);
+            AssertRC(rc);
+
+            break;
+        }
+
+        case SHCRGL_GUEST_FN_GET_CAPS_LEGACY:
+        {
+            Log(("svcCall: SHCRGL_GUEST_FN_GET_CAPS_LEGACY\n"));
+
+            /* Verify parameter count and types. */
+            if (cParms != SHCRGL_CPARMS_GET_CAPS_LEGACY)
+            {
+                rc = VERR_INVALID_PARAMETER;
+            }
+            else if (paParms[0].type != VBOX_HGCM_SVC_PARM_32BIT)
             {
                 rc = VERR_INVALID_PARAMETER;
@@ -921,5 +953,5 @@
             {
                 /* Execute the function. */
-                rc = crVBoxServerClientGetCaps(u32ClientID, &paParms[0].u.uint32);
+                rc = crVBoxServerClientGetCapsLegacy(u32ClientID, &paParms[0].u.uint32);
                 AssertRC(rc);
             }
Index: trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
===================================================================
--- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c	(revision 51329)
+++ trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c	(revision 51330)
@@ -840,7 +840,16 @@
 }
 
-extern DECLEXPORT(int32_t) crVBoxServerClientGetCaps(uint32_t u32ClientID, uint32_t *pu32Caps)
-{
-    *pu32Caps = cr_server.u32Caps;
+extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsLegacy(uint32_t u32ClientID, uint32_t *pu32Caps)
+{
+    uint32_t u32Caps = cr_server.u32Caps;
+    u32Caps &= ~CR_VBOX_CAP_CMDVBVA;
+    *pu32Caps = u32Caps;
+    return VINF_SUCCESS;
+}
+
+extern DECLEXPORT(int32_t) crVBoxServerClientGetCapsNew(uint32_t u32ClientID, CR_CAPS_INFO *pInfo)
+{
+    pInfo->u32Caps = cr_server.u32Caps;
+    pInfo->u32CmdVbvaVersion = CR_CMDVBVA_VERSION;
     return VINF_SUCCESS;
 }
