Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h	(revision 41471)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/common/VBoxVideoLog.h	(revision 41472)
@@ -40,4 +40,14 @@
 #endif
 
+#ifndef VBOX_VIDEO_LOG_FORMATTER
+# define VBOX_VIDEO_LOG_FORMATTER(_logger, _severity, _a)                     \
+    do                                                                      \
+    {                                                                       \
+        _logger((VBOX_VIDEO_LOG_PREFIX_FMT _severity, VBOX_VIDEO_LOG_PREFIX_PARMS));  \
+        _logger(_a);                                                        \
+        _logger((VBOX_VIDEO_LOG_SUFFIX_FMT  VBOX_VIDEO_LOG_SUFFIX_PARMS));  \
+    } while (0)
+#endif
+
 /* Uncomment to show file/line info in the log */
 /*#define VBOX_VIDEO_LOG_SHOWLINEINFO*/
@@ -66,10 +76,8 @@
     } while (0)
 
-#define _LOGMSG(_logger, _a)                                                \
+#define _LOGMSG(_logger, _severity, _a)                                     \
     do                                                                      \
     {                                                                       \
-        _logger((VBOX_VIDEO_LOG_PREFIX_FMT, VBOX_VIDEO_LOG_PREFIX_PARMS));  \
-        _logger(_a);                                                        \
-        _logger((VBOX_VIDEO_LOG_SUFFIX_FMT  VBOX_VIDEO_LOG_SUFFIX_PARMS));  \
+        VBOX_VIDEO_LOG_FORMATTER(_logger, _severity, _a);                   \
     } while (0)
 
@@ -89,19 +97,11 @@
 #endif
 
-#define WARN_NOBP(_a)                                                          \
-    do                                                                            \
-    {                                                                             \
-        _WARN_LOGGER((VBOX_VIDEO_LOG_PREFIX_FMT"WARNING! ", VBOX_VIDEO_LOG_PREFIX_PARMS)); \
-        _WARN_LOGGER(_a);                                                                  \
-        _WARN_LOGGER((VBOX_VIDEO_LOG_SUFFIX_FMT VBOX_VIDEO_LOG_SUFFIX_PARMS));             \
+#define WARN_NOBP(_a) _LOGMSG(VBOX_VIDEO_LOG_LOGGER, "WARNING! :", _a)
+#define WARN(_a)           \
+    do                     \
+    {                      \
+        WARN_NOBP(_a);     \
+        BP_WARN();         \
     } while (0)
-
-#define WARN(_a)                                                                  \
-    do                                                                            \
-    {                                                                             \
-        WARN_NOBP(_a);                                                         \
-        BP_WARN();                                                             \
-    } while (0)
-
 #define ASSERT_WARN(_a, _w) do {\
         if(!(_a)) { \
@@ -110,7 +110,7 @@
     } while (0)
 
-#define LOG(_a) _LOGMSG(VBOX_VIDEO_LOG_LOGGER, _a)
-#define LOGREL(_a) _LOGMSG(VBOX_VIDEO_LOGREL_LOGGER, _a)
-#define LOGF(_a) _LOGMSG(VBOX_VIDEO_LOGFLOW_LOGGER, _a)
+#define LOG(_a) _LOGMSG(VBOX_VIDEO_LOG_LOGGER, "", _a)
+#define LOGREL(_a) _LOGMSG(VBOX_VIDEO_LOGREL_LOGGER, "", _a)
+#define LOGF(_a) _LOGMSG(VBOX_VIDEO_LOGFLOW_LOGGER, "", _a)
 #define LOGF_ENTER() LOGF(("ENTER"))
 #define LOGF_LEAVE() LOGF(("LEAVE"))
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp	(revision 41471)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp	(revision 41472)
@@ -48,4 +48,5 @@
 
 #include <iprt/asm.h>
+#include <iprt/assert.h>
 
 #ifdef VBOXWDDMDISP_DEBUG
@@ -93,4 +94,16 @@
 DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce = 0;
 
+static void vboxDispLogDbgFormatStringV(char * szBuffer, uint32_t cbBuffer, const char * szString, va_list pArgList)
+{
+    uint32_t cbWritten = sprintf(szBuffer, "[0x%x.0x%x] Disp: ", GetCurrentProcessId(), GetCurrentThreadId());
+    if (cbWritten > cbBuffer)
+    {
+        AssertReleaseFailed();
+        return;
+    }
+
+    _vsnprintf(szBuffer + cbWritten, cbBuffer - cbWritten, szString, pArgList);
+}
+
 void vboxDispLogDbgPrintF(char * szString, ...)
 {
@@ -98,13 +111,8 @@
     va_list pArgList;
     va_start(pArgList, szString);
-    _vsnprintf(szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]), szString, pArgList);
+    vboxDispLogDbgFormatStringV(szBuffer, sizeof (szBuffer), szString, pArgList);
     va_end(pArgList);
 
     OutputDebugStringA(szBuffer);
-}
-
-VOID vboxVDbgDoDumpSurfRectByAlloc(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix)
-{
-    vboxVDbgDoDumpSurfRectByRc(pPrefix, pAlloc->pRc, pAlloc->iAlloc, pRect, pSuffix);
 }
 
@@ -126,16 +134,74 @@
 }
 
-VOID vboxVDbgDoDumpAllocRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix)
-{
-    if (pPrefix)
-    {
-        vboxVDbgPrint(("%s", pPrefix));
-    }
+typedef struct VBOXVDBG_DUMP_INFO
+{
+    DWORD fFlags;
+    PVBOXWDDMDISP_ALLOCATION pAlloc;
+    IDirect3DResource9 *pD3DRc;
+    RECT *pRect;
+} VBOXVDBG_DUMP_INFO, *PVBOXVDBG_DUMP_INFO;
+
+typedef DECLCALLBACK(void) FNVBOXVDBG_CONTENTS_DUMPER(PVBOXVDBG_DUMP_INFO pInfo, BOOLEAN fBreak, void *pvDumper);
+typedef FNVBOXVDBG_CONTENTS_DUMPER *PFNVBOXVDBG_CONTENTS_DUMPER;
+
+static VOID vboxVDbgDoDumpSummary(const char * pPrefix, PVBOXVDBG_DUMP_INFO pInfo, const char * pSuffix)
+{
+    PVBOXWDDMDISP_ALLOCATION pAlloc = pInfo->pAlloc;
+    IDirect3DResource9 *pD3DRc = pInfo->pD3DRc;
+    char rectBuf[24];
+    if (pInfo->pRect)
+        _snprintf(rectBuf, sizeof(rectBuf) / sizeof(rectBuf[0]), "(%d:%d);(%d:%d)",
+                pInfo->pRect->left, pInfo->pRect->top,
+                pInfo->pRect->right, pInfo->pRect->bottom);
+    else
+        strcpy(rectBuf, "n/a");
+
+    vboxVDbgPrint(("%s Sh(0x%p), Rc(0x%p), pAlloc(0x%x), pD3DIf(0x%p), Type(%s), Rect(%s), Locks(%d) %s",
+                    pPrefix ? pPrefix : "",
+                    pAlloc ? pAlloc->pRc->aAllocations[0].hSharedHandle : NULL,
+                    pAlloc ? pAlloc->pRc : NULL,
+                    pAlloc,
+                    pD3DRc,
+                    pD3DRc ? vboxDispLogD3DRcType(pD3DRc->GetType()) : "n/a",
+                    rectBuf,
+                    pAlloc ? pAlloc->LockInfo.cLocks : 0,
+                    pSuffix ? pSuffix : ""));
+}
+
+VOID vboxVDbgDoDumpPerform(const char * pPrefix, PVBOXVDBG_DUMP_INFO pInfo, const char * pSuffix,
+        PFNVBOXVDBG_CONTENTS_DUMPER pfnCd, void *pvCd)
+{
+    DWORD fFlags = pInfo->fFlags;
+
+    if (!VBOXVDBG_DUMP_TYPE_ENABLED(fFlags))
+        return;
+
+    if (!pInfo->pD3DRc && pInfo->pAlloc)
+        pInfo->pD3DRc = (IDirect3DResource9*)pInfo->pAlloc->pD3DIf;
+
+    BOOLEAN bLogOnly = VBOXVDBG_DUMP_TYPE_FLOW_ONLY(fFlags);
+    if (bLogOnly || !pfnCd)
+    {
+        vboxVDbgDoDumpSummary(pPrefix, pInfo, pSuffix);
+        if (VBOXVDBG_DUMP_FLAGS_IS_SET(fFlags, VBOXVDBG_DUMP_TYPEF_BREAK_ON_FLOW)
+                || (!bLogOnly && VBOXVDBG_DUMP_FLAGS_IS_CLEARED(fFlags, VBOXVDBG_DUMP_TYPEF_DONT_BREAK_ON_CONTENTS)))
+            Assert(0);
+        return;
+    }
+
+    vboxVDbgDoDumpSummary(pPrefix, pInfo, NULL);
+
+    pfnCd(pInfo, VBOXVDBG_DUMP_FLAGS_IS_CLEARED(fFlags, VBOXVDBG_DUMP_TYPEF_DONT_BREAK_ON_CONTENTS), pvCd);
+
+    if (pSuffix && pSuffix[0] != '\0')
+        vboxVDbgPrint(("%s", pSuffix));
+}
+
+static DECLCALLBACK(void) vboxVDbgAllocRectContentsDumperCb(PVBOXVDBG_DUMP_INFO pInfo, BOOLEAN fBreak, void *pvDumper)
+{
+    PVBOXWDDMDISP_ALLOCATION pAlloc = pInfo->pAlloc;
+    const RECT *pRect = pInfo->pRect;
 
     Assert(pAlloc->hAllocation);
-
-    HANDLE hSharedHandle = pAlloc->hSharedHandle;
-
-    vboxVDbgPrint(("SharedHandle: (0x%p)\n", hSharedHandle));
 
     D3DDDICB_LOCK LockData;
@@ -175,34 +241,31 @@
         Assert(hr == S_OK);
     }
-    if (pSuffix)
-    {
-        vboxVDbgPrint(("%s\n", pSuffix));
-    }
-}
-
-
-VOID vboxVDbgDoDumpSurfRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, const char* pSuffix)
-{
-    Assert(pRc->cAllocations > iAlloc);
-    BOOL bReleaseSurf = false;
+}
+
+VOID vboxVDbgDoDumpAllocRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, RECT *pRect, const char* pSuffix, DWORD fFlags)
+{
+    VBOXVDBG_DUMP_INFO Info;
+    Info.fFlags = fFlags;
+    Info.pAlloc = pAlloc;
+    Info.pD3DRc = NULL;
+    Info.pRect = pRect;
+    vboxVDbgDoDumpPerform(pPrefix, &Info, pSuffix, vboxVDbgAllocRectContentsDumperCb, NULL);
+}
+
+static DECLCALLBACK(void) vboxVDbgRcRectContentsDumperCb(PVBOXVDBG_DUMP_INFO pInfo, BOOLEAN fBreak, void *pvDumper)
+{
+    PVBOXWDDMDISP_ALLOCATION pAlloc = pInfo->pAlloc;
+    IDirect3DResource9 *pD3DRc = pInfo->pD3DRc;
+    const RECT *pRect = pInfo->pRect;
     IDirect3DSurface9 *pSurf;
-    HRESULT hr = vboxWddmSurfGet(pRc, iAlloc, &pSurf);
-    Assert(hr == S_OK);
-    if (hr == S_OK)
-    {
-        vboxVDbgDoDumpSurfRect(pPrefix, pSurf, pRect, pSuffix, true);
-        pSurf->Release();
-    }
-}
-
-VOID vboxVDbgDoDumpSurfRect(const char * pPrefix, IDirect3DSurface9 *pSurf, const RECT *pRect, const char * pSuffix, bool bBreak)
-{
-    if (pPrefix)
-    {
-        vboxVDbgPrint(("%s", pPrefix));
+    HRESULT hr = vboxWddmSurfGet(pAlloc->pRc, pAlloc->iAlloc, &pSurf);
+    if (hr != S_OK)
+    {
+        WARN(("vboxWddmSurfGet failed, hr 0x%x", hr));
+        return;
     }
 
     D3DSURFACE_DESC Desc;
-    HRESULT hr = pSurf->GetDesc(&Desc);
+    hr = pSurf->GetDesc(&Desc);
     Assert(hr == S_OK);
     if (hr == S_OK)
@@ -224,26 +287,26 @@
             }
 
-            if (bBreak)
+            if (fBreak)
             {
                 Assert(0);
-
-                hr = pSurf->UnlockRect();
-                Assert(hr == S_OK);
             }
+            hr = pSurf->UnlockRect();
+            Assert(hr == S_OK);
         }
     }
