Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp	(revision 44333)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp	(revision 44334)
@@ -505,4 +505,33 @@
 }
 
+#ifdef VBOX_WDDM_MINIPORT
+static const uint32_t g_aVBoxVidModesSupportedBpps[] = {
+        32
+#ifndef VBOX_WITHOUT_24BPP_MODES
+        , 24
+#endif
+        , 16
+#ifdef VBOX_WITH_8BPP_MODES
+        , 8
+#endif
+};
+DECLINLINE(BOOLEAN) VBoxMPIsSupportedBpp(uint32_t bpp)
+{
+    for (int i = 0; i < RT_ELEMENTS(g_aVBoxVidModesSupportedBpps); ++i)
+    {
+        if (bpp == g_aVBoxVidModesSupportedBpps[i])
+            return TRUE;
+    }
+    return FALSE;
+}
+
+DECLINLINE(uint32_t) VBoxMPAdjustBpp(uint32_t bpp)
+{
+    if (VBoxMPIsSupportedBpp(bpp))
+        return bpp;
+    Assert(g_aVBoxVidModesSupportedBpps[0] == 32);
+    return g_aVBoxVidModesSupportedBpps[0];
+}
+#endif
 /* Updates missing video mode params with current values,
  * Checks if resulting mode is liked by the host and fits into VRAM.
@@ -533,5 +562,12 @@
         xres = xres ? xres:pAllocData->SurfDesc.width;
         yres = yres ? yres:pAllocData->SurfDesc.height;
-        bpp  = bpp  ? bpp :pAllocData->SurfDesc.bpp;
+        /* VBox WDDM driver does not allow 24 modes since OS could choose the 24bit mode as default in that case,
+         * the pExt->aSources[iDisplay].AllocData.SurfDesc.bpp could be initially 24 though,
+         * i.e. when driver occurs the current mode on driver load via DxgkCbAcquirePostDisplayOwnership
+         * and until driver reports the supported modes
+         * This is true for Win8 Display-Only driver currently since DxgkCbAcquirePostDisplayOwnership is only used by it
+         *
+         * This is why we need to adjust the current mode bpp to the value we actually report as supported */
+        bpp  = bpp  ? bpp : VBoxMPAdjustBpp(pAllocData->SurfDesc.bpp);
 #endif
     }
@@ -551,5 +587,5 @@
     if (!VBoxMPValidateVideoModeParamsGuest(pExt, iDisplay, xres, yres, bpp))
     {
-        WARN_NOBP(("GUEST does not like special mode %dx%d:%d for display %d", xres, yres, bpp, iDisplay));
+        WARN(("GUEST does not like special mode %dx%d:%d for display %d", xres, yres, bpp, iDisplay));
         return FALSE;
     }
