Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp	(revision 27218)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVidPn.cpp	(revision 27219)
@@ -35,5 +35,6 @@
         */
 
-        if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY
+        if (pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_UNPINNED
+                || pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_IDENTITY
                 || pNewVidPnPresentPathInfo->ContentTransformation.Scaling != D3DKMDT_VPPS_CENTERED)
         {
@@ -658,49 +659,48 @@
             CONST D3DKMDT_VIDPN_SOURCE_MODE* pPinnedVidPnSourceModeInfo;
             Status = pCurVidPnSourceModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnSourceModeSet, &pPinnedVidPnSourceModeInfo);
-            Assert(Status == STATUS_SUCCESS);
+            Assert(Status == STATUS_SUCCESS || Status == STATUS_GRAPHICS_MODE_NOT_PINNED);
             if (Status == STATUS_SUCCESS)
             {
-                if (!pPinnedVidPnSourceModeInfo)
-                {
-                    /* just create and populate the new source mode set for now */
-                    D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
-                    const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface;
-                    Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn,
+                Assert (pPinnedVidPnSourceModeInfo);
+                /* release */
+                pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
+
+            }
+            else if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED)
+            {
+                /* just create and populate the new source mode set for now */
+                D3DKMDT_HVIDPNSOURCEMODESET hNewVidPnSourceModeSet;
+                const DXGK_VIDPNSOURCEMODESET_INTERFACE *pNewVidPnSourceModeSetInterface;
+                Status = pVidPnInterface->pfnCreateNewSourceModeSet(hDesiredVidPn,
                                     pNewVidPnPresentPathInfo->VidPnSourceId, /*__in CONST D3DDDI_VIDEO_PRESENT_SOURCE_ID  VidPnSourceId */
                                     &hNewVidPnSourceModeSet,
                                     &pNewVidPnSourceModeSetInterface);
+                Assert(Status == STATUS_SUCCESS);
+                if (Status == STATUS_SUCCESS)
+                {
+                    Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt,
+                                hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface,
+                                pModes, cModes, iPreferredMode);
                     Assert(Status == STATUS_SUCCESS);
                     if (Status == STATUS_SUCCESS)
                     {
-                        Status = vboxVidPnPopulateSourceModeSetFromLegacy(pDevExt,
-                                hNewVidPnSourceModeSet, pNewVidPnSourceModeSetInterface,
-                                pModes, cModes, iPreferredMode);
-                        Assert(Status == STATUS_SUCCESS);
-                        if (Status == STATUS_SUCCESS)
-                        {
-                            Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn,
+                        Status = pVidPnInterface->pfnAssignSourceModeSet(hDesiredVidPn,
                                     pNewVidPnPresentPathInfo->VidPnSourceId,
                                     hNewVidPnSourceModeSet);
-                            Assert(Status == STATUS_SUCCESS);
-                            if(Status != STATUS_SUCCESS)
-                            {
-                                drprintf((__FUNCTION__": pfnAssignSourceModeSet failed Status(0x%x)\n", Status));
-                                pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
-                            }
-                        }
-                        else
+                        Assert(Status == STATUS_SUCCESS);
+                        if(Status != STATUS_SUCCESS)
                         {
-                            drprintf((__FUNCTION__": vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status));
+                            drprintf((__FUNCTION__": pfnAssignSourceModeSet failed Status(0x%x)\n", Status));
                             pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
                         }
                     }
                     else
-                        drprintf((__FUNCTION__": pfnCreateNewSourceModeSet failed Status(0x%x)\n", Status));
+                    {
+                        drprintf((__FUNCTION__": vboxVidPnPopulateSourceModeSetFromLegacy failed Status(0x%x)\n", Status));
+                        pVidPnInterface->pfnReleaseSourceModeSet(hDesiredVidPn, hNewVidPnSourceModeSet);
+                    }
                 }
                 else
-                {
-                    /* release */
-                    pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
-                }
+                    drprintf((__FUNCTION__": pfnCreateNewSourceModeSet failed Status(0x%x)\n", Status));
             }
             else
@@ -732,46 +732,44 @@
                 CONST D3DKMDT_VIDPN_TARGET_MODE* pPinnedVidPnTargetModeInfo;
                 Status = pCurVidPnTargetModeSetInterface->pfnAcquirePinnedModeInfo(hCurVidPnTargetModeSet, &pPinnedVidPnTargetModeInfo);
-                Assert(Status == STATUS_SUCCESS);
+                Assert(Status == STATUS_SUCCESS || Status == STATUS_GRAPHICS_MODE_NOT_PINNED);
                 if (Status == STATUS_SUCCESS)
                 {
-                    if (!pPinnedVidPnTargetModeInfo)
-                    {
-                        /* just create and populate a new target mode info for now */
-                        D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
-                        const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface;
-                        Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn,
+                    Assert (pPinnedVidPnTargetModeInfo);
+                    /* nothing to be done here, just release */
+                    pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo);
+                }
+                else if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED)
+                {
+                    /* just create and populate a new target mode info for now */
+                    D3DKMDT_HVIDPNTARGETMODESET hNewVidPnTargetModeSet;
+                    const DXGK_VIDPNTARGETMODESET_INTERFACE *pNewVidPnTargetModeSetInterface;
+                    Status = pVidPnInterface->pfnCreateNewTargetModeSet(hDesiredVidPn,
                                         pNewVidPnPresentPathInfo->VidPnTargetId, /*__in CONST D3DDDI_VIDEO_PRESENT_TARGET_ID  VidPnTargetId */
                                         &hNewVidPnTargetModeSet,
                                         &pNewVidPnTargetModeSetInterface);
+                    Assert(Status == STATUS_SUCCESS);
+                    if (Status == STATUS_SUCCESS)
+                    {
+                        Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt,
+                                    hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface,
+                                    pResolutions, cResolutions, &pModes[iPreferredMode]);
                         Assert(Status == STATUS_SUCCESS);
                         if (Status == STATUS_SUCCESS)
                         {
-                            Status = vboxVidPnPopulateTargetModeSetFromLegacy(pDevExt,
-                                    hNewVidPnTargetModeSet, pNewVidPnTargetModeSetInterface,
-                                    pResolutions, cResolutions, &pModes[iPreferredMode]);
-                            Assert(Status == STATUS_SUCCESS);
-                            if (Status == STATUS_SUCCESS)
-                            {
-                                Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn,
+                            Status = pVidPnInterface->pfnAssignTargetModeSet(hDesiredVidPn,
                                         pNewVidPnPresentPathInfo->VidPnTargetId,
                                         hNewVidPnTargetModeSet);
-                                Assert(Status == STATUS_SUCCESS);
-                                if(Status != STATUS_SUCCESS)
-                                {
-                                    drprintf((__FUNCTION__": pfnAssignTargetModeSet failed Status(0x%x)\n", Status));
-                                    pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
-                                }
-                            }
-                            else
+                            Assert(Status == STATUS_SUCCESS);
+                            if(Status != STATUS_SUCCESS)
                             {
-                                drprintf((__FUNCTION__": vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status));
+                                drprintf((__FUNCTION__": pfnAssignTargetModeSet failed Status(0x%x)\n", Status));
                                 pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
                             }
                         }
-                    }
-                    else
-                    {
-                        /* nothing to be done here, just release */
-                        pCurVidPnTargetModeSetInterface->pfnReleaseModeInfo(hCurVidPnTargetModeSet, pPinnedVidPnTargetModeInfo);
+                        else
+                        {
+                            drprintf((__FUNCTION__": vboxVidPnPopulateTargetModeSetFromLegacy failed Status(0x%x)\n", Status));
+                            pVidPnInterface->pfnReleaseTargetModeSet(hDesiredVidPn, hNewVidPnTargetModeSet);
+                        }
                     }
                 }
@@ -963,16 +961,13 @@
         {
             Assert(pPinnedVidPnSourceModeInfo);
-            if (pPinnedVidPnSourceModeInfo)
-            {
-                Status = vboxVidPnCommitSourceMode(pDevExt, pPinnedVidPnSourceModeInfo, pAllocation);
-                Assert(Status == STATUS_SUCCESS);
-                if (Status != STATUS_SUCCESS)
-                    drprintf((__FUNCTION__": vboxVidPnCommitSourceMode failed Status(0x%x)\n", Status));
-                /* release */
-                pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
-            }
-            else
-                drprintf((__FUNCTION__": no pPinnedVidPnSourceModeInfo available for source id (%d)\n", srcId));
-        }
+            Status = vboxVidPnCommitSourceMode(pDevExt, pPinnedVidPnSourceModeInfo, pAllocation);
+            Assert(Status == STATUS_SUCCESS);
+            if (Status != STATUS_SUCCESS)
+                drprintf((__FUNCTION__": vboxVidPnCommitSourceMode failed Status(0x%x)\n", Status));
+            /* release */
+            pCurVidPnSourceModeSetInterface->pfnReleaseModeInfo(hCurVidPnSourceModeSet, pPinnedVidPnSourceModeInfo);
+        }
+        else if (Status == STATUS_GRAPHICS_MODE_NOT_PINNED)
+            drprintf((__FUNCTION__": no pPinnedVidPnSourceModeInfo available for source id (%d)\n", srcId));
         else
             drprintf((__FUNCTION__": pfnAcquirePinnedModeInfo failed Status(0x%x)\n", Status));
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp	(revision 27218)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp	(revision 27219)
@@ -1094,5 +1094,5 @@
     PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
 
-    vboxVDbgBreakF();
+    vboxVDbgBreakFv();
 
     switch (pQueryAdapterInfo->Type)
@@ -1377,5 +1377,5 @@
     dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
 
-    AssertBreakpoint();
+    vboxVDbgBreakF();
 
     NTSTATUS Status = STATUS_SUCCESS;
@@ -1434,5 +1434,6 @@
     dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
 
-    AssertBreakpoint();
+    vboxVDbgBreakF();
+
     PVBOXWDDM_ALLOCATION pAllocation = (PVBOXWDDM_ALLOCATION)pDescribeAllocation->hAllocation;
     pDescribeAllocation->Width = pAllocation->u.SurfInfo.width;
@@ -1463,5 +1464,5 @@
     dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
 
-    AssertBreakpoint();
+    vboxVDbgBreakF();
 
     NTSTATUS Status = STATUS_SUCCESS;
@@ -1693,4 +1694,7 @@
 }
 
+/*
+ * DxgkDdiBuildPagingBuffer
+ */
 NTSTATUS
 APIENTRY
@@ -1702,5 +1706,5 @@
     PAGED_CODE();
 
-    AssertBreakpoint();
+    vboxVDbgBreakF();
 
     NTSTATUS Status = STATUS_SUCCESS;
@@ -1857,5 +1861,5 @@
     dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
 