-
-    if (pSuffix)
-    {
-        vboxVDbgPrint(("%s", pSuffix));
-    }
-}
-
-VOID vboxVDbgDoDumpSurf(const char * pPrefix, IDirect3DSurface9 *pSurf, const char * pSuffix)
-{
-    vboxVDbgDoDumpSurfRect(pPrefix, pSurf, NULL, pSuffix, true);
-}
-
-VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix)
+}
+
+VOID vboxVDbgDoDumpRcRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc,
+        IDirect3DResource9 *pD3DRc, RECT *pRect, const char * pSuffix, DWORD fFlags)
+{
+    VBOXVDBG_DUMP_INFO Info;
+    Info.fFlags = fFlags;
+    Info.pAlloc = pAlloc;
+    Info.pD3DRc = pD3DRc;
+    Info.pRect = pRect;
+    vboxVDbgDoDumpPerform(pPrefix, &Info, pSuffix, vboxVDbgRcRectContentsDumperCb, NULL);
+}
+
+VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags)
 {
     IDirect3DSurface9 *pBb = NULL;
@@ -256,9 +319,9 @@
 
     Assert(pBb);
-    vboxVDbgDoDumpSurf(pPrefix, pBb, pSuffix);
+    vboxVDbgDoDumpRcRect(pPrefix, NULL, pBb, NULL, pSuffix, fFlags);
     pBb->Release();
 }
 
-VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix)
+VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags)
 {
     IDirect3DSurface9 *pBb = NULL;
@@ -271,5 +334,5 @@
 
     Assert(pBb);
-    vboxVDbgDoDumpSurf(pPrefix, pBb, pSuffix);
+    vboxVDbgDoDumpRcRect(pPrefix, NULL, pBb, NULL, pSuffix, fFlags);
     pBb->Release();
 }
@@ -295,104 +358,5 @@
 }
 
-VOID vboxVDbgDoDumpRcRect(const char * pPrefix, IDirect3DResource9 *pRc, const RECT *pRect, const char * pSuffix)
-{
-    if (pPrefix)
-    {
-        vboxVDbgPrint(("%s", pPrefix));
-    }
-
-    switch (pRc->GetType())
-    {
-        case D3DRTYPE_TEXTURE:
-        {
-            vboxVDbgPrint(("this is a texture\n"));
-
-            IDirect3DTexture9 *pTex = (IDirect3DTexture9*)pRc;
-            IDirect3DSurface9 *pSurf;
-            HRESULT hr = pTex->GetSurfaceLevel(0, &pSurf);
-            Assert(hr == S_OK);
-            if (hr == S_OK)
-            {
-                vboxVDbgDoDumpSurfRect("", pSurf, pRect, "\n", true);
-                pSurf->Release();
-            }
-            break;
-        }
-        case D3DRTYPE_CUBETEXTURE:
-        {
-            vboxVDbgPrint(("this is a cube texture\n"));
-
-            IDirect3DCubeTexture9 *pCubeTex = (IDirect3DCubeTexture9*)pRc;
-            IDirect3DSurface9 *apSurf[6] = {0};
-            for (UINT i = D3DCUBEMAP_FACE_POSITIVE_X; i < D3DCUBEMAP_FACE_POSITIVE_X + 6; ++i)
-            {
-                vboxVDbgPrint(("face %s: ", vboxVDbgStrCubeFaceType((D3DCUBEMAP_FACES)i)));
-
-                HRESULT hr = pCubeTex->GetCubeMapSurface((D3DCUBEMAP_FACES)i, 0, &apSurf[i]);
-                Assert(hr == S_OK);
-                if (hr == S_OK)
-                {
-                    vboxVDbgDoDumpSurfRect("", apSurf[i], pRect, "\n", false);
-                }
-                else
-                {
-                    Assert(0);
-                }
-            }
-
-            Assert(0);
-
-            for (UINT i = D3DCUBEMAP_FACE_POSITIVE_X; i < D3DCUBEMAP_FACE_POSITIVE_X + 6; ++i)
-            {
-                apSurf[i]->UnlockRect();
-                apSurf[i]->Release();
-            }
-
-            break;
-        }
-        case D3DRTYPE_SURFACE:
-        {
-            vboxVDbgPrint(("this is a surface\n"));
-            IDirect3DSurface9 *pSurf = (IDirect3DSurface9 *)pRc;
-            vboxVDbgDoDumpSurfRect("", pSurf, pRect, "\n", true);
-            break;
-        }
-        default:
-            vboxVDbgPrint(("unsupported rc type\n"));
-            Assert(0);
-    }
-
-    if (pSuffix)
-    {
-        vboxVDbgPrint(("%s", pSuffix));
-    }
-}
-
-VOID vboxVDbgDoDumpRcRectByAlloc(const char * pPrefix, const PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DResource9 *pD3DIf, const RECT *pRect, const char* pSuffix)
-{
-    if (pPrefix)
-        vboxVDbgPrint(("%s", pPrefix));
-
-    if (!pD3DIf)
-    {
-        pD3DIf = (IDirect3DResource9*)pAlloc->pD3DIf;
-    }
-
-    vboxVDbgPrint(("Rc(0x%p), pAlloc(0x%x), pD3DIf(0x%p), SharedHandle(0x%p)\n", pAlloc->pRc, pAlloc, pD3DIf, pAlloc->pRc->aAllocations[0].hSharedHandle));
-
-    vboxVDbgDoDumpRcRect("", pD3DIf, pRect, pSuffix);
-}
-
-VOID vboxVDbgDoDumpRcRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, const RECT *pRect, const char* pSuffix)
-{
-    vboxVDbgDoDumpRcRectByAlloc(pPrefix, &pRc->aAllocations[0], NULL, pRect, pSuffix);
-}
-
-VOID vboxVDbgDoDumpTex(const char * pPrefix, IDirect3DBaseTexture9 *pTexBase, const char * pSuffix)
-{
-    vboxVDbgDoDumpRcRect(pPrefix, pTexBase, NULL, pSuffix);
-}
-
-VOID vboxVDbgDoDumpRt(const char * pPrefix, PVBOXWDDMDISP_DEVICE pDevice, const char * pSuffix)
+VOID vboxVDbgDoDumpRt(const char * pPrefix, PVBOXWDDMDISP_DEVICE pDevice, const char * pSuffix, DWORD fFlags)
 {
     for (UINT i = 0; i < pDevice->cRTs; ++i)
@@ -406,5 +370,5 @@
         {
 //            Assert(pAlloc->pD3DIf == pRt);
-            vboxVDbgDoDumpRcRectByAlloc(pPrefix, pAlloc, NULL, NULL, "\n");
+            vboxVDbgDoDumpRcRect(pPrefix, pAlloc, NULL, NULL, pSuffix, fFlags);
             pRt->Release();
         }
@@ -416,17 +380,45 @@
 }
 
-VOID vboxVDbgDoDumpLockUnlockSurfTex(const char * pPrefix, const PVBOXWDDMDISP_ALLOCATION pAlloc, const char * pSuffix, bool fBreak)
-{
-    if (pPrefix)
-    {
-        vboxVDbgPrint(("%s", pPrefix));
-    }
-
-    Assert(!pAlloc->hSharedHandle);
-
+static DECLCALLBACK(void) vboxVDbgLockUnlockSurfTexContentsDumperCb(PVBOXVDBG_DUMP_INFO pInfo, BOOLEAN fBreak, void *pvDumper)
+{
+    PVBOXWDDMDISP_ALLOCATION pAlloc = pInfo->pAlloc;
+    PRECT pRect = pInfo->pRect;
     UINT bpp = vboxWddmCalcBitsPerPixel(pAlloc->SurfDesc.format);
     uint32_t width, height, pitch;
+    void *pvData;
+    if (pAlloc->LockInfo.fFlags.AreaValid)
+    {
+        width = pAlloc->LockInfo.Area.left - pAlloc->LockInfo.Area.right;
+        height = pAlloc->LockInfo.Area.bottom - pAlloc->LockInfo.Area.top;
+    }
+    else
+    {
+        width = pAlloc->SurfDesc.width;
+        height = pAlloc->SurfDesc.height;
+    }
+
+    if (pAlloc->LockInfo.fFlags.NotifyOnly)
+    {
+        pitch = pAlloc->SurfDesc.pitch;
+        pvData = ((uint8_t*)pAlloc->pvMem) + pitch*pRect->top + ((bpp*pRect->left) >> 3);
+    }
+    else
+    {
+        pvData = pAlloc->LockInfo.pvData;
+    }
+
+    vboxVDbgDoPrintDumpCmd("Surf Info", pvData, width, height, bpp, pitch);
+
+    if (fBreak)
+    {
+        Assert(0);
+    }
+}
+
+VOID vboxVDbgDoDumpLockUnlockSurfTex(const char * pPrefix, const PVBOXWDDMDISP_ALLOCATION pAlloc, const char * pSuffix, DWORD fFlags)
+{
+    Assert(!pAlloc->hSharedHandle);
+
     RECT Rect, *pRect;
-    void *pvData;
     Assert(!pAlloc->LockInfo.fFlags.RangeValid);
     Assert(!pAlloc->LockInfo.fFlags.BoxValid);
@@ -434,57 +426,35 @@
     {
         pRect = &pAlloc->LockInfo.Area;
-        width = pAlloc->LockInfo.Area.left - pAlloc->LockInfo.Area.right;
-        height = pAlloc->LockInfo.Area.bottom - pAlloc->LockInfo.Area.top;
     }
     else
     {
-        width = pAlloc->SurfDesc.width;
-        height = pAlloc->SurfDesc.height;
         Rect.top = 0;
-        Rect.bottom = height;
+        Rect.bottom = pAlloc->SurfDesc.height;
         Rect.left = 0;
-        Rect.right = width;
+        Rect.right = pAlloc->SurfDesc.width;
         pRect = &Rect;
     }
 
-    if (pAlloc->LockInfo.fFlags.NotifyOnly)
-    {
-        pitch = pAlloc->SurfDesc.pitch;
-        pvData = ((uint8_t*)pAlloc->pvMem) + pitch*pRect->top + ((bpp*pRect->left) >> 3);
-    }
-    else
-    {
-        pvData = pAlloc->LockInfo.pvData;
-    }
-
-    vboxVDbgPrint(("pRc(0x%p) iAlloc(%d), type(%d), cLocks(%d)\n", pAlloc->pRc, pAlloc->iAlloc, pAlloc->enmD3DIfType, pAlloc->LockInfo.cLocks));
-
-    vboxVDbgDoPrintDumpCmd("Surf Info", pvData, width, height, bpp, pitch);
-
-    if (fBreak)
-    {
-        Assert(0);
-    }
-
-    if (pSuffix)
-    {
-        vboxVDbgPrint(("%s", pSuffix));
-    }
-
-}
-
-VOID vboxVDbgDoDumpLockSurfTex(const char * pPrefix, const D3DDDIARG_LOCK* pData, const char * pSuffix, bool fBreak)
+    VBOXVDBG_DUMP_INFO Info;
+    Info.fFlags = fFlags;
+    Info.pAlloc = pAlloc;
+    Info.pD3DRc = NULL;
+    Info.pRect = pRect;
+    vboxVDbgDoDumpPerform(pPrefix, &Info, pSuffix, vboxVDbgLockUnlockSurfTexContentsDumperCb, NULL);
+}
+
+VOID vboxVDbgDoDumpLockSurfTex(const char * pPrefix, const D3DDDIARG_LOCK* pData, const char * pSuffix, DWORD fFlags)
 {
     const PVBOXWDDMDISP_RESOURCE pRc = (const PVBOXWDDMDISP_RESOURCE)pData->hResource;
     const PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SubResourceIndex];
     pAlloc->LockInfo.pvData = pData->pSurfData;