@@ -976,45 +1012,55 @@
         if (pModes->cModes < RT_ELEMENTS(pModes->aModes))
         {
-            int foundIdx;
-            VBoxFillVidModeInfo(&pModes->aModes[pModes->cModes], pAllocData->SurfDesc.width, pAllocData->SurfDesc.height, pAllocData->SurfDesc.bpp, 1/*index*/, 0);
-            if ((foundIdx=VBoxMPFindVideoMode(pModes->aModes, pModes->cModes, &pModes->aModes[pModes->cModes]))>=0)
-            {
-                pModes->iPreferredMode = foundIdx;
-            }
-            else
-            {
-                pModes->iPreferredMode = pModes->cModes;
-                ++pModes->cModes;
-            }
+            /* VBox WDDM driver does not allow 24 modes since OS could choose the 24bit mode as default in that case,
+             * the pExt->aSources[iDisplay].AllocData.SurfDesc.bpp could be initially 24 though,
+             * i.e. when driver occurs the current mode on driver load via DxgkCbAcquirePostDisplayOwnership
+             * and until driver reports the supported modes
+             * This is true for Win8 Display-Only driver currently since DxgkCbAcquirePostDisplayOwnership is only used by it
+             *
+             * This is why we check the bpp to be supported here and add the current mode to the list only in that case */
+            if (VBoxMPIsSupportedBpp(pAllocData->SurfDesc.bpp))
+            {
+                int foundIdx;
+                VBoxFillVidModeInfo(&pModes->aModes[pModes->cModes], pAllocData->SurfDesc.width, pAllocData->SurfDesc.height, pAllocData->SurfDesc.bpp, 1/*index*/, 0);
+                if ((foundIdx=VBoxMPFindVideoMode(pModes->aModes, pModes->cModes, &pModes->aModes[pModes->cModes]))>=0)
+                {
+                    pModes->iPreferredMode = foundIdx;
+                }
+                else
+                {
+                    pModes->iPreferredMode = pModes->cModes;
+                    ++pModes->cModes;
+                }
 
 #ifdef VBOX_WITH_8BPP_MODES
-            int bytesPerPixel=1;
+                int bytesPerPixel=1;
 #else
-            int bytesPerPixel=2;
-#endif
-            for (; bytesPerPixel<=4; bytesPerPixel++)
-            {
-                int bpp = 8*bytesPerPixel;
-
-                if (bpp == pAllocData->SurfDesc.bpp)
-                    continue;
-
-                if (!VBoxMPValidateVideoModeParamsGuest(pExt, VidPnTargetId,
-                        pAllocData->SurfDesc.width, pAllocData->SurfDesc.height,
-                        bpp))
-                    continue;
-
-                if (pModes->cModes >= RT_ELEMENTS(pModes->aModes))
+                int bytesPerPixel=2;
+#endif
+                for (; bytesPerPixel<=4; bytesPerPixel++)
                 {
-                    WARN(("ran out of video modes 2"));
-                    break;
-                }
-
-                VBoxFillVidModeInfo(&pModes->aModes[pModes->cModes],
-                                        pAllocData->SurfDesc.width, pAllocData->SurfDesc.height,
-                                        bpp, pModes->cModes, 0);
-                if (VBoxMPFindVideoMode(pModes->aModes, pModes->cModes, &pModes->aModes[pModes->cModes]) < 0)
-                {
-                    ++pModes->cModes;
+                    int bpp = 8*bytesPerPixel;
+
+                    if (bpp == pAllocData->SurfDesc.bpp)
+                        continue;
+
+                    if (!VBoxMPValidateVideoModeParamsGuest(pExt, VidPnTargetId,
+                            pAllocData->SurfDesc.width, pAllocData->SurfDesc.height,
+                            bpp))
+                        continue;
+
+                    if (pModes->cModes >= RT_ELEMENTS(pModes->aModes))
+                    {
+                        WARN(("ran out of video modes 2"));
+                        break;
+                    }
+
+                    VBoxFillVidModeInfo(&pModes->aModes[pModes->cModes],
+                                            pAllocData->SurfDesc.width, pAllocData->SurfDesc.height,
+                                            bpp, pModes->cModes, 0);
+                    if (VBoxMPFindVideoMode(pModes->aModes, pModes->cModes, &pModes->aModes[pModes->cModes]) < 0)
+                    {
+                        ++pModes->cModes;
+                    }
                 }
             }
@@ -1227,4 +1273,25 @@
     /* @todo: this info should go from the target actually */
     PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];
+
+    UINT newWidth = pMode->Mode.Width;
+    UINT newHeight = pMode->Mode.Height;
+    UINT newBpp = pMode->Mode.BitsPerPixel;
+
+    if (!VBoxMPValidateVideoModeParams(pExt, pMode->Mode.Id, newWidth, newHeight, newBpp))
+    {
+        PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];
+        pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED;
+    }
+
+    if (pMode->Mode.Width != newWidth
+            || pMode->Mode.Height != newHeight
+            || pMode->Mode.BitsPerPixel != newBpp)
+    {
+        pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_ADJUSTED;
+        pMode->Mode.Width = newWidth;
+        pMode->Mode.Height = newHeight;
+        pMode->Mode.BitsPerPixel = newBpp;
+    }
+
     if (pTarget->HeightVisible /* <- active */
             && pSource->AllocData.SurfDesc.width == pMode->Mode.Width
@@ -1232,38 +1299,8 @@
             && pSource->AllocData.SurfDesc.bpp == pMode->Mode.BitsPerPixel)
     {
-        pMode->fFlags = VBOXWDDM_ADJUSTVIDEOMODE_F_CURRENT;
-        return;
-    }
-
-    UINT newWidth = pMode->Mode.Width;
-    UINT newHeight = pMode->Mode.Height;
-    UINT newBpp = pMode->Mode.BitsPerPixel;
-
-    if (!VBoxMPValidateVideoModeParams(pExt, pMode->Mode.Id, newWidth, newHeight, newBpp))
-    {
-        PVBOXWDDM_SOURCE pSource = &pExt->aSources[pMode->Mode.Id];
-        pMode->fFlags = VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED;
-    }
-
-    if (pMode->Mode.Width != newWidth
-            || pMode->Mode.Height != newHeight
-            || pMode->Mode.BitsPerPixel != newBpp)
-    {
-        pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_ADJUSTED;
-        pMode->Mode.Width = newWidth;
-        pMode->Mode.Height = newHeight;
-        pMode->Mode.BitsPerPixel = newBpp;
-    }
-
-    if (pTarget->HeightVisible /* <- active */
-            && pSource->AllocData.SurfDesc.width == pMode->Mode.Width
-            && pSource->AllocData.SurfDesc.height == pMode->Mode.Height
-            && pSource->AllocData.SurfDesc.bpp == pMode->Mode.BitsPerPixel)
-    {
         pMode->fFlags |= VBOXWDDM_ADJUSTVIDEOMODE_F_CURRENT;
         if (pMode->fFlags & VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED)
         {
-            WARN(("current mode is reported as unsupported, cleaning the unsupported flag"));
-            pMode->fFlags &= ~VBOXWDDM_ADJUSTVIDEOMODE_F_UNSUPPORTED;
+            WARN(("current mode is reported as unsupported"));
         }
     }
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 44333)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 44334)
@@ -4248,4 +4248,5 @@
                 VBoxWddmAdjustModes(pDevExt, cModes, pPodesInfo->aScreenInfos);
                 Status = STATUS_SUCCESS;
+                break;
             }
             case VBOXESC_SHRC_ADDREF:
