Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.cpp	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.cpp	(revision 34345)
@@ -224,5 +224,7 @@
             Assert(hr == S_OK || hr == S_FALSE);
             if (hr == S_OK || hr != S_FALSE)
+            {
                 return hr;
+            }
 
             pSession->bQueryMp = false;
@@ -257,2 +259,19 @@
     return vboxDispCmSessionCmdGet(&g_pVBoxCmMgr.Session, pCmd, cbCmd, dwMilliseconds);
 }
+
+void vboxDispCmLog(LPCSTR pszMsg)
+{
+    PVBOXDISPCM_SESSION pSession = &g_pVBoxCmMgr.Session;
+
+    EnterCriticalSection(&pSession->CritSect);
+    /* use any context for identifying the kernel CmSession. We're using the first one */
+    PVBOXWDDMDISP_CONTEXT pContext = RTListNodeGetFirst(&pSession->CtxList, VBOXWDDMDISP_CONTEXT, ListNode);
+    Assert(pContext);
+    if (pContext)
+    {
+        PVBOXWDDMDISP_DEVICE pDevice = pContext->pDevice;
+        Assert(pDevice);
+        vboxVDbgMpPrint((pDevice, pszMsg));
+    }
+    LeaveCriticalSection(&pSession->CritSect);
+}
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.h	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispCm.h	(revision 34345)
@@ -27,3 +27,5 @@
 HRESULT vboxDispCmCmdGet(PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD pCmd, uint32_t cbCmd, DWORD dwMilliseconds);
 
+void vboxDispCmLog(LPCSTR pszMsg);
+
 #endif /* #ifdef ___VBoxDispCm_h___ */
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 34345)
@@ -3596,5 +3596,5 @@
             Assert(hr == S_OK);
 
-//            vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));
+//            vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));
         }
         else
@@ -3631,5 +3631,5 @@
         Assert(hr == S_OK);
 
-//        vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitive\n"));
+//        vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitive\n"));
 #if 0
         IDirect3DVertexDeclaration9* pDecl;
@@ -3997,5 +3997,5 @@
             if (pDevice->aStreamSource[stream]->LockInfo.cLocks)
             {
-//                vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));
+//                vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitiveUP\n"));
 
                 Assert(pLock->fFlags.MightDrawFromLocked && (pLock->fFlags.Discard || pLock->fFlags.NoOverwrite));
@@ -4009,5 +4009,5 @@
             else
             {
-//                vboxVDbgMpPrint((pDevice, __FUNCTION__": DrawPrimitive\n"));
+//                vboxVDbgMpPrintF((pDevice, __FUNCTION__": DrawPrimitive\n"));
 
                 hr = pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset/pDevice->StreamSourceInfo[stream].uiStride, pData->PrimitiveCount);
@@ -8143,5 +8143,5 @@
     if (pPrefix)
     {
-        vboxVDbgMpPrint((pDevice, "%s", pPrefix));
+        vboxVDbgMpPrintF((pDevice, "%s", pPrefix));
     }
 
@@ -8161,9 +8161,9 @@
 //        Assert(bpp == pAlloc->SurfDesc.bpp);
 //        Assert(pAlloc->SurfDesc.pitch == Lr.Pitch);
-        vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
+        vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
                 Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch));
         if (pRect)
         {
-            vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
+            vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
                     ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3),
                     pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch));
@@ -8176,5 +8176,5 @@
     if (pSuffix)
     {
-        vboxVDbgMpPrint((pDevice, "%s\n", pSuffix));
+        vboxVDbgMpPrintF((pDevice, "%s\n", pSuffix));
     }
 }
@@ -8184,5 +8184,5 @@
     if (pPrefix)
     {
-        vboxVDbgMpPrint((pDevice, "%s", pPrefix));
+        vboxVDbgMpPrintF((pDevice, "%s", pPrefix));
     }
 
@@ -8213,9 +8213,9 @@
 //        Assert(bpp == pAlloc->SurfDesc.bpp);
 //        Assert(pAlloc->SurfDesc.pitch == Lr.Pitch);
-        vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
+        vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
                 LockData.pData, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, pAlloc->SurfDesc.pitch));
         if (pRect)
         {
-            vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
+            vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
                     ((uint8_t*)LockData.pData) + (pRect->top * pAlloc->SurfDesc.pitch) + ((pRect->left * bpp) >> 3),
                     pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, pAlloc->SurfDesc.pitch));
@@ -8233,5 +8233,5 @@
     if (pSuffix)
     {
-        vboxVDbgMpPrint((pDevice, "%s\n", pSuffix));
+        vboxVDbgMpPrintF((pDevice, "%s\n", pSuffix));
     }
 }
@@ -8242,5 +8242,5 @@
     if (pPrefix)
     {
-        vboxVDbgMpPrint((pDevice, "%s", pPrefix));
+        vboxVDbgMpPrintF((pDevice, "%s", pPrefix));
     }
 
@@ -8272,9 +8272,9 @@
 //        Assert(bpp == pAlloc->SurfDesc.bpp);
 //        Assert(pAlloc->SurfDesc.pitch == Lr.Pitch);
-        vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
+        vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
                 Lr.pBits, pAlloc->D3DWidth, pAlloc->SurfDesc.height, bpp, Lr.Pitch));
         if (pRect)
         {
-            vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
+            vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
                     ((uint8_t*)Lr.pBits) + (pRect->top * Lr.Pitch) + ((pRect->left * bpp) >> 3),
                     pRect->right - pRect->left, pRect->bottom - pRect->top, bpp, Lr.Pitch));
@@ -8287,5 +8287,5 @@
     if (pSuffix)
     {
-        vboxVDbgMpPrint((pDevice, "%s\n", pSuffix));
+        vboxVDbgMpPrintF((pDevice, "%s\n", pSuffix));
     }
 
@@ -8307,5 +8307,5 @@
         {
             UINT bpp = vboxWddmCalcBitsPerPixel((D3DDDIFORMAT)Desc.Format);
-            vboxVDbgMpPrint((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
+            vboxVDbgMpPrintF((pDevice, "<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
                     Lr.pBits, Desc.Width, Desc.Height, bpp, Lr.Pitch));
 
@@ -8328,5 +8328,5 @@
         PVBOXWDDMDISP_SWAPCHAIN pSwapchain = vboxWddmSwapchainForAlloc(pAlloc);
         Assert(pSwapchain);
-        bFrontBuf = (vboxWddmSwapchainGetBb(pSwapchain)->pAlloc == pAlloc);
+        bFrontBuf = (vboxWddmSwapchainGetFb(pSwapchain)->pAlloc == pAlloc);
     }
     vboxVDbgDoMpPrintF(pDevice, "%s D3DWidth(%d), width(%d), height(%d), format(%d), usage(%s), %s", pPrefix,
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3DCmn.h	(revision 34345)
@@ -70,4 +70,5 @@
 #ifdef VBOXWDDMDISP_DEBUG_PRINT
 VOID vboxVDbgDoMpPrintF(const PVBOXWDDMDISP_DEVICE pDevice, LPCSTR szString, ...);
+VOID vboxVDbgDoMpPrint(const PVBOXWDDMDISP_DEVICE pDevice, LPCSTR szString);
 VOID vboxVDbgDoPrint(LPCSTR szString, ...);
 #endif
@@ -95,4 +96,8 @@
 #define vboxVDbgPrintR vboxVDbgPrint
 #define vboxVDbgMpPrint(_m) \
+    do { \
+        vboxVDbgDoMpPrint _m ; \
+    } while (0)
+#define vboxVDbgMpPrintF(_m) \
     do { \
         vboxVDbgDoMpPrintF _m ; \
@@ -129,4 +134,5 @@
 #else
 #define vboxVDbgMpPrint(_m) do {} while (0)
+#define vboxVDbgMpPrintF(_m) do {} while (0)
 #define vboxVDbgMpPrintRect(_m) do {} while (0)
 #define vboxVDbgMpPrintAlloc(_m) do {} while (0)
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp	(revision 34345)
@@ -154,4 +154,9 @@
 }
 
+static DECLCALLBACK(void) vboxDispMpLog(LPCSTR pszMsg)
+{
+    vboxDispCmLog(pszMsg);
+}
+
 VBOXDISPMP_DECL(HRESULT) VBoxDispMpGetCallbacks(uint32_t u32Version, PVBOXDISPMP_CALLBACKS pCallbacks)
 {
@@ -163,4 +168,5 @@
     pCallbacks->pfnDisableEvents = vboxDispMpDisableEvents;
     pCallbacks->pfnGetRegions = vboxDispMpGetRegions;
+    pCallbacks->pfnLog = vboxDispMpLog;
     return S_OK;
 }
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.h	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.h	(revision 34345)
@@ -40,4 +40,8 @@
 typedef FNVBOXDISPMP_GETREGIONS *PFNVBOXDISPMP_GETREGIONS;
 
+typedef DECLCALLBACK(void) FNVBOXDISPMP_LOG(LPCSTR pszMsg);
+typedef FNVBOXDISPMP_LOG *PFNVBOXDISPMP_LOG;
+
+
 typedef struct VBOXDISPMP_CALLBACKS
 {
@@ -50,4 +54,6 @@
      */
     PFNVBOXDISPMP_GETREGIONS pfnGetRegions;
+
+    PFNVBOXDISPMP_LOG pfnLog;
 } VBOXDISPMP_CALLBACKS, *PVBOXDISPMP_CALLBACKS;
 
@@ -63,5 +69,5 @@
 # endif
 
-#define VBOXDISPMP_IFVERSION 1
+#define VBOXDISPMP_IFVERSION 2
 #define VBOXDISPMP_VERSION (VBOXVIDEOIF_VERSION | (VBOXDISPMP_IFVERSION < 16))
 /**
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.cpp	(revision 34345)
@@ -419,5 +419,7 @@
             if (hr == S_OK)
             {
-                hr = vboxDispKmtCreateContext(&pHgsmi->Device, &pHgsmi->Context, bD3D);
+                hr = vboxDispKmtCreateContext(&pHgsmi->Device, &pHgsmi->Context,
+                        bD3D ? VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D : VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL,
+                                NULL, 0);
                 Assert(hr == S_OK);
                 if (hr == S_OK)
@@ -696,9 +698,12 @@
 }
 
-HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext, BOOL bD3D)
+HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext,
+                                    VBOXWDDM_CONTEXT_TYPE enmType, HANDLE hEvent, uint64_t u64UmInfo)
 {
     VBOXWDDM_CREATECONTEXT_INFO Info = {0};
     Info.u32IfVersion = 9;
-    Info.enmType = bD3D ? VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D : VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL;
+    Info.enmType = enmType;
+    Info.hUmEvent = (uint64_t)hEvent;
+    Info.u64UmInfo = u64UmInfo;
     D3DKMT_CREATECONTEXT ContextData = {0};
     ContextData.hDevice = pDevice->hDevice;
@@ -707,5 +712,5 @@
     ContextData.pPrivateDriverData = &Info;
     ContextData.PrivateDriverDataSize = sizeof (Info);
-    ContextData.ClientHint = bD3D ? D3DKMT_CLIENTHINT_DX9 : D3DKMT_CLIENTHINT_OPENGL;
+    ContextData.ClientHint = enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL ? D3DKMT_CLIENTHINT_OPENGL : D3DKMT_CLIENTHINT_DX9;
     NTSTATUS Status = pDevice->pAdapter->pCallbacks->pfnD3DKMTCreateContext(&ContextData);
     Assert(!Status);
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.h	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxUhgsmiKmt.h	(revision 34345)
@@ -96,5 +96,6 @@
 HRESULT vboxDispKmtCreateDevice(PVBOXDISPKMT_ADAPTER pAdapter, PVBOXDISPKMT_DEVICE pDevice);
 HRESULT vboxDispKmtDestroyDevice(PVBOXDISPKMT_DEVICE pDevice);
-HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext, BOOL bD3D);
+HRESULT vboxDispKmtCreateContext(PVBOXDISPKMT_DEVICE pDevice, PVBOXDISPKMT_CONTEXT pContext,
+        VBOXWDDM_CONTEXT_TYPE enmType, HANDLE hEvent, uint64_t u64UmInfo);
 HRESULT vboxDispKmtDestroyContext(PVBOXDISPKMT_CONTEXT pContext);
 
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoIf.h	(revision 34345)
@@ -30,5 +30,5 @@
 
 /* One would increase this whenever definitions in this file are changed */
-#define VBOXVIDEOIF_VERSION 7
+#define VBOXVIDEOIF_VERSION 8
 
 /* create allocation func */
@@ -214,5 +214,6 @@
     VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D,
     VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D,
-    VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL
+    VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL,
+    VBOXWDDM_CONTEXT_TYPE_CUSTOM_SESSION
 } VBOXWDDM_CONTEXT_TYPE;
 
@@ -246,5 +247,8 @@
             /* adds hidden regions */
             UINT bAddHiddenRects : 1;
-            UINT Reserved : 29;
+            /* hide entire window */
+            UINT bHide : 1;
+            /* reserved */
+            UINT Reserved : 28;
         };
         uint32_t Value;
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoMisc.cpp	(revision 34345)
@@ -204,5 +204,13 @@
     Assert(cRefs < UINT32_MAX/2);
     if (!cRefs)
+    {
+        Assert(pSwapchain->pContext);
+        if (pSwapchain->pContext)
+        {
+            NTSTATUS tmpStatus = vboxVdmaPostHideSwapchain(pSwapchain);
+            Assert(tmpStatus == STATUS_SUCCESS);
+        }
         vboxWddmMemFree(pSwapchain);
+    }
 }
 
@@ -313,5 +321,5 @@
     Assert(pTst == pSwapchain);
     RemoveEntryList(&pSwapchain->DevExtListEntry);
-    pSwapchain->pContext = NULL;
+//    pSwapchain->pContext = NULL;
     pSwapchain->hSwapchainKm = NULL;
     if (pSwapchain->pLastReportedRects)
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp	(revision 34345)
@@ -305,4 +305,24 @@
     }
     return true;
+}
+
+NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain)
+{
+    Assert(KeGetCurrentIrql() < DISPATCH_LEVEL);
+    uint32_t cbCmdInternal = VBOXVIDEOCM_CMD_RECTS_INTERNAL_SIZE4CRECTS(0);
+    PVBOXVIDEOCM_CMD_RECTS_INTERNAL pCmdInternal =
+            (PVBOXVIDEOCM_CMD_RECTS_INTERNAL)vboxVideoCmCmdCreate(&pSwapchain->pContext->CmContext, cbCmdInternal);
+    Assert(pCmdInternal);
+    if (pCmdInternal)
+    {
+        pCmdInternal->hSwapchainUm = pSwapchain->hSwapchainUm;
+        pCmdInternal->Cmd.fFlags.Value = 0;
+        pCmdInternal->Cmd.fFlags.bAddHiddenRects = 1;
+        pCmdInternal->Cmd.fFlags.bHide = 1;
+        pCmdInternal->Cmd.RectsInfo.cRects = 0;
+        vboxVideoCmCmdSubmit(pCmdInternal, VBOXVIDEOCM_SUBMITSIZE_DEFAULT);
+        return STATUS_SUCCESS;
+    }
+    return STATUS_NO_MEMORY;
 }
 
@@ -914,4 +934,12 @@
                             Assert(Status == STATUS_SUCCESS);
                         } break;
+                        case VBOXVDMAPIPE_CMD_TYPE_RECTSINFO:
+                        {
+                            PVBOXVDMAPIPE_CMD_RECTSINFO pRects = (PVBOXVDMAPIPE_CMD_RECTSINFO)pDr;
+                            Status = vboxVdmaGgDirtyRectsProcess(pRects->pDevExt, pRects->pContext, pRects->pSwapchain, &pRects->ContextsRects);
+                            Assert(Status == STATUS_SUCCESS);
+                            vboxVdmaGgCmdDestroy(pDr);
+                            break;
+                        }
                         default:
                             AssertBreakpoint();
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h	(revision 34344)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.h	(revision 34345)
@@ -178,5 +178,6 @@
 {
     VBOXVDMAPIPE_CMD_DR Hdr;
-    VBOXVDMADDI_CMD DdiCmd;
+    PDEVICE_EXTENSION pDevExt;
+    PVBOXWDDM_CONTEXT pContext;
     struct VBOXWDDM_SWAPCHAIN *pSwapchain;
     VBOXVDMAPIPE_RECTS ContextsRects;
@@ -302,4 +303,6 @@
 void vboxVdmaGgCmdDestroy(PVBOXVDMAPIPE_CMD_DR pDr);
 
+NTSTATUS vboxVdmaPostHideSwapchain(PVBOXWDDM_SWAPCHAIN pSwapchain);
+
 #define VBOXVDMAPIPE_CMD_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMAPIPE_CMD_DR)(((uint8_t*)(_pCmd)) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_DR, DdiCmd)))
 DECLCALLBACK(VOID) vboxVdmaGgDdiCmdDestroy(PDEVICE_EXTENSION pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext);
Index: /trunk/src/VBox/Additions/common/crOpenGL/load.c
===================================================================
--- /trunk/src/VBox/Additions/common/crOpenGL/load.c	(revision 34344)
+++ /trunk/src/VBox/Additions/common/crOpenGL/load.c	(revision 34345)
@@ -790,7 +790,13 @@
         }
     }
+    else if (!pRegions->pRegions->fFlags.bHide)
+    {
+        Assert(pRegions->pRegions->fFlags.bAddHiddenRects);
+        hNewRgn = stubMakeRegionFromRects(pRegions->pRegions, 0);
+    }
     else
     {
-        hNewRgn = stubMakeRegionFromRects(pRegions->pRegions, 0);
+        Assert(pRegions->pRegions->fFlags.bAddHiddenRects);
+        hNewRgn = CreateRectRgn(pWindow->x, pWindow->y, pWindow->x + pWindow->width, pWindow->y + pWindow->height);
     }
 
