Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 37906)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp	(revision 37907)
@@ -1025,7 +1025,8 @@
 static BOOLEAN vboxWddmDalCheckAdd(PVBOXWDDMDISP_DEVICE pDevice, PVBOXWDDMDISP_ALLOCATION pAlloc, BOOLEAN fWrite)
 {
-    if (!pAlloc->hSharedHandle) /* only shared resources matter */
-    {
-        Assert(!pAlloc->DirtyAllocListEntry.pNext);
+    if (!pAlloc->hSharedHandle /* only shared resources matter */
+            || !fWrite) /* only write op matter */
+    {
+        Assert(!pAlloc->DirtyAllocListEntry.pNext || (!fWrite && pAlloc->hSharedHandle && pAlloc->fDirtyWrite));
         return FALSE;
     }
@@ -2166,6 +2167,10 @@
     if (pSwapchain->cRTs == 1)
     {
+        IDirect3DSurface9 *pD3D9Bb;
+        /* only use direct bb if wine is able to handle quick blits bewteen surfaces in one swapchain,
+         * this is FALSE by now :( */
+# ifdef VBOX_WINE_WITH_FAST_INTERSWAPCHAIN_BLT
         /* here we sync the front-buffer with a backbuffer data*/
-        IDirect3DSurface9 *pD3D9Bb = (IDirect3DSurface9*)vboxWddmSwapchainGetBb(pSwapchain)->pAlloc->pD3DIf;
+        pD3D9Bb = (IDirect3DSurface9*)vboxWddmSwapchainGetBb(pSwapchain)->pAlloc->pD3DIf;
         Assert(pD3D9Bb);
         pD3D9Bb->AddRef();
@@ -2176,4 +2181,7 @@
         }
         pSwapchain->pRenderTargetFbCopy = pD3D9Bb;
+# else
+        pD3D9Bb = pSwapchain->pRenderTargetFbCopy;
+# endif
         HRESULT tmpHr = pSwapchain->pSwapChainIf->GetFrontBufferData(pD3D9Bb);
         if (SUCCEEDED(tmpHr))
@@ -2181,4 +2189,11 @@
             VBOXVDBG_DUMP_SYNC_RT(pD3D9Bb);
             pSwapchain->bRTFbCopyUpToDate = TRUE;
+# ifndef VBOX_WINE_WITH_FAST_INTERSWAPCHAIN_BLT
+            tmpHr = pDevice->pDevice9If->StretchRect(pD3D9Bb, NULL, (IDirect3DSurface9*)vboxWddmSwapchainGetBb(pSwapchain)->pAlloc->pD3DIf, NULL, D3DTEXF_NONE);
+            if (FAILED(tmpHr))
+            {
+                WARN(("StretchRect failed, hr (0x%x)", tmpHr));
+            }
+# endif
         }
         else
@@ -2405,5 +2420,7 @@
 #ifndef VBOXWDDM_WITH_VISIBLE_FB
         pSwapchain->bRTFbCopyUpToDate = FALSE;
-# ifdef VBOXDISP_WITH_WINE_BB_WORKAROUND
+# if defined(VBOXDISP_WITH_WINE_BB_WORKAROUND) && defined(VBOX_WINE_WITH_FAST_INTERSWAPCHAIN_BLT)
+        /* if wine is able to do fast fb->bb blits, we will use backbuffer directly,
+         * this is NOT possible currently */
         if (pSwapchain->cRTs == 1)
         {
@@ -2573,4 +2590,5 @@
             {
                 WARN(("GetFrontBufferData failed, hr (0x%x)", hr));
+                pSurf->Release();
                 return hr;
             }
@@ -6794,6 +6812,7 @@
                     HANDLE hSharedHandle = pAllocation->hSharedHandle;
                     Assert(pAllocation->hSharedHandle);
+
 #ifdef DEBUG_misha
-                    vboxVDbgPrintR(("\n\n********\nShared Resource (0x%x), (0n%d) openned\n\n\n", hSharedHandle, hSharedHandle));
+                    vboxVDbgPrint(("\n\n********\nShared Resource (0x%x), (0n%d) openned\n\n\n", hSharedHandle, hSharedHandle));
 #endif
 