-    vboxVDbgDoDumpLockUnlockSurfTex(pPrefix, pAlloc, pSuffix, fBreak);
-}
-
-VOID vboxVDbgDoDumpUnlockSurfTex(const char * pPrefix, const D3DDDIARG_UNLOCK* pData, const char * pSuffix, bool fBreak)
+    vboxVDbgDoDumpLockUnlockSurfTex(pPrefix, pAlloc, pSuffix, fFlags);
+}
+
+VOID vboxVDbgDoDumpUnlockSurfTex(const char * pPrefix, const D3DDDIARG_UNLOCK* pData, const char * pSuffix, DWORD fFlags)
 {
     const PVBOXWDDMDISP_RESOURCE pRc = (const PVBOXWDDMDISP_RESOURCE)pData->hResource;
     const PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[pData->SubResourceIndex];
-    vboxVDbgDoDumpLockUnlockSurfTex(pPrefix, pAlloc, pSuffix, fBreak);
+    vboxVDbgDoDumpLockUnlockSurfTex(pPrefix, pAlloc, pSuffix, fFlags);
 }
 
@@ -715,4 +685,13 @@
 
 #if defined(VBOXWDDMDISP_DEBUG) || defined(LOG_TO_BACKDOOR_DRV)
-
+void vboxDispLogDrvF(char * szString, ...)
+{
+    char szBuffer[4096] = {0};
+    va_list pArgList;
+    va_start(pArgList, szString);
+    vboxDispLogDbgFormatStringV(szBuffer, sizeof (szBuffer), szString, pArgList);
+    va_end(pArgList);
+
+    VBoxDispMpLoggerLog(szBuffer);
+}
 #endif
Index: /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h	(revision 41471)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h	(revision 41472)
@@ -39,5 +39,5 @@
 //#  define VBOXWDDMDISP_DEBUG_PRINTDRV
 /* use OutputDebugString */
-#  define VBOXWDDMDISP_DEBUG_PRINT
+//#  define VBOXWDDMDISP_DEBUG_PRINT
 /* adds vectored exception handler to be able to catch non-debug UM exceptions in kernel debugger */
 //#  define VBOXWDDMDISP_DEBUG_VEHANDLER
@@ -111,7 +111,7 @@
 
 #if defined(LOG_TO_BACKDOOR_DRV) || defined(VBOXWDDMDISP_DEBUG_PRINTDRV)
-# define DbgPrintDrv(_m) do { VBoxDispMpLoggerLogF _m; } while (0)
-# define DbgPrintDrvRel(_m) do { VBoxDispMpLoggerLogF _m; } while (0)
-# define DbgPrintDrvFlow(_m) do { VBoxDispMpLoggerLogF _m; } while (0)
+# define DbgPrintDrv(_m) do { vboxDispLogDrvF _m; } while (0)
+# define DbgPrintDrvRel(_m) do { vboxDispLogDrvF _m; } while (0)
+# define DbgPrintDrvFlow(_m) do { vboxDispLogDrvF _m; } while (0)
 #else
 # define DbgPrintDrv(_m) do { } while (0)
@@ -171,7 +171,29 @@
 #if defined(VBOXWDDMDISP_DEBUG) || defined(LOG_TO_BACKDOOR_DRV)
 
+#define VBOXVDBG_STRCASE(_t) \
+        case _t: return #_t;
+#define VBOXVDBG_STRCASE_UNKNOWN() \
+        default: Assert(0); return "Unknown";
+
+static DECLINLINE(const char*) vboxDispLogD3DRcType(D3DRESOURCETYPE enmType)
+{
+    switch (enmType)
+    {
+        VBOXVDBG_STRCASE(D3DRTYPE_SURFACE);
+        VBOXVDBG_STRCASE(D3DRTYPE_VOLUME);
+        VBOXVDBG_STRCASE(D3DRTYPE_TEXTURE);
+        VBOXVDBG_STRCASE(D3DRTYPE_VOLUMETEXTURE);
+        VBOXVDBG_STRCASE(D3DRTYPE_CUBETEXTURE);
+        VBOXVDBG_STRCASE(D3DRTYPE_VERTEXBUFFER);
+        VBOXVDBG_STRCASE(D3DRTYPE_INDEXBUFFER);
+        VBOXVDBG_STRCASE_UNKNOWN();
+    }
+}
+
 #include "VBoxDispMpLogger.h"
 
 VBOXDISPMPLOGGER_DECL(void) VBoxDispMpLoggerDumpD3DCAPS9(struct _D3DCAPS9 *pCaps);
+
+void vboxDispLogDrvF(char * szString, ...);
 
 # define vboxDispDumpD3DCAPS9(_pCaps) do { VBoxDispMpLoggerDumpD3DCAPS9(_pCaps); } while (0)