-    AssertBreakpoint();
+    vboxVDbgBreakF();
 
     PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
@@ -2153,4 +2157,6 @@
     dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", hAdapter));
 
+    vboxVDbgBreakF();
+
     PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)hAdapter;
 
@@ -2468,5 +2474,5 @@
     dfprintf(("==> "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
 
-    vboxVDbgBreakF();
+    vboxVDbgBreakFv();
 
     dfprintf(("<== "__FUNCTION__ ", hAdapter(0x%x)\n", hAdapter));
@@ -2558,4 +2564,7 @@
 }
 
+/*
+ * DxgkDdiOpenAllocation
+ */
 NTSTATUS
 APIENTRY
@@ -2569,5 +2578,5 @@
     dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice));
 
-    AssertBreakpoint();
+    vboxVDbgBreakF();
 
     NTSTATUS Status = STATUS_SUCCESS;
@@ -2863,5 +2872,5 @@
     dfprintf(("==> "__FUNCTION__ ", hDevice(0x%x)\n", hDevice));
 
-    vboxVDbgBreakF();
+    vboxVDbgBreakFv();
 
     NTSTATUS Status = STATUS_SUCCESS;
@@ -2870,4 +2879,5 @@
 
     pContext->pDevice = pDevice;
+    pContext->hContext = pCreateContext->hContext;
     pContext->EngineAffinity = pCreateContext->EngineAffinity;
     pContext->NodeOrdinal = pCreateContext->NodeOrdinal;
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h	(revision 27218)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.h	(revision 27219)
@@ -115,4 +115,5 @@
 {
     struct VBOXWDDM_DEVICE * pDevice;
+    HANDLE hContext;
     VBOXWDDM_CONTEXT_TYPE enmType;
     UINT  NodeOrdinal;
