Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h	(revision 37194)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h	(revision 37207)
@@ -38,4 +38,10 @@
 #endif
 
+#ifdef DEBUG_misha
+# define BREAK_WARN() AssertFailed()
+#else
+# define BREAK_WARN() do {} while(0)
+#endif
+
 #define _LOGMSG(_logger, _a)                                                \
     do                                                                      \
@@ -52,4 +58,5 @@
         Log(_a);                                                                  \
         Log((VBOX_VIDEO_LOG_SUFFIX_FMT VBOX_VIDEO_LOG_SUFFIX_PARMS));             \
+        BREAK_WARN(); \
     } while (0)
 
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp	(revision 37194)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPVidModes.cpp	(revision 37207)
@@ -430,10 +430,10 @@
 
 /* Returns if we're in the first mode change, ie doesn't have valid video mode set yet */
-static BOOLEAN VBoxMPIsStartingUp(PVBOXMP_DEVEXT pExt)
+static BOOLEAN VBoxMPIsStartingUp(PVBOXMP_DEVEXT pExt, uint32_t iDisplay)
 {
 #ifdef VBOX_XPDM_MINIPORT
     return (pExt->CurrentMode == 0);
 #else
-    return (!VBoxCommonFromDeviceExt(pExt)->cDisplays || !pExt->aSources[0].pPrimaryAllocation);
+    return (!VBoxCommonFromDeviceExt(pExt)->cDisplays || !pExt->aSources[iDisplay].pPrimaryAllocation);
 #endif
 }
@@ -447,5 +447,5 @@
 {
     /* Make sure all important video mode values are set */
-    if (VBoxMPIsStartingUp(pExt))
+    if (VBoxMPIsStartingUp(pExt, iDisplay))
     {
         /* Use stored custom values only if nothing was read from host. */
@@ -462,7 +462,7 @@
         bpp  = bpp  ? bpp :pExt->CurrentModeBPP;
 #else
-        xres = xres ? xres:pExt->aSources[0].pPrimaryAllocation->SurfDesc.width;
-        yres = yres ? yres:pExt->aSources[0].pPrimaryAllocation->SurfDesc.height;
-        bpp  = bpp  ? bpp :pExt->aSources[0].pPrimaryAllocation->SurfDesc.bpp;
+        xres = xres ? xres:pExt->aSources[iDisplay].pPrimaryAllocation->SurfDesc.width;
+        yres = yres ? yres:pExt->aSources[iDisplay].pPrimaryAllocation->SurfDesc.height;
+        bpp  = bpp  ? bpp :pExt->aSources[iDisplay].pPrimaryAllocation->SurfDesc.bpp;
 #endif
     }
@@ -637,5 +637,5 @@
 
     /* Check the startup case */
-    if (!bHaveSpecial && VBoxMPIsStartingUp(pExt))
+    if (!bHaveSpecial && VBoxMPIsStartingUp(pExt, pExt->iDevice))
     {
         uint32_t xres=0, yres=0, bpp=0;
@@ -699,5 +699,5 @@
 
         /* Check if we need to alternate the index */
-        if (!VBoxMPIsStartingUp(pExt))
+        if (!VBoxMPIsStartingUp(pExt, pExt->iDevice))
         {
             if (bChanged)
@@ -731,5 +731,5 @@
         
         /* Make sure we've added 2nd mode if necessary to maintain table size */
-        if (VBoxMPIsStartingUp(pExt))
+        if (VBoxMPIsStartingUp(pExt, pExt->iDevice))
         {
             memcpy(&g_VideoModes[g_NumVideoModes], &g_VideoModes[g_NumVideoModes-1], sizeof(VIDEO_MODE_INFORMATION));
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp	(revision 37194)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp	(revision 37207)
@@ -117,220 +117,4 @@
     }
     return -1;
-}
-
-
-NTSTATUS vboxVidPnCheckTopology(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
-        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
-        BOOLEAN *pbSupported)
-{
-    const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo = NULL;
-    NTSTATUS Status = pVidPnTopologyInterface->pfnAcquireFirstPathInfo(hVidPnTopology, &pNewVidPnPresentPathInfo);
-    BOOLEAN bSupported = TRUE;
-
-    if (Status == STATUS_SUCCESS)
-    {
-        BOOLEAN bFoundPrimary = FALSE;
-
-        while (1)
-        {
-            if (pNewVidPnPresentPathInfo->VidPnSourceId != pNewVidPnPresentPathInfo->VidPnTargetId)
-            {
-                LOG(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId));
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->VidPnSourceId == 0)
-            {
-                bFoundPrimary = TRUE;
-            }
-
-            /*
-            ImportanceOrdinal does not matter for now
-            pNewVidPnPresentPathInfo->ImportanceOrdinal
-            */
-
-            if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_UNPINNED
-                    && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY
-                    && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_CENTERED
-                    && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_NOTSPECIFIED)
-            {
-                LOG(("unsupported Scaling (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Scaling));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched)
-            {
-                LOG(("unsupported Scaling support (Stretched)"));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (!pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity
-                    && !pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered)
-            {
-                LOG(("\"Identity\" or \"Centered\" Scaling support not set"));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_UNPINNED
-                    && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_IDENTITY)
-            {
-                LOG(("unsupported rotation (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Rotation));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180
-                    || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270
-                    || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90)
-            {
-                LOG(("unsupported RotationSupport"));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (!pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity)
-            {
-                LOG(("\"Identity\" RotationSupport not set"));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx
-                    || pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy)
-            {
-                LOG(("Non-zero TLOffset: cx(%d), cy(%d)",
-                        pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx,
-                        pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx
-                    || pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy)
-            {
-                LOG(("Non-zero TLOffset: cx(%d), cy(%d)",
-                        pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx,
-                        pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_SRGB
-                    && pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_UNINITIALIZED)
-            {
-                LOG(("unsupported VidPnTargetColorBasis (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorBasis));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            /* channels?
-            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel;
-            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel;
-            pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel;
-            we definitely not support fourth channel
-            */
-            if (pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel)
-            {
-                LOG(("Non-zero FourthChannel (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            /* Content (D3DKMDT_VPPC_GRAPHICS, _NOTSPECIFIED, _VIDEO), does not matter for now
-            pNewVidPnPresentPathInfo->Content
-            */
-            /* not support copy protection for now */
-            if (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_NOPROTECTION
-                    && pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_UNINITIALIZED)
-            {
-                LOG(("Copy protection not supported CopyProtectionType(%d)", pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits)
-            {
-                LOG(("Copy protection not supported APSTriggerBits(%d)", pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT tstCPSupport = {0};
-            tstCPSupport.NoProtection = 1;
-            if (memcmp(&tstCPSupport, &pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, sizeof(tstCPSupport)))
-            {
-                LOG(("Copy protection support (0x%x)", *((UINT*)&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_DEFAULT
-                    && pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_UNINITIALIZED)
-            {
-                LOG(("Unsupported GammaRamp.Type (%d)", pNewVidPnPresentPathInfo->GammaRamp.Type));
-                AssertBreakpoint();
-                bSupported = FALSE;
-                break;
-            }
-
-            if (pNewVidPnPresentPathInfo->GammaRamp.DataSize != 0)
-            {
-                LOG(("Warning: non-zero GammaRamp.DataSize (%d), treating as supported", pNewVidPnPresentPathInfo->GammaRamp.DataSize));
-            }
-
-            const D3DKMDT_VIDPN_PRESENT_PATH *pNextVidPnPresentPathInfo;
-
-            Status = pVidPnTopologyInterface->pfnAcquireNextPathInfo(hVidPnTopology, pNewVidPnPresentPathInfo, &pNextVidPnPresentPathInfo);
-            pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
-            if (Status == STATUS_SUCCESS)
-            {
-                pNewVidPnPresentPathInfo = pNextVidPnPresentPathInfo;
-            }
-            else if (Status == STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET)
-            {
-                Status = STATUS_SUCCESS;
-                pNewVidPnPresentPathInfo = NULL;
-                break;
-            }
-            else
-            {
-                AssertBreakpoint();
-                LOG(("pfnAcquireNextPathInfo Failed Status(0x%x)", Status));
-                pNewVidPnPresentPathInfo = NULL;
-                break;
-            }
-        }
-
-        bSupported &= bFoundPrimary;
-
-        if (pNewVidPnPresentPathInfo)
-            pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNewVidPnPresentPathInfo);
-
-    }
-    else if (Status == STATUS_GRAPHICS_DATASET_IS_EMPTY)
-        Status = STATUS_SUCCESS;
-    else
-        LOGREL(("pfnAcquireFirstPathInfo failed Status(0x%x)", Status));
-
-    *pbSupported = bSupported;
-
-    return Status;
 }
 
@@ -643,6 +427,4 @@
                 Status = pMonitorSMSIf->pfnAddMode(hMonitorSMS, pMonitorSMI);
                 Assert(Status == STATUS_SUCCESS/* || Status == STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET*/);
-//                if (Status == STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET)
-//                    Status = STATUS_SUCCESS;
                 if (Status == STATUS_SUCCESS)
                     break;
@@ -658,4 +440,7 @@
             if (tmpStatus != STATUS_SUCCESS)
                 LOGREL(("pfnReleaseModeInfo failed tmpStatus(0x%x)", tmpStatus));
+
+            if (Status == STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET)
+                Status = STATUS_SUCCESS;
         } while (0);
     }
@@ -762,13 +547,13 @@
             {
                 D3DKMDT_2DREGION *pRes = &pResolutions[i];
-                VBOXVIDPNCHECKMONMODESENUM ChkInfo = {0};
-                ChkInfo.Region = *pRes;
-                Status = vboxVidPnEnumMonitorSourceModes(hMonitorSMS, pMonitorSMSIf,
-                        vboxFidPnCheckMonitorModesEnum, &ChkInfo);
-                Assert(Status == STATUS_SUCCESS);
-                if (Status == STATUS_SUCCESS)
-                {
-                    if (!ChkInfo.pMonitorSMI)
-                    {
+//                VBOXVIDPNCHECKMONMODESENUM ChkInfo = {0};
+//                ChkInfo.Region = *pRes;
+//                Status = vboxVidPnEnumMonitorSourceModes(hMonitorSMS, pMonitorSMSIf,
+//                        vboxFidPnCheckMonitorModesEnum, &ChkInfo);
+//                Assert(Status == STATUS_SUCCESS);
+//                if (Status == STATUS_SUCCESS)
+//                {
+//                    if (!ChkInfo.pMonitorSMI)
+//                    {
                         Status = vboxVidPnCreatePopulateMonitorSourceModeInfoFromLegacy(pDevExt,
                                 hMonitorSMS,
@@ -784,15 +569,15 @@
                             break;
                         }
-                    }
-                    else
-                    {
-                        pMonitorSMSIf->pfnReleaseModeInfo(hMonitorSMS, ChkInfo.pMonitorSMI);
-                    }
-                }
-                else
-                {
-                    LOGREL(("vboxVidPnEnumMonitorSourceModes failed Status(0x%x)", Status));
-                    break;
-                }
+//                    }
+//                    else
+//                    {
+//                        pMonitorSMSIf->pfnReleaseModeInfo(hMonitorSMS, ChkInfo.pMonitorSMI);
+//                    }
+//                }
+//                else
+//                {
+//                    LOGREL(("vboxVidPnEnumMonitorSourceModes failed Status(0x%x)", Status));
+//                    break;
+//                }
             }
             NTSTATUS tmpStatus = pMonitorInterface->pfnReleaseMonitorSourceModeSet(pDevExt->u.primary.DxgkInterface.DeviceHandle, hMonitorSMS);
@@ -1415,40 +1200,45 @@
         {
             Assert(hNewVidPnTargetModeSet);
-            for (uint32_t i = 0; i < pInfo->cResolutions; ++i)
-            {
-                D3DKMDT_2DREGION *pResolution = &pInfo->aResolutions[i];
-                if (pPinnedVidPnSourceModeInfo)
+            if (pCbContext->apPathInfos[VidPnSourceId].enmState == VBOXVIDPNPATHITEM_STATE_PRESENT)
+            {
+                Assert(VidPnSourceId == VidPnTargetId);
+
+                for (uint32_t i = 0; i < pInfo->cResolutions; ++i)
                 {
-                    if (pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx != pResolution->cx
-                            || pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy != pResolution->cy)
+                    D3DKMDT_2DREGION *pResolution = &pInfo->aResolutions[i];
+                    if (pPinnedVidPnSourceModeInfo)
                     {
-                        continue;
+                        if (pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cx != pResolution->cx
+                                || pPinnedVidPnSourceModeInfo->Format.Graphics.PrimSurfSize.cy != pResolution->cy)
+                        {
+                            continue;
+                        }
                     }
-                }
-
-                D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo;
-                Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo);
-                Assert(Status == STATUS_SUCCESS);
-                if (NT_SUCCESS(Status))
-                {
-                    Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution);
+
+                    D3DKMDT_VIDPN_TARGET_MODE *pNewVidPnTargetModeInfo;
+                    Status = pNewVidPnTargetModeSetInterface->pfnCreateNewModeInfo(hNewVidPnTargetModeSet, &pNewVidPnTargetModeInfo);
                     Assert(Status == STATUS_SUCCESS);
                     if (NT_SUCCESS(Status))
                     {
-                        Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);
+                        Status = vboxVidPnPopulateTargetModeInfoFromLegacy(pNewVidPnTargetModeInfo, pResolution);
                         Assert(Status == STATUS_SUCCESS);
                         if (NT_SUCCESS(Status))
                         {
-                            /* success */
-                            continue;
+                            Status = pNewVidPnTargetModeSetInterface->pfnAddMode(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);
+                            Assert(Status == STATUS_SUCCESS);
+                            if (NT_SUCCESS(Status))
+                            {
+                                /* success */
+                                continue;
+                            }
                         }
+
+                        NTSTATUS tmpStatus = pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);
+                        Assert(tmpStatus == STATUS_SUCCESS);
                     }
-
-                    NTSTATUS tmpStatus = pNewVidPnTargetModeSetInterface->pfnReleaseModeInfo(hNewVidPnTargetModeSet, pNewVidPnTargetModeInfo);
-                    Assert(tmpStatus == STATUS_SUCCESS);
+                    /* we're here because of an error */
+                    Assert(!NT_SUCCESS(Status));
+                    break;
                 }
-                /* we're here because of an error */
-                Assert(!NT_SUCCESS(Status));
-                break;
             }
         }
@@ -1535,40 +1325,44 @@
         {
             Assert(hNewVidPnSourceModeSet);
-            for (uint32_t i = 0; i < pInfo->cModes; ++i)
-            {
-                VIDEO_MODE_INFORMATION *pMode = &pInfo->aModes[i];
-                if (pPinnedVidPnTargetModeInfo)
+            if (pCbContext->apPathInfos[VidPnSourceId].enmState == VBOXVIDPNPATHITEM_STATE_PRESENT)
+            {
+                Assert(VidPnSourceId == VidPnTargetId);
+                for (uint32_t i = 0; i < pInfo->cModes; ++i)
                 {
-                    if (pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx != pMode->VisScreenWidth
-                            || pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy != pMode->VisScreenHeight)
+                    VIDEO_MODE_INFORMATION *pMode = &pInfo->aModes[i];
+                    if (pPinnedVidPnTargetModeInfo)
                     {
-                        continue;
+                        if (pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cx != pMode->VisScreenWidth
+                                || pPinnedVidPnTargetModeInfo->VideoSignalInfo.ActiveSize.cy != pMode->VisScreenHeight)
+                        {
+                            continue;
+                        }
                     }
-                }
-
-                D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo;
-                Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo);
-                Assert(Status == STATUS_SUCCESS);
-                if (NT_SUCCESS(Status))
-                {
-                    Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pNewVidPnSourceModeInfo, pMode);
+
+                    D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo;
+                    Status = pNewVidPnSourceModeSetInterface->pfnCreateNewModeInfo(hNewVidPnSourceModeSet, &pNewVidPnSourceModeInfo);
                     Assert(Status == STATUS_SUCCESS);
                     if (NT_SUCCESS(Status))
                     {
-                        Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
+                        Status = vboxVidPnPopulateSourceModeInfoFromLegacy(pNewVidPnSourceModeInfo, pMode);
                         Assert(Status == STATUS_SUCCESS);
                         if (NT_SUCCESS(Status))
                         {
-                            /* success */
-                            continue;
+                            Status = pNewVidPnSourceModeSetInterface->pfnAddMode(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
+                            Assert(Status == STATUS_SUCCESS);
+                            if (NT_SUCCESS(Status))
+                            {
+                                /* success */
+                                continue;
+                            }
                         }
+
+                        NTSTATUS tmpStatus = pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
+                        Assert(tmpStatus == STATUS_SUCCESS);
                     }
-
-                    NTSTATUS tmpStatus = pNewVidPnSourceModeSetInterface->pfnReleaseModeInfo(hNewVidPnSourceModeSet, pNewVidPnSourceModeInfo);
-                    Assert(tmpStatus == STATUS_SUCCESS);
+                    /* we're here because of an error */
+                    Assert(!NT_SUCCESS(Status));
+                    break;
                 }
-                /* we're here because of an error */
-                Assert(!NT_SUCCESS(Status));
-                break;
             }
         }
@@ -1689,4 +1483,248 @@
     Assert(Status == STATUS_SUCCESS);
     return Status == STATUS_SUCCESS;
+}
+
+static BOOLEAN vboxVidPnIsPathSupported(const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo)
+{
+    if (pNewVidPnPresentPathInfo->VidPnSourceId != pNewVidPnPresentPathInfo->VidPnTargetId)
+    {
+        WARN(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId));
+        return FALSE;
+    }
+
+    /*
+    ImportanceOrdinal does not matter for now
+    pNewVidPnPresentPathInfo->ImportanceOrdinal
+    */
+
+    if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_UNPINNED
+            && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY
+            && pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_NOTSPECIFIED)
+    {
+        WARN(("unsupported Scaling (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Scaling));
+        return FALSE;
+    }
+
+    if (    !pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Identity
+         || pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Centered
+         || pNewVidPnPresentPathInfo->ContentTransformation.ScalingSupport.Stretched)
+    {
+        WARN(("unsupported Scaling support"));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_UNPINNED
+            && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_IDENTITY
+            && pNewVidPnPresentPathInfo->ContentTransformation.Rotation != D3DKMDT_VPPR_NOTSPECIFIED)
+    {
+        WARN(("unsupported rotation (%d)", pNewVidPnPresentPathInfo->ContentTransformation.Rotation));
+        return FALSE;
+    }
+
+    if (    !pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Identity
+         || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate90
+         || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate180
+         || pNewVidPnPresentPathInfo->ContentTransformation.RotationSupport.Rotate270)
+    {
+        WARN(("unsupported RotationSupport"));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx
+            || pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy)
+    {
+        WARN(("Non-zero TLOffset: cx(%d), cy(%d)",
+                pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cx,
+                pNewVidPnPresentPathInfo->VisibleFromActiveTLOffset.cy));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx
+            || pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy)
+    {
+        WARN(("Non-zero TLOffset: cx(%d), cy(%d)",
+                pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cx,
+                pNewVidPnPresentPathInfo->VisibleFromActiveBROffset.cy));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_SRGB
+            && pNewVidPnPresentPathInfo->VidPnTargetColorBasis != D3DKMDT_CB_UNINITIALIZED)
+    {
+        WARN(("unsupported VidPnTargetColorBasis (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorBasis));
+        return FALSE;
+    }
+
+    /* channels?
+    pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FirstChannel;
+    pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.SecondChannel;
+    pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.ThirdChannel;
+    we definitely not support fourth channel
+    */
+    if (pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel)
+    {
+        WARN(("Non-zero FourthChannel (%d)", pNewVidPnPresentPathInfo->VidPnTargetColorCoeffDynamicRanges.FourthChannel));
+        return FALSE;
+    }
+
+    /* Content (D3DKMDT_VPPC_GRAPHICS, _NOTSPECIFIED, _VIDEO), does not matter for now
+    pNewVidPnPresentPathInfo->Content
+    */
+    /* not support copy protection for now */
+    if (pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_NOPROTECTION
+            && pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType != D3DKMDT_VPPMT_UNINITIALIZED)
+    {
+        WARN(("Copy protection not supported CopyProtectionType(%d)", pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionType));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits)
+    {
+        WARN(("Copy protection not supported APSTriggerBits(%d)", pNewVidPnPresentPathInfo->CopyProtection.APSTriggerBits));
+        return FALSE;
+    }
+
+    D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT tstCPSupport = {0};
+    tstCPSupport.NoProtection = 1;
+    if (memcmp(&tstCPSupport, &pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport, sizeof(tstCPSupport)))
+    {
+        WARN(("Copy protection support (0x%x)", *((UINT*)&pNewVidPnPresentPathInfo->CopyProtection.CopyProtectionSupport)));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_DEFAULT
+            && pNewVidPnPresentPathInfo->GammaRamp.Type != D3DDDI_GAMMARAMP_UNINITIALIZED)
+    {
+        WARN(("Unsupported GammaRamp.Type (%d)", pNewVidPnPresentPathInfo->GammaRamp.Type));
+        return FALSE;
+    }
+
+    if (pNewVidPnPresentPathInfo->GammaRamp.DataSize != 0)
+    {
+        WARN(("Warning: non-zero GammaRamp.DataSize (%d), treating as supported", pNewVidPnPresentPathInfo->GammaRamp.DataSize));
+    }
+
+    return TRUE;
+}
+
+typedef struct VBOXVIDPNGETPATHSINFO
+{
+    NTSTATUS Status;
+    BOOLEAN fBreakOnDisabled;
+    BOOLEAN fDisabledFound;
+    UINT cItems;
+    PVBOXVIDPNPATHITEM paItems;
+} VBOXVIDPNGETPATHSINFO, *PVBOXVIDPNGETPATHSINFO;
+
+static DECLCALLBACK(BOOLEAN) vboxVidPnCheckTopologyEnum(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
+        const D3DKMDT_VIDPN_PRESENT_PATH *pNewVidPnPresentPathInfo, PVOID pContext)
+{
+    PVBOXVIDPNGETPATHSINFO pCbContext = (PVBOXVIDPNGETPATHSINFO)pContext;
+    NTSTATUS Status = STATUS_SUCCESS;
+    CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId = pNewVidPnPresentPathInfo->VidPnSourceId;
+    CONST D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId = pNewVidPnPresentPathInfo->VidPnTargetId;
+    BOOLEAN fDisabledFound = !vboxVidPnIsPathSupported(pNewVidPnPresentPathInfo);
+    do
+    {
+        if (fDisabledFound)
+        {
+            if (pCbContext->cItems > VidPnSourceId)
+            {
+                pCbContext->paItems[VidPnSourceId].enmState = VBOXVIDPNPATHITEM_STATE_DISABLED;
+            }
+            else
+            {
+                AssertFailed();
+                Status = STATUS_BUFFER_OVERFLOW;
+                break;
+            }
+
+            if (pCbContext->cItems > VidPnTargetId)
+            {
+                pCbContext->paItems[VidPnTargetId].enmState = VBOXVIDPNPATHITEM_STATE_DISABLED;
+            }
+            else
+            {
+                AssertFailed();
+                Status = STATUS_BUFFER_OVERFLOW;
+                break;
+            }
+
+            break;
+        }
+
+        /* VidPnSourceId == VidPnTargetId */
+        if (pCbContext->cItems > VidPnSourceId)
+        {
+            if (pCbContext->paItems[VidPnSourceId].enmState != VBOXVIDPNPATHITEM_STATE_DISABLED)
+            {
+                Assert(pCbContext->paItems[VidPnSourceId].enmState == VBOXVIDPNPATHITEM_STATE_NOT_EXISTS);
+                pCbContext->paItems[VidPnSourceId].enmState = VBOXVIDPNPATHITEM_STATE_PRESENT;
+            }
+        }
+        else
+        {
+            AssertFailed();
+            Status = STATUS_BUFFER_OVERFLOW;
+            break;
+        }
+    } while (0);
+
+    pCbContext->fDisabledFound |= fDisabledFound;
+    pCbContext->Status = Status;
+    if (!NT_SUCCESS(Status))
+        return FALSE; /* do not continue on failure */
+
+    return !fDisabledFound || !pCbContext->fBreakOnDisabled;
+}
+
+/* we currently support only 0 -> 0, 1 -> 1, 2 -> 2 paths, AND 0 -> 0 must be present
+ * this routine disables all paths unsupported */
+NTSTATUS vboxVidPnCheckTopology(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
+                                    BOOLEAN fBreakOnDisabled, UINT cItems, PVBOXVIDPNPATHITEM paItems, BOOLEAN *pfDisabledFound)
+{
+    UINT i;
+    for (i = 0; i < cItems; ++i)
+    {
+        paItems[i].enmState = VBOXVIDPNPATHITEM_STATE_NOT_EXISTS;
+    }
+    VBOXVIDPNGETPATHSINFO CbContext = {};
+    CbContext.Status = STATUS_SUCCESS;
+    CbContext.fBreakOnDisabled = fBreakOnDisabled;
+    CbContext.fDisabledFound = FALSE;
+    CbContext.cItems = cItems;
+    CbContext.paItems = paItems;
+    NTSTATUS Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface, vboxVidPnCheckTopologyEnum, &CbContext);
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("vboxVidPnEnumPaths failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    Status = CbContext.Status;
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("vboxVidPnCheckTopologyEnum returned failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    if (pfDisabledFound)
+        *pfDisabledFound = CbContext.fDisabledFound;
+
+    if (!fBreakOnDisabled)
+    {
+        /* now check if 0->0 path is present and enabled, and if not, disable everything */
+        if (cItems && paItems[0].enmState != VBOXVIDPNPATHITEM_STATE_PRESENT)
+        {
+            LOGREL(("path 0 not set to present\n"));
+            for (i = 0; i < cItems; ++i)
+            {
+                if (paItems[i].enmState == VBOXVIDPNPATHITEM_STATE_PRESENT)
+                    paItems[i].enmState = VBOXVIDPNPATHITEM_STATE_DISABLED;
+            }
+        }
+    }
+
+    return Status;
 }
 
@@ -1901,5 +1939,4 @@
             if (!pfnCallback(hVidPnTopology, pVidPnTopologyInterface, pNewVidPnPresentPathInfo, pContext))
             {
-                Assert(Status == STATUS_SUCCESS);
                 if (Status == STATUS_SUCCESS)
                     pVidPnTopologyInterface->pfnReleasePathInfo(hVidPnTopology, pNextVidPnPresentPathInfo);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h	(revision 37194)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.h	(revision 37207)
@@ -23,8 +23,4 @@
 #define VBOXVDPN_C_DISPLAY_VBLANK_SIZE 180
 
-NTSTATUS vboxVidPnCheckTopology(PVBOXMP_DEVEXT pDevExt, const D3DKMDT_HVIDPN hDesiredVidPn,
-        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
-        BOOLEAN *pbSupported);
-
 NTSTATUS vboxVidPnCheckSourceModeInfo(const D3DKMDT_HVIDPN hDesiredVidPn,
         const D3DKMDT_VIDPN_SOURCE_MODE *pNewVidPnSourceModeInfo,
@@ -43,4 +39,16 @@
         BOOLEAN *pbSupported);
 
+typedef enum
+{
+    VBOXVIDPNPATHITEM_STATE_NOT_EXISTS = 0,
+    VBOXVIDPNPATHITEM_STATE_PRESENT,
+    VBOXVIDPNPATHITEM_STATE_DISABLED
+} VBOXVIDPNPATHITEM_STATE;
+
+typedef struct VBOXVIDPNPATHITEM
+{
+    VBOXVIDPNPATHITEM_STATE enmState;
+} VBOXVIDPNPATHITEM, *PVBOXVIDPNPATHITEM;
+
 typedef struct VBOXVIDPNCOFUNCMODALITY
 {
@@ -50,4 +58,6 @@
     CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* pEnumCofuncModalityArg;
     PVBOXWDDM_VIDEOMODES_INFO pInfos;
+    UINT cPathInfos;
+    PVBOXVIDPNPATHITEM apPathInfos;
 } VBOXVIDPNCOFUNCMODALITY, *PVBOXVIDPNCOFUNCMODALITY;
 
@@ -133,4 +143,7 @@
 NTSTATUS vboxVidPnCofuncModalityForPath(PVBOXVIDPNCOFUNCMODALITY pCbContext, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId);
 
+NTSTATUS vboxVidPnCheckTopology(D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology, const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface,
+                                    BOOLEAN fBreakOnDisabled, UINT cItems, PVBOXVIDPNPATHITEM paItems, BOOLEAN *pfDisabledFound);
+
 void vboxVidPnDumpVidPn(const char * pPrefix, PVBOXMP_DEVEXT pDevExt, D3DKMDT_HVIDPN hVidPn, const DXGK_VIDPN_INTERFACE* pVidPnInterface, const char * pSuffix);
 void vboxVidPnDumpCofuncModalityArg(const char *pPrefix, CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST  pEnumCofuncModalityArg, const char *pSuffix);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 37194)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 37207)
@@ -1110,5 +1110,5 @@
         ChildRelations[i].ChildCapabilities.Type.VideoOutput.SupportsSdtvModes = FALSE;
         ChildRelations[i].ChildCapabilities.HpdAwareness = HpdAwarenessAlwaysConnected; //HpdAwarenessInterruptible; /* ?? HpdAwarenessAlwaysConnected; */
-        ChildRelations[i].AcpiUid =  i; /* */
+        ChildRelations[i].AcpiUid =  0; /* */
         ChildRelations[i].ChildUid = i; /* should be == target id */
     }
@@ -3506,102 +3506,42 @@
     NTSTATUS Status = STATUS_SUCCESS;
     BOOLEAN bSupported = TRUE;
-#if 1
-    /* always report it as supported and let DxgkDdiEnumVidPnCofuncModality deal with support info */
-#else
+
     PVBOXMP_DEVEXT pContext = (PVBOXMP_DEVEXT)hAdapter;
     const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL;
     Status = pContext->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pIsSupportedVidPnArg->hDesiredVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
-    if (Status == STATUS_SUCCESS)
-    {
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("DxgkCbQueryVidPnInterface failed Status()0x%x\n", Status));
+        return Status;
+    }
+
 #ifdef VBOXWDDM_DEBUG_VIDPN
-        vboxVidPnDumpVidPn("\n>>>>IS SUPPORTED VidPN : >>>>", pContext, pIsSupportedVidPnArg->hDesiredVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<");
-#endif
-
-        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
-        const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
-        Status = pVidPnInterface->pfnGetTopology(pIsSupportedVidPnArg->hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
-        if (Status == STATUS_SUCCESS)
-        {
-            Status = vboxVidPnCheckTopology(pContext, pIsSupportedVidPnArg->hDesiredVidPn, hVidPnTopology, pVidPnTopologyInterface, &bSupported);
-            if (Status == STATUS_SUCCESS && bSupported)
-            {
-#if 0
-                for (int id = 0; id < VBoxCommonFromDeviceExt(pContext)->cDisplays; ++id)
-                {
-                    D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
-                    const DXGK_VIDPNSOURCEMODESET_INTERFACE *pVidPnSourceModeSetInterface;
-                    Status = pVidPnInterface->pfnAcquireSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn,
-                                    id,
-                                    &hNewVidPnSourceModeSet,
-                                    &pVidPnSourceModeSetInterface);
-                    if (Status == STATUS_SUCCESS)
-                    {
-                        Status = vboxVidPnCheckSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnSourceModeSet, pVidPnSourceModeSetInterface, &bSupported);
-
-                        Assert(bSupported);
-
-                        pVidPnInterface->pfnReleaseSourceModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnSourceModeSet);
-
-                        if (Status != STATUS_SUCCESS || !bSupported)
-                            break;
-                    }
-                    else if (Status == STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE)
-                    {
-                        LOGREL(("Warning: pfnAcquireSourceModeSet returned STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, continuing"));
-                        Status = STATUS_SUCCESS;
-                    }
-                    else
-                    {
-                        LOGREL(("pfnAcquireSourceModeSet failed Status(0x%x)"));
-                        break;
-                    }
-                }
-
-                if (Status == STATUS_SUCCESS && bSupported)
-                {
-                    for (int id = 0; id < VBoxCommonFromDeviceExt(pContext)->cDisplays; ++id)
-                    {
-                        D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
-                        CONST DXGK_VIDPNTARGETMODESET_INTERFACE *pVidPnTargetModeSetInterface;
-                        Status = pVidPnInterface->pfnAcquireTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn,
-                                        id, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId */
-                                        &hNewVidPnTargetModeSet,
-                                        &pVidPnTargetModeSetInterface);
-                        if (Status == STATUS_SUCCESS)
-                        {
-                            Status = vboxVidPnCheckTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnTargetModeSet, pVidPnTargetModeSetInterface, &bSupported);
-
-                            Assert(bSupported);
-
-                            pVidPnInterface->pfnReleaseTargetModeSet(pIsSupportedVidPnArg->hDesiredVidPn, hNewVidPnTargetModeSet);
-
-                            if (Status != STATUS_SUCCESS || !bSupported)
-                                break;
-                        }
-                        else if (Status == STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE)
-                        {
-                            LOGREL(("Warning: pfnAcquireSourceModeSet returned STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, continuing"));
-                            Status = STATUS_SUCCESS;
-                        }
-                        else
-                        {
-                            LOGREL(("pfnAcquireSourceModeSet failed Status(0x%x)"));
-                            break;
-                        }
-                    }
-                }
-#endif
-            }
-        }
-        else
-        {
-            LOGREL(("pfnGetTopology failed Status(0x%x)"));
-        }
-    }
-    else
-    {
-        LOGREL(("DxgkCbQueryVidPnInterface failed Status(0x%x)"));
-    }
-#endif /* if 0 */
+    vboxVidPnDumpVidPn("\n>>>>IS SUPPORTED VidPN : >>>>", pContext, pIsSupportedVidPnArg->hDesiredVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<");
+#endif
+
+    D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
+    const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
+    Status = pVidPnInterface->pfnGetTopology(pIsSupportedVidPnArg->hDesiredVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("pfnGetTopology failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    VBOXVIDPNPATHITEM aItems[VBOX_VIDEO_MAX_SCREENS];
+    BOOLEAN fDisabledFound = FALSE;
+    Status = vboxVidPnCheckTopology(hVidPnTopology, pVidPnTopologyInterface, TRUE /* fBreakOnDisabled */, RT_ELEMENTS(aItems), aItems, &fDisabledFound);
+    Assert(Status == STATUS_SUCCESS);
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("vboxVidPnCheckTopology failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    if (fDisabledFound)
+    {
+        WARN(("found unsupported path"));
+        bSupported = FALSE;
+    }
 
     pIsSupportedVidPnArg->IsVidPnSupported = bSupported;
@@ -3634,5 +3574,5 @@
     PVBOXWDDM_RECOMMENDVIDPN pVidPnInfo = pRecommendFunctionalVidPnArg->PrivateDriverDataSize >= sizeof (VBOXWDDM_RECOMMENDVIDPN) ?
             (PVBOXWDDM_RECOMMENDVIDPN)pRecommendFunctionalVidPnArg->pPrivateDriverData : NULL;
-    PVBOXWDDM_VIDEOMODES_INFO pInfos = VBoxWddmUpdateVideoModesInfo(pDevExt, pVidPnInfo);
+    PVBOXWDDM_VIDEOMODES_INFO pInfos = VBoxWddmUpdateVideoModesInfo(pDevExt, NULL /*pVidPnInfo*/);
     const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL;
     Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pRecommendFunctionalVidPnArg->hRecommendedFunctionalVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
@@ -3742,57 +3682,60 @@
     const DXGK_VIDPN_INTERFACE* pVidPnInterface = NULL;
     NTSTATUS Status = pDevExt->u.primary.DxgkInterface.DxgkCbQueryVidPnInterface(pEnumCofuncModalityArg->hConstrainingVidPn, DXGK_VIDPN_INTERFACE_VERSION_V1, &pVidPnInterface);
-    if (Status == STATUS_SUCCESS)
-    {
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("DxgkCbQueryVidPnInterface failed Status()0x%x\n", Status));
+        return Status;
+    }
 #ifdef VBOXWDDM_DEBUG_VIDPN
-        vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", pEnumCofuncModalityArg, "\n");
-        vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n");
-#endif
-
-        D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
-        const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
-        NTSTATUS Status = pVidPnInterface->pfnGetTopology(pEnumCofuncModalityArg->hConstrainingVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
-        Assert(Status == STATUS_SUCCESS);
-        if (Status == STATUS_SUCCESS)
-        {
-            BOOLEAN bSupported = FALSE;
-            Status = vboxVidPnCheckTopology(pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, hVidPnTopology, pVidPnTopologyInterface, &bSupported);
-            Assert(Status == STATUS_SUCCESS);
-            Assert(bSupported);
-
-            VBOXVIDPNCOFUNCMODALITY CbContext = {0};
-            CbContext.pDevExt = pDevExt;
-            CbContext.pVidPnInterface = pVidPnInterface;
-            CbContext.pEnumCofuncModalityArg = pEnumCofuncModalityArg;
-            CbContext.pInfos = VBoxWddmGetAllVideoModesInfos(pDevExt);
-
-#if 0
-            for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
-            {
-                vboxVidPnCofuncModalityForPath(&CbContext, i, i, TRUE);
-            }
-#else
-            Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface,
+    vboxVidPnDumpCofuncModalityArg(">>>>MODALITY Args: ", pEnumCofuncModalityArg, "\n");
+    vboxVidPnDumpVidPn(">>>>MODALITY VidPN (IN) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n");
+#endif
+
+    D3DKMDT_HVIDPNTOPOLOGY hVidPnTopology;
+    const DXGK_VIDPNTOPOLOGY_INTERFACE* pVidPnTopologyInterface;
+    Status = pVidPnInterface->pfnGetTopology(pEnumCofuncModalityArg->hConstrainingVidPn, &hVidPnTopology, &pVidPnTopologyInterface);
+    Assert(Status == STATUS_SUCCESS);
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("pfnGetTopology failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    VBOXVIDPNPATHITEM aItems[VBOX_VIDEO_MAX_SCREENS];
+    Status = vboxVidPnCheckTopology(hVidPnTopology, pVidPnTopologyInterface, FALSE /* fBreakOnDisabled */, RT_ELEMENTS(aItems), aItems, NULL /* *pfDisabledFound */);
+    Assert(Status == STATUS_SUCCESS);
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("vboxVidPnCheckTopology failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    VBOXVIDPNCOFUNCMODALITY CbContext = {0};
+    CbContext.pDevExt = pDevExt;
+    CbContext.pVidPnInterface = pVidPnInterface;
+    CbContext.pEnumCofuncModalityArg = pEnumCofuncModalityArg;
+    CbContext.pInfos = VBoxWddmGetAllVideoModesInfos(pDevExt);
+    CbContext.cPathInfos = RT_ELEMENTS(aItems);
+    CbContext.apPathInfos = aItems;
+
+    Status = vboxVidPnEnumPaths(hVidPnTopology, pVidPnTopologyInterface,
                     vboxVidPnCofuncModalityPathEnum, &CbContext);
-            Assert(Status == STATUS_SUCCESS);
-            if (Status == STATUS_SUCCESS)
-            {
-                Status = CbContext.Status;
-                Assert(Status == STATUS_SUCCESS);
-                if (Status != STATUS_SUCCESS)
-                    LOGREL(("vboxVidPnAdjustSourcesTargetsCallback failed Status(0x%x)", Status));
-            }
-            else
-                LOGREL(("vboxVidPnEnumPaths failed Status(0x%x)", Status));
-#endif
-        }
-        else
-            LOGREL(("pfnGetTopology failed Status(0x%x)", Status));
+    Assert(Status == STATUS_SUCCESS);
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("vboxVidPnEnumPaths failed Status()0x%x\n", Status));
+        return Status;
+    }
+
+    Status = CbContext.Status;
+    if (!NT_SUCCESS(Status))
+    {
+        WARN(("vboxVidPnCofuncModalityPathEnum failed Status()0x%x\n", Status));
+        return Status;
+    }
 
 #ifdef VBOXWDDM_DEBUG_VIDPN
         vboxVidPnDumpVidPn("\n>>>>MODALITY VidPN (OUT) : >>>>\n", pDevExt, pEnumCofuncModalityArg->hConstrainingVidPn, pVidPnInterface, "<<<<<<<<<<<<<<<<<<<<\n\n");
 #endif
-    }
-    else
-        LOGREL(("DxgkCbQueryVidPnInterface failed Status(0x%x)", Status));
 
     LOGF(("LEAVE, status(0x%x), context(0x%x)", Status, hAdapter));