@@ -187,22 +209,40 @@
 typedef struct VBOXWDDMDISP_RESOURCE *PVBOXWDDMDISP_RESOURCE;
 
-VOID vboxVDbgDoDumpSurfRectByAlloc(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix);
-VOID vboxVDbgDoDumpAllocRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix);
-VOID vboxVDbgDoDumpSurfRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, const char* pSuffix);
-VOID vboxVDbgDoDumpSurfRect(const char * pPrefix, IDirect3DSurface9 *pSurf, const RECT *pRect, const char * pSuffix, bool bBreak);
-VOID vboxVDbgDoDumpSurf(const char * pPrefix, IDirect3DSurface9 *pSurf, const char * pSuffix);
-VOID vboxVDbgDoDumpRcRect(const char * pPrefix, IDirect3DResource9 *pRc, const RECT *pRect, const char * pSuffix);
-VOID vboxVDbgDoDumpRcRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, const RECT *pRect, const char* pSuffix);
-VOID vboxVDbgDoDumpRcRectByAlloc(const char * pPrefix, const PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DResource9 *pD3DIf, const RECT *pRect, const char* pSuffix);
-VOID vboxVDbgDoDumpTex(const char * pPrefix, IDirect3DBaseTexture9 *pTexBase, const char * pSuffix);
-VOID vboxVDbgDoDumpRt(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix);
-VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix);
-VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix);
+/* functions all dump finally comes to */
+#define VBOXVDBG_DUMP_TYPEF_FLOW                   0x00000001
+#define VBOXVDBG_DUMP_TYPEF_CONTENTS               0x00000002
+#define VBOXVDBG_DUMP_TYPEF_DONT_BREAK_ON_CONTENTS 0x00000004
+#define VBOXVDBG_DUMP_TYPEF_BREAK_ON_FLOW          0x00000008
+
+#define VBOXVDBG_DUMP_FLAGS_IS_SETANY(_fFlags, _Value) (((_fFlags) & (_Value)) != 0)
+#define VBOXVDBG_DUMP_FLAGS_IS_SET(_fFlags, _Value) (((_fFlags) & (_Value)) == (_Value))
+#define VBOXVDBG_DUMP_FLAGS_IS_CLEARED(_fFlags, _Value) (((_fFlags) & (_Value)) == 0)
+#define VBOXVDBG_DUMP_FLAGS_CLEAR(_fFlags, _Value) ((_fFlags) & (~(_Value)))
+#define VBOXVDBG_DUMP_FLAGS_SET(_fFlags, _Value) ((_fFlags) | (_Value))
+
+#define VBOXVDBG_DUMP_TYPE_ENABLED(_fFlags) (VBOXVDBG_DUMP_FLAGS_IS_SETANY(_fFlags, VBOXVDBG_DUMP_TYPEF_FLOW | VBOXVDBG_DUMP_TYPEF_CONTENTS))
+#define VBOXVDBG_DUMP_TYPE_FLOW_ONLY(_fFlags) (VBOXVDBG_DUMP_FLAGS_IS_SET(_fFlags, VBOXVDBG_DUMP_TYPEF_FLOW) \
+        && VBOXVDBG_DUMP_FLAGS_IS_CLEARED(_fFlags, VBOXVDBG_DUMP_TYPEF_CONTENTS))
+#define VBOXVDBG_DUMP_TYPE_CONTENTS(_fFlags) (VBOXVDBG_DUMP_FLAGS_IS_SET(_fFlags, VBOXVDBG_DUMP_TYPEF_CONTENTS))
+#define VBOXVDBG_DUMP_TYPE_GET_FLOW_ONLY(_fFlags) ( \
+        VBOXVDBG_DUMP_FLAGS_SET( \
+                VBOXVDBG_DUMP_FLAGS_CLEAR(_fFlags, VBOXVDBG_DUMP_TYPEF_CONTENTS), \
+                VBOXVDBG_DUMP_TYPEF_FLOW) \
+        )
+
+VOID vboxVDbgDoDumpAllocRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, RECT *pRect, const char* pSuffix, DWORD fFlags);
+VOID vboxVDbgDoDumpRcRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DResource9 *pD3DRc, RECT *pRect, const char * pSuffix, DWORD fFlags);
+VOID vboxVDbgDoDumpLockUnlockSurfTex(const char * pPrefix, const PVBOXWDDMDISP_ALLOCATION pAlloc, const char * pSuffix, DWORD fFlags);
+/* */
+
+VOID vboxVDbgDoDumpRt(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix, DWORD fFlags);
+VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags);
+VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix, DWORD fFlags);
 
 void vboxVDbgDoPrintRect(const char * pPrefix, const RECT *pRect, const char * pSuffix);
 void vboxVDbgDoPrintAlloc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const char * pSuffix);
 
-VOID vboxVDbgDoDumpLockSurfTex(const char * pPrefix, const D3DDDIARG_LOCK* pData, const char * pSuffix, bool fBreak);
-VOID vboxVDbgDoDumpUnlockSurfTex(const char * pPrefix, const D3DDDIARG_UNLOCK* pData, const char * pSuffix, bool fBreak);
+VOID vboxVDbgDoDumpLockSurfTex(const char * pPrefix, const D3DDDIARG_LOCK* pData, const char * pSuffix, DWORD fFlags);
+VOID vboxVDbgDoDumpUnlockSurfTex(const char * pPrefix, const D3DDDIARG_UNLOCK* pData, const char * pSuffix, DWORD fFlags);
 
 BOOL vboxVDbgDoCheckRectsMatch(const PVBOXWDDMDISP_RESOURCE pDstRc, uint32_t iDstAlloc,
@@ -227,24 +267,12 @@
     } while (0)
 
