Index: trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 30621)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispD3D.cpp	(revision 30622)
@@ -34,4 +34,5 @@
 
 #define VBOXWDDMDISP_WITH_TMPWORKAROUND 1
+#define VBOXDISP_TMP_NEWCREATEDEVICE 1
 
 #define VBOXWDDMOVERLAY_TEST
@@ -3577,4 +3578,55 @@
     {
         Assert(pDevice->pDevice9If);
+#if 1
+        hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */
+                NULL, /* CONST RECT * pDestRect */
+                NULL, /* HWND hDestWindowOverride */
+                NULL /*CONST RGNDATA * pDirtyRegion */
+                );
+        Assert(hr == S_OK);
+#endif
+    }
+#if 0
+    else
+#endif
+    {
+        D3DDDICB_PRESENT DdiPresent = {0};
+        if (pData->hSrcResource)
+        {
+            PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource;
+            Assert(pRc->hKMResource);
+            Assert(pRc->cAllocations > pData->SrcSubResourceIndex);
+            PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SrcSubResourceIndex];
+            Assert(pAlloc->hAllocation);
+            DdiPresent.hSrcAllocation = pAlloc->hAllocation;
+        }
+        if (pData->hDstResource)
+        {
+            PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hDstResource;
+            Assert(pRc->hKMResource);
+            Assert(pRc->cAllocations > pData->DstSubResourceIndex);
+            PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->DstSubResourceIndex];
+            Assert(pAlloc->hAllocation);
+            DdiPresent.hDstAllocation = pAlloc->hAllocation;
+        }
+        DdiPresent.hContext = pDevice->DefaultContext.ContextInfo.hContext;
+//        DdiPresent.BroadcastContextCount;
+//        DdiPresent.BroadcastContext[D3DDDI_MAX_BROADCAST_CONTEXT];
+
+        hr = pDevice->RtCallbacks.pfnPresentCb(pDevice->hDevice, &DdiPresent);
+        Assert(hr == S_OK);
+    }
+    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr));
+    return hr;
+}
+static HRESULT APIENTRY vboxWddmDDevFlush(HANDLE hDevice)
+{
+    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
+    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
+    Assert(pDevice);
+    HRESULT hr = S_OK;
+    if (VBOXDISPMODE_IS_3D(pDevice->pAdapter))
+    {
+        Assert(pDevice->pDevice9If);
 #if 0
         hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */
@@ -3585,53 +3637,4 @@
         Assert(hr == S_OK);
 #endif
-    }
-#if 0
-    else
-#endif
-    {
-        D3DDDICB_PRESENT DdiPresent = {0};
-        if (pData->hSrcResource)
-        {
-            PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hSrcResource;
-            Assert(pRc->hKMResource);
-            Assert(pRc->cAllocations > pData->SrcSubResourceIndex);
-            PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SrcSubResourceIndex];
-            Assert(pAlloc->hAllocation);
-            DdiPresent.hSrcAllocation = pAlloc->hAllocation;
-        }
-        if (pData->hDstResource)
-        {
-            PVBOXWDDMDISP_RESOURCE pRc = (PVBOXWDDMDISP_RESOURCE)pData->hDstResource;
-            Assert(pRc->hKMResource);
-            Assert(pRc->cAllocations > pData->DstSubResourceIndex);
-            PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->DstSubResourceIndex];
-            Assert(pAlloc->hAllocation);
-            DdiPresent.hDstAllocation = pAlloc->hAllocation;
-        }
-        DdiPresent.hContext = pDevice->DefaultContext.ContextInfo.hContext;
-//        DdiPresent.BroadcastContextCount;
-//        DdiPresent.BroadcastContext[D3DDDI_MAX_BROADCAST_CONTEXT];
-
-        hr = pDevice->RtCallbacks.pfnPresentCb(pDevice->hDevice, &DdiPresent);
-        Assert(hr == S_OK);
-    }
-    vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr));
-    return hr;
-}
-static HRESULT APIENTRY vboxWddmDDevFlush(HANDLE hDevice)
-{
-    vboxVDbgPrintF(("==> "__FUNCTION__", hDevice(0x%p)\n", hDevice));
-    PVBOXWDDMDISP_DEVICE pDevice = (PVBOXWDDMDISP_DEVICE)hDevice;
-    Assert(pDevice);
-    HRESULT hr = S_OK;
-    if (VBOXDISPMODE_IS_3D(pDevice->pAdapter))
-    {
-        Assert(pDevice->pDevice9If);
-        hr = pDevice->pDevice9If->Present(NULL, /* CONST RECT * pSourceRect */
-                NULL, /* CONST RECT * pDestRect */
-                NULL, /* HWND hDestWindowOverride */
-                NULL /*CONST RGNDATA * pDirtyRegion */
-                );
-        Assert(hr == S_OK);
     }
     vboxVDbgPrintF(("<== "__FUNCTION__", hDevice(0x%p), hr(0x%x)\n", hDevice, hr));
