Index: trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp	(revision 72351)
+++ trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDispIf.cpp	(revision 72366)
@@ -1700,7 +1700,7 @@
 }
 
-BOOL vboxDispIfWddmResizeDisplayWin7(PCVBOXDISPIF const pIf, uint32_t cModeHints, const VBOXDISPLAY_MODEHINT* paModeHints)
-{
-    const VBOXDISPLAY_MODEHINT* pHint;
+BOOL vboxDispIfWddmResizeDisplayWin7(PCVBOXDISPIF const pIf, uint32_t cDispDef, const VMMDevDisplayDef *paDispDef)
+{
+    const VMMDevDisplayDef* pDispDef;
     VBOXDISPIF_OP Op;
     DWORD winEr = ERROR_SUCCESS;
@@ -1710,14 +1710,16 @@
     vboxDispIfOpBegin(pIf, &Op);
 
-    for (id = 0; id < cModeHints; ++id)
-    {
-        pHint = &paModeHints[id];
-
-        if (pHint->fModeHintFlags & VBOXDISPLAY_MODEHINT_ACTIVE)
+    for (id = 0; id < cDispDef; ++id)
+    {
+        pDispDef = &paDispDef[id];
+
+        if (!(pDispDef->fDisplayFlags & VMMDEV_DISPLAY_DISABLED) &&
+             (pDispDef->fDisplayFlags | VMMDEV_DISPLAY_CX) || 
+             (pDispDef->fDisplayFlags | VMMDEV_DISPLAY_CY))
         {
             RTRECTSIZE Size;
 
-            Size.cx = pHint->cx;
-            Size.cy = pHint->cy;
+            Size.cx = pDispDef->cx;
+            Size.cy = pDispDef->cy;
 
             vboxDispIfUpdateModesWDDM(&Op, id, &Size);
@@ -1731,9 +1733,9 @@
     vboxDispIfWddmDcCreate(&DispCfg, QDC_ALL_PATHS);
 
-    for (id = 0; id < cModeHints; ++id)
+    for (id = 0; id < cDispDef; ++id)
     {
         DISPLAYCONFIG_PATH_INFO *pPathInfo;
 
-        pHint = &paModeHints[id];
+        pDispDef = &paDispDef[id];
         iPath = vboxDispIfWddmDcSearchPath(&DispCfg, id, id);
 
@@ -1744,5 +1746,5 @@
         }
 
-        if (pHint->fModeHintFlags & VBOXDISPLAY_MODEHINT_ACTIVE)
+        if (!(pDispDef->fDisplayFlags & VMMDEV_DISPLAY_DISABLED))
         {
             DISPLAYCONFIG_SOURCE_MODE *pSrcMode;
@@ -1769,14 +1771,14 @@
                 pSrcMode->width =
                     pTgtMode->targetVideoSignalInfo.activeSize.cx =
-                    pTgtMode->targetVideoSignalInfo.totalSize.cx  = pHint->cx;
+                    pTgtMode->targetVideoSignalInfo.totalSize.cx  = pDispDef->cx;
 
                 pSrcMode->height =
                     pTgtMode->targetVideoSignalInfo.activeSize.cy =
-                    pTgtMode->targetVideoSignalInfo.totalSize.cy  = pHint->cy;
-
-                pSrcMode->position.x = pHint->xOrigin;
-                pSrcMode->position.y = pHint->yOrigin;
-
-                switch (pHint->cBPP)
+                    pTgtMode->targetVideoSignalInfo.totalSize.cy  = pDispDef->cy;
+
+                pSrcMode->position.x = pDispDef->xOrigin;
+                pSrcMode->position.y = pDispDef->yOrigin;
+
+                switch (pDispDef->cBitsPerPixel)
                 {
                 case 32:
@@ -1793,5 +1795,5 @@
                     break;
                 default:
-                    LogRel(("VBoxTray: (WDDM) invalid bpp %d, using 32bpp instead\n", pHint->cBPP));
+                    LogRel(("VBoxTray: (WDDM) invalid bpp %d, using 32bpp instead\n", pDispDef->cBitsPerPixel));
                     pSrcMode->pixelFormat = DISPLAYCONFIG_PIXELFORMAT_32BPP;
                     break;
@@ -1821,9 +1823,9 @@
                 pModeInfoNew->adapterId = pModeInfo[0].adapterId;
                 pSrcMode = &pModeInfoNew->sourceMode;
-                pSrcMode->width  = pHint->cx;
-                pSrcMode->height = pHint->cy;
+                pSrcMode->width  = pDispDef->cx;
+                pSrcMode->height = pDispDef->cy;
                 pSrcMode->pixelFormat = DISPLAYCONFIG_PIXELFORMAT_32BPP;
-                pSrcMode->position.x = pHint->xOrigin;
-                pSrcMode->position.y = pHint->yOrigin;
+                pSrcMode->position.x = pDispDef->xOrigin;
+                pSrcMode->position.y = pDispDef->yOrigin;
                 pPathInfo->sourceInfo.modeInfoIdx = DispCfg.cModeInfoArray;
 
@@ -1834,8 +1836,8 @@
                 pModeInfoNew->targetMode = pModeInfo[0].targetMode;
                 pTgtMode = &pModeInfoNew->targetMode;
-                pTgtMode->targetVideoSignalInfo.activeSize.cx = pHint->cx;
-                pTgtMode->targetVideoSignalInfo.totalSize.cx  = pHint->cx;
-                pTgtMode->targetVideoSignalInfo.activeSize.cy = pHint->cy;
-                pTgtMode->targetVideoSignalInfo.totalSize.cy  = pHint->cy;
+                pTgtMode->targetVideoSignalInfo.activeSize.cx = 
+                    pTgtMode->targetVideoSignalInfo.totalSize.cx = pDispDef->cx;
+                pTgtMode->targetVideoSignalInfo.activeSize.cy = 
+                    pTgtMode->targetVideoSignalInfo.totalSize.cy  = pDispDef->cy;
                 pPathInfo->targetInfo.modeInfoIdx = DispCfg.cModeInfoArray + 1;
 