-#define VBOXVDBG_IS_DUMP_ALLOWED(_type) ( \
-        g_VBoxVDbgFDump##_type \
-        && (g_VBoxVDbgFDump##_type == 1 \
-                || VBOXVDBG_IS_DUMP_ALLOWED_PID(g_VBoxVDbgFDump##_type) \
-           ) \
-        )
-
-#define VBOXVDBG_IS_BREAK_ALLOWED(_type) ( \
-        g_VBoxVDbgFBreak##_type \
-        && (g_VBoxVDbgFBreak##_type == 1 \
-                || VBOXVDBG_IS_DUMP_ALLOWED_PID(g_VBoxVDbgFBreak##_type) \
-           ) \
-        )
-
-#define VBOXVDBG_IS_CHECK_ALLOWED(_type) ( \
-        g_VBoxVDbgFCheck##_type \
-        && (g_VBoxVDbgFCheck##_type == 1 \
-                || VBOXVDBG_IS_DUMP_ALLOWED_PID(g_VBoxVDbgFCheck##_type) \
-           ) \
-        )
+#define VBOXVDBG_DUMP_FLAGS_FOR_TYPE(_type) g_VBoxVDbgFDump##_type
+#define VBOXVDBG_BREAK_FLAGS_FOR_TYPE(_type) g_VBoxVDbgFBreak##_type
+#define VBOXVDBG_CHECK_FLAGS_FOR_TYPE(_type) g_VBoxVDbgFCheck##_type
+#define VBOXVDBG_IS_DUMP_ALLOWED(_type) ( VBOXVDBG_DUMP_TYPE_ENABLED(VBOXVDBG_DUMP_FLAGS_FOR_TYPE(_type)) )
+
+#define VBOXVDBG_IS_BREAK_ALLOWED(_type) ( !!VBOXVDBG_BREAK_FLAGS_FOR_TYPE(_type) )
+
+#define VBOXVDBG_IS_CHECK_ALLOWED(_type) ( !!VBOXVDBG_CHECK_FLAGS_FOR_TYPE(_type) )
 
 #define VBOXVDBG_IS_DUMP_SHARED_ALLOWED(_pRc) (\
@@ -318,6 +346,7 @@
                 Assert(i < RT_ELEMENTS((_pDevice)->aSamplerTextures)); \
                 if (!(_pDevice)->aSamplerTextures[i]) continue; \
+                ++iSampler; \
+                if (!(_pDevice)->aSamplerTextures[i]->RcDesc.fFlags.SharedResource) continue; \
                 *(_pIsShared) = TRUE; break; \
-                ++iSampler; \
             } \
         } \
@@ -346,5 +375,5 @@
                 || VBOXVDBG_IS_DUMP_ALLOWED(DrawPrim)) \
         { \
-            vboxVDbgDoDumpRt("==>"__FUNCTION__": RenderTarget Dump\n", (_pDevice), "\n"); \
+            vboxVDbgDoDumpRt("==>"__FUNCTION__": Rt: ", (_pDevice), "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Flush) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(DrawPrim)); \
         }\
     } while (0)
@@ -356,5 +385,6 @@
                 || VBOXVDBG_IS_DUMP_ALLOWED(DrawPrim)) \
         { \
-            vboxVDbgDoDumpRt("<=="__FUNCTION__": RenderTarget Dump\n", (_pDevice), "\n"); \
+            vboxVDbgDoDumpRt("<=="__FUNCTION__": Rt: ", (_pDevice), "", \
+                VBOXVDBG_DUMP_FLAGS_FOR_TYPE(DrawPrim) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
         }\
     } while (0)
@@ -374,5 +404,6 @@
                 ) \
         { \
-            vboxVDbgDoDumpRcRectByRc("== "__FUNCTION__": ", _pRc, NULL, "\n"); \
+            vboxVDbgDoDumpRcRect("== "__FUNCTION__": ", &(_pRc)->aAllocations[0], NULL, NULL, "", \
+                    VBOXVDBG_DUMP_FLAGS_FOR_TYPE(SetTexture) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
         } \
     } while (0)
@@ -384,8 +415,11 @@
                 ) \
         { \
+            RECT SrcRect = *(_pSrcRect); \
             RECT _DstRect; \
-            vboxWddmRectMoved(&_DstRect, (_pSrcRect), (_pDstPoint)->x, (_pDstPoint)->y); \
-            vboxVDbgDoDumpRcRectByRc("==>"__FUNCTION__" Src: ", (_pSrcRc), (_pSrcRect), "\n"); \
-            vboxVDbgDoDumpRcRectByRc("==>"__FUNCTION__" Dst: ", (_pDstRc), &_DstRect, "\n"); \
+            vboxWddmRectMoved(&_DstRect, &SrcRect, (_pDstPoint)->x, (_pDstPoint)->y); \
+            vboxVDbgDoDumpRcRect("==> "__FUNCTION__": Src: ", &(_pSrcRc)->aAllocations[0], NULL, &SrcRect, "", \
+                    VBOXVDBG_DUMP_FLAGS_FOR_TYPE(TexBlt) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
+            vboxVDbgDoDumpRcRect("==> "__FUNCTION__": Dst: ", &(_pDstRc)->aAllocations[0], NULL, &_DstRect, "", \
+                    VBOXVDBG_DUMP_FLAGS_FOR_TYPE(TexBlt) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
         } \
     } while (0)
@@ -398,8 +432,11 @@
                 ) \
         { \
+            RECT SrcRect = *(_pSrcRect); \
             RECT _DstRect; \
-            vboxWddmRectMoved(&_DstRect, (_pSrcRect), (_pDstPoint)->x, (_pDstPoint)->y); \
-            vboxVDbgDoDumpRcRectByRc("<=="__FUNCTION__" Src: ", (_pSrcRc), (_pSrcRect), "\n"); \
-            vboxVDbgDoDumpRcRectByRc("<=="__FUNCTION__" Dst: ", (_pDstRc), &_DstRect, "\n"); \
+            vboxWddmRectMoved(&_DstRect, &SrcRect, (_pDstPoint)->x, (_pDstPoint)->y); \
+            vboxVDbgDoDumpRcRect("<== "__FUNCTION__": Src: ", &(_pSrcRc)->aAllocations[0], NULL, &SrcRect, "", \
+                    VBOXVDBG_DUMP_FLAGS_FOR_TYPE(TexBlt) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
+            vboxVDbgDoDumpRcRect("<== "__FUNCTION__": Dst: ", &(_pDstRc)->aAllocations[0], NULL, &_DstRect, "", \
+                    VBOXVDBG_DUMP_FLAGS_FOR_TYPE(TexBlt) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
         } \
     } while (0)
@@ -411,16 +448,33 @@
                 ) \
         { \
-            if ((_pSrcSurf) == (_pDstSurf) \
+            DWORD fFlags = VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Blt) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared); \
+            if (VBOXVDBG_DUMP_TYPE_CONTENTS(fFlags) && \
+                    ((_pSrcSurf) == (_pDstSurf) \
                     && ( ((_pSrcRect) && (_pDstRect) && !memcmp((_pSrcRect), (_pDstRect), sizeof (_pDstRect))) \
                             || ((_pSrcRect) == (_pDstRect)) \
-                            ) ) \
+                            )) ) \
             { \
-                vboxVDbgPrint((_str #_type ": skipping dump of the same rect for one surfcace\n")); \
+                vboxVDbgPrint((_str #_type ": skipping content dump of the same rect for one surfcace\n")); \
+                fFlags = VBOXVDBG_DUMP_TYPE_GET_FLOW_ONLY(fFlags); \
+            } \
+            RECT Rect, *pRect; \
+            if (_pSrcRect) \
+            { \
+                Rect = *((RECT*)(_pSrcRect)); \
+                pRect = &Rect; \
             } \
             else \
+                pRect = NULL; \
+            vboxVDbgDoDumpRcRect(_str __FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), pRect, "", \
+                        VBOXVDBG_DUMP_FLAGS_FOR_TYPE(_type) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
+            if (_pDstRect) \
             { \
-                vboxVDbgDoDumpRcRectByAlloc(_str __FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \
-                vboxVDbgDoDumpRcRectByAlloc(_str __FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \
-            } \
+                Rect = *((RECT*)(_pDstRect)); \
+                pRect = &Rect; \
+            } \
+            else \
+                pRect = NULL; \
+            vboxVDbgDoDumpRcRect(_str __FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), pRect, "", \
+                        VBOXVDBG_DUMP_FLAGS_FOR_TYPE(_type) | VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Shared)); \
         } \
     } while (0)
@@ -510,5 +564,5 @@
         if (VBOXVDBG_IS_DUMP_ALLOWED(RtSynch)) \
         { \
-            vboxVDbgDoDumpSurfRect("== "__FUNCTION__" Bb:\n", (_pBbSurf), NULL, "\n", true); \
+            vboxVDbgDoDumpRcRect("== "__FUNCTION__" Bb:\n", NULL, (_pBbSurf), NULL, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(RtSynch)); \
         } \
     } while (0)
@@ -517,5 +571,5 @@
         if (VBOXVDBG_IS_DUMP_ALLOWED(PresentEnter)) { \
             if (!(_pSwapchain)->fFlags.bRtReportingPresent) { \
-                vboxVDbgDoDumpBb("==>"__FUNCTION__" Bb:\n", (_pSwapchain)->pSwapChainIf, "\n"); \
+                vboxVDbgDoDumpBb("==>"__FUNCTION__" Bb:\n", (_pSwapchain)->pSwapChainIf, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(PresentEnter)); \
             } \
             else  { \
@@ -524,5 +578,5 @@
                 HRESULT hr = vboxWddmSwapchainSurfGet(_pDevice, _pSwapchain, pCurBb, &pSurf); \
                 Assert(hr == S_OK); \
-                vboxVDbgDoDumpSurf("== "__FUNCTION__" Bb:\n", pSurf, "\n"); \
+                vboxVDbgDoDumpRcRect("== "__FUNCTION__" Bb:\n", pCurBb, pSurf, NULL, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(PresentEnter)); \
                 pSurf->Release(); \
             } \
@@ -533,5 +587,5 @@
         if (VBOXVDBG_IS_DUMP_ALLOWED(PresentLeave)) { \
             if (!(_pSwapchain)->fFlags.bRtReportingPresent) { \
-                vboxVDbgDoDumpFb("<=="__FUNCTION__" Fb:\n", (_pSwapchain)->pSwapChainIf, "\n"); \
+                vboxVDbgDoDumpFb("<=="__FUNCTION__" Fb:\n", (_pSwapchain)->pSwapChainIf, "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(PresentLeave)); \
             } \
             else  { \
@@ -545,5 +599,6 @@
         if (VBOXVDBG_IS_DUMP_ALLOWED(Flush)) \
         { \
-            vboxVDbgDoDumpRt("== "__FUNCTION__": RenderTarget Dump\n", (_pDevice), "\n"); \
+            vboxVDbgDoDumpRt("== "__FUNCTION__": Rt: ", (_pDevice), "", \
+                VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Flush)); \
         }\
     } while (0)
@@ -554,5 +609,5 @@
                 ) \
         { \
-            vboxVDbgDoDumpLockSurfTex("== "__FUNCTION__": ", (_pData), "\n", VBOXVDBG_IS_DUMP_ALLOWED(Lock)); \
+            vboxVDbgDoDumpLockSurfTex("== "__FUNCTION__": ", (_pData), "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Lock)); \
         } \
     } while (0)
@@ -562,5 +617,5 @@
                 ) \
         { \
-            vboxVDbgDoDumpUnlockSurfTex("== "__FUNCTION__": ", (_pData), "\n", true); \
+            vboxVDbgDoDumpUnlockSurfTex("== "__FUNCTION__": ", (_pData), "", VBOXVDBG_DUMP_FLAGS_FOR_TYPE(Unlock)); \
         } \
     } while (0)
